diff --git a/plugins/spine/dist/SpineCanvasPlugin.js b/plugins/spine/dist/SpineCanvasPlugin.js index 2d42925ff..69fc852ef 100644 --- a/plugins/spine/dist/SpineCanvasPlugin.js +++ b/plugins/spine/dist/SpineCanvasPlugin.js @@ -12548,7 +12548,7 @@ var CONST = { * @type {string} * @since 3.0.0 */ - VERSION: '3.60.0-beta.20', + VERSION: '3.60.0', BlendModes: __webpack_require__(8351), @@ -14510,7 +14510,7 @@ module.exports = init(); /***/ }), /***/ 2131: -/***/ ((module) => { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -14518,9 +14518,13 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var GetFastValue = __webpack_require__(4597); + /** * Determines the video support of the browser running this Phaser Game instance. + * * These values are read-only and populated during the boot sequence of the game. + * * They are then referenced by internal game systems and are available for you to access * via `this.sys.game.device.video` from within any Scene. * @@ -14536,6 +14540,7 @@ module.exports = init(); * @property {boolean} ogg - Can this device play ogg video files? * @property {boolean} vp9 - Can this device play vp9 video files? * @property {boolean} webm - Can this device play webm video files? + * @property {function} getVideoURL - Returns the first video URL that can be played by this browser. */ var Video = { @@ -14545,7 +14550,8 @@ var Video = { m4v: false, ogg: false, vp9: false, - webm: false + webm: false, + hasRequestVideoFrame: false }; @@ -14602,6 +14608,55 @@ function init () // Nothing to do } + if (videoElement.parentNode) + { + videoElement.parentNode.removeChild(videoElement); + } + + Video.getVideoURL = function (urls) + { + if (!Array.isArray(urls)) + { + urls = [ urls ]; + } + + for (var i = 0; i < urls.length; i++) + { + var url = GetFastValue(urls[i], 'url', urls[i]); + + if (url.indexOf('blob:') === 0) + { + return { + url: url, + type: '' + }; + } + + var videoType; + + if (url.indexOf('data:') === 0) + { + videoType = url.split(',')[0].match(/\/(.*?);/); + } + else + { + videoType = url.match(/\.([a-zA-Z0-9]+)($|\?)/); + } + + videoType = GetFastValue(urls[i], 'type', (videoType) ? videoType[1] : '').toLowerCase(); + + if (Video[videoType]) + { + return { + url: url, + type: videoType + }; + } + } + + return null; + }; + return Video; } @@ -15770,8 +15825,8 @@ var GameObjectFactory = __webpack_require__(3649); * * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means - * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects - * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the + * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects. + * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the * corresponding pixel in the mask. * * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, @@ -16304,7 +16359,7 @@ module.exports = GeometryMask; /***/ }), -/***/ 8325: +/***/ 7340: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -16390,6 +16445,23 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Bloom FX Controller. + * + * This FX controller manages the bloom effect for a Game Object. + * + * Bloom is an effect used to reproduce an imaging artifact of real-world cameras. + * The effect produces fringes of light extending from the borders of bright areas in an image, + * contributing to the illusion of an extremely bright light overwhelming the + * camera or eye capturing the scene. + * + * A Bloom effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBloom(); + * sprite.postFX.addBloom(); + * ``` * * @class Bloom * @extends Phaser.FX.Controller @@ -16398,7 +16470,7 @@ var FX_CONST = __webpack_require__(1571); * @since 3.60.0 * * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. - * @param {number} [color] - The color of the Bloom, as a hex value. + * @param {number} [color=0xffffff] - The color of the Bloom, as a hex value. * @param {number} [offsetX=1] - The horizontal offset of the bloom effect. * @param {number} [offsetY=1] - The vertical offset of the bloom effect. * @param {number} [blurStrength=1] - The strength of the blur process of the bloom effect. @@ -16538,6 +16610,23 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Blur FX Controller. + * + * This FX controller manages the blur effect for a Game Object. + * + * A Gaussian blur is the result of blurring an image by a Gaussian function. It is a widely used effect, + * typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a + * smooth blur resembling that of viewing the image through a translucent screen, distinctly different + * from the bokeh effect produced by an out-of-focus lens or the shadow of an object under usual illumination. + * + * A Blur effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBlur(); + * sprite.postFX.addBlur(); + * ``` * * @class Blur * @extends Phaser.FX.Controller @@ -16700,6 +16789,27 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Bokeh FX Controller. + * + * This FX controller manages the bokeh effect for a Game Object. + * + * Bokeh refers to a visual effect that mimics the photographic technique of creating a shallow depth of field. + * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground + * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering + * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. + * + * This effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature + * effect by blurring everything except a small area of the image. This effect is achieved by blurring the + * top and bottom elements, while keeping the center area in focus. + * + * A Bokeh effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBokeh(); + * sprite.postFX.addBokeh(); + * ``` * * @class Bokeh * @extends Phaser.FX.Controller @@ -16734,13 +16844,77 @@ var Bokeh = new Class({ Controller.call(this, FX_CONST.BOKEH, gameObject); + /** + * The radius of the bokeh effect. + * + * This is a float value, where a radius of 0 will result in no effect being applied, + * and a radius of 1 will result in a strong bokeh. However, you can exceed this value + * for even stronger effects. + * + * @name Phaser.FX.Bokeh#radius + * @type {number} + * @since 3.60.0 + */ this.radius = radius; + + /** + * The amount, or strength, of the bokeh effect. Defaults to 1. + * + * @name Phaser.FX.Bokeh#amount + * @type {number} + * @since 3.60.0 + */ this.amount = amount; + + /** + * The color contrast, or brightness, of the bokeh effect. Defaults to 0.2. + * + * @name Phaser.FX.Bokeh#contrast + * @type {number} + * @since 3.60.0 + */ this.contrast = contrast; + /** + * Is this a Tilt Shift effect or a standard bokeh effect? + * + * @name Phaser.FX.Bokeh#isTiltShift + * @type {boolean} + * @since 3.60.0 + */ this.isTiltShift = isTiltShift; + + /** + * If a Tilt Shift effect this controls the strength of the blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#strength + * @type {number} + * @since 3.60.0 + */ this.strength = strength; + + /** + * If a Tilt Shift effect this controls the amount of horizontal blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#blurX + * @type {number} + * @since 3.60.0 + */ this.blurX = blurX; + + /** + * If a Tilt Shift effect this controls the amount of vertical blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#blurY + * @type {number} + * @since 3.60.0 + */ this.blurY = blurY; } @@ -16766,6 +16940,26 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Circle FX Controller. + * + * This FX controller manages the circle effect for a Game Object. + * + * This effect will draw a circle around the texture of the Game Object, effectively masking off + * any area outside of the circle without the need for an actual mask. You can control the thickness + * of the circle, the color of the circle and the color of the background, should the texture be + * transparent. You can also control the feathering applied to the circle, allowing for a harsh or soft edge. + * + * Please note that adding this effect to a Game Object will not change the input area or physics body of + * the Game Object, should it have one. + * + * A Circle effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addCircle(); + * sprite.postFX.addCircle(); + * ``` * * @class Circle * @extends Phaser.FX.Controller @@ -16775,7 +16969,7 @@ var FX_CONST = __webpack_require__(1571); * * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. * @param {number} [thickness=8] - The width of the circle around the texture, in pixels. - * @param {number} [color=16724914] - The color of the circular ring, given as a number value. + * @param {number} [color=0xfeedb6] - The color of the circular ring, given as a number value. * @param {number} [backgroundColor=0xff0000] - The color of the background, behind the texture, given as a number value. * @param {number} [scale=1] - The scale of the circle. The default scale is 1, which is a circle the full size of the underlying texture. * @param {number} [feather=0.005] - The amount of feathering to apply to the circle from the ring. @@ -16935,6 +17129,24 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The ColorMatrix FX Controller. + * + * This FX controller manages the color matrix effect for a Game Object. + * + * The color matrix effect is a visual technique that involves manipulating the colors of an image + * or scene using a mathematical matrix. This process can adjust hue, saturation, brightness, and contrast, + * allowing developers to create various stylistic appearances or mood settings within the game. + * Common applications include simulating different lighting conditions, applying color filters, + * or achieving a specific visual style. + * + * A ColorMatrix effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addColorMatrix(); + * sprite.postFX.addColorMatrix(); + * ``` * * @class ColorMatrix * @extends Phaser.Display.ColorMatrix @@ -17010,6 +17222,9 @@ var Class = __webpack_require__(7473); /** * @classdesc + * FX Controller is the base class that all built-in FX use. + * + * You should not normally create an instance of this class directly, but instead use one of the built-in FX that extend it. * * @class Controller * @memberof Phaser.FX @@ -17047,6 +17262,10 @@ var Controller = new Class({ * Toggle this boolean to enable or disable this effect, * without removing and adding it from the Game Object. * + * Only works for Pre FX. + * + * Post FX are always active. + * * @name Phaser.FX.Controller#active * @type {boolean} * @since 3.60.0 @@ -17054,6 +17273,25 @@ var Controller = new Class({ this.active = true; }, + /** + * Sets the active state of this FX Controller. + * + * A disabled FX Controller will not be updated. + * + * @method Phaser.FX.Controller#setActive + * @since 3.60.0 + * + * @param {boolean} value - `true` to enable this FX Controller, or `false` to disable it. + * + * @return {this} This FX Controller instance. + */ + setActive: function (value) + { + this.active = value; + + return this; + }, + /** * Destroys this FX Controller. * @@ -17088,6 +17326,24 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Displacement FX Controller. + * + * This FX controller manages the displacement effect for a Game Object. + * + * The displacement effect is a visual technique that alters the position of pixels in an image + * or texture based on the values of a displacement map. This effect is used to create the illusion + * of depth, surface irregularities, or distortion in otherwise flat elements. It can be applied to + * characters, objects, or backgrounds to enhance realism, convey movement, or achieve various + * stylistic appearances. + * + * A Displacement effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addDisplacement(); + * sprite.postFX.addDisplacement(); + * ``` * * @class Displacement * @extends Phaser.FX.Controller @@ -17096,9 +17352,9 @@ var FX_CONST = __webpack_require__(1571); * @since 3.60.0 * * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. - * @param {string} [key='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. - * @param {number} [x=0.005] - The amount of horizontal displacement to apply. - * @param {number} [y=0.005] - The amount of vertical displacement to apply. + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * @param {number} [x=0.005] - The amount of horizontal displacement to apply. A very small float number, such as 0.005. + * @param {number} [y=0.005] - The amount of vertical displacement to apply. A very small float number, such as 0.005. */ var Displacement = new Class({ @@ -17106,9 +17362,9 @@ var Displacement = new Class({ initialize: - function Displacement (gameObject, displacementTexture, x, y) + function Displacement (gameObject, texture, x, y) { - if (displacementTexture === undefined) { displacementTexture = '__WHITE'; } + if (texture === undefined) { texture = '__WHITE'; } if (x === undefined) { x = 0.005; } if (y === undefined) { y = 0.005; } @@ -17141,9 +17397,21 @@ var Displacement = new Class({ */ this.glTexture; - this.setTexture(displacementTexture); + this.setTexture(texture); }, + /** + * Sets the Texture to be used for the displacement effect. + * + * You can only use a whole texture, not a frame from a texture atlas or sprite sheet. + * + * @method Phaser.GameObjects.Components.FX#setTexture + * @since 3.60.0 + * + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * + * @return {this} This FX Controller. + */ setTexture: function (texture) { var phaserTexture = this.gameObject.scene.sys.textures.getFrame(texture); @@ -17152,6 +17420,8 @@ var Displacement = new Class({ { this.glTexture = phaserTexture.glTexture; } + + return this; } }); @@ -17180,10 +17450,10 @@ var FX_CONST = __webpack_require__(1571); * * This FX controller manages the glow effect for a Game Object. * - * A glow effect allows you to apply a soft, blurred 'glow' around either the outside, - * inside, or both of a Game Object. The color and strength of the glow can be modified. - * - * You can modify most of its properties in real-time to adjust the visual effect. + * The glow effect is a visual technique that creates a soft, luminous halo around game objects, + * characters, or UI elements. This effect is used to emphasize importance, enhance visual appeal, + * or convey a sense of energy, magic, or otherworldly presence. The effect can also be set on + * the inside of the Game Object. The color and strength of the glow can be modified. * * A Glow effect is added to a Game Object via the FX component: * @@ -17311,6 +17581,23 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Gradient FX Controller. + * + * This FX controller manages the gradient effect for a Game Object. + * + * The gradient overlay effect is a visual technique where a smooth color transition is applied over Game Objects, + * such as sprites or UI components. This effect is used to enhance visual appeal, emphasize depth, or create + * stylistic and atmospheric variations. It can also be utilized to convey information, such as representing + * progress or health status through color changes. + * + * A Gradient effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addGradient(); + * sprite.postFX.addGradient(); + * ``` * * @class Gradient * @extends Phaser.FX.Controller @@ -17507,6 +17794,23 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Pixelate FX Controller. + * + * This FX controller manages the pixelate effect for a Game Object. + * + * The pixelate effect is a visual technique that deliberately reduces the resolution or detail of an image, + * creating a blocky or mosaic appearance composed of large, visible pixels. This effect can be used for stylistic + * purposes, as a homage to retro gaming, or as a means to obscure certain elements within the game, such as + * during a transition or to censor specific content. + * + * A Pixelate effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addPixelate(); + * sprite.postFX.addPixelate(); + * ``` * * @class Pixelate * @extends Phaser.FX.Controller @@ -17561,6 +17865,22 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Shadow FX Controller. + * + * This FX controller manages the shadow effect for a Game Object. + * + * The shadow effect is a visual technique used to create the illusion of depth and realism by adding darker, + * offset silhouettes or shapes beneath game objects, characters, or environments. These simulated shadows + * help to enhance the visual appeal and immersion, making the 2D game world appear more dynamic and three-dimensional. + * + * A Shadow effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addShadow(); + * sprite.postFX.addShadow(); + * ``` * * @class Shadow * @extends Phaser.FX.Controller @@ -17714,6 +18034,23 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Shine FX Controller. + * + * This FX controller manages the shift effect for a Game Object. + * + * The shine effect is a visual technique that simulates the appearance of reflective + * or glossy surfaces by passing a light beam across a Game Object. This effect is used to + * enhance visual appeal, emphasize certain features, and create a sense of depth or + * material properties. + * + * A Shine effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addShine(); + * sprite.postFX.addShine(); + * ``` * * @class Shine * @extends Phaser.FX.Controller @@ -17801,6 +18138,22 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Vignette FX Controller. + * + * This FX controller manages the vignette effect for a Game Object. + * + * The vignette effect is a visual technique where the edges of the screen, or a Game Object, gradually darken or blur, + * creating a frame-like appearance. This effect is used to draw the player's focus towards the central action or subject, + * enhance immersion, and provide a cinematic or artistic quality to the game's visuals. + * + * A Vignette effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addVignette(); + * sprite.postFX.addVignette(); + * ``` * * @class Vignette * @extends Phaser.FX.Controller @@ -17888,6 +18241,34 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Wipe FX Controller. + * + * This FX controller manages the wipe effect for a Game Object. + * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * + * A Wipe effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addWipe(); + * sprite.postFX.addWipe(); + * sprite.preFX.addReveal(); + * sprite.postFX.addReveal(); + * ``` * * @class Wipe * @extends Phaser.FX.Controller @@ -17916,14 +18297,6 @@ var Wipe = new Class({ Controller.call(this, FX_CONST.WIPE, gameObject); - // left to right: direction 0, axis 0 - // right to left: direction 1, axis 0 - // top to bottom: direction 1, axis 1 - // bottom to top: direction 1, axis 0 - // wipe: reveal 0 - // reveal: reveal 1 - // progress: 0 - 1 - /** * The progress of the Wipe effect. This value is normalized to the range 0 to 1. * @@ -18155,7 +18528,7 @@ var FX_CONST = __webpack_require__(1571); var FX = { - Barrel: __webpack_require__(8325), + Barrel: __webpack_require__(7340), Controller: __webpack_require__(6128), Bloom: __webpack_require__(5170), Blur: __webpack_require__(4199), @@ -20386,6 +20759,57 @@ var SpliceOne = __webpack_require__(8935); /** * @classdesc + * The FX Component features a set of methods used for applying a range of special built-in effects to a Game Object. + * + * The effects include the following: + * + * * Barrel Distortion + * * Bloom + * * Blur + * * Bokeh / Tilt Shift + * * Circle Outline + * * Color Matrix + * * Glow + * * Displacement + * * Gradient + * * Pixelate + * * Shine + * * Shadow + * * Vignette + * * Wipe / Reveal + * + * All Game Objects support Post FX. These are effects applied after the Game Object has been rendered. + * + * Texture-based Game Objects also support Pre FX, including: + * + * * Image + * * Sprite + * * TileSprite + * * Text + * * RenderTexture + * * Video + * + * And any Game Object that extends the above. + * + * The difference between Pre FX and Post FX are that all Post FX take place in a canvas (renderer) sized frame buffer, + * after the Game Object has been rendered. Pre FX, however, take place in a texture sized frame buffer, which is sized + * based on the Game Object itself. The end result is then composited back to the main game canvas. For intensive effects, + * such as blur, bloom or glow, which can require many iterations, this is a much more efficient way to apply the effect, + * as only it only has to work on a Game Object sized texture and not all pixels in the canvas. + * + * In short, you should always try and use a Pre FX if you can. + * + * Due to the way that FX work they can be stacked-up. For example, you can apply a blur to a Game Object, then apply + * a bloom effect to the same Game Object. The bloom effect will be applied to the blurred texture, not the original. + * Keep the order in mind when stacking effects. + * + * All effects are WebGL only and do not have canvas counterparts. + * + * As you can appreciate, some effects are more expensive than others. For example, a bloom effect is going to be more + * expensive than a simple color matrix effect, so please consider using them wisely and performance test your target + * platforms early on in production. + * + * This component is created automatically by the `PostPipeline` class and does not need to be instantiated directly. * * @class FX * @memberof Phaser.GameObjects.Components @@ -20395,7 +20819,6 @@ var SpliceOne = __webpack_require__(8935); * * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that owns this FX Component. * @param {boolean} isPost - Is this a Pre or Post FX Component? -+- * */ var FX = new Class({ @@ -20408,6 +20831,7 @@ var FX = new Class({ * * @name Phaser.GameObjects.Components.FX#gameObject * @type {Phaser.GameObjects.GameObject} + * @readonly * @since 3.60.0 */ this.gameObject = gameObject; @@ -20417,6 +20841,7 @@ var FX = new Class({ * * @name Phaser.GameObjects.Components.FX#isPost * @type {boolean} + * @readonly * @since 3.60.0 */ this.isPost = isPost; @@ -20424,7 +20849,8 @@ var FX = new Class({ /** * Has this FX Component been enabled? * - * You should treat this property as read-only. + * You should treat this property as read-only, although it is toggled + * automaticaly during internal use. * * @name Phaser.GameObjects.Components.FX#enabled * @type {boolean} @@ -20433,8 +20859,11 @@ var FX = new Class({ this.enabled = false; /** - * An array containing all of the FX Controllers that - * have been added to this FX Component. + * An array containing all of the Pre FX Controllers that + * have been added to this FX Component. They are processed in + * the order they are added. + * + * This array is empty if this is a Post FX Component. * * @name Phaser.GameObjects.Components.FX#list * @type {Phaser.FX.Controller[]} @@ -20444,13 +20873,15 @@ var FX = new Class({ /** * The amount of extra padding to be applied to this Game Object - * when it is being rendered by a PreFX or SpriteFX Pipeline. + * when it is being rendered by a PreFX Pipeline. * * Lots of FX require additional spacing added to the texture the * Game Object uses, for example a glow or shadow effect, and this * method allows you to control how much extra padding is included * in addition to the texture size. * + * You do not need to set this if you're only using Post FX. + * * @name Phaser.GameObjects.Components.FX#padding * @type {number} * @default 0 @@ -20468,6 +20899,8 @@ var FX = new Class({ * method allows you to control how much extra padding is included * in addition to the texture size. * + * You do not need to set this if you're only using Post FX. + * * @method Phaser.GameObjects.Components.FX#setPadding * @webglOnly * @since 3.60.0 @@ -20524,6 +20957,8 @@ var FX = new Class({ * * You can check the `enabled` property to see if the Game Object is already enabled, or not. * + * This only applies to Pre FX. Post FX are always enabled. + * * @method Phaser.GameObjects.Components.FX#enable * @since 3.60.0 * @@ -20531,6 +20966,11 @@ var FX = new Class({ */ enable: function (padding) { + if (this.isPost) + { + return; + } + var renderer = this.gameObject.scene.sys.renderer; if (renderer && renderer.pipelines) @@ -20554,46 +20994,97 @@ var FX = new Class({ * Destroys and removes all FX Controllers that are part of this FX Component, * then disables it. * + * If this is a Pre FX Component it will only remove Pre FX. + * If this is a Post FX Component it will only remove Post FX. + * + * To remove both at once use the `GameObject.clearFX` method instead. + * * @method Phaser.GameObjects.Components.FX#clear * @since 3.60.0 + * + * @return {this} This Game Object instance. */ clear: function () { - var list = this.list; - - for (var i = 0; i < list.length; i++) + if (this.isPost) { - list[i].destroy(); + this.gameObject.resetPostPipeline(true); + } + else + { + var list = this.list; + + for (var i = 0; i < list.length; i++) + { + list[i].destroy(); + } + + this.list = []; } - this.list = []; - this.enabled = false; + + return this.gameObject; }, /** - * Searches for the given FX Controler within this FX Component. + * Searches for the given FX Controller within this FX Component. * - * If found, the controller is removed from this compoent and then destroyed. + * If found, the controller is removed from this component and then destroyed. * * @method Phaser.GameObjects.Components.FX#remove * @since 3.60.0 * + * @generic {Phaser.FX.Controller} T + * @genericUse {T} - [fx] + * * @param {Phaser.FX.Controller} fx - The FX Controller to remove from this FX Component. + * + * @return {this} This Game Object instance. */ remove: function (fx) { - var list = this.list; + var i; - for (var i = 0; i < list.length; i++) + if (this.isPost) { - if (list[i] === fx) - { - SpliceOne(list, i); + var pipelines = this.gameObject.getPostPipeline(String(fx.type)); - fx.destroy(); + if (!Array.isArray(pipelines)) + { + pipelines = [ pipelines ]; + } + + for (i = 0; i < pipelines.length; i++) + { + var pipeline = pipelines[i]; + + if (pipeline.controller === fx) + { + this.gameObject.removePostPipeline(pipeline); + + fx.destroy(); + + break; + } } } + else + { + var list = this.list; + + for (i = 0; i < list.length; i++) + { + if (list[i] === fx) + { + SpliceOne(list, i); + + fx.destroy(); + } + } + } + + return this.gameObject; }, /** @@ -20602,20 +21093,25 @@ var FX = new Class({ * This will reset the pipeline on the Game Object that owns this component back to its * default and flag this component as disabled. * - * You can re-enable it again by calling `enable`. + * You can re-enable it again by calling `enable` for Pre FX or by adding an FX for Post FX. * * Optionally, set `clear` to destroy all current FX Controllers. * * @method Phaser.GameObjects.Components.FX#disable * @since 3.60.0 * - * @param {boolean} [clear=false] - Destroy and remove all FX Controllers that are part of this FX Component. + * @param {boolean} [clear=false] - Destroy and remove all FX Controllers that are part of this component. + * + * @return {this} This Game Object instance. */ disable: function (clear) { if (clear === undefined) { clear = false; } - this.gameObject.resetPipeline(); + if (!this.isPost) + { + this.gameObject.resetPipeline(); + } this.enabled = false; @@ -20623,6 +21119,8 @@ var FX = new Class({ { this.clear(); } + + return this.gameObject; }, /** @@ -20635,6 +21133,9 @@ var FX = new Class({ * @method Phaser.GameObjects.Components.FX#add * @since 3.60.0 * + * @generic {Phaser.FX.Controller} T + * @genericUse {T} - [fx] + * * @param {Phaser.FX.Controller} fx - The FX Controller to add to this FX Component. * @param {object} [config] - Optional configuration object that is passed to the pipeline during instantiation. * @@ -20678,6 +21179,11 @@ var FX = new Class({ /** * Adds a Glow effect. * + * The glow effect is a visual technique that creates a soft, luminous halo around game objects, + * characters, or UI elements. This effect is used to emphasize importance, enhance visual appeal, + * or convey a sense of energy, magic, or otherworldly presence. The effect can also be set on + * the inside of the Game Object. The color and strength of the glow can be modified. + * * @method Phaser.GameObjects.Components.FX#addGlow * @since 3.60.0 * @@ -20698,6 +21204,10 @@ var FX = new Class({ /** * Adds a Shadow effect. * + * The shadow effect is a visual technique used to create the illusion of depth and realism by adding darker, + * offset silhouettes or shapes beneath game objects, characters, or environments. These simulated shadows + * help to enhance the visual appeal and immersion, making the 2D game world appear more dynamic and three-dimensional. + * * @method Phaser.GameObjects.Components.FX#addShadow * @since 3.60.0 * @@ -20719,6 +21229,11 @@ var FX = new Class({ /** * Adds a Pixelate effect. * + * The pixelate effect is a visual technique that deliberately reduces the resolution or detail of an image, + * creating a blocky or mosaic appearance composed of large, visible pixels. This effect can be used for stylistic + * purposes, as a homage to retro gaming, or as a means to obscure certain elements within the game, such as + * during a transition or to censor specific content. + * * @method Phaser.GameObjects.Components.FX#addPixelate * @since 3.60.0 * @@ -20734,6 +21249,10 @@ var FX = new Class({ /** * Adds a Vignette effect. * + * The vignette effect is a visual technique where the edges of the screen, or a Game Object, gradually darken or blur, + * creating a frame-like appearance. This effect is used to draw the player's focus towards the central action or subject, + * enhance immersion, and provide a cinematic or artistic quality to the game's visuals. + * * @method Phaser.GameObjects.Components.FX#addVignette * @since 3.60.0 * @@ -20752,6 +21271,11 @@ var FX = new Class({ /** * Adds a Shine effect. * + * The shine effect is a visual technique that simulates the appearance of reflective + * or glossy surfaces by passing a light beam across a Game Object. This effect is used to + * enhance visual appeal, emphasize certain features, and create a sense of depth or + * material properties. + * * @method Phaser.GameObjects.Components.FX#addShine * @since 3.60.0 * @@ -20770,6 +21294,11 @@ var FX = new Class({ /** * Adds a Blur effect. * + * A Gaussian blur is the result of blurring an image by a Gaussian function. It is a widely used effect, + * typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a + * smooth blur resembling that of viewing the image through a translucent screen, distinctly different + * from the bokeh effect produced by an out-of-focus lens or the shadow of an object under usual illumination. + * * @method Phaser.GameObjects.Components.FX#addBlur * @since 3.60.0 * @@ -20790,6 +21319,11 @@ var FX = new Class({ /** * Adds a Gradient effect. * + * The gradient overlay effect is a visual technique where a smooth color transition is applied over Game Objects, + * such as sprites or UI components. This effect is used to enhance visual appeal, emphasize depth, or create + * stylistic and atmospheric variations. It can also be utilized to convey information, such as representing + * progress or health status through color changes. + * * @method Phaser.GameObjects.Components.FX#addGradient * @since 3.60.0 * @@ -20812,6 +21346,11 @@ var FX = new Class({ /** * Adds a Bloom effect. * + * Bloom is an effect used to reproduce an imaging artifact of real-world cameras. + * The effect produces fringes of light extending from the borders of bright areas in an image, + * contributing to the illusion of an extremely bright light overwhelming the + * camera or eye capturing the scene. + * * @method Phaser.GameObjects.Components.FX#addBloom * @since 3.60.0 * @@ -20832,6 +21371,12 @@ var FX = new Class({ /** * Adds a ColorMatrix effect. * + * The color matrix effect is a visual technique that involves manipulating the colors of an image + * or scene using a mathematical matrix. This process can adjust hue, saturation, brightness, and contrast, + * allowing developers to create various stylistic appearances or mood settings within the game. + * Common applications include simulating different lighting conditions, applying color filters, + * or achieving a specific visual style. + * * @method Phaser.GameObjects.Components.FX#addColorMatrix * @since 3.60.0 * @@ -20845,11 +21390,19 @@ var FX = new Class({ /** * Adds a Circle effect. * + * This effect will draw a circle around the texture of the Game Object, effectively masking off + * any area outside of the circle without the need for an actual mask. You can control the thickness + * of the circle, the color of the circle and the color of the background, should the texture be + * transparent. You can also control the feathering applied to the circle, allowing for a harsh or soft edge. + * + * Please note that adding this effect to a Game Object will not change the input area or physics body of + * the Game Object, should it have one. + * * @method Phaser.GameObjects.Components.FX#addCircle * @since 3.60.0 * * @param {number} [thickness=8] - The width of the circle around the texture, in pixels. - * @param {number} [color=16724914] - The color of the circular ring, given as a number value. + * @param {number} [color=0xfeedb6] - The color of the circular ring, given as a number value. * @param {number} [backgroundColor=0xff0000] - The color of the background, behind the texture, given as a number value. * @param {number} [scale=1] - The scale of the circle. The default scale is 1, which is a circle the full size of the underlying texture. * @param {number} [feather=0.005] - The amount of feathering to apply to the circle from the ring. @@ -20864,6 +21417,9 @@ var FX = new Class({ /** * Adds a Barrel effect. * + * A barrel effect allows you to apply either a 'pinch' or 'expand' distortion to + * a Game Object. The amount of the effect can be modified in real-time. + * * @method Phaser.GameObjects.Components.FX#addBarrel * @since 3.60.0 * @@ -20879,23 +21435,43 @@ var FX = new Class({ /** * Adds a Displacement effect. * + * The displacement effect is a visual technique that alters the position of pixels in an image + * or texture based on the values of a displacement map. This effect is used to create the illusion + * of depth, surface irregularities, or distortion in otherwise flat elements. It can be applied to + * characters, objects, or backgrounds to enhance realism, convey movement, or achieve various + * stylistic appearances. + * * @method Phaser.GameObjects.Components.FX#addDisplacement * @since 3.60.0 * - * @param {string} [key='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. - * @param {number} [x=0.005] - The amount of horizontal displacement to apply. - * @param {number} [y=0.005] - The amount of vertical displacement to apply. + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * @param {number} [x=0.005] - The amount of horizontal displacement to apply. A very small float number, such as 0.005. + * @param {number} [y=0.005] - The amount of vertical displacement to apply. A very small float number, such as 0.005. * * @return {Phaser.FX.Displacement} The Displacement FX Controller. */ - addDisplacement: function (displacementTexture, x, y) + addDisplacement: function (texture, x, y) { - return this.add(new Effects.Displacement(this.gameObject, displacementTexture, x, y)); + return this.add(new Effects.Displacement(this.gameObject, texture, x, y)); }, /** * Adds a Wipe effect. * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * * @method Phaser.GameObjects.Components.FX#addWipe * @since 3.60.0 * @@ -20913,6 +21489,20 @@ var FX = new Class({ /** * Adds a Reveal Wipe effect. * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * * @method Phaser.GameObjects.Components.FX#addReveal * @since 3.60.0 * @@ -20930,6 +21520,13 @@ var FX = new Class({ /** * Adds a Bokeh effect. * + * Bokeh refers to a visual effect that mimics the photographic technique of creating a shallow depth of field. + * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground + * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering + * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. + * + * See also Tilt Shift. + * * @method Phaser.GameObjects.Components.FX#addBokeh * @since 3.60.0 * @@ -20945,7 +21542,13 @@ var FX = new Class({ }, /** - * Adds a TiltShift effect. + * Adds a Tilt Shift effect. + * + * This Bokeh effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature + * effect by blurring everything except a small area of the image. This effect is achieved by blurring the + * top and bottom elements, while keeping the center area in focus. + * + * See also Bokeh. * * @method Phaser.GameObjects.Components.FX#addTiltShift * @since 3.60.0 @@ -20953,9 +21556,9 @@ var FX = new Class({ * @param {number} [radius=0.5] - The radius of the bokeh effect. * @param {number} [amount=1] - The amount of the bokeh effect. * @param {number} [contrast=0.2] - The color contrast of the bokeh effect. - * @param {number} [blurX=1] - If Tilt Shift, the amount of horizontal blur. - * @param {number} [blurY=1] - If Tilt Shift, the amount of vertical blur. - * @param {number} [strength=1] - If Tilt Shift, the strength of the blur. + * @param {number} [blurX=1] - The amount of horizontal blur. + * @param {number} [blurY=1] - The amount of vertical blur. + * @param {number} [strength=1] - The strength of the blur. * * @return {Phaser.FX.Bokeh} The Bokeh TiltShift FX Controller. */ @@ -21181,12 +21784,12 @@ var GetBounds = { * @private * @since 3.18.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} output - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} output - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ prepareBoundsOutput: function (output, includeParent) { @@ -21209,40 +21812,45 @@ var GetBounds = { /** * Gets the center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getCenter * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ - getCenter: function (output) + getCenter: function (output, includeParent) { if (output === undefined) { output = new Vector2(); } output.x = this.x - (this.displayWidth * this.originX) + (this.displayWidth / 2); output.y = this.y - (this.displayHeight * this.originY) + (this.displayHeight / 2); - return output; + return this.prepareBoundsOutput(output, includeParent); }, /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getTopLeft * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getTopLeft: function (output, includeParent) { @@ -21256,17 +21864,19 @@ var GetBounds = { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getTopCenter * @since 3.18.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getTopCenter: function (output, includeParent) { @@ -21280,17 +21890,19 @@ var GetBounds = { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getTopRight * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getTopRight: function (output, includeParent) { @@ -21304,17 +21916,19 @@ var GetBounds = { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getLeftCenter * @since 3.18.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getLeftCenter: function (output, includeParent) { @@ -21328,17 +21942,19 @@ var GetBounds = { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getRightCenter * @since 3.18.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getRightCenter: function (output, includeParent) { @@ -21352,17 +21968,19 @@ var GetBounds = { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getBottomLeft * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getBottomLeft: function (output, includeParent) { @@ -21376,17 +21994,19 @@ var GetBounds = { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getBottomCenter * @since 3.18.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getBottomCenter: function (output, includeParent) { @@ -21400,17 +22020,19 @@ var GetBounds = { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getBottomRight * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getBottomRight: function (output, includeParent) { @@ -21424,6 +22046,7 @@ var GetBounds = { /** * Gets the bounds of this Game Object, regardless of origin. + * * The values are stored and returned in a Rectangle, or Rectangle-like, object. * * @method Phaser.GameObjects.Components.GetBounds#getBounds @@ -22619,7 +23242,7 @@ var PostPipeline = { * Please see the FX Class for more details and available methods. * * @name Phaser.GameObjects.Components.PostPipeline#preFX - * @type {Phaser.GameObjects.Components.FX} + * @type {?Phaser.GameObjects.Components.FX} * @webglOnly * @since 3.60.0 */ @@ -22641,6 +23264,8 @@ var PostPipeline = { * * Please see the FX Class for more details and available methods. * + * This property is always `null` until the `initPostPipeline` method is called. + * * @name Phaser.GameObjects.Components.PostPipeline#postFX * @type {Phaser.GameObjects.Components.FX} * @webglOnly @@ -22849,6 +23474,8 @@ var PostPipeline = { */ removePostPipeline: function (pipeline) { + var isString = (typeof pipeline === 'string'); + var pipelines = this.postPipelines; for (var i = pipelines.length - 1; i >= 0; i--) @@ -22856,8 +23483,8 @@ var PostPipeline = { var instance = pipelines[i]; if ( - (typeof pipeline === 'string' && instance.name === pipeline) || - (typeof pipeline !== 'string' && instance instanceof pipeline)) + (isString && instance.name === pipeline) || + (!isString && instance === pipeline)) { instance.destroy(); @@ -22867,6 +23494,34 @@ var PostPipeline = { this.hasPostPipeline = (this.postPipelines.length > 0); + return this; + }, + + /** + * Removes all Pre and Post FX Controllers from this Game Object. + * + * If you wish to remove a single controller, use the `preFX.remove(fx)` or `postFX.remove(fx)` methods instead. + * + * If you wish to clear a single controller, use the `preFX.clear()` or `postFX.clear()` methods instead. + * + * @method Phaser.GameObjects.Components.PostPipeline#clearFX + * @webglOnly + * @since 3.60.0 + * + * @return {this} This Game Object. + */ + clearFX: function () + { + if (this.preFX) + { + this.preFX.clear(); + } + + if (this.postFX) + { + this.postFX.clear(); + } + return this; } @@ -26106,28 +26761,19 @@ var Container = new Class({ { var entry = children[i]; - if (entry.getTextBounds) - { - var textBounds = entry.getTextBounds().global; - tempRect.setTo(textBounds.x, textBounds.y, textBounds.width, textBounds.height); - } - else if (entry.getBounds) + if (entry.getBounds) { entry.getBounds(tempRect); - } - else - { - continue; - } - if (!hasSetFirst) - { - output.setTo(tempRect.x, tempRect.y, tempRect.width, tempRect.height); - hasSetFirst = true; - } - else - { - Union(tempRect, output, output); + if (!hasSetFirst) + { + output.setTo(tempRect.x, tempRect.y, tempRect.width, tempRect.height); + hasSetFirst = true; + } + else + { + Union(tempRect, output, output); + } } } } @@ -27480,11 +28126,43 @@ module.exports = 'created'; * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. - * @param {Event} event - The native DOM event the browser raised during playback. + * @param {DOMException|string} event - The native DOM event the browser raised during playback. */ module.exports = 'error'; +/***/ }), + +/***/ 6231: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Locked Event. + * + * This event is dispatched when a Video was attempted to be played, but the browser prevented it + * from doing so due to the Media Engagement Interaction policy. + * + * If you get this event you will need to wait for the user to interact with the browser before + * the video will play. This is a browser security measure to prevent autoplaying videos with + * audio. An interaction includes a mouse click, a touch, or a key press. + * + * Listen for it from a Video Game Object instance using `Video.on('locked', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_LOCKED + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. + */ +module.exports = 'locked'; + + /***/ }), /***/ 5241: @@ -27519,6 +28197,35 @@ module.exports = 'error'; module.exports = 'loop'; +/***/ }), + +/***/ 8325: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Playing Event. + * + * The playing event is fired after playback is first started, + * and whenever it is restarted. For example it is fired when playback + * resumes after having been paused or delayed due to lack of data. + * + * Listen for it from a Video Game Object instance using `Video.on('playing', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_PLAYING + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. + */ +module.exports = 'playing'; + + /***/ }), /***/ 3356: @@ -27604,6 +28311,46 @@ module.exports = 'seeked'; module.exports = 'seeking'; +/***/ }), + +/***/ 7111: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Stalled Event. + * + * This event is dispatched by a Video Game Object when the video playback stalls. + * + * This can happen if the video is buffering. + * + * If will fire for any of the following native DOM events: + * + * `stalled` + * `suspend` + * `waiting` + * + * Listen for it from a Video Game Object instance using `Video.on('stalled', listener)`. + * + * Note that being stalled isn't always a negative thing. A video can be stalled if it + * has downloaded enough data in to its buffer to not need to download any more until + * the current batch of frames have rendered. + * + * @event Phaser.GameObjects.Events#VIDEO_STALLED + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. + * @param {Event} event - The native DOM event the browser raised during playback. + */ +module.exports = 'stalled'; + + /***/ }), /***/ 8118: @@ -27634,7 +28381,7 @@ module.exports = 'stop'; /***/ }), -/***/ 5529: +/***/ 9184: /***/ ((module) => { /** @@ -27644,20 +28391,25 @@ module.exports = 'stop'; */ /** - * The Video Game Object Timeout Event. + * The Video Game Object Texture Ready Event. * - * This event is dispatched when a Video has exhausted its allocated time while trying to connect to a video - * source to start playback. + * This event is dispatched by a Video Game Object when it has finished creating its texture. * - * Listen for it from a Video Game Object instance using `Video.on('timeout', listener)`. + * This happens when the video has finished loading enough data for its first frame. * - * @event Phaser.GameObjects.Events#VIDEO_TIMEOUT + * If you wish to use the Video texture elsewhere in your game, such as as a Sprite texture, + * then you should listen for this event first, before creating the Sprites that use it. + * + * Listen for it from a Video Game Object instance using `Video.on('textureready', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_TEXTURE * @type {string} - * @since 3.20.0 + * @since 3.60.0 * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which timed out. + * @param {Phaser.GameObjects.Video} video - The Video Game Object that emitted the event. + * @param {Phaser.Textures.Texture} texture - The Texture that was created. */ -module.exports = 'timeout'; +module.exports = 'textureready'; /***/ }), @@ -27688,6 +28440,36 @@ module.exports = 'timeout'; module.exports = 'unlocked'; +/***/ }), + +/***/ 857: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Unsupported Event. + * + * This event is dispatched by a Video Game Object if the media source + * (which may be specified as a MediaStream, MediaSource, Blob, or File, + * for example) doesn't represent a supported media format. + * + * Listen for it from a Video Game Object instance using `Video.on('unsupported', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_UNSUPPORTED + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. + * @param {DOMException|string} event - The native DOM event the browser raised during playback. + */ +module.exports = 'unsupported'; + + /***/ }), /***/ 3389: @@ -27711,13 +28493,17 @@ module.exports = { VIDEO_COMPLETE: __webpack_require__(3420), VIDEO_CREATED: __webpack_require__(601), VIDEO_ERROR: __webpack_require__(7919), + VIDEO_LOCKED: __webpack_require__(6231), VIDEO_LOOP: __webpack_require__(5241), VIDEO_PLAY: __webpack_require__(3356), + VIDEO_PLAYING: __webpack_require__(8325), VIDEO_SEEKED: __webpack_require__(7513), VIDEO_SEEKING: __webpack_require__(5788), + VIDEO_STALLED: __webpack_require__(7111), VIDEO_STOP: __webpack_require__(8118), - VIDEO_TIMEOUT: __webpack_require__(5529), - VIDEO_UNLOCKED: __webpack_require__(4287) + VIDEO_TEXTURE: __webpack_require__(9184), + VIDEO_UNLOCKED: __webpack_require__(4287), + VIDEO_UNSUPPORTED: __webpack_require__(857) }; @@ -39845,7 +40631,7 @@ var MATH_CONST = { /** * The value of PI * 0.5. * - * Yes, we undertstand that this should actually be PI * 2, but + * Yes, we understand that this should actually be PI * 2, but * it has been like this for so long we can't change it now. * If you need PI * 2, use the PI2 constant instead. * diff --git a/plugins/spine/dist/SpineCanvasPlugin.min.js b/plugins/spine/dist/SpineCanvasPlugin.min.js index 95a7f22b4..017d45530 100644 --- a/plugins/spine/dist/SpineCanvasPlugin.min.js +++ b/plugins/spine/dist/SpineCanvasPlugin.min.js @@ -1 +1 @@ -(()=>{var t={4399:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,s||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,a=new Array(s);r{(function(){var e,i,n,r=this&&this.__extends||(e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},e(t,i)},function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)});!function(t){var e,i,n,s=function(){function t(t,e,i){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var n=0;n0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l>>1;;){if(t[(s+1)*i]<=e?n=s+1:r=s,n==r)return(n+1)*i;s=n+r>>>1}},t.linearSearch=function(t,e,i){for(var n=0,r=t.length-i;n<=r;n+=i)if(t[n]>e)return n;return-1},t}();t.Animation=s,function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(e=t.MixBlend||(t.MixBlend={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(i=t.MixDirection||(t.MixDirection={})),function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"}(n=t.TimelineType||(t.TimelineType={}));var a=function(){function e(i){if(i<=0)throw new Error("frameCount must be > 0: "+i);this.curves=t.Utils.newFloatArray((i-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var i=t*e.BEZIER_SIZE;if(i==this.curves.length)return e.LINEAR;var n=this.curves[i];return n==e.LINEAR?e.LINEAR:n==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,i,n,r,s){var a=.03*(2*-i+r),o=.03*(2*-n+s),h=.006*(3*(i-r)+1),l=.006*(3*(n-s)+1),u=2*a+h,c=2*o+l,d=.3*i+a+.16666667*h,f=.3*n+o+.16666667*l,p=t*e.BEZIER_SIZE,v=this.curves;v[p++]=e.BEZIER;for(var g=d,m=f,y=p+e.BEZIER_SIZE-1;p=n){var u=void 0,c=void 0;return s==h?(u=0,c=0):(u=r[s-2],c=r[s-1]),c+(r[s+1]-c)*(n-u)/(o-u)}var d=r[s-1];return d+(1-d)*(n-o)/(1-o)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=a;var o=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e<<1),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.rotate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+a.ROTATION]=i},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(n=u[u.length-a.ENTRIES]){var f=u[u.length+a.PREV_ROTATION];switch(h){case e.setup:c.rotation=c.data.rotation+f*o;break;case e.first:case e.replace:f+=c.data.rotation-c.rotation,f-=360*(16384-(16384.499999999996-f/360|0));case e.add:c.rotation+=f*o}}else{var p=s.binarySearch(u,n,a.ENTRIES),v=u[p+a.PREV_ROTATION],g=u[p],m=this.getCurvePercent((p>>1)-1,1-(n-g)/(u[p+a.PREV_TIME]-g)),y=u[p+a.ROTATION]-v;switch(y=v+(y-360*(16384-(16384.499999999996-y/360|0)))*m,h){case e.setup:c.rotation=c.data.rotation+(y-360*(16384-(16384.499999999996-y/360|0)))*o;break;case e.first:case e.replace:y+=c.data.rotation-c.rotation;case e.add:c.rotation+=(y-360*(16384-(16384.499999999996-y/360|0)))*o}}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_ROTATION=-1,a.ROTATION=1,a}(a);t.RotateTimeline=o;var h=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.translate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,i,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.X]=i,this.frames[t+a.Y]=n},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_X],f=u[u.length+a.PREV_Y];else{var p=s.binarySearch(u,n,a.ENTRIES);d=u[p+a.PREV_X],f=u[p+a.PREV_Y];var v=u[p],g=this.getCurvePercent(p/a.ENTRIES-1,1-(n-v)/(u[p+a.PREV_TIME]-v));d+=(u[p+a.X]-d)*g,f+=(u[p+a.Y]-f)*g}switch(h){case e.setup:c.x=c.data.x+d*o,c.y=c.data.y+f*o;break;case e.first:case e.replace:c.x+=(c.data.x+d-c.x)*o,c.y+=(c.data.y+f-c.y)*o;break;case e.add:c.x+=d*o,c.y+=f*o}}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_X=-2,a.PREV_Y=-1,a.X=1,a.Y=2,a}(a);t.TranslateTimeline=h;var l=function(a){function o(t){return a.call(this,t)||this}return r(o,a),o.prototype.getPropertyId=function(){return(n.scale<<24)+this.boneIndex},o.prototype.apply=function(n,r,a,h,l,u,c){var d=this.frames,f=n.bones[this.boneIndex];if(f.active)if(a=d[d.length-o.ENTRIES])p=d[d.length+o.PREV_X]*f.data.scaleX,v=d[d.length+o.PREV_Y]*f.data.scaleY;else{var g=s.binarySearch(d,a,o.ENTRIES);p=d[g+o.PREV_X],v=d[g+o.PREV_Y];var m=d[g],y=this.getCurvePercent(g/o.ENTRIES-1,1-(a-m)/(d[g+o.PREV_TIME]-m));p=(p+(d[g+o.X]-p)*y)*f.data.scaleX,v=(v+(d[g+o.Y]-v)*y)*f.data.scaleY}if(1==l)u==e.add?(f.scaleX+=p-f.data.scaleX,f.scaleY+=v-f.data.scaleY):(f.scaleX=p,f.scaleY=v);else{var x=0,w=0;if(c==i.mixOut)switch(u){case e.setup:x=f.data.scaleX,w=f.data.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,f.scaleY=w+(Math.abs(v)*t.MathUtils.signum(w)-w)*l;break;case e.first:case e.replace:x=f.scaleX,w=f.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,f.scaleY=w+(Math.abs(v)*t.MathUtils.signum(w)-w)*l;break;case e.add:x=f.scaleX,w=f.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-f.data.scaleX)*l,f.scaleY=w+(Math.abs(v)*t.MathUtils.signum(w)-f.data.scaleY)*l}else switch(u){case e.setup:x=Math.abs(f.data.scaleX)*t.MathUtils.signum(p),w=Math.abs(f.data.scaleY)*t.MathUtils.signum(v),f.scaleX=x+(p-x)*l,f.scaleY=w+(v-w)*l;break;case e.first:case e.replace:x=Math.abs(f.scaleX)*t.MathUtils.signum(p),w=Math.abs(f.scaleY)*t.MathUtils.signum(v),f.scaleX=x+(p-x)*l,f.scaleY=w+(v-w)*l;break;case e.add:x=t.MathUtils.signum(p),w=t.MathUtils.signum(v),f.scaleX=Math.abs(f.scaleX)*x+(p-Math.abs(f.data.scaleX)*x)*l,f.scaleY=Math.abs(f.scaleY)*w+(v-Math.abs(f.data.scaleY)*w)*l}}}},o}(h);t.ScaleTimeline=l;var u=function(t){function i(e){return t.call(this,e)||this}return r(i,t),i.prototype.getPropertyId=function(){return(n.shear<<24)+this.boneIndex},i.prototype.apply=function(t,n,r,a,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(r=u[u.length-i.ENTRIES])d=u[u.length+i.PREV_X],f=u[u.length+i.PREV_Y];else{var p=s.binarySearch(u,r,i.ENTRIES);d=u[p+i.PREV_X],f=u[p+i.PREV_Y];var v=u[p],g=this.getCurvePercent(p/i.ENTRIES-1,1-(r-v)/(u[p+i.PREV_TIME]-v));d+=(u[p+i.X]-d)*g,f+=(u[p+i.Y]-f)*g}switch(h){case e.setup:c.shearX=c.data.shearX+d*o,c.shearY=c.data.shearY+f*o;break;case e.first:case e.replace:c.shearX+=(c.data.shearX+d-c.shearX)*o,c.shearY+=(c.data.shearY+f-c.shearY)*o;break;case e.add:c.shearX+=d*o,c.shearY+=f*o}}},i}(h);t.ShearTimeline=u;var c=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.color<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,i,n,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=i,this.frames[t+a.G]=n,this.frames[t+a.B]=r,this.frames[t+a.A]=s},a.prototype.apply=function(t,i,n,r,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(n=c[c.length-a.ENTRIES]){var y=c.length;p=c[y+a.PREV_R],v=c[y+a.PREV_G],g=c[y+a.PREV_B],m=c[y+a.PREV_A]}else{var x=s.binarySearch(c,n,a.ENTRIES);p=c[x+a.PREV_R],v=c[x+a.PREV_G],g=c[x+a.PREV_B],m=c[x+a.PREV_A];var w=c[x],M=this.getCurvePercent(x/a.ENTRIES-1,1-(n-w)/(c[x+a.PREV_TIME]-w));p+=(c[x+a.R]-p)*M,v+=(c[x+a.G]-v)*M,g+=(c[x+a.B]-g)*M,m+=(c[x+a.A]-m)*M}if(1==o)u.color.set(p,v,g,m);else{d=u.color;h==e.setup&&d.setFromColor(u.data.color),d.add((p-d.r)*o,(v-d.g)*o,(g-d.b)*o,(m-d.a)*o)}}}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_R=-4,a.PREV_G=-3,a.PREV_B=-2,a.PREV_A=-1,a.R=1,a.G=2,a.B=3,a.A=4,a}(a);t.ColorTimeline=c;var d=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.twoColor<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,i,n,r,s,o,h,l){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=i,this.frames[t+a.G]=n,this.frames[t+a.B]=r,this.frames[t+a.A]=s,this.frames[t+a.R2]=o,this.frames[t+a.G2]=h,this.frames[t+a.B2]=l},a.prototype.apply=function(t,i,n,r,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(n=c[c.length-a.ENTRIES]){var T=c.length;g=c[T+a.PREV_R],m=c[T+a.PREV_G],y=c[T+a.PREV_B],x=c[T+a.PREV_A],w=c[T+a.PREV_R2],M=c[T+a.PREV_G2],E=c[T+a.PREV_B2]}else{var A=s.binarySearch(c,n,a.ENTRIES);g=c[A+a.PREV_R],m=c[A+a.PREV_G],y=c[A+a.PREV_B],x=c[A+a.PREV_A],w=c[A+a.PREV_R2],M=c[A+a.PREV_G2],E=c[A+a.PREV_B2];var b=c[A],S=this.getCurvePercent(A/a.ENTRIES-1,1-(n-b)/(c[A+a.PREV_TIME]-b));g+=(c[A+a.R]-g)*S,m+=(c[A+a.G]-m)*S,y+=(c[A+a.B]-y)*S,x+=(c[A+a.A]-x)*S,w+=(c[A+a.R2]-w)*S,M+=(c[A+a.G2]-M)*S,E+=(c[A+a.B2]-E)*S}if(1==o)u.color.set(g,m,y,x),u.darkColor.set(w,M,E,1);else{d=u.color,f=u.darkColor;h==e.setup&&(d.setFromColor(u.data.color),f.setFromColor(u.data.darkColor)),d.add((g-d.r)*o,(m-d.g)*o,(y-d.b)*o,(x-d.a)*o),f.add((w-f.r)*o,(M-f.g)*o,(E-f.b)*o,0)}}}},a.ENTRIES=8,a.PREV_TIME=-8,a.PREV_R=-7,a.PREV_G=-6,a.PREV_B=-5,a.PREV_A=-4,a.PREV_R2=-3,a.PREV_G2=-2,a.PREV_B2=-1,a.R=1,a.G=2,a.B=3,a.A=4,a.R2=5,a.G2=6,a.B2=7,a}(a);t.TwoColorTimeline=d;var f=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return r.prototype.getPropertyId=function(){return(n.attachment<<24)+this.slotIndex},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},r.prototype.apply=function(t,n,r,a,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active)if(l!=i.mixOut){var c=this.frames;if(r=c[c.length-1]?c.length-1:s.binarySearch(c,r,1)-1;var f=this.attachmentNames[d];t.slots[this.slotIndex].setAttachment(null==f?null:t.getAttachment(this.slotIndex,f))}}else h==e.setup&&this.setAttachment(t,u,u.data.attachmentName)},r.prototype.setAttachment=function(t,e,i){e.setAttachment(null==i?null:t.getAttachment(this.slotIndex,i))},r}();t.AttachmentTimeline=f;var p=null,v=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e),n.frameVertices=new Array(e),null==p&&(p=t.Utils.newFloatArray(64)),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.deform<<27)+ +this.attachment.id+this.slotIndex},a.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.frameVertices[t]=i},a.prototype.apply=function(i,n,r,a,o,h,l){var u=i.slots[this.slotIndex];if(u.bone.active){var c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.deformAttachment==this.attachment){var d=u.deform;0==d.length&&(h=e.setup);var f=this.frameVertices,p=f[0].length,v=this.frames;if(r=v[v.length-1]){var M=f[v.length-1];if(1==o)if(h==e.add)if(null==(g=c).bones){y=g.vertices;for(var E=0;Ei)this.apply(t,e,Number.MAX_VALUE,n,r,a,o),e=-1;else if(e>=h[l-1])return;if(!(i0&&h[u-1]==c;)u--;for(;u=h[u];u++)n.push(this.events[u])}}},e}();t.EventTimeline=g;var m=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return r.prototype.getPropertyId=function(){return n.drawOrder<<24},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.drawOrders[t]=i},r.prototype.apply=function(n,r,a,o,h,l,u){var c=n.drawOrder,d=n.slots;if(u!=i.mixOut){var f=this.frames;if(a=f[f.length-1]?f.length-1:s.binarySearch(f,a)-1;var v=this.drawOrders[p];if(null==v)t.Utils.arrayCopy(d,0,c,0,d.length);else for(var g=0,m=v.length;g=c[c.length-o.ENTRIES])l==e.setup?(d.mix=d.data.mix+(c[c.length+o.PREV_MIX]-d.data.mix)*h,d.softness=d.data.softness+(c[c.length+o.PREV_SOFTNESS]-d.data.softness)*h,u==i.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],d.compress=0!=c[c.length+o.PREV_COMPRESS],d.stretch=0!=c[c.length+o.PREV_STRETCH])):(d.mix+=(c[c.length+o.PREV_MIX]-d.mix)*h,d.softness+=(c[c.length+o.PREV_SOFTNESS]-d.softness)*h,u==i.mixIn&&(d.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],d.compress=0!=c[c.length+o.PREV_COMPRESS],d.stretch=0!=c[c.length+o.PREV_STRETCH]));else{var f=s.binarySearch(c,r,o.ENTRIES),p=c[f+o.PREV_MIX],v=c[f+o.PREV_SOFTNESS],g=c[f],m=this.getCurvePercent(f/o.ENTRIES-1,1-(r-g)/(c[f+o.PREV_TIME]-g));l==e.setup?(d.mix=d.data.mix+(p+(c[f+o.MIX]-p)*m-d.data.mix)*h,d.softness=d.data.softness+(v+(c[f+o.SOFTNESS]-v)*m-d.data.softness)*h,u==i.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=c[f+o.PREV_BEND_DIRECTION],d.compress=0!=c[f+o.PREV_COMPRESS],d.stretch=0!=c[f+o.PREV_STRETCH])):(d.mix+=(p+(c[f+o.MIX]-p)*m-d.mix)*h,d.softness+=(v+(c[f+o.SOFTNESS]-v)*m-d.softness)*h,u==i.mixIn&&(d.bendDirection=c[f+o.PREV_BEND_DIRECTION],d.compress=0!=c[f+o.PREV_COMPRESS],d.stretch=0!=c[f+o.PREV_STRETCH]))}},o.ENTRIES=6,o.PREV_TIME=-6,o.PREV_MIX=-5,o.PREV_SOFTNESS=-4,o.PREV_BEND_DIRECTION=-3,o.PREV_COMPRESS=-2,o.PREV_STRETCH=-1,o.MIX=1,o.SOFTNESS=2,o.BEND_DIRECTION=3,o.COMPRESS=4,o.STRETCH=5,o}(a);t.IkConstraintTimeline=y;var x=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.transformConstraint<<24)+this.transformConstraintIndex},a.prototype.setFrame=function(t,e,i,n,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=i,this.frames[t+a.TRANSLATE]=n,this.frames[t+a.SCALE]=r,this.frames[t+a.SHEAR]=s},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES]){var m=u.length;f=u[m+a.PREV_ROTATE],p=u[m+a.PREV_TRANSLATE],v=u[m+a.PREV_SCALE],g=u[m+a.PREV_SHEAR]}else{var y=s.binarySearch(u,n,a.ENTRIES);f=u[y+a.PREV_ROTATE],p=u[y+a.PREV_TRANSLATE],v=u[y+a.PREV_SCALE],g=u[y+a.PREV_SHEAR];var x=u[y],w=this.getCurvePercent(y/a.ENTRIES-1,1-(n-x)/(u[y+a.PREV_TIME]-x));f+=(u[y+a.ROTATE]-f)*w,p+=(u[y+a.TRANSLATE]-p)*w,v+=(u[y+a.SCALE]-v)*w,g+=(u[y+a.SHEAR]-g)*w}if(h==e.setup){d=c.data;c.rotateMix=d.rotateMix+(f-d.rotateMix)*o,c.translateMix=d.translateMix+(p-d.translateMix)*o,c.scaleMix=d.scaleMix+(v-d.scaleMix)*o,c.shearMix=d.shearMix+(g-d.shearMix)*o}else c.rotateMix+=(f-c.rotateMix)*o,c.translateMix+=(p-c.translateMix)*o,c.scaleMix+=(v-c.scaleMix)*o,c.shearMix+=(g-c.shearMix)*o}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_ROTATE=-4,a.PREV_TRANSLATE=-3,a.PREV_SCALE=-2,a.PREV_SHEAR=-1,a.ROTATE=1,a.TRANSLATE=2,a.SCALE=3,a.SHEAR=4,a}(a);t.TransformConstraintTimeline=x;var w=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.pathConstraintPosition<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,i){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.VALUE]=i},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_VALUE];else{var f=s.binarySearch(u,n,a.ENTRIES);d=u[f+a.PREV_VALUE];var p=u[f],v=this.getCurvePercent(f/a.ENTRIES-1,1-(n-p)/(u[f+a.PREV_TIME]-p));d+=(u[f+a.VALUE]-d)*v}h==e.setup?c.position=c.data.position+(d-c.data.position)*o:c.position+=(d-c.position)*o}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_VALUE=-1,a.VALUE=1,a}(a);t.PathConstraintPositionTimeline=w;var M=function(t){function i(e){return t.call(this,e)||this}return r(i,t),i.prototype.getPropertyId=function(){return(n.pathConstraintSpacing<<24)+this.pathConstraintIndex},i.prototype.apply=function(t,n,r,a,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(r=u[u.length-i.ENTRIES])d=u[u.length+i.PREV_VALUE];else{var f=s.binarySearch(u,r,i.ENTRIES);d=u[f+i.PREV_VALUE];var p=u[f],v=this.getCurvePercent(f/i.ENTRIES-1,1-(r-p)/(u[f+i.PREV_TIME]-p));d+=(u[f+i.VALUE]-d)*v}h==e.setup?c.spacing=c.data.spacing+(d-c.data.spacing)*o:c.spacing+=(d-c.spacing)*o}},i}(w);t.PathConstraintSpacingTimeline=M;var E=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.pathConstraintMix<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,i,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=i,this.frames[t+a.TRANSLATE]=n},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_ROTATE],f=u[u.length+a.PREV_TRANSLATE];else{var p=s.binarySearch(u,n,a.ENTRIES);d=u[p+a.PREV_ROTATE],f=u[p+a.PREV_TRANSLATE];var v=u[p],g=this.getCurvePercent(p/a.ENTRIES-1,1-(n-v)/(u[p+a.PREV_TIME]-v));d+=(u[p+a.ROTATE]-d)*g,f+=(u[p+a.TRANSLATE]-f)*g}h==e.setup?(c.rotateMix=c.data.rotateMix+(d-c.data.rotateMix)*o,c.translateMix=c.data.translateMix+(f-c.data.translateMix)*o):(c.rotateMix+=(d-c.rotateMix)*o,c.translateMix+=(f-c.translateMix)*o)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_ROTATE=-2,a.PREV_TRANSLATE=-1,a.ROTATE=1,a.TRANSLATE=2,a}(a);t.PathConstraintMixTimeline=E}(n||(n={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.trackEntryPool=new t.Pool((function(){return new i})),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,i=0,n=e.length;i0){if(r.delay-=s,r.delay>0)continue;s=-r.delay,r.delay=0}var a=r.next;if(null!=a){var o=r.trackLast-a.delay;if(o>=0){for(a.delay=0,a.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*a.timeScale,r.trackTime+=s,this.setCurrent(i,a,!0);null!=a.mixingFrom;)a.mixTime+=t,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&null==r.mixingFrom){e[i]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,null!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=s}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var i=t.mixingFrom;if(null==i)return!0;var n=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,null!=i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(i){if(null==i)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var n=this.events,r=this.tracks,s=!1,a=0,o=r.length;a0)){s=!0;var l=0==a?t.MixBlend.first:h.mixBlend,u=h.alpha;null!=h.mixingFrom?u*=this.applyMixingFrom(h,i,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,d=h.getAnimationTime(),f=h.animation.timelines.length,p=h.animation.timelines;if(0==a&&1==u||l==t.MixBlend.add)for(var v=0;v1&&(a=1),r!=t.MixBlend.first&&(r=s.mixBlend));var o=a0&&this.queueEvents(s,c),this.events.length=0,s.nextAnimationLast=c,s.nextTrackLast=s.trackTime,a},e.prototype.applyAttachmentTimeline=function(i,n,r,s,a){var o=n.slots[i.slotIndex];if(o.bone.active){var h,l=i.frames;if(r=l[l.length-1]?l.length-1:t.Animation.binarySearch(l,r)-1,this.setAttachment(n,o,i.attachmentNames[h],a);o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+e.SETUP)}},e.prototype.setAttachment=function(t,i,n,r){i.setAttachment(null==n?null:t.getAttachment(i.data.index,n)),r&&(i.attachmentState=this.unkeyedState+e.CURRENT)},e.prototype.applyRotateTimeline=function(e,i,n,r,s,a,o,h){if(h&&(a[o]=0),1!=r){var l=e,u=l.frames,c=i.bones[l.boneIndex];if(c.active){var d=0,f=0;if(n=u[u.length-t.RotateTimeline.ENTRIES])f=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(u,n,t.RotateTimeline.ENTRIES),v=u[p+t.RotateTimeline.PREV_ROTATION],g=u[p],m=l.getCurvePercent((p>>1)-1,1-(n-g)/(u[p+t.RotateTimeline.PREV_TIME]-g));f=u[p+t.RotateTimeline.ROTATION]-v,f=v+(f-=360*(16384-(16384.499999999996-f/360|0)))*m+c.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0))}var y=0,x=f-d;if(0==(x-=360*(16384-(16384.499999999996-x/360|0))))y=a[o];else{var w=0,M=0;h?(w=0,M=x):(w=a[o],M=a[o+1]);var E=x>0,T=w>=0;t.MathUtils.signum(M)!=t.MathUtils.signum(x)&&Math.abs(M)<=90&&(Math.abs(w)>180&&(w+=360*t.MathUtils.signum(w)),T=E),y=x+w-w%360,T!=E&&(y+=360*t.MathUtils.signum(w)),a[o]=y}a[o+1]=x,d+=y*r,c.rotation=d-360*(16384-(16384.499999999996-d/360|0))}}else e.apply(i,0,n,null,1,s,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var i=t.animationStart,n=t.animationEnd,r=n-i,s=t.trackLast%r,a=this.events,o=0,h=a.length;on||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:e>=n&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var i=e;;){var n=i.mixingFrom;if(null==n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,i){var n=this.expandToIndex(t);this.tracks[t]=e,null!=n&&(i&&this.queue.interrupt(n),e.mixingFrom=n,n.mixingTo=e,e.mixTime=0,null!=n.mixingFrom&&n.mixDuration>0&&(e.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,i){var n=this.data.skeletonData.findAnimation(e);if(null==n)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,n,i)},e.prototype.setAnimationWith=function(t,e,i){if(null==e)throw new Error("animation cannot be null.");var n=!0,r=this.expandToIndex(t);null!=r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.disposeNext(r),r=r.mixingFrom,n=!1):this.disposeNext(r));var s=this.trackEntry(t,e,i,r);return this.setCurrent(t,s,n),this.queue.drain(),s},e.prototype.addAnimation=function(t,e,i,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,i,n)},e.prototype.addAnimationWith=function(t,e,i,n){if(null==e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(null!=r)for(;null!=r.next;)r=r.next;var s=this.trackEntry(t,e,i,r);if(null==r)this.setCurrent(t,s,!0),this.queue.drain();else if(r.next=s,n<=0){var a=r.animationEnd-r.animationStart;0!=a?(r.loop?n+=a*(1+(r.trackTime/a|0)):n+=Math.max(a,r.trackTime),n-=this.data.getMix(r.animation,e)):n=r.trackTime}return s.delay=n,s},e.prototype.setEmptyAnimation=function(t,i){var n=this.setAnimationWith(t,e.emptyAnimation,!1);return n.mixDuration=i,n.trackEnd=i,n},e.prototype.addEmptyAnimation=function(t,i,n){n<=0&&(n-=i);var r=this.addAnimationWith(t,e.emptyAnimation,!1,n);return r.mixDuration=i,r.trackEnd=i,r},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var i=0,n=this.tracks.length;i0){a[l]=e.HOLD_MIX,o[l]=d;continue t}break}a[l]=e.HOLD_FIRST}else a[l]=e.SUBSEQUENT}},e.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.emptyAnimation=new t.Animation("",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.HOLD_SUBSEQUENT=2,e.HOLD_FIRST=3,e.HOLD_MIX=4,e.SETUP=1,e.CURRENT=2,e}();t.AnimationState=e;var i=function(){function e(){this.mixBlend=t.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return e.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},e.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},e.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},e}();t.TrackEntry=i;var n,r=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(n.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(n.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(n.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(n.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(n.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(n.event),this.objects.push(t),this.objects.push(e)},t.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,i=0;i=0?e.substring(0,e.lastIndexOf("/")):"";e=this.pathPrefix+e,this.toLoad++,this.downloadText(e,(function(a){var o={count:0},h=new Array;try{new t.TextureAtlas(a,(function(e){h.push(""==s?e:s+"/"+e);var i=document.createElement("img");return i.width=16,i.height=16,new t.FakeTexture(i)}))}catch(t){var l=t;return r.errors[e]="Couldn't load texture atlas ".concat(e,": ").concat(l.message),n&&n(e,"Couldn't load texture atlas ".concat(e,": ").concat(l.message)),r.toLoad--,void r.loaded++}for(var u=function(l){var u=!1;r.loadTexture(l,(function(l,c){if(o.count++,o.count==h.length)if(u)r.errors[e]="Couldn't load texture atlas page ".concat(l,"} of atlas ").concat(e),n&&n(e,"Couldn't load texture atlas page ".concat(l," of atlas ").concat(e)),r.toLoad--,r.loaded++;else try{var d=new t.TextureAtlas(a,(function(t){return r.get(""==s?t:s+"/"+t)}));r.assets[e]=d,i&&i(e,d),r.toLoad--,r.loaded++}catch(t){var f=t;r.errors[e]="Couldn't load texture atlas ".concat(e,": ").concat(f.message),n&&n(e,"Couldn't load texture atlas ".concat(e,": ").concat(f.message)),r.toLoad--,r.loaded++}}),(function(t,i){u=!0,o.count++,o.count==h.length&&(r.errors[e]="Couldn't load texture atlas page ".concat(t,"} of atlas ").concat(e),n&&n(e,"Couldn't load texture atlas page ".concat(t," of atlas ").concat(e)),r.toLoad--,r.loaded++)}))},c=0,d=h;c0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(n||(n={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in atlas: "+n+" (region attachment: "+i+")");r.renderObject=r;var s=new t.RegionAttachment(i);return s.setRegion(r),s},e.prototype.newMeshAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in atlas: "+n+" (mesh attachment: "+i+")");r.renderObject=r;var s=new t.MeshAttachment(i);return s.region=r,s},e.prototype.newBoundingBoxAttachment=function(e,i){return new t.BoundingBoxAttachment(i)},e.prototype.newPathAttachment=function(e,i){return new t.PathAttachment(i)},e.prototype.newPointAttachment=function(e,i){return new t.PointAttachment(i)},e.prototype.newClippingAttachment=function(e,i){return new t.ClippingAttachment(i)},e}();t.AtlasAttachmentLoader=e}(n||(n={})),function(t){!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(t.BlendMode||(t.BlendMode={}))}(n||(n={})),function(t){var e=function(){function e(t,e,i){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}return e.prototype.isActive=function(){return this.active},e.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,i,n,r,s,a,o){this.ax=e,this.ay=i,this.arotation=n,this.ascaleX=r,this.ascaleY=s,this.ashearX=a,this.ashearY=o,this.appliedValid=!0;var h=this.parent;if(null==h){var l=this.skeleton,u=n+90+o,c=l.scaleX,d=l.scaleY;return this.a=t.MathUtils.cosDeg(n+a)*r*c,this.b=t.MathUtils.cosDeg(u)*s*c,this.c=t.MathUtils.sinDeg(n+a)*r*d,this.d=t.MathUtils.sinDeg(u)*s*d,this.worldX=e*c+l.x,void(this.worldY=i*d+l.y)}var f=h.a,p=h.b,v=h.c,g=h.d;switch(this.worldX=f*e+p*i+h.worldX,this.worldY=v*e+g*i+h.worldY,this.data.transformMode){case t.TransformMode.Normal:u=n+90+o;var m=t.MathUtils.cosDeg(n+a)*r,y=t.MathUtils.cosDeg(u)*s,x=t.MathUtils.sinDeg(n+a)*r,w=t.MathUtils.sinDeg(u)*s;return this.a=f*m+p*x,this.b=f*y+p*w,this.c=v*m+g*x,void(this.d=v*y+g*w);case t.TransformMode.OnlyTranslation:u=n+90+o;this.a=t.MathUtils.cosDeg(n+a)*r,this.b=t.MathUtils.cosDeg(u)*s,this.c=t.MathUtils.sinDeg(n+a)*r,this.d=t.MathUtils.sinDeg(u)*s;break;case t.TransformMode.NoRotationOrReflection:var M=0;(A=f*f+v*v)>1e-4?(A=Math.abs(f*g-p*v)/A,f/=this.skeleton.scaleX,p=(v/=this.skeleton.scaleY)*A,g=f*A,M=Math.atan2(v,f)*t.MathUtils.radDeg):(f=0,v=0,M=90-Math.atan2(g,p)*t.MathUtils.radDeg);var E=n+a-M,T=n+o-M+90;m=t.MathUtils.cosDeg(E)*r,y=t.MathUtils.cosDeg(T)*s,x=t.MathUtils.sinDeg(E)*r,w=t.MathUtils.sinDeg(T)*s;this.a=f*m-p*x,this.b=f*y-p*w,this.c=v*m+g*x,this.d=v*y+g*w;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var A,b=t.MathUtils.cosDeg(n),S=t.MathUtils.sinDeg(n),R=(f*b+p*S)/this.skeleton.scaleX,I=(v*b+g*S)/this.skeleton.scaleY;(A=Math.sqrt(R*R+I*I))>1e-5&&(A=1/A),R*=A,I*=A,A=Math.sqrt(R*R+I*I),this.data.transformMode==t.TransformMode.NoScale&&f*g-p*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(A=-A);var C=Math.PI/2+Math.atan2(I,R),P=Math.cos(C)*A,k=Math.sin(C)*A;m=t.MathUtils.cosDeg(a)*r,y=t.MathUtils.cosDeg(90+o)*s,x=t.MathUtils.sinDeg(a)*r,w=t.MathUtils.sinDeg(90+o)*s;this.a=R*m+P*x,this.b=R*y+P*w,this.c=I*m+k*x,this.d=I*y+k*w}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},e.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*t.MathUtils.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*t.MathUtils.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var e=this.parent;if(null==e)return this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);var i=e.a,n=e.b,r=e.c,s=e.d,a=1/(i*s-n*r),o=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=o*s*a-h*n*a,this.ay=h*i*a-o*r*a;var l=a*s,u=a*i,c=a*n,d=a*r,f=l*this.a-c*this.c,p=l*this.b-c*this.d,v=u*this.c-d*this.a,g=u*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var m=f*g-p*v;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(f*p+v*g,m)*t.MathUtils.radDeg,this.arotation=Math.atan2(v,f)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,i=this.b,n=this.c,r=this.d,s=1/(e*r-i*n),a=t.x-this.worldX,o=t.y-this.worldY;return t.x=a*r*s-o*i*s,t.y=o*e*s-a*n*s,t},e.prototype.localToWorld=function(t){var e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t},e.prototype.worldToLocalRotation=function(e){var i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return Math.atan2(this.a*i-this.c*n,this.d*n-this.b*i)*t.MathUtils.radDeg+this.rotation-this.shearX},e.prototype.localToWorldRotation=function(e){e-=this.rotation-this.shearX;var i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return Math.atan2(n*this.c+i*this.d,n*this.a+i*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var i=this.a,n=this.b,r=this.c,s=this.d,a=t.MathUtils.cosDeg(e),o=t.MathUtils.sinDeg(e);this.a=a*i-o*r,this.b=a*n-o*s,this.c=o*i+a*r,this.d=o*n+a*s,this.appliedValid=!1},e}();t.Bone=e}(n||(n={})),function(t){var e,i=function(i,n,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=e.Normal,this.skinRequired=!1,this.color=new t.Color,i<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");this.index=i,this.name=n,this.parent=r};t.BoneData=i,function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(e=t.TransformMode||(t.TransformMode={}))}(n||(n={})),function(t){var e=function(t,e,i){this.name=t,this.order=e,this.skinRequired=i};t.ConstraintData=e}(n||(n={})),function(t){var e=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e};t.Event=e}(n||(n={})),function(t){var e=function(t){this.name=t};t.EventData=e}(n||(n={})),function(t){var e=function(){function e(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var i=0;i180?f-=360:f<-180&&(f+=360);var E=e.ascaleX,T=e.ascaleY;if(r||s){switch(e.data.transformMode){case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:p=i-e.worldX,v=n-e.worldY}var A=e.data.length*E,b=Math.sqrt(p*p+v*v);if(r&&bA&&A>1e-4)E*=g=(b/A-1)*o+1,a&&(T*=g)}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*o,E,T,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,i,n,r,s,a,o,h){if(0!=h){e.appliedValid||e.updateAppliedTransform(),i.appliedValid||i.updateAppliedTransform();var l=e.ax,u=e.ay,c=e.ascaleX,d=c,f=e.ascaleY,p=i.ascaleX,v=0,g=0,m=0;c<0?(c=-c,v=180,m=-1):(v=0,m=1),f<0&&(f=-f,m=-m),p<0?(p=-p,g=180):g=0;var y=i.ax,x=0,w=0,M=0,E=e.a,T=e.b,A=e.c,b=e.d,S=Math.abs(c-f)<=1e-4;S?(w=E*y+T*(x=i.ay)+e.worldX,M=A*y+b*x+e.worldY):(x=0,w=E*y+e.worldX,M=A*y+e.worldY);var R=e.parent;E=R.a,T=R.b,A=R.c;var I,C,P=1/(E*(b=R.d)-T*A),k=w-R.worldX,O=M-R.worldY,_=(k*b-O*T)*P-l,F=(O*E-k*A)*P-u,L=Math.sqrt(_*_+F*F),V=i.data.length*p;if(L<1e-4)return this.apply1(e,n,r,!1,a,!1,h),void i.updateWorldTransformWith(y,x,0,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY);var D=((k=n-R.worldX)*b-(O=r-R.worldY)*T)*P-l,N=(O*E-k*A)*P-u,Y=D*D+N*N;if(0!=o){o*=c*(p+1)/2;var X=Math.sqrt(Y),B=X-L-V*c+o;if(B>0){var U=Math.min(1,B/(2*o))-1;Y=(D-=(U=(B-o*(1-U*U))/X)*D)*D+(N-=U*N)*N}}t:if(S){var z=(Y-L*L-(V*=c)*V)/(2*L*V);z<-1?z=-1:z>1&&(z=1,a&&(d*=(Math.sqrt(Y)/(L+V)-1)*h+1)),C=Math.acos(z)*s,E=L+V*z,T=V*Math.sin(C),I=Math.atan2(N*E-D*T,D*E+N*T)}else{var W=(E=c*V)*E,q=(T=f*V)*T,G=Math.atan2(N,D),H=-2*q*L,j=q-W;if((b=H*H-4*j*(A=q*L*L+W*Y-W*q))>=0){var Z=Math.sqrt(b);H<0&&(Z=-Z);var K=(Z=-(H+Z)/2)/j,Q=A/Z,$=Math.abs(K)=-1&&A<=1&&(A=Math.acos(A),(b=(k=E*Math.cos(A)+L)*k+(O=T*Math.sin(A))*O)st&&(nt=A,st=b,rt=k,at=O)),Y<=(et+st)/2?(I=G-Math.atan2(it*s,tt),C=J*s):(I=G-Math.atan2(at*s,rt),C=nt*s)}var ot=Math.atan2(x,y)*m,ht=e.arotation;(I=(I-ot)*t.MathUtils.radDeg+v-ht)>180?I-=360:I<-180&&(I+=360),e.updateWorldTransformWith(l,u,ht+I*h,d,e.ascaleY,0,0),ht=i.arotation,(C=((C+ot)*t.MathUtils.radDeg-i.ashearX)*m+g-ht)>180?C-=360:C<-180&&(C+=360),i.updateWorldTransformWith(y,x,ht+C*h,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY)}else i.updateWorldTransform()},e}();t.IkConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i.bendDirection=1,i.compress=!1,i.stretch=!1,i.uniform=!1,i.mix=1,i.softness=0,i}return r(e,t),e}(t.ConstraintData);t.IkConstraintData=e}(n||(n={})),function(t){var e=function(){function e(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var i=0,n=t.bones.length;i0;if(r>0||s){var a=this.data,o=a.spacingMode==t.SpacingMode.Percent,h=a.rotateMode,l=h==t.RotateMode.Tangent,u=h==t.RotateMode.ChainScale,c=this.bones.length,d=l?c:c+1,f=this.bones,p=t.Utils.setArraySize(this.spaces,d),v=null,g=this.spacing;if(u||!o){u&&(v=t.Utils.setArraySize(this.lengths,c));for(var m=a.spacingMode==t.SpacingMode.Length,y=0,x=d-1;y0?t.MathUtils.degRad:-t.MathUtils.degRad;y=0;for(var P=3;yt.MathUtils.PI?X-=t.MathUtils.PI2:X<-t.MathUtils.PI&&(X+=t.MathUtils.PI2),X*=n,B=Math.cos(X),U=Math.sin(X),k.a=B*V-U*N,k.b=B*D-U*Y,k.c=U*V+B*N,k.d=U*D+B*Y}k.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(i,n,r,s,a){var o=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*n+2),c=null,d=i.closed,f=i.worldVerticesLength,p=f/6,v=e.NONE;if(!i.constantSpeed){var g=i.lengths,m=g[p-=d?1:2];if(s&&(h*=m),a)for(var y=1;ym){v!=e.AFTER&&(v=e.AFTER,i.computeWorldVertices(o,f-6,4,c,0,2)),this.addAfterPosition(M-m,c,0,u,x);continue}}for(;;w++){var E=g[w];if(!(M>E)){if(0==w)M/=E;else M=(M-(Z=g[w-1]))/(E-Z);break}}w!=v&&(v=w,d&&w==p?(i.computeWorldVertices(o,f-4,4,c,0,2),i.computeWorldVertices(o,0,4,c,4,2)):i.computeWorldVertices(o,6*w+2,8,c,0,2)),this.addCurvePosition(M,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,x,r||y>0&&0==q)}return u}d?(f+=2,c=t.Utils.setArraySize(this.world,f),i.computeWorldVertices(o,2,f-4,c,0,2),i.computeWorldVertices(o,0,2,c,f-4,2),c[f-2]=c[0],c[f-1]=c[1]):(p--,f-=4,c=t.Utils.setArraySize(this.world,f),i.computeWorldVertices(o,2,f,c,0,2));for(var T=t.Utils.setArraySize(this.curves,p),A=0,b=c[0],S=c[1],R=0,I=0,C=0,P=0,k=0,O=0,_=0,F=0,L=0,V=0,D=0,N=0,Y=0,X=0,B=(y=0,2);yA){this.addAfterPosition(M-A,c,f-4,u,x);continue}}for(;;w++){var G=T[w];if(!(M>G)){if(0==w)M/=G;else M=(M-(Z=T[w-1]))/(G-Z);break}}if(w!=v){v=w;var H=6*w;for(b=c[H],S=c[H+1],R=c[H+2],I=c[H+3],C=c[H+4],P=c[H+5],D=2*(_=.03*(b-2*R+C))+(L=.006*(3*(R-C)-b+(k=c[H+6]))),N=2*(F=.03*(S-2*I+P))+(V=.006*(3*(I-P)-S+(O=c[H+7]))),Y=.3*(R-b)+_+.16666667*L,X=.3*(I-S)+F+.16666667*V,z=Math.sqrt(Y*Y+X*X),U[0]=z,H=1;H<8;H++)Y+=D,X+=N,D+=L,N+=V,z+=Math.sqrt(Y*Y+X*X),U[H]=z;Y+=D,X+=N,z+=Math.sqrt(Y*Y+X*X),U[8]=z,Y+=D+L,X+=N+V,z+=Math.sqrt(Y*Y+X*X),U[9]=z,W=0}for(M*=z;;W++){var j=U[W];if(!(M>j)){var Z;if(0==W)M/=j;else M=W+(M-(Z=U[W-1]))/(j-Z);break}}this.addCurvePosition(.1*M,b,S,R,I,C,P,k,O,u,x,r||y>0&&0==q)}return u},e.prototype.addBeforePosition=function(t,e,i,n,r){var s=e[i],a=e[i+1],o=e[i+2]-s,h=e[i+3]-a,l=Math.atan2(h,o);n[r]=s+t*Math.cos(l),n[r+1]=a+t*Math.sin(l),n[r+2]=l},e.prototype.addAfterPosition=function(t,e,i,n,r){var s=e[i+2],a=e[i+3],o=s-e[i],h=a-e[i+1],l=Math.atan2(h,o);n[r]=s+t*Math.cos(l),n[r+1]=a+t*Math.sin(l),n[r+2]=l},e.prototype.addCurvePosition=function(t,e,i,n,r,s,a,o,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=i,void(l[u+2]=Math.atan2(r-i,n-e));var d=t*t,f=d*t,p=1-t,v=p*p,g=v*p,m=p*t,y=3*m,x=p*y,w=y*t,M=e*g+n*x+s*w+o*f,E=i*g+r*x+a*w+h*f;l[u]=M,l[u+1]=E,c&&(l[u+2]=t<.001?Math.atan2(r-i,n-e):Math.atan2(E-(i*v+r*m*2+a*d),M-(e*v+n*m*2+s*d)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i}return r(e,t),e}(t.ConstraintData);t.PathConstraintData=e,function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(t.PositionMode||(t.PositionMode={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent"}(t.SpacingMode||(t.SpacingMode={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(t.RotateMode||(t.RotateMode={}))}(n||(n={})),function(t){var e=function(){function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t}(),i=function(){function t(t){void 0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}return t.prototype.queueAsset=function(t,i,n){var r=this.clientAssets[t];return null==r&&(r=new e(t),this.clientAssets[t]=r),null!==i&&(r.textureLoader=i),r.toLoad.push(n),this.queuedAssets[n]!==n&&(this.queuedAssets[n]=n,!0)},t.prototype.loadText=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.overrideMimeType("text/html"),n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=n.responseText:i.errors[e]="Couldn't load text ".concat(e,": status ").concat(n.status,", ").concat(n.responseText))},n.open("GET",e,!0),n.send()}},t.prototype.loadJson=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.overrideMimeType("text/html"),n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=JSON.parse(n.responseText):i.errors[e]="Couldn't load text ".concat(e,": status ").concat(n.status,", ").concat(n.responseText))},n.open("GET",e,!0),n.send()}},t.prototype.loadTexture=function(t,e,i){var n=this;if(i=this.pathPrefix+i,this.queueAsset(t,e,i))if(!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts){fetch(i,{mode:"cors"}).then((function(t){return t.ok||(n.errors[i]="Couldn't load image "+i),t.blob()})).then((function(t){return createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"})})).then((function(t){n.rawAssets[i]=t}))}else{var r=new Image;r.crossOrigin="anonymous",r.onload=function(t){n.rawAssets[i]=r},r.onerror=function(t){n.errors[i]="Couldn't load image ".concat(i)},r.src=i}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var i=this.clientAssets[t];return null==i||i.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts,i=0;i0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=i}(n||(n={})),function(t){var e=function(){function e(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(var i=0;i1){var s=n[n.length-1];this._updateCache.indexOf(s)>-1||this.updateCacheReset.push(s)}this._updateCache.push(e),this.sortReset(r.children),n[n.length-1].sorted=!0}},e.prototype.sortPathConstraint=function(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active){var i=e.target,n=i.data.index,r=i.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,n,r),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,r);for(var s=0,a=this.data.skins.length;s-1||this.updateCacheReset.push(s)}else for(r=0;r0){w=new t.DrawOrderTimeline(V);var D=r.slots.length;for(u=0;u=0;f--)Y[f]=-1;var X=t.Utils.newArray(D-N,0),B=0,U=0;for(f=0;f=0;f--)-1==Y[f]&&(Y[f]=X[--U]);w.setFrame(u,y,Y)}s.push(w),o=Math.max(o,w.frames[V-1])}var z=i.readInt(!0);if(z>0){for(w=new t.EventTimeline(z),u=0;u>>1^-(1&i)},t.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},t.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(n),i++}}return e},t.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},t.prototype.readBoolean=function(){return 0!=this.readByte()},t}(),n=function(t,e,i,n,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=n,this.inheritDeform=r},r=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(n||(n={})),function(t){var e=function(){function e(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new t.Pool((function(){return t.Utils.newFloatArray(16)}))}return e.prototype.update=function(e,i){if(null==e)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,r=this.polygons,s=this.polygonPool,a=e.slots,o=a.length;n.length=0,s.freeAll(r),r.length=0;for(var h=0;h=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,i,n){var r=this.minX,s=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&i<=r||e<=s&&n<=s||t>=a&&i>=a||e>=o&&n>=o)return!1;var h=(n-e)/(i-t),l=h*(r-t)+e;if(l>s&&ls&&lr&&ur&&ut.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var i=this.polygons,n=0,r=i.length;n=i||l=i){var u=n[o];u+(i-h)/(l-h)*(n[s]-u)=u&&x<=f||x>=f&&x<=u)&&(x>=e&&x<=n||x>=n&&x<=e)){var w=(l*m-h*v)/y;if((w>=c&&w<=p||w>=p&&w<=c)&&(w>=i&&w<=r||w>=r&&w<=i))return!0}u=f,c=p}return!1},e.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},e.prototype.getWidth=function(){return this.maxX-this.minX},e.prototype.getHeight=function(){return this.maxY-this.minY},e}();t.SkeletonBounds=e}(n||(n={})),function(t){var e=function(){function e(){this.triangulator=new t.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return e.prototype.clipStart=function(i,n){if(null!=this.clipAttachment)return 0;this.clipAttachment=n;var r=n.worldVerticesLength,s=t.Utils.setArraySize(this.clippingPolygon,r);n.computeWorldVertices(i,0,r,s,0,2);var a=this.clippingPolygon;e.makeClockwise(a);for(var o=this.clippingPolygons=this.triangulator.decompose(a,this.triangulator.triangulate(a)),h=0,l=o.length;h>1,Y=this.clipOutput,X=t.Utils.setArraySize(u,k+N*p),B=0;B=2?(u=o,o=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(i),u.push(n),u.push(r),u.push(s),u.push(t),u.push(e),o.length=0;for(var c=a,d=a.length-4,f=0;;f+=2){for(var p=c[f],v=c[f+1],g=c[f+2],m=c[f+3],y=p-g,x=v-m,w=u,M=u.length-2,E=o.length,T=0;T0;if(y*(b-m)-x*(A-g)>0){if(I){o.push(S),o.push(R);continue}var C=(k=R-b)*(g-p)-(O=S-A)*(m-v);if(Math.abs(C)>1e-6){var P=(O*(v-b)-k*(p-A))/C;o.push(p+(g-p)*P),o.push(v+(m-v)*P)}else o.push(p),o.push(v)}else if(I){var k,O;C=(k=R-b)*(g-p)-(O=S-A)*(m-v);if(Math.abs(C)>1e-6){P=(O*(v-b)-k*(p-A))/C;o.push(p+(g-p)*P),o.push(v+(m-v)*P)}else o.push(p),o.push(v);o.push(S),o.push(R)}l=!0}if(E==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),f==d)break;var _=o;(o=u).length=0,u=_}if(h!=o){h.length=0;f=0;for(var F=o.length-2;f>1;o=0;d--)-1==q[d]&&(q[d]=H[--Z])}w.setFrame(c++,this.getValue(W,"time",0),q)}s.push(w),a=Math.max(a,w.frames[w.getFrameCount()-1])}if(e.events){for(w=new t.EventTimeline(e.events.length),c=0,d=0;d=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=i},i.prototype.addSkin=function(t){for(var e=0;e= 0.");if(null==i)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=e,this.name=i,this.boneData=n};t.SlotData=e}(n||(n={})),function(t){var e,i,n=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return e.MipMapNearestNearest;case"mipmaplinearnearest":return e.MipMapLinearNearest;case"mipmapnearestlinear":return e.MipMapNearestLinear;case"mipmaplinearlinear":return e.MipMapLinearLinear;default:throw new Error("Unknown texture filter ".concat(t))}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return i.MirroredRepeat;case"clamptoedge":return i.ClampToEdge;case"repeat":return i.Repeat;default:throw new Error("Unknown texture wrap ".concat(t))}},t}();t.Texture=n,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(e=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(i=t.TextureWrap||(t.TextureWrap={}));var s=function(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.rotate=!1,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0};t.TextureRegion=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(n);t.FakeTexture=a}(n||(n={})),function(t){var e=function(){function e(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}return e.prototype.load=function(e,r){if(null==r)throw new Error("textureLoader cannot be null.");for(var a=new i(e),o=new Array(4),h=null;;){var l=a.readLine();if(null==l)break;if(0==(l=l.trim()).length)h=null;else if(h){var u=new s;u.name=l,u.page=h;var c=a.readValue();"true"==c.toLocaleLowerCase()?u.degrees=90:"false"==c.toLocaleLowerCase()?u.degrees=0:u.degrees=parseFloat(c),u.rotate=90==u.degrees,a.readTuple(o);var d=parseInt(o[0]),f=parseInt(o[1]);a.readTuple(o);var p=parseInt(o[0]),v=parseInt(o[1]);u.u=d/h.width,u.v=f/h.height,u.rotate?(u.u2=(d+v)/h.width,u.v2=(f+p)/h.height):(u.u2=(d+p)/h.width,u.v2=(f+v)/h.height),u.x=d,u.y=f,u.width=Math.abs(p),u.height=Math.abs(v),4==a.readTuple(o)&&4==a.readTuple(o)&&a.readTuple(o),u.originalWidth=parseInt(o[0]),u.originalHeight=parseInt(o[1]),a.readTuple(o),u.offsetX=parseInt(o[0]),u.offsetY=parseInt(o[1]),u.index=parseInt(a.readValue()),u.texture=h.texture,this.regions.push(u)}else{(h=new n).name=l,2==a.readTuple(o)&&(h.width=parseInt(o[0]),h.height=parseInt(o[1]),a.readTuple(o)),a.readTuple(o),h.minFilter=t.Texture.filterFromString(o[0]),h.magFilter=t.Texture.filterFromString(o[1]);var g=a.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==g?h.uWrap=t.TextureWrap.Repeat:"y"==g?h.vWrap=t.TextureWrap.Repeat:"xy"==g&&(h.uWrap=h.vWrap=t.TextureWrap.Repeat),h.texture=r(l),h.texture.setFilters(h.minFilter,h.magFilter),h.texture.setWraps(h.uWrap,h.vWrap),h.width=h.texture.getImage().width,h.height=h.texture.getImage().height,this.pages.push(h)}}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw new Error("Invalid line: "+e);for(var n=0,r=i+1;n<3;n++){var s=e.indexOf(",",r);if(-1==s)break;t[n]=e.substr(r,s-r).trim(),r=s+1}return t[n]=e.substring(r).trim(),n+1},t}(),n=function(){};t.TextureAtlasPage=n;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=s}(n||(n={})),function(t){var e=function(){function e(e,i){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,this.active=!1,null==e)throw new Error("data cannot be null.");if(null==i)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(var n=0;n0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,d=this.data.offsetShearY*u,f=this.bones,p=0,v=f.length;pt.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R*=e;var E=Math.cos(R),T=Math.sin(R);g.a=E*y-T*w,g.b=E*x-T*M,g.c=T*y+E*w,g.d=T*x+E*M,m=!0}if(0!=i){var A=this.temp;s.localToWorld(A.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(A.x-g.worldX)*i,g.worldY+=(A.y-g.worldY)*i,m=!0}if(n>0){var b=Math.sqrt(g.a*g.a+g.c*g.c),S=Math.sqrt(a*a+h*h);b>1e-5&&(b=(b+(S-b+this.data.offsetScaleX)*n)/b),g.a*=b,g.c*=b,b=Math.sqrt(g.b*g.b+g.d*g.d),S=Math.sqrt(o*o+l*l),b>1e-5&&(b=(b+(S-b+this.data.offsetScaleY)*n)/b),g.b*=b,g.d*=b,m=!0}if(r>0){x=g.b,M=g.d;var R,I=Math.atan2(M,x);(R=Math.atan2(l,o)-Math.atan2(h,a)-(I-Math.atan2(g.c,g.a)))>t.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R=I+(R+d)*r;b=Math.sqrt(x*x+M*M);g.b=Math.cos(R)*b,g.d=Math.sin(R)*b,m=!0}m&&(g.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,i=this.translateMix,n=this.scaleMix,r=this.shearMix,s=this.target,a=s.a,o=s.b,h=s.c,l=s.d,u=a*l-o*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,d=this.data.offsetShearY*u,f=this.bones,p=0,v=f.length;pt.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2),S*=e;var E=Math.cos(S),T=Math.sin(S);g.a=E*y-T*w,g.b=E*x-T*M,g.c=T*y+E*w,g.d=T*x+E*M,m=!0}if(0!=i){var A=this.temp;s.localToWorld(A.set(this.data.offsetX,this.data.offsetY)),g.worldX+=A.x*i,g.worldY+=A.y*i,m=!0}if(n>0){var b=(Math.sqrt(a*a+h*h)-1+this.data.offsetScaleX)*n+1;g.a*=b,g.c*=b,b=(Math.sqrt(o*o+l*l)-1+this.data.offsetScaleY)*n+1,g.b*=b,g.d*=b,m=!0}if(r>0){var S;(S=Math.atan2(l,o)-Math.atan2(h,a))>t.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2);x=g.b,M=g.d;S=Math.atan2(M,x)+(S-t.MathUtils.PI/2+d)*r;b=Math.sqrt(x*x+M*M);g.b=Math.cos(S)*b,g.d=Math.sin(S)*b,m=!0}m&&(g.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a1e-5&&(f=(f+(r.ascaleX-f+this.data.offsetScaleX)*i)/f),p>1e-5&&(p=(p+(r.ascaleY-p+this.data.offsetScaleY)*i)/p));var v=h.ashearY;if(0!=n){u=r.ashearY-v+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*n}h.updateWorldTransformWith(c,d,l,f,p,h.ashearX,v)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a1e-5&&(d*=(r.ascaleX-1+this.data.offsetScaleX)*i+1),f>1e-5&&(f*=(r.ascaleY-1+this.data.offsetScaleY)*i+1));var p=h.ashearY;0!=n&&(p+=(r.ashearY+this.data.offsetShearY)*n),h.updateWorldTransformWith(u,c,l,d,f,h.ashearX,p)}},e}();t.TransformConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i.rotateMix=0,i.translateMix=0,i.scaleMix=0,i.shearMix=0,i.offsetRotation=0,i.offsetX=0,i.offsetY=0,i.offsetScaleX=0,i.offsetScaleY=0,i.offsetShearY=0,i.relative=!1,i.local=!1,i}return r(e,t),e}(t.ConstraintData);t.TransformConstraintData=e}(n||(n={})),function(t){var e=function(){function e(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new t.Pool((function(){return new Array})),this.polygonIndicesPool=new t.Pool((function(){return new Array}))}return e.prototype.triangulate=function(t){var i=t,n=t.length>>1,r=this.indicesArray;r.length=0;for(var s=0;s3;){for(var l=n-1,u=(s=0,1);;){t:if(!a[s]){for(var c=r[l]<<1,d=r[s]<<1,f=r[u]<<1,p=i[c],v=i[c+1],g=i[d],m=i[d+1],y=i[f],x=i[f+1],w=(u+1)%n;w!=l;w=(w+1)%n)if(a[w]){var M=r[w]<<1,E=i[M],T=i[M+1];if(e.positiveArea(y,x,p,v,E,T)&&e.positiveArea(p,v,g,m,E,T)&&e.positiveArea(g,m,y,x,E,T))break t}break}if(0==u){do{if(!a[s])break;s--}while(s>0);break}l=s,s=u,u=(u+1)%n}h.push(r[(n+s-1)%n]),h.push(r[s]),h.push(r[(s+1)%n]),r.splice(s,1),a.splice(s,1);var A=(--n+s-1)%n,b=s==n?0:s;a[A]=e.isConcave(A,n,i,r),a[b]=e.isConcave(b,n,i,r)}return 3==n&&(h.push(r[2]),h.push(r[0]),h.push(r[1])),h},e.prototype.decompose=function(t,i){var n=t,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var s=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(s),s.length=0;var a=this.polygonIndicesPool.obtain();a.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,u=0,c=i.length;u0?(r.push(o),s.push(a)):(this.polygonPool.free(o),this.polygonIndicesPool.free(a)),(o=this.polygonPool.obtain()).length=0,o.push(v),o.push(g),o.push(m),o.push(y),o.push(x),o.push(w),(a=this.polygonIndicesPool.obtain()).length=0,a.push(d),a.push(f),a.push(p),l=e.winding(v,g,m,y,x,w),h=d)}o.length>0&&(r.push(o),s.push(a));for(u=0,c=r.length;u=0;u--)0==(o=r[u]).length&&(r.splice(u,1),this.polygonPool.free(o),a=s[u],s.splice(u,1),this.polygonIndicesPool.free(a));return r},e.isConcave=function(t,e,i,n){var r=n[(e+t-1)%e]<<1,s=n[t]<<1,a=n[(t+1)%e]<<1;return!this.positiveArea(i[r],i[r+1],i[s],i[s+1],i[a],i[a+1])},e.positiveArea=function(t,e,i,n,r,s){return t*(s-n)+i*(e-s)+r*(n-e)>=0},e.winding=function(t,e,i,n,r,s){var a=i-t,o=n-e;return r*o-s*a+a*e-t*o>=0?1:-1},e}();t.Triangulator=e}(n||(n={})),function(t){var e=function(){function t(){this.array=new Array}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return null!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t}();t.IntSet=e;var i=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.r=t,this.g=e,this.b=i,this.a=n}return t.prototype.set=function(t,e,i,n){return this.r=t,this.g=e,this.b=i,this.a=n,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,i,n){return this.r+=t,this.g+=e,this.b+=i,this.a+=n,this.clamp(),this},t.prototype.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.rgba8888ToColor=function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},t.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();t.Color=i;var n=function(){function t(){}return t.clamp=function(t,e,i){return ti?i:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,i){return t.randomTriangularWith(e,i,.5*(e+i))},t.randomTriangularWith=function(t,e,i){var n=Math.random(),r=e-t;return n<=(i-t)/r?t+Math.sqrt(n*r*(i-t)):e-Math.sqrt((1-n)*r*(e-i))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();t.MathUtils=n;var s=function(){function t(){}return t.prototype.apply=function(t,e,i){return t+(e-t)*this.applyInternal(i)},t}();t.Interpolation=s;var a=function(t){function e(e){var i=t.call(this)||this;return i.power=2,i.power=e,i}return r(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1},e}(s);t.Pow=a;var o=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(a);t.PowOut=o;var h=function(){function t(){}return t.arrayCopy=function(t,e,i,n,r){for(var s=e,a=n;s=i?e:t.setArraySize(e,i,n)},t.newArray=function(t,e){for(var i=new Array(t),n=0;n0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();t.TimeKeeper=d;var f=function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*s;var a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,d=0;d0&&(h=o);for(var w,M=(w=t.bone).worldX,E=w.worldY,T=w.a,A=w.b,b=w.c,S=w.d,R=e,I=r;I{var n=i(7473),r=i(4597),s=i(6732),a=i(2482),o=i(704),h=i(3137),l=i(1192),u=new n({Extends:h,initialize:function(t,e,i,n,s,u,c){var d,f,p,v=[],g=t.cacheManager.custom.spine;if(a(e)){var m=e;for(e=r(m,"key"),f=new o(t,{key:e,url:r(m,"jsonURL"),extension:r(m,"jsonExtension","json"),xhrSettings:r(m,"jsonXhrSettings")}),n=r(m,"atlasURL"),s=r(m,"preMultipliedAlpha"),Array.isArray(n)||(n=[n]),d=0;d{var n=i(2494),r=i(7473),s=i(5851),a=i(3527),o=i(5722),h=i(5159),l=i(3524),u=i(8332),c=i(5782),d=i(1984),f=new r({Extends:o,initialize:function(t,e,i){o.call(this,t,e,i);var r=e.game;this.isWebGL=2===r.config.renderType,this.cache=r.cache.addCustom("spine"),this.spineTextures=r.cache.addCustom("spineTextures"),this.json=r.cache.json,this.textures=r.textures,this.drawDebug=!1,this.gl,this.renderer,this.sceneRenderer,this.skeletonRenderer,this.skeletonDebugRenderer,this.plugin=h,this.temp1,this.temp2,this.isWebGL?(this.runtime=h.webgl,this.renderer=r.renderer,this.gl=r.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=r.renderer,this.getAtlas=this.getAtlasCanvas),this.renderer||(this.renderer={width:r.scale.width,height:r.scale.height,preRender:d,postRender:d,render:d,destroy:d});var a=this.isWebGL;e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",(function(t,e,n,r,s){a&&this.scene.sys.renderer.pipelines.clear();var o=this.scene.sys[i],h=new u(this.scene,o,t,e,n,r,s);return this.displayList.add(h),this.updateList.add(h),a&&this.scene.sys.renderer.pipelines.rebind(),h}),(function(t,e){void 0===t&&(t={}),a&&this.scene.sys.renderer.pipelines.clear();var r=s(t,"key",null),o=s(t,"animationName",null),h=s(t,"loop",!1),l=this.scene.sys[i],c=new u(this.scene,l,0,0,r,o,h);void 0!==e&&(t.add=e),n(this.scene,c,t);var d=s(t,"skinName",!1);d&&c.setSkinByName(d);var f=s(t,"slotName",!1),p=s(t,"attachmentName",null);return f&&c.setAttachment(f,p),a&&this.scene.sys.renderer.pipelines.rebind(),c.refresh()})),e.registerGameObject("spineContainer",(function(t,e,n){var r=this.scene.sys[i],s=new c(this.scene,r,t,e,n);return this.displayList.add(s),s}),(function(t,e){void 0===t&&(t={});var r=s(t,"x",0),a=s(t,"y",0),o=s(t,"children",null),h=this.scene.sys[i],l=new c(this.scene,h,r,a,o);return void 0!==e&&(t.add=e),n(this.scene,l,t),l}))},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(a,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this),this.game.events.once("destroy",this.gameDestroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){var t=function(t,e){if(t!==this.srcBlend||e!==this.dstBlend){var i=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),i.blendFunc(this.srcBlend,this.dstBlend))}},e=this.renderer.spineSceneRenderer;e||((e=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0)).batcher.setBlendMode=t,e.shapes.setBlendMode=t,this.renderer.spineSceneRenderer=e),this.sceneRenderer=e,this.skeletonRenderer=e.skeletonRenderer,this.skeletonDebugRenderer=e.skeletonDebugRenderer,this.temp1=new h.webgl.Vector3(0,0,0),this.temp2=new h.webgl.Vector3(0,0,0)},getAtlasCanvas:function(t){var e=this.cache.get(t);if(e){var i,n=this.spineTextures;if(n.has(t))i=n.get(t);else{var r=this.textures;i=new h.TextureAtlas(e.data,(function(i){return new h.canvas.CanvasTexture(r.get(e.prefix+t+":"+i).getSourceImage())}))}return i}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var i,n=this.spineTextures;if(n.has(t))i=n.get(t);else{var r=this.textures,s=this.sceneRenderer.context.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i=new h.TextureAtlas(e.data,(function(i){return new h.webgl.GLTexture(s,r.get(e.prefix+t+":"+i).getSourceImage(),!1)}))}return i}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,i,n,r,s,a){var o;if(a=a||{},Array.isArray(t))for(var h=0;h{var n=i(7473),r=i(7361),s=i(7738),a=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,n,s){r.call(this,t,i,n,s),this.type="Spine",this.plugin=e},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null,this.plugin=null}});t.exports=a},8064:t=>{t.exports=function(t,e,i,n){var r=e.list;if(0!==r.length){i.addToRenderList(e);var s=e.localTransform;n?(s.loadIdentity(),s.multiply(n),s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.scaleX,e.scaleY)):s.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var n=i(1984),r=i(1984);r=i(8064),t.exports={renderWebGL:n,renderCanvas:r}},6576:t=>{t.exports="complete"},8621:t=>{t.exports="dispose"},8944:t=>{t.exports="end"},7494:t=>{t.exports="event"},1908:t=>{t.exports="interrupted"},5591:t=>{t.exports="start"},5146:(t,e,i)=>{t.exports={COMPLETE:i(6576),DISPOSE:i(8621),END:i(8944),EVENT:i(7494),INTERRUPTED:i(1908),START:i(5591)}},8332:(t,e,i)=>{var n=i(6412),r=i(2915),s=i(7473),a=i(1991),o=i(3131),h=i(9660),l=i(4627),u=i(3212),c=i(8414),d=i(3426),f=i(7149),p=i(2273),v=i(4208),g=i(5146),m=i(2762),y=new s({Extends:p,Mixins:[a,o,h,l,u,c,m],initialize:function(t,e,i,n,r,s,a){p.call(this,t,"Spine"),this.plugin=e,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null,this.root=null,this.bounds=null,this.drawDebug=!1,this.timeScale=1,this.displayOriginX=0,this.displayOriginY=0,this.preMultipliedAlpha=!1,this.blendMode=-1,this.setPosition(i,n),r&&this.setSkeleton(r,s,a)},willRender:function(t,e){var i=!this.skeleton||!(15!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id);if(!e&&!i&&this.parentContainer){var n=this.plugin,r=n.sceneRenderer;n.gl&&r.batcher.isDrawing&&(r.end(),n.renderer.pipelines.rebind())}return i},setAlpha:function(t,e){if(void 0===t&&(t=1),e){var i=this.findSlot(e);i&&(i.color.a=r(t,0,1))}else this.alpha=t;return this},alpha:{get:function(){return this.skeleton.color.a},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.a=e),0===e?this.renderFlags&=-3:this.renderFlags|=2}},red:{get:function(){return this.skeleton.color.r},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.r=e)}},green:{get:function(){return this.skeleton.color.g},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.g=e)}},blue:{get:function(){return this.skeleton.color.b},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.b=e)}},setColor:function(t,e){void 0===t&&(t=16777215);var i=(t>>16&255)/255,n=(t>>8&255)/255,r=(255&t)/255,s=t>16777215?(t>>>24)/255:null,a=this.skeleton;if(e){var o=this.findSlot(e);o&&(a=o)}return a.color.r=i,a.color.g=n,a.color.b=r,null!==s&&(a.color.a=s),this},setSkeletonFromJSON:function(t,e,i,n){return this.setSkeleton(t,e,i,n)},setSkeleton:function(t,e,i,n){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,n);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkin(),s.setToSetupPose(),this.skeleton=s,r=this.plugin.createAnimationState(s),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=v(d(this.rotation))+90),this.state.apply(s),s.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=v(d(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,n){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===i&&(i=0),void 0===n&&(n=0),this.width=t,this.height=e,this.displayOriginX=r.x-i,this.displayOriginY=r.y-n,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,n=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=i,t.scaleY=n,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i{var n=i(3426),r=i(4208),s=i(8445);t.exports=function(t,e,i,a){var o=t.currentContext,h=e.plugin,l=e.skeleton,u=h.skeletonRenderer,c=t._tempMatrix1,d=t._tempMatrix2,f=t._tempMatrix3;i.addToRenderList(e),d.applyITRS(e.x,e.y,e.rotation,Math.abs(e.scaleX),Math.abs(e.scaleY)),c.copyFrom(i.matrix),a?(c.multiplyWithOffset(a,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),d.e=e.x,d.f=e.y,c.multiply(d,f)):(d.e-=i.scrollX*e.scrollFactorX,d.f-=i.scrollY*e.scrollFactorY,c.multiply(d,f)),l.x=f.tx,l.y=f.ty,l.scaleX=f.scaleX,l.scaleY=-1*f.scaleY,e.scaleX<0?(l.scaleX*=-1,e.root.rotation=r(f.rotationNormalized)):e.root.rotation=s(r(n(f.rotationNormalized))+90,0,360),e.scaleY<0&&(l.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*r(f.rotationNormalized):e.root.rotation+=2*r(f.rotationNormalized)),i.renderToTexture&&(l.y=f.ty,l.scaleY*=-1),l.updateWorldTransform(),u.ctx=o,u.debugRendering=h.drawDebug||e.drawDebug,o.save(),u.draw(l),o.restore()}},2762:(t,e,i)=>{var n=i(1984),r=i(1984),s=i(1984);r=i(2753),t.exports={renderWebGL:n,renderCanvas:r,renderDirect:s}},9454:(t,e,i)=>{var n={VERSION:"3.60.0-beta.20",BlendModes:i(8351),ScaleModes:i(8196),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},1081:(t,e,i)=>{var n=i(7473),r=i(6748),s=new n({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(r.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n{t.exports="changedata"},7801:t=>{t.exports="changedata-"},4873:t=>{t.exports="destroy"},9966:t=>{t.exports="removedata"},4586:t=>{t.exports="setdata"},6748:(t,e,i)=>{t.exports={CHANGE_DATA:i(9044),CHANGE_DATA_KEY:i(7801),DESTROY:i(4873),REMOVE_DATA:i(9966),SET_DATA:i(4586)}},3004:(t,e,i)=>{var n=i(2776),r={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return r;r.audioData=!!window.Audio,r.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var n=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(n||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(n)};if(r.ogg=i('ogg; codecs="vorbis"'),r.opus=i('ogg; codecs="opus"',"opus"),r.mp3=i("mpeg"),r.wav=i("wav"),r.m4a=i("x-m4a"),r.aac=i("aac"),r.flac=i("flac","x-flac"),r.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(n.edge)r.dolby=!0;else if(n.safari&&n.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var s=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===s&&a>=11||s>10)&&(r.dolby=!0)}}}catch(t){}return r}()},2776:(t,e,i)=>{var n,r=i(5203),s={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(n=navigator.userAgent,/Edg\/\d+/.test(n)?(s.edge=!0,s.es2019=!0):/OPR/.test(n)?(s.opera=!0,s.es2019=!0):/Chrome\/(\d+)/.test(n)&&!r.windowsPhone?(s.chrome=!0,s.chromeVersion=parseInt(RegExp.$1,10),s.es2019=s.chromeVersion>69):/Firefox\D+(\d+)/.test(n)?(s.firefox=!0,s.firefoxVersion=parseInt(RegExp.$1,10),s.es2019=s.firefoxVersion>10):/AppleWebKit/.test(n)&&r.iOS?s.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(s.ie=!0,s.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+) Safari/.test(n)&&!r.windowsPhone?(s.safari=!0,s.safariVersion=parseInt(RegExp.$1,10),s.es2019=s.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(s.ie=!0,s.trident=!0,s.tridentVersion=parseInt(RegExp.$1,10),s.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(s.silk=!0),s)},6505:(t,e,i)=>{var n,r,s,a=i(8073),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",r="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(s=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(s,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+r},s.src=n+"AP804Oa6"+r,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),n=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),n}()),o)},6543:(t,e,i)=>{var n=i(5203),r=i(2776),s=i(8073),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=s.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=s.create2D(this),n=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=n.data instanceof Uint8ClampedArray,s.remove(t),s.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!n.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},3922:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",n="FullScreen",r=["request"+i,"request"+n,"webkitRequest"+i,"webkitRequest"+n,"msRequest"+i,"msRequest"+n,"mozRequest"+n,"mozRequest"+i];for(t=0;t{var n=i(2776),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||n.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":n.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},5203:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},2131:t=>{var e={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=document.createElement("video"),i=!!t.canPlayType,n=/^no$/;try{i&&(t.canPlayType('video/ogg; codecs="theora"').replace(n,"")&&(e.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(n,"")&&(e.h264=!0,e.mp4=!0),t.canPlayType("video/x-m4v").replace(n,"")&&(e.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(n,"")&&(e.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(n,"")&&(e.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(n,"")&&(e.hls=!0))}catch(t){}return e}()},9356:(t,e,i)=>{t.exports={os:i(5203),browser:i(2776),features:i(6543),input:i(1454),audio:i(3004),video:i(2131),fullscreen:i(3922),canvasFeatures:i(6505)}},5686:(t,e,i)=>{var n=i(7473),r=new Float32Array(20),s=new n({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(t){return this._matrix.set(t),this._dirty=!0,this},reset:function(){var t=this._matrix;return t.fill(0),t[0]=1,t[6]=1,t[12]=1,t[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var t=this._data;return this._dirty&&(t.set(this._matrix),t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._dirty=!1),t},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,n=-.5*(i-1);return this.multiply([i,n,n,0,0,n,i,n,0,0,n,n,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),n=Math.sin(t),r=.213,s=.715,a=.072;return this.multiply([r+.787*i+n*-r,s+i*-s+n*-s,a+i*-a+.928*n,0,0,r+i*-r+.143*n,s+i*(1-s)+.14*n,a+i*-a+-.283*n,0,0,r+i*-r+-.787*n,s+i*-s+n*s,a+.928*i+n*a,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply(s.BLACK_WHITE,t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,n=-.5*(i-1);return this.multiply([i,0,0,0,n,0,i,0,0,n,0,0,i,0,n,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply(s.NEGATIVE,t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply(s.DESATURATE_LUMINANCE,t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply(s.SEPIA,t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply(s.LSD,t)},brown:function(t){return void 0===t&&(t=!1),this.multiply(s.BROWN,t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply(s.VINTAGE,t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply(s.KODACHROME,t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply(s.TECHNICOLOR,t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply(s.POLAROID,t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply(s.SHIFT_BGR,t)},multiply:function(t,e){void 0===e&&(e=!1),e||this.reset();var i=this._matrix,n=r;return n.set(i),i.set([n[0]*t[0]+n[1]*t[5]+n[2]*t[10]+n[3]*t[15],n[0]*t[1]+n[1]*t[6]+n[2]*t[11]+n[3]*t[16],n[0]*t[2]+n[1]*t[7]+n[2]*t[12]+n[3]*t[17],n[0]*t[3]+n[1]*t[8]+n[2]*t[13]+n[3]*t[18],n[0]*t[4]+n[1]*t[9]+n[2]*t[14]+n[3]*t[19]+n[4],n[5]*t[0]+n[6]*t[5]+n[7]*t[10]+n[8]*t[15],n[5]*t[1]+n[6]*t[6]+n[7]*t[11]+n[8]*t[16],n[5]*t[2]+n[6]*t[7]+n[7]*t[12]+n[8]*t[17],n[5]*t[3]+n[6]*t[8]+n[7]*t[13]+n[8]*t[18],n[5]*t[4]+n[6]*t[9]+n[7]*t[14]+n[8]*t[19]+n[9],n[10]*t[0]+n[11]*t[5]+n[12]*t[10]+n[13]*t[15],n[10]*t[1]+n[11]*t[6]+n[12]*t[11]+n[13]*t[16],n[10]*t[2]+n[11]*t[7]+n[12]*t[12]+n[13]*t[17],n[10]*t[3]+n[11]*t[8]+n[12]*t[13]+n[13]*t[18],n[10]*t[4]+n[11]*t[9]+n[12]*t[14]+n[13]*t[19]+n[14],n[15]*t[0]+n[16]*t[5]+n[17]*t[10]+n[18]*t[15],n[15]*t[1]+n[16]*t[6]+n[17]*t[11]+n[18]*t[16],n[15]*t[2]+n[16]*t[7]+n[17]*t[12]+n[18]*t[17],n[15]*t[3]+n[16]*t[8]+n[17]*t[13]+n[18]*t[18],n[15]*t[4]+n[16]*t[9]+n[17]*t[14]+n[18]*t[19]+n[19]]),this._dirty=!0,this}});s.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],s.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],s.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],s.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],s.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],s.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],s.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],s.KODACHROME=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],s.TECHNICOLOR=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],s.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],s.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t.exports=s},8073:(t,e,i)=>{var n,r,s,a=i(9454),o=i(2150),h=[],l=!1;t.exports=(s=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return n(t,e,i,a.CANVAS)},create:n=function(t,e,i,n,s){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=a.CANVAS),void 0===s&&(s=!1);var c=r(n);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:n},n===a.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),s&&(c.parent=u),u.width=e,u.height=i,l&&n===a.CANVAS&&o.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return n(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:r=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{var n=i(7473),r=i(3649),s=new n({initialize:function(t,e,i,n,r,s){e||(e=t.sys.make.image({x:i,y:n,key:r,frame:s,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});r.register("bitmapMask",(function(t,e,i,n,r){return new s(this.scene,t,e,i,n,r)})),t.exports=s},6726:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var n=t.gl;t.flush(),0===t.maskStack.length&&(n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var n=t.gl,r=this.geometryMask,s=t.maskCount,a=255;n.colorMask(!1,!1,!1,!1),i?(n.stencilFunc(n.EQUAL,s,a),n.stencilOp(n.KEEP,n.KEEP,n.INCR),s++):(n.stencilFunc(n.EQUAL,s+1,a),n.stencilOp(n.KEEP,n.KEEP,n.DECR)),this.level=s,r.renderWebGL(t,r,e),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),this.invertAlpha?n.stencilFunc(n.NOTEQUAL,s,a):n.stencilFunc(n.EQUAL,s,a)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var n=t.maskStack[t.maskStack.length-1];n.mask.applyStencil(t,n.camera,!1),t.currentCameraMask.mask!==n.mask?(i.mask=n.mask,i.camera=n.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},8325:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,s.BARREL,t),this.amount=e}});t.exports=a},5170:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h){void 0===i&&(i=1),void 0===n&&(n=1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=4),r.call(this,s.BLOOM,t),this.steps=h,this.offsetX=i,this.offsetY=n,this.blurStrength=a,this.strength=o,this.glcolor=[1,1,1],null!=e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4199:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h){void 0===e&&(e=0),void 0===i&&(i=2),void 0===n&&(n=2),void 0===a&&(a=1),void 0===h&&(h=4),r.call(this,s.BLUR,t),this.quality=0,this.x=i,this.y=n,this.steps=h,this.strength=a,this.glcolor=[1,1,1],null!=o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},3132:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===n&&(n=.2),void 0===a&&(a=!1),void 0===o&&(o=1),void 0===h&&(h=1),void 0===l&&(l=1),r.call(this,s.BOKEH,t),this.radius=e,this.amount=i,this.contrast=n,this.isTiltShift=a,this.strength=l,this.blurX=o,this.blurY=h}});t.exports=a},6610:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o){void 0===e&&(e=8),void 0===a&&(a=1),void 0===o&&(o=.005),r.call(this,s.CIRCLE,t),this.scale=a,this.feather=o,this.thickness=e,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],null!=i&&(this.color=i),null!=n&&(this.backgroundColor=n)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundColor:{get:function(){var t=this.glcolor2;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor2;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4931:(t,e,i)=>{var n=i(7473),r=i(5686),s=i(1571),a=new n({Extends:r,initialize:function(t){r.call(this),this.type=s.COLOR_MATRIX,this.gameObject=t,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});t.exports=a},6128:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e){this.type=t,this.gameObject=e,this.active=!0},destroy:function(){this.gameObject=null,this.active=!1}});t.exports=n},9195:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===n&&(n=.005),r.call(this,s.DISPLACEMENT,t),this.x=i,this.y=n,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.gameObject.scene.sys.textures.getFrame(t);e&&(this.glTexture=e.glTexture)}});t.exports=a},445:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===i&&(i=4),void 0===n&&(n=0),void 0===a&&(a=!1),r.call(this,s.GLOW,t),this.outerStrength=i,this.innerStrength=n,this.knockout=a,this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},7724:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l,u){void 0===n&&(n=.2),void 0===a&&(a=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l=1),void 0===u&&(u=0),r.call(this,s.GRADIENT,t),this.alpha=n,this.size=u,this.fromX=a,this.fromY=o,this.toX=h,this.toY=l,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],null!=e&&(this.color1=e),null!=i&&(this.color2=i)},color1:{get:function(){var t=this.glcolor1;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor1;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}},color2:{get:function(){var t=this.glcolor2;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor2;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}}});t.exports=a},4412:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,s.PIXELATE,t),this.amount=e}});t.exports=a},75:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=.1),void 0===a&&(a=1),void 0===h&&(h=6),void 0===l&&(l=1),r.call(this,s.SHADOW,t),this.x=e,this.y=i,this.decay=n,this.power=a,this.glcolor=[0,0,0,1],this.samples=h,this.intensity=l,void 0!==o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},8734:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===n&&(n=3),void 0===a&&(a=!1),r.call(this,s.SHINE,t),this.speed=e,this.lineWidth=i,this.gradient=n,this.reveal=a}});t.exports=a},2437:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===a&&(a=.5),r.call(this,s.VIGNETTE,t),this.x=e,this.y=i,this.radius=n,this.strength=a}});t.exports=a},5984:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=!1),r.call(this,s.WIPE,t),this.progress=0,this.wipeWidth=e,this.direction=i,this.axis=n,this.reveal=a}});t.exports=a},1571:t=>{t.exports={GLOW:4,SHADOW:5,PIXELATE:6,VIGNETTE:7,SHINE:8,BLUR:9,GRADIENT:12,BLOOM:13,COLOR_MATRIX:14,CIRCLE:15,BARREL:16,DISPLACEMENT:17,WIPE:18,BOKEH:19}},7347:(t,e,i)=>{var n=i(1030),r=i(1571),s={Barrel:i(8325),Controller:i(6128),Bloom:i(5170),Blur:i(4199),Bokeh:i(3132),Circle:i(6610),ColorMatrix:i(4931),Displacement:i(9195),Glow:i(445),Gradient:i(7724),Pixelate:i(4412),Shadow:i(75),Shine:i(8734),Vignette:i(2437),Wipe:i(5984)};s=n(!1,s,r),t.exports=s},2494:(t,e,i)=>{var n=i(8351),r=i(8361);t.exports=function(t,e,i){e.x=r(i,"x",0),e.y=r(i,"y",0),e.depth=r(i,"depth",0),e.flipX=r(i,"flipX",!1),e.flipY=r(i,"flipY",!1);var s=r(i,"scale",null);"number"==typeof s?e.setScale(s):null!==s&&(e.scaleX=r(s,"x",1),e.scaleY=r(s,"y",1));var a=r(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=r(a,"x",1),e.scrollFactorY=r(a,"y",1)),e.rotation=r(i,"rotation",0);var o=r(i,"angle",null);null!==o&&(e.angle=o),e.alpha=r(i,"alpha",1);var h=r(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),u=r(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=r(i,"blendMode",n.NORMAL),e.visible=r(i,"visible",!0),r(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},2273:(t,e,i)=>{var n=i(7473),r=i(6125),s=i(1081),a=i(4399),o=i(3389),h=i(204),l=new n({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new s(this)),this},setData:function(t,e){return this.data||(this.data=new s(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new s(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new s(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new s(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.preFX&&(this.preFX.destroy(),this.preFX=void 0),this.postFX&&(this.postFX.destroy(),this.postFX=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},3649:(t,e,i)=>{var n=i(7473),r=i(8456),s=i(204),a=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(s.BOOT,this.boot,this),this.events.on(s.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(s.DESTROY,this.destroy,this)},start:function(){this.events.once(s.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(s.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(s.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectFactory",a,"add"),t.exports=a},4344:(t,e,i)=>{var n=i(2915),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,r){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=r},4518:(t,e,i)=>{var n=i(2915),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=r},5173:(t,e,i)=>{var n=i(8351),r={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=r},1991:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},8305:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},3131:t=>{var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},1626:(t,e,i)=>{var n=i(7473),r=i(7347),s=i(8935),a=new n({initialize:function(t,e){this.gameObject=t,this.isPost=e,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(t){return void 0===t&&(t=0),this.padding=t,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(t){var e=this.gameObject.scene.sys.renderer;e&&e.pipelines?(this.gameObject.pipeline=e.pipelines.FX_PIPELINE,void 0!==t&&(this.padding=t),this.enabled=!0):this.enabled=!1},clear:function(){for(var t=this.list,e=0;e{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},3671:(t,e,i)=>{var n=i(1392),r=i(9876),s=i(2529),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&r(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t){return void 0===t&&(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,r,s,a,o,h,l;if(void 0===t&&(t=new n),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),r=t.x,s=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),r=t.x,s=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,r,a,h),t.y=Math.min(i,s,o,l),t.width=Math.max(e,r,a,h)-t.x,t.height=Math.max(i,s,o,l)-t.y,t}};t.exports=a},2246:(t,e,i)=>{var n=i(7499),r=i(6726),s={mask:null,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},createBitmapMask:function(t,e,i,r,s){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new n(this.scene,t,e,i,r,s)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new r(this.scene,t)}};t.exports=s},5085:t=>{var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},77:(t,e,i)=>{var n=i(7149),r=i(1864),s=i(5851),a=i(3747),o=i(2529),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=s(t,"from",0),t.to=s(t,"to",1);var h=r(t,"positionOnPath",!1);this.rotateToPath=r(t,"rotateToPath",!1),this.pathRotationOffset=s(t,"rotationOffset",0);var l=s(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+n(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,r=this.pathVector;if(i.copy(r).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,r),i.add(r),r.add(this.pathOffset),void this.setPosition(r.x,r.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),r),i.add(r),r.add(this.pathOffset);var s=this.x,o=this.y;this.setPosition(r.x,r.y);var h=this.x-s,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+n(this.pathRotationOffset))}}};t.exports=h},986:(t,e,i)=>{var n=i(3911),r={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(t){this.pipelineData={};var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(i){void 0===t&&(t=i.default);var n=i.get(t);if(n)return this.defaultPipeline=n,this.pipeline=n,!0}return!1},setPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){var a=s.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?n(e):e)}return this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},resetPipeline:function(t){return void 0===t&&(t=!1),this.pipeline=this.defaultPipeline,t&&(this.pipelineData={}),null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=r},4461:(t,e,i)=>{var n=i(3911),r=i(1626),s=i(8935),a={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(t){this.postPipelines=[],this.postPipelineData={},this.postFX=new r(this,!0),t&&(this.preFX=new r(this,!1))},setPostPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){Array.isArray(t)||(t=[t]);for(var a=0;a0,this},setPostPipelineData:function(t,e){var i=this.postPipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,n=[],r=0;r=0;i--){var n=e[i];("string"==typeof t&&n.name===t||"string"!=typeof t&&n instanceof t)&&(n.destroy(),s(e,i))}return this.hasPostPipeline=this.postPipelines.length>0,this}};t.exports=a},4627:t=>{var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},1868:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},4976:(t,e,i)=>{var n=i(2362),r={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof n?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=r},9243:(t,e,i)=>{var n=i(2362),r={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof n?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=r},5693:t=>{var e={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,n){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,n=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=n,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=e},6125:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},3212:(t,e,i)=>{var n=i(7425),r=i(4227),s=i(7556),a=i(3692),o=i(2820),h=i(2529),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:0!==this._scaleY&&(this.renderFlags|=4)}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:0!==this._scaleX&&(this.renderFlags|=4)}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(e||(e=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,n){i||(i=new h),n||(n=this.scene.sys.cameras.main);var r=n.scrollX,a=n.scrollY,o=t+r*this.scrollFactorX-r,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):s(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},4227:(t,e,i)=>{var n=i(7473),r=i(7425),s=i(2529),a=new n({initialize:function(t,e,i,n,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),this.matrix=new Float32Array([t,e,i,n,r,s,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):n||s?r.TAU-(s>0?Math.acos(-n/this.scaleY):-Math.acos(n/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,r=n[0],s=n[1],a=n[2],o=n[3];return n[0]=r*i+a*e,n[1]=s*i+o*e,n[2]=r*-e+a*i,n[3]=s*-e+o*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,r=i[0],s=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],v=n[5],g=void 0===e?i:e.matrix;return g[0]=u*r+c*a,g[1]=u*s+c*o,g[2]=d*r+f*a,g[3]=d*s+f*o,g[4]=p*r+v*a+h,g[5]=p*s+v*o+l,g},multiplyWithOffset:function(t,e,i){var n=this.matrix,r=t.matrix,s=n[0],a=n[1],o=n[2],h=n[3],l=e*s+i*o+n[4],u=e*a+i*h+n[5],c=r[0],d=r[1],f=r[2],p=r[3],v=r[4],g=r[5];return n[0]=c*s+d*o,n[1]=c*a+d*h,n[2]=f*s+p*o,n[3]=f*a+p*h,n[4]=v*s+g*o+l,n[5]=v*a+g*h+u,this},transform:function(t,e,i,n,r,s){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+n*l,a[3]=i*h+n*u,a[4]=r*o+s*l+c,a[5]=r*h+s*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,r=n[0],s=n[1],a=n[2],o=n[3],h=n[4],l=n[5];return i.x=t*r+e*a+h,i.y=t*s+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=e*r-i*n;return t[0]=r/o,t[1]=-i/o,t[2]=-n/o,t[3]=e/o,t[4]=(n*a-r*s)/o,t[5]=-(e*a-i*s)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,r,s){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=n,a[4]=r,a[5]=s,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],r=e[2],s=e[3],a=i*s-n*r;if(t.translateX=e[4],t.translateY=e[5],i||n){var o=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(r||s){var h=Math.sqrt(r*r+s*s);t.rotation=.5*Math.PI-(s>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,n,r){var s=this.matrix,a=Math.sin(i),o=Math.cos(i);return s[4]=t,s[5]=e,s[0]=o*n,s[1]=a*n,s[2]=-a*r,s[3]=o*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],a=n[1],o=n[2],h=n[3],l=n[4],u=n[5],c=1/(r*h+o*-a);return i.x=h*c*t+-o*c*e+(u*o-l*h)*c,i.y=r*c*e+-a*c*t+(-u*r+l*a)*c,i},setQuad:function(t,e,i,n,r,s){void 0===s&&(s=this.quad);var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return s[0]=t*o+e*l+c,s[1]=t*h+e*u+d,s[2]=t*o+n*l+c,s[3]=t*h+n*u+d,s[4]=i*o+n*l+c,s[5]=i*h+n*u+d,s[6]=i*o+e*l+c,s[7]=i*h+e*u+d,r&&s.forEach((function(t,e){s[e]=Math.round(t)})),s},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var n=this.getX(t,e);return i&&(n=Math.round(n)),n},getYRound:function(t,e,i){var n=this.getY(t,e);return i&&(n=Math.round(n)),n},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},8414:t=>{var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},4286:(t,e,i)=>{t.exports={Alpha:i(4344),AlphaSingle:i(4518),BlendMode:i(5173),ComputedSize:i(1991),Crop:i(8305),Depth:i(3131),Flip:i(9660),FX:i(1626),GetBounds:i(3671),Mask:i(2246),Origin:i(5085),PathFollower:i(77),Pipeline:i(986),PostPipeline:i(4461),ScrollFactor:i(4627),Size:i(1868),Texture:i(4976),TextureCrop:i(9243),Tint:i(5693),ToJSON:i(6125),Transform:i(3212),TransformMatrix:i(4227),Visible:i(8414)}},7361:(t,e,i)=>{var n=i(1953),r=i(8351),s=i(7473),a=i(4286),o=i(3389),h=i(2273),l=i(1392),u=i(3232),c=i(9422),d=i(2529),f=new s({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.PostPipeline,a.Transform,a.Visible,u],initialize:function(t,e,i,n){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(e,i),this.setBlendMode(r.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,n=new l,r=!1;t.setEmpty();for(var s=0;s-1},setAll:function(t,e,i,r){return n.SetAll(this.list,t,e,i,r),this},each:function(t,e){var i,n=[null],r=this.list.slice(),s=r.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},2840:t=>{t.exports=function(t,e,i,n){i.addToRenderList(e);var r=e.list;if(0!==r.length){var s=e.localTransform;n?(s.loadIdentity(),s.multiply(n),s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.scaleX,e.scaleY)):s.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var n=i(1984),r=n,s=n;s=i(2840),t.exports={renderWebGL:r,renderCanvas:s}},6608:t=>{t.exports="addedtoscene"},4265:t=>{t.exports="destroy"},8671:t=>{t.exports="removedfromscene"},3420:t=>{t.exports="complete"},601:t=>{t.exports="created"},7919:t=>{t.exports="error"},5241:t=>{t.exports="loop"},3356:t=>{t.exports="play"},7513:t=>{t.exports="seeked"},5788:t=>{t.exports="seeking"},8118:t=>{t.exports="stop"},5529:t=>{t.exports="timeout"},4287:t=>{t.exports="unlocked"},3389:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(6608),DESTROY:i(4265),REMOVED_FROM_SCENE:i(8671),VIDEO_COMPLETE:i(3420),VIDEO_CREATED:i(601),VIDEO_ERROR:i(7919),VIDEO_LOOP:i(5241),VIDEO_PLAY:i(3356),VIDEO_SEEKED:i(7513),VIDEO_SEEKING:i(5788),VIDEO_STOP:i(8118),VIDEO_TIMEOUT:i(5529),VIDEO_UNLOCKED:i(4287)}},1643:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},8881:(t,e,i)=>{var n=i(7655);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},4479:(t,e,i)=>{var n=i(4771),r=i(7655);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=n(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;u{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},284:(t,e,i)=>{var n=i(7473),r=i(8881),s=i(4479),a=i(1643),o=i(3915),h=i(2529),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=n},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return s(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},3915:(t,e,i)=>{var n=i(7655);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},7655:(t,e,i)=>{var n=i(7473),r=i(1643),s=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=r.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=s},5956:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},716:(t,e,i)=>{var n=i(7120),r=i(7655);t.exports=function(t,e,i){if(void 0===i&&(i=new r),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var s=n(t)*e;return e>.5?(s-=t.width+t.height)<=t.width?(i.x=t.right-s,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(s-t.width)):s<=t.width?(i.x=t.x+s,i.y=t.y):(i.x=t.right,i.y=t.y+(s-t.width)),i}},8151:(t,e,i)=>{var n=i(716),r=i(7120);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=r(t)/i);for(var a=0;a{t.exports=function(t){return 2*(t.width+t.height)}},2161:(t,e,i)=>{var n=i(7655);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},1392:(t,e,i)=>{var n=i(7473),r=i(5956),s=i(716),a=i(8151),o=i(1643),h=i(284),l=i(2161),u=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},9422:(t,e,i)=>{var n=i(1392);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=Math.min(t.x,e.x),s=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-r,o=Math.max(t.bottom,e.bottom)-s;return i.setTo(r,s,a,o)}},1593:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1179),a=i(4597),o=i(5593),h=i(7410),l=i(5874),u=i(707),c=new n({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var n=a(e,"url");void 0===n?n=t.path+i+"."+a(e,"extension",""):"string"!=typeof n||n.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(n=t.path+n),this.url=n,this.src="",this.xhrSettings=u(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===r.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=r.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,n=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(n=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,n)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(s.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==r.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(s.FILE_COMPLETE,e,i,t),this.loader.emit(s.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=r.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},9845:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},5593:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},7410:(t,e,i)=>{var n=i(1030),r=i(707);t.exports=function(t,e){var i=void 0===t?r():n({},t);if(e)for(var s in e)void 0!==e[s]&&(i[s]=e[s]);return i}},3137:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1179),a=new n({initialize:function(t,e,i,n){var s=[];n.forEach((function(t){t&&s.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=s,this.state=r.FILE_PENDING,this.complete=!1,this.pending=s.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a{var n=i(7410);t.exports=function(t,e){var i=n(e,t.xhrSettings),r=new XMLHttpRequest;if(r.open("GET",t.src,i.async,i.user,i.password),r.responseType=t.xhrSettings.responseType,r.timeout=i.timeout,i.headers)for(var s in i.headers)r.setRequestHeader(s,i.headers[s]);return i.header&&i.headerValue&&r.setRequestHeader(i.header,i.headerValue),i.requestedWith&&r.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&r.overrideMimeType(i.overrideMimeType),i.withCredentials&&(r.withCredentials=!0),r.onload=t.onLoad.bind(t,r),r.onerror=t.onError.bind(t,r),r.onprogress=t.onProgress.bind(t),r.send(),r}},707:t=>{t.exports=function(t,e,i,n,r,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=0),void 0===s&&(s=!1),{responseType:t,async:e,user:i,password:n,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:s}}},4359:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},462:t=>{t.exports="addfile"},7297:t=>{t.exports="complete"},8660:t=>{t.exports="filecomplete"},6484:t=>{t.exports="filecomplete-"},7972:t=>{t.exports="loaderror"},1906:t=>{t.exports="load"},1441:t=>{t.exports="fileprogress"},1072:t=>{t.exports="postprocess"},1927:t=>{t.exports="progress"},6597:t=>{t.exports="start"},1179:(t,e,i)=>{t.exports={ADD:i(462),COMPLETE:i(7297),FILE_COMPLETE:i(8660),FILE_KEY_COMPLETE:i(6484),FILE_LOAD_ERROR:i(7972),FILE_LOAD:i(1906),FILE_PROGRESS:i(1441),POST_PROCESS:i(1072),PROGRESS:i(1927),START:i(6597)}},6732:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(2482),l=i(5593),u=new n({Extends:s,initialize:function t(e,i,n,r,a){var l,u="png";if(h(i)){var c=i;i=o(c,"key"),n=o(c,"url"),l=o(c,"normalMap"),r=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"frameConfig")}Array.isArray(n)&&(l=n[1],n=n[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:n,xhrSettings:r,config:a};if(s.call(this,e,d),l){var f=new t(e,this.key,l,r,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){s.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){s.revokeObjectURL(t.data),t.onProcessError()},s.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=r.FILE_PROCESSING,t===r.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=r.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=r.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t?t.state>=r.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var n=0;n{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(5851),l=i(2482),u=new n({Extends:s,initialize:function(t,e,i,n,a){var u="json";if(l(e)){var c=e;e=o(c,"key"),i=o(c,"url"),n=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:a};s.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=r.FILE_POPULATED)},onProcess:function(){if(this.state!==r.FILE_POPULATED){this.state=r.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(2482),l=new n({Extends:s,initialize:function(t,e,i,n){var r="text",a="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),n=o(u,"xhrSettings"),a=o(u,"extension",a),r=o(u,"type",r),l=o(u,"cache",l)}var c={type:r,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var n=0;n{t.exports=function(t){for(var e=0,i=0;i{var n=i(3916);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},7025:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},48:t=>{t.exports=function(t,e,i,n,r){var s=.5*(n-e),a=.5*(r-i),o=t*t;return(2*i-2*n+s+a)*(t*o)+(-3*i+3*n-2*s-a)*o+s*t+i}},5035:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},2915:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},7149:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t*n.DEG_TO_RAD}},2975:t=>{t.exports=function(t,e){return Math.abs(t-e)}},2107:(t,e,i)=>{var n=i(2915),r=i(7473),s=i(9652),a=i(1984),o=new s,h=new r({initialize:function t(e,i,n,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=t.DefaultOrder),this._x=e,this._y=i,this._z=n,this._order=r,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,n){return void 0===n&&(n=this._order),this._x=t,this._y=e,this._z=i,this._order=n,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var r=t.val,s=r[0],a=r[4],o=r[8],h=r[1],l=r[5],u=r[9],c=r[2],d=r[6],f=r[10],p=0,v=0,g=0,m=.99999;switch(e){case"XYZ":v=Math.asin(n(o,-1,1)),Math.abs(o){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},104:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},4941:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},1555:(t,e,i)=>{var n=i(2915);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))+e}},5005:t=>{t.exports=function(t,e){return t/e/1e3}},3702:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},8820:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},1743:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},3416:t=>{t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},2149:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*s-a*h,c=-l*r+a*o,d=h*r-s*o,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(a*i-n*s)*f,t[3]=c*f,t[4]=(l*e-n*o)*f,t[5]=(-a*e+n*r)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(s*e-i*r)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=s*l-a*h,t[1]=n*h-i*l,t[2]=i*a-n*s,t[3]=a*o-r*l,t[4]=e*l-n*o,t[5]=n*r-e*a,t[6]=r*h-s*o,t[7]=i*o-e*h,t[8]=e*s-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*s-a*h)+i*(-l*r+a*o)+n*(h*r-s*o)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],v=c[3],g=c[4],m=c[5],y=c[6],x=c[7],w=c[8];return e[0]=d*i+f*s+p*h,e[1]=d*n+f*a+p*l,e[2]=d*r+f*o+p*u,e[3]=v*i+g*s+m*h,e[4]=v*n+g*a+m*l,e[5]=v*r+g*o+m*u,e[6]=y*i+x*s+w*h,e[7]=y*n+x*a+w*l,e[8]=y*r+x*o+w*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*s,e[1]=l*n+h*a,e[2]=l*r+h*o,e[3]=l*s-h*i,e[4]=l*a-h*n,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,r=t.w,s=e+e,a=i+i,o=n+n,h=e*s,l=e*a,u=e*o,c=i*a,d=i*o,f=n*o,p=r*s,v=r*a,g=r*o,m=this.val;return m[0]=1-(c+f),m[3]=l+g,m[6]=u-v,m[1]=l-g,m[4]=1-(h+f),m[7]=d+p,m[2]=u+v,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],v=e[12],g=e[13],m=e[14],y=e[15],x=n*h-r*o,w=n*l-s*o,M=n*u-a*o,E=r*l-s*h,T=r*u-a*h,A=s*u-a*l,b=c*g-d*v,S=c*m-f*v,R=c*y-p*v,I=d*m-f*g,C=d*y-p*g,P=f*y-p*m,k=x*P-w*C+M*I+E*R-T*S+A*b;return k?(k=1/k,i[0]=(h*P-l*C+u*I)*k,i[1]=(l*R-o*P-u*S)*k,i[2]=(o*C-h*R+u*b)*k,i[3]=(s*C-r*P-a*I)*k,i[4]=(n*P-s*R+a*S)*k,i[5]=(r*R-n*C-a*b)*k,i[6]=(g*A-m*T+y*E)*k,i[7]=(m*M-v*A-y*w)*k,i[8]=(v*T-g*M+y*x)*k,this):null}});t.exports=n},9652:(t,e,i)=>{var n=i(7473),r=i(5689),s=1e-6,a=new n({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,n,r,s,a,o,h,l,u,c,d,f,p,v){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=n,g[4]=r,g[5]=s,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=u,g[11]=c,g[12]=d,g[13]=f,g[14]=p,g[15]=v,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var n=o.fromQuat(i).val,r=e.x,s=e.y,a=e.z;return this.setValues(n[0]*r,n[1]*r,n[2]*r,0,n[4]*s,n[5]*s,n[6]*s,0,n[8]*a,n[9]*a,n[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],r=t[6],s=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=n,t[13]=s,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15],m=e*a-i*s,y=e*o-n*s,x=e*h-r*s,w=i*o-n*a,M=i*h-r*a,E=n*h-r*o,T=l*p-u*f,A=l*v-c*f,b=l*g-d*f,S=u*v-c*p,R=u*g-d*p,I=c*g-d*v,C=m*I-y*R+x*S+w*b-M*A+E*T;return C?(C=1/C,this.setValues((a*I-o*R+h*S)*C,(n*R-i*I-r*S)*C,(p*E-v*M+g*w)*C,(c*M-u*E-d*w)*C,(o*b-s*I-h*A)*C,(e*I-n*b+r*A)*C,(v*x-f*E-g*y)*C,(l*E-c*x+d*y)*C,(s*R-a*b+h*T)*C,(i*b-e*R-r*T)*C,(f*M-p*x+g*m)*C,(u*x-l*M-d*m)*C,(a*A-s*S-o*T)*C,(e*S-i*A+n*T)*C,(p*y-f*w-v*m)*C,(l*w-u*y+c*m)*C)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return this.setValues(a*(c*g-d*v)-u*(o*g-h*v)+p*(o*d-h*c),-(i*(c*g-d*v)-u*(n*g-r*v)+p*(n*d-r*c)),i*(o*g-h*v)-a*(n*g-r*v)+p*(n*h-r*o),-(i*(o*d-h*c)-a*(n*d-r*c)+u*(n*h-r*o)),-(s*(c*g-d*v)-l*(o*g-h*v)+f*(o*d-h*c)),e*(c*g-d*v)-l*(n*g-r*v)+f*(n*d-r*c),-(e*(o*g-h*v)-s*(n*g-r*v)+f*(n*h-r*o)),e*(o*d-h*c)-s*(n*d-r*c)+l*(n*h-r*o),s*(u*g-d*p)-l*(a*g-h*p)+f*(a*d-h*u),-(e*(u*g-d*p)-l*(i*g-r*p)+f*(i*d-r*u)),e*(a*g-h*p)-s*(i*g-r*p)+f*(i*h-r*a),-(e*(a*d-h*u)-s*(i*d-r*u)+l*(i*h-r*a)),-(s*(u*v-c*p)-l*(a*v-o*p)+f*(a*c-o*u)),e*(u*v-c*p)-l*(i*v-n*p)+f*(i*c-n*u),-(e*(a*v-o*p)-s*(i*v-n*p)+f*(i*o-n*a)),e*(a*c-o*u)-s*(i*c-n*u)+l*(i*o-n*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return(e*a-i*s)*(c*g-d*v)-(e*o-n*s)*(u*g-d*p)+(e*h-r*s)*(u*v-c*p)+(i*o-n*a)*(l*g-d*f)-(i*h-r*a)*(l*v-c*f)+(n*h-r*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],v=e[13],g=e[14],m=e[15],y=t.val,x=y[0],w=y[1],M=y[2],E=y[3];return e[0]=x*i+w*a+M*u+E*p,e[1]=x*n+w*o+M*c+E*v,e[2]=x*r+w*h+M*d+E*g,e[3]=x*s+w*l+M*f+E*m,x=y[4],w=y[5],M=y[6],E=y[7],e[4]=x*i+w*a+M*u+E*p,e[5]=x*n+w*o+M*c+E*v,e[6]=x*r+w*h+M*d+E*g,e[7]=x*s+w*l+M*f+E*m,x=y[8],w=y[9],M=y[10],E=y[11],e[8]=x*i+w*a+M*u+E*p,e[9]=x*n+w*o+M*c+E*v,e[10]=x*r+w*h+M*d+E*g,e[11]=x*s+w*l+M*f+E*m,x=y[12],w=y[13],M=y[14],E=y[15],e[12]=x*i+w*a+M*u+E*p,e[13]=x*n+w*o+M*c+E*v,e[14]=x*r+w*h+M*d+E*g,e[15]=x*s+w*l+M*f+E*m,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,n=e.val,r=i[0],s=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],f=i[6],p=i[10],v=i[14],g=i[3],m=i[7],y=i[11],x=i[15],w=n[0],M=n[4],E=n[8],T=n[12],A=n[1],b=n[5],S=n[9],R=n[13],I=n[2],C=n[6],P=n[10],k=n[14],O=n[3],_=n[7],F=n[11],L=n[15];return this.setValues(r*w+s*A+a*I+o*O,h*w+l*A+u*I+c*O,d*w+f*A+p*I+v*O,g*w+m*A+y*I+x*O,r*M+s*b+a*C+o*_,h*M+l*b+u*C+c*_,d*M+f*b+p*C+v*_,g*M+m*b+y*C+x*_,r*E+s*S+a*P+o*F,h*E+l*S+u*P+c*F,d*E+f*S+p*P+v*F,g*E+m*S+y*P+x*F,r*T+s*R+a*k+o*L,h*T+l*R+u*k+c*L,d*T+f*R+p*k+v*L,g*T+m*R+y*k+x*L)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var n=this.val;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var n=this.val;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,a=t.y,o=t.z,h=r*s,l=r*a;return this.setValues(h*s+i,h*a-n*o,h*o+n*a,0,h*a+n*o,l*a+i,l*o-n*s,0,h*o-n*a,l*o+n*s,r*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,n=e.x,r=e.y,a=e.z,o=Math.sqrt(n*n+r*r+a*a);if(Math.abs(o){t.exports=function(t,e,i){return Math.min(t+e,i)}},44:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},5385:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},8585:t=>{t.exports=function(t,e,i,n){void 0===i&&(i=e+1);var r=(t-e)/(i-e);return r>1?void 0!==n?(r=(n-t)/(n-i))<0&&(r=0):r=1:r<0&&(r=0),r}},372:(t,e,i)=>{var n=i(7473),r=i(2149),s=i(1984),a=i(5689),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),c=new a(0,1,0),d=new a,f=new r,p=new n({initialize:function(t,e,i,n){this.onChangeCallback=s,this.set(t,e,i,n)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,n,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=n||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=n*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.set(i+e*(t.x-i),n+e*(t.y-n),r+e*(t.z-r),s+e*(t.w-s))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var n=f.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+r*s+i*o-n*a,i*h+r*a+n*s-e*o,n*h+r*o+e*a-i*s,r*h-e*s-i*a-n*o)},slerp:function(t,e){var i=this.x,n=this.y,r=this.z,s=this.w,a=t.x,h=t.y,l=t.z,u=t.w,c=i*a+n*h+r*l+s*u;c<0&&(c=-c,a=-a,h=-h,l=-l,u=-u);var d=1-e,f=e;if(1-c>o){var p=Math.acos(c),v=Math.sin(p);d=Math.sin((1-e)*p)/v,f=Math.sin(e*p)/v}return this.set(d*i+f*a,d*n+f*h,d*r+f*l,d*s+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n,s=r?1/r:0;return this.set(-t*s,-e*s,-i*s,n*s)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a+r*s,i*a+n*s,n*a-i*s,r*a-e*s)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a-n*s,i*a+r*s,n*a+e*s,r*a-i*s)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*s,i*a-e*s,n*a+r*s,r*a-n*s)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,n=t.y/2,r=t.z/2,s=Math.cos(i),a=Math.cos(n),o=Math.cos(r),h=Math.sin(i),l=Math.sin(n),u=Math.sin(r);switch(t.order){case"XYZ":this.set(h*a*o+s*l*u,s*l*o-h*a*u,s*a*u+h*l*o,s*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+s*l*u,s*l*o-h*a*u,s*a*u-h*l*o,s*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-s*l*u,s*l*o+h*a*u,s*a*u+h*l*o,s*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-s*l*u,s*l*o+h*a*u,s*a*u-h*l*o,s*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+s*l*u,s*l*o+h*a*u,s*a*u-h*l*o,s*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-s*l*u,s*l*o-h*a*u,s*a*u+h*l*o,s*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,n=i[0],r=i[4],s=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=n+o+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(s-l)*e,(a-r)*e,.25/e)):n>o&&n>c?(e=2*Math.sqrt(1+n-o-c),this.set(.25*e,(r+a)/e,(s+l)/e,(u-h)/e)):o>c?(e=2*Math.sqrt(1+o-n-c),this.set((r+a)/e,.25*e,(h+u)/e,(s-l)/e)):(e=2*Math.sqrt(1+c-n-o),this.set((s+l)/e,(h+u)/e,.25*e,(a-r)/e)),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var s=h[r],a=h[s];e=Math.sqrt(i[3*r+r]-i[3*s+s]-i[3*a+a]+1),l[r]=.5*e,e=.5/e,l[s]=(i[3*s+r]+i[3*r+s])*e,l[a]=(i[3*a+r]+i[3*r+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+s]-i[3*s+a])*e}return this.onChangeCallback(this),this}});t.exports=p},4208:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t*n.RAD_TO_DEG}},1705:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},6650:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,n=2*Math.random()-1,r=Math.sqrt(1-n*n)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=n*e,t}},2037:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},6283:t=>{t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},9876:t=>{t.exports=function(t,e,i,n){var r=Math.cos(n),s=Math.sin(n),a=t.x-e,o=t.y-i;return t.x=a*r-o*s+e,t.y=a*s+o*r+i,t}},8348:t=>{t.exports=function(t,e,i,n,r){var s=n+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},4497:t=>{t.exports=function(t,e,i,n,r){return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},9640:(t,e,i)=>{var n=i(5689),r=i(9652),s=i(372),a=new r,o=new s,h=new n;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},4078:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},855:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.round(t*n)/n}},4936:t=>{t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var r=[],s=[],a=0;a{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},278:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},163:(t,e,i)=>{var n=i(2529);t.exports=function(t,e,i,r){void 0===r&&(r=new n);var s=0,a=0;return t>0&&t<=e*i&&(s=t>e-1?t-(a=Math.floor(t/e))*e:t),r.set(s,a)}},7556:(t,e,i)=>{var n=i(2529);t.exports=function(t,e,i,r,s,a,o,h){void 0===h&&(h=new n);var l=Math.sin(s),u=Math.cos(s),c=u*a,d=l*a,f=-l*o,p=u*o,v=1/(c*p+f*-d);return h.x=p*v*t+-f*v*e+(r*f-i*p)*v,h.y=c*v*e+-d*v*t+(-r*c+i*d)*v,h}},2529:(t,e,i)=>{var n=i(7473),r=i(12),s=new n({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new s(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return r(this.x,t.x,e)&&r(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});s.ZERO=new s,s.RIGHT=new s(1,0),s.LEFT=new s(-1,0),s.UP=new s(0,-1),s.DOWN=new s(0,1),s.ONE=new s(1,1),t.exports=s},5689:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new n(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=n*o-r*a,this.y=r*s-i*o,this.z=i*a-n*s,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z;return this.x=i*a-n*s,this.y=n*r-e*a,this.z=e*s-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+n*r[6],this.y=e*r[1]+i*r[4]+n*r[7],this.z=e*r[2]+i*r[5]+n*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12],this.y=r[1]*e+r[5]*i+r[9]*n+r[13],this.z=r[2]*e+r[6]*i+r[10]*n+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=e*r[0]+i*r[4]+n*r[8]+r[12],a=e*r[1]+i*r[5]+n*r[9]+r[13],o=e*r[2]+i*r[6]+n*r[10]+r[14],h=e*r[3]+i*r[7]+n*r[11]+r[15];return this.x=s/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*n-a*i,l=o*i+a*e-r*n,u=o*n+r*i-s*e,c=-r*e-s*i-a*n;return this.x=h*o+c*-r+l*-a-u*-s,this.y=l*o+c*-s+u*-r-h*-a,this.z=u*o+c*-a+h*-s-l*-r,this},project:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],c=r[6],d=r[7],f=r[8],p=r[9],v=r[10],g=r[11],m=r[12],y=r[13],x=r[14],w=1/(e*h+i*d+n*g+r[15]);return this.x=(e*s+i*l+n*f+m)*w,this.y=(e*a+i*u+n*p+y)*w,this.z=(e*o+i*c+n*v+x)*w,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,n=t.y,r=t.z,s=t.w,a=this.x-i,o=s-this.y-1-n,h=this.z;return this.x=2*a/r-1,this.y=2*o/s-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});n.ZERO=new n,n.RIGHT=new n(1,0,0),n.LEFT=new n(-1,0,0),n.UP=new n(0,-1,0),n.DOWN=new n(0,1,0),n.FORWARD=new n(0,0,1),n.BACK=new n(0,0,-1),n.ONE=new n(1,1,1),t.exports=n},9279:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=n*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this.w=s+e*(t.w-s),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+n*n+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*n-a*i,l=o*i+a*e-r*n,u=o*n+r*i-s*e,c=-r*e-s*i-a*n;return this.x=h*o+c*-r+l*-a-u*-s,this.y=l*o+c*-s+u*-r-h*-a,this.z=u*o+c*-a+h*-s-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},4119:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},8445:t=>{t.exports=function(t,e,i){if(t>=e&&t<=i)return t;var n=i-e;return e+((t-e)%n+n)%n}},6412:t=>{t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},760:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},6909:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},6947:t=>{t.exports=function(t,e,i,n){return Math.atan2(i-t,n-e)}},3426:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t>Math.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},6906:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},3270:(t,e,i)=>{var n=i(104);t.exports=function(){return n(-Math.PI,Math.PI)}},2748:(t,e,i)=>{var n=i(104);t.exports=function(){return n(-180,180)}},936:(t,e,i)=>{var n=i(6906);t.exports=function(t){return n(t+Math.PI)}},1935:(t,e,i)=>{var n=i(7425);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},3692:(t,e,i)=>{var n=i(8445);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},2820:(t,e,i)=>{var n=i(8445);t.exports=function(t){return n(t,-180,180)}},1833:(t,e,i)=>{t.exports={Between:i(6412),BetweenPoints:i(760),BetweenPointsY:i(6909),BetweenY:i(6947),CounterClockwise:i(3426),Normalize:i(6906),Random:i(3270),RandomDegrees:i(2748),Reverse:i(936),RotateTo:i(1935),ShortestBetween:i(5393),Wrap:i(3692),WrapDegrees:i(2820)}},7425:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},1518:t=>{t.exports=function(t,e,i,n){var r=t-i,s=e-n;return Math.sqrt(r*r+s*s)}},5372:t=>{t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}},4430:t=>{t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},4361:t=>{t.exports=function(t,e,i,n){return Math.max(Math.abs(t-i),Math.abs(e-n))}},7798:t=>{t.exports=function(t,e,i,n,r){return void 0===r&&(r=2),Math.sqrt(Math.pow(i-t,r)+Math.pow(n-e,r))}},8290:t=>{t.exports=function(t,e,i,n){return Math.abs(t-i)+Math.abs(e-n)}},3788:t=>{t.exports=function(t,e,i,n){var r=t-i,s=e-n;return r*r+s*s}},6338:(t,e,i)=>{t.exports={Between:i(1518),BetweenPoints:i(5372),BetweenPointsSquared:i(4430),Chebyshev:i(4361),Power:i(7798),Snake:i(8290),Squared:i(3788)}},5751:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},6203:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},9103:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},4938:(t,e,i)=>{t.exports={In:i(5751),Out:i(9103),InOut:i(6203)}},8677:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},4649:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},504:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},8872:(t,e,i)=>{t.exports={In:i(8677),Out:i(504),InOut:i(4649)}},3170:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},2627:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},1349:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},5006:(t,e,i)=>{t.exports={In:i(3170),Out:i(1349),InOut:i(2627)}},6046:t=>{t.exports=function(t){return t*t*t}},9531:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},4836:t=>{t.exports=function(t){return--t*t*t+1}},875:(t,e,i)=>{t.exports={In:i(6046),Out:i(4836),InOut:i(9531)}},7619:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},7437:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},8119:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},2884:(t,e,i)=>{t.exports={In:i(7619),Out:i(8119),InOut:i(7437)}},5456:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},3461:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},2711:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},6287:(t,e,i)=>{t.exports={In:i(5456),Out:i(2711),InOut:i(3461)}},8613:(t,e,i)=>{t.exports={Back:i(4938),Bounce:i(8872),Circular:i(5006),Cubic:i(875),Elastic:i(2884),Expo:i(6287),Linear:i(4233),Quadratic:i(6341),Quartic:i(762),Quintic:i(345),Sine:i(8698),Stepped:i(7051)}},744:t=>{t.exports=function(t){return t}},4233:(t,e,i)=>{t.exports=i(744)},9810:t=>{t.exports=function(t){return t*t}},8163:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},6123:t=>{t.exports=function(t){return t*(2-t)}},6341:(t,e,i)=>{t.exports={In:i(9810),Out:i(6123),InOut:i(8163)}},7337:t=>{t.exports=function(t){return t*t*t*t}},4878:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},9012:t=>{t.exports=function(t){return 1- --t*t*t*t}},762:(t,e,i)=>{t.exports={In:i(7337),Out:i(9012),InOut:i(4878)}},303:t=>{t.exports=function(t){return t*t*t*t*t}},553:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},1632:t=>{t.exports=function(t){return--t*t*t*t*t+1}},345:(t,e,i)=>{t.exports={In:i(303),Out:i(1632),InOut:i(553)}},8455:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},1844:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},990:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},8698:(t,e,i)=>{t.exports={In:i(8455),Out:i(990),InOut:i(1844)}},6745:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},7051:(t,e,i)=>{t.exports=i(6745)},3158:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},12:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},7373:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},2622:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(3158),Equal:i(12),Floor:i(1326),GreaterThan:i(7373),LessThan:i(2622)}},4675:(t,e,i)=>{var n=i(7425),r=i(1030),s={Angle:i(1833),Distance:i(6338),Easing:i(8613),Fuzzy:i(7927),Interpolation:i(2140),Pow2:i(7897),Snap:i(3943),RandomDataGenerator:i(6957),Average:i(3136),Bernstein:i(785),Between:i(7025),CatmullRom:i(48),CeilTo:i(5035),Clamp:i(2915),DegToRad:i(7149),Difference:i(2975),Euler:i(2107),Factorial:i(3916),FloatBetween:i(104),FloorTo:i(4941),FromPercent:i(1555),GetSpeed:i(5005),IsEven:i(3702),IsEvenStrict:i(8820),Linear:i(1743),LinearXY:i(3416),MaxAdd:i(3733),Median:i(44),MinSub:i(5385),Percent:i(8585),RadToDeg:i(4208),RandomXY:i(1705),RandomXYZ:i(6650),RandomXYZW:i(2037),Rotate:i(6283),RotateAround:i(9876),RotateAroundDistance:i(8348),RotateTo:i(4497),RoundAwayFromZero:i(4078),RoundTo:i(855),SinCosTableGenerator:i(4936),SmootherStep:i(278),SmoothStep:i(2733),ToXY:i(163),TransformXY:i(7556),Within:i(4119),Wrap:i(8445),Vector2:i(2529),Vector3:i(5689),Vector4:i(9279),Matrix3:i(2149),Matrix4:i(9652),Quaternion:i(372),RotateVec3:i(9640)};s=r(!1,s,n),t.exports=s},1640:(t,e,i)=>{var n=i(785);t.exports=function(t,e){for(var i=0,r=t.length-1,s=0;s<=r;s++)i+=Math.pow(1-e,r-s)*Math.pow(e,s)*t[s]*n(r,s);return i}},6105:(t,e,i)=>{var n=i(48);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return t[0]===t[i]?(e<0&&(s=Math.floor(r=i*(1+e))),n(r-s,t[(s-1+i)%i],t[s],t[(s+1)%i],t[(s+2)%i])):e<0?t[0]-(n(-r,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(r-s,t[s?s-1:0],t[s],t[i{t.exports=function(t,e,i,n,r){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,r)}},6765:(t,e,i)=>{var n=i(1743);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return e<0?n(t[0],t[1],r):e>1?n(t[i],t[i-1],i-r):n(t[s],t[s+1>i?i:s+1],r-s)}},6388:t=>{t.exports=function(t,e,i,n){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}},5735:(t,e,i)=>{var n=i(2733);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},8705:(t,e,i)=>{var n=i(278);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},2140:(t,e,i)=>{t.exports={Bezier:i(1640),CatmullRom:i(6105),CubicBezier:i(4002),Linear:i(6765),QuadraticBezier:i(6388),SmoothStep:i(5735),SmootherStep:i(8705)}},5443:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},167:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},7897:(t,e,i)=>{t.exports={GetNext:i(5443),IsSize:i(725),IsValue:i(167)}},6957:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var n=0;n>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),n=t[i];t[i]=t[e],t[e]=n}return t}});t.exports=n},5659:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},5461:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),n?(i+t)/e:i+t)}},5131:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),n?(i+t)/e:i+t)}},3943:(t,e,i)=>{t.exports={Ceil:i(5659),Floor:i(5461),To:i(5131)}},8666:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},8456:t=>{var e={},i={},n={register:function(t,i,n,r){void 0===r&&(r=!1),e[t]={plugin:i,mapping:n,custom:r}},registerCustom:function(t,e,n,r){i[t]={plugin:e,mapping:n,data:r}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=n},5722:(t,e,i)=>{var n=i(8666),r=i(7473),s=i(204),a=new r({Extends:n,initialize:function(t,e,i){n.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(s.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},8351:t=>{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},8196:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},3527:t=>{t.exports="resize"},8618:t=>{t.exports="addedtoscene"},4328:t=>{t.exports="boot"},6099:t=>{t.exports="create"},7645:t=>{t.exports="destroy"},2710:t=>{t.exports="pause"},2547:t=>{t.exports="postupdate"},8577:t=>{t.exports="prerender"},8197:t=>{t.exports="preupdate"},8997:t=>{t.exports="ready"},7604:t=>{t.exports="removedfromscene"},8999:t=>{t.exports="render"},9742:t=>{t.exports="resume"},3667:t=>{t.exports="shutdown"},3468:t=>{t.exports="sleep"},7840:t=>{t.exports="start"},9896:t=>{t.exports="transitioncomplete"},5103:t=>{t.exports="transitioninit"},3162:t=>{t.exports="transitionout"},7841:t=>{t.exports="transitionstart"},6454:t=>{t.exports="transitionwake"},6536:t=>{t.exports="update"},3875:t=>{t.exports="wake"},204:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(8618),BOOT:i(4328),CREATE:i(6099),DESTROY:i(7645),PAUSE:i(2710),POST_UPDATE:i(2547),PRE_RENDER:i(8577),PRE_UPDATE:i(8197),READY:i(8997),REMOVED_FROM_SCENE:i(7604),RENDER:i(8999),RESUME:i(9742),SHUTDOWN:i(3667),SLEEP:i(3468),START:i(7840),TRANSITION_COMPLETE:i(9896),TRANSITION_INIT:i(5103),TRANSITION_OUT:i(3162),TRANSITION_START:i(7841),TRANSITION_WAKE:i(6454),UPDATE:i(6536),WAKE:i(3875)}},2362:(t,e,i)=>{var n=i(7473),r=i(2915),s=i(1030),a=new n({initialize:function(t,e,i,n,r,s,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(s,a,n,r)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var r=this.data,s=r.cut;s.x=i,s.y=n,s.w=t,s.h=e,s.r=i+t,s.b=n+e,r.sourceSize.w=t,r.sourceSize.h=e,r.spriteSourceSize.w=t,r.spriteSourceSize.h=e,r.radius=.5*Math.sqrt(t*t+e*e);var a=r.drawImage;return a.x=i,a.y=n,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,n,r,s){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=n,o.w=r,o.h=s,o.r=i+r,o.b=n+s,this.x=i,this.y=n,this.width=r,this.height=s,this.halfWidth=.5*r,this.halfHeight=.5*s,this.centerX=Math.floor(r/2),this.centerY=Math.floor(s/2),this.updateUVs()},setCropUVs:function(t,e,i,n,s,a,o){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=r(e,0,d)),v=l+(i=r(i,0,f)),g=n=r(n,0,d-e),m=s=r(s,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,w=e+(n=r(n,0,u-e)),M=i+(s=r(s,0,c-i));if(!(x.rw||x.y>M)){var E=Math.max(x.x,e),T=Math.max(x.y,i),A=Math.min(x.r,w)-E,b=Math.min(x.b,M)-T;g=A,m=b,p=a?h+(u-(E-x.x)-A):h+(E-x.x),v=o?l+(c-(T-x.y)-b):l+(T-x.y),e=E,i=T,n=A,s=b}else p=0,v=0,g=0,m=0}else a&&(p=h+(u-e-n)),o&&(v=l+(c-i-s));var S=this.source.width,R=this.source.height;return t.u0=Math.max(0,p/S),t.v0=Math.max(0,v/R),t.u1=Math.min(1,(p+g)/S),t.v1=Math.min(1,(v+m)/R),t.x=e,t.y=i,t.cx=p,t.cy=v,t.cw=g,t.ch=m,t.width=n,t.height=s,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,n,r,s){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=n,this.u1=r,this.v1=s,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=n;var s=this.source.width,a=this.source.height;return this.u0=t/s,this.v0=e/a,this.u1=(t+i)/s,this.v1=(e+n)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=s(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},1864:t=>{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},3747:t=>{t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},7473:t=>{function e(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function n(t,n,r,a){for(var o in n)if(n.hasOwnProperty(o)){var h=e(n,o,r);if(!1!==h){if(i((a||t).prototype,o)){if(s.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=n[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},1792:t=>{t.exports=function(t,e,i,n,r){if(void 0===r&&(r=t),i>0){var s=i-t.length;if(s<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>s&&(e.splice(s),a=s);for(var o=0;o{t.exports=function(t,e,i,n,r,s){if(void 0===i&&(i=0),void 0===s&&(s=t),n>0){var a=n-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),r&&r.call(s,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;n>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),r&&r.call(s,l)}return e}},2513:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var n=i(2497);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var a=0;if(n(t,r,s))for(var o=r;o{t.exports=function(t,e,i){var n,r=[null];for(n=3;n{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s)){var a,o=[null];for(a=5;a{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var n,r,s=1;if(i){if(te.length&&(s=e.length),i?(n=e[s-1][i],(r=e[s][i])-t<=t-n?e[s]:e[s-1]):(n=e[s-1],(r=e[s])-t<=t-n?r:n)}},4493:t=>{var e=function(t,i){void 0===i&&(i=[]);for(var n=0;n{var n=i(2497);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var a=[];if(n(t,r,s))for(var o=r;o{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var a=r;a{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},8683:t=>{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n>r||(t.splice(n,1),r===t.length-1?t.push(e):t.splice(r,0,e)),t}},546:t=>{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var n=t[i-1],r=t.indexOf(n);t[i]=n,t[r]=e}return t}},1419:t=>{t.exports=function(t,e,i){var n=t.indexOf(e);if(-1===n||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},6512:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,n){var r,s=[],a=!1;if((i||n)&&(a=!0,i||(i=""),n||(n="")),e=e;r--)a?s.push(i+r.toString()+n):s.push(r);else for(r=t;r<=e;r++)a?s.push(i+r.toString()+n):s.push(r);return s}},1316:(t,e,i)=>{var n=i(4078);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var r=[],s=Math.max(n((e-t)/(i||1)),0),a=0;a{function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return te?1:0}var n=function(t,r,s,a,o){for(void 0===s&&(s=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>s;){if(a-s>600){var h=a-s+1,l=r-s+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(s,Math.floor(r-l*c/h+d)),p=Math.min(a,Math.floor(r+(h-l)*c/h+d));n(t,r,f,p,o)}var v=t[r],g=s,m=a;for(e(t,s,r),o(t[a],v)>0&&e(t,s,a);g0;)m--}0===o(t[s],v)?e(t,s,m):e(t,++m,a),m<=r&&(s=m+1),r<=m&&(a=m-1)}};t.exports=n},9703:(t,e,i)=>{var n=i(5851),r=i(4912),s=function(t,e,i){for(var n=[],r=0;r{var n=i(8935);t.exports=function(t,e,i,r){var s;if(void 0===r&&(r=t),!Array.isArray(e))return-1!==(s=t.indexOf(e))?(n(t,s),i&&i.call(r,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(s=t.indexOf(h))&&(n(t,s),o.push(h),i&&i.call(r,h)),a--}return o}},4725:(t,e,i)=>{var n=i(8935);t.exports=function(t,e,i,r){if(void 0===r&&(r=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var s=n(t,e);return i&&i.call(r,s),s}},8780:(t,e,i)=>{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===s&&(s=t),n(t,e,i)){var a=i-e,o=t.splice(e,a);if(r)for(var h=0;h{var n=i(8935);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*i);return n(t,r)}},6960:t=>{t.exports=function(t,e,i){var n=t.indexOf(e),r=t.indexOf(i);return-1!==n&&-1===r&&(t[n]=i,!0)}},1021:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n{t.exports=function(t,e,i,n){var r=t.length;if(e<0||e>r||e>=i||i>r){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},5361:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},3718:(t,e,i)=>{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var a=r;a{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},2071:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},8935:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],r=e;r{var n=i(9356);function r(t,e){return String(t).localeCompare(e)}function s(t,e,i,n){var r,s,a,o,h,l=t.length,u=0,c=2*i;for(r=0;rl&&(s=l),a>l&&(a=l),o=r,h=s;;)if(o{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return t[n]=i,t[r]=e,t}},1953:(t,e,i)=>{t.exports={Matrix:i(1237),Add:i(1792),AddAt:i(2280),BringToTop:i(2513),CountAllMatching:i(1771),Each:i(7883),EachInRange:i(5856),FindClosestInSorted:i(3957),Flatten:i(4493),GetAll:i(6245),GetFirst:i(1647),GetRandom:i(5301),MoveDown:i(1842),MoveTo:i(1419),MoveUp:i(6512),MoveAbove:i(8683),MoveBelow:i(546),NumberArray:i(4130),NumberArrayStep:i(1316),QuickSelect:i(9465),Range:i(9703),Remove:i(7161),RemoveAt:i(4725),RemoveBetween:i(8780),RemoveRandomElement:i(5744),Replace:i(6960),RotateLeft:i(1021),RotateRight:i(4027),SafeRange:i(2497),SendToBack:i(5361),SetAll:i(3718),Shuffle:i(4912),SortByDigits:i(2071),SpliceOne:i(8935),StableSort:i(9992),Swap:i(2372)}},1816:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var n=i(7222),r=i(1816);t.exports=function(t){var e="";if(!r(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},6063:t=>{t.exports=function(t){for(var e=0;e{var n=i(7116);t.exports=function(t){return n(t,180)}},2597:(t,e,i)=>{var n=i(7116);t.exports=function(t){return n(t,90)}},7116:(t,e,i)=>{var n=i(1816),r=i(4780);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=r(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=r(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var n=i(7116);t.exports=function(t){return n(t,-90)}},7711:(t,e,i)=>{var n=i(1021),r=i(4027);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?n(t,Math.abs(i)):r(t,i)),0!==e)for(var s=0;s{t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),r=0;r-1;s--)n[r][s]=t[s][r]}return n}},1237:(t,e,i)=>{t.exports={CheckMatrix:i(1816),MatrixToString:i(6655),ReverseColumns:i(582),ReverseRows:i(6063),Rotate180:i(8321),RotateLeft:i(2597),RotateMatrix:i(7116),RotateRight:i(6285),Translate:i(7711),TransposeMatrix:i(4780)}},3911:t=>{var e=function(t){var i,n,r;if("object"!=typeof t||null===t)return t;for(r in i=Array.isArray(t)?[]:{},t)n=t[r],i[r]=e(n);return i};t.exports=e},1030:(t,e,i)=>{var n=i(2482),r=function(){var t,e,i,s,a,o,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l{var n=i(4675),r=i(5851);t.exports=function(t,e,i){var s=r(t,e,null);if(null===s)return i;if(Array.isArray(s))return n.RND.pick(s);if("object"==typeof s){if(s.hasOwnProperty("randInt"))return n.RND.integerInRange(s.randInt[0],s.randInt[1]);if(s.hasOwnProperty("randFloat"))return n.RND.realInRange(s.randFloat[0],s.randFloat[1])}else if("function"==typeof s)return s(e);return s}},4597:t=>{t.exports=function(t,e,i){var n=typeof t;return t&&"number"!==n&&"string"!==n&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},5851:t=>{t.exports=function(t,e,i,n){if(!t&&!n||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(n&&n.hasOwnProperty(e))return n[e];if(-1!==e.indexOf(".")){for(var r=e.split("."),s=t,a=n,o=i,h=i,l=!0,u=!0,c=0;c{t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},7222:t=>{t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===n&&(n=3);var r=0;if(e+1>=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var s=Math.ceil((r=e-t.length)/2);t=new Array(r-s+1).join(i)+t+new Array(s+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}}},e={};var i=function i(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,i),s.exports}(4513);window.SpinePlugin=i})(); \ No newline at end of file +(()=>{var t={4399:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,s||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,a=new Array(s);r{(function(){var e,i,n,r=this&&this.__extends||(e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},e(t,i)},function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)});!function(t){var e,i,n,s=function(){function t(t,e,i){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var n=0;n0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l>>1;;){if(t[(s+1)*i]<=e?n=s+1:r=s,n==r)return(n+1)*i;s=n+r>>>1}},t.linearSearch=function(t,e,i){for(var n=0,r=t.length-i;n<=r;n+=i)if(t[n]>e)return n;return-1},t}();t.Animation=s,function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(e=t.MixBlend||(t.MixBlend={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(i=t.MixDirection||(t.MixDirection={})),function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"}(n=t.TimelineType||(t.TimelineType={}));var a=function(){function e(i){if(i<=0)throw new Error("frameCount must be > 0: "+i);this.curves=t.Utils.newFloatArray((i-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var i=t*e.BEZIER_SIZE;if(i==this.curves.length)return e.LINEAR;var n=this.curves[i];return n==e.LINEAR?e.LINEAR:n==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,i,n,r,s){var a=.03*(2*-i+r),o=.03*(2*-n+s),h=.006*(3*(i-r)+1),l=.006*(3*(n-s)+1),u=2*a+h,c=2*o+l,d=.3*i+a+.16666667*h,f=.3*n+o+.16666667*l,p=t*e.BEZIER_SIZE,v=this.curves;v[p++]=e.BEZIER;for(var g=d,m=f,y=p+e.BEZIER_SIZE-1;p=n){var u=void 0,c=void 0;return s==h?(u=0,c=0):(u=r[s-2],c=r[s-1]),c+(r[s+1]-c)*(n-u)/(o-u)}var d=r[s-1];return d+(1-d)*(n-o)/(1-o)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=a;var o=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e<<1),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.rotate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+a.ROTATION]=i},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(n=u[u.length-a.ENTRIES]){var f=u[u.length+a.PREV_ROTATION];switch(h){case e.setup:c.rotation=c.data.rotation+f*o;break;case e.first:case e.replace:f+=c.data.rotation-c.rotation,f-=360*(16384-(16384.499999999996-f/360|0));case e.add:c.rotation+=f*o}}else{var p=s.binarySearch(u,n,a.ENTRIES),v=u[p+a.PREV_ROTATION],g=u[p],m=this.getCurvePercent((p>>1)-1,1-(n-g)/(u[p+a.PREV_TIME]-g)),y=u[p+a.ROTATION]-v;switch(y=v+(y-360*(16384-(16384.499999999996-y/360|0)))*m,h){case e.setup:c.rotation=c.data.rotation+(y-360*(16384-(16384.499999999996-y/360|0)))*o;break;case e.first:case e.replace:y+=c.data.rotation-c.rotation;case e.add:c.rotation+=(y-360*(16384-(16384.499999999996-y/360|0)))*o}}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_ROTATION=-1,a.ROTATION=1,a}(a);t.RotateTimeline=o;var h=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.translate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,i,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.X]=i,this.frames[t+a.Y]=n},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_X],f=u[u.length+a.PREV_Y];else{var p=s.binarySearch(u,n,a.ENTRIES);d=u[p+a.PREV_X],f=u[p+a.PREV_Y];var v=u[p],g=this.getCurvePercent(p/a.ENTRIES-1,1-(n-v)/(u[p+a.PREV_TIME]-v));d+=(u[p+a.X]-d)*g,f+=(u[p+a.Y]-f)*g}switch(h){case e.setup:c.x=c.data.x+d*o,c.y=c.data.y+f*o;break;case e.first:case e.replace:c.x+=(c.data.x+d-c.x)*o,c.y+=(c.data.y+f-c.y)*o;break;case e.add:c.x+=d*o,c.y+=f*o}}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_X=-2,a.PREV_Y=-1,a.X=1,a.Y=2,a}(a);t.TranslateTimeline=h;var l=function(a){function o(t){return a.call(this,t)||this}return r(o,a),o.prototype.getPropertyId=function(){return(n.scale<<24)+this.boneIndex},o.prototype.apply=function(n,r,a,h,l,u,c){var d=this.frames,f=n.bones[this.boneIndex];if(f.active)if(a=d[d.length-o.ENTRIES])p=d[d.length+o.PREV_X]*f.data.scaleX,v=d[d.length+o.PREV_Y]*f.data.scaleY;else{var g=s.binarySearch(d,a,o.ENTRIES);p=d[g+o.PREV_X],v=d[g+o.PREV_Y];var m=d[g],y=this.getCurvePercent(g/o.ENTRIES-1,1-(a-m)/(d[g+o.PREV_TIME]-m));p=(p+(d[g+o.X]-p)*y)*f.data.scaleX,v=(v+(d[g+o.Y]-v)*y)*f.data.scaleY}if(1==l)u==e.add?(f.scaleX+=p-f.data.scaleX,f.scaleY+=v-f.data.scaleY):(f.scaleX=p,f.scaleY=v);else{var x=0,w=0;if(c==i.mixOut)switch(u){case e.setup:x=f.data.scaleX,w=f.data.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,f.scaleY=w+(Math.abs(v)*t.MathUtils.signum(w)-w)*l;break;case e.first:case e.replace:x=f.scaleX,w=f.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,f.scaleY=w+(Math.abs(v)*t.MathUtils.signum(w)-w)*l;break;case e.add:x=f.scaleX,w=f.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-f.data.scaleX)*l,f.scaleY=w+(Math.abs(v)*t.MathUtils.signum(w)-f.data.scaleY)*l}else switch(u){case e.setup:x=Math.abs(f.data.scaleX)*t.MathUtils.signum(p),w=Math.abs(f.data.scaleY)*t.MathUtils.signum(v),f.scaleX=x+(p-x)*l,f.scaleY=w+(v-w)*l;break;case e.first:case e.replace:x=Math.abs(f.scaleX)*t.MathUtils.signum(p),w=Math.abs(f.scaleY)*t.MathUtils.signum(v),f.scaleX=x+(p-x)*l,f.scaleY=w+(v-w)*l;break;case e.add:x=t.MathUtils.signum(p),w=t.MathUtils.signum(v),f.scaleX=Math.abs(f.scaleX)*x+(p-Math.abs(f.data.scaleX)*x)*l,f.scaleY=Math.abs(f.scaleY)*w+(v-Math.abs(f.data.scaleY)*w)*l}}}},o}(h);t.ScaleTimeline=l;var u=function(t){function i(e){return t.call(this,e)||this}return r(i,t),i.prototype.getPropertyId=function(){return(n.shear<<24)+this.boneIndex},i.prototype.apply=function(t,n,r,a,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(r=u[u.length-i.ENTRIES])d=u[u.length+i.PREV_X],f=u[u.length+i.PREV_Y];else{var p=s.binarySearch(u,r,i.ENTRIES);d=u[p+i.PREV_X],f=u[p+i.PREV_Y];var v=u[p],g=this.getCurvePercent(p/i.ENTRIES-1,1-(r-v)/(u[p+i.PREV_TIME]-v));d+=(u[p+i.X]-d)*g,f+=(u[p+i.Y]-f)*g}switch(h){case e.setup:c.shearX=c.data.shearX+d*o,c.shearY=c.data.shearY+f*o;break;case e.first:case e.replace:c.shearX+=(c.data.shearX+d-c.shearX)*o,c.shearY+=(c.data.shearY+f-c.shearY)*o;break;case e.add:c.shearX+=d*o,c.shearY+=f*o}}},i}(h);t.ShearTimeline=u;var c=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.color<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,i,n,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=i,this.frames[t+a.G]=n,this.frames[t+a.B]=r,this.frames[t+a.A]=s},a.prototype.apply=function(t,i,n,r,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(n=c[c.length-a.ENTRIES]){var y=c.length;p=c[y+a.PREV_R],v=c[y+a.PREV_G],g=c[y+a.PREV_B],m=c[y+a.PREV_A]}else{var x=s.binarySearch(c,n,a.ENTRIES);p=c[x+a.PREV_R],v=c[x+a.PREV_G],g=c[x+a.PREV_B],m=c[x+a.PREV_A];var w=c[x],M=this.getCurvePercent(x/a.ENTRIES-1,1-(n-w)/(c[x+a.PREV_TIME]-w));p+=(c[x+a.R]-p)*M,v+=(c[x+a.G]-v)*M,g+=(c[x+a.B]-g)*M,m+=(c[x+a.A]-m)*M}if(1==o)u.color.set(p,v,g,m);else{d=u.color;h==e.setup&&d.setFromColor(u.data.color),d.add((p-d.r)*o,(v-d.g)*o,(g-d.b)*o,(m-d.a)*o)}}}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_R=-4,a.PREV_G=-3,a.PREV_B=-2,a.PREV_A=-1,a.R=1,a.G=2,a.B=3,a.A=4,a}(a);t.ColorTimeline=c;var d=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.twoColor<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,i,n,r,s,o,h,l){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=i,this.frames[t+a.G]=n,this.frames[t+a.B]=r,this.frames[t+a.A]=s,this.frames[t+a.R2]=o,this.frames[t+a.G2]=h,this.frames[t+a.B2]=l},a.prototype.apply=function(t,i,n,r,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(n=c[c.length-a.ENTRIES]){var T=c.length;g=c[T+a.PREV_R],m=c[T+a.PREV_G],y=c[T+a.PREV_B],x=c[T+a.PREV_A],w=c[T+a.PREV_R2],M=c[T+a.PREV_G2],E=c[T+a.PREV_B2]}else{var A=s.binarySearch(c,n,a.ENTRIES);g=c[A+a.PREV_R],m=c[A+a.PREV_G],y=c[A+a.PREV_B],x=c[A+a.PREV_A],w=c[A+a.PREV_R2],M=c[A+a.PREV_G2],E=c[A+a.PREV_B2];var b=c[A],S=this.getCurvePercent(A/a.ENTRIES-1,1-(n-b)/(c[A+a.PREV_TIME]-b));g+=(c[A+a.R]-g)*S,m+=(c[A+a.G]-m)*S,y+=(c[A+a.B]-y)*S,x+=(c[A+a.A]-x)*S,w+=(c[A+a.R2]-w)*S,M+=(c[A+a.G2]-M)*S,E+=(c[A+a.B2]-E)*S}if(1==o)u.color.set(g,m,y,x),u.darkColor.set(w,M,E,1);else{d=u.color,f=u.darkColor;h==e.setup&&(d.setFromColor(u.data.color),f.setFromColor(u.data.darkColor)),d.add((g-d.r)*o,(m-d.g)*o,(y-d.b)*o,(x-d.a)*o),f.add((w-f.r)*o,(M-f.g)*o,(E-f.b)*o,0)}}}},a.ENTRIES=8,a.PREV_TIME=-8,a.PREV_R=-7,a.PREV_G=-6,a.PREV_B=-5,a.PREV_A=-4,a.PREV_R2=-3,a.PREV_G2=-2,a.PREV_B2=-1,a.R=1,a.G=2,a.B=3,a.A=4,a.R2=5,a.G2=6,a.B2=7,a}(a);t.TwoColorTimeline=d;var f=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return r.prototype.getPropertyId=function(){return(n.attachment<<24)+this.slotIndex},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},r.prototype.apply=function(t,n,r,a,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active)if(l!=i.mixOut){var c=this.frames;if(r=c[c.length-1]?c.length-1:s.binarySearch(c,r,1)-1;var f=this.attachmentNames[d];t.slots[this.slotIndex].setAttachment(null==f?null:t.getAttachment(this.slotIndex,f))}}else h==e.setup&&this.setAttachment(t,u,u.data.attachmentName)},r.prototype.setAttachment=function(t,e,i){e.setAttachment(null==i?null:t.getAttachment(this.slotIndex,i))},r}();t.AttachmentTimeline=f;var p=null,v=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e),n.frameVertices=new Array(e),null==p&&(p=t.Utils.newFloatArray(64)),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.deform<<27)+ +this.attachment.id+this.slotIndex},a.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.frameVertices[t]=i},a.prototype.apply=function(i,n,r,a,o,h,l){var u=i.slots[this.slotIndex];if(u.bone.active){var c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.deformAttachment==this.attachment){var d=u.deform;0==d.length&&(h=e.setup);var f=this.frameVertices,p=f[0].length,v=this.frames;if(r=v[v.length-1]){var M=f[v.length-1];if(1==o)if(h==e.add)if(null==(g=c).bones){y=g.vertices;for(var E=0;Ei)this.apply(t,e,Number.MAX_VALUE,n,r,a,o),e=-1;else if(e>=h[l-1])return;if(!(i0&&h[u-1]==c;)u--;for(;u=h[u];u++)n.push(this.events[u])}}},e}();t.EventTimeline=g;var m=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return r.prototype.getPropertyId=function(){return n.drawOrder<<24},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.drawOrders[t]=i},r.prototype.apply=function(n,r,a,o,h,l,u){var c=n.drawOrder,d=n.slots;if(u!=i.mixOut){var f=this.frames;if(a=f[f.length-1]?f.length-1:s.binarySearch(f,a)-1;var v=this.drawOrders[p];if(null==v)t.Utils.arrayCopy(d,0,c,0,d.length);else for(var g=0,m=v.length;g=c[c.length-o.ENTRIES])l==e.setup?(d.mix=d.data.mix+(c[c.length+o.PREV_MIX]-d.data.mix)*h,d.softness=d.data.softness+(c[c.length+o.PREV_SOFTNESS]-d.data.softness)*h,u==i.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],d.compress=0!=c[c.length+o.PREV_COMPRESS],d.stretch=0!=c[c.length+o.PREV_STRETCH])):(d.mix+=(c[c.length+o.PREV_MIX]-d.mix)*h,d.softness+=(c[c.length+o.PREV_SOFTNESS]-d.softness)*h,u==i.mixIn&&(d.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],d.compress=0!=c[c.length+o.PREV_COMPRESS],d.stretch=0!=c[c.length+o.PREV_STRETCH]));else{var f=s.binarySearch(c,r,o.ENTRIES),p=c[f+o.PREV_MIX],v=c[f+o.PREV_SOFTNESS],g=c[f],m=this.getCurvePercent(f/o.ENTRIES-1,1-(r-g)/(c[f+o.PREV_TIME]-g));l==e.setup?(d.mix=d.data.mix+(p+(c[f+o.MIX]-p)*m-d.data.mix)*h,d.softness=d.data.softness+(v+(c[f+o.SOFTNESS]-v)*m-d.data.softness)*h,u==i.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=c[f+o.PREV_BEND_DIRECTION],d.compress=0!=c[f+o.PREV_COMPRESS],d.stretch=0!=c[f+o.PREV_STRETCH])):(d.mix+=(p+(c[f+o.MIX]-p)*m-d.mix)*h,d.softness+=(v+(c[f+o.SOFTNESS]-v)*m-d.softness)*h,u==i.mixIn&&(d.bendDirection=c[f+o.PREV_BEND_DIRECTION],d.compress=0!=c[f+o.PREV_COMPRESS],d.stretch=0!=c[f+o.PREV_STRETCH]))}},o.ENTRIES=6,o.PREV_TIME=-6,o.PREV_MIX=-5,o.PREV_SOFTNESS=-4,o.PREV_BEND_DIRECTION=-3,o.PREV_COMPRESS=-2,o.PREV_STRETCH=-1,o.MIX=1,o.SOFTNESS=2,o.BEND_DIRECTION=3,o.COMPRESS=4,o.STRETCH=5,o}(a);t.IkConstraintTimeline=y;var x=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.transformConstraint<<24)+this.transformConstraintIndex},a.prototype.setFrame=function(t,e,i,n,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=i,this.frames[t+a.TRANSLATE]=n,this.frames[t+a.SCALE]=r,this.frames[t+a.SHEAR]=s},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES]){var m=u.length;f=u[m+a.PREV_ROTATE],p=u[m+a.PREV_TRANSLATE],v=u[m+a.PREV_SCALE],g=u[m+a.PREV_SHEAR]}else{var y=s.binarySearch(u,n,a.ENTRIES);f=u[y+a.PREV_ROTATE],p=u[y+a.PREV_TRANSLATE],v=u[y+a.PREV_SCALE],g=u[y+a.PREV_SHEAR];var x=u[y],w=this.getCurvePercent(y/a.ENTRIES-1,1-(n-x)/(u[y+a.PREV_TIME]-x));f+=(u[y+a.ROTATE]-f)*w,p+=(u[y+a.TRANSLATE]-p)*w,v+=(u[y+a.SCALE]-v)*w,g+=(u[y+a.SHEAR]-g)*w}if(h==e.setup){d=c.data;c.rotateMix=d.rotateMix+(f-d.rotateMix)*o,c.translateMix=d.translateMix+(p-d.translateMix)*o,c.scaleMix=d.scaleMix+(v-d.scaleMix)*o,c.shearMix=d.shearMix+(g-d.shearMix)*o}else c.rotateMix+=(f-c.rotateMix)*o,c.translateMix+=(p-c.translateMix)*o,c.scaleMix+=(v-c.scaleMix)*o,c.shearMix+=(g-c.shearMix)*o}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_ROTATE=-4,a.PREV_TRANSLATE=-3,a.PREV_SCALE=-2,a.PREV_SHEAR=-1,a.ROTATE=1,a.TRANSLATE=2,a.SCALE=3,a.SHEAR=4,a}(a);t.TransformConstraintTimeline=x;var w=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.pathConstraintPosition<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,i){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.VALUE]=i},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_VALUE];else{var f=s.binarySearch(u,n,a.ENTRIES);d=u[f+a.PREV_VALUE];var p=u[f],v=this.getCurvePercent(f/a.ENTRIES-1,1-(n-p)/(u[f+a.PREV_TIME]-p));d+=(u[f+a.VALUE]-d)*v}h==e.setup?c.position=c.data.position+(d-c.data.position)*o:c.position+=(d-c.position)*o}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_VALUE=-1,a.VALUE=1,a}(a);t.PathConstraintPositionTimeline=w;var M=function(t){function i(e){return t.call(this,e)||this}return r(i,t),i.prototype.getPropertyId=function(){return(n.pathConstraintSpacing<<24)+this.pathConstraintIndex},i.prototype.apply=function(t,n,r,a,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(r=u[u.length-i.ENTRIES])d=u[u.length+i.PREV_VALUE];else{var f=s.binarySearch(u,r,i.ENTRIES);d=u[f+i.PREV_VALUE];var p=u[f],v=this.getCurvePercent(f/i.ENTRIES-1,1-(r-p)/(u[f+i.PREV_TIME]-p));d+=(u[f+i.VALUE]-d)*v}h==e.setup?c.spacing=c.data.spacing+(d-c.data.spacing)*o:c.spacing+=(d-c.spacing)*o}},i}(w);t.PathConstraintSpacingTimeline=M;var E=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.pathConstraintMix<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,i,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=i,this.frames[t+a.TRANSLATE]=n},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_ROTATE],f=u[u.length+a.PREV_TRANSLATE];else{var p=s.binarySearch(u,n,a.ENTRIES);d=u[p+a.PREV_ROTATE],f=u[p+a.PREV_TRANSLATE];var v=u[p],g=this.getCurvePercent(p/a.ENTRIES-1,1-(n-v)/(u[p+a.PREV_TIME]-v));d+=(u[p+a.ROTATE]-d)*g,f+=(u[p+a.TRANSLATE]-f)*g}h==e.setup?(c.rotateMix=c.data.rotateMix+(d-c.data.rotateMix)*o,c.translateMix=c.data.translateMix+(f-c.data.translateMix)*o):(c.rotateMix+=(d-c.rotateMix)*o,c.translateMix+=(f-c.translateMix)*o)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_ROTATE=-2,a.PREV_TRANSLATE=-1,a.ROTATE=1,a.TRANSLATE=2,a}(a);t.PathConstraintMixTimeline=E}(n||(n={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.trackEntryPool=new t.Pool((function(){return new i})),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,i=0,n=e.length;i0){if(r.delay-=s,r.delay>0)continue;s=-r.delay,r.delay=0}var a=r.next;if(null!=a){var o=r.trackLast-a.delay;if(o>=0){for(a.delay=0,a.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*a.timeScale,r.trackTime+=s,this.setCurrent(i,a,!0);null!=a.mixingFrom;)a.mixTime+=t,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&null==r.mixingFrom){e[i]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,null!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=s}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var i=t.mixingFrom;if(null==i)return!0;var n=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,null!=i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(i){if(null==i)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var n=this.events,r=this.tracks,s=!1,a=0,o=r.length;a0)){s=!0;var l=0==a?t.MixBlend.first:h.mixBlend,u=h.alpha;null!=h.mixingFrom?u*=this.applyMixingFrom(h,i,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,d=h.getAnimationTime(),f=h.animation.timelines.length,p=h.animation.timelines;if(0==a&&1==u||l==t.MixBlend.add)for(var v=0;v1&&(a=1),r!=t.MixBlend.first&&(r=s.mixBlend));var o=a0&&this.queueEvents(s,c),this.events.length=0,s.nextAnimationLast=c,s.nextTrackLast=s.trackTime,a},e.prototype.applyAttachmentTimeline=function(i,n,r,s,a){var o=n.slots[i.slotIndex];if(o.bone.active){var h,l=i.frames;if(r=l[l.length-1]?l.length-1:t.Animation.binarySearch(l,r)-1,this.setAttachment(n,o,i.attachmentNames[h],a);o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+e.SETUP)}},e.prototype.setAttachment=function(t,i,n,r){i.setAttachment(null==n?null:t.getAttachment(i.data.index,n)),r&&(i.attachmentState=this.unkeyedState+e.CURRENT)},e.prototype.applyRotateTimeline=function(e,i,n,r,s,a,o,h){if(h&&(a[o]=0),1!=r){var l=e,u=l.frames,c=i.bones[l.boneIndex];if(c.active){var d=0,f=0;if(n=u[u.length-t.RotateTimeline.ENTRIES])f=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(u,n,t.RotateTimeline.ENTRIES),v=u[p+t.RotateTimeline.PREV_ROTATION],g=u[p],m=l.getCurvePercent((p>>1)-1,1-(n-g)/(u[p+t.RotateTimeline.PREV_TIME]-g));f=u[p+t.RotateTimeline.ROTATION]-v,f=v+(f-=360*(16384-(16384.499999999996-f/360|0)))*m+c.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0))}var y=0,x=f-d;if(0==(x-=360*(16384-(16384.499999999996-x/360|0))))y=a[o];else{var w=0,M=0;h?(w=0,M=x):(w=a[o],M=a[o+1]);var E=x>0,T=w>=0;t.MathUtils.signum(M)!=t.MathUtils.signum(x)&&Math.abs(M)<=90&&(Math.abs(w)>180&&(w+=360*t.MathUtils.signum(w)),T=E),y=x+w-w%360,T!=E&&(y+=360*t.MathUtils.signum(w)),a[o]=y}a[o+1]=x,d+=y*r,c.rotation=d-360*(16384-(16384.499999999996-d/360|0))}}else e.apply(i,0,n,null,1,s,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var i=t.animationStart,n=t.animationEnd,r=n-i,s=t.trackLast%r,a=this.events,o=0,h=a.length;on||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:e>=n&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var i=e;;){var n=i.mixingFrom;if(null==n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,i){var n=this.expandToIndex(t);this.tracks[t]=e,null!=n&&(i&&this.queue.interrupt(n),e.mixingFrom=n,n.mixingTo=e,e.mixTime=0,null!=n.mixingFrom&&n.mixDuration>0&&(e.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,i){var n=this.data.skeletonData.findAnimation(e);if(null==n)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,n,i)},e.prototype.setAnimationWith=function(t,e,i){if(null==e)throw new Error("animation cannot be null.");var n=!0,r=this.expandToIndex(t);null!=r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.disposeNext(r),r=r.mixingFrom,n=!1):this.disposeNext(r));var s=this.trackEntry(t,e,i,r);return this.setCurrent(t,s,n),this.queue.drain(),s},e.prototype.addAnimation=function(t,e,i,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,i,n)},e.prototype.addAnimationWith=function(t,e,i,n){if(null==e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(null!=r)for(;null!=r.next;)r=r.next;var s=this.trackEntry(t,e,i,r);if(null==r)this.setCurrent(t,s,!0),this.queue.drain();else if(r.next=s,n<=0){var a=r.animationEnd-r.animationStart;0!=a?(r.loop?n+=a*(1+(r.trackTime/a|0)):n+=Math.max(a,r.trackTime),n-=this.data.getMix(r.animation,e)):n=r.trackTime}return s.delay=n,s},e.prototype.setEmptyAnimation=function(t,i){var n=this.setAnimationWith(t,e.emptyAnimation,!1);return n.mixDuration=i,n.trackEnd=i,n},e.prototype.addEmptyAnimation=function(t,i,n){n<=0&&(n-=i);var r=this.addAnimationWith(t,e.emptyAnimation,!1,n);return r.mixDuration=i,r.trackEnd=i,r},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var i=0,n=this.tracks.length;i0){a[l]=e.HOLD_MIX,o[l]=d;continue t}break}a[l]=e.HOLD_FIRST}else a[l]=e.SUBSEQUENT}},e.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.emptyAnimation=new t.Animation("",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.HOLD_SUBSEQUENT=2,e.HOLD_FIRST=3,e.HOLD_MIX=4,e.SETUP=1,e.CURRENT=2,e}();t.AnimationState=e;var i=function(){function e(){this.mixBlend=t.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return e.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},e.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},e.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},e}();t.TrackEntry=i;var n,r=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(n.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(n.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(n.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(n.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(n.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(n.event),this.objects.push(t),this.objects.push(e)},t.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,i=0;i=0?e.substring(0,e.lastIndexOf("/")):"";e=this.pathPrefix+e,this.toLoad++,this.downloadText(e,(function(a){var o={count:0},h=new Array;try{new t.TextureAtlas(a,(function(e){h.push(""==s?e:s+"/"+e);var i=document.createElement("img");return i.width=16,i.height=16,new t.FakeTexture(i)}))}catch(t){var l=t;return r.errors[e]="Couldn't load texture atlas ".concat(e,": ").concat(l.message),n&&n(e,"Couldn't load texture atlas ".concat(e,": ").concat(l.message)),r.toLoad--,void r.loaded++}for(var u=function(l){var u=!1;r.loadTexture(l,(function(l,c){if(o.count++,o.count==h.length)if(u)r.errors[e]="Couldn't load texture atlas page ".concat(l,"} of atlas ").concat(e),n&&n(e,"Couldn't load texture atlas page ".concat(l," of atlas ").concat(e)),r.toLoad--,r.loaded++;else try{var d=new t.TextureAtlas(a,(function(t){return r.get(""==s?t:s+"/"+t)}));r.assets[e]=d,i&&i(e,d),r.toLoad--,r.loaded++}catch(t){var f=t;r.errors[e]="Couldn't load texture atlas ".concat(e,": ").concat(f.message),n&&n(e,"Couldn't load texture atlas ".concat(e,": ").concat(f.message)),r.toLoad--,r.loaded++}}),(function(t,i){u=!0,o.count++,o.count==h.length&&(r.errors[e]="Couldn't load texture atlas page ".concat(t,"} of atlas ").concat(e),n&&n(e,"Couldn't load texture atlas page ".concat(t," of atlas ").concat(e)),r.toLoad--,r.loaded++)}))},c=0,d=h;c0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(n||(n={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in atlas: "+n+" (region attachment: "+i+")");r.renderObject=r;var s=new t.RegionAttachment(i);return s.setRegion(r),s},e.prototype.newMeshAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in atlas: "+n+" (mesh attachment: "+i+")");r.renderObject=r;var s=new t.MeshAttachment(i);return s.region=r,s},e.prototype.newBoundingBoxAttachment=function(e,i){return new t.BoundingBoxAttachment(i)},e.prototype.newPathAttachment=function(e,i){return new t.PathAttachment(i)},e.prototype.newPointAttachment=function(e,i){return new t.PointAttachment(i)},e.prototype.newClippingAttachment=function(e,i){return new t.ClippingAttachment(i)},e}();t.AtlasAttachmentLoader=e}(n||(n={})),function(t){!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(t.BlendMode||(t.BlendMode={}))}(n||(n={})),function(t){var e=function(){function e(t,e,i){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}return e.prototype.isActive=function(){return this.active},e.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,i,n,r,s,a,o){this.ax=e,this.ay=i,this.arotation=n,this.ascaleX=r,this.ascaleY=s,this.ashearX=a,this.ashearY=o,this.appliedValid=!0;var h=this.parent;if(null==h){var l=this.skeleton,u=n+90+o,c=l.scaleX,d=l.scaleY;return this.a=t.MathUtils.cosDeg(n+a)*r*c,this.b=t.MathUtils.cosDeg(u)*s*c,this.c=t.MathUtils.sinDeg(n+a)*r*d,this.d=t.MathUtils.sinDeg(u)*s*d,this.worldX=e*c+l.x,void(this.worldY=i*d+l.y)}var f=h.a,p=h.b,v=h.c,g=h.d;switch(this.worldX=f*e+p*i+h.worldX,this.worldY=v*e+g*i+h.worldY,this.data.transformMode){case t.TransformMode.Normal:u=n+90+o;var m=t.MathUtils.cosDeg(n+a)*r,y=t.MathUtils.cosDeg(u)*s,x=t.MathUtils.sinDeg(n+a)*r,w=t.MathUtils.sinDeg(u)*s;return this.a=f*m+p*x,this.b=f*y+p*w,this.c=v*m+g*x,void(this.d=v*y+g*w);case t.TransformMode.OnlyTranslation:u=n+90+o;this.a=t.MathUtils.cosDeg(n+a)*r,this.b=t.MathUtils.cosDeg(u)*s,this.c=t.MathUtils.sinDeg(n+a)*r,this.d=t.MathUtils.sinDeg(u)*s;break;case t.TransformMode.NoRotationOrReflection:var M=0;(A=f*f+v*v)>1e-4?(A=Math.abs(f*g-p*v)/A,f/=this.skeleton.scaleX,p=(v/=this.skeleton.scaleY)*A,g=f*A,M=Math.atan2(v,f)*t.MathUtils.radDeg):(f=0,v=0,M=90-Math.atan2(g,p)*t.MathUtils.radDeg);var E=n+a-M,T=n+o-M+90;m=t.MathUtils.cosDeg(E)*r,y=t.MathUtils.cosDeg(T)*s,x=t.MathUtils.sinDeg(E)*r,w=t.MathUtils.sinDeg(T)*s;this.a=f*m-p*x,this.b=f*y-p*w,this.c=v*m+g*x,this.d=v*y+g*w;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var A,b=t.MathUtils.cosDeg(n),S=t.MathUtils.sinDeg(n),R=(f*b+p*S)/this.skeleton.scaleX,I=(v*b+g*S)/this.skeleton.scaleY;(A=Math.sqrt(R*R+I*I))>1e-5&&(A=1/A),R*=A,I*=A,A=Math.sqrt(R*R+I*I),this.data.transformMode==t.TransformMode.NoScale&&f*g-p*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(A=-A);var C=Math.PI/2+Math.atan2(I,R),P=Math.cos(C)*A,k=Math.sin(C)*A;m=t.MathUtils.cosDeg(a)*r,y=t.MathUtils.cosDeg(90+o)*s,x=t.MathUtils.sinDeg(a)*r,w=t.MathUtils.sinDeg(90+o)*s;this.a=R*m+P*x,this.b=R*y+P*w,this.c=I*m+k*x,this.d=I*y+k*w}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},e.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*t.MathUtils.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*t.MathUtils.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var e=this.parent;if(null==e)return this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);var i=e.a,n=e.b,r=e.c,s=e.d,a=1/(i*s-n*r),o=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=o*s*a-h*n*a,this.ay=h*i*a-o*r*a;var l=a*s,u=a*i,c=a*n,d=a*r,f=l*this.a-c*this.c,p=l*this.b-c*this.d,v=u*this.c-d*this.a,g=u*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var m=f*g-p*v;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(f*p+v*g,m)*t.MathUtils.radDeg,this.arotation=Math.atan2(v,f)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,i=this.b,n=this.c,r=this.d,s=1/(e*r-i*n),a=t.x-this.worldX,o=t.y-this.worldY;return t.x=a*r*s-o*i*s,t.y=o*e*s-a*n*s,t},e.prototype.localToWorld=function(t){var e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t},e.prototype.worldToLocalRotation=function(e){var i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return Math.atan2(this.a*i-this.c*n,this.d*n-this.b*i)*t.MathUtils.radDeg+this.rotation-this.shearX},e.prototype.localToWorldRotation=function(e){e-=this.rotation-this.shearX;var i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return Math.atan2(n*this.c+i*this.d,n*this.a+i*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var i=this.a,n=this.b,r=this.c,s=this.d,a=t.MathUtils.cosDeg(e),o=t.MathUtils.sinDeg(e);this.a=a*i-o*r,this.b=a*n-o*s,this.c=o*i+a*r,this.d=o*n+a*s,this.appliedValid=!1},e}();t.Bone=e}(n||(n={})),function(t){var e,i=function(i,n,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=e.Normal,this.skinRequired=!1,this.color=new t.Color,i<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");this.index=i,this.name=n,this.parent=r};t.BoneData=i,function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(e=t.TransformMode||(t.TransformMode={}))}(n||(n={})),function(t){var e=function(t,e,i){this.name=t,this.order=e,this.skinRequired=i};t.ConstraintData=e}(n||(n={})),function(t){var e=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e};t.Event=e}(n||(n={})),function(t){var e=function(t){this.name=t};t.EventData=e}(n||(n={})),function(t){var e=function(){function e(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var i=0;i180?f-=360:f<-180&&(f+=360);var E=e.ascaleX,T=e.ascaleY;if(r||s){switch(e.data.transformMode){case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:p=i-e.worldX,v=n-e.worldY}var A=e.data.length*E,b=Math.sqrt(p*p+v*v);if(r&&bA&&A>1e-4)E*=g=(b/A-1)*o+1,a&&(T*=g)}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*o,E,T,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,i,n,r,s,a,o,h){if(0!=h){e.appliedValid||e.updateAppliedTransform(),i.appliedValid||i.updateAppliedTransform();var l=e.ax,u=e.ay,c=e.ascaleX,d=c,f=e.ascaleY,p=i.ascaleX,v=0,g=0,m=0;c<0?(c=-c,v=180,m=-1):(v=0,m=1),f<0&&(f=-f,m=-m),p<0?(p=-p,g=180):g=0;var y=i.ax,x=0,w=0,M=0,E=e.a,T=e.b,A=e.c,b=e.d,S=Math.abs(c-f)<=1e-4;S?(w=E*y+T*(x=i.ay)+e.worldX,M=A*y+b*x+e.worldY):(x=0,w=E*y+e.worldX,M=A*y+e.worldY);var R=e.parent;E=R.a,T=R.b,A=R.c;var I,C,P=1/(E*(b=R.d)-T*A),k=w-R.worldX,O=M-R.worldY,_=(k*b-O*T)*P-l,F=(O*E-k*A)*P-u,L=Math.sqrt(_*_+F*F),V=i.data.length*p;if(L<1e-4)return this.apply1(e,n,r,!1,a,!1,h),void i.updateWorldTransformWith(y,x,0,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY);var D=((k=n-R.worldX)*b-(O=r-R.worldY)*T)*P-l,N=(O*E-k*A)*P-u,Y=D*D+N*N;if(0!=o){o*=c*(p+1)/2;var X=Math.sqrt(Y),B=X-L-V*c+o;if(B>0){var U=Math.min(1,B/(2*o))-1;Y=(D-=(U=(B-o*(1-U*U))/X)*D)*D+(N-=U*N)*N}}t:if(S){var z=(Y-L*L-(V*=c)*V)/(2*L*V);z<-1?z=-1:z>1&&(z=1,a&&(d*=(Math.sqrt(Y)/(L+V)-1)*h+1)),C=Math.acos(z)*s,E=L+V*z,T=V*Math.sin(C),I=Math.atan2(N*E-D*T,D*E+N*T)}else{var W=(E=c*V)*E,q=(T=f*V)*T,G=Math.atan2(N,D),H=-2*q*L,j=q-W;if((b=H*H-4*j*(A=q*L*L+W*Y-W*q))>=0){var Z=Math.sqrt(b);H<0&&(Z=-Z);var K=(Z=-(H+Z)/2)/j,Q=A/Z,$=Math.abs(K)=-1&&A<=1&&(A=Math.acos(A),(b=(k=E*Math.cos(A)+L)*k+(O=T*Math.sin(A))*O)st&&(nt=A,st=b,rt=k,at=O)),Y<=(et+st)/2?(I=G-Math.atan2(it*s,tt),C=J*s):(I=G-Math.atan2(at*s,rt),C=nt*s)}var ot=Math.atan2(x,y)*m,ht=e.arotation;(I=(I-ot)*t.MathUtils.radDeg+v-ht)>180?I-=360:I<-180&&(I+=360),e.updateWorldTransformWith(l,u,ht+I*h,d,e.ascaleY,0,0),ht=i.arotation,(C=((C+ot)*t.MathUtils.radDeg-i.ashearX)*m+g-ht)>180?C-=360:C<-180&&(C+=360),i.updateWorldTransformWith(y,x,ht+C*h,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY)}else i.updateWorldTransform()},e}();t.IkConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i.bendDirection=1,i.compress=!1,i.stretch=!1,i.uniform=!1,i.mix=1,i.softness=0,i}return r(e,t),e}(t.ConstraintData);t.IkConstraintData=e}(n||(n={})),function(t){var e=function(){function e(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var i=0,n=t.bones.length;i0;if(r>0||s){var a=this.data,o=a.spacingMode==t.SpacingMode.Percent,h=a.rotateMode,l=h==t.RotateMode.Tangent,u=h==t.RotateMode.ChainScale,c=this.bones.length,d=l?c:c+1,f=this.bones,p=t.Utils.setArraySize(this.spaces,d),v=null,g=this.spacing;if(u||!o){u&&(v=t.Utils.setArraySize(this.lengths,c));for(var m=a.spacingMode==t.SpacingMode.Length,y=0,x=d-1;y0?t.MathUtils.degRad:-t.MathUtils.degRad;y=0;for(var P=3;yt.MathUtils.PI?X-=t.MathUtils.PI2:X<-t.MathUtils.PI&&(X+=t.MathUtils.PI2),X*=n,B=Math.cos(X),U=Math.sin(X),k.a=B*V-U*N,k.b=B*D-U*Y,k.c=U*V+B*N,k.d=U*D+B*Y}k.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(i,n,r,s,a){var o=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*n+2),c=null,d=i.closed,f=i.worldVerticesLength,p=f/6,v=e.NONE;if(!i.constantSpeed){var g=i.lengths,m=g[p-=d?1:2];if(s&&(h*=m),a)for(var y=1;ym){v!=e.AFTER&&(v=e.AFTER,i.computeWorldVertices(o,f-6,4,c,0,2)),this.addAfterPosition(M-m,c,0,u,x);continue}}for(;;w++){var E=g[w];if(!(M>E)){if(0==w)M/=E;else M=(M-(Z=g[w-1]))/(E-Z);break}}w!=v&&(v=w,d&&w==p?(i.computeWorldVertices(o,f-4,4,c,0,2),i.computeWorldVertices(o,0,4,c,4,2)):i.computeWorldVertices(o,6*w+2,8,c,0,2)),this.addCurvePosition(M,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,x,r||y>0&&0==q)}return u}d?(f+=2,c=t.Utils.setArraySize(this.world,f),i.computeWorldVertices(o,2,f-4,c,0,2),i.computeWorldVertices(o,0,2,c,f-4,2),c[f-2]=c[0],c[f-1]=c[1]):(p--,f-=4,c=t.Utils.setArraySize(this.world,f),i.computeWorldVertices(o,2,f,c,0,2));for(var T=t.Utils.setArraySize(this.curves,p),A=0,b=c[0],S=c[1],R=0,I=0,C=0,P=0,k=0,O=0,_=0,F=0,L=0,V=0,D=0,N=0,Y=0,X=0,B=(y=0,2);yA){this.addAfterPosition(M-A,c,f-4,u,x);continue}}for(;;w++){var G=T[w];if(!(M>G)){if(0==w)M/=G;else M=(M-(Z=T[w-1]))/(G-Z);break}}if(w!=v){v=w;var H=6*w;for(b=c[H],S=c[H+1],R=c[H+2],I=c[H+3],C=c[H+4],P=c[H+5],D=2*(_=.03*(b-2*R+C))+(L=.006*(3*(R-C)-b+(k=c[H+6]))),N=2*(F=.03*(S-2*I+P))+(V=.006*(3*(I-P)-S+(O=c[H+7]))),Y=.3*(R-b)+_+.16666667*L,X=.3*(I-S)+F+.16666667*V,z=Math.sqrt(Y*Y+X*X),U[0]=z,H=1;H<8;H++)Y+=D,X+=N,D+=L,N+=V,z+=Math.sqrt(Y*Y+X*X),U[H]=z;Y+=D,X+=N,z+=Math.sqrt(Y*Y+X*X),U[8]=z,Y+=D+L,X+=N+V,z+=Math.sqrt(Y*Y+X*X),U[9]=z,W=0}for(M*=z;;W++){var j=U[W];if(!(M>j)){var Z;if(0==W)M/=j;else M=W+(M-(Z=U[W-1]))/(j-Z);break}}this.addCurvePosition(.1*M,b,S,R,I,C,P,k,O,u,x,r||y>0&&0==q)}return u},e.prototype.addBeforePosition=function(t,e,i,n,r){var s=e[i],a=e[i+1],o=e[i+2]-s,h=e[i+3]-a,l=Math.atan2(h,o);n[r]=s+t*Math.cos(l),n[r+1]=a+t*Math.sin(l),n[r+2]=l},e.prototype.addAfterPosition=function(t,e,i,n,r){var s=e[i+2],a=e[i+3],o=s-e[i],h=a-e[i+1],l=Math.atan2(h,o);n[r]=s+t*Math.cos(l),n[r+1]=a+t*Math.sin(l),n[r+2]=l},e.prototype.addCurvePosition=function(t,e,i,n,r,s,a,o,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=i,void(l[u+2]=Math.atan2(r-i,n-e));var d=t*t,f=d*t,p=1-t,v=p*p,g=v*p,m=p*t,y=3*m,x=p*y,w=y*t,M=e*g+n*x+s*w+o*f,E=i*g+r*x+a*w+h*f;l[u]=M,l[u+1]=E,c&&(l[u+2]=t<.001?Math.atan2(r-i,n-e):Math.atan2(E-(i*v+r*m*2+a*d),M-(e*v+n*m*2+s*d)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i}return r(e,t),e}(t.ConstraintData);t.PathConstraintData=e,function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(t.PositionMode||(t.PositionMode={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent"}(t.SpacingMode||(t.SpacingMode={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(t.RotateMode||(t.RotateMode={}))}(n||(n={})),function(t){var e=function(){function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t}(),i=function(){function t(t){void 0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}return t.prototype.queueAsset=function(t,i,n){var r=this.clientAssets[t];return null==r&&(r=new e(t),this.clientAssets[t]=r),null!==i&&(r.textureLoader=i),r.toLoad.push(n),this.queuedAssets[n]!==n&&(this.queuedAssets[n]=n,!0)},t.prototype.loadText=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.overrideMimeType("text/html"),n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=n.responseText:i.errors[e]="Couldn't load text ".concat(e,": status ").concat(n.status,", ").concat(n.responseText))},n.open("GET",e,!0),n.send()}},t.prototype.loadJson=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.overrideMimeType("text/html"),n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=JSON.parse(n.responseText):i.errors[e]="Couldn't load text ".concat(e,": status ").concat(n.status,", ").concat(n.responseText))},n.open("GET",e,!0),n.send()}},t.prototype.loadTexture=function(t,e,i){var n=this;if(i=this.pathPrefix+i,this.queueAsset(t,e,i))if(!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts){fetch(i,{mode:"cors"}).then((function(t){return t.ok||(n.errors[i]="Couldn't load image "+i),t.blob()})).then((function(t){return createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"})})).then((function(t){n.rawAssets[i]=t}))}else{var r=new Image;r.crossOrigin="anonymous",r.onload=function(t){n.rawAssets[i]=r},r.onerror=function(t){n.errors[i]="Couldn't load image ".concat(i)},r.src=i}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var i=this.clientAssets[t];return null==i||i.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts,i=0;i0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=i}(n||(n={})),function(t){var e=function(){function e(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(var i=0;i1){var s=n[n.length-1];this._updateCache.indexOf(s)>-1||this.updateCacheReset.push(s)}this._updateCache.push(e),this.sortReset(r.children),n[n.length-1].sorted=!0}},e.prototype.sortPathConstraint=function(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active){var i=e.target,n=i.data.index,r=i.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,n,r),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,r);for(var s=0,a=this.data.skins.length;s-1||this.updateCacheReset.push(s)}else for(r=0;r0){w=new t.DrawOrderTimeline(V);var D=r.slots.length;for(u=0;u=0;f--)Y[f]=-1;var X=t.Utils.newArray(D-N,0),B=0,U=0;for(f=0;f=0;f--)-1==Y[f]&&(Y[f]=X[--U]);w.setFrame(u,y,Y)}s.push(w),o=Math.max(o,w.frames[V-1])}var z=i.readInt(!0);if(z>0){for(w=new t.EventTimeline(z),u=0;u>>1^-(1&i)},t.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},t.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(n),i++}}return e},t.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},t.prototype.readBoolean=function(){return 0!=this.readByte()},t}(),n=function(t,e,i,n,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=n,this.inheritDeform=r},r=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(n||(n={})),function(t){var e=function(){function e(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new t.Pool((function(){return t.Utils.newFloatArray(16)}))}return e.prototype.update=function(e,i){if(null==e)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,r=this.polygons,s=this.polygonPool,a=e.slots,o=a.length;n.length=0,s.freeAll(r),r.length=0;for(var h=0;h=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,i,n){var r=this.minX,s=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&i<=r||e<=s&&n<=s||t>=a&&i>=a||e>=o&&n>=o)return!1;var h=(n-e)/(i-t),l=h*(r-t)+e;if(l>s&&ls&&lr&&ur&&ut.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var i=this.polygons,n=0,r=i.length;n=i||l=i){var u=n[o];u+(i-h)/(l-h)*(n[s]-u)=u&&x<=f||x>=f&&x<=u)&&(x>=e&&x<=n||x>=n&&x<=e)){var w=(l*m-h*v)/y;if((w>=c&&w<=p||w>=p&&w<=c)&&(w>=i&&w<=r||w>=r&&w<=i))return!0}u=f,c=p}return!1},e.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},e.prototype.getWidth=function(){return this.maxX-this.minX},e.prototype.getHeight=function(){return this.maxY-this.minY},e}();t.SkeletonBounds=e}(n||(n={})),function(t){var e=function(){function e(){this.triangulator=new t.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return e.prototype.clipStart=function(i,n){if(null!=this.clipAttachment)return 0;this.clipAttachment=n;var r=n.worldVerticesLength,s=t.Utils.setArraySize(this.clippingPolygon,r);n.computeWorldVertices(i,0,r,s,0,2);var a=this.clippingPolygon;e.makeClockwise(a);for(var o=this.clippingPolygons=this.triangulator.decompose(a,this.triangulator.triangulate(a)),h=0,l=o.length;h>1,Y=this.clipOutput,X=t.Utils.setArraySize(u,k+N*p),B=0;B=2?(u=o,o=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(i),u.push(n),u.push(r),u.push(s),u.push(t),u.push(e),o.length=0;for(var c=a,d=a.length-4,f=0;;f+=2){for(var p=c[f],v=c[f+1],g=c[f+2],m=c[f+3],y=p-g,x=v-m,w=u,M=u.length-2,E=o.length,T=0;T0;if(y*(b-m)-x*(A-g)>0){if(I){o.push(S),o.push(R);continue}var C=(k=R-b)*(g-p)-(O=S-A)*(m-v);if(Math.abs(C)>1e-6){var P=(O*(v-b)-k*(p-A))/C;o.push(p+(g-p)*P),o.push(v+(m-v)*P)}else o.push(p),o.push(v)}else if(I){var k,O;C=(k=R-b)*(g-p)-(O=S-A)*(m-v);if(Math.abs(C)>1e-6){P=(O*(v-b)-k*(p-A))/C;o.push(p+(g-p)*P),o.push(v+(m-v)*P)}else o.push(p),o.push(v);o.push(S),o.push(R)}l=!0}if(E==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),f==d)break;var _=o;(o=u).length=0,u=_}if(h!=o){h.length=0;f=0;for(var F=o.length-2;f>1;o=0;d--)-1==q[d]&&(q[d]=H[--Z])}w.setFrame(c++,this.getValue(W,"time",0),q)}s.push(w),a=Math.max(a,w.frames[w.getFrameCount()-1])}if(e.events){for(w=new t.EventTimeline(e.events.length),c=0,d=0;d=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=i},i.prototype.addSkin=function(t){for(var e=0;e= 0.");if(null==i)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=e,this.name=i,this.boneData=n};t.SlotData=e}(n||(n={})),function(t){var e,i,n=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return e.MipMapNearestNearest;case"mipmaplinearnearest":return e.MipMapLinearNearest;case"mipmapnearestlinear":return e.MipMapNearestLinear;case"mipmaplinearlinear":return e.MipMapLinearLinear;default:throw new Error("Unknown texture filter ".concat(t))}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return i.MirroredRepeat;case"clamptoedge":return i.ClampToEdge;case"repeat":return i.Repeat;default:throw new Error("Unknown texture wrap ".concat(t))}},t}();t.Texture=n,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(e=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(i=t.TextureWrap||(t.TextureWrap={}));var s=function(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.rotate=!1,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0};t.TextureRegion=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(n);t.FakeTexture=a}(n||(n={})),function(t){var e=function(){function e(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}return e.prototype.load=function(e,r){if(null==r)throw new Error("textureLoader cannot be null.");for(var a=new i(e),o=new Array(4),h=null;;){var l=a.readLine();if(null==l)break;if(0==(l=l.trim()).length)h=null;else if(h){var u=new s;u.name=l,u.page=h;var c=a.readValue();"true"==c.toLocaleLowerCase()?u.degrees=90:"false"==c.toLocaleLowerCase()?u.degrees=0:u.degrees=parseFloat(c),u.rotate=90==u.degrees,a.readTuple(o);var d=parseInt(o[0]),f=parseInt(o[1]);a.readTuple(o);var p=parseInt(o[0]),v=parseInt(o[1]);u.u=d/h.width,u.v=f/h.height,u.rotate?(u.u2=(d+v)/h.width,u.v2=(f+p)/h.height):(u.u2=(d+p)/h.width,u.v2=(f+v)/h.height),u.x=d,u.y=f,u.width=Math.abs(p),u.height=Math.abs(v),4==a.readTuple(o)&&4==a.readTuple(o)&&a.readTuple(o),u.originalWidth=parseInt(o[0]),u.originalHeight=parseInt(o[1]),a.readTuple(o),u.offsetX=parseInt(o[0]),u.offsetY=parseInt(o[1]),u.index=parseInt(a.readValue()),u.texture=h.texture,this.regions.push(u)}else{(h=new n).name=l,2==a.readTuple(o)&&(h.width=parseInt(o[0]),h.height=parseInt(o[1]),a.readTuple(o)),a.readTuple(o),h.minFilter=t.Texture.filterFromString(o[0]),h.magFilter=t.Texture.filterFromString(o[1]);var g=a.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==g?h.uWrap=t.TextureWrap.Repeat:"y"==g?h.vWrap=t.TextureWrap.Repeat:"xy"==g&&(h.uWrap=h.vWrap=t.TextureWrap.Repeat),h.texture=r(l),h.texture.setFilters(h.minFilter,h.magFilter),h.texture.setWraps(h.uWrap,h.vWrap),h.width=h.texture.getImage().width,h.height=h.texture.getImage().height,this.pages.push(h)}}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw new Error("Invalid line: "+e);for(var n=0,r=i+1;n<3;n++){var s=e.indexOf(",",r);if(-1==s)break;t[n]=e.substr(r,s-r).trim(),r=s+1}return t[n]=e.substring(r).trim(),n+1},t}(),n=function(){};t.TextureAtlasPage=n;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=s}(n||(n={})),function(t){var e=function(){function e(e,i){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,this.active=!1,null==e)throw new Error("data cannot be null.");if(null==i)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(var n=0;n0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,d=this.data.offsetShearY*u,f=this.bones,p=0,v=f.length;pt.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R*=e;var E=Math.cos(R),T=Math.sin(R);g.a=E*y-T*w,g.b=E*x-T*M,g.c=T*y+E*w,g.d=T*x+E*M,m=!0}if(0!=i){var A=this.temp;s.localToWorld(A.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(A.x-g.worldX)*i,g.worldY+=(A.y-g.worldY)*i,m=!0}if(n>0){var b=Math.sqrt(g.a*g.a+g.c*g.c),S=Math.sqrt(a*a+h*h);b>1e-5&&(b=(b+(S-b+this.data.offsetScaleX)*n)/b),g.a*=b,g.c*=b,b=Math.sqrt(g.b*g.b+g.d*g.d),S=Math.sqrt(o*o+l*l),b>1e-5&&(b=(b+(S-b+this.data.offsetScaleY)*n)/b),g.b*=b,g.d*=b,m=!0}if(r>0){x=g.b,M=g.d;var R,I=Math.atan2(M,x);(R=Math.atan2(l,o)-Math.atan2(h,a)-(I-Math.atan2(g.c,g.a)))>t.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R=I+(R+d)*r;b=Math.sqrt(x*x+M*M);g.b=Math.cos(R)*b,g.d=Math.sin(R)*b,m=!0}m&&(g.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,i=this.translateMix,n=this.scaleMix,r=this.shearMix,s=this.target,a=s.a,o=s.b,h=s.c,l=s.d,u=a*l-o*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,d=this.data.offsetShearY*u,f=this.bones,p=0,v=f.length;pt.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2),S*=e;var E=Math.cos(S),T=Math.sin(S);g.a=E*y-T*w,g.b=E*x-T*M,g.c=T*y+E*w,g.d=T*x+E*M,m=!0}if(0!=i){var A=this.temp;s.localToWorld(A.set(this.data.offsetX,this.data.offsetY)),g.worldX+=A.x*i,g.worldY+=A.y*i,m=!0}if(n>0){var b=(Math.sqrt(a*a+h*h)-1+this.data.offsetScaleX)*n+1;g.a*=b,g.c*=b,b=(Math.sqrt(o*o+l*l)-1+this.data.offsetScaleY)*n+1,g.b*=b,g.d*=b,m=!0}if(r>0){var S;(S=Math.atan2(l,o)-Math.atan2(h,a))>t.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2);x=g.b,M=g.d;S=Math.atan2(M,x)+(S-t.MathUtils.PI/2+d)*r;b=Math.sqrt(x*x+M*M);g.b=Math.cos(S)*b,g.d=Math.sin(S)*b,m=!0}m&&(g.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a1e-5&&(f=(f+(r.ascaleX-f+this.data.offsetScaleX)*i)/f),p>1e-5&&(p=(p+(r.ascaleY-p+this.data.offsetScaleY)*i)/p));var v=h.ashearY;if(0!=n){u=r.ashearY-v+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*n}h.updateWorldTransformWith(c,d,l,f,p,h.ashearX,v)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a1e-5&&(d*=(r.ascaleX-1+this.data.offsetScaleX)*i+1),f>1e-5&&(f*=(r.ascaleY-1+this.data.offsetScaleY)*i+1));var p=h.ashearY;0!=n&&(p+=(r.ashearY+this.data.offsetShearY)*n),h.updateWorldTransformWith(u,c,l,d,f,h.ashearX,p)}},e}();t.TransformConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i.rotateMix=0,i.translateMix=0,i.scaleMix=0,i.shearMix=0,i.offsetRotation=0,i.offsetX=0,i.offsetY=0,i.offsetScaleX=0,i.offsetScaleY=0,i.offsetShearY=0,i.relative=!1,i.local=!1,i}return r(e,t),e}(t.ConstraintData);t.TransformConstraintData=e}(n||(n={})),function(t){var e=function(){function e(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new t.Pool((function(){return new Array})),this.polygonIndicesPool=new t.Pool((function(){return new Array}))}return e.prototype.triangulate=function(t){var i=t,n=t.length>>1,r=this.indicesArray;r.length=0;for(var s=0;s3;){for(var l=n-1,u=(s=0,1);;){t:if(!a[s]){for(var c=r[l]<<1,d=r[s]<<1,f=r[u]<<1,p=i[c],v=i[c+1],g=i[d],m=i[d+1],y=i[f],x=i[f+1],w=(u+1)%n;w!=l;w=(w+1)%n)if(a[w]){var M=r[w]<<1,E=i[M],T=i[M+1];if(e.positiveArea(y,x,p,v,E,T)&&e.positiveArea(p,v,g,m,E,T)&&e.positiveArea(g,m,y,x,E,T))break t}break}if(0==u){do{if(!a[s])break;s--}while(s>0);break}l=s,s=u,u=(u+1)%n}h.push(r[(n+s-1)%n]),h.push(r[s]),h.push(r[(s+1)%n]),r.splice(s,1),a.splice(s,1);var A=(--n+s-1)%n,b=s==n?0:s;a[A]=e.isConcave(A,n,i,r),a[b]=e.isConcave(b,n,i,r)}return 3==n&&(h.push(r[2]),h.push(r[0]),h.push(r[1])),h},e.prototype.decompose=function(t,i){var n=t,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var s=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(s),s.length=0;var a=this.polygonIndicesPool.obtain();a.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,u=0,c=i.length;u0?(r.push(o),s.push(a)):(this.polygonPool.free(o),this.polygonIndicesPool.free(a)),(o=this.polygonPool.obtain()).length=0,o.push(v),o.push(g),o.push(m),o.push(y),o.push(x),o.push(w),(a=this.polygonIndicesPool.obtain()).length=0,a.push(d),a.push(f),a.push(p),l=e.winding(v,g,m,y,x,w),h=d)}o.length>0&&(r.push(o),s.push(a));for(u=0,c=r.length;u=0;u--)0==(o=r[u]).length&&(r.splice(u,1),this.polygonPool.free(o),a=s[u],s.splice(u,1),this.polygonIndicesPool.free(a));return r},e.isConcave=function(t,e,i,n){var r=n[(e+t-1)%e]<<1,s=n[t]<<1,a=n[(t+1)%e]<<1;return!this.positiveArea(i[r],i[r+1],i[s],i[s+1],i[a],i[a+1])},e.positiveArea=function(t,e,i,n,r,s){return t*(s-n)+i*(e-s)+r*(n-e)>=0},e.winding=function(t,e,i,n,r,s){var a=i-t,o=n-e;return r*o-s*a+a*e-t*o>=0?1:-1},e}();t.Triangulator=e}(n||(n={})),function(t){var e=function(){function t(){this.array=new Array}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return null!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t}();t.IntSet=e;var i=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.r=t,this.g=e,this.b=i,this.a=n}return t.prototype.set=function(t,e,i,n){return this.r=t,this.g=e,this.b=i,this.a=n,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,i,n){return this.r+=t,this.g+=e,this.b+=i,this.a+=n,this.clamp(),this},t.prototype.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.rgba8888ToColor=function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},t.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();t.Color=i;var n=function(){function t(){}return t.clamp=function(t,e,i){return ti?i:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,i){return t.randomTriangularWith(e,i,.5*(e+i))},t.randomTriangularWith=function(t,e,i){var n=Math.random(),r=e-t;return n<=(i-t)/r?t+Math.sqrt(n*r*(i-t)):e-Math.sqrt((1-n)*r*(e-i))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();t.MathUtils=n;var s=function(){function t(){}return t.prototype.apply=function(t,e,i){return t+(e-t)*this.applyInternal(i)},t}();t.Interpolation=s;var a=function(t){function e(e){var i=t.call(this)||this;return i.power=2,i.power=e,i}return r(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1},e}(s);t.Pow=a;var o=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(a);t.PowOut=o;var h=function(){function t(){}return t.arrayCopy=function(t,e,i,n,r){for(var s=e,a=n;s=i?e:t.setArraySize(e,i,n)},t.newArray=function(t,e){for(var i=new Array(t),n=0;n0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();t.TimeKeeper=d;var f=function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*s;var a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,d=0;d0&&(h=o);for(var w,M=(w=t.bone).worldX,E=w.worldY,T=w.a,A=w.b,b=w.c,S=w.d,R=e,I=r;I{var n=i(7473),r=i(4597),s=i(6732),a=i(2482),o=i(704),h=i(3137),l=i(1192),u=new n({Extends:h,initialize:function(t,e,i,n,s,u,c){var d,f,p,v=[],g=t.cacheManager.custom.spine;if(a(e)){var m=e;for(e=r(m,"key"),f=new o(t,{key:e,url:r(m,"jsonURL"),extension:r(m,"jsonExtension","json"),xhrSettings:r(m,"jsonXhrSettings")}),n=r(m,"atlasURL"),s=r(m,"preMultipliedAlpha"),Array.isArray(n)||(n=[n]),d=0;d{var n=i(2494),r=i(7473),s=i(5851),a=i(3527),o=i(5722),h=i(5159),l=i(3524),u=i(8332),c=i(5782),d=i(1984),f=new r({Extends:o,initialize:function(t,e,i){o.call(this,t,e,i);var r=e.game;this.isWebGL=2===r.config.renderType,this.cache=r.cache.addCustom("spine"),this.spineTextures=r.cache.addCustom("spineTextures"),this.json=r.cache.json,this.textures=r.textures,this.drawDebug=!1,this.gl,this.renderer,this.sceneRenderer,this.skeletonRenderer,this.skeletonDebugRenderer,this.plugin=h,this.temp1,this.temp2,this.isWebGL?(this.runtime=h.webgl,this.renderer=r.renderer,this.gl=r.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=r.renderer,this.getAtlas=this.getAtlasCanvas),this.renderer||(this.renderer={width:r.scale.width,height:r.scale.height,preRender:d,postRender:d,render:d,destroy:d});var a=this.isWebGL;e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",(function(t,e,n,r,s){a&&this.scene.sys.renderer.pipelines.clear();var o=this.scene.sys[i],h=new u(this.scene,o,t,e,n,r,s);return this.displayList.add(h),this.updateList.add(h),a&&this.scene.sys.renderer.pipelines.rebind(),h}),(function(t,e){void 0===t&&(t={}),a&&this.scene.sys.renderer.pipelines.clear();var r=s(t,"key",null),o=s(t,"animationName",null),h=s(t,"loop",!1),l=this.scene.sys[i],c=new u(this.scene,l,0,0,r,o,h);void 0!==e&&(t.add=e),n(this.scene,c,t);var d=s(t,"skinName",!1);d&&c.setSkinByName(d);var f=s(t,"slotName",!1),p=s(t,"attachmentName",null);return f&&c.setAttachment(f,p),a&&this.scene.sys.renderer.pipelines.rebind(),c.refresh()})),e.registerGameObject("spineContainer",(function(t,e,n){var r=this.scene.sys[i],s=new c(this.scene,r,t,e,n);return this.displayList.add(s),s}),(function(t,e){void 0===t&&(t={});var r=s(t,"x",0),a=s(t,"y",0),o=s(t,"children",null),h=this.scene.sys[i],l=new c(this.scene,h,r,a,o);return void 0!==e&&(t.add=e),n(this.scene,l,t),l}))},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(a,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this),this.game.events.once("destroy",this.gameDestroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){var t=function(t,e){if(t!==this.srcBlend||e!==this.dstBlend){var i=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),i.blendFunc(this.srcBlend,this.dstBlend))}},e=this.renderer.spineSceneRenderer;e||((e=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0)).batcher.setBlendMode=t,e.shapes.setBlendMode=t,this.renderer.spineSceneRenderer=e),this.sceneRenderer=e,this.skeletonRenderer=e.skeletonRenderer,this.skeletonDebugRenderer=e.skeletonDebugRenderer,this.temp1=new h.webgl.Vector3(0,0,0),this.temp2=new h.webgl.Vector3(0,0,0)},getAtlasCanvas:function(t){var e=this.cache.get(t);if(e){var i,n=this.spineTextures;if(n.has(t))i=n.get(t);else{var r=this.textures;i=new h.TextureAtlas(e.data,(function(i){return new h.canvas.CanvasTexture(r.get(e.prefix+t+":"+i).getSourceImage())}))}return i}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var i,n=this.spineTextures;if(n.has(t))i=n.get(t);else{var r=this.textures,s=this.sceneRenderer.context.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i=new h.TextureAtlas(e.data,(function(i){return new h.webgl.GLTexture(s,r.get(e.prefix+t+":"+i).getSourceImage(),!1)}))}return i}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,i,n,r,s,a){var o;if(a=a||{},Array.isArray(t))for(var h=0;h{var n=i(7473),r=i(7361),s=i(7738),a=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,n,s){r.call(this,t,i,n,s),this.type="Spine",this.plugin=e},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null,this.plugin=null}});t.exports=a},8064:t=>{t.exports=function(t,e,i,n){var r=e.list;if(0!==r.length){i.addToRenderList(e);var s=e.localTransform;n?(s.loadIdentity(),s.multiply(n),s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.scaleX,e.scaleY)):s.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var n=i(1984),r=i(1984);r=i(8064),t.exports={renderWebGL:n,renderCanvas:r}},6576:t=>{t.exports="complete"},8621:t=>{t.exports="dispose"},8944:t=>{t.exports="end"},7494:t=>{t.exports="event"},1908:t=>{t.exports="interrupted"},5591:t=>{t.exports="start"},5146:(t,e,i)=>{t.exports={COMPLETE:i(6576),DISPOSE:i(8621),END:i(8944),EVENT:i(7494),INTERRUPTED:i(1908),START:i(5591)}},8332:(t,e,i)=>{var n=i(6412),r=i(2915),s=i(7473),a=i(1991),o=i(3131),h=i(9660),l=i(4627),u=i(3212),c=i(8414),d=i(3426),f=i(7149),p=i(2273),v=i(4208),g=i(5146),m=i(2762),y=new s({Extends:p,Mixins:[a,o,h,l,u,c,m],initialize:function(t,e,i,n,r,s,a){p.call(this,t,"Spine"),this.plugin=e,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null,this.root=null,this.bounds=null,this.drawDebug=!1,this.timeScale=1,this.displayOriginX=0,this.displayOriginY=0,this.preMultipliedAlpha=!1,this.blendMode=-1,this.setPosition(i,n),r&&this.setSkeleton(r,s,a)},willRender:function(t,e){var i=!this.skeleton||!(15!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id);if(!e&&!i&&this.parentContainer){var n=this.plugin,r=n.sceneRenderer;n.gl&&r.batcher.isDrawing&&(r.end(),n.renderer.pipelines.rebind())}return i},setAlpha:function(t,e){if(void 0===t&&(t=1),e){var i=this.findSlot(e);i&&(i.color.a=r(t,0,1))}else this.alpha=t;return this},alpha:{get:function(){return this.skeleton.color.a},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.a=e),0===e?this.renderFlags&=-3:this.renderFlags|=2}},red:{get:function(){return this.skeleton.color.r},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.r=e)}},green:{get:function(){return this.skeleton.color.g},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.g=e)}},blue:{get:function(){return this.skeleton.color.b},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.b=e)}},setColor:function(t,e){void 0===t&&(t=16777215);var i=(t>>16&255)/255,n=(t>>8&255)/255,r=(255&t)/255,s=t>16777215?(t>>>24)/255:null,a=this.skeleton;if(e){var o=this.findSlot(e);o&&(a=o)}return a.color.r=i,a.color.g=n,a.color.b=r,null!==s&&(a.color.a=s),this},setSkeletonFromJSON:function(t,e,i,n){return this.setSkeleton(t,e,i,n)},setSkeleton:function(t,e,i,n){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,n);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkin(),s.setToSetupPose(),this.skeleton=s,r=this.plugin.createAnimationState(s),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=v(d(this.rotation))+90),this.state.apply(s),s.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=v(d(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,n){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===i&&(i=0),void 0===n&&(n=0),this.width=t,this.height=e,this.displayOriginX=r.x-i,this.displayOriginY=r.y-n,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,n=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=i,t.scaleY=n,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i{var n=i(3426),r=i(4208),s=i(8445);t.exports=function(t,e,i,a){var o=t.currentContext,h=e.plugin,l=e.skeleton,u=h.skeletonRenderer,c=t._tempMatrix1,d=t._tempMatrix2,f=t._tempMatrix3;i.addToRenderList(e),d.applyITRS(e.x,e.y,e.rotation,Math.abs(e.scaleX),Math.abs(e.scaleY)),c.copyFrom(i.matrix),a?(c.multiplyWithOffset(a,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),d.e=e.x,d.f=e.y,c.multiply(d,f)):(d.e-=i.scrollX*e.scrollFactorX,d.f-=i.scrollY*e.scrollFactorY,c.multiply(d,f)),l.x=f.tx,l.y=f.ty,l.scaleX=f.scaleX,l.scaleY=-1*f.scaleY,e.scaleX<0?(l.scaleX*=-1,e.root.rotation=r(f.rotationNormalized)):e.root.rotation=s(r(n(f.rotationNormalized))+90,0,360),e.scaleY<0&&(l.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*r(f.rotationNormalized):e.root.rotation+=2*r(f.rotationNormalized)),i.renderToTexture&&(l.y=f.ty,l.scaleY*=-1),l.updateWorldTransform(),u.ctx=o,u.debugRendering=h.drawDebug||e.drawDebug,o.save(),u.draw(l),o.restore()}},2762:(t,e,i)=>{var n=i(1984),r=i(1984),s=i(1984);r=i(2753),t.exports={renderWebGL:n,renderCanvas:r,renderDirect:s}},9454:(t,e,i)=>{var n={VERSION:"3.60.0",BlendModes:i(8351),ScaleModes:i(8196),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},1081:(t,e,i)=>{var n=i(7473),r=i(6748),s=new n({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(r.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n{t.exports="changedata"},7801:t=>{t.exports="changedata-"},4873:t=>{t.exports="destroy"},9966:t=>{t.exports="removedata"},4586:t=>{t.exports="setdata"},6748:(t,e,i)=>{t.exports={CHANGE_DATA:i(9044),CHANGE_DATA_KEY:i(7801),DESTROY:i(4873),REMOVE_DATA:i(9966),SET_DATA:i(4586)}},3004:(t,e,i)=>{var n=i(2776),r={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return r;r.audioData=!!window.Audio,r.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var n=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(n||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(n)};if(r.ogg=i('ogg; codecs="vorbis"'),r.opus=i('ogg; codecs="opus"',"opus"),r.mp3=i("mpeg"),r.wav=i("wav"),r.m4a=i("x-m4a"),r.aac=i("aac"),r.flac=i("flac","x-flac"),r.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(n.edge)r.dolby=!0;else if(n.safari&&n.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var s=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===s&&a>=11||s>10)&&(r.dolby=!0)}}}catch(t){}return r}()},2776:(t,e,i)=>{var n,r=i(5203),s={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(n=navigator.userAgent,/Edg\/\d+/.test(n)?(s.edge=!0,s.es2019=!0):/OPR/.test(n)?(s.opera=!0,s.es2019=!0):/Chrome\/(\d+)/.test(n)&&!r.windowsPhone?(s.chrome=!0,s.chromeVersion=parseInt(RegExp.$1,10),s.es2019=s.chromeVersion>69):/Firefox\D+(\d+)/.test(n)?(s.firefox=!0,s.firefoxVersion=parseInt(RegExp.$1,10),s.es2019=s.firefoxVersion>10):/AppleWebKit/.test(n)&&r.iOS?s.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(s.ie=!0,s.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+) Safari/.test(n)&&!r.windowsPhone?(s.safari=!0,s.safariVersion=parseInt(RegExp.$1,10),s.es2019=s.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(s.ie=!0,s.trident=!0,s.tridentVersion=parseInt(RegExp.$1,10),s.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(s.silk=!0),s)},6505:(t,e,i)=>{var n,r,s,a=i(8073),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",r="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(s=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(s,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+r},s.src=n+"AP804Oa6"+r,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),n=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),n}()),o)},6543:(t,e,i)=>{var n=i(5203),r=i(2776),s=i(8073),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=s.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=s.create2D(this),n=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=n.data instanceof Uint8ClampedArray,s.remove(t),s.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!n.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},3922:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",n="FullScreen",r=["request"+i,"request"+n,"webkitRequest"+i,"webkitRequest"+n,"msRequest"+i,"msRequest"+n,"mozRequest"+n,"mozRequest"+i];for(t=0;t{var n=i(2776),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||n.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":n.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},5203:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},2131:(t,e,i)=>{var n=i(4597),r={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return r;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(r.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(r.h264=!0,r.mp4=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(r.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(r.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(r.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(r.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),r.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e{t.exports={os:i(5203),browser:i(2776),features:i(6543),input:i(1454),audio:i(3004),video:i(2131),fullscreen:i(3922),canvasFeatures:i(6505)}},5686:(t,e,i)=>{var n=i(7473),r=new Float32Array(20),s=new n({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(t){return this._matrix.set(t),this._dirty=!0,this},reset:function(){var t=this._matrix;return t.fill(0),t[0]=1,t[6]=1,t[12]=1,t[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var t=this._data;return this._dirty&&(t.set(this._matrix),t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._dirty=!1),t},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,n=-.5*(i-1);return this.multiply([i,n,n,0,0,n,i,n,0,0,n,n,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),n=Math.sin(t),r=.213,s=.715,a=.072;return this.multiply([r+.787*i+n*-r,s+i*-s+n*-s,a+i*-a+.928*n,0,0,r+i*-r+.143*n,s+i*(1-s)+.14*n,a+i*-a+-.283*n,0,0,r+i*-r+-.787*n,s+i*-s+n*s,a+.928*i+n*a,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply(s.BLACK_WHITE,t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,n=-.5*(i-1);return this.multiply([i,0,0,0,n,0,i,0,0,n,0,0,i,0,n,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply(s.NEGATIVE,t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply(s.DESATURATE_LUMINANCE,t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply(s.SEPIA,t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply(s.LSD,t)},brown:function(t){return void 0===t&&(t=!1),this.multiply(s.BROWN,t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply(s.VINTAGE,t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply(s.KODACHROME,t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply(s.TECHNICOLOR,t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply(s.POLAROID,t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply(s.SHIFT_BGR,t)},multiply:function(t,e){void 0===e&&(e=!1),e||this.reset();var i=this._matrix,n=r;return n.set(i),i.set([n[0]*t[0]+n[1]*t[5]+n[2]*t[10]+n[3]*t[15],n[0]*t[1]+n[1]*t[6]+n[2]*t[11]+n[3]*t[16],n[0]*t[2]+n[1]*t[7]+n[2]*t[12]+n[3]*t[17],n[0]*t[3]+n[1]*t[8]+n[2]*t[13]+n[3]*t[18],n[0]*t[4]+n[1]*t[9]+n[2]*t[14]+n[3]*t[19]+n[4],n[5]*t[0]+n[6]*t[5]+n[7]*t[10]+n[8]*t[15],n[5]*t[1]+n[6]*t[6]+n[7]*t[11]+n[8]*t[16],n[5]*t[2]+n[6]*t[7]+n[7]*t[12]+n[8]*t[17],n[5]*t[3]+n[6]*t[8]+n[7]*t[13]+n[8]*t[18],n[5]*t[4]+n[6]*t[9]+n[7]*t[14]+n[8]*t[19]+n[9],n[10]*t[0]+n[11]*t[5]+n[12]*t[10]+n[13]*t[15],n[10]*t[1]+n[11]*t[6]+n[12]*t[11]+n[13]*t[16],n[10]*t[2]+n[11]*t[7]+n[12]*t[12]+n[13]*t[17],n[10]*t[3]+n[11]*t[8]+n[12]*t[13]+n[13]*t[18],n[10]*t[4]+n[11]*t[9]+n[12]*t[14]+n[13]*t[19]+n[14],n[15]*t[0]+n[16]*t[5]+n[17]*t[10]+n[18]*t[15],n[15]*t[1]+n[16]*t[6]+n[17]*t[11]+n[18]*t[16],n[15]*t[2]+n[16]*t[7]+n[17]*t[12]+n[18]*t[17],n[15]*t[3]+n[16]*t[8]+n[17]*t[13]+n[18]*t[18],n[15]*t[4]+n[16]*t[9]+n[17]*t[14]+n[18]*t[19]+n[19]]),this._dirty=!0,this}});s.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],s.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],s.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],s.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],s.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],s.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],s.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],s.KODACHROME=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],s.TECHNICOLOR=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],s.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],s.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t.exports=s},8073:(t,e,i)=>{var n,r,s,a=i(9454),o=i(2150),h=[],l=!1;t.exports=(s=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return n(t,e,i,a.CANVAS)},create:n=function(t,e,i,n,s){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=a.CANVAS),void 0===s&&(s=!1);var c=r(n);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:n},n===a.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),s&&(c.parent=u),u.width=e,u.height=i,l&&n===a.CANVAS&&o.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return n(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:r=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{var n=i(7473),r=i(3649),s=new n({initialize:function(t,e,i,n,r,s){e||(e=t.sys.make.image({x:i,y:n,key:r,frame:s,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});r.register("bitmapMask",(function(t,e,i,n,r){return new s(this.scene,t,e,i,n,r)})),t.exports=s},6726:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var n=t.gl;t.flush(),0===t.maskStack.length&&(n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var n=t.gl,r=this.geometryMask,s=t.maskCount,a=255;n.colorMask(!1,!1,!1,!1),i?(n.stencilFunc(n.EQUAL,s,a),n.stencilOp(n.KEEP,n.KEEP,n.INCR),s++):(n.stencilFunc(n.EQUAL,s+1,a),n.stencilOp(n.KEEP,n.KEEP,n.DECR)),this.level=s,r.renderWebGL(t,r,e),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),this.invertAlpha?n.stencilFunc(n.NOTEQUAL,s,a):n.stencilFunc(n.EQUAL,s,a)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var n=t.maskStack[t.maskStack.length-1];n.mask.applyStencil(t,n.camera,!1),t.currentCameraMask.mask!==n.mask?(i.mask=n.mask,i.camera=n.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},7340:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,s.BARREL,t),this.amount=e}});t.exports=a},5170:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h){void 0===i&&(i=1),void 0===n&&(n=1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=4),r.call(this,s.BLOOM,t),this.steps=h,this.offsetX=i,this.offsetY=n,this.blurStrength=a,this.strength=o,this.glcolor=[1,1,1],null!=e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4199:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h){void 0===e&&(e=0),void 0===i&&(i=2),void 0===n&&(n=2),void 0===a&&(a=1),void 0===h&&(h=4),r.call(this,s.BLUR,t),this.quality=0,this.x=i,this.y=n,this.steps=h,this.strength=a,this.glcolor=[1,1,1],null!=o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},3132:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===n&&(n=.2),void 0===a&&(a=!1),void 0===o&&(o=1),void 0===h&&(h=1),void 0===l&&(l=1),r.call(this,s.BOKEH,t),this.radius=e,this.amount=i,this.contrast=n,this.isTiltShift=a,this.strength=l,this.blurX=o,this.blurY=h}});t.exports=a},6610:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o){void 0===e&&(e=8),void 0===a&&(a=1),void 0===o&&(o=.005),r.call(this,s.CIRCLE,t),this.scale=a,this.feather=o,this.thickness=e,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],null!=i&&(this.color=i),null!=n&&(this.backgroundColor=n)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundColor:{get:function(){var t=this.glcolor2;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor2;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4931:(t,e,i)=>{var n=i(7473),r=i(5686),s=i(1571),a=new n({Extends:r,initialize:function(t){r.call(this),this.type=s.COLOR_MATRIX,this.gameObject=t,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});t.exports=a},6128:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e){this.type=t,this.gameObject=e,this.active=!0},setActive:function(t){return this.active=t,this},destroy:function(){this.gameObject=null,this.active=!1}});t.exports=n},9195:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===n&&(n=.005),r.call(this,s.DISPLACEMENT,t),this.x=i,this.y=n,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.gameObject.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=a},445:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===i&&(i=4),void 0===n&&(n=0),void 0===a&&(a=!1),r.call(this,s.GLOW,t),this.outerStrength=i,this.innerStrength=n,this.knockout=a,this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},7724:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l,u){void 0===n&&(n=.2),void 0===a&&(a=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l=1),void 0===u&&(u=0),r.call(this,s.GRADIENT,t),this.alpha=n,this.size=u,this.fromX=a,this.fromY=o,this.toX=h,this.toY=l,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],null!=e&&(this.color1=e),null!=i&&(this.color2=i)},color1:{get:function(){var t=this.glcolor1;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor1;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}},color2:{get:function(){var t=this.glcolor2;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor2;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}}});t.exports=a},4412:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,s.PIXELATE,t),this.amount=e}});t.exports=a},75:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=.1),void 0===a&&(a=1),void 0===h&&(h=6),void 0===l&&(l=1),r.call(this,s.SHADOW,t),this.x=e,this.y=i,this.decay=n,this.power=a,this.glcolor=[0,0,0,1],this.samples=h,this.intensity=l,void 0!==o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},8734:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===n&&(n=3),void 0===a&&(a=!1),r.call(this,s.SHINE,t),this.speed=e,this.lineWidth=i,this.gradient=n,this.reveal=a}});t.exports=a},2437:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===a&&(a=.5),r.call(this,s.VIGNETTE,t),this.x=e,this.y=i,this.radius=n,this.strength=a}});t.exports=a},5984:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=!1),r.call(this,s.WIPE,t),this.progress=0,this.wipeWidth=e,this.direction=i,this.axis=n,this.reveal=a}});t.exports=a},1571:t=>{t.exports={GLOW:4,SHADOW:5,PIXELATE:6,VIGNETTE:7,SHINE:8,BLUR:9,GRADIENT:12,BLOOM:13,COLOR_MATRIX:14,CIRCLE:15,BARREL:16,DISPLACEMENT:17,WIPE:18,BOKEH:19}},7347:(t,e,i)=>{var n=i(1030),r=i(1571),s={Barrel:i(7340),Controller:i(6128),Bloom:i(5170),Blur:i(4199),Bokeh:i(3132),Circle:i(6610),ColorMatrix:i(4931),Displacement:i(9195),Glow:i(445),Gradient:i(7724),Pixelate:i(4412),Shadow:i(75),Shine:i(8734),Vignette:i(2437),Wipe:i(5984)};s=n(!1,s,r),t.exports=s},2494:(t,e,i)=>{var n=i(8351),r=i(8361);t.exports=function(t,e,i){e.x=r(i,"x",0),e.y=r(i,"y",0),e.depth=r(i,"depth",0),e.flipX=r(i,"flipX",!1),e.flipY=r(i,"flipY",!1);var s=r(i,"scale",null);"number"==typeof s?e.setScale(s):null!==s&&(e.scaleX=r(s,"x",1),e.scaleY=r(s,"y",1));var a=r(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=r(a,"x",1),e.scrollFactorY=r(a,"y",1)),e.rotation=r(i,"rotation",0);var o=r(i,"angle",null);null!==o&&(e.angle=o),e.alpha=r(i,"alpha",1);var h=r(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),u=r(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=r(i,"blendMode",n.NORMAL),e.visible=r(i,"visible",!0),r(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},2273:(t,e,i)=>{var n=i(7473),r=i(6125),s=i(1081),a=i(4399),o=i(3389),h=i(204),l=new n({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new s(this)),this},setData:function(t,e){return this.data||(this.data=new s(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new s(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new s(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new s(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.preFX&&(this.preFX.destroy(),this.preFX=void 0),this.postFX&&(this.postFX.destroy(),this.postFX=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},3649:(t,e,i)=>{var n=i(7473),r=i(8456),s=i(204),a=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(s.BOOT,this.boot,this),this.events.on(s.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(s.DESTROY,this.destroy,this)},start:function(){this.events.once(s.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(s.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(s.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectFactory",a,"add"),t.exports=a},4344:(t,e,i)=>{var n=i(2915),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,r){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=r},4518:(t,e,i)=>{var n=i(2915),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=r},5173:(t,e,i)=>{var n=i(8351),r={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=r},1991:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},8305:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},3131:t=>{var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},1626:(t,e,i)=>{var n=i(7473),r=i(7347),s=i(8935),a=new n({initialize:function(t,e){this.gameObject=t,this.isPost=e,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(t){return void 0===t&&(t=0),this.padding=t,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(t){if(!this.isPost){var e=this.gameObject.scene.sys.renderer;e&&e.pipelines?(this.gameObject.pipeline=e.pipelines.FX_PIPELINE,void 0!==t&&(this.padding=t),this.enabled=!0):this.enabled=!1}},clear:function(){if(this.isPost)this.gameObject.resetPostPipeline(!0);else{for(var t=this.list,e=0;e{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},3671:(t,e,i)=>{var n=i(1392),r=i(9876),s=i(2529),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&r(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t,e){return void 0===t&&(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getTopLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,r,s,a,o,h,l;if(void 0===t&&(t=new n),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),r=t.x,s=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),r=t.x,s=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,r,a,h),t.y=Math.min(i,s,o,l),t.width=Math.max(e,r,a,h)-t.x,t.height=Math.max(i,s,o,l)-t.y,t}};t.exports=a},2246:(t,e,i)=>{var n=i(7499),r=i(6726),s={mask:null,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},createBitmapMask:function(t,e,i,r,s){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new n(this.scene,t,e,i,r,s)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new r(this.scene,t)}};t.exports=s},5085:t=>{var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},77:(t,e,i)=>{var n=i(7149),r=i(1864),s=i(5851),a=i(3747),o=i(2529),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=s(t,"from",0),t.to=s(t,"to",1);var h=r(t,"positionOnPath",!1);this.rotateToPath=r(t,"rotateToPath",!1),this.pathRotationOffset=s(t,"rotationOffset",0);var l=s(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+n(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,r=this.pathVector;if(i.copy(r).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,r),i.add(r),r.add(this.pathOffset),void this.setPosition(r.x,r.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),r),i.add(r),r.add(this.pathOffset);var s=this.x,o=this.y;this.setPosition(r.x,r.y);var h=this.x-s,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+n(this.pathRotationOffset))}}};t.exports=h},986:(t,e,i)=>{var n=i(3911),r={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(t){this.pipelineData={};var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(i){void 0===t&&(t=i.default);var n=i.get(t);if(n)return this.defaultPipeline=n,this.pipeline=n,!0}return!1},setPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){var a=s.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?n(e):e)}return this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},resetPipeline:function(t){return void 0===t&&(t=!1),this.pipeline=this.defaultPipeline,t&&(this.pipelineData={}),null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=r},4461:(t,e,i)=>{var n=i(3911),r=i(1626),s=i(8935),a={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(t){this.postPipelines=[],this.postPipelineData={},this.postFX=new r(this,!0),t&&(this.preFX=new r(this,!1))},setPostPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){Array.isArray(t)||(t=[t]);for(var a=0;a0,this},setPostPipelineData:function(t,e){var i=this.postPipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,n=[],r=0;r=0;n--){var r=i[n];(e&&r.name===t||!e&&r===t)&&(r.destroy(),s(i,n))}return this.hasPostPipeline=this.postPipelines.length>0,this},clearFX:function(){return this.preFX&&this.preFX.clear(),this.postFX&&this.postFX.clear(),this}};t.exports=a},4627:t=>{var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},1868:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},4976:(t,e,i)=>{var n=i(2362),r={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof n?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=r},9243:(t,e,i)=>{var n=i(2362),r={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof n?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=r},5693:t=>{var e={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,n){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,n=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=n,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=e},6125:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},3212:(t,e,i)=>{var n=i(7425),r=i(4227),s=i(7556),a=i(3692),o=i(2820),h=i(2529),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:0!==this._scaleY&&(this.renderFlags|=4)}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:0!==this._scaleX&&(this.renderFlags|=4)}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(e||(e=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,n){i||(i=new h),n||(n=this.scene.sys.cameras.main);var r=n.scrollX,a=n.scrollY,o=t+r*this.scrollFactorX-r,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):s(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},4227:(t,e,i)=>{var n=i(7473),r=i(7425),s=i(2529),a=new n({initialize:function(t,e,i,n,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),this.matrix=new Float32Array([t,e,i,n,r,s,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):n||s?r.TAU-(s>0?Math.acos(-n/this.scaleY):-Math.acos(n/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,r=n[0],s=n[1],a=n[2],o=n[3];return n[0]=r*i+a*e,n[1]=s*i+o*e,n[2]=r*-e+a*i,n[3]=s*-e+o*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,r=i[0],s=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],v=n[5],g=void 0===e?i:e.matrix;return g[0]=u*r+c*a,g[1]=u*s+c*o,g[2]=d*r+f*a,g[3]=d*s+f*o,g[4]=p*r+v*a+h,g[5]=p*s+v*o+l,g},multiplyWithOffset:function(t,e,i){var n=this.matrix,r=t.matrix,s=n[0],a=n[1],o=n[2],h=n[3],l=e*s+i*o+n[4],u=e*a+i*h+n[5],c=r[0],d=r[1],f=r[2],p=r[3],v=r[4],g=r[5];return n[0]=c*s+d*o,n[1]=c*a+d*h,n[2]=f*s+p*o,n[3]=f*a+p*h,n[4]=v*s+g*o+l,n[5]=v*a+g*h+u,this},transform:function(t,e,i,n,r,s){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+n*l,a[3]=i*h+n*u,a[4]=r*o+s*l+c,a[5]=r*h+s*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,r=n[0],s=n[1],a=n[2],o=n[3],h=n[4],l=n[5];return i.x=t*r+e*a+h,i.y=t*s+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=e*r-i*n;return t[0]=r/o,t[1]=-i/o,t[2]=-n/o,t[3]=e/o,t[4]=(n*a-r*s)/o,t[5]=-(e*a-i*s)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,r,s){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=n,a[4]=r,a[5]=s,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],r=e[2],s=e[3],a=i*s-n*r;if(t.translateX=e[4],t.translateY=e[5],i||n){var o=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(r||s){var h=Math.sqrt(r*r+s*s);t.rotation=.5*Math.PI-(s>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,n,r){var s=this.matrix,a=Math.sin(i),o=Math.cos(i);return s[4]=t,s[5]=e,s[0]=o*n,s[1]=a*n,s[2]=-a*r,s[3]=o*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],a=n[1],o=n[2],h=n[3],l=n[4],u=n[5],c=1/(r*h+o*-a);return i.x=h*c*t+-o*c*e+(u*o-l*h)*c,i.y=r*c*e+-a*c*t+(-u*r+l*a)*c,i},setQuad:function(t,e,i,n,r,s){void 0===s&&(s=this.quad);var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return s[0]=t*o+e*l+c,s[1]=t*h+e*u+d,s[2]=t*o+n*l+c,s[3]=t*h+n*u+d,s[4]=i*o+n*l+c,s[5]=i*h+n*u+d,s[6]=i*o+e*l+c,s[7]=i*h+e*u+d,r&&s.forEach((function(t,e){s[e]=Math.round(t)})),s},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var n=this.getX(t,e);return i&&(n=Math.round(n)),n},getYRound:function(t,e,i){var n=this.getY(t,e);return i&&(n=Math.round(n)),n},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},8414:t=>{var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},4286:(t,e,i)=>{t.exports={Alpha:i(4344),AlphaSingle:i(4518),BlendMode:i(5173),ComputedSize:i(1991),Crop:i(8305),Depth:i(3131),Flip:i(9660),FX:i(1626),GetBounds:i(3671),Mask:i(2246),Origin:i(5085),PathFollower:i(77),Pipeline:i(986),PostPipeline:i(4461),ScrollFactor:i(4627),Size:i(1868),Texture:i(4976),TextureCrop:i(9243),Tint:i(5693),ToJSON:i(6125),Transform:i(3212),TransformMatrix:i(4227),Visible:i(8414)}},7361:(t,e,i)=>{var n=i(1953),r=i(8351),s=i(7473),a=i(4286),o=i(3389),h=i(2273),l=i(1392),u=i(3232),c=i(9422),d=i(2529),f=new s({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.PostPipeline,a.Transform,a.Visible,u],initialize:function(t,e,i,n){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(e,i),this.setBlendMode(r.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,n=new l,r=!1;t.setEmpty();for(var s=0;s-1},setAll:function(t,e,i,r){return n.SetAll(this.list,t,e,i,r),this},each:function(t,e){var i,n=[null],r=this.list.slice(),s=r.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},2840:t=>{t.exports=function(t,e,i,n){i.addToRenderList(e);var r=e.list;if(0!==r.length){var s=e.localTransform;n?(s.loadIdentity(),s.multiply(n),s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.scaleX,e.scaleY)):s.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var n=i(1984),r=n,s=n;s=i(2840),t.exports={renderWebGL:r,renderCanvas:s}},6608:t=>{t.exports="addedtoscene"},4265:t=>{t.exports="destroy"},8671:t=>{t.exports="removedfromscene"},3420:t=>{t.exports="complete"},601:t=>{t.exports="created"},7919:t=>{t.exports="error"},6231:t=>{t.exports="locked"},5241:t=>{t.exports="loop"},8325:t=>{t.exports="playing"},3356:t=>{t.exports="play"},7513:t=>{t.exports="seeked"},5788:t=>{t.exports="seeking"},7111:t=>{t.exports="stalled"},8118:t=>{t.exports="stop"},9184:t=>{t.exports="textureready"},4287:t=>{t.exports="unlocked"},857:t=>{t.exports="unsupported"},3389:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(6608),DESTROY:i(4265),REMOVED_FROM_SCENE:i(8671),VIDEO_COMPLETE:i(3420),VIDEO_CREATED:i(601),VIDEO_ERROR:i(7919),VIDEO_LOCKED:i(6231),VIDEO_LOOP:i(5241),VIDEO_PLAY:i(3356),VIDEO_PLAYING:i(8325),VIDEO_SEEKED:i(7513),VIDEO_SEEKING:i(5788),VIDEO_STALLED:i(7111),VIDEO_STOP:i(8118),VIDEO_TEXTURE:i(9184),VIDEO_UNLOCKED:i(4287),VIDEO_UNSUPPORTED:i(857)}},1643:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},8881:(t,e,i)=>{var n=i(7655);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},4479:(t,e,i)=>{var n=i(4771),r=i(7655);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=n(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;u{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},284:(t,e,i)=>{var n=i(7473),r=i(8881),s=i(4479),a=i(1643),o=i(3915),h=i(2529),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=n},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return s(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},3915:(t,e,i)=>{var n=i(7655);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},7655:(t,e,i)=>{var n=i(7473),r=i(1643),s=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=r.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=s},5956:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},716:(t,e,i)=>{var n=i(7120),r=i(7655);t.exports=function(t,e,i){if(void 0===i&&(i=new r),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var s=n(t)*e;return e>.5?(s-=t.width+t.height)<=t.width?(i.x=t.right-s,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(s-t.width)):s<=t.width?(i.x=t.x+s,i.y=t.y):(i.x=t.right,i.y=t.y+(s-t.width)),i}},8151:(t,e,i)=>{var n=i(716),r=i(7120);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=r(t)/i);for(var a=0;a{t.exports=function(t){return 2*(t.width+t.height)}},2161:(t,e,i)=>{var n=i(7655);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},1392:(t,e,i)=>{var n=i(7473),r=i(5956),s=i(716),a=i(8151),o=i(1643),h=i(284),l=i(2161),u=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},9422:(t,e,i)=>{var n=i(1392);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=Math.min(t.x,e.x),s=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-r,o=Math.max(t.bottom,e.bottom)-s;return i.setTo(r,s,a,o)}},1593:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1179),a=i(4597),o=i(5593),h=i(7410),l=i(5874),u=i(707),c=new n({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var n=a(e,"url");void 0===n?n=t.path+i+"."+a(e,"extension",""):"string"!=typeof n||n.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(n=t.path+n),this.url=n,this.src="",this.xhrSettings=u(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===r.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=r.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,n=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(n=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,n)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(s.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==r.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(s.FILE_COMPLETE,e,i,t),this.loader.emit(s.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=r.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},9845:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},5593:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},7410:(t,e,i)=>{var n=i(1030),r=i(707);t.exports=function(t,e){var i=void 0===t?r():n({},t);if(e)for(var s in e)void 0!==e[s]&&(i[s]=e[s]);return i}},3137:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1179),a=new n({initialize:function(t,e,i,n){var s=[];n.forEach((function(t){t&&s.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=s,this.state=r.FILE_PENDING,this.complete=!1,this.pending=s.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a{var n=i(7410);t.exports=function(t,e){var i=n(e,t.xhrSettings),r=new XMLHttpRequest;if(r.open("GET",t.src,i.async,i.user,i.password),r.responseType=t.xhrSettings.responseType,r.timeout=i.timeout,i.headers)for(var s in i.headers)r.setRequestHeader(s,i.headers[s]);return i.header&&i.headerValue&&r.setRequestHeader(i.header,i.headerValue),i.requestedWith&&r.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&r.overrideMimeType(i.overrideMimeType),i.withCredentials&&(r.withCredentials=!0),r.onload=t.onLoad.bind(t,r),r.onerror=t.onError.bind(t,r),r.onprogress=t.onProgress.bind(t),r.send(),r}},707:t=>{t.exports=function(t,e,i,n,r,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=0),void 0===s&&(s=!1),{responseType:t,async:e,user:i,password:n,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:s}}},4359:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},462:t=>{t.exports="addfile"},7297:t=>{t.exports="complete"},8660:t=>{t.exports="filecomplete"},6484:t=>{t.exports="filecomplete-"},7972:t=>{t.exports="loaderror"},1906:t=>{t.exports="load"},1441:t=>{t.exports="fileprogress"},1072:t=>{t.exports="postprocess"},1927:t=>{t.exports="progress"},6597:t=>{t.exports="start"},1179:(t,e,i)=>{t.exports={ADD:i(462),COMPLETE:i(7297),FILE_COMPLETE:i(8660),FILE_KEY_COMPLETE:i(6484),FILE_LOAD_ERROR:i(7972),FILE_LOAD:i(1906),FILE_PROGRESS:i(1441),POST_PROCESS:i(1072),PROGRESS:i(1927),START:i(6597)}},6732:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(2482),l=i(5593),u=new n({Extends:s,initialize:function t(e,i,n,r,a){var l,u="png";if(h(i)){var c=i;i=o(c,"key"),n=o(c,"url"),l=o(c,"normalMap"),r=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"frameConfig")}Array.isArray(n)&&(l=n[1],n=n[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:n,xhrSettings:r,config:a};if(s.call(this,e,d),l){var f=new t(e,this.key,l,r,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){s.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){s.revokeObjectURL(t.data),t.onProcessError()},s.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=r.FILE_PROCESSING,t===r.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=r.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=r.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t?t.state>=r.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var n=0;n{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(5851),l=i(2482),u=new n({Extends:s,initialize:function(t,e,i,n,a){var u="json";if(l(e)){var c=e;e=o(c,"key"),i=o(c,"url"),n=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:a};s.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=r.FILE_POPULATED)},onProcess:function(){if(this.state!==r.FILE_POPULATED){this.state=r.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(2482),l=new n({Extends:s,initialize:function(t,e,i,n){var r="text",a="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),n=o(u,"xhrSettings"),a=o(u,"extension",a),r=o(u,"type",r),l=o(u,"cache",l)}var c={type:r,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var n=0;n{t.exports=function(t){for(var e=0,i=0;i{var n=i(3916);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},7025:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},48:t=>{t.exports=function(t,e,i,n,r){var s=.5*(n-e),a=.5*(r-i),o=t*t;return(2*i-2*n+s+a)*(t*o)+(-3*i+3*n-2*s-a)*o+s*t+i}},5035:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},2915:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},7149:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t*n.DEG_TO_RAD}},2975:t=>{t.exports=function(t,e){return Math.abs(t-e)}},2107:(t,e,i)=>{var n=i(2915),r=i(7473),s=i(9652),a=i(1984),o=new s,h=new r({initialize:function t(e,i,n,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=t.DefaultOrder),this._x=e,this._y=i,this._z=n,this._order=r,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,n){return void 0===n&&(n=this._order),this._x=t,this._y=e,this._z=i,this._order=n,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var r=t.val,s=r[0],a=r[4],o=r[8],h=r[1],l=r[5],u=r[9],c=r[2],d=r[6],f=r[10],p=0,v=0,g=0,m=.99999;switch(e){case"XYZ":v=Math.asin(n(o,-1,1)),Math.abs(o){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},104:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},4941:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},1555:(t,e,i)=>{var n=i(2915);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))+e}},5005:t=>{t.exports=function(t,e){return t/e/1e3}},3702:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},8820:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},1743:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},3416:t=>{t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},2149:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*s-a*h,c=-l*r+a*o,d=h*r-s*o,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(a*i-n*s)*f,t[3]=c*f,t[4]=(l*e-n*o)*f,t[5]=(-a*e+n*r)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(s*e-i*r)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=s*l-a*h,t[1]=n*h-i*l,t[2]=i*a-n*s,t[3]=a*o-r*l,t[4]=e*l-n*o,t[5]=n*r-e*a,t[6]=r*h-s*o,t[7]=i*o-e*h,t[8]=e*s-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*s-a*h)+i*(-l*r+a*o)+n*(h*r-s*o)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],v=c[3],g=c[4],m=c[5],y=c[6],x=c[7],w=c[8];return e[0]=d*i+f*s+p*h,e[1]=d*n+f*a+p*l,e[2]=d*r+f*o+p*u,e[3]=v*i+g*s+m*h,e[4]=v*n+g*a+m*l,e[5]=v*r+g*o+m*u,e[6]=y*i+x*s+w*h,e[7]=y*n+x*a+w*l,e[8]=y*r+x*o+w*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*s,e[1]=l*n+h*a,e[2]=l*r+h*o,e[3]=l*s-h*i,e[4]=l*a-h*n,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,r=t.w,s=e+e,a=i+i,o=n+n,h=e*s,l=e*a,u=e*o,c=i*a,d=i*o,f=n*o,p=r*s,v=r*a,g=r*o,m=this.val;return m[0]=1-(c+f),m[3]=l+g,m[6]=u-v,m[1]=l-g,m[4]=1-(h+f),m[7]=d+p,m[2]=u+v,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],v=e[12],g=e[13],m=e[14],y=e[15],x=n*h-r*o,w=n*l-s*o,M=n*u-a*o,E=r*l-s*h,T=r*u-a*h,A=s*u-a*l,b=c*g-d*v,S=c*m-f*v,R=c*y-p*v,I=d*m-f*g,C=d*y-p*g,P=f*y-p*m,k=x*P-w*C+M*I+E*R-T*S+A*b;return k?(k=1/k,i[0]=(h*P-l*C+u*I)*k,i[1]=(l*R-o*P-u*S)*k,i[2]=(o*C-h*R+u*b)*k,i[3]=(s*C-r*P-a*I)*k,i[4]=(n*P-s*R+a*S)*k,i[5]=(r*R-n*C-a*b)*k,i[6]=(g*A-m*T+y*E)*k,i[7]=(m*M-v*A-y*w)*k,i[8]=(v*T-g*M+y*x)*k,this):null}});t.exports=n},9652:(t,e,i)=>{var n=i(7473),r=i(5689),s=1e-6,a=new n({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,n,r,s,a,o,h,l,u,c,d,f,p,v){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=n,g[4]=r,g[5]=s,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=u,g[11]=c,g[12]=d,g[13]=f,g[14]=p,g[15]=v,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var n=o.fromQuat(i).val,r=e.x,s=e.y,a=e.z;return this.setValues(n[0]*r,n[1]*r,n[2]*r,0,n[4]*s,n[5]*s,n[6]*s,0,n[8]*a,n[9]*a,n[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],r=t[6],s=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=n,t[13]=s,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15],m=e*a-i*s,y=e*o-n*s,x=e*h-r*s,w=i*o-n*a,M=i*h-r*a,E=n*h-r*o,T=l*p-u*f,A=l*v-c*f,b=l*g-d*f,S=u*v-c*p,R=u*g-d*p,I=c*g-d*v,C=m*I-y*R+x*S+w*b-M*A+E*T;return C?(C=1/C,this.setValues((a*I-o*R+h*S)*C,(n*R-i*I-r*S)*C,(p*E-v*M+g*w)*C,(c*M-u*E-d*w)*C,(o*b-s*I-h*A)*C,(e*I-n*b+r*A)*C,(v*x-f*E-g*y)*C,(l*E-c*x+d*y)*C,(s*R-a*b+h*T)*C,(i*b-e*R-r*T)*C,(f*M-p*x+g*m)*C,(u*x-l*M-d*m)*C,(a*A-s*S-o*T)*C,(e*S-i*A+n*T)*C,(p*y-f*w-v*m)*C,(l*w-u*y+c*m)*C)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return this.setValues(a*(c*g-d*v)-u*(o*g-h*v)+p*(o*d-h*c),-(i*(c*g-d*v)-u*(n*g-r*v)+p*(n*d-r*c)),i*(o*g-h*v)-a*(n*g-r*v)+p*(n*h-r*o),-(i*(o*d-h*c)-a*(n*d-r*c)+u*(n*h-r*o)),-(s*(c*g-d*v)-l*(o*g-h*v)+f*(o*d-h*c)),e*(c*g-d*v)-l*(n*g-r*v)+f*(n*d-r*c),-(e*(o*g-h*v)-s*(n*g-r*v)+f*(n*h-r*o)),e*(o*d-h*c)-s*(n*d-r*c)+l*(n*h-r*o),s*(u*g-d*p)-l*(a*g-h*p)+f*(a*d-h*u),-(e*(u*g-d*p)-l*(i*g-r*p)+f*(i*d-r*u)),e*(a*g-h*p)-s*(i*g-r*p)+f*(i*h-r*a),-(e*(a*d-h*u)-s*(i*d-r*u)+l*(i*h-r*a)),-(s*(u*v-c*p)-l*(a*v-o*p)+f*(a*c-o*u)),e*(u*v-c*p)-l*(i*v-n*p)+f*(i*c-n*u),-(e*(a*v-o*p)-s*(i*v-n*p)+f*(i*o-n*a)),e*(a*c-o*u)-s*(i*c-n*u)+l*(i*o-n*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return(e*a-i*s)*(c*g-d*v)-(e*o-n*s)*(u*g-d*p)+(e*h-r*s)*(u*v-c*p)+(i*o-n*a)*(l*g-d*f)-(i*h-r*a)*(l*v-c*f)+(n*h-r*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],v=e[13],g=e[14],m=e[15],y=t.val,x=y[0],w=y[1],M=y[2],E=y[3];return e[0]=x*i+w*a+M*u+E*p,e[1]=x*n+w*o+M*c+E*v,e[2]=x*r+w*h+M*d+E*g,e[3]=x*s+w*l+M*f+E*m,x=y[4],w=y[5],M=y[6],E=y[7],e[4]=x*i+w*a+M*u+E*p,e[5]=x*n+w*o+M*c+E*v,e[6]=x*r+w*h+M*d+E*g,e[7]=x*s+w*l+M*f+E*m,x=y[8],w=y[9],M=y[10],E=y[11],e[8]=x*i+w*a+M*u+E*p,e[9]=x*n+w*o+M*c+E*v,e[10]=x*r+w*h+M*d+E*g,e[11]=x*s+w*l+M*f+E*m,x=y[12],w=y[13],M=y[14],E=y[15],e[12]=x*i+w*a+M*u+E*p,e[13]=x*n+w*o+M*c+E*v,e[14]=x*r+w*h+M*d+E*g,e[15]=x*s+w*l+M*f+E*m,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,n=e.val,r=i[0],s=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],f=i[6],p=i[10],v=i[14],g=i[3],m=i[7],y=i[11],x=i[15],w=n[0],M=n[4],E=n[8],T=n[12],A=n[1],b=n[5],S=n[9],R=n[13],I=n[2],C=n[6],P=n[10],k=n[14],O=n[3],_=n[7],F=n[11],L=n[15];return this.setValues(r*w+s*A+a*I+o*O,h*w+l*A+u*I+c*O,d*w+f*A+p*I+v*O,g*w+m*A+y*I+x*O,r*M+s*b+a*C+o*_,h*M+l*b+u*C+c*_,d*M+f*b+p*C+v*_,g*M+m*b+y*C+x*_,r*E+s*S+a*P+o*F,h*E+l*S+u*P+c*F,d*E+f*S+p*P+v*F,g*E+m*S+y*P+x*F,r*T+s*R+a*k+o*L,h*T+l*R+u*k+c*L,d*T+f*R+p*k+v*L,g*T+m*R+y*k+x*L)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var n=this.val;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var n=this.val;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,a=t.y,o=t.z,h=r*s,l=r*a;return this.setValues(h*s+i,h*a-n*o,h*o+n*a,0,h*a+n*o,l*a+i,l*o-n*s,0,h*o-n*a,l*o+n*s,r*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,n=e.x,r=e.y,a=e.z,o=Math.sqrt(n*n+r*r+a*a);if(Math.abs(o){t.exports=function(t,e,i){return Math.min(t+e,i)}},44:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},5385:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},8585:t=>{t.exports=function(t,e,i,n){void 0===i&&(i=e+1);var r=(t-e)/(i-e);return r>1?void 0!==n?(r=(n-t)/(n-i))<0&&(r=0):r=1:r<0&&(r=0),r}},372:(t,e,i)=>{var n=i(7473),r=i(2149),s=i(1984),a=i(5689),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),c=new a(0,1,0),d=new a,f=new r,p=new n({initialize:function(t,e,i,n){this.onChangeCallback=s,this.set(t,e,i,n)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,n,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=n||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=n*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.set(i+e*(t.x-i),n+e*(t.y-n),r+e*(t.z-r),s+e*(t.w-s))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var n=f.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+r*s+i*o-n*a,i*h+r*a+n*s-e*o,n*h+r*o+e*a-i*s,r*h-e*s-i*a-n*o)},slerp:function(t,e){var i=this.x,n=this.y,r=this.z,s=this.w,a=t.x,h=t.y,l=t.z,u=t.w,c=i*a+n*h+r*l+s*u;c<0&&(c=-c,a=-a,h=-h,l=-l,u=-u);var d=1-e,f=e;if(1-c>o){var p=Math.acos(c),v=Math.sin(p);d=Math.sin((1-e)*p)/v,f=Math.sin(e*p)/v}return this.set(d*i+f*a,d*n+f*h,d*r+f*l,d*s+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n,s=r?1/r:0;return this.set(-t*s,-e*s,-i*s,n*s)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a+r*s,i*a+n*s,n*a-i*s,r*a-e*s)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a-n*s,i*a+r*s,n*a+e*s,r*a-i*s)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*s,i*a-e*s,n*a+r*s,r*a-n*s)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,n=t.y/2,r=t.z/2,s=Math.cos(i),a=Math.cos(n),o=Math.cos(r),h=Math.sin(i),l=Math.sin(n),u=Math.sin(r);switch(t.order){case"XYZ":this.set(h*a*o+s*l*u,s*l*o-h*a*u,s*a*u+h*l*o,s*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+s*l*u,s*l*o-h*a*u,s*a*u-h*l*o,s*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-s*l*u,s*l*o+h*a*u,s*a*u+h*l*o,s*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-s*l*u,s*l*o+h*a*u,s*a*u-h*l*o,s*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+s*l*u,s*l*o+h*a*u,s*a*u-h*l*o,s*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-s*l*u,s*l*o-h*a*u,s*a*u+h*l*o,s*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,n=i[0],r=i[4],s=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=n+o+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(s-l)*e,(a-r)*e,.25/e)):n>o&&n>c?(e=2*Math.sqrt(1+n-o-c),this.set(.25*e,(r+a)/e,(s+l)/e,(u-h)/e)):o>c?(e=2*Math.sqrt(1+o-n-c),this.set((r+a)/e,.25*e,(h+u)/e,(s-l)/e)):(e=2*Math.sqrt(1+c-n-o),this.set((s+l)/e,(h+u)/e,.25*e,(a-r)/e)),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var s=h[r],a=h[s];e=Math.sqrt(i[3*r+r]-i[3*s+s]-i[3*a+a]+1),l[r]=.5*e,e=.5/e,l[s]=(i[3*s+r]+i[3*r+s])*e,l[a]=(i[3*a+r]+i[3*r+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+s]-i[3*s+a])*e}return this.onChangeCallback(this),this}});t.exports=p},4208:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t*n.RAD_TO_DEG}},1705:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},6650:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,n=2*Math.random()-1,r=Math.sqrt(1-n*n)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=n*e,t}},2037:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},6283:t=>{t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},9876:t=>{t.exports=function(t,e,i,n){var r=Math.cos(n),s=Math.sin(n),a=t.x-e,o=t.y-i;return t.x=a*r-o*s+e,t.y=a*s+o*r+i,t}},8348:t=>{t.exports=function(t,e,i,n,r){var s=n+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},4497:t=>{t.exports=function(t,e,i,n,r){return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},9640:(t,e,i)=>{var n=i(5689),r=i(9652),s=i(372),a=new r,o=new s,h=new n;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},4078:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},855:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.round(t*n)/n}},4936:t=>{t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var r=[],s=[],a=0;a{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},278:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},163:(t,e,i)=>{var n=i(2529);t.exports=function(t,e,i,r){void 0===r&&(r=new n);var s=0,a=0;return t>0&&t<=e*i&&(s=t>e-1?t-(a=Math.floor(t/e))*e:t),r.set(s,a)}},7556:(t,e,i)=>{var n=i(2529);t.exports=function(t,e,i,r,s,a,o,h){void 0===h&&(h=new n);var l=Math.sin(s),u=Math.cos(s),c=u*a,d=l*a,f=-l*o,p=u*o,v=1/(c*p+f*-d);return h.x=p*v*t+-f*v*e+(r*f-i*p)*v,h.y=c*v*e+-d*v*t+(-r*c+i*d)*v,h}},2529:(t,e,i)=>{var n=i(7473),r=i(12),s=new n({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new s(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return r(this.x,t.x,e)&&r(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});s.ZERO=new s,s.RIGHT=new s(1,0),s.LEFT=new s(-1,0),s.UP=new s(0,-1),s.DOWN=new s(0,1),s.ONE=new s(1,1),t.exports=s},5689:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new n(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=n*o-r*a,this.y=r*s-i*o,this.z=i*a-n*s,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z;return this.x=i*a-n*s,this.y=n*r-e*a,this.z=e*s-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+n*r[6],this.y=e*r[1]+i*r[4]+n*r[7],this.z=e*r[2]+i*r[5]+n*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12],this.y=r[1]*e+r[5]*i+r[9]*n+r[13],this.z=r[2]*e+r[6]*i+r[10]*n+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=e*r[0]+i*r[4]+n*r[8]+r[12],a=e*r[1]+i*r[5]+n*r[9]+r[13],o=e*r[2]+i*r[6]+n*r[10]+r[14],h=e*r[3]+i*r[7]+n*r[11]+r[15];return this.x=s/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*n-a*i,l=o*i+a*e-r*n,u=o*n+r*i-s*e,c=-r*e-s*i-a*n;return this.x=h*o+c*-r+l*-a-u*-s,this.y=l*o+c*-s+u*-r-h*-a,this.z=u*o+c*-a+h*-s-l*-r,this},project:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],c=r[6],d=r[7],f=r[8],p=r[9],v=r[10],g=r[11],m=r[12],y=r[13],x=r[14],w=1/(e*h+i*d+n*g+r[15]);return this.x=(e*s+i*l+n*f+m)*w,this.y=(e*a+i*u+n*p+y)*w,this.z=(e*o+i*c+n*v+x)*w,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,n=t.y,r=t.z,s=t.w,a=this.x-i,o=s-this.y-1-n,h=this.z;return this.x=2*a/r-1,this.y=2*o/s-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});n.ZERO=new n,n.RIGHT=new n(1,0,0),n.LEFT=new n(-1,0,0),n.UP=new n(0,-1,0),n.DOWN=new n(0,1,0),n.FORWARD=new n(0,0,1),n.BACK=new n(0,0,-1),n.ONE=new n(1,1,1),t.exports=n},9279:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=n*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this.w=s+e*(t.w-s),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+n*n+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*n-a*i,l=o*i+a*e-r*n,u=o*n+r*i-s*e,c=-r*e-s*i-a*n;return this.x=h*o+c*-r+l*-a-u*-s,this.y=l*o+c*-s+u*-r-h*-a,this.z=u*o+c*-a+h*-s-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},4119:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},8445:t=>{t.exports=function(t,e,i){if(t>=e&&t<=i)return t;var n=i-e;return e+((t-e)%n+n)%n}},6412:t=>{t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},760:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},6909:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},6947:t=>{t.exports=function(t,e,i,n){return Math.atan2(i-t,n-e)}},3426:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t>Math.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},6906:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},3270:(t,e,i)=>{var n=i(104);t.exports=function(){return n(-Math.PI,Math.PI)}},2748:(t,e,i)=>{var n=i(104);t.exports=function(){return n(-180,180)}},936:(t,e,i)=>{var n=i(6906);t.exports=function(t){return n(t+Math.PI)}},1935:(t,e,i)=>{var n=i(7425);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},3692:(t,e,i)=>{var n=i(8445);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},2820:(t,e,i)=>{var n=i(8445);t.exports=function(t){return n(t,-180,180)}},1833:(t,e,i)=>{t.exports={Between:i(6412),BetweenPoints:i(760),BetweenPointsY:i(6909),BetweenY:i(6947),CounterClockwise:i(3426),Normalize:i(6906),Random:i(3270),RandomDegrees:i(2748),Reverse:i(936),RotateTo:i(1935),ShortestBetween:i(5393),Wrap:i(3692),WrapDegrees:i(2820)}},7425:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},1518:t=>{t.exports=function(t,e,i,n){var r=t-i,s=e-n;return Math.sqrt(r*r+s*s)}},5372:t=>{t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}},4430:t=>{t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},4361:t=>{t.exports=function(t,e,i,n){return Math.max(Math.abs(t-i),Math.abs(e-n))}},7798:t=>{t.exports=function(t,e,i,n,r){return void 0===r&&(r=2),Math.sqrt(Math.pow(i-t,r)+Math.pow(n-e,r))}},8290:t=>{t.exports=function(t,e,i,n){return Math.abs(t-i)+Math.abs(e-n)}},3788:t=>{t.exports=function(t,e,i,n){var r=t-i,s=e-n;return r*r+s*s}},6338:(t,e,i)=>{t.exports={Between:i(1518),BetweenPoints:i(5372),BetweenPointsSquared:i(4430),Chebyshev:i(4361),Power:i(7798),Snake:i(8290),Squared:i(3788)}},5751:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},6203:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},9103:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},4938:(t,e,i)=>{t.exports={In:i(5751),Out:i(9103),InOut:i(6203)}},8677:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},4649:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},504:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},8872:(t,e,i)=>{t.exports={In:i(8677),Out:i(504),InOut:i(4649)}},3170:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},2627:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},1349:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},5006:(t,e,i)=>{t.exports={In:i(3170),Out:i(1349),InOut:i(2627)}},6046:t=>{t.exports=function(t){return t*t*t}},9531:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},4836:t=>{t.exports=function(t){return--t*t*t+1}},875:(t,e,i)=>{t.exports={In:i(6046),Out:i(4836),InOut:i(9531)}},7619:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},7437:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},8119:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},2884:(t,e,i)=>{t.exports={In:i(7619),Out:i(8119),InOut:i(7437)}},5456:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},3461:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},2711:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},6287:(t,e,i)=>{t.exports={In:i(5456),Out:i(2711),InOut:i(3461)}},8613:(t,e,i)=>{t.exports={Back:i(4938),Bounce:i(8872),Circular:i(5006),Cubic:i(875),Elastic:i(2884),Expo:i(6287),Linear:i(4233),Quadratic:i(6341),Quartic:i(762),Quintic:i(345),Sine:i(8698),Stepped:i(7051)}},744:t=>{t.exports=function(t){return t}},4233:(t,e,i)=>{t.exports=i(744)},9810:t=>{t.exports=function(t){return t*t}},8163:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},6123:t=>{t.exports=function(t){return t*(2-t)}},6341:(t,e,i)=>{t.exports={In:i(9810),Out:i(6123),InOut:i(8163)}},7337:t=>{t.exports=function(t){return t*t*t*t}},4878:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},9012:t=>{t.exports=function(t){return 1- --t*t*t*t}},762:(t,e,i)=>{t.exports={In:i(7337),Out:i(9012),InOut:i(4878)}},303:t=>{t.exports=function(t){return t*t*t*t*t}},553:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},1632:t=>{t.exports=function(t){return--t*t*t*t*t+1}},345:(t,e,i)=>{t.exports={In:i(303),Out:i(1632),InOut:i(553)}},8455:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},1844:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},990:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},8698:(t,e,i)=>{t.exports={In:i(8455),Out:i(990),InOut:i(1844)}},6745:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},7051:(t,e,i)=>{t.exports=i(6745)},3158:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},12:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},7373:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},2622:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(3158),Equal:i(12),Floor:i(1326),GreaterThan:i(7373),LessThan:i(2622)}},4675:(t,e,i)=>{var n=i(7425),r=i(1030),s={Angle:i(1833),Distance:i(6338),Easing:i(8613),Fuzzy:i(7927),Interpolation:i(2140),Pow2:i(7897),Snap:i(3943),RandomDataGenerator:i(6957),Average:i(3136),Bernstein:i(785),Between:i(7025),CatmullRom:i(48),CeilTo:i(5035),Clamp:i(2915),DegToRad:i(7149),Difference:i(2975),Euler:i(2107),Factorial:i(3916),FloatBetween:i(104),FloorTo:i(4941),FromPercent:i(1555),GetSpeed:i(5005),IsEven:i(3702),IsEvenStrict:i(8820),Linear:i(1743),LinearXY:i(3416),MaxAdd:i(3733),Median:i(44),MinSub:i(5385),Percent:i(8585),RadToDeg:i(4208),RandomXY:i(1705),RandomXYZ:i(6650),RandomXYZW:i(2037),Rotate:i(6283),RotateAround:i(9876),RotateAroundDistance:i(8348),RotateTo:i(4497),RoundAwayFromZero:i(4078),RoundTo:i(855),SinCosTableGenerator:i(4936),SmootherStep:i(278),SmoothStep:i(2733),ToXY:i(163),TransformXY:i(7556),Within:i(4119),Wrap:i(8445),Vector2:i(2529),Vector3:i(5689),Vector4:i(9279),Matrix3:i(2149),Matrix4:i(9652),Quaternion:i(372),RotateVec3:i(9640)};s=r(!1,s,n),t.exports=s},1640:(t,e,i)=>{var n=i(785);t.exports=function(t,e){for(var i=0,r=t.length-1,s=0;s<=r;s++)i+=Math.pow(1-e,r-s)*Math.pow(e,s)*t[s]*n(r,s);return i}},6105:(t,e,i)=>{var n=i(48);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return t[0]===t[i]?(e<0&&(s=Math.floor(r=i*(1+e))),n(r-s,t[(s-1+i)%i],t[s],t[(s+1)%i],t[(s+2)%i])):e<0?t[0]-(n(-r,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(r-s,t[s?s-1:0],t[s],t[i{t.exports=function(t,e,i,n,r){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,r)}},6765:(t,e,i)=>{var n=i(1743);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return e<0?n(t[0],t[1],r):e>1?n(t[i],t[i-1],i-r):n(t[s],t[s+1>i?i:s+1],r-s)}},6388:t=>{t.exports=function(t,e,i,n){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}},5735:(t,e,i)=>{var n=i(2733);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},8705:(t,e,i)=>{var n=i(278);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},2140:(t,e,i)=>{t.exports={Bezier:i(1640),CatmullRom:i(6105),CubicBezier:i(4002),Linear:i(6765),QuadraticBezier:i(6388),SmoothStep:i(5735),SmootherStep:i(8705)}},5443:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},167:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},7897:(t,e,i)=>{t.exports={GetNext:i(5443),IsSize:i(725),IsValue:i(167)}},6957:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var n=0;n>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),n=t[i];t[i]=t[e],t[e]=n}return t}});t.exports=n},5659:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},5461:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),n?(i+t)/e:i+t)}},5131:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),n?(i+t)/e:i+t)}},3943:(t,e,i)=>{t.exports={Ceil:i(5659),Floor:i(5461),To:i(5131)}},8666:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},8456:t=>{var e={},i={},n={register:function(t,i,n,r){void 0===r&&(r=!1),e[t]={plugin:i,mapping:n,custom:r}},registerCustom:function(t,e,n,r){i[t]={plugin:e,mapping:n,data:r}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=n},5722:(t,e,i)=>{var n=i(8666),r=i(7473),s=i(204),a=new r({Extends:n,initialize:function(t,e,i){n.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(s.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},8351:t=>{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},8196:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},3527:t=>{t.exports="resize"},8618:t=>{t.exports="addedtoscene"},4328:t=>{t.exports="boot"},6099:t=>{t.exports="create"},7645:t=>{t.exports="destroy"},2710:t=>{t.exports="pause"},2547:t=>{t.exports="postupdate"},8577:t=>{t.exports="prerender"},8197:t=>{t.exports="preupdate"},8997:t=>{t.exports="ready"},7604:t=>{t.exports="removedfromscene"},8999:t=>{t.exports="render"},9742:t=>{t.exports="resume"},3667:t=>{t.exports="shutdown"},3468:t=>{t.exports="sleep"},7840:t=>{t.exports="start"},9896:t=>{t.exports="transitioncomplete"},5103:t=>{t.exports="transitioninit"},3162:t=>{t.exports="transitionout"},7841:t=>{t.exports="transitionstart"},6454:t=>{t.exports="transitionwake"},6536:t=>{t.exports="update"},3875:t=>{t.exports="wake"},204:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(8618),BOOT:i(4328),CREATE:i(6099),DESTROY:i(7645),PAUSE:i(2710),POST_UPDATE:i(2547),PRE_RENDER:i(8577),PRE_UPDATE:i(8197),READY:i(8997),REMOVED_FROM_SCENE:i(7604),RENDER:i(8999),RESUME:i(9742),SHUTDOWN:i(3667),SLEEP:i(3468),START:i(7840),TRANSITION_COMPLETE:i(9896),TRANSITION_INIT:i(5103),TRANSITION_OUT:i(3162),TRANSITION_START:i(7841),TRANSITION_WAKE:i(6454),UPDATE:i(6536),WAKE:i(3875)}},2362:(t,e,i)=>{var n=i(7473),r=i(2915),s=i(1030),a=new n({initialize:function(t,e,i,n,r,s,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(s,a,n,r)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var r=this.data,s=r.cut;s.x=i,s.y=n,s.w=t,s.h=e,s.r=i+t,s.b=n+e,r.sourceSize.w=t,r.sourceSize.h=e,r.spriteSourceSize.w=t,r.spriteSourceSize.h=e,r.radius=.5*Math.sqrt(t*t+e*e);var a=r.drawImage;return a.x=i,a.y=n,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,n,r,s){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=n,o.w=r,o.h=s,o.r=i+r,o.b=n+s,this.x=i,this.y=n,this.width=r,this.height=s,this.halfWidth=.5*r,this.halfHeight=.5*s,this.centerX=Math.floor(r/2),this.centerY=Math.floor(s/2),this.updateUVs()},setCropUVs:function(t,e,i,n,s,a,o){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=r(e,0,d)),v=l+(i=r(i,0,f)),g=n=r(n,0,d-e),m=s=r(s,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,w=e+(n=r(n,0,u-e)),M=i+(s=r(s,0,c-i));if(!(x.rw||x.y>M)){var E=Math.max(x.x,e),T=Math.max(x.y,i),A=Math.min(x.r,w)-E,b=Math.min(x.b,M)-T;g=A,m=b,p=a?h+(u-(E-x.x)-A):h+(E-x.x),v=o?l+(c-(T-x.y)-b):l+(T-x.y),e=E,i=T,n=A,s=b}else p=0,v=0,g=0,m=0}else a&&(p=h+(u-e-n)),o&&(v=l+(c-i-s));var S=this.source.width,R=this.source.height;return t.u0=Math.max(0,p/S),t.v0=Math.max(0,v/R),t.u1=Math.min(1,(p+g)/S),t.v1=Math.min(1,(v+m)/R),t.x=e,t.y=i,t.cx=p,t.cy=v,t.cw=g,t.ch=m,t.width=n,t.height=s,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,n,r,s){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=n,this.u1=r,this.v1=s,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=n;var s=this.source.width,a=this.source.height;return this.u0=t/s,this.v0=e/a,this.u1=(t+i)/s,this.v1=(e+n)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=s(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},1864:t=>{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},3747:t=>{t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},7473:t=>{function e(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function n(t,n,r,a){for(var o in n)if(n.hasOwnProperty(o)){var h=e(n,o,r);if(!1!==h){if(i((a||t).prototype,o)){if(s.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=n[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},1792:t=>{t.exports=function(t,e,i,n,r){if(void 0===r&&(r=t),i>0){var s=i-t.length;if(s<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>s&&(e.splice(s),a=s);for(var o=0;o{t.exports=function(t,e,i,n,r,s){if(void 0===i&&(i=0),void 0===s&&(s=t),n>0){var a=n-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),r&&r.call(s,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;n>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),r&&r.call(s,l)}return e}},2513:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var n=i(2497);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var a=0;if(n(t,r,s))for(var o=r;o{t.exports=function(t,e,i){var n,r=[null];for(n=3;n{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s)){var a,o=[null];for(a=5;a{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var n,r,s=1;if(i){if(te.length&&(s=e.length),i?(n=e[s-1][i],(r=e[s][i])-t<=t-n?e[s]:e[s-1]):(n=e[s-1],(r=e[s])-t<=t-n?r:n)}},4493:t=>{var e=function(t,i){void 0===i&&(i=[]);for(var n=0;n{var n=i(2497);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var a=[];if(n(t,r,s))for(var o=r;o{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var a=r;a{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},8683:t=>{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n>r||(t.splice(n,1),r===t.length-1?t.push(e):t.splice(r,0,e)),t}},546:t=>{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var n=t[i-1],r=t.indexOf(n);t[i]=n,t[r]=e}return t}},1419:t=>{t.exports=function(t,e,i){var n=t.indexOf(e);if(-1===n||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},6512:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,n){var r,s=[],a=!1;if((i||n)&&(a=!0,i||(i=""),n||(n="")),e=e;r--)a?s.push(i+r.toString()+n):s.push(r);else for(r=t;r<=e;r++)a?s.push(i+r.toString()+n):s.push(r);return s}},1316:(t,e,i)=>{var n=i(4078);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var r=[],s=Math.max(n((e-t)/(i||1)),0),a=0;a{function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return te?1:0}var n=function(t,r,s,a,o){for(void 0===s&&(s=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>s;){if(a-s>600){var h=a-s+1,l=r-s+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(s,Math.floor(r-l*c/h+d)),p=Math.min(a,Math.floor(r+(h-l)*c/h+d));n(t,r,f,p,o)}var v=t[r],g=s,m=a;for(e(t,s,r),o(t[a],v)>0&&e(t,s,a);g0;)m--}0===o(t[s],v)?e(t,s,m):e(t,++m,a),m<=r&&(s=m+1),r<=m&&(a=m-1)}};t.exports=n},9703:(t,e,i)=>{var n=i(5851),r=i(4912),s=function(t,e,i){for(var n=[],r=0;r{var n=i(8935);t.exports=function(t,e,i,r){var s;if(void 0===r&&(r=t),!Array.isArray(e))return-1!==(s=t.indexOf(e))?(n(t,s),i&&i.call(r,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(s=t.indexOf(h))&&(n(t,s),o.push(h),i&&i.call(r,h)),a--}return o}},4725:(t,e,i)=>{var n=i(8935);t.exports=function(t,e,i,r){if(void 0===r&&(r=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var s=n(t,e);return i&&i.call(r,s),s}},8780:(t,e,i)=>{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===s&&(s=t),n(t,e,i)){var a=i-e,o=t.splice(e,a);if(r)for(var h=0;h{var n=i(8935);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*i);return n(t,r)}},6960:t=>{t.exports=function(t,e,i){var n=t.indexOf(e),r=t.indexOf(i);return-1!==n&&-1===r&&(t[n]=i,!0)}},1021:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n{t.exports=function(t,e,i,n){var r=t.length;if(e<0||e>r||e>=i||i>r){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},5361:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},3718:(t,e,i)=>{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var a=r;a{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},2071:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},8935:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],r=e;r{var n=i(9356);function r(t,e){return String(t).localeCompare(e)}function s(t,e,i,n){var r,s,a,o,h,l=t.length,u=0,c=2*i;for(r=0;rl&&(s=l),a>l&&(a=l),o=r,h=s;;)if(o{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return t[n]=i,t[r]=e,t}},1953:(t,e,i)=>{t.exports={Matrix:i(1237),Add:i(1792),AddAt:i(2280),BringToTop:i(2513),CountAllMatching:i(1771),Each:i(7883),EachInRange:i(5856),FindClosestInSorted:i(3957),Flatten:i(4493),GetAll:i(6245),GetFirst:i(1647),GetRandom:i(5301),MoveDown:i(1842),MoveTo:i(1419),MoveUp:i(6512),MoveAbove:i(8683),MoveBelow:i(546),NumberArray:i(4130),NumberArrayStep:i(1316),QuickSelect:i(9465),Range:i(9703),Remove:i(7161),RemoveAt:i(4725),RemoveBetween:i(8780),RemoveRandomElement:i(5744),Replace:i(6960),RotateLeft:i(1021),RotateRight:i(4027),SafeRange:i(2497),SendToBack:i(5361),SetAll:i(3718),Shuffle:i(4912),SortByDigits:i(2071),SpliceOne:i(8935),StableSort:i(9992),Swap:i(2372)}},1816:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var n=i(7222),r=i(1816);t.exports=function(t){var e="";if(!r(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},6063:t=>{t.exports=function(t){for(var e=0;e{var n=i(7116);t.exports=function(t){return n(t,180)}},2597:(t,e,i)=>{var n=i(7116);t.exports=function(t){return n(t,90)}},7116:(t,e,i)=>{var n=i(1816),r=i(4780);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=r(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=r(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var n=i(7116);t.exports=function(t){return n(t,-90)}},7711:(t,e,i)=>{var n=i(1021),r=i(4027);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?n(t,Math.abs(i)):r(t,i)),0!==e)for(var s=0;s{t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),r=0;r-1;s--)n[r][s]=t[s][r]}return n}},1237:(t,e,i)=>{t.exports={CheckMatrix:i(1816),MatrixToString:i(6655),ReverseColumns:i(582),ReverseRows:i(6063),Rotate180:i(8321),RotateLeft:i(2597),RotateMatrix:i(7116),RotateRight:i(6285),Translate:i(7711),TransposeMatrix:i(4780)}},3911:t=>{var e=function(t){var i,n,r;if("object"!=typeof t||null===t)return t;for(r in i=Array.isArray(t)?[]:{},t)n=t[r],i[r]=e(n);return i};t.exports=e},1030:(t,e,i)=>{var n=i(2482),r=function(){var t,e,i,s,a,o,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l{var n=i(4675),r=i(5851);t.exports=function(t,e,i){var s=r(t,e,null);if(null===s)return i;if(Array.isArray(s))return n.RND.pick(s);if("object"==typeof s){if(s.hasOwnProperty("randInt"))return n.RND.integerInRange(s.randInt[0],s.randInt[1]);if(s.hasOwnProperty("randFloat"))return n.RND.realInRange(s.randFloat[0],s.randFloat[1])}else if("function"==typeof s)return s(e);return s}},4597:t=>{t.exports=function(t,e,i){var n=typeof t;return t&&"number"!==n&&"string"!==n&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},5851:t=>{t.exports=function(t,e,i,n){if(!t&&!n||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(n&&n.hasOwnProperty(e))return n[e];if(-1!==e.indexOf(".")){for(var r=e.split("."),s=t,a=n,o=i,h=i,l=!0,u=!0,c=0;c{t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},7222:t=>{t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===n&&(n=3);var r=0;if(e+1>=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var s=Math.ceil((r=e-t.length)/2);t=new Array(r-s+1).join(i)+t+new Array(s+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}}},e={};var i=function i(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,i),s.exports}(4513);window.SpinePlugin=i})(); \ No newline at end of file diff --git a/plugins/spine/dist/SpinePlugin.js b/plugins/spine/dist/SpinePlugin.js index 9c243b2f6..e411eced2 100644 --- a/plugins/spine/dist/SpinePlugin.js +++ b/plugins/spine/dist/SpinePlugin.js @@ -15309,7 +15309,7 @@ var CONST = { * @type {string} * @since 3.0.0 */ - VERSION: '3.60.0-beta.20', + VERSION: '3.60.0', BlendModes: __webpack_require__(8351), @@ -17271,7 +17271,7 @@ module.exports = init(); /***/ }), /***/ 2131: -/***/ ((module) => { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -17279,9 +17279,13 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var GetFastValue = __webpack_require__(4597); + /** * Determines the video support of the browser running this Phaser Game instance. + * * These values are read-only and populated during the boot sequence of the game. + * * They are then referenced by internal game systems and are available for you to access * via `this.sys.game.device.video` from within any Scene. * @@ -17297,6 +17301,7 @@ module.exports = init(); * @property {boolean} ogg - Can this device play ogg video files? * @property {boolean} vp9 - Can this device play vp9 video files? * @property {boolean} webm - Can this device play webm video files? + * @property {function} getVideoURL - Returns the first video URL that can be played by this browser. */ var Video = { @@ -17306,7 +17311,8 @@ var Video = { m4v: false, ogg: false, vp9: false, - webm: false + webm: false, + hasRequestVideoFrame: false }; @@ -17363,6 +17369,55 @@ function init () // Nothing to do } + if (videoElement.parentNode) + { + videoElement.parentNode.removeChild(videoElement); + } + + Video.getVideoURL = function (urls) + { + if (!Array.isArray(urls)) + { + urls = [ urls ]; + } + + for (var i = 0; i < urls.length; i++) + { + var url = GetFastValue(urls[i], 'url', urls[i]); + + if (url.indexOf('blob:') === 0) + { + return { + url: url, + type: '' + }; + } + + var videoType; + + if (url.indexOf('data:') === 0) + { + videoType = url.split(',')[0].match(/\/(.*?);/); + } + else + { + videoType = url.match(/\.([a-zA-Z0-9]+)($|\?)/); + } + + videoType = GetFastValue(urls[i], 'type', (videoType) ? videoType[1] : '').toLowerCase(); + + if (Video[videoType]) + { + return { + url: url, + type: videoType + }; + } + } + + return null; + }; + return Video; } @@ -18531,8 +18586,8 @@ var GameObjectFactory = __webpack_require__(3649); * * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means - * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects - * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the + * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects. + * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the * corresponding pixel in the mask. * * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, @@ -19065,7 +19120,7 @@ module.exports = GeometryMask; /***/ }), -/***/ 8325: +/***/ 7340: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -19151,6 +19206,23 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Bloom FX Controller. + * + * This FX controller manages the bloom effect for a Game Object. + * + * Bloom is an effect used to reproduce an imaging artifact of real-world cameras. + * The effect produces fringes of light extending from the borders of bright areas in an image, + * contributing to the illusion of an extremely bright light overwhelming the + * camera or eye capturing the scene. + * + * A Bloom effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBloom(); + * sprite.postFX.addBloom(); + * ``` * * @class Bloom * @extends Phaser.FX.Controller @@ -19159,7 +19231,7 @@ var FX_CONST = __webpack_require__(1571); * @since 3.60.0 * * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. - * @param {number} [color] - The color of the Bloom, as a hex value. + * @param {number} [color=0xffffff] - The color of the Bloom, as a hex value. * @param {number} [offsetX=1] - The horizontal offset of the bloom effect. * @param {number} [offsetY=1] - The vertical offset of the bloom effect. * @param {number} [blurStrength=1] - The strength of the blur process of the bloom effect. @@ -19299,6 +19371,23 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Blur FX Controller. + * + * This FX controller manages the blur effect for a Game Object. + * + * A Gaussian blur is the result of blurring an image by a Gaussian function. It is a widely used effect, + * typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a + * smooth blur resembling that of viewing the image through a translucent screen, distinctly different + * from the bokeh effect produced by an out-of-focus lens or the shadow of an object under usual illumination. + * + * A Blur effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBlur(); + * sprite.postFX.addBlur(); + * ``` * * @class Blur * @extends Phaser.FX.Controller @@ -19461,6 +19550,27 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Bokeh FX Controller. + * + * This FX controller manages the bokeh effect for a Game Object. + * + * Bokeh refers to a visual effect that mimics the photographic technique of creating a shallow depth of field. + * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground + * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering + * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. + * + * This effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature + * effect by blurring everything except a small area of the image. This effect is achieved by blurring the + * top and bottom elements, while keeping the center area in focus. + * + * A Bokeh effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBokeh(); + * sprite.postFX.addBokeh(); + * ``` * * @class Bokeh * @extends Phaser.FX.Controller @@ -19495,13 +19605,77 @@ var Bokeh = new Class({ Controller.call(this, FX_CONST.BOKEH, gameObject); + /** + * The radius of the bokeh effect. + * + * This is a float value, where a radius of 0 will result in no effect being applied, + * and a radius of 1 will result in a strong bokeh. However, you can exceed this value + * for even stronger effects. + * + * @name Phaser.FX.Bokeh#radius + * @type {number} + * @since 3.60.0 + */ this.radius = radius; + + /** + * The amount, or strength, of the bokeh effect. Defaults to 1. + * + * @name Phaser.FX.Bokeh#amount + * @type {number} + * @since 3.60.0 + */ this.amount = amount; + + /** + * The color contrast, or brightness, of the bokeh effect. Defaults to 0.2. + * + * @name Phaser.FX.Bokeh#contrast + * @type {number} + * @since 3.60.0 + */ this.contrast = contrast; + /** + * Is this a Tilt Shift effect or a standard bokeh effect? + * + * @name Phaser.FX.Bokeh#isTiltShift + * @type {boolean} + * @since 3.60.0 + */ this.isTiltShift = isTiltShift; + + /** + * If a Tilt Shift effect this controls the strength of the blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#strength + * @type {number} + * @since 3.60.0 + */ this.strength = strength; + + /** + * If a Tilt Shift effect this controls the amount of horizontal blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#blurX + * @type {number} + * @since 3.60.0 + */ this.blurX = blurX; + + /** + * If a Tilt Shift effect this controls the amount of vertical blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#blurY + * @type {number} + * @since 3.60.0 + */ this.blurY = blurY; } @@ -19527,6 +19701,26 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Circle FX Controller. + * + * This FX controller manages the circle effect for a Game Object. + * + * This effect will draw a circle around the texture of the Game Object, effectively masking off + * any area outside of the circle without the need for an actual mask. You can control the thickness + * of the circle, the color of the circle and the color of the background, should the texture be + * transparent. You can also control the feathering applied to the circle, allowing for a harsh or soft edge. + * + * Please note that adding this effect to a Game Object will not change the input area or physics body of + * the Game Object, should it have one. + * + * A Circle effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addCircle(); + * sprite.postFX.addCircle(); + * ``` * * @class Circle * @extends Phaser.FX.Controller @@ -19536,7 +19730,7 @@ var FX_CONST = __webpack_require__(1571); * * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. * @param {number} [thickness=8] - The width of the circle around the texture, in pixels. - * @param {number} [color=16724914] - The color of the circular ring, given as a number value. + * @param {number} [color=0xfeedb6] - The color of the circular ring, given as a number value. * @param {number} [backgroundColor=0xff0000] - The color of the background, behind the texture, given as a number value. * @param {number} [scale=1] - The scale of the circle. The default scale is 1, which is a circle the full size of the underlying texture. * @param {number} [feather=0.005] - The amount of feathering to apply to the circle from the ring. @@ -19696,6 +19890,24 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The ColorMatrix FX Controller. + * + * This FX controller manages the color matrix effect for a Game Object. + * + * The color matrix effect is a visual technique that involves manipulating the colors of an image + * or scene using a mathematical matrix. This process can adjust hue, saturation, brightness, and contrast, + * allowing developers to create various stylistic appearances or mood settings within the game. + * Common applications include simulating different lighting conditions, applying color filters, + * or achieving a specific visual style. + * + * A ColorMatrix effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addColorMatrix(); + * sprite.postFX.addColorMatrix(); + * ``` * * @class ColorMatrix * @extends Phaser.Display.ColorMatrix @@ -19771,6 +19983,9 @@ var Class = __webpack_require__(7473); /** * @classdesc + * FX Controller is the base class that all built-in FX use. + * + * You should not normally create an instance of this class directly, but instead use one of the built-in FX that extend it. * * @class Controller * @memberof Phaser.FX @@ -19808,6 +20023,10 @@ var Controller = new Class({ * Toggle this boolean to enable or disable this effect, * without removing and adding it from the Game Object. * + * Only works for Pre FX. + * + * Post FX are always active. + * * @name Phaser.FX.Controller#active * @type {boolean} * @since 3.60.0 @@ -19815,6 +20034,25 @@ var Controller = new Class({ this.active = true; }, + /** + * Sets the active state of this FX Controller. + * + * A disabled FX Controller will not be updated. + * + * @method Phaser.FX.Controller#setActive + * @since 3.60.0 + * + * @param {boolean} value - `true` to enable this FX Controller, or `false` to disable it. + * + * @return {this} This FX Controller instance. + */ + setActive: function (value) + { + this.active = value; + + return this; + }, + /** * Destroys this FX Controller. * @@ -19849,6 +20087,24 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Displacement FX Controller. + * + * This FX controller manages the displacement effect for a Game Object. + * + * The displacement effect is a visual technique that alters the position of pixels in an image + * or texture based on the values of a displacement map. This effect is used to create the illusion + * of depth, surface irregularities, or distortion in otherwise flat elements. It can be applied to + * characters, objects, or backgrounds to enhance realism, convey movement, or achieve various + * stylistic appearances. + * + * A Displacement effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addDisplacement(); + * sprite.postFX.addDisplacement(); + * ``` * * @class Displacement * @extends Phaser.FX.Controller @@ -19857,9 +20113,9 @@ var FX_CONST = __webpack_require__(1571); * @since 3.60.0 * * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. - * @param {string} [key='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. - * @param {number} [x=0.005] - The amount of horizontal displacement to apply. - * @param {number} [y=0.005] - The amount of vertical displacement to apply. + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * @param {number} [x=0.005] - The amount of horizontal displacement to apply. A very small float number, such as 0.005. + * @param {number} [y=0.005] - The amount of vertical displacement to apply. A very small float number, such as 0.005. */ var Displacement = new Class({ @@ -19867,9 +20123,9 @@ var Displacement = new Class({ initialize: - function Displacement (gameObject, displacementTexture, x, y) + function Displacement (gameObject, texture, x, y) { - if (displacementTexture === undefined) { displacementTexture = '__WHITE'; } + if (texture === undefined) { texture = '__WHITE'; } if (x === undefined) { x = 0.005; } if (y === undefined) { y = 0.005; } @@ -19902,9 +20158,21 @@ var Displacement = new Class({ */ this.glTexture; - this.setTexture(displacementTexture); + this.setTexture(texture); }, + /** + * Sets the Texture to be used for the displacement effect. + * + * You can only use a whole texture, not a frame from a texture atlas or sprite sheet. + * + * @method Phaser.GameObjects.Components.FX#setTexture + * @since 3.60.0 + * + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * + * @return {this} This FX Controller. + */ setTexture: function (texture) { var phaserTexture = this.gameObject.scene.sys.textures.getFrame(texture); @@ -19913,6 +20181,8 @@ var Displacement = new Class({ { this.glTexture = phaserTexture.glTexture; } + + return this; } }); @@ -19941,10 +20211,10 @@ var FX_CONST = __webpack_require__(1571); * * This FX controller manages the glow effect for a Game Object. * - * A glow effect allows you to apply a soft, blurred 'glow' around either the outside, - * inside, or both of a Game Object. The color and strength of the glow can be modified. - * - * You can modify most of its properties in real-time to adjust the visual effect. + * The glow effect is a visual technique that creates a soft, luminous halo around game objects, + * characters, or UI elements. This effect is used to emphasize importance, enhance visual appeal, + * or convey a sense of energy, magic, or otherworldly presence. The effect can also be set on + * the inside of the Game Object. The color and strength of the glow can be modified. * * A Glow effect is added to a Game Object via the FX component: * @@ -20072,6 +20342,23 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Gradient FX Controller. + * + * This FX controller manages the gradient effect for a Game Object. + * + * The gradient overlay effect is a visual technique where a smooth color transition is applied over Game Objects, + * such as sprites or UI components. This effect is used to enhance visual appeal, emphasize depth, or create + * stylistic and atmospheric variations. It can also be utilized to convey information, such as representing + * progress or health status through color changes. + * + * A Gradient effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addGradient(); + * sprite.postFX.addGradient(); + * ``` * * @class Gradient * @extends Phaser.FX.Controller @@ -20268,6 +20555,23 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Pixelate FX Controller. + * + * This FX controller manages the pixelate effect for a Game Object. + * + * The pixelate effect is a visual technique that deliberately reduces the resolution or detail of an image, + * creating a blocky or mosaic appearance composed of large, visible pixels. This effect can be used for stylistic + * purposes, as a homage to retro gaming, or as a means to obscure certain elements within the game, such as + * during a transition or to censor specific content. + * + * A Pixelate effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addPixelate(); + * sprite.postFX.addPixelate(); + * ``` * * @class Pixelate * @extends Phaser.FX.Controller @@ -20322,6 +20626,22 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Shadow FX Controller. + * + * This FX controller manages the shadow effect for a Game Object. + * + * The shadow effect is a visual technique used to create the illusion of depth and realism by adding darker, + * offset silhouettes or shapes beneath game objects, characters, or environments. These simulated shadows + * help to enhance the visual appeal and immersion, making the 2D game world appear more dynamic and three-dimensional. + * + * A Shadow effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addShadow(); + * sprite.postFX.addShadow(); + * ``` * * @class Shadow * @extends Phaser.FX.Controller @@ -20475,6 +20795,23 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Shine FX Controller. + * + * This FX controller manages the shift effect for a Game Object. + * + * The shine effect is a visual technique that simulates the appearance of reflective + * or glossy surfaces by passing a light beam across a Game Object. This effect is used to + * enhance visual appeal, emphasize certain features, and create a sense of depth or + * material properties. + * + * A Shine effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addShine(); + * sprite.postFX.addShine(); + * ``` * * @class Shine * @extends Phaser.FX.Controller @@ -20562,6 +20899,22 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Vignette FX Controller. + * + * This FX controller manages the vignette effect for a Game Object. + * + * The vignette effect is a visual technique where the edges of the screen, or a Game Object, gradually darken or blur, + * creating a frame-like appearance. This effect is used to draw the player's focus towards the central action or subject, + * enhance immersion, and provide a cinematic or artistic quality to the game's visuals. + * + * A Vignette effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addVignette(); + * sprite.postFX.addVignette(); + * ``` * * @class Vignette * @extends Phaser.FX.Controller @@ -20649,6 +21002,34 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Wipe FX Controller. + * + * This FX controller manages the wipe effect for a Game Object. + * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * + * A Wipe effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addWipe(); + * sprite.postFX.addWipe(); + * sprite.preFX.addReveal(); + * sprite.postFX.addReveal(); + * ``` * * @class Wipe * @extends Phaser.FX.Controller @@ -20677,14 +21058,6 @@ var Wipe = new Class({ Controller.call(this, FX_CONST.WIPE, gameObject); - // left to right: direction 0, axis 0 - // right to left: direction 1, axis 0 - // top to bottom: direction 1, axis 1 - // bottom to top: direction 1, axis 0 - // wipe: reveal 0 - // reveal: reveal 1 - // progress: 0 - 1 - /** * The progress of the Wipe effect. This value is normalized to the range 0 to 1. * @@ -20916,7 +21289,7 @@ var FX_CONST = __webpack_require__(1571); var FX = { - Barrel: __webpack_require__(8325), + Barrel: __webpack_require__(7340), Controller: __webpack_require__(6128), Bloom: __webpack_require__(5170), Blur: __webpack_require__(4199), @@ -23219,6 +23592,57 @@ var SpliceOne = __webpack_require__(8935); /** * @classdesc + * The FX Component features a set of methods used for applying a range of special built-in effects to a Game Object. + * + * The effects include the following: + * + * * Barrel Distortion + * * Bloom + * * Blur + * * Bokeh / Tilt Shift + * * Circle Outline + * * Color Matrix + * * Glow + * * Displacement + * * Gradient + * * Pixelate + * * Shine + * * Shadow + * * Vignette + * * Wipe / Reveal + * + * All Game Objects support Post FX. These are effects applied after the Game Object has been rendered. + * + * Texture-based Game Objects also support Pre FX, including: + * + * * Image + * * Sprite + * * TileSprite + * * Text + * * RenderTexture + * * Video + * + * And any Game Object that extends the above. + * + * The difference between Pre FX and Post FX are that all Post FX take place in a canvas (renderer) sized frame buffer, + * after the Game Object has been rendered. Pre FX, however, take place in a texture sized frame buffer, which is sized + * based on the Game Object itself. The end result is then composited back to the main game canvas. For intensive effects, + * such as blur, bloom or glow, which can require many iterations, this is a much more efficient way to apply the effect, + * as only it only has to work on a Game Object sized texture and not all pixels in the canvas. + * + * In short, you should always try and use a Pre FX if you can. + * + * Due to the way that FX work they can be stacked-up. For example, you can apply a blur to a Game Object, then apply + * a bloom effect to the same Game Object. The bloom effect will be applied to the blurred texture, not the original. + * Keep the order in mind when stacking effects. + * + * All effects are WebGL only and do not have canvas counterparts. + * + * As you can appreciate, some effects are more expensive than others. For example, a bloom effect is going to be more + * expensive than a simple color matrix effect, so please consider using them wisely and performance test your target + * platforms early on in production. + * + * This component is created automatically by the `PostPipeline` class and does not need to be instantiated directly. * * @class FX * @memberof Phaser.GameObjects.Components @@ -23228,7 +23652,6 @@ var SpliceOne = __webpack_require__(8935); * * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that owns this FX Component. * @param {boolean} isPost - Is this a Pre or Post FX Component? -+- * */ var FX = new Class({ @@ -23241,6 +23664,7 @@ var FX = new Class({ * * @name Phaser.GameObjects.Components.FX#gameObject * @type {Phaser.GameObjects.GameObject} + * @readonly * @since 3.60.0 */ this.gameObject = gameObject; @@ -23250,6 +23674,7 @@ var FX = new Class({ * * @name Phaser.GameObjects.Components.FX#isPost * @type {boolean} + * @readonly * @since 3.60.0 */ this.isPost = isPost; @@ -23257,7 +23682,8 @@ var FX = new Class({ /** * Has this FX Component been enabled? * - * You should treat this property as read-only. + * You should treat this property as read-only, although it is toggled + * automaticaly during internal use. * * @name Phaser.GameObjects.Components.FX#enabled * @type {boolean} @@ -23266,8 +23692,11 @@ var FX = new Class({ this.enabled = false; /** - * An array containing all of the FX Controllers that - * have been added to this FX Component. + * An array containing all of the Pre FX Controllers that + * have been added to this FX Component. They are processed in + * the order they are added. + * + * This array is empty if this is a Post FX Component. * * @name Phaser.GameObjects.Components.FX#list * @type {Phaser.FX.Controller[]} @@ -23277,13 +23706,15 @@ var FX = new Class({ /** * The amount of extra padding to be applied to this Game Object - * when it is being rendered by a PreFX or SpriteFX Pipeline. + * when it is being rendered by a PreFX Pipeline. * * Lots of FX require additional spacing added to the texture the * Game Object uses, for example a glow or shadow effect, and this * method allows you to control how much extra padding is included * in addition to the texture size. * + * You do not need to set this if you're only using Post FX. + * * @name Phaser.GameObjects.Components.FX#padding * @type {number} * @default 0 @@ -23301,6 +23732,8 @@ var FX = new Class({ * method allows you to control how much extra padding is included * in addition to the texture size. * + * You do not need to set this if you're only using Post FX. + * * @method Phaser.GameObjects.Components.FX#setPadding * @webglOnly * @since 3.60.0 @@ -23357,6 +23790,8 @@ var FX = new Class({ * * You can check the `enabled` property to see if the Game Object is already enabled, or not. * + * This only applies to Pre FX. Post FX are always enabled. + * * @method Phaser.GameObjects.Components.FX#enable * @since 3.60.0 * @@ -23364,6 +23799,11 @@ var FX = new Class({ */ enable: function (padding) { + if (this.isPost) + { + return; + } + var renderer = this.gameObject.scene.sys.renderer; if (renderer && renderer.pipelines) @@ -23387,46 +23827,97 @@ var FX = new Class({ * Destroys and removes all FX Controllers that are part of this FX Component, * then disables it. * + * If this is a Pre FX Component it will only remove Pre FX. + * If this is a Post FX Component it will only remove Post FX. + * + * To remove both at once use the `GameObject.clearFX` method instead. + * * @method Phaser.GameObjects.Components.FX#clear * @since 3.60.0 + * + * @return {this} This Game Object instance. */ clear: function () { - var list = this.list; - - for (var i = 0; i < list.length; i++) + if (this.isPost) { - list[i].destroy(); + this.gameObject.resetPostPipeline(true); + } + else + { + var list = this.list; + + for (var i = 0; i < list.length; i++) + { + list[i].destroy(); + } + + this.list = []; } - this.list = []; - this.enabled = false; + + return this.gameObject; }, /** - * Searches for the given FX Controler within this FX Component. + * Searches for the given FX Controller within this FX Component. * - * If found, the controller is removed from this compoent and then destroyed. + * If found, the controller is removed from this component and then destroyed. * * @method Phaser.GameObjects.Components.FX#remove * @since 3.60.0 * + * @generic {Phaser.FX.Controller} T + * @genericUse {T} - [fx] + * * @param {Phaser.FX.Controller} fx - The FX Controller to remove from this FX Component. + * + * @return {this} This Game Object instance. */ remove: function (fx) { - var list = this.list; + var i; - for (var i = 0; i < list.length; i++) + if (this.isPost) { - if (list[i] === fx) - { - SpliceOne(list, i); + var pipelines = this.gameObject.getPostPipeline(String(fx.type)); - fx.destroy(); + if (!Array.isArray(pipelines)) + { + pipelines = [ pipelines ]; + } + + for (i = 0; i < pipelines.length; i++) + { + var pipeline = pipelines[i]; + + if (pipeline.controller === fx) + { + this.gameObject.removePostPipeline(pipeline); + + fx.destroy(); + + break; + } } } + else + { + var list = this.list; + + for (i = 0; i < list.length; i++) + { + if (list[i] === fx) + { + SpliceOne(list, i); + + fx.destroy(); + } + } + } + + return this.gameObject; }, /** @@ -23435,20 +23926,25 @@ var FX = new Class({ * This will reset the pipeline on the Game Object that owns this component back to its * default and flag this component as disabled. * - * You can re-enable it again by calling `enable`. + * You can re-enable it again by calling `enable` for Pre FX or by adding an FX for Post FX. * * Optionally, set `clear` to destroy all current FX Controllers. * * @method Phaser.GameObjects.Components.FX#disable * @since 3.60.0 * - * @param {boolean} [clear=false] - Destroy and remove all FX Controllers that are part of this FX Component. + * @param {boolean} [clear=false] - Destroy and remove all FX Controllers that are part of this component. + * + * @return {this} This Game Object instance. */ disable: function (clear) { if (clear === undefined) { clear = false; } - this.gameObject.resetPipeline(); + if (!this.isPost) + { + this.gameObject.resetPipeline(); + } this.enabled = false; @@ -23456,6 +23952,8 @@ var FX = new Class({ { this.clear(); } + + return this.gameObject; }, /** @@ -23468,6 +23966,9 @@ var FX = new Class({ * @method Phaser.GameObjects.Components.FX#add * @since 3.60.0 * + * @generic {Phaser.FX.Controller} T + * @genericUse {T} - [fx] + * * @param {Phaser.FX.Controller} fx - The FX Controller to add to this FX Component. * @param {object} [config] - Optional configuration object that is passed to the pipeline during instantiation. * @@ -23511,6 +24012,11 @@ var FX = new Class({ /** * Adds a Glow effect. * + * The glow effect is a visual technique that creates a soft, luminous halo around game objects, + * characters, or UI elements. This effect is used to emphasize importance, enhance visual appeal, + * or convey a sense of energy, magic, or otherworldly presence. The effect can also be set on + * the inside of the Game Object. The color and strength of the glow can be modified. + * * @method Phaser.GameObjects.Components.FX#addGlow * @since 3.60.0 * @@ -23531,6 +24037,10 @@ var FX = new Class({ /** * Adds a Shadow effect. * + * The shadow effect is a visual technique used to create the illusion of depth and realism by adding darker, + * offset silhouettes or shapes beneath game objects, characters, or environments. These simulated shadows + * help to enhance the visual appeal and immersion, making the 2D game world appear more dynamic and three-dimensional. + * * @method Phaser.GameObjects.Components.FX#addShadow * @since 3.60.0 * @@ -23552,6 +24062,11 @@ var FX = new Class({ /** * Adds a Pixelate effect. * + * The pixelate effect is a visual technique that deliberately reduces the resolution or detail of an image, + * creating a blocky or mosaic appearance composed of large, visible pixels. This effect can be used for stylistic + * purposes, as a homage to retro gaming, or as a means to obscure certain elements within the game, such as + * during a transition or to censor specific content. + * * @method Phaser.GameObjects.Components.FX#addPixelate * @since 3.60.0 * @@ -23567,6 +24082,10 @@ var FX = new Class({ /** * Adds a Vignette effect. * + * The vignette effect is a visual technique where the edges of the screen, or a Game Object, gradually darken or blur, + * creating a frame-like appearance. This effect is used to draw the player's focus towards the central action or subject, + * enhance immersion, and provide a cinematic or artistic quality to the game's visuals. + * * @method Phaser.GameObjects.Components.FX#addVignette * @since 3.60.0 * @@ -23585,6 +24104,11 @@ var FX = new Class({ /** * Adds a Shine effect. * + * The shine effect is a visual technique that simulates the appearance of reflective + * or glossy surfaces by passing a light beam across a Game Object. This effect is used to + * enhance visual appeal, emphasize certain features, and create a sense of depth or + * material properties. + * * @method Phaser.GameObjects.Components.FX#addShine * @since 3.60.0 * @@ -23603,6 +24127,11 @@ var FX = new Class({ /** * Adds a Blur effect. * + * A Gaussian blur is the result of blurring an image by a Gaussian function. It is a widely used effect, + * typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a + * smooth blur resembling that of viewing the image through a translucent screen, distinctly different + * from the bokeh effect produced by an out-of-focus lens or the shadow of an object under usual illumination. + * * @method Phaser.GameObjects.Components.FX#addBlur * @since 3.60.0 * @@ -23623,6 +24152,11 @@ var FX = new Class({ /** * Adds a Gradient effect. * + * The gradient overlay effect is a visual technique where a smooth color transition is applied over Game Objects, + * such as sprites or UI components. This effect is used to enhance visual appeal, emphasize depth, or create + * stylistic and atmospheric variations. It can also be utilized to convey information, such as representing + * progress or health status through color changes. + * * @method Phaser.GameObjects.Components.FX#addGradient * @since 3.60.0 * @@ -23645,6 +24179,11 @@ var FX = new Class({ /** * Adds a Bloom effect. * + * Bloom is an effect used to reproduce an imaging artifact of real-world cameras. + * The effect produces fringes of light extending from the borders of bright areas in an image, + * contributing to the illusion of an extremely bright light overwhelming the + * camera or eye capturing the scene. + * * @method Phaser.GameObjects.Components.FX#addBloom * @since 3.60.0 * @@ -23665,6 +24204,12 @@ var FX = new Class({ /** * Adds a ColorMatrix effect. * + * The color matrix effect is a visual technique that involves manipulating the colors of an image + * or scene using a mathematical matrix. This process can adjust hue, saturation, brightness, and contrast, + * allowing developers to create various stylistic appearances or mood settings within the game. + * Common applications include simulating different lighting conditions, applying color filters, + * or achieving a specific visual style. + * * @method Phaser.GameObjects.Components.FX#addColorMatrix * @since 3.60.0 * @@ -23678,11 +24223,19 @@ var FX = new Class({ /** * Adds a Circle effect. * + * This effect will draw a circle around the texture of the Game Object, effectively masking off + * any area outside of the circle without the need for an actual mask. You can control the thickness + * of the circle, the color of the circle and the color of the background, should the texture be + * transparent. You can also control the feathering applied to the circle, allowing for a harsh or soft edge. + * + * Please note that adding this effect to a Game Object will not change the input area or physics body of + * the Game Object, should it have one. + * * @method Phaser.GameObjects.Components.FX#addCircle * @since 3.60.0 * * @param {number} [thickness=8] - The width of the circle around the texture, in pixels. - * @param {number} [color=16724914] - The color of the circular ring, given as a number value. + * @param {number} [color=0xfeedb6] - The color of the circular ring, given as a number value. * @param {number} [backgroundColor=0xff0000] - The color of the background, behind the texture, given as a number value. * @param {number} [scale=1] - The scale of the circle. The default scale is 1, which is a circle the full size of the underlying texture. * @param {number} [feather=0.005] - The amount of feathering to apply to the circle from the ring. @@ -23697,6 +24250,9 @@ var FX = new Class({ /** * Adds a Barrel effect. * + * A barrel effect allows you to apply either a 'pinch' or 'expand' distortion to + * a Game Object. The amount of the effect can be modified in real-time. + * * @method Phaser.GameObjects.Components.FX#addBarrel * @since 3.60.0 * @@ -23712,23 +24268,43 @@ var FX = new Class({ /** * Adds a Displacement effect. * + * The displacement effect is a visual technique that alters the position of pixels in an image + * or texture based on the values of a displacement map. This effect is used to create the illusion + * of depth, surface irregularities, or distortion in otherwise flat elements. It can be applied to + * characters, objects, or backgrounds to enhance realism, convey movement, or achieve various + * stylistic appearances. + * * @method Phaser.GameObjects.Components.FX#addDisplacement * @since 3.60.0 * - * @param {string} [key='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. - * @param {number} [x=0.005] - The amount of horizontal displacement to apply. - * @param {number} [y=0.005] - The amount of vertical displacement to apply. + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * @param {number} [x=0.005] - The amount of horizontal displacement to apply. A very small float number, such as 0.005. + * @param {number} [y=0.005] - The amount of vertical displacement to apply. A very small float number, such as 0.005. * * @return {Phaser.FX.Displacement} The Displacement FX Controller. */ - addDisplacement: function (displacementTexture, x, y) + addDisplacement: function (texture, x, y) { - return this.add(new Effects.Displacement(this.gameObject, displacementTexture, x, y)); + return this.add(new Effects.Displacement(this.gameObject, texture, x, y)); }, /** * Adds a Wipe effect. * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * * @method Phaser.GameObjects.Components.FX#addWipe * @since 3.60.0 * @@ -23746,6 +24322,20 @@ var FX = new Class({ /** * Adds a Reveal Wipe effect. * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * * @method Phaser.GameObjects.Components.FX#addReveal * @since 3.60.0 * @@ -23763,6 +24353,13 @@ var FX = new Class({ /** * Adds a Bokeh effect. * + * Bokeh refers to a visual effect that mimics the photographic technique of creating a shallow depth of field. + * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground + * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering + * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. + * + * See also Tilt Shift. + * * @method Phaser.GameObjects.Components.FX#addBokeh * @since 3.60.0 * @@ -23778,7 +24375,13 @@ var FX = new Class({ }, /** - * Adds a TiltShift effect. + * Adds a Tilt Shift effect. + * + * This Bokeh effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature + * effect by blurring everything except a small area of the image. This effect is achieved by blurring the + * top and bottom elements, while keeping the center area in focus. + * + * See also Bokeh. * * @method Phaser.GameObjects.Components.FX#addTiltShift * @since 3.60.0 @@ -23786,9 +24389,9 @@ var FX = new Class({ * @param {number} [radius=0.5] - The radius of the bokeh effect. * @param {number} [amount=1] - The amount of the bokeh effect. * @param {number} [contrast=0.2] - The color contrast of the bokeh effect. - * @param {number} [blurX=1] - If Tilt Shift, the amount of horizontal blur. - * @param {number} [blurY=1] - If Tilt Shift, the amount of vertical blur. - * @param {number} [strength=1] - If Tilt Shift, the strength of the blur. + * @param {number} [blurX=1] - The amount of horizontal blur. + * @param {number} [blurY=1] - The amount of vertical blur. + * @param {number} [strength=1] - The strength of the blur. * * @return {Phaser.FX.Bokeh} The Bokeh TiltShift FX Controller. */ @@ -24014,12 +24617,12 @@ var GetBounds = { * @private * @since 3.18.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} output - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} output - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ prepareBoundsOutput: function (output, includeParent) { @@ -24042,40 +24645,45 @@ var GetBounds = { /** * Gets the center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getCenter * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ - getCenter: function (output) + getCenter: function (output, includeParent) { if (output === undefined) { output = new Vector2(); } output.x = this.x - (this.displayWidth * this.originX) + (this.displayWidth / 2); output.y = this.y - (this.displayHeight * this.originY) + (this.displayHeight / 2); - return output; + return this.prepareBoundsOutput(output, includeParent); }, /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getTopLeft * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getTopLeft: function (output, includeParent) { @@ -24089,17 +24697,19 @@ var GetBounds = { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getTopCenter * @since 3.18.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getTopCenter: function (output, includeParent) { @@ -24113,17 +24723,19 @@ var GetBounds = { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getTopRight * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getTopRight: function (output, includeParent) { @@ -24137,17 +24749,19 @@ var GetBounds = { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getLeftCenter * @since 3.18.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getLeftCenter: function (output, includeParent) { @@ -24161,17 +24775,19 @@ var GetBounds = { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getRightCenter * @since 3.18.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getRightCenter: function (output, includeParent) { @@ -24185,17 +24801,19 @@ var GetBounds = { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getBottomLeft * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getBottomLeft: function (output, includeParent) { @@ -24209,17 +24827,19 @@ var GetBounds = { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getBottomCenter * @since 3.18.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getBottomCenter: function (output, includeParent) { @@ -24233,17 +24853,19 @@ var GetBounds = { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getBottomRight * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getBottomRight: function (output, includeParent) { @@ -24257,6 +24879,7 @@ var GetBounds = { /** * Gets the bounds of this Game Object, regardless of origin. + * * The values are stored and returned in a Rectangle, or Rectangle-like, object. * * @method Phaser.GameObjects.Components.GetBounds#getBounds @@ -25452,7 +26075,7 @@ var PostPipeline = { * Please see the FX Class for more details and available methods. * * @name Phaser.GameObjects.Components.PostPipeline#preFX - * @type {Phaser.GameObjects.Components.FX} + * @type {?Phaser.GameObjects.Components.FX} * @webglOnly * @since 3.60.0 */ @@ -25474,6 +26097,8 @@ var PostPipeline = { * * Please see the FX Class for more details and available methods. * + * This property is always `null` until the `initPostPipeline` method is called. + * * @name Phaser.GameObjects.Components.PostPipeline#postFX * @type {Phaser.GameObjects.Components.FX} * @webglOnly @@ -25682,6 +26307,8 @@ var PostPipeline = { */ removePostPipeline: function (pipeline) { + var isString = (typeof pipeline === 'string'); + var pipelines = this.postPipelines; for (var i = pipelines.length - 1; i >= 0; i--) @@ -25689,8 +26316,8 @@ var PostPipeline = { var instance = pipelines[i]; if ( - (typeof pipeline === 'string' && instance.name === pipeline) || - (typeof pipeline !== 'string' && instance instanceof pipeline)) + (isString && instance.name === pipeline) || + (!isString && instance === pipeline)) { instance.destroy(); @@ -25700,6 +26327,34 @@ var PostPipeline = { this.hasPostPipeline = (this.postPipelines.length > 0); + return this; + }, + + /** + * Removes all Pre and Post FX Controllers from this Game Object. + * + * If you wish to remove a single controller, use the `preFX.remove(fx)` or `postFX.remove(fx)` methods instead. + * + * If you wish to clear a single controller, use the `preFX.clear()` or `postFX.clear()` methods instead. + * + * @method Phaser.GameObjects.Components.PostPipeline#clearFX + * @webglOnly + * @since 3.60.0 + * + * @return {this} This Game Object. + */ + clearFX: function () + { + if (this.preFX) + { + this.preFX.clear(); + } + + if (this.postFX) + { + this.postFX.clear(); + } + return this; } @@ -28939,28 +29594,19 @@ var Container = new Class({ { var entry = children[i]; - if (entry.getTextBounds) - { - var textBounds = entry.getTextBounds().global; - tempRect.setTo(textBounds.x, textBounds.y, textBounds.width, textBounds.height); - } - else if (entry.getBounds) + if (entry.getBounds) { entry.getBounds(tempRect); - } - else - { - continue; - } - if (!hasSetFirst) - { - output.setTo(tempRect.x, tempRect.y, tempRect.width, tempRect.height); - hasSetFirst = true; - } - else - { - Union(tempRect, output, output); + if (!hasSetFirst) + { + output.setTo(tempRect.x, tempRect.y, tempRect.width, tempRect.height); + hasSetFirst = true; + } + else + { + Union(tempRect, output, output); + } } } } @@ -30468,11 +31114,43 @@ module.exports = 'created'; * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. - * @param {Event} event - The native DOM event the browser raised during playback. + * @param {DOMException|string} event - The native DOM event the browser raised during playback. */ module.exports = 'error'; +/***/ }), + +/***/ 6231: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Locked Event. + * + * This event is dispatched when a Video was attempted to be played, but the browser prevented it + * from doing so due to the Media Engagement Interaction policy. + * + * If you get this event you will need to wait for the user to interact with the browser before + * the video will play. This is a browser security measure to prevent autoplaying videos with + * audio. An interaction includes a mouse click, a touch, or a key press. + * + * Listen for it from a Video Game Object instance using `Video.on('locked', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_LOCKED + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. + */ +module.exports = 'locked'; + + /***/ }), /***/ 5241: @@ -30507,6 +31185,35 @@ module.exports = 'error'; module.exports = 'loop'; +/***/ }), + +/***/ 8325: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Playing Event. + * + * The playing event is fired after playback is first started, + * and whenever it is restarted. For example it is fired when playback + * resumes after having been paused or delayed due to lack of data. + * + * Listen for it from a Video Game Object instance using `Video.on('playing', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_PLAYING + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. + */ +module.exports = 'playing'; + + /***/ }), /***/ 3356: @@ -30592,6 +31299,46 @@ module.exports = 'seeked'; module.exports = 'seeking'; +/***/ }), + +/***/ 7111: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Stalled Event. + * + * This event is dispatched by a Video Game Object when the video playback stalls. + * + * This can happen if the video is buffering. + * + * If will fire for any of the following native DOM events: + * + * `stalled` + * `suspend` + * `waiting` + * + * Listen for it from a Video Game Object instance using `Video.on('stalled', listener)`. + * + * Note that being stalled isn't always a negative thing. A video can be stalled if it + * has downloaded enough data in to its buffer to not need to download any more until + * the current batch of frames have rendered. + * + * @event Phaser.GameObjects.Events#VIDEO_STALLED + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. + * @param {Event} event - The native DOM event the browser raised during playback. + */ +module.exports = 'stalled'; + + /***/ }), /***/ 8118: @@ -30622,7 +31369,7 @@ module.exports = 'stop'; /***/ }), -/***/ 5529: +/***/ 9184: /***/ ((module) => { /** @@ -30632,20 +31379,25 @@ module.exports = 'stop'; */ /** - * The Video Game Object Timeout Event. + * The Video Game Object Texture Ready Event. * - * This event is dispatched when a Video has exhausted its allocated time while trying to connect to a video - * source to start playback. + * This event is dispatched by a Video Game Object when it has finished creating its texture. * - * Listen for it from a Video Game Object instance using `Video.on('timeout', listener)`. + * This happens when the video has finished loading enough data for its first frame. * - * @event Phaser.GameObjects.Events#VIDEO_TIMEOUT + * If you wish to use the Video texture elsewhere in your game, such as as a Sprite texture, + * then you should listen for this event first, before creating the Sprites that use it. + * + * Listen for it from a Video Game Object instance using `Video.on('textureready', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_TEXTURE * @type {string} - * @since 3.20.0 + * @since 3.60.0 * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which timed out. + * @param {Phaser.GameObjects.Video} video - The Video Game Object that emitted the event. + * @param {Phaser.Textures.Texture} texture - The Texture that was created. */ -module.exports = 'timeout'; +module.exports = 'textureready'; /***/ }), @@ -30676,6 +31428,36 @@ module.exports = 'timeout'; module.exports = 'unlocked'; +/***/ }), + +/***/ 857: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Unsupported Event. + * + * This event is dispatched by a Video Game Object if the media source + * (which may be specified as a MediaStream, MediaSource, Blob, or File, + * for example) doesn't represent a supported media format. + * + * Listen for it from a Video Game Object instance using `Video.on('unsupported', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_UNSUPPORTED + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. + * @param {DOMException|string} event - The native DOM event the browser raised during playback. + */ +module.exports = 'unsupported'; + + /***/ }), /***/ 3389: @@ -30699,13 +31481,17 @@ module.exports = { VIDEO_COMPLETE: __webpack_require__(3420), VIDEO_CREATED: __webpack_require__(601), VIDEO_ERROR: __webpack_require__(7919), + VIDEO_LOCKED: __webpack_require__(6231), VIDEO_LOOP: __webpack_require__(5241), VIDEO_PLAY: __webpack_require__(3356), + VIDEO_PLAYING: __webpack_require__(8325), VIDEO_SEEKED: __webpack_require__(7513), VIDEO_SEEKING: __webpack_require__(5788), + VIDEO_STALLED: __webpack_require__(7111), VIDEO_STOP: __webpack_require__(8118), - VIDEO_TIMEOUT: __webpack_require__(5529), - VIDEO_UNLOCKED: __webpack_require__(4287) + VIDEO_TEXTURE: __webpack_require__(9184), + VIDEO_UNLOCKED: __webpack_require__(4287), + VIDEO_UNSUPPORTED: __webpack_require__(857) }; @@ -42833,7 +43619,7 @@ var MATH_CONST = { /** * The value of PI * 0.5. * - * Yes, we undertstand that this should actually be PI * 2, but + * Yes, we understand that this should actually be PI * 2, but * it has been like this for so long we can't change it now. * If you need PI * 2, use the PI2 constant instead. * diff --git a/plugins/spine/dist/SpinePlugin.min.js b/plugins/spine/dist/SpinePlugin.min.js index 8c652e9cf..44f60b7ee 100644 --- a/plugins/spine/dist/SpinePlugin.min.js +++ b/plugins/spine/dist/SpinePlugin.min.js @@ -1 +1 @@ -(()=>{var t={4399:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,s||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,a=new Array(s);r{(function(){var e,i,n,r=this&&this.__extends||(e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},e(t,i)},function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)});!function(t){var e,i,n,s=function(){function t(t,e,i){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var n=0;n0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l>>1;;){if(t[(s+1)*i]<=e?n=s+1:r=s,n==r)return(n+1)*i;s=n+r>>>1}},t.linearSearch=function(t,e,i){for(var n=0,r=t.length-i;n<=r;n+=i)if(t[n]>e)return n;return-1},t}();t.Animation=s,function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(e=t.MixBlend||(t.MixBlend={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(i=t.MixDirection||(t.MixDirection={})),function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"}(n=t.TimelineType||(t.TimelineType={}));var a=function(){function e(i){if(i<=0)throw new Error("frameCount must be > 0: "+i);this.curves=t.Utils.newFloatArray((i-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var i=t*e.BEZIER_SIZE;if(i==this.curves.length)return e.LINEAR;var n=this.curves[i];return n==e.LINEAR?e.LINEAR:n==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,i,n,r,s){var a=.03*(2*-i+r),o=.03*(2*-n+s),h=.006*(3*(i-r)+1),l=.006*(3*(n-s)+1),u=2*a+h,c=2*o+l,d=.3*i+a+.16666667*h,f=.3*n+o+.16666667*l,p=t*e.BEZIER_SIZE,v=this.curves;v[p++]=e.BEZIER;for(var g=d,m=f,M=p+e.BEZIER_SIZE-1;p=n){var u=void 0,c=void 0;return s==h?(u=0,c=0):(u=r[s-2],c=r[s-1]),c+(r[s+1]-c)*(n-u)/(o-u)}var d=r[s-1];return d+(1-d)*(n-o)/(1-o)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=a;var o=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e<<1),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.rotate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+a.ROTATION]=i},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(n=u[u.length-a.ENTRIES]){var f=u[u.length+a.PREV_ROTATION];switch(h){case e.setup:c.rotation=c.data.rotation+f*o;break;case e.first:case e.replace:f+=c.data.rotation-c.rotation,f-=360*(16384-(16384.499999999996-f/360|0));case e.add:c.rotation+=f*o}}else{var p=s.binarySearch(u,n,a.ENTRIES),v=u[p+a.PREV_ROTATION],g=u[p],m=this.getCurvePercent((p>>1)-1,1-(n-g)/(u[p+a.PREV_TIME]-g)),M=u[p+a.ROTATION]-v;switch(M=v+(M-360*(16384-(16384.499999999996-M/360|0)))*m,h){case e.setup:c.rotation=c.data.rotation+(M-360*(16384-(16384.499999999996-M/360|0)))*o;break;case e.first:case e.replace:M+=c.data.rotation-c.rotation;case e.add:c.rotation+=(M-360*(16384-(16384.499999999996-M/360|0)))*o}}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_ROTATION=-1,a.ROTATION=1,a}(a);t.RotateTimeline=o;var h=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.translate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,i,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.X]=i,this.frames[t+a.Y]=n},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_X],f=u[u.length+a.PREV_Y];else{var p=s.binarySearch(u,n,a.ENTRIES);d=u[p+a.PREV_X],f=u[p+a.PREV_Y];var v=u[p],g=this.getCurvePercent(p/a.ENTRIES-1,1-(n-v)/(u[p+a.PREV_TIME]-v));d+=(u[p+a.X]-d)*g,f+=(u[p+a.Y]-f)*g}switch(h){case e.setup:c.x=c.data.x+d*o,c.y=c.data.y+f*o;break;case e.first:case e.replace:c.x+=(c.data.x+d-c.x)*o,c.y+=(c.data.y+f-c.y)*o;break;case e.add:c.x+=d*o,c.y+=f*o}}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_X=-2,a.PREV_Y=-1,a.X=1,a.Y=2,a}(a);t.TranslateTimeline=h;var l=function(a){function o(t){return a.call(this,t)||this}return r(o,a),o.prototype.getPropertyId=function(){return(n.scale<<24)+this.boneIndex},o.prototype.apply=function(n,r,a,h,l,u,c){var d=this.frames,f=n.bones[this.boneIndex];if(f.active)if(a=d[d.length-o.ENTRIES])p=d[d.length+o.PREV_X]*f.data.scaleX,v=d[d.length+o.PREV_Y]*f.data.scaleY;else{var g=s.binarySearch(d,a,o.ENTRIES);p=d[g+o.PREV_X],v=d[g+o.PREV_Y];var m=d[g],M=this.getCurvePercent(g/o.ENTRIES-1,1-(a-m)/(d[g+o.PREV_TIME]-m));p=(p+(d[g+o.X]-p)*M)*f.data.scaleX,v=(v+(d[g+o.Y]-v)*M)*f.data.scaleY}if(1==l)u==e.add?(f.scaleX+=p-f.data.scaleX,f.scaleY+=v-f.data.scaleY):(f.scaleX=p,f.scaleY=v);else{var x=0,y=0;if(c==i.mixOut)switch(u){case e.setup:x=f.data.scaleX,y=f.data.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,f.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-y)*l;break;case e.first:case e.replace:x=f.scaleX,y=f.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,f.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-y)*l;break;case e.add:x=f.scaleX,y=f.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-f.data.scaleX)*l,f.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-f.data.scaleY)*l}else switch(u){case e.setup:x=Math.abs(f.data.scaleX)*t.MathUtils.signum(p),y=Math.abs(f.data.scaleY)*t.MathUtils.signum(v),f.scaleX=x+(p-x)*l,f.scaleY=y+(v-y)*l;break;case e.first:case e.replace:x=Math.abs(f.scaleX)*t.MathUtils.signum(p),y=Math.abs(f.scaleY)*t.MathUtils.signum(v),f.scaleX=x+(p-x)*l,f.scaleY=y+(v-y)*l;break;case e.add:x=t.MathUtils.signum(p),y=t.MathUtils.signum(v),f.scaleX=Math.abs(f.scaleX)*x+(p-Math.abs(f.data.scaleX)*x)*l,f.scaleY=Math.abs(f.scaleY)*y+(v-Math.abs(f.data.scaleY)*y)*l}}}},o}(h);t.ScaleTimeline=l;var u=function(t){function i(e){return t.call(this,e)||this}return r(i,t),i.prototype.getPropertyId=function(){return(n.shear<<24)+this.boneIndex},i.prototype.apply=function(t,n,r,a,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(r=u[u.length-i.ENTRIES])d=u[u.length+i.PREV_X],f=u[u.length+i.PREV_Y];else{var p=s.binarySearch(u,r,i.ENTRIES);d=u[p+i.PREV_X],f=u[p+i.PREV_Y];var v=u[p],g=this.getCurvePercent(p/i.ENTRIES-1,1-(r-v)/(u[p+i.PREV_TIME]-v));d+=(u[p+i.X]-d)*g,f+=(u[p+i.Y]-f)*g}switch(h){case e.setup:c.shearX=c.data.shearX+d*o,c.shearY=c.data.shearY+f*o;break;case e.first:case e.replace:c.shearX+=(c.data.shearX+d-c.shearX)*o,c.shearY+=(c.data.shearY+f-c.shearY)*o;break;case e.add:c.shearX+=d*o,c.shearY+=f*o}}},i}(h);t.ShearTimeline=u;var c=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.color<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,i,n,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=i,this.frames[t+a.G]=n,this.frames[t+a.B]=r,this.frames[t+a.A]=s},a.prototype.apply=function(t,i,n,r,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(n=c[c.length-a.ENTRIES]){var M=c.length;p=c[M+a.PREV_R],v=c[M+a.PREV_G],g=c[M+a.PREV_B],m=c[M+a.PREV_A]}else{var x=s.binarySearch(c,n,a.ENTRIES);p=c[x+a.PREV_R],v=c[x+a.PREV_G],g=c[x+a.PREV_B],m=c[x+a.PREV_A];var y=c[x],w=this.getCurvePercent(x/a.ENTRIES-1,1-(n-y)/(c[x+a.PREV_TIME]-y));p+=(c[x+a.R]-p)*w,v+=(c[x+a.G]-v)*w,g+=(c[x+a.B]-g)*w,m+=(c[x+a.A]-m)*w}if(1==o)u.color.set(p,v,g,m);else{d=u.color;h==e.setup&&d.setFromColor(u.data.color),d.add((p-d.r)*o,(v-d.g)*o,(g-d.b)*o,(m-d.a)*o)}}}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_R=-4,a.PREV_G=-3,a.PREV_B=-2,a.PREV_A=-1,a.R=1,a.G=2,a.B=3,a.A=4,a}(a);t.ColorTimeline=c;var d=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.twoColor<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,i,n,r,s,o,h,l){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=i,this.frames[t+a.G]=n,this.frames[t+a.B]=r,this.frames[t+a.A]=s,this.frames[t+a.R2]=o,this.frames[t+a.G2]=h,this.frames[t+a.B2]=l},a.prototype.apply=function(t,i,n,r,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(n=c[c.length-a.ENTRIES]){var b=c.length;g=c[b+a.PREV_R],m=c[b+a.PREV_G],M=c[b+a.PREV_B],x=c[b+a.PREV_A],y=c[b+a.PREV_R2],w=c[b+a.PREV_G2],E=c[b+a.PREV_B2]}else{var T=s.binarySearch(c,n,a.ENTRIES);g=c[T+a.PREV_R],m=c[T+a.PREV_G],M=c[T+a.PREV_B],x=c[T+a.PREV_A],y=c[T+a.PREV_R2],w=c[T+a.PREV_G2],E=c[T+a.PREV_B2];var A=c[T],R=this.getCurvePercent(T/a.ENTRIES-1,1-(n-A)/(c[T+a.PREV_TIME]-A));g+=(c[T+a.R]-g)*R,m+=(c[T+a.G]-m)*R,M+=(c[T+a.B]-M)*R,x+=(c[T+a.A]-x)*R,y+=(c[T+a.R2]-y)*R,w+=(c[T+a.G2]-w)*R,E+=(c[T+a.B2]-E)*R}if(1==o)u.color.set(g,m,M,x),u.darkColor.set(y,w,E,1);else{d=u.color,f=u.darkColor;h==e.setup&&(d.setFromColor(u.data.color),f.setFromColor(u.data.darkColor)),d.add((g-d.r)*o,(m-d.g)*o,(M-d.b)*o,(x-d.a)*o),f.add((y-f.r)*o,(w-f.g)*o,(E-f.b)*o,0)}}}},a.ENTRIES=8,a.PREV_TIME=-8,a.PREV_R=-7,a.PREV_G=-6,a.PREV_B=-5,a.PREV_A=-4,a.PREV_R2=-3,a.PREV_G2=-2,a.PREV_B2=-1,a.R=1,a.G=2,a.B=3,a.A=4,a.R2=5,a.G2=6,a.B2=7,a}(a);t.TwoColorTimeline=d;var f=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return r.prototype.getPropertyId=function(){return(n.attachment<<24)+this.slotIndex},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},r.prototype.apply=function(t,n,r,a,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active)if(l!=i.mixOut){var c=this.frames;if(r=c[c.length-1]?c.length-1:s.binarySearch(c,r,1)-1;var f=this.attachmentNames[d];t.slots[this.slotIndex].setAttachment(null==f?null:t.getAttachment(this.slotIndex,f))}}else h==e.setup&&this.setAttachment(t,u,u.data.attachmentName)},r.prototype.setAttachment=function(t,e,i){e.setAttachment(null==i?null:t.getAttachment(this.slotIndex,i))},r}();t.AttachmentTimeline=f;var p=null,v=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e),n.frameVertices=new Array(e),null==p&&(p=t.Utils.newFloatArray(64)),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.deform<<27)+ +this.attachment.id+this.slotIndex},a.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.frameVertices[t]=i},a.prototype.apply=function(i,n,r,a,o,h,l){var u=i.slots[this.slotIndex];if(u.bone.active){var c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.deformAttachment==this.attachment){var d=u.deform;0==d.length&&(h=e.setup);var f=this.frameVertices,p=f[0].length,v=this.frames;if(r=v[v.length-1]){var w=f[v.length-1];if(1==o)if(h==e.add)if(null==(g=c).bones){M=g.vertices;for(var E=0;Ei)this.apply(t,e,Number.MAX_VALUE,n,r,a,o),e=-1;else if(e>=h[l-1])return;if(!(i0&&h[u-1]==c;)u--;for(;u=h[u];u++)n.push(this.events[u])}}},e}();t.EventTimeline=g;var m=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return r.prototype.getPropertyId=function(){return n.drawOrder<<24},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.drawOrders[t]=i},r.prototype.apply=function(n,r,a,o,h,l,u){var c=n.drawOrder,d=n.slots;if(u!=i.mixOut){var f=this.frames;if(a=f[f.length-1]?f.length-1:s.binarySearch(f,a)-1;var v=this.drawOrders[p];if(null==v)t.Utils.arrayCopy(d,0,c,0,d.length);else for(var g=0,m=v.length;g=c[c.length-o.ENTRIES])l==e.setup?(d.mix=d.data.mix+(c[c.length+o.PREV_MIX]-d.data.mix)*h,d.softness=d.data.softness+(c[c.length+o.PREV_SOFTNESS]-d.data.softness)*h,u==i.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],d.compress=0!=c[c.length+o.PREV_COMPRESS],d.stretch=0!=c[c.length+o.PREV_STRETCH])):(d.mix+=(c[c.length+o.PREV_MIX]-d.mix)*h,d.softness+=(c[c.length+o.PREV_SOFTNESS]-d.softness)*h,u==i.mixIn&&(d.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],d.compress=0!=c[c.length+o.PREV_COMPRESS],d.stretch=0!=c[c.length+o.PREV_STRETCH]));else{var f=s.binarySearch(c,r,o.ENTRIES),p=c[f+o.PREV_MIX],v=c[f+o.PREV_SOFTNESS],g=c[f],m=this.getCurvePercent(f/o.ENTRIES-1,1-(r-g)/(c[f+o.PREV_TIME]-g));l==e.setup?(d.mix=d.data.mix+(p+(c[f+o.MIX]-p)*m-d.data.mix)*h,d.softness=d.data.softness+(v+(c[f+o.SOFTNESS]-v)*m-d.data.softness)*h,u==i.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=c[f+o.PREV_BEND_DIRECTION],d.compress=0!=c[f+o.PREV_COMPRESS],d.stretch=0!=c[f+o.PREV_STRETCH])):(d.mix+=(p+(c[f+o.MIX]-p)*m-d.mix)*h,d.softness+=(v+(c[f+o.SOFTNESS]-v)*m-d.softness)*h,u==i.mixIn&&(d.bendDirection=c[f+o.PREV_BEND_DIRECTION],d.compress=0!=c[f+o.PREV_COMPRESS],d.stretch=0!=c[f+o.PREV_STRETCH]))}},o.ENTRIES=6,o.PREV_TIME=-6,o.PREV_MIX=-5,o.PREV_SOFTNESS=-4,o.PREV_BEND_DIRECTION=-3,o.PREV_COMPRESS=-2,o.PREV_STRETCH=-1,o.MIX=1,o.SOFTNESS=2,o.BEND_DIRECTION=3,o.COMPRESS=4,o.STRETCH=5,o}(a);t.IkConstraintTimeline=M;var x=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.transformConstraint<<24)+this.transformConstraintIndex},a.prototype.setFrame=function(t,e,i,n,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=i,this.frames[t+a.TRANSLATE]=n,this.frames[t+a.SCALE]=r,this.frames[t+a.SHEAR]=s},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES]){var m=u.length;f=u[m+a.PREV_ROTATE],p=u[m+a.PREV_TRANSLATE],v=u[m+a.PREV_SCALE],g=u[m+a.PREV_SHEAR]}else{var M=s.binarySearch(u,n,a.ENTRIES);f=u[M+a.PREV_ROTATE],p=u[M+a.PREV_TRANSLATE],v=u[M+a.PREV_SCALE],g=u[M+a.PREV_SHEAR];var x=u[M],y=this.getCurvePercent(M/a.ENTRIES-1,1-(n-x)/(u[M+a.PREV_TIME]-x));f+=(u[M+a.ROTATE]-f)*y,p+=(u[M+a.TRANSLATE]-p)*y,v+=(u[M+a.SCALE]-v)*y,g+=(u[M+a.SHEAR]-g)*y}if(h==e.setup){d=c.data;c.rotateMix=d.rotateMix+(f-d.rotateMix)*o,c.translateMix=d.translateMix+(p-d.translateMix)*o,c.scaleMix=d.scaleMix+(v-d.scaleMix)*o,c.shearMix=d.shearMix+(g-d.shearMix)*o}else c.rotateMix+=(f-c.rotateMix)*o,c.translateMix+=(p-c.translateMix)*o,c.scaleMix+=(v-c.scaleMix)*o,c.shearMix+=(g-c.shearMix)*o}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_ROTATE=-4,a.PREV_TRANSLATE=-3,a.PREV_SCALE=-2,a.PREV_SHEAR=-1,a.ROTATE=1,a.TRANSLATE=2,a.SCALE=3,a.SHEAR=4,a}(a);t.TransformConstraintTimeline=x;var y=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.pathConstraintPosition<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,i){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.VALUE]=i},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_VALUE];else{var f=s.binarySearch(u,n,a.ENTRIES);d=u[f+a.PREV_VALUE];var p=u[f],v=this.getCurvePercent(f/a.ENTRIES-1,1-(n-p)/(u[f+a.PREV_TIME]-p));d+=(u[f+a.VALUE]-d)*v}h==e.setup?c.position=c.data.position+(d-c.data.position)*o:c.position+=(d-c.position)*o}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_VALUE=-1,a.VALUE=1,a}(a);t.PathConstraintPositionTimeline=y;var w=function(t){function i(e){return t.call(this,e)||this}return r(i,t),i.prototype.getPropertyId=function(){return(n.pathConstraintSpacing<<24)+this.pathConstraintIndex},i.prototype.apply=function(t,n,r,a,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(r=u[u.length-i.ENTRIES])d=u[u.length+i.PREV_VALUE];else{var f=s.binarySearch(u,r,i.ENTRIES);d=u[f+i.PREV_VALUE];var p=u[f],v=this.getCurvePercent(f/i.ENTRIES-1,1-(r-p)/(u[f+i.PREV_TIME]-p));d+=(u[f+i.VALUE]-d)*v}h==e.setup?c.spacing=c.data.spacing+(d-c.data.spacing)*o:c.spacing+=(d-c.spacing)*o}},i}(y);t.PathConstraintSpacingTimeline=w;var E=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.pathConstraintMix<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,i,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=i,this.frames[t+a.TRANSLATE]=n},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_ROTATE],f=u[u.length+a.PREV_TRANSLATE];else{var p=s.binarySearch(u,n,a.ENTRIES);d=u[p+a.PREV_ROTATE],f=u[p+a.PREV_TRANSLATE];var v=u[p],g=this.getCurvePercent(p/a.ENTRIES-1,1-(n-v)/(u[p+a.PREV_TIME]-v));d+=(u[p+a.ROTATE]-d)*g,f+=(u[p+a.TRANSLATE]-f)*g}h==e.setup?(c.rotateMix=c.data.rotateMix+(d-c.data.rotateMix)*o,c.translateMix=c.data.translateMix+(f-c.data.translateMix)*o):(c.rotateMix+=(d-c.rotateMix)*o,c.translateMix+=(f-c.translateMix)*o)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_ROTATE=-2,a.PREV_TRANSLATE=-1,a.ROTATE=1,a.TRANSLATE=2,a}(a);t.PathConstraintMixTimeline=E}(n||(n={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.trackEntryPool=new t.Pool((function(){return new i})),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,i=0,n=e.length;i0){if(r.delay-=s,r.delay>0)continue;s=-r.delay,r.delay=0}var a=r.next;if(null!=a){var o=r.trackLast-a.delay;if(o>=0){for(a.delay=0,a.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*a.timeScale,r.trackTime+=s,this.setCurrent(i,a,!0);null!=a.mixingFrom;)a.mixTime+=t,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&null==r.mixingFrom){e[i]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,null!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=s}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var i=t.mixingFrom;if(null==i)return!0;var n=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,null!=i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(i){if(null==i)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var n=this.events,r=this.tracks,s=!1,a=0,o=r.length;a0)){s=!0;var l=0==a?t.MixBlend.first:h.mixBlend,u=h.alpha;null!=h.mixingFrom?u*=this.applyMixingFrom(h,i,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,d=h.getAnimationTime(),f=h.animation.timelines.length,p=h.animation.timelines;if(0==a&&1==u||l==t.MixBlend.add)for(var v=0;v1&&(a=1),r!=t.MixBlend.first&&(r=s.mixBlend));var o=a0&&this.queueEvents(s,c),this.events.length=0,s.nextAnimationLast=c,s.nextTrackLast=s.trackTime,a},e.prototype.applyAttachmentTimeline=function(i,n,r,s,a){var o=n.slots[i.slotIndex];if(o.bone.active){var h,l=i.frames;if(r=l[l.length-1]?l.length-1:t.Animation.binarySearch(l,r)-1,this.setAttachment(n,o,i.attachmentNames[h],a);o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+e.SETUP)}},e.prototype.setAttachment=function(t,i,n,r){i.setAttachment(null==n?null:t.getAttachment(i.data.index,n)),r&&(i.attachmentState=this.unkeyedState+e.CURRENT)},e.prototype.applyRotateTimeline=function(e,i,n,r,s,a,o,h){if(h&&(a[o]=0),1!=r){var l=e,u=l.frames,c=i.bones[l.boneIndex];if(c.active){var d=0,f=0;if(n=u[u.length-t.RotateTimeline.ENTRIES])f=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(u,n,t.RotateTimeline.ENTRIES),v=u[p+t.RotateTimeline.PREV_ROTATION],g=u[p],m=l.getCurvePercent((p>>1)-1,1-(n-g)/(u[p+t.RotateTimeline.PREV_TIME]-g));f=u[p+t.RotateTimeline.ROTATION]-v,f=v+(f-=360*(16384-(16384.499999999996-f/360|0)))*m+c.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0))}var M=0,x=f-d;if(0==(x-=360*(16384-(16384.499999999996-x/360|0))))M=a[o];else{var y=0,w=0;h?(y=0,w=x):(y=a[o],w=a[o+1]);var E=x>0,b=y>=0;t.MathUtils.signum(w)!=t.MathUtils.signum(x)&&Math.abs(w)<=90&&(Math.abs(y)>180&&(y+=360*t.MathUtils.signum(y)),b=E),M=x+y-y%360,b!=E&&(M+=360*t.MathUtils.signum(y)),a[o]=M}a[o+1]=x,d+=M*r,c.rotation=d-360*(16384-(16384.499999999996-d/360|0))}}else e.apply(i,0,n,null,1,s,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var i=t.animationStart,n=t.animationEnd,r=n-i,s=t.trackLast%r,a=this.events,o=0,h=a.length;on||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:e>=n&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var i=e;;){var n=i.mixingFrom;if(null==n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,i){var n=this.expandToIndex(t);this.tracks[t]=e,null!=n&&(i&&this.queue.interrupt(n),e.mixingFrom=n,n.mixingTo=e,e.mixTime=0,null!=n.mixingFrom&&n.mixDuration>0&&(e.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,i){var n=this.data.skeletonData.findAnimation(e);if(null==n)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,n,i)},e.prototype.setAnimationWith=function(t,e,i){if(null==e)throw new Error("animation cannot be null.");var n=!0,r=this.expandToIndex(t);null!=r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.disposeNext(r),r=r.mixingFrom,n=!1):this.disposeNext(r));var s=this.trackEntry(t,e,i,r);return this.setCurrent(t,s,n),this.queue.drain(),s},e.prototype.addAnimation=function(t,e,i,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,i,n)},e.prototype.addAnimationWith=function(t,e,i,n){if(null==e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(null!=r)for(;null!=r.next;)r=r.next;var s=this.trackEntry(t,e,i,r);if(null==r)this.setCurrent(t,s,!0),this.queue.drain();else if(r.next=s,n<=0){var a=r.animationEnd-r.animationStart;0!=a?(r.loop?n+=a*(1+(r.trackTime/a|0)):n+=Math.max(a,r.trackTime),n-=this.data.getMix(r.animation,e)):n=r.trackTime}return s.delay=n,s},e.prototype.setEmptyAnimation=function(t,i){var n=this.setAnimationWith(t,e.emptyAnimation,!1);return n.mixDuration=i,n.trackEnd=i,n},e.prototype.addEmptyAnimation=function(t,i,n){n<=0&&(n-=i);var r=this.addAnimationWith(t,e.emptyAnimation,!1,n);return r.mixDuration=i,r.trackEnd=i,r},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var i=0,n=this.tracks.length;i0){a[l]=e.HOLD_MIX,o[l]=d;continue t}break}a[l]=e.HOLD_FIRST}else a[l]=e.SUBSEQUENT}},e.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.emptyAnimation=new t.Animation("",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.HOLD_SUBSEQUENT=2,e.HOLD_FIRST=3,e.HOLD_MIX=4,e.SETUP=1,e.CURRENT=2,e}();t.AnimationState=e;var i=function(){function e(){this.mixBlend=t.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return e.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},e.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},e.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},e}();t.TrackEntry=i;var n,r=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(n.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(n.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(n.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(n.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(n.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(n.event),this.objects.push(t),this.objects.push(e)},t.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,i=0;i=0?e.substring(0,e.lastIndexOf("/")):"";e=this.pathPrefix+e,this.toLoad++,this.downloadText(e,(function(a){var o={count:0},h=new Array;try{new t.TextureAtlas(a,(function(e){h.push(""==s?e:s+"/"+e);var i=document.createElement("img");return i.width=16,i.height=16,new t.FakeTexture(i)}))}catch(t){var l=t;return r.errors[e]="Couldn't load texture atlas ".concat(e,": ").concat(l.message),n&&n(e,"Couldn't load texture atlas ".concat(e,": ").concat(l.message)),r.toLoad--,void r.loaded++}for(var u=function(l){var u=!1;r.loadTexture(l,(function(l,c){if(o.count++,o.count==h.length)if(u)r.errors[e]="Couldn't load texture atlas page ".concat(l,"} of atlas ").concat(e),n&&n(e,"Couldn't load texture atlas page ".concat(l," of atlas ").concat(e)),r.toLoad--,r.loaded++;else try{var d=new t.TextureAtlas(a,(function(t){return r.get(""==s?t:s+"/"+t)}));r.assets[e]=d,i&&i(e,d),r.toLoad--,r.loaded++}catch(t){var f=t;r.errors[e]="Couldn't load texture atlas ".concat(e,": ").concat(f.message),n&&n(e,"Couldn't load texture atlas ".concat(e,": ").concat(f.message)),r.toLoad--,r.loaded++}}),(function(t,i){u=!0,o.count++,o.count==h.length&&(r.errors[e]="Couldn't load texture atlas page ".concat(t,"} of atlas ").concat(e),n&&n(e,"Couldn't load texture atlas page ".concat(t," of atlas ").concat(e)),r.toLoad--,r.loaded++)}))},c=0,d=h;c0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(n||(n={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in atlas: "+n+" (region attachment: "+i+")");r.renderObject=r;var s=new t.RegionAttachment(i);return s.setRegion(r),s},e.prototype.newMeshAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in atlas: "+n+" (mesh attachment: "+i+")");r.renderObject=r;var s=new t.MeshAttachment(i);return s.region=r,s},e.prototype.newBoundingBoxAttachment=function(e,i){return new t.BoundingBoxAttachment(i)},e.prototype.newPathAttachment=function(e,i){return new t.PathAttachment(i)},e.prototype.newPointAttachment=function(e,i){return new t.PointAttachment(i)},e.prototype.newClippingAttachment=function(e,i){return new t.ClippingAttachment(i)},e}();t.AtlasAttachmentLoader=e}(n||(n={})),function(t){!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(t.BlendMode||(t.BlendMode={}))}(n||(n={})),function(t){var e=function(){function e(t,e,i){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}return e.prototype.isActive=function(){return this.active},e.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,i,n,r,s,a,o){this.ax=e,this.ay=i,this.arotation=n,this.ascaleX=r,this.ascaleY=s,this.ashearX=a,this.ashearY=o,this.appliedValid=!0;var h=this.parent;if(null==h){var l=this.skeleton,u=n+90+o,c=l.scaleX,d=l.scaleY;return this.a=t.MathUtils.cosDeg(n+a)*r*c,this.b=t.MathUtils.cosDeg(u)*s*c,this.c=t.MathUtils.sinDeg(n+a)*r*d,this.d=t.MathUtils.sinDeg(u)*s*d,this.worldX=e*c+l.x,void(this.worldY=i*d+l.y)}var f=h.a,p=h.b,v=h.c,g=h.d;switch(this.worldX=f*e+p*i+h.worldX,this.worldY=v*e+g*i+h.worldY,this.data.transformMode){case t.TransformMode.Normal:u=n+90+o;var m=t.MathUtils.cosDeg(n+a)*r,M=t.MathUtils.cosDeg(u)*s,x=t.MathUtils.sinDeg(n+a)*r,y=t.MathUtils.sinDeg(u)*s;return this.a=f*m+p*x,this.b=f*M+p*y,this.c=v*m+g*x,void(this.d=v*M+g*y);case t.TransformMode.OnlyTranslation:u=n+90+o;this.a=t.MathUtils.cosDeg(n+a)*r,this.b=t.MathUtils.cosDeg(u)*s,this.c=t.MathUtils.sinDeg(n+a)*r,this.d=t.MathUtils.sinDeg(u)*s;break;case t.TransformMode.NoRotationOrReflection:var w=0;(T=f*f+v*v)>1e-4?(T=Math.abs(f*g-p*v)/T,f/=this.skeleton.scaleX,p=(v/=this.skeleton.scaleY)*T,g=f*T,w=Math.atan2(v,f)*t.MathUtils.radDeg):(f=0,v=0,w=90-Math.atan2(g,p)*t.MathUtils.radDeg);var E=n+a-w,b=n+o-w+90;m=t.MathUtils.cosDeg(E)*r,M=t.MathUtils.cosDeg(b)*s,x=t.MathUtils.sinDeg(E)*r,y=t.MathUtils.sinDeg(b)*s;this.a=f*m-p*x,this.b=f*M-p*y,this.c=v*m+g*x,this.d=v*M+g*y;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var T,A=t.MathUtils.cosDeg(n),R=t.MathUtils.sinDeg(n),S=(f*A+p*R)/this.skeleton.scaleX,C=(v*A+g*R)/this.skeleton.scaleY;(T=Math.sqrt(S*S+C*C))>1e-5&&(T=1/T),S*=T,C*=T,T=Math.sqrt(S*S+C*C),this.data.transformMode==t.TransformMode.NoScale&&f*g-p*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(T=-T);var I=Math.PI/2+Math.atan2(C,S),P=Math.cos(I)*T,L=Math.sin(I)*T;m=t.MathUtils.cosDeg(a)*r,M=t.MathUtils.cosDeg(90+o)*s,x=t.MathUtils.sinDeg(a)*r,y=t.MathUtils.sinDeg(90+o)*s;this.a=S*m+P*x,this.b=S*M+P*y,this.c=C*m+L*x,this.d=C*M+L*y}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},e.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*t.MathUtils.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*t.MathUtils.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var e=this.parent;if(null==e)return this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);var i=e.a,n=e.b,r=e.c,s=e.d,a=1/(i*s-n*r),o=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=o*s*a-h*n*a,this.ay=h*i*a-o*r*a;var l=a*s,u=a*i,c=a*n,d=a*r,f=l*this.a-c*this.c,p=l*this.b-c*this.d,v=u*this.c-d*this.a,g=u*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var m=f*g-p*v;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(f*p+v*g,m)*t.MathUtils.radDeg,this.arotation=Math.atan2(v,f)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,i=this.b,n=this.c,r=this.d,s=1/(e*r-i*n),a=t.x-this.worldX,o=t.y-this.worldY;return t.x=a*r*s-o*i*s,t.y=o*e*s-a*n*s,t},e.prototype.localToWorld=function(t){var e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t},e.prototype.worldToLocalRotation=function(e){var i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return Math.atan2(this.a*i-this.c*n,this.d*n-this.b*i)*t.MathUtils.radDeg+this.rotation-this.shearX},e.prototype.localToWorldRotation=function(e){e-=this.rotation-this.shearX;var i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return Math.atan2(n*this.c+i*this.d,n*this.a+i*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var i=this.a,n=this.b,r=this.c,s=this.d,a=t.MathUtils.cosDeg(e),o=t.MathUtils.sinDeg(e);this.a=a*i-o*r,this.b=a*n-o*s,this.c=o*i+a*r,this.d=o*n+a*s,this.appliedValid=!1},e}();t.Bone=e}(n||(n={})),function(t){var e,i=function(i,n,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=e.Normal,this.skinRequired=!1,this.color=new t.Color,i<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");this.index=i,this.name=n,this.parent=r};t.BoneData=i,function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(e=t.TransformMode||(t.TransformMode={}))}(n||(n={})),function(t){var e=function(t,e,i){this.name=t,this.order=e,this.skinRequired=i};t.ConstraintData=e}(n||(n={})),function(t){var e=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e};t.Event=e}(n||(n={})),function(t){var e=function(t){this.name=t};t.EventData=e}(n||(n={})),function(t){var e=function(){function e(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var i=0;i180?f-=360:f<-180&&(f+=360);var E=e.ascaleX,b=e.ascaleY;if(r||s){switch(e.data.transformMode){case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:p=i-e.worldX,v=n-e.worldY}var T=e.data.length*E,A=Math.sqrt(p*p+v*v);if(r&&AT&&T>1e-4)E*=g=(A/T-1)*o+1,a&&(b*=g)}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*o,E,b,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,i,n,r,s,a,o,h){if(0!=h){e.appliedValid||e.updateAppliedTransform(),i.appliedValid||i.updateAppliedTransform();var l=e.ax,u=e.ay,c=e.ascaleX,d=c,f=e.ascaleY,p=i.ascaleX,v=0,g=0,m=0;c<0?(c=-c,v=180,m=-1):(v=0,m=1),f<0&&(f=-f,m=-m),p<0?(p=-p,g=180):g=0;var M=i.ax,x=0,y=0,w=0,E=e.a,b=e.b,T=e.c,A=e.d,R=Math.abs(c-f)<=1e-4;R?(y=E*M+b*(x=i.ay)+e.worldX,w=T*M+A*x+e.worldY):(x=0,y=E*M+e.worldX,w=T*M+e.worldY);var S=e.parent;E=S.a,b=S.b,T=S.c;var C,I,P=1/(E*(A=S.d)-b*T),L=y-S.worldX,O=w-S.worldY,_=(L*A-O*b)*P-l,k=(O*E-L*T)*P-u,F=Math.sqrt(_*_+k*k),V=i.data.length*p;if(F<1e-4)return this.apply1(e,n,r,!1,a,!1,h),void i.updateWorldTransformWith(M,x,0,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY);var D=((L=n-S.worldX)*A-(O=r-S.worldY)*b)*P-l,N=(O*E-L*T)*P-u,B=D*D+N*N;if(0!=o){o*=c*(p+1)/2;var X=Math.sqrt(B),Y=X-F-V*c+o;if(Y>0){var U=Math.min(1,Y/(2*o))-1;B=(D-=(U=(Y-o*(1-U*U))/X)*D)*D+(N-=U*N)*N}}t:if(R){var z=(B-F*F-(V*=c)*V)/(2*F*V);z<-1?z=-1:z>1&&(z=1,a&&(d*=(Math.sqrt(B)/(F+V)-1)*h+1)),I=Math.acos(z)*s,E=F+V*z,b=V*Math.sin(I),C=Math.atan2(N*E-D*b,D*E+N*b)}else{var W=(E=c*V)*E,G=(b=f*V)*b,H=Math.atan2(N,D),q=-2*G*F,j=G-W;if((A=q*q-4*j*(T=G*F*F+W*B-W*G))>=0){var Z=Math.sqrt(A);q<0&&(Z=-Z);var K=(Z=-(q+Z)/2)/j,Q=T/Z,$=Math.abs(K)=-1&&T<=1&&(T=Math.acos(T),(A=(L=E*Math.cos(T)+F)*L+(O=b*Math.sin(T))*O)st&&(nt=T,st=A,rt=L,at=O)),B<=(et+st)/2?(C=H-Math.atan2(it*s,tt),I=J*s):(C=H-Math.atan2(at*s,rt),I=nt*s)}var ot=Math.atan2(x,M)*m,ht=e.arotation;(C=(C-ot)*t.MathUtils.radDeg+v-ht)>180?C-=360:C<-180&&(C+=360),e.updateWorldTransformWith(l,u,ht+C*h,d,e.ascaleY,0,0),ht=i.arotation,(I=((I+ot)*t.MathUtils.radDeg-i.ashearX)*m+g-ht)>180?I-=360:I<-180&&(I+=360),i.updateWorldTransformWith(M,x,ht+I*h,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY)}else i.updateWorldTransform()},e}();t.IkConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i.bendDirection=1,i.compress=!1,i.stretch=!1,i.uniform=!1,i.mix=1,i.softness=0,i}return r(e,t),e}(t.ConstraintData);t.IkConstraintData=e}(n||(n={})),function(t){var e=function(){function e(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var i=0,n=t.bones.length;i0;if(r>0||s){var a=this.data,o=a.spacingMode==t.SpacingMode.Percent,h=a.rotateMode,l=h==t.RotateMode.Tangent,u=h==t.RotateMode.ChainScale,c=this.bones.length,d=l?c:c+1,f=this.bones,p=t.Utils.setArraySize(this.spaces,d),v=null,g=this.spacing;if(u||!o){u&&(v=t.Utils.setArraySize(this.lengths,c));for(var m=a.spacingMode==t.SpacingMode.Length,M=0,x=d-1;M0?t.MathUtils.degRad:-t.MathUtils.degRad;M=0;for(var P=3;Mt.MathUtils.PI?X-=t.MathUtils.PI2:X<-t.MathUtils.PI&&(X+=t.MathUtils.PI2),X*=n,Y=Math.cos(X),U=Math.sin(X),L.a=Y*V-U*N,L.b=Y*D-U*B,L.c=U*V+Y*N,L.d=U*D+Y*B}L.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(i,n,r,s,a){var o=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*n+2),c=null,d=i.closed,f=i.worldVerticesLength,p=f/6,v=e.NONE;if(!i.constantSpeed){var g=i.lengths,m=g[p-=d?1:2];if(s&&(h*=m),a)for(var M=1;Mm){v!=e.AFTER&&(v=e.AFTER,i.computeWorldVertices(o,f-6,4,c,0,2)),this.addAfterPosition(w-m,c,0,u,x);continue}}for(;;y++){var E=g[y];if(!(w>E)){if(0==y)w/=E;else w=(w-(Z=g[y-1]))/(E-Z);break}}y!=v&&(v=y,d&&y==p?(i.computeWorldVertices(o,f-4,4,c,0,2),i.computeWorldVertices(o,0,4,c,4,2)):i.computeWorldVertices(o,6*y+2,8,c,0,2)),this.addCurvePosition(w,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,x,r||M>0&&0==G)}return u}d?(f+=2,c=t.Utils.setArraySize(this.world,f),i.computeWorldVertices(o,2,f-4,c,0,2),i.computeWorldVertices(o,0,2,c,f-4,2),c[f-2]=c[0],c[f-1]=c[1]):(p--,f-=4,c=t.Utils.setArraySize(this.world,f),i.computeWorldVertices(o,2,f,c,0,2));for(var b=t.Utils.setArraySize(this.curves,p),T=0,A=c[0],R=c[1],S=0,C=0,I=0,P=0,L=0,O=0,_=0,k=0,F=0,V=0,D=0,N=0,B=0,X=0,Y=(M=0,2);MT){this.addAfterPosition(w-T,c,f-4,u,x);continue}}for(;;y++){var H=b[y];if(!(w>H)){if(0==y)w/=H;else w=(w-(Z=b[y-1]))/(H-Z);break}}if(y!=v){v=y;var q=6*y;for(A=c[q],R=c[q+1],S=c[q+2],C=c[q+3],I=c[q+4],P=c[q+5],D=2*(_=.03*(A-2*S+I))+(F=.006*(3*(S-I)-A+(L=c[q+6]))),N=2*(k=.03*(R-2*C+P))+(V=.006*(3*(C-P)-R+(O=c[q+7]))),B=.3*(S-A)+_+.16666667*F,X=.3*(C-R)+k+.16666667*V,z=Math.sqrt(B*B+X*X),U[0]=z,q=1;q<8;q++)B+=D,X+=N,D+=F,N+=V,z+=Math.sqrt(B*B+X*X),U[q]=z;B+=D,X+=N,z+=Math.sqrt(B*B+X*X),U[8]=z,B+=D+F,X+=N+V,z+=Math.sqrt(B*B+X*X),U[9]=z,W=0}for(w*=z;;W++){var j=U[W];if(!(w>j)){var Z;if(0==W)w/=j;else w=W+(w-(Z=U[W-1]))/(j-Z);break}}this.addCurvePosition(.1*w,A,R,S,C,I,P,L,O,u,x,r||M>0&&0==G)}return u},e.prototype.addBeforePosition=function(t,e,i,n,r){var s=e[i],a=e[i+1],o=e[i+2]-s,h=e[i+3]-a,l=Math.atan2(h,o);n[r]=s+t*Math.cos(l),n[r+1]=a+t*Math.sin(l),n[r+2]=l},e.prototype.addAfterPosition=function(t,e,i,n,r){var s=e[i+2],a=e[i+3],o=s-e[i],h=a-e[i+1],l=Math.atan2(h,o);n[r]=s+t*Math.cos(l),n[r+1]=a+t*Math.sin(l),n[r+2]=l},e.prototype.addCurvePosition=function(t,e,i,n,r,s,a,o,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=i,void(l[u+2]=Math.atan2(r-i,n-e));var d=t*t,f=d*t,p=1-t,v=p*p,g=v*p,m=p*t,M=3*m,x=p*M,y=M*t,w=e*g+n*x+s*y+o*f,E=i*g+r*x+a*y+h*f;l[u]=w,l[u+1]=E,c&&(l[u+2]=t<.001?Math.atan2(r-i,n-e):Math.atan2(E-(i*v+r*m*2+a*d),w-(e*v+n*m*2+s*d)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i}return r(e,t),e}(t.ConstraintData);t.PathConstraintData=e,function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(t.PositionMode||(t.PositionMode={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent"}(t.SpacingMode||(t.SpacingMode={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(t.RotateMode||(t.RotateMode={}))}(n||(n={})),function(t){var e=function(){function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t}(),i=function(){function t(t){void 0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}return t.prototype.queueAsset=function(t,i,n){var r=this.clientAssets[t];return null==r&&(r=new e(t),this.clientAssets[t]=r),null!==i&&(r.textureLoader=i),r.toLoad.push(n),this.queuedAssets[n]!==n&&(this.queuedAssets[n]=n,!0)},t.prototype.loadText=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.overrideMimeType("text/html"),n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=n.responseText:i.errors[e]="Couldn't load text ".concat(e,": status ").concat(n.status,", ").concat(n.responseText))},n.open("GET",e,!0),n.send()}},t.prototype.loadJson=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.overrideMimeType("text/html"),n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=JSON.parse(n.responseText):i.errors[e]="Couldn't load text ".concat(e,": status ").concat(n.status,", ").concat(n.responseText))},n.open("GET",e,!0),n.send()}},t.prototype.loadTexture=function(t,e,i){var n=this;if(i=this.pathPrefix+i,this.queueAsset(t,e,i))if(!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts){fetch(i,{mode:"cors"}).then((function(t){return t.ok||(n.errors[i]="Couldn't load image "+i),t.blob()})).then((function(t){return createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"})})).then((function(t){n.rawAssets[i]=t}))}else{var r=new Image;r.crossOrigin="anonymous",r.onload=function(t){n.rawAssets[i]=r},r.onerror=function(t){n.errors[i]="Couldn't load image ".concat(i)},r.src=i}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var i=this.clientAssets[t];return null==i||i.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts,i=0;i0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=i}(n||(n={})),function(t){var e=function(){function e(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(var i=0;i1){var s=n[n.length-1];this._updateCache.indexOf(s)>-1||this.updateCacheReset.push(s)}this._updateCache.push(e),this.sortReset(r.children),n[n.length-1].sorted=!0}},e.prototype.sortPathConstraint=function(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active){var i=e.target,n=i.data.index,r=i.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,n,r),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,r);for(var s=0,a=this.data.skins.length;s-1||this.updateCacheReset.push(s)}else for(r=0;r0){y=new t.DrawOrderTimeline(V);var D=r.slots.length;for(u=0;u=0;f--)B[f]=-1;var X=t.Utils.newArray(D-N,0),Y=0,U=0;for(f=0;f=0;f--)-1==B[f]&&(B[f]=X[--U]);y.setFrame(u,M,B)}s.push(y),o=Math.max(o,y.frames[V-1])}var z=i.readInt(!0);if(z>0){for(y=new t.EventTimeline(z),u=0;u>>1^-(1&i)},t.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},t.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(n),i++}}return e},t.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},t.prototype.readBoolean=function(){return 0!=this.readByte()},t}(),n=function(t,e,i,n,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=n,this.inheritDeform=r},r=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(n||(n={})),function(t){var e=function(){function e(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new t.Pool((function(){return t.Utils.newFloatArray(16)}))}return e.prototype.update=function(e,i){if(null==e)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,r=this.polygons,s=this.polygonPool,a=e.slots,o=a.length;n.length=0,s.freeAll(r),r.length=0;for(var h=0;h=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,i,n){var r=this.minX,s=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&i<=r||e<=s&&n<=s||t>=a&&i>=a||e>=o&&n>=o)return!1;var h=(n-e)/(i-t),l=h*(r-t)+e;if(l>s&&ls&&lr&&ur&&ut.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var i=this.polygons,n=0,r=i.length;n=i||l=i){var u=n[o];u+(i-h)/(l-h)*(n[s]-u)=u&&x<=f||x>=f&&x<=u)&&(x>=e&&x<=n||x>=n&&x<=e)){var y=(l*m-h*v)/M;if((y>=c&&y<=p||y>=p&&y<=c)&&(y>=i&&y<=r||y>=r&&y<=i))return!0}u=f,c=p}return!1},e.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},e.prototype.getWidth=function(){return this.maxX-this.minX},e.prototype.getHeight=function(){return this.maxY-this.minY},e}();t.SkeletonBounds=e}(n||(n={})),function(t){var e=function(){function e(){this.triangulator=new t.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return e.prototype.clipStart=function(i,n){if(null!=this.clipAttachment)return 0;this.clipAttachment=n;var r=n.worldVerticesLength,s=t.Utils.setArraySize(this.clippingPolygon,r);n.computeWorldVertices(i,0,r,s,0,2);var a=this.clippingPolygon;e.makeClockwise(a);for(var o=this.clippingPolygons=this.triangulator.decompose(a,this.triangulator.triangulate(a)),h=0,l=o.length;h>1,B=this.clipOutput,X=t.Utils.setArraySize(u,L+N*p),Y=0;Y=2?(u=o,o=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(i),u.push(n),u.push(r),u.push(s),u.push(t),u.push(e),o.length=0;for(var c=a,d=a.length-4,f=0;;f+=2){for(var p=c[f],v=c[f+1],g=c[f+2],m=c[f+3],M=p-g,x=v-m,y=u,w=u.length-2,E=o.length,b=0;b0;if(M*(A-m)-x*(T-g)>0){if(C){o.push(R),o.push(S);continue}var I=(L=S-A)*(g-p)-(O=R-T)*(m-v);if(Math.abs(I)>1e-6){var P=(O*(v-A)-L*(p-T))/I;o.push(p+(g-p)*P),o.push(v+(m-v)*P)}else o.push(p),o.push(v)}else if(C){var L,O;I=(L=S-A)*(g-p)-(O=R-T)*(m-v);if(Math.abs(I)>1e-6){P=(O*(v-A)-L*(p-T))/I;o.push(p+(g-p)*P),o.push(v+(m-v)*P)}else o.push(p),o.push(v);o.push(R),o.push(S)}l=!0}if(E==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),f==d)break;var _=o;(o=u).length=0,u=_}if(h!=o){h.length=0;f=0;for(var k=o.length-2;f>1;o=0;d--)-1==G[d]&&(G[d]=q[--Z])}y.setFrame(c++,this.getValue(W,"time",0),G)}s.push(y),a=Math.max(a,y.frames[y.getFrameCount()-1])}if(e.events){for(y=new t.EventTimeline(e.events.length),c=0,d=0;d=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=i},i.prototype.addSkin=function(t){for(var e=0;e= 0.");if(null==i)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=e,this.name=i,this.boneData=n};t.SlotData=e}(n||(n={})),function(t){var e,i,n=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return e.MipMapNearestNearest;case"mipmaplinearnearest":return e.MipMapLinearNearest;case"mipmapnearestlinear":return e.MipMapNearestLinear;case"mipmaplinearlinear":return e.MipMapLinearLinear;default:throw new Error("Unknown texture filter ".concat(t))}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return i.MirroredRepeat;case"clamptoedge":return i.ClampToEdge;case"repeat":return i.Repeat;default:throw new Error("Unknown texture wrap ".concat(t))}},t}();t.Texture=n,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(e=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(i=t.TextureWrap||(t.TextureWrap={}));var s=function(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.rotate=!1,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0};t.TextureRegion=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(n);t.FakeTexture=a}(n||(n={})),function(t){var e=function(){function e(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}return e.prototype.load=function(e,r){if(null==r)throw new Error("textureLoader cannot be null.");for(var a=new i(e),o=new Array(4),h=null;;){var l=a.readLine();if(null==l)break;if(0==(l=l.trim()).length)h=null;else if(h){var u=new s;u.name=l,u.page=h;var c=a.readValue();"true"==c.toLocaleLowerCase()?u.degrees=90:"false"==c.toLocaleLowerCase()?u.degrees=0:u.degrees=parseFloat(c),u.rotate=90==u.degrees,a.readTuple(o);var d=parseInt(o[0]),f=parseInt(o[1]);a.readTuple(o);var p=parseInt(o[0]),v=parseInt(o[1]);u.u=d/h.width,u.v=f/h.height,u.rotate?(u.u2=(d+v)/h.width,u.v2=(f+p)/h.height):(u.u2=(d+p)/h.width,u.v2=(f+v)/h.height),u.x=d,u.y=f,u.width=Math.abs(p),u.height=Math.abs(v),4==a.readTuple(o)&&4==a.readTuple(o)&&a.readTuple(o),u.originalWidth=parseInt(o[0]),u.originalHeight=parseInt(o[1]),a.readTuple(o),u.offsetX=parseInt(o[0]),u.offsetY=parseInt(o[1]),u.index=parseInt(a.readValue()),u.texture=h.texture,this.regions.push(u)}else{(h=new n).name=l,2==a.readTuple(o)&&(h.width=parseInt(o[0]),h.height=parseInt(o[1]),a.readTuple(o)),a.readTuple(o),h.minFilter=t.Texture.filterFromString(o[0]),h.magFilter=t.Texture.filterFromString(o[1]);var g=a.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==g?h.uWrap=t.TextureWrap.Repeat:"y"==g?h.vWrap=t.TextureWrap.Repeat:"xy"==g&&(h.uWrap=h.vWrap=t.TextureWrap.Repeat),h.texture=r(l),h.texture.setFilters(h.minFilter,h.magFilter),h.texture.setWraps(h.uWrap,h.vWrap),h.width=h.texture.getImage().width,h.height=h.texture.getImage().height,this.pages.push(h)}}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw new Error("Invalid line: "+e);for(var n=0,r=i+1;n<3;n++){var s=e.indexOf(",",r);if(-1==s)break;t[n]=e.substr(r,s-r).trim(),r=s+1}return t[n]=e.substring(r).trim(),n+1},t}(),n=function(){};t.TextureAtlasPage=n;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=s}(n||(n={})),function(t){var e=function(){function e(e,i){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,this.active=!1,null==e)throw new Error("data cannot be null.");if(null==i)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(var n=0;n0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,d=this.data.offsetShearY*u,f=this.bones,p=0,v=f.length;pt.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2),S*=e;var E=Math.cos(S),b=Math.sin(S);g.a=E*M-b*y,g.b=E*x-b*w,g.c=b*M+E*y,g.d=b*x+E*w,m=!0}if(0!=i){var T=this.temp;s.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(T.x-g.worldX)*i,g.worldY+=(T.y-g.worldY)*i,m=!0}if(n>0){var A=Math.sqrt(g.a*g.a+g.c*g.c),R=Math.sqrt(a*a+h*h);A>1e-5&&(A=(A+(R-A+this.data.offsetScaleX)*n)/A),g.a*=A,g.c*=A,A=Math.sqrt(g.b*g.b+g.d*g.d),R=Math.sqrt(o*o+l*l),A>1e-5&&(A=(A+(R-A+this.data.offsetScaleY)*n)/A),g.b*=A,g.d*=A,m=!0}if(r>0){x=g.b,w=g.d;var S,C=Math.atan2(w,x);(S=Math.atan2(l,o)-Math.atan2(h,a)-(C-Math.atan2(g.c,g.a)))>t.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2),S=C+(S+d)*r;A=Math.sqrt(x*x+w*w);g.b=Math.cos(S)*A,g.d=Math.sin(S)*A,m=!0}m&&(g.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,i=this.translateMix,n=this.scaleMix,r=this.shearMix,s=this.target,a=s.a,o=s.b,h=s.c,l=s.d,u=a*l-o*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,d=this.data.offsetShearY*u,f=this.bones,p=0,v=f.length;pt.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R*=e;var E=Math.cos(R),b=Math.sin(R);g.a=E*M-b*y,g.b=E*x-b*w,g.c=b*M+E*y,g.d=b*x+E*w,m=!0}if(0!=i){var T=this.temp;s.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),g.worldX+=T.x*i,g.worldY+=T.y*i,m=!0}if(n>0){var A=(Math.sqrt(a*a+h*h)-1+this.data.offsetScaleX)*n+1;g.a*=A,g.c*=A,A=(Math.sqrt(o*o+l*l)-1+this.data.offsetScaleY)*n+1,g.b*=A,g.d*=A,m=!0}if(r>0){var R;(R=Math.atan2(l,o)-Math.atan2(h,a))>t.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2);x=g.b,w=g.d;R=Math.atan2(w,x)+(R-t.MathUtils.PI/2+d)*r;A=Math.sqrt(x*x+w*w);g.b=Math.cos(R)*A,g.d=Math.sin(R)*A,m=!0}m&&(g.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a1e-5&&(f=(f+(r.ascaleX-f+this.data.offsetScaleX)*i)/f),p>1e-5&&(p=(p+(r.ascaleY-p+this.data.offsetScaleY)*i)/p));var v=h.ashearY;if(0!=n){u=r.ashearY-v+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*n}h.updateWorldTransformWith(c,d,l,f,p,h.ashearX,v)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a1e-5&&(d*=(r.ascaleX-1+this.data.offsetScaleX)*i+1),f>1e-5&&(f*=(r.ascaleY-1+this.data.offsetScaleY)*i+1));var p=h.ashearY;0!=n&&(p+=(r.ashearY+this.data.offsetShearY)*n),h.updateWorldTransformWith(u,c,l,d,f,h.ashearX,p)}},e}();t.TransformConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i.rotateMix=0,i.translateMix=0,i.scaleMix=0,i.shearMix=0,i.offsetRotation=0,i.offsetX=0,i.offsetY=0,i.offsetScaleX=0,i.offsetScaleY=0,i.offsetShearY=0,i.relative=!1,i.local=!1,i}return r(e,t),e}(t.ConstraintData);t.TransformConstraintData=e}(n||(n={})),function(t){var e=function(){function e(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new t.Pool((function(){return new Array})),this.polygonIndicesPool=new t.Pool((function(){return new Array}))}return e.prototype.triangulate=function(t){var i=t,n=t.length>>1,r=this.indicesArray;r.length=0;for(var s=0;s3;){for(var l=n-1,u=(s=0,1);;){t:if(!a[s]){for(var c=r[l]<<1,d=r[s]<<1,f=r[u]<<1,p=i[c],v=i[c+1],g=i[d],m=i[d+1],M=i[f],x=i[f+1],y=(u+1)%n;y!=l;y=(y+1)%n)if(a[y]){var w=r[y]<<1,E=i[w],b=i[w+1];if(e.positiveArea(M,x,p,v,E,b)&&e.positiveArea(p,v,g,m,E,b)&&e.positiveArea(g,m,M,x,E,b))break t}break}if(0==u){do{if(!a[s])break;s--}while(s>0);break}l=s,s=u,u=(u+1)%n}h.push(r[(n+s-1)%n]),h.push(r[s]),h.push(r[(s+1)%n]),r.splice(s,1),a.splice(s,1);var T=(--n+s-1)%n,A=s==n?0:s;a[T]=e.isConcave(T,n,i,r),a[A]=e.isConcave(A,n,i,r)}return 3==n&&(h.push(r[2]),h.push(r[0]),h.push(r[1])),h},e.prototype.decompose=function(t,i){var n=t,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var s=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(s),s.length=0;var a=this.polygonIndicesPool.obtain();a.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,u=0,c=i.length;u0?(r.push(o),s.push(a)):(this.polygonPool.free(o),this.polygonIndicesPool.free(a)),(o=this.polygonPool.obtain()).length=0,o.push(v),o.push(g),o.push(m),o.push(M),o.push(x),o.push(y),(a=this.polygonIndicesPool.obtain()).length=0,a.push(d),a.push(f),a.push(p),l=e.winding(v,g,m,M,x,y),h=d)}o.length>0&&(r.push(o),s.push(a));for(u=0,c=r.length;u=0;u--)0==(o=r[u]).length&&(r.splice(u,1),this.polygonPool.free(o),a=s[u],s.splice(u,1),this.polygonIndicesPool.free(a));return r},e.isConcave=function(t,e,i,n){var r=n[(e+t-1)%e]<<1,s=n[t]<<1,a=n[(t+1)%e]<<1;return!this.positiveArea(i[r],i[r+1],i[s],i[s+1],i[a],i[a+1])},e.positiveArea=function(t,e,i,n,r,s){return t*(s-n)+i*(e-s)+r*(n-e)>=0},e.winding=function(t,e,i,n,r,s){var a=i-t,o=n-e;return r*o-s*a+a*e-t*o>=0?1:-1},e}();t.Triangulator=e}(n||(n={})),function(t){var e=function(){function t(){this.array=new Array}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return null!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t}();t.IntSet=e;var i=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.r=t,this.g=e,this.b=i,this.a=n}return t.prototype.set=function(t,e,i,n){return this.r=t,this.g=e,this.b=i,this.a=n,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,i,n){return this.r+=t,this.g+=e,this.b+=i,this.a+=n,this.clamp(),this},t.prototype.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.rgba8888ToColor=function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},t.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();t.Color=i;var n=function(){function t(){}return t.clamp=function(t,e,i){return ti?i:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,i){return t.randomTriangularWith(e,i,.5*(e+i))},t.randomTriangularWith=function(t,e,i){var n=Math.random(),r=e-t;return n<=(i-t)/r?t+Math.sqrt(n*r*(i-t)):e-Math.sqrt((1-n)*r*(e-i))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();t.MathUtils=n;var s=function(){function t(){}return t.prototype.apply=function(t,e,i){return t+(e-t)*this.applyInternal(i)},t}();t.Interpolation=s;var a=function(t){function e(e){var i=t.call(this)||this;return i.power=2,i.power=e,i}return r(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1},e}(s);t.Pow=a;var o=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(a);t.PowOut=o;var h=function(){function t(){}return t.arrayCopy=function(t,e,i,n,r){for(var s=e,a=n;s=i?e:t.setArraySize(e,i,n)},t.newArray=function(t,e){for(var i=new Array(t),n=0;n0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();t.TimeKeeper=d;var f=function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*s;var a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,d=0;d0&&(h=o);for(var y,w=(y=t.bone).worldX,E=y.worldY,b=y.a,T=y.b,A=y.c,R=y.d,S=e,C=r;Cthis.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length},e.prototype.setIndices=function(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length},e.prototype.draw=function(t,e){this.drawWithOffset(t,e,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)},e.prototype.drawWithOffset=function(t,e,i,n){var r=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?r.drawElements(e,n,r.UNSIGNED_SHORT,2*i):r.drawArrays(e,i,n),this.unbind(t)},e.prototype.bind=function(t){var e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);for(var i=0,n=0;n0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)},e.prototype.unbind=function(t){for(var e=this.context.gl,i=0;i0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)},e.prototype.update=function(){var t=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=t.createBuffer()),t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),t.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),t.DYNAMIC_DRAW),this.dirtyIndices=!1)},e.prototype.restore=function(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()},e.prototype.dispose=function(){this.context.removeRestorable(this);var t=this.context.gl;t.deleteBuffer(this.verticesBuffer),t.deleteBuffer(this.indicesBuffer)},e}();t.Mesh=e;var i=function(t,e,i){this.name=t,this.type=e,this.numElements=i};t.VertexAttribute=i;var n=function(e){function i(){return e.call(this,t.Shader.POSITION,h.Float,2)||this}return r(i,e),i}(i);t.Position2Attribute=n;var s=function(e){function i(){return e.call(this,t.Shader.POSITION,h.Float,3)||this}return r(i,e),i}(i);t.Position3Attribute=s;var a=function(e){function i(i){return void 0===i&&(i=0),e.call(this,t.Shader.TEXCOORDS+(0==i?"":i),h.Float,2)||this}return r(i,e),i}(i);t.TexCoordAttribute=a;var o=function(e){function i(){return e.call(this,t.Shader.COLOR,h.Float,4)||this}return r(i,e),i}(i);t.ColorAttribute=o;var h,l=function(e){function i(){return e.call(this,t.Shader.COLOR2,h.Float,4)||this}return r(i,e),i}(i);t.Color2Attribute=l,function(t){t[t.Float=0]="Float"}(h=t.VertexAttributeType||(t.VertexAttributeType={}))}(t.webgl||(t.webgl={}))}(n||(n={})),function(t){!function(t){var e=function(){function e(e,i,n){if(void 0===i&&(i=!0),void 0===n&&(n=10920),this.isDrawing=!1,this.shader=null,this.lastTexture=null,this.verticesLength=0,this.indicesLength=0,n>10920)throw new Error("Can't have more than 10920 triangles per batch: "+n);this.context=e instanceof t.ManagedWebGLRenderingContext?e:new t.ManagedWebGLRenderingContext(e);var r=i?[new t.Position2Attribute,new t.ColorAttribute,new t.TexCoordAttribute,new t.Color2Attribute]:[new t.Position2Attribute,new t.ColorAttribute,new t.TexCoordAttribute];this.mesh=new t.Mesh(e,r,n,3*n),this.srcBlend=this.context.gl.SRC_ALPHA,this.dstBlend=this.context.gl.ONE_MINUS_SRC_ALPHA}return e.prototype.begin=function(t){var e=this.context.gl;if(this.isDrawing)throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=t,this.lastTexture=null,this.isDrawing=!0,e.enable(e.BLEND),e.blendFunc(this.srcBlend,this.dstBlend)},e.prototype.setBlendMode=function(t,e){var i=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),i.blendFunc(this.srcBlend,this.dstBlend))},e.prototype.draw=function(t,e,i){t!=this.lastTexture?(this.flush(),this.lastTexture=t):(this.verticesLength+e.length>this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();var n=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);for(var r=this.mesh.getIndices(),s=this.indicesLength,a=0;a0||this.indicesLength>0)&&this.flush(),this.shader=null,this.lastTexture=null,this.isDrawing=!1,t.disable(t.BLEND)},e.prototype.getDrawCalls=function(){return this.drawCalls},e.prototype.dispose=function(){this.mesh.dispose()},e}();t.PolygonBatcher=e}(t.webgl||(t.webgl={}))}(n||(n={})),function(t){!function(e){var i,n=function(){function n(i,n,r){void 0===r&&(r=!0),this.twoColorTint=!1,this.activeRenderer=null,this.QUAD=[0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0],this.QUAD_TRIANGLES=[0,1,2,2,3,0],this.WHITE=new t.Color(1,1,1,1),this.canvas=i,this.context=n instanceof e.ManagedWebGLRenderingContext?n:new e.ManagedWebGLRenderingContext(n),this.twoColorTint=r,this.camera=new e.OrthoCamera(i.width,i.height),this.batcherShader=r?e.Shader.newTwoColoredTextured(this.context):e.Shader.newColoredTextured(this.context),this.batcher=new e.PolygonBatcher(this.context,r),this.shapesShader=e.Shader.newColored(this.context),this.shapes=new e.ShapeRenderer(this.context),this.skeletonRenderer=new e.SkeletonRenderer(this.context,r),this.skeletonDebugRenderer=new e.SkeletonDebugRenderer(this.context)}return n.prototype.begin=function(){this.camera.update(),this.enableRenderer(this.batcher)},n.prototype.drawSkeleton=function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=-1),void 0===n&&(n=-1),this.enableRenderer(this.batcher),this.skeletonRenderer.premultipliedAlpha=e,this.skeletonRenderer.draw(this.batcher,t,i,n)},n.prototype.drawSkeletonDebug=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=null),this.enableRenderer(this.shapes),this.skeletonDebugRenderer.premultipliedAlpha=e,this.skeletonDebugRenderer.draw(this.shapes,t,i)},n.prototype.drawTexture=function(t,e,i,n,r,s){void 0===s&&(s=null),this.enableRenderer(this.batcher),null===s&&(s=this.WHITE);var a=this.QUAD,o=0;a[o++]=e,a[o++]=i,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=0,a[o++]=1,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),a[o++]=e+n,a[o++]=i,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=1,a[o++]=1,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),a[o++]=e+n,a[o++]=i+r,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=1,a[o++]=0,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),a[o++]=e,a[o++]=i+r,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=0,a[o++]=0,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),this.batcher.draw(t,a,this.QUAD_TRIANGLES)},n.prototype.drawTextureUV=function(t,e,i,n,r,s,a,o,h,l){void 0===l&&(l=null),this.enableRenderer(this.batcher),null===l&&(l=this.WHITE);var u=this.QUAD,c=0;u[c++]=e,u[c++]=i,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=s,u[c++]=a,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e+n,u[c++]=i,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=o,u[c++]=a,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e+n,u[c++]=i+r,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=o,u[c++]=h,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e,u[c++]=i+r,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=s,u[c++]=h,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),this.batcher.draw(t,u,this.QUAD_TRIANGLES)},n.prototype.drawTextureRotated=function(e,i,n,r,s,a,o,h,l,u){void 0===l&&(l=null),void 0===u&&(u=!1),this.enableRenderer(this.batcher),null===l&&(l=this.WHITE);var c=this.QUAD,d=i+a,f=n+o,p=-a,v=-o,g=r-a,m=s-o,M=p,x=v,y=p,w=m,E=g,b=m,T=g,A=v,R=0,S=0,C=0,I=0,P=0,L=0,O=0,_=0;if(0!=h){var k=t.MathUtils.cosDeg(h),F=t.MathUtils.sinDeg(h);C=(P=k*E-F*b)+((R=k*M-F*x)-(O=k*y-F*w)),I=(L=F*E+k*b)+((S=F*M+k*x)-(_=F*y+k*w))}else R=M,S=x,O=y,_=w,P=E,L=b,C=T,I=A;R+=d,S+=f,C+=d,I+=f,P+=d,L+=f,O+=d,_+=f;var V=0;c[V++]=R,c[V++]=S,c[V++]=l.r,c[V++]=l.g,c[V++]=l.b,c[V++]=l.a,c[V++]=0,c[V++]=1,this.twoColorTint&&(c[V++]=0,c[V++]=0,c[V++]=0,c[V++]=0),c[V++]=C,c[V++]=I,c[V++]=l.r,c[V++]=l.g,c[V++]=l.b,c[V++]=l.a,c[V++]=1,c[V++]=1,this.twoColorTint&&(c[V++]=0,c[V++]=0,c[V++]=0,c[V++]=0),c[V++]=P,c[V++]=L,c[V++]=l.r,c[V++]=l.g,c[V++]=l.b,c[V++]=l.a,c[V++]=1,c[V++]=0,this.twoColorTint&&(c[V++]=0,c[V++]=0,c[V++]=0,c[V++]=0),c[V++]=O,c[V++]=_,c[V++]=l.r,c[V++]=l.g,c[V++]=l.b,c[V++]=l.a,c[V++]=0,c[V++]=0,this.twoColorTint&&(c[V++]=0,c[V++]=0,c[V++]=0,c[V++]=0),this.batcher.draw(e,c,this.QUAD_TRIANGLES)},n.prototype.drawRegion=function(t,e,i,n,r,s,a){void 0===s&&(s=null),void 0===a&&(a=!1),this.enableRenderer(this.batcher),null===s&&(s=this.WHITE);var o=this.QUAD,h=0;o[h++]=e,o[h++]=i,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u,o[h++]=t.v2,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),o[h++]=e+n,o[h++]=i,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u2,o[h++]=t.v2,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),o[h++]=e+n,o[h++]=i+r,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u2,o[h++]=t.v,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),o[h++]=e,o[h++]=i+r,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u,o[h++]=t.v,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),this.batcher.draw(t.texture,o,this.QUAD_TRIANGLES)},n.prototype.line=function(t,e,i,n,r,s){void 0===r&&(r=null),void 0===s&&(s=null),this.enableRenderer(this.shapes),this.shapes.line(t,e,i,n,r)},n.prototype.triangle=function(t,e,i,n,r,s,a,o,h,l){void 0===o&&(o=null),void 0===h&&(h=null),void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.triangle(t,e,i,n,r,s,a,o,h,l)},n.prototype.quad=function(t,e,i,n,r,s,a,o,h,l,u,c,d){void 0===l&&(l=null),void 0===u&&(u=null),void 0===c&&(c=null),void 0===d&&(d=null),this.enableRenderer(this.shapes),this.shapes.quad(t,e,i,n,r,s,a,o,h,l,u,c,d)},n.prototype.rect=function(t,e,i,n,r,s){void 0===s&&(s=null),this.enableRenderer(this.shapes),this.shapes.rect(t,e,i,n,r,s)},n.prototype.rectLine=function(t,e,i,n,r,s,a){void 0===a&&(a=null),this.enableRenderer(this.shapes),this.shapes.rectLine(t,e,i,n,r,s,a)},n.prototype.polygon=function(t,e,i,n){void 0===n&&(n=null),this.enableRenderer(this.shapes),this.shapes.polygon(t,e,i,n)},n.prototype.circle=function(t,e,i,n,r,s){void 0===r&&(r=null),void 0===s&&(s=0),this.enableRenderer(this.shapes),this.shapes.circle(t,e,i,n,r,s)},n.prototype.curve=function(t,e,i,n,r,s,a,o,h,l){void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.curve(t,e,i,n,r,s,a,o,h,l)},n.prototype.end=function(){this.activeRenderer===this.batcher?this.batcher.end():this.activeRenderer===this.shapes&&this.shapes.end(),this.activeRenderer=null},n.prototype.resize=function(t){var e=this.canvas,n=e.clientWidth,r=e.clientHeight;if(e.width==n&&e.height==r||(e.width=n,e.height=r),this.context.gl.viewport(0,0,e.width,e.height),t===i.Stretch);else if(t===i.Expand)this.camera.setViewport(n,r);else if(t===i.Fit){var s=e.width,a=e.height,o=this.camera.viewportWidth,h=this.camera.viewportHeight,l=h/o10920)throw new Error("Can't have more than 10920 triangles per batch: "+r);this.context=n instanceof e.ManagedWebGLRenderingContext?n:new e.ManagedWebGLRenderingContext(n),this.mesh=new e.Mesh(n,[new e.Position2Attribute,new e.ColorAttribute],r,0),this.srcBlend=this.context.gl.SRC_ALPHA,this.dstBlend=this.context.gl.ONE_MINUS_SRC_ALPHA}return n.prototype.begin=function(t){if(this.isDrawing)throw new Error("ShapeRenderer.begin() has already been called");this.shader=t,this.vertexIndex=0,this.isDrawing=!0;var e=this.context.gl;e.enable(e.BLEND),e.blendFunc(this.srcBlend,this.dstBlend)},n.prototype.setBlendMode=function(t,e){var i=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),i.blendFunc(this.srcBlend,this.dstBlend))},n.prototype.setColor=function(t){this.color.setFromColor(t)},n.prototype.setColorWith=function(t,e,i,n){this.color.set(t,e,i,n)},n.prototype.point=function(t,e,n){void 0===n&&(n=null),this.check(i.Point,1),null===n&&(n=this.color),this.vertex(t,e,n)},n.prototype.line=function(t,e,n,r,s){void 0===s&&(s=null),this.check(i.Line,2);this.mesh.getVertices(),this.vertexIndex;null===s&&(s=this.color),this.vertex(t,e,s),this.vertex(n,r,s)},n.prototype.triangle=function(t,e,n,r,s,a,o,h,l,u){void 0===h&&(h=null),void 0===l&&(l=null),void 0===u&&(u=null),this.check(t?i.Filled:i.Line,3);this.mesh.getVertices(),this.vertexIndex;null===h&&(h=this.color),null===l&&(l=this.color),null===u&&(u=this.color),t?(this.vertex(e,n,h),this.vertex(r,s,l),this.vertex(a,o,u)):(this.vertex(e,n,h),this.vertex(r,s,l),this.vertex(r,s,h),this.vertex(a,o,l),this.vertex(a,o,h),this.vertex(e,n,l))},n.prototype.quad=function(t,e,n,r,s,a,o,h,l,u,c,d,f){void 0===u&&(u=null),void 0===c&&(c=null),void 0===d&&(d=null),void 0===f&&(f=null),this.check(t?i.Filled:i.Line,3);this.mesh.getVertices(),this.vertexIndex;null===u&&(u=this.color),null===c&&(c=this.color),null===d&&(d=this.color),null===f&&(f=this.color),t?(this.vertex(e,n,u),this.vertex(r,s,c),this.vertex(a,o,d),this.vertex(a,o,d),this.vertex(h,l,f),this.vertex(e,n,u)):(this.vertex(e,n,u),this.vertex(r,s,c),this.vertex(r,s,c),this.vertex(a,o,d),this.vertex(a,o,d),this.vertex(h,l,f),this.vertex(h,l,f),this.vertex(e,n,u))},n.prototype.rect=function(t,e,i,n,r,s){void 0===s&&(s=null),this.quad(t,e,i,e+n,i,e+n,i+r,e,i+r,s,s,s,s)},n.prototype.rectLine=function(t,e,n,r,s,a,o){void 0===o&&(o=null),this.check(t?i.Filled:i.Line,8),null===o&&(o=this.color);var h=this.tmp.set(s-n,e-r);h.normalize(),a*=.5;var l=h.x*a,u=h.y*a;t?(this.vertex(e+l,n+u,o),this.vertex(e-l,n-u,o),this.vertex(r+l,s+u,o),this.vertex(r-l,s-u,o),this.vertex(r+l,s+u,o),this.vertex(e-l,n-u,o)):(this.vertex(e+l,n+u,o),this.vertex(e-l,n-u,o),this.vertex(r+l,s+u,o),this.vertex(r-l,s-u,o),this.vertex(r+l,s+u,o),this.vertex(e+l,n+u,o),this.vertex(r-l,s-u,o),this.vertex(e-l,n-u,o))},n.prototype.x=function(t,e,i){this.line(t-i,e-i,t+i,e+i),this.line(t-i,e+i,t+i,e-i)},n.prototype.polygon=function(t,e,n,r){if(void 0===r&&(r=null),n<3)throw new Error("Polygon must contain at least 3 vertices");this.check(i.Line,2*n),null===r&&(r=this.color);this.mesh.getVertices(),this.vertexIndex;n<<=1;for(var s=t[e<<=1],a=t[e+1],o=e+n,h=e,l=e+n-2;h=o?(d=s,f=a):(d=t[h+2],f=t[h+3]),this.vertex(u,c,r),this.vertex(d,f,r)}},n.prototype.circle=function(e,n,r,s,a,o){if(void 0===a&&(a=null),void 0===o&&(o=0),0===o&&(o=Math.max(1,6*t.MathUtils.cbrt(s)|0)),o<=0)throw new Error("segments must be > 0.");null===a&&(a=this.color);var h=2*t.MathUtils.PI/o,l=Math.cos(h),u=Math.sin(h),c=s,d=0;if(e){this.check(i.Filled,3*o+3),o--;for(p=0;p0;)this.vertex(E,b,u),E+=T,b+=A,T+=R,A+=S,R+=C,S+=I,this.vertex(E,b,u);this.vertex(E,b,u),this.vertex(o,h,u)},n.prototype.vertex=function(t,e,i){var n=this.vertexIndex,r=this.mesh.getVertices();r[n++]=t,r[n++]=e,r[n++]=i.r,r[n++]=i.g,r[n++]=i.b,r[n++]=i.a,this.vertexIndex=n},n.prototype.end=function(){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");this.flush(),this.context.gl.disable(this.context.gl.BLEND),this.isDrawing=!1},n.prototype.flush=function(){0!=this.vertexIndex&&(this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0)},n.prototype.check=function(t,e){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");if(this.shapeType==t){if(!(this.mesh.maxVertices()-this.mesh.numVertices()-1)&&null!=d.parent){var f=s+d.data.length*d.a+d.worldX,p=a+d.data.length*d.c+d.worldY;e.rectLine(!0,s+d.worldX,a+d.worldY,f,p,this.boneWidth*this.scale)}}this.drawSkeletonXY&&e.x(s,a,4*this.scale)}if(this.drawRegionAttachments){e.setColor(this.attachmentLineColor);for(u=0,c=(U=n.slots).length;u0){e.setColor(this.attachmentLineColor);var A=g[(x=2*(x>>1))-2],R=g[x-1];for(y=0,w=x;y-1||e.circle(!0,s+d.worldX,a+d.worldY,3*this.scale,i.GREEN,8)}}if(this.drawClipping){var U=n.slots;e.setColor(this.clipColor);for(u=0,c=U.length;u=0&&s==R.data.index&&(E=!0),E){a>=0&&a==R.data.index&&(E=!1);var S=R.getAttachment(),C=null;if(S instanceof t.RegionAttachment){var I=S;v.vertices=this.vertices,v.numVertices=4,v.numFloats=A<<2,I.computeWorldVertices(R.bone,v.vertices,0,A),m=n.QUAD_TRIANGLES,g=I.uvs,C=I.region.renderObject.texture,x=I.color}else{if(!(S instanceof t.MeshAttachment)){if(S instanceof t.ClippingAttachment){var P=S;o.clipStart(R,P);continue}o.clipEndWithSlot(R);continue}var L=S;v.vertices=this.vertices,v.numVertices=L.worldVerticesLength>>1,v.numFloats=v.numVertices*A,v.numFloats>v.vertices.length&&(v.vertices=this.vertices=t.Utils.newFloatArray(v.numFloats)),L.computeWorldVertices(R,0,L.worldVerticesLength,v.vertices,0,A),m=L.triangles,C=L.region.renderObject.texture,g=L.uvs,x=L.color}if(null!=C){var O=R.color,_=this.tempColor;_.r=y.r*O.r*x.r,_.g=y.g*O.g*x.g,_.b=y.b*O.b*x.b,_.a=y.a*O.a*x.a,h&&(_.r*=_.a,_.g*=_.a,_.b*=_.a);var k=this.tempColor2;null==R.darkColor?k.set(0,0,0,1):(h?(k.r=R.darkColor.r*_.a,k.g=R.darkColor.g*_.a,k.b=R.darkColor.b*_.a):k.setFromColor(R.darkColor),k.a=h?1:0);var F=R.data.blendMode;if(F!=u&&(u=F,i.setBlendMode(e.WebGLBlendModeConverter.getSourceGLBlendMode(u,h),e.WebGLBlendModeConverter.getDestGLBlendMode(u))),o.isClipping()){o.clipTriangles(v.vertices,v.numFloats,m,m.length,g,_,k,l);var V=new Float32Array(o.clippedVertices),D=o.clippedTriangles;if(null!=this.vertexEffect){var N=this.vertexEffect,B=V;if(l){Y=0;for(var X=V.length;Y-1&&this.restorables.splice(e,1)},t}();e.ManagedWebGLRenderingContext=i;var n=function(){function e(){}return e.getDestGLBlendMode=function(i){switch(i){case t.BlendMode.Normal:return e.ONE_MINUS_SRC_ALPHA;case t.BlendMode.Additive:return e.ONE;case t.BlendMode.Multiply:case t.BlendMode.Screen:return e.ONE_MINUS_SRC_ALPHA;default:throw new Error("Unknown blend mode: "+i)}},e.getSourceGLBlendMode=function(i,n){switch(void 0===n&&(n=!1),i){case t.BlendMode.Normal:case t.BlendMode.Additive:return n?e.ONE:e.SRC_ALPHA;case t.BlendMode.Multiply:return e.DST_COLOR;case t.BlendMode.Screen:return e.ONE;default:throw new Error("Unknown blend mode: "+i)}},e.ZERO=0,e.ONE=1,e.SRC_COLOR=768,e.ONE_MINUS_SRC_COLOR=769,e.SRC_ALPHA=770,e.ONE_MINUS_SRC_ALPHA=771,e.DST_ALPHA=772,e.ONE_MINUS_DST_ALPHA=773,e.DST_COLOR=774,e}();e.WebGLBlendModeConverter=n}(t.webgl||(t.webgl={}))}(n||(n={})),t.exports=n}).call(window)},3524:(t,e,i)=>{var n=i(7473),r=i(4597),s=i(6732),a=i(2482),o=i(704),h=i(3137),l=i(1192),u=new n({Extends:h,initialize:function(t,e,i,n,s,u,c){var d,f,p,v=[],g=t.cacheManager.custom.spine;if(a(e)){var m=e;for(e=r(m,"key"),f=new o(t,{key:e,url:r(m,"jsonURL"),extension:r(m,"jsonExtension","json"),xhrSettings:r(m,"jsonXhrSettings")}),n=r(m,"atlasURL"),s=r(m,"preMultipliedAlpha"),Array.isArray(n)||(n=[n]),d=0;d{var n=i(2494),r=i(7473),s=i(5851),a=i(3527),o=i(5722),h=i(1847),l=i(3524),u=i(8332),c=i(5782),d=i(1984),f=new r({Extends:o,initialize:function(t,e,i){o.call(this,t,e,i);var r=e.game;this.isWebGL=2===r.config.renderType,this.cache=r.cache.addCustom("spine"),this.spineTextures=r.cache.addCustom("spineTextures"),this.json=r.cache.json,this.textures=r.textures,this.drawDebug=!1,this.gl,this.renderer,this.sceneRenderer,this.skeletonRenderer,this.skeletonDebugRenderer,this.plugin=h,this.temp1,this.temp2,this.isWebGL?(this.runtime=h.webgl,this.renderer=r.renderer,this.gl=r.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=r.renderer,this.getAtlas=this.getAtlasCanvas),this.renderer||(this.renderer={width:r.scale.width,height:r.scale.height,preRender:d,postRender:d,render:d,destroy:d});var a=this.isWebGL;e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",(function(t,e,n,r,s){a&&this.scene.sys.renderer.pipelines.clear();var o=this.scene.sys[i],h=new u(this.scene,o,t,e,n,r,s);return this.displayList.add(h),this.updateList.add(h),a&&this.scene.sys.renderer.pipelines.rebind(),h}),(function(t,e){void 0===t&&(t={}),a&&this.scene.sys.renderer.pipelines.clear();var r=s(t,"key",null),o=s(t,"animationName",null),h=s(t,"loop",!1),l=this.scene.sys[i],c=new u(this.scene,l,0,0,r,o,h);void 0!==e&&(t.add=e),n(this.scene,c,t);var d=s(t,"skinName",!1);d&&c.setSkinByName(d);var f=s(t,"slotName",!1),p=s(t,"attachmentName",null);return f&&c.setAttachment(f,p),a&&this.scene.sys.renderer.pipelines.rebind(),c.refresh()})),e.registerGameObject("spineContainer",(function(t,e,n){var r=this.scene.sys[i],s=new c(this.scene,r,t,e,n);return this.displayList.add(s),s}),(function(t,e){void 0===t&&(t={});var r=s(t,"x",0),a=s(t,"y",0),o=s(t,"children",null),h=this.scene.sys[i],l=new c(this.scene,h,r,a,o);return void 0!==e&&(t.add=e),n(this.scene,l,t),l}))},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(a,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this),this.game.events.once("destroy",this.gameDestroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){var t=function(t,e){if(t!==this.srcBlend||e!==this.dstBlend){var i=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),i.blendFunc(this.srcBlend,this.dstBlend))}},e=this.renderer.spineSceneRenderer;e||((e=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0)).batcher.setBlendMode=t,e.shapes.setBlendMode=t,this.renderer.spineSceneRenderer=e),this.sceneRenderer=e,this.skeletonRenderer=e.skeletonRenderer,this.skeletonDebugRenderer=e.skeletonDebugRenderer,this.temp1=new h.webgl.Vector3(0,0,0),this.temp2=new h.webgl.Vector3(0,0,0)},getAtlasCanvas:function(t){var e=this.cache.get(t);if(e){var i,n=this.spineTextures;if(n.has(t))i=n.get(t);else{var r=this.textures;i=new h.TextureAtlas(e.data,(function(i){return new h.canvas.CanvasTexture(r.get(e.prefix+t+":"+i).getSourceImage())}))}return i}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var i,n=this.spineTextures;if(n.has(t))i=n.get(t);else{var r=this.textures,s=this.sceneRenderer.context.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i=new h.TextureAtlas(e.data,(function(i){return new h.webgl.GLTexture(s,r.get(e.prefix+t+":"+i).getSourceImage(),!1)}))}return i}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,i,n,r,s,a){var o;if(a=a||{},Array.isArray(t))for(var h=0;h{var n=i(7473),r=i(7361),s=i(7738),a=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,n,s){r.call(this,t,i,n,s),this.type="Spine",this.plugin=e},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null,this.plugin=null}});t.exports=a},8064:t=>{t.exports=function(t,e,i,n){var r=e.list;if(0!==r.length){i.addToRenderList(e);var s=e.localTransform;n?(s.loadIdentity(),s.multiply(n),s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.scaleX,e.scaleY)):s.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var n=i(1984),r=i(1984);n=i(434),r=i(8064),t.exports={renderWebGL:n,renderCanvas:r}},434:t=>{t.exports=function(t,e,i,n){var r=e.plugin.sceneRenderer,s=e.list;if(0!==s.length){i.addToRenderList(e);var a=e.localTransform;n?(a.loadIdentity(),a.multiply(n),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.newType&&(t.pipelines.clear(),r.begin());var o=t.nextTypeMatch;t.nextTypeMatch=!0,t.newType=!1;for(var h=0;h{t.exports="complete"},8621:t=>{t.exports="dispose"},8944:t=>{t.exports="end"},7494:t=>{t.exports="event"},1908:t=>{t.exports="interrupted"},5591:t=>{t.exports="start"},5146:(t,e,i)=>{t.exports={COMPLETE:i(6576),DISPOSE:i(8621),END:i(8944),EVENT:i(7494),INTERRUPTED:i(1908),START:i(5591)}},8332:(t,e,i)=>{var n=i(6412),r=i(2915),s=i(7473),a=i(1991),o=i(3131),h=i(9660),l=i(4627),u=i(3212),c=i(8414),d=i(3426),f=i(7149),p=i(2273),v=i(4208),g=i(5146),m=i(2762),M=new s({Extends:p,Mixins:[a,o,h,l,u,c,m],initialize:function(t,e,i,n,r,s,a){p.call(this,t,"Spine"),this.plugin=e,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null,this.root=null,this.bounds=null,this.drawDebug=!1,this.timeScale=1,this.displayOriginX=0,this.displayOriginY=0,this.preMultipliedAlpha=!1,this.blendMode=-1,this.setPosition(i,n),r&&this.setSkeleton(r,s,a)},willRender:function(t,e){var i=!this.skeleton||!(15!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id);if(!e&&!i&&this.parentContainer){var n=this.plugin,r=n.sceneRenderer;n.gl&&r.batcher.isDrawing&&(r.end(),n.renderer.pipelines.rebind())}return i},setAlpha:function(t,e){if(void 0===t&&(t=1),e){var i=this.findSlot(e);i&&(i.color.a=r(t,0,1))}else this.alpha=t;return this},alpha:{get:function(){return this.skeleton.color.a},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.a=e),0===e?this.renderFlags&=-3:this.renderFlags|=2}},red:{get:function(){return this.skeleton.color.r},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.r=e)}},green:{get:function(){return this.skeleton.color.g},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.g=e)}},blue:{get:function(){return this.skeleton.color.b},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.b=e)}},setColor:function(t,e){void 0===t&&(t=16777215);var i=(t>>16&255)/255,n=(t>>8&255)/255,r=(255&t)/255,s=t>16777215?(t>>>24)/255:null,a=this.skeleton;if(e){var o=this.findSlot(e);o&&(a=o)}return a.color.r=i,a.color.g=n,a.color.b=r,null!==s&&(a.color.a=s),this},setSkeletonFromJSON:function(t,e,i,n){return this.setSkeleton(t,e,i,n)},setSkeleton:function(t,e,i,n){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,n);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkin(),s.setToSetupPose(),this.skeleton=s,r=this.plugin.createAnimationState(s),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=v(d(this.rotation))+90),this.state.apply(s),s.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=v(d(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,n){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===i&&(i=0),void 0===n&&(n=0),this.width=t,this.height=e,this.displayOriginX=r.x-i,this.displayOriginY=r.y-n,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,n=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=i,t.scaleY=n,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i{var n=i(3426),r=i(4208),s=i(8445);t.exports=function(t,e,i,a){var o=t.currentContext,h=e.plugin,l=e.skeleton,u=h.skeletonRenderer,c=t._tempMatrix1,d=t._tempMatrix2,f=t._tempMatrix3;i.addToRenderList(e),d.applyITRS(e.x,e.y,e.rotation,Math.abs(e.scaleX),Math.abs(e.scaleY)),c.copyFrom(i.matrix),a?(c.multiplyWithOffset(a,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),d.e=e.x,d.f=e.y,c.multiply(d,f)):(d.e-=i.scrollX*e.scrollFactorX,d.f-=i.scrollY*e.scrollFactorY,c.multiply(d,f)),l.x=f.tx,l.y=f.ty,l.scaleX=f.scaleX,l.scaleY=-1*f.scaleY,e.scaleX<0?(l.scaleX*=-1,e.root.rotation=r(f.rotationNormalized)):e.root.rotation=s(r(n(f.rotationNormalized))+90,0,360),e.scaleY<0&&(l.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*r(f.rotationNormalized):e.root.rotation+=2*r(f.rotationNormalized)),i.renderToTexture&&(l.y=f.ty,l.scaleY*=-1),l.updateWorldTransform(),u.ctx=o,u.debugRendering=h.drawDebug||e.drawDebug,o.save(),u.draw(l),o.restore()}},2762:(t,e,i)=>{var n=i(1984),r=i(1984),s=i(1984);n=i(4290),s=i(780),r=i(2753),t.exports={renderWebGL:n,renderCanvas:r,renderDirect:s}},780:(t,e,i)=>{var n=i(2915),r=i(3426),s=i(2208),a=i(4208),o=i(8445);t.exports=function(t,e,i,h,l){var u=e.plugin,c=e.skeleton,d=u.sceneRenderer;t.pipelines.clear(),d.begin();var f=e.scrollFactorX,p=e.scrollFactorY,v=c.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,c.color.a=n(v*l.alpha,0,1)),i.addToRenderList(e);var g=s(e,i,h).calc,m=t.height;if(c.x=g.tx,c.y=m-g.ty,c.scaleX=g.scaleX,c.scaleY=g.scaleY,e.scaleX<0?(c.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(r(g.rotationNormalized))+90,0,360),e.scaleY<0&&(c.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),c.updateWorldTransform(),d.drawSkeleton(c,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,c.color.a=v),u.drawDebug||e.drawDebug){var M=c.x,x=c.y;c.x=0,c.y=0,d.drawSkeletonDebug(c,e.preMultipliedAlpha),c.x=M,c.y=x}d.end(),t.pipelines.rebind()}},4290:(t,e,i)=>{var n=i(2915),r=i(3426),s=i(2208),a=i(4208),o=i(8445);t.exports=function(t,e,i,h,l){var u=e.plugin,c=e.skeleton,d=u.sceneRenderer;t.newType&&(t.pipelines.clear(),d.begin());var f=e.scrollFactorX,p=e.scrollFactorY,v=c.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,c.color.a=n(v*l.alpha,0,1)),i.addToRenderList(e);var g=s(e,i,h).calc,m=t.height;if(c.x=g.tx,c.y=m-g.ty,c.scaleX=g.scaleX,c.scaleY=g.scaleY,e.scaleX<0?(c.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(r(g.rotationNormalized))+90,0,360),e.scaleY<0&&(c.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),c.updateWorldTransform(),d.drawSkeleton(c,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,c.color.a=v),u.drawDebug||e.drawDebug){var M=c.x,x=c.y;c.x=0,c.y=0,d.drawSkeletonDebug(c,e.preMultipliedAlpha),c.x=M,c.y=x,d.end(),t.pipelines.rebind()}else t.nextTypeMatch||(d.end(),t.pipelines.rebind())}},9454:(t,e,i)=>{var n={VERSION:"3.60.0-beta.20",BlendModes:i(8351),ScaleModes:i(8196),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},1081:(t,e,i)=>{var n=i(7473),r=i(6748),s=new n({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(r.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n{t.exports="changedata"},7801:t=>{t.exports="changedata-"},4873:t=>{t.exports="destroy"},9966:t=>{t.exports="removedata"},4586:t=>{t.exports="setdata"},6748:(t,e,i)=>{t.exports={CHANGE_DATA:i(9044),CHANGE_DATA_KEY:i(7801),DESTROY:i(4873),REMOVE_DATA:i(9966),SET_DATA:i(4586)}},3004:(t,e,i)=>{var n=i(2776),r={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return r;r.audioData=!!window.Audio,r.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var n=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(n||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(n)};if(r.ogg=i('ogg; codecs="vorbis"'),r.opus=i('ogg; codecs="opus"',"opus"),r.mp3=i("mpeg"),r.wav=i("wav"),r.m4a=i("x-m4a"),r.aac=i("aac"),r.flac=i("flac","x-flac"),r.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(n.edge)r.dolby=!0;else if(n.safari&&n.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var s=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===s&&a>=11||s>10)&&(r.dolby=!0)}}}catch(t){}return r}()},2776:(t,e,i)=>{var n,r=i(5203),s={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(n=navigator.userAgent,/Edg\/\d+/.test(n)?(s.edge=!0,s.es2019=!0):/OPR/.test(n)?(s.opera=!0,s.es2019=!0):/Chrome\/(\d+)/.test(n)&&!r.windowsPhone?(s.chrome=!0,s.chromeVersion=parseInt(RegExp.$1,10),s.es2019=s.chromeVersion>69):/Firefox\D+(\d+)/.test(n)?(s.firefox=!0,s.firefoxVersion=parseInt(RegExp.$1,10),s.es2019=s.firefoxVersion>10):/AppleWebKit/.test(n)&&r.iOS?s.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(s.ie=!0,s.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+) Safari/.test(n)&&!r.windowsPhone?(s.safari=!0,s.safariVersion=parseInt(RegExp.$1,10),s.es2019=s.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(s.ie=!0,s.trident=!0,s.tridentVersion=parseInt(RegExp.$1,10),s.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(s.silk=!0),s)},6505:(t,e,i)=>{var n,r,s,a=i(8073),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",r="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(s=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(s,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+r},s.src=n+"AP804Oa6"+r,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),n=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),n}()),o)},6543:(t,e,i)=>{var n=i(5203),r=i(2776),s=i(8073),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=s.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=s.create2D(this),n=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=n.data instanceof Uint8ClampedArray,s.remove(t),s.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!n.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},3922:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",n="FullScreen",r=["request"+i,"request"+n,"webkitRequest"+i,"webkitRequest"+n,"msRequest"+i,"msRequest"+n,"mozRequest"+n,"mozRequest"+i];for(t=0;t{var n=i(2776),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||n.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":n.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},5203:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},2131:t=>{var e={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=document.createElement("video"),i=!!t.canPlayType,n=/^no$/;try{i&&(t.canPlayType('video/ogg; codecs="theora"').replace(n,"")&&(e.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(n,"")&&(e.h264=!0,e.mp4=!0),t.canPlayType("video/x-m4v").replace(n,"")&&(e.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(n,"")&&(e.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(n,"")&&(e.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(n,"")&&(e.hls=!0))}catch(t){}return e}()},9356:(t,e,i)=>{t.exports={os:i(5203),browser:i(2776),features:i(6543),input:i(1454),audio:i(3004),video:i(2131),fullscreen:i(3922),canvasFeatures:i(6505)}},5686:(t,e,i)=>{var n=i(7473),r=new Float32Array(20),s=new n({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(t){return this._matrix.set(t),this._dirty=!0,this},reset:function(){var t=this._matrix;return t.fill(0),t[0]=1,t[6]=1,t[12]=1,t[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var t=this._data;return this._dirty&&(t.set(this._matrix),t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._dirty=!1),t},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,n=-.5*(i-1);return this.multiply([i,n,n,0,0,n,i,n,0,0,n,n,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),n=Math.sin(t),r=.213,s=.715,a=.072;return this.multiply([r+.787*i+n*-r,s+i*-s+n*-s,a+i*-a+.928*n,0,0,r+i*-r+.143*n,s+i*(1-s)+.14*n,a+i*-a+-.283*n,0,0,r+i*-r+-.787*n,s+i*-s+n*s,a+.928*i+n*a,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply(s.BLACK_WHITE,t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,n=-.5*(i-1);return this.multiply([i,0,0,0,n,0,i,0,0,n,0,0,i,0,n,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply(s.NEGATIVE,t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply(s.DESATURATE_LUMINANCE,t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply(s.SEPIA,t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply(s.LSD,t)},brown:function(t){return void 0===t&&(t=!1),this.multiply(s.BROWN,t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply(s.VINTAGE,t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply(s.KODACHROME,t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply(s.TECHNICOLOR,t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply(s.POLAROID,t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply(s.SHIFT_BGR,t)},multiply:function(t,e){void 0===e&&(e=!1),e||this.reset();var i=this._matrix,n=r;return n.set(i),i.set([n[0]*t[0]+n[1]*t[5]+n[2]*t[10]+n[3]*t[15],n[0]*t[1]+n[1]*t[6]+n[2]*t[11]+n[3]*t[16],n[0]*t[2]+n[1]*t[7]+n[2]*t[12]+n[3]*t[17],n[0]*t[3]+n[1]*t[8]+n[2]*t[13]+n[3]*t[18],n[0]*t[4]+n[1]*t[9]+n[2]*t[14]+n[3]*t[19]+n[4],n[5]*t[0]+n[6]*t[5]+n[7]*t[10]+n[8]*t[15],n[5]*t[1]+n[6]*t[6]+n[7]*t[11]+n[8]*t[16],n[5]*t[2]+n[6]*t[7]+n[7]*t[12]+n[8]*t[17],n[5]*t[3]+n[6]*t[8]+n[7]*t[13]+n[8]*t[18],n[5]*t[4]+n[6]*t[9]+n[7]*t[14]+n[8]*t[19]+n[9],n[10]*t[0]+n[11]*t[5]+n[12]*t[10]+n[13]*t[15],n[10]*t[1]+n[11]*t[6]+n[12]*t[11]+n[13]*t[16],n[10]*t[2]+n[11]*t[7]+n[12]*t[12]+n[13]*t[17],n[10]*t[3]+n[11]*t[8]+n[12]*t[13]+n[13]*t[18],n[10]*t[4]+n[11]*t[9]+n[12]*t[14]+n[13]*t[19]+n[14],n[15]*t[0]+n[16]*t[5]+n[17]*t[10]+n[18]*t[15],n[15]*t[1]+n[16]*t[6]+n[17]*t[11]+n[18]*t[16],n[15]*t[2]+n[16]*t[7]+n[17]*t[12]+n[18]*t[17],n[15]*t[3]+n[16]*t[8]+n[17]*t[13]+n[18]*t[18],n[15]*t[4]+n[16]*t[9]+n[17]*t[14]+n[18]*t[19]+n[19]]),this._dirty=!0,this}});s.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],s.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],s.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],s.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],s.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],s.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],s.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],s.KODACHROME=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],s.TECHNICOLOR=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],s.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],s.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t.exports=s},8073:(t,e,i)=>{var n,r,s,a=i(9454),o=i(2150),h=[],l=!1;t.exports=(s=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return n(t,e,i,a.CANVAS)},create:n=function(t,e,i,n,s){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=a.CANVAS),void 0===s&&(s=!1);var c=r(n);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:n},n===a.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),s&&(c.parent=u),u.width=e,u.height=i,l&&n===a.CANVAS&&o.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return n(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:r=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{var n=i(7473),r=i(3649),s=new n({initialize:function(t,e,i,n,r,s){e||(e=t.sys.make.image({x:i,y:n,key:r,frame:s,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});r.register("bitmapMask",(function(t,e,i,n,r){return new s(this.scene,t,e,i,n,r)})),t.exports=s},6726:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var n=t.gl;t.flush(),0===t.maskStack.length&&(n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var n=t.gl,r=this.geometryMask,s=t.maskCount,a=255;n.colorMask(!1,!1,!1,!1),i?(n.stencilFunc(n.EQUAL,s,a),n.stencilOp(n.KEEP,n.KEEP,n.INCR),s++):(n.stencilFunc(n.EQUAL,s+1,a),n.stencilOp(n.KEEP,n.KEEP,n.DECR)),this.level=s,r.renderWebGL(t,r,e),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),this.invertAlpha?n.stencilFunc(n.NOTEQUAL,s,a):n.stencilFunc(n.EQUAL,s,a)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var n=t.maskStack[t.maskStack.length-1];n.mask.applyStencil(t,n.camera,!1),t.currentCameraMask.mask!==n.mask?(i.mask=n.mask,i.camera=n.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},8325:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,s.BARREL,t),this.amount=e}});t.exports=a},5170:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h){void 0===i&&(i=1),void 0===n&&(n=1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=4),r.call(this,s.BLOOM,t),this.steps=h,this.offsetX=i,this.offsetY=n,this.blurStrength=a,this.strength=o,this.glcolor=[1,1,1],null!=e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4199:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h){void 0===e&&(e=0),void 0===i&&(i=2),void 0===n&&(n=2),void 0===a&&(a=1),void 0===h&&(h=4),r.call(this,s.BLUR,t),this.quality=0,this.x=i,this.y=n,this.steps=h,this.strength=a,this.glcolor=[1,1,1],null!=o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},3132:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===n&&(n=.2),void 0===a&&(a=!1),void 0===o&&(o=1),void 0===h&&(h=1),void 0===l&&(l=1),r.call(this,s.BOKEH,t),this.radius=e,this.amount=i,this.contrast=n,this.isTiltShift=a,this.strength=l,this.blurX=o,this.blurY=h}});t.exports=a},6610:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o){void 0===e&&(e=8),void 0===a&&(a=1),void 0===o&&(o=.005),r.call(this,s.CIRCLE,t),this.scale=a,this.feather=o,this.thickness=e,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],null!=i&&(this.color=i),null!=n&&(this.backgroundColor=n)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundColor:{get:function(){var t=this.glcolor2;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor2;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4931:(t,e,i)=>{var n=i(7473),r=i(5686),s=i(1571),a=new n({Extends:r,initialize:function(t){r.call(this),this.type=s.COLOR_MATRIX,this.gameObject=t,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});t.exports=a},6128:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e){this.type=t,this.gameObject=e,this.active=!0},destroy:function(){this.gameObject=null,this.active=!1}});t.exports=n},9195:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===n&&(n=.005),r.call(this,s.DISPLACEMENT,t),this.x=i,this.y=n,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.gameObject.scene.sys.textures.getFrame(t);e&&(this.glTexture=e.glTexture)}});t.exports=a},445:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===i&&(i=4),void 0===n&&(n=0),void 0===a&&(a=!1),r.call(this,s.GLOW,t),this.outerStrength=i,this.innerStrength=n,this.knockout=a,this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},7724:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l,u){void 0===n&&(n=.2),void 0===a&&(a=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l=1),void 0===u&&(u=0),r.call(this,s.GRADIENT,t),this.alpha=n,this.size=u,this.fromX=a,this.fromY=o,this.toX=h,this.toY=l,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],null!=e&&(this.color1=e),null!=i&&(this.color2=i)},color1:{get:function(){var t=this.glcolor1;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor1;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}},color2:{get:function(){var t=this.glcolor2;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor2;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}}});t.exports=a},4412:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,s.PIXELATE,t),this.amount=e}});t.exports=a},75:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=.1),void 0===a&&(a=1),void 0===h&&(h=6),void 0===l&&(l=1),r.call(this,s.SHADOW,t),this.x=e,this.y=i,this.decay=n,this.power=a,this.glcolor=[0,0,0,1],this.samples=h,this.intensity=l,void 0!==o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},8734:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===n&&(n=3),void 0===a&&(a=!1),r.call(this,s.SHINE,t),this.speed=e,this.lineWidth=i,this.gradient=n,this.reveal=a}});t.exports=a},2437:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===a&&(a=.5),r.call(this,s.VIGNETTE,t),this.x=e,this.y=i,this.radius=n,this.strength=a}});t.exports=a},5984:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=!1),r.call(this,s.WIPE,t),this.progress=0,this.wipeWidth=e,this.direction=i,this.axis=n,this.reveal=a}});t.exports=a},1571:t=>{t.exports={GLOW:4,SHADOW:5,PIXELATE:6,VIGNETTE:7,SHINE:8,BLUR:9,GRADIENT:12,BLOOM:13,COLOR_MATRIX:14,CIRCLE:15,BARREL:16,DISPLACEMENT:17,WIPE:18,BOKEH:19}},7347:(t,e,i)=>{var n=i(1030),r=i(1571),s={Barrel:i(8325),Controller:i(6128),Bloom:i(5170),Blur:i(4199),Bokeh:i(3132),Circle:i(6610),ColorMatrix:i(4931),Displacement:i(9195),Glow:i(445),Gradient:i(7724),Pixelate:i(4412),Shadow:i(75),Shine:i(8734),Vignette:i(2437),Wipe:i(5984)};s=n(!1,s,r),t.exports=s},2494:(t,e,i)=>{var n=i(8351),r=i(8361);t.exports=function(t,e,i){e.x=r(i,"x",0),e.y=r(i,"y",0),e.depth=r(i,"depth",0),e.flipX=r(i,"flipX",!1),e.flipY=r(i,"flipY",!1);var s=r(i,"scale",null);"number"==typeof s?e.setScale(s):null!==s&&(e.scaleX=r(s,"x",1),e.scaleY=r(s,"y",1));var a=r(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=r(a,"x",1),e.scrollFactorY=r(a,"y",1)),e.rotation=r(i,"rotation",0);var o=r(i,"angle",null);null!==o&&(e.angle=o),e.alpha=r(i,"alpha",1);var h=r(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),u=r(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=r(i,"blendMode",n.NORMAL),e.visible=r(i,"visible",!0),r(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},2273:(t,e,i)=>{var n=i(7473),r=i(6125),s=i(1081),a=i(4399),o=i(3389),h=i(204),l=new n({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new s(this)),this},setData:function(t,e){return this.data||(this.data=new s(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new s(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new s(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new s(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.preFX&&(this.preFX.destroy(),this.preFX=void 0),this.postFX&&(this.postFX.destroy(),this.postFX=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},3649:(t,e,i)=>{var n=i(7473),r=i(8456),s=i(204),a=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(s.BOOT,this.boot,this),this.events.on(s.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(s.DESTROY,this.destroy,this)},start:function(){this.events.once(s.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(s.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(s.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectFactory",a,"add"),t.exports=a},2208:(t,e,i)=>{var n=i(4227),r=new n,s=new n,a=new n,o={camera:r,sprite:s,calc:a};t.exports=function(t,e,i){var n=r,h=s,l=a;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),n.multiply(h,l),o}},4344:(t,e,i)=>{var n=i(2915),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,r){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=r},4518:(t,e,i)=>{var n=i(2915),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=r},5173:(t,e,i)=>{var n=i(8351),r={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=r},1991:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},8305:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},3131:t=>{var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},1626:(t,e,i)=>{var n=i(7473),r=i(7347),s=i(8935),a=new n({initialize:function(t,e){this.gameObject=t,this.isPost=e,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(t){return void 0===t&&(t=0),this.padding=t,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(t){var e=this.gameObject.scene.sys.renderer;e&&e.pipelines?(this.gameObject.pipeline=e.pipelines.FX_PIPELINE,void 0!==t&&(this.padding=t),this.enabled=!0):this.enabled=!1},clear:function(){for(var t=this.list,e=0;e{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},3671:(t,e,i)=>{var n=i(1392),r=i(9876),s=i(2529),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&r(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t){return void 0===t&&(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,r,s,a,o,h,l;if(void 0===t&&(t=new n),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),r=t.x,s=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),r=t.x,s=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,r,a,h),t.y=Math.min(i,s,o,l),t.width=Math.max(e,r,a,h)-t.x,t.height=Math.max(i,s,o,l)-t.y,t}};t.exports=a},2246:(t,e,i)=>{var n=i(7499),r=i(6726),s={mask:null,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},createBitmapMask:function(t,e,i,r,s){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new n(this.scene,t,e,i,r,s)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new r(this.scene,t)}};t.exports=s},5085:t=>{var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},77:(t,e,i)=>{var n=i(7149),r=i(1864),s=i(5851),a=i(3747),o=i(2529),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=s(t,"from",0),t.to=s(t,"to",1);var h=r(t,"positionOnPath",!1);this.rotateToPath=r(t,"rotateToPath",!1),this.pathRotationOffset=s(t,"rotationOffset",0);var l=s(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+n(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,r=this.pathVector;if(i.copy(r).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,r),i.add(r),r.add(this.pathOffset),void this.setPosition(r.x,r.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),r),i.add(r),r.add(this.pathOffset);var s=this.x,o=this.y;this.setPosition(r.x,r.y);var h=this.x-s,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+n(this.pathRotationOffset))}}};t.exports=h},986:(t,e,i)=>{var n=i(3911),r={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(t){this.pipelineData={};var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(i){void 0===t&&(t=i.default);var n=i.get(t);if(n)return this.defaultPipeline=n,this.pipeline=n,!0}return!1},setPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){var a=s.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?n(e):e)}return this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},resetPipeline:function(t){return void 0===t&&(t=!1),this.pipeline=this.defaultPipeline,t&&(this.pipelineData={}),null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=r},4461:(t,e,i)=>{var n=i(3911),r=i(1626),s=i(8935),a={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(t){this.postPipelines=[],this.postPipelineData={},this.postFX=new r(this,!0),t&&(this.preFX=new r(this,!1))},setPostPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){Array.isArray(t)||(t=[t]);for(var a=0;a0,this},setPostPipelineData:function(t,e){var i=this.postPipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,n=[],r=0;r=0;i--){var n=e[i];("string"==typeof t&&n.name===t||"string"!=typeof t&&n instanceof t)&&(n.destroy(),s(e,i))}return this.hasPostPipeline=this.postPipelines.length>0,this}};t.exports=a},4627:t=>{var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},1868:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},4976:(t,e,i)=>{var n=i(2362),r={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof n?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=r},9243:(t,e,i)=>{var n=i(2362),r={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof n?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=r},5693:t=>{var e={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,n){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,n=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=n,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=e},6125:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},3212:(t,e,i)=>{var n=i(7425),r=i(4227),s=i(7556),a=i(3692),o=i(2820),h=i(2529),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:0!==this._scaleY&&(this.renderFlags|=4)}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:0!==this._scaleX&&(this.renderFlags|=4)}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(e||(e=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,n){i||(i=new h),n||(n=this.scene.sys.cameras.main);var r=n.scrollX,a=n.scrollY,o=t+r*this.scrollFactorX-r,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):s(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},4227:(t,e,i)=>{var n=i(7473),r=i(7425),s=i(2529),a=new n({initialize:function(t,e,i,n,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),this.matrix=new Float32Array([t,e,i,n,r,s,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):n||s?r.TAU-(s>0?Math.acos(-n/this.scaleY):-Math.acos(n/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,r=n[0],s=n[1],a=n[2],o=n[3];return n[0]=r*i+a*e,n[1]=s*i+o*e,n[2]=r*-e+a*i,n[3]=s*-e+o*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,r=i[0],s=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],v=n[5],g=void 0===e?i:e.matrix;return g[0]=u*r+c*a,g[1]=u*s+c*o,g[2]=d*r+f*a,g[3]=d*s+f*o,g[4]=p*r+v*a+h,g[5]=p*s+v*o+l,g},multiplyWithOffset:function(t,e,i){var n=this.matrix,r=t.matrix,s=n[0],a=n[1],o=n[2],h=n[3],l=e*s+i*o+n[4],u=e*a+i*h+n[5],c=r[0],d=r[1],f=r[2],p=r[3],v=r[4],g=r[5];return n[0]=c*s+d*o,n[1]=c*a+d*h,n[2]=f*s+p*o,n[3]=f*a+p*h,n[4]=v*s+g*o+l,n[5]=v*a+g*h+u,this},transform:function(t,e,i,n,r,s){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+n*l,a[3]=i*h+n*u,a[4]=r*o+s*l+c,a[5]=r*h+s*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,r=n[0],s=n[1],a=n[2],o=n[3],h=n[4],l=n[5];return i.x=t*r+e*a+h,i.y=t*s+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=e*r-i*n;return t[0]=r/o,t[1]=-i/o,t[2]=-n/o,t[3]=e/o,t[4]=(n*a-r*s)/o,t[5]=-(e*a-i*s)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,r,s){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=n,a[4]=r,a[5]=s,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],r=e[2],s=e[3],a=i*s-n*r;if(t.translateX=e[4],t.translateY=e[5],i||n){var o=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(r||s){var h=Math.sqrt(r*r+s*s);t.rotation=.5*Math.PI-(s>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,n,r){var s=this.matrix,a=Math.sin(i),o=Math.cos(i);return s[4]=t,s[5]=e,s[0]=o*n,s[1]=a*n,s[2]=-a*r,s[3]=o*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],a=n[1],o=n[2],h=n[3],l=n[4],u=n[5],c=1/(r*h+o*-a);return i.x=h*c*t+-o*c*e+(u*o-l*h)*c,i.y=r*c*e+-a*c*t+(-u*r+l*a)*c,i},setQuad:function(t,e,i,n,r,s){void 0===s&&(s=this.quad);var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return s[0]=t*o+e*l+c,s[1]=t*h+e*u+d,s[2]=t*o+n*l+c,s[3]=t*h+n*u+d,s[4]=i*o+n*l+c,s[5]=i*h+n*u+d,s[6]=i*o+e*l+c,s[7]=i*h+e*u+d,r&&s.forEach((function(t,e){s[e]=Math.round(t)})),s},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var n=this.getX(t,e);return i&&(n=Math.round(n)),n},getYRound:function(t,e,i){var n=this.getY(t,e);return i&&(n=Math.round(n)),n},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},8414:t=>{var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},4286:(t,e,i)=>{t.exports={Alpha:i(4344),AlphaSingle:i(4518),BlendMode:i(5173),ComputedSize:i(1991),Crop:i(8305),Depth:i(3131),Flip:i(9660),FX:i(1626),GetBounds:i(3671),Mask:i(2246),Origin:i(5085),PathFollower:i(77),Pipeline:i(986),PostPipeline:i(4461),ScrollFactor:i(4627),Size:i(1868),Texture:i(4976),TextureCrop:i(9243),Tint:i(5693),ToJSON:i(6125),Transform:i(3212),TransformMatrix:i(4227),Visible:i(8414)}},7361:(t,e,i)=>{var n=i(1953),r=i(8351),s=i(7473),a=i(4286),o=i(3389),h=i(2273),l=i(1392),u=i(3232),c=i(9422),d=i(2529),f=new s({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.PostPipeline,a.Transform,a.Visible,u],initialize:function(t,e,i,n){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(e,i),this.setBlendMode(r.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,n=new l,r=!1;t.setEmpty();for(var s=0;s-1},setAll:function(t,e,i,r){return n.SetAll(this.list,t,e,i,r),this},each:function(t,e){var i,n=[null],r=this.list.slice(),s=r.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},2840:t=>{t.exports=function(t,e,i,n){i.addToRenderList(e);var r=e.list;if(0!==r.length){var s=e.localTransform;n?(s.loadIdentity(),s.multiply(n),s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.scaleX,e.scaleY)):s.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var n=i(1984),r=n,s=n;r=i(4343),s=i(2840),t.exports={renderWebGL:r,renderCanvas:s}},4343:t=>{t.exports=function(t,e,i,n){i.addToRenderList(e);var r=e.list,s=r.length;if(0!==s){var a=e.localTransform;n?(a.loadIdentity(),a.multiply(n),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var o=-1!==e.blendMode;o||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c{t.exports="addedtoscene"},4265:t=>{t.exports="destroy"},8671:t=>{t.exports="removedfromscene"},3420:t=>{t.exports="complete"},601:t=>{t.exports="created"},7919:t=>{t.exports="error"},5241:t=>{t.exports="loop"},3356:t=>{t.exports="play"},7513:t=>{t.exports="seeked"},5788:t=>{t.exports="seeking"},8118:t=>{t.exports="stop"},5529:t=>{t.exports="timeout"},4287:t=>{t.exports="unlocked"},3389:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(6608),DESTROY:i(4265),REMOVED_FROM_SCENE:i(8671),VIDEO_COMPLETE:i(3420),VIDEO_CREATED:i(601),VIDEO_ERROR:i(7919),VIDEO_LOOP:i(5241),VIDEO_PLAY:i(3356),VIDEO_SEEKED:i(7513),VIDEO_SEEKING:i(5788),VIDEO_STOP:i(8118),VIDEO_TIMEOUT:i(5529),VIDEO_UNLOCKED:i(4287)}},1643:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},8881:(t,e,i)=>{var n=i(7655);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},4479:(t,e,i)=>{var n=i(4771),r=i(7655);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=n(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;u{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},284:(t,e,i)=>{var n=i(7473),r=i(8881),s=i(4479),a=i(1643),o=i(3915),h=i(2529),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=n},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return s(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},3915:(t,e,i)=>{var n=i(7655);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},7655:(t,e,i)=>{var n=i(7473),r=i(1643),s=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=r.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=s},5956:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},716:(t,e,i)=>{var n=i(7120),r=i(7655);t.exports=function(t,e,i){if(void 0===i&&(i=new r),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var s=n(t)*e;return e>.5?(s-=t.width+t.height)<=t.width?(i.x=t.right-s,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(s-t.width)):s<=t.width?(i.x=t.x+s,i.y=t.y):(i.x=t.right,i.y=t.y+(s-t.width)),i}},8151:(t,e,i)=>{var n=i(716),r=i(7120);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=r(t)/i);for(var a=0;a{t.exports=function(t){return 2*(t.width+t.height)}},2161:(t,e,i)=>{var n=i(7655);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},1392:(t,e,i)=>{var n=i(7473),r=i(5956),s=i(716),a=i(8151),o=i(1643),h=i(284),l=i(2161),u=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},9422:(t,e,i)=>{var n=i(1392);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=Math.min(t.x,e.x),s=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-r,o=Math.max(t.bottom,e.bottom)-s;return i.setTo(r,s,a,o)}},1593:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1179),a=i(4597),o=i(5593),h=i(7410),l=i(5874),u=i(707),c=new n({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var n=a(e,"url");void 0===n?n=t.path+i+"."+a(e,"extension",""):"string"!=typeof n||n.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(n=t.path+n),this.url=n,this.src="",this.xhrSettings=u(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===r.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=r.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,n=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(n=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,n)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(s.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==r.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(s.FILE_COMPLETE,e,i,t),this.loader.emit(s.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=r.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},9845:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},5593:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},7410:(t,e,i)=>{var n=i(1030),r=i(707);t.exports=function(t,e){var i=void 0===t?r():n({},t);if(e)for(var s in e)void 0!==e[s]&&(i[s]=e[s]);return i}},3137:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1179),a=new n({initialize:function(t,e,i,n){var s=[];n.forEach((function(t){t&&s.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=s,this.state=r.FILE_PENDING,this.complete=!1,this.pending=s.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a{var n=i(7410);t.exports=function(t,e){var i=n(e,t.xhrSettings),r=new XMLHttpRequest;if(r.open("GET",t.src,i.async,i.user,i.password),r.responseType=t.xhrSettings.responseType,r.timeout=i.timeout,i.headers)for(var s in i.headers)r.setRequestHeader(s,i.headers[s]);return i.header&&i.headerValue&&r.setRequestHeader(i.header,i.headerValue),i.requestedWith&&r.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&r.overrideMimeType(i.overrideMimeType),i.withCredentials&&(r.withCredentials=!0),r.onload=t.onLoad.bind(t,r),r.onerror=t.onError.bind(t,r),r.onprogress=t.onProgress.bind(t),r.send(),r}},707:t=>{t.exports=function(t,e,i,n,r,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=0),void 0===s&&(s=!1),{responseType:t,async:e,user:i,password:n,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:s}}},4359:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},462:t=>{t.exports="addfile"},7297:t=>{t.exports="complete"},8660:t=>{t.exports="filecomplete"},6484:t=>{t.exports="filecomplete-"},7972:t=>{t.exports="loaderror"},1906:t=>{t.exports="load"},1441:t=>{t.exports="fileprogress"},1072:t=>{t.exports="postprocess"},1927:t=>{t.exports="progress"},6597:t=>{t.exports="start"},1179:(t,e,i)=>{t.exports={ADD:i(462),COMPLETE:i(7297),FILE_COMPLETE:i(8660),FILE_KEY_COMPLETE:i(6484),FILE_LOAD_ERROR:i(7972),FILE_LOAD:i(1906),FILE_PROGRESS:i(1441),POST_PROCESS:i(1072),PROGRESS:i(1927),START:i(6597)}},6732:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(2482),l=i(5593),u=new n({Extends:s,initialize:function t(e,i,n,r,a){var l,u="png";if(h(i)){var c=i;i=o(c,"key"),n=o(c,"url"),l=o(c,"normalMap"),r=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"frameConfig")}Array.isArray(n)&&(l=n[1],n=n[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:n,xhrSettings:r,config:a};if(s.call(this,e,d),l){var f=new t(e,this.key,l,r,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){s.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){s.revokeObjectURL(t.data),t.onProcessError()},s.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=r.FILE_PROCESSING,t===r.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=r.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=r.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t?t.state>=r.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var n=0;n{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(5851),l=i(2482),u=new n({Extends:s,initialize:function(t,e,i,n,a){var u="json";if(l(e)){var c=e;e=o(c,"key"),i=o(c,"url"),n=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:a};s.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=r.FILE_POPULATED)},onProcess:function(){if(this.state!==r.FILE_POPULATED){this.state=r.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(2482),l=new n({Extends:s,initialize:function(t,e,i,n){var r="text",a="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),n=o(u,"xhrSettings"),a=o(u,"extension",a),r=o(u,"type",r),l=o(u,"cache",l)}var c={type:r,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var n=0;n{t.exports=function(t){for(var e=0,i=0;i{var n=i(3916);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},7025:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},48:t=>{t.exports=function(t,e,i,n,r){var s=.5*(n-e),a=.5*(r-i),o=t*t;return(2*i-2*n+s+a)*(t*o)+(-3*i+3*n-2*s-a)*o+s*t+i}},5035:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},2915:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},7149:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t*n.DEG_TO_RAD}},2975:t=>{t.exports=function(t,e){return Math.abs(t-e)}},2107:(t,e,i)=>{var n=i(2915),r=i(7473),s=i(9652),a=i(1984),o=new s,h=new r({initialize:function t(e,i,n,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=t.DefaultOrder),this._x=e,this._y=i,this._z=n,this._order=r,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,n){return void 0===n&&(n=this._order),this._x=t,this._y=e,this._z=i,this._order=n,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var r=t.val,s=r[0],a=r[4],o=r[8],h=r[1],l=r[5],u=r[9],c=r[2],d=r[6],f=r[10],p=0,v=0,g=0,m=.99999;switch(e){case"XYZ":v=Math.asin(n(o,-1,1)),Math.abs(o){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},104:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},4941:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},1555:(t,e,i)=>{var n=i(2915);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))+e}},5005:t=>{t.exports=function(t,e){return t/e/1e3}},3702:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},8820:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},1743:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},3416:t=>{t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},2149:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*s-a*h,c=-l*r+a*o,d=h*r-s*o,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(a*i-n*s)*f,t[3]=c*f,t[4]=(l*e-n*o)*f,t[5]=(-a*e+n*r)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(s*e-i*r)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=s*l-a*h,t[1]=n*h-i*l,t[2]=i*a-n*s,t[3]=a*o-r*l,t[4]=e*l-n*o,t[5]=n*r-e*a,t[6]=r*h-s*o,t[7]=i*o-e*h,t[8]=e*s-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*s-a*h)+i*(-l*r+a*o)+n*(h*r-s*o)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],v=c[3],g=c[4],m=c[5],M=c[6],x=c[7],y=c[8];return e[0]=d*i+f*s+p*h,e[1]=d*n+f*a+p*l,e[2]=d*r+f*o+p*u,e[3]=v*i+g*s+m*h,e[4]=v*n+g*a+m*l,e[5]=v*r+g*o+m*u,e[6]=M*i+x*s+y*h,e[7]=M*n+x*a+y*l,e[8]=M*r+x*o+y*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*s,e[1]=l*n+h*a,e[2]=l*r+h*o,e[3]=l*s-h*i,e[4]=l*a-h*n,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,r=t.w,s=e+e,a=i+i,o=n+n,h=e*s,l=e*a,u=e*o,c=i*a,d=i*o,f=n*o,p=r*s,v=r*a,g=r*o,m=this.val;return m[0]=1-(c+f),m[3]=l+g,m[6]=u-v,m[1]=l-g,m[4]=1-(h+f),m[7]=d+p,m[2]=u+v,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],v=e[12],g=e[13],m=e[14],M=e[15],x=n*h-r*o,y=n*l-s*o,w=n*u-a*o,E=r*l-s*h,b=r*u-a*h,T=s*u-a*l,A=c*g-d*v,R=c*m-f*v,S=c*M-p*v,C=d*m-f*g,I=d*M-p*g,P=f*M-p*m,L=x*P-y*I+w*C+E*S-b*R+T*A;return L?(L=1/L,i[0]=(h*P-l*I+u*C)*L,i[1]=(l*S-o*P-u*R)*L,i[2]=(o*I-h*S+u*A)*L,i[3]=(s*I-r*P-a*C)*L,i[4]=(n*P-s*S+a*R)*L,i[5]=(r*S-n*I-a*A)*L,i[6]=(g*T-m*b+M*E)*L,i[7]=(m*w-v*T-M*y)*L,i[8]=(v*b-g*w+M*x)*L,this):null}});t.exports=n},9652:(t,e,i)=>{var n=i(7473),r=i(5689),s=1e-6,a=new n({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,n,r,s,a,o,h,l,u,c,d,f,p,v){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=n,g[4]=r,g[5]=s,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=u,g[11]=c,g[12]=d,g[13]=f,g[14]=p,g[15]=v,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var n=o.fromQuat(i).val,r=e.x,s=e.y,a=e.z;return this.setValues(n[0]*r,n[1]*r,n[2]*r,0,n[4]*s,n[5]*s,n[6]*s,0,n[8]*a,n[9]*a,n[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],r=t[6],s=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=n,t[13]=s,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15],m=e*a-i*s,M=e*o-n*s,x=e*h-r*s,y=i*o-n*a,w=i*h-r*a,E=n*h-r*o,b=l*p-u*f,T=l*v-c*f,A=l*g-d*f,R=u*v-c*p,S=u*g-d*p,C=c*g-d*v,I=m*C-M*S+x*R+y*A-w*T+E*b;return I?(I=1/I,this.setValues((a*C-o*S+h*R)*I,(n*S-i*C-r*R)*I,(p*E-v*w+g*y)*I,(c*w-u*E-d*y)*I,(o*A-s*C-h*T)*I,(e*C-n*A+r*T)*I,(v*x-f*E-g*M)*I,(l*E-c*x+d*M)*I,(s*S-a*A+h*b)*I,(i*A-e*S-r*b)*I,(f*w-p*x+g*m)*I,(u*x-l*w-d*m)*I,(a*T-s*R-o*b)*I,(e*R-i*T+n*b)*I,(p*M-f*y-v*m)*I,(l*y-u*M+c*m)*I)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return this.setValues(a*(c*g-d*v)-u*(o*g-h*v)+p*(o*d-h*c),-(i*(c*g-d*v)-u*(n*g-r*v)+p*(n*d-r*c)),i*(o*g-h*v)-a*(n*g-r*v)+p*(n*h-r*o),-(i*(o*d-h*c)-a*(n*d-r*c)+u*(n*h-r*o)),-(s*(c*g-d*v)-l*(o*g-h*v)+f*(o*d-h*c)),e*(c*g-d*v)-l*(n*g-r*v)+f*(n*d-r*c),-(e*(o*g-h*v)-s*(n*g-r*v)+f*(n*h-r*o)),e*(o*d-h*c)-s*(n*d-r*c)+l*(n*h-r*o),s*(u*g-d*p)-l*(a*g-h*p)+f*(a*d-h*u),-(e*(u*g-d*p)-l*(i*g-r*p)+f*(i*d-r*u)),e*(a*g-h*p)-s*(i*g-r*p)+f*(i*h-r*a),-(e*(a*d-h*u)-s*(i*d-r*u)+l*(i*h-r*a)),-(s*(u*v-c*p)-l*(a*v-o*p)+f*(a*c-o*u)),e*(u*v-c*p)-l*(i*v-n*p)+f*(i*c-n*u),-(e*(a*v-o*p)-s*(i*v-n*p)+f*(i*o-n*a)),e*(a*c-o*u)-s*(i*c-n*u)+l*(i*o-n*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return(e*a-i*s)*(c*g-d*v)-(e*o-n*s)*(u*g-d*p)+(e*h-r*s)*(u*v-c*p)+(i*o-n*a)*(l*g-d*f)-(i*h-r*a)*(l*v-c*f)+(n*h-r*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],v=e[13],g=e[14],m=e[15],M=t.val,x=M[0],y=M[1],w=M[2],E=M[3];return e[0]=x*i+y*a+w*u+E*p,e[1]=x*n+y*o+w*c+E*v,e[2]=x*r+y*h+w*d+E*g,e[3]=x*s+y*l+w*f+E*m,x=M[4],y=M[5],w=M[6],E=M[7],e[4]=x*i+y*a+w*u+E*p,e[5]=x*n+y*o+w*c+E*v,e[6]=x*r+y*h+w*d+E*g,e[7]=x*s+y*l+w*f+E*m,x=M[8],y=M[9],w=M[10],E=M[11],e[8]=x*i+y*a+w*u+E*p,e[9]=x*n+y*o+w*c+E*v,e[10]=x*r+y*h+w*d+E*g,e[11]=x*s+y*l+w*f+E*m,x=M[12],y=M[13],w=M[14],E=M[15],e[12]=x*i+y*a+w*u+E*p,e[13]=x*n+y*o+w*c+E*v,e[14]=x*r+y*h+w*d+E*g,e[15]=x*s+y*l+w*f+E*m,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,n=e.val,r=i[0],s=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],f=i[6],p=i[10],v=i[14],g=i[3],m=i[7],M=i[11],x=i[15],y=n[0],w=n[4],E=n[8],b=n[12],T=n[1],A=n[5],R=n[9],S=n[13],C=n[2],I=n[6],P=n[10],L=n[14],O=n[3],_=n[7],k=n[11],F=n[15];return this.setValues(r*y+s*T+a*C+o*O,h*y+l*T+u*C+c*O,d*y+f*T+p*C+v*O,g*y+m*T+M*C+x*O,r*w+s*A+a*I+o*_,h*w+l*A+u*I+c*_,d*w+f*A+p*I+v*_,g*w+m*A+M*I+x*_,r*E+s*R+a*P+o*k,h*E+l*R+u*P+c*k,d*E+f*R+p*P+v*k,g*E+m*R+M*P+x*k,r*b+s*S+a*L+o*F,h*b+l*S+u*L+c*F,d*b+f*S+p*L+v*F,g*b+m*S+M*L+x*F)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var n=this.val;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var n=this.val;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,a=t.y,o=t.z,h=r*s,l=r*a;return this.setValues(h*s+i,h*a-n*o,h*o+n*a,0,h*a+n*o,l*a+i,l*o-n*s,0,h*o-n*a,l*o+n*s,r*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,n=e.x,r=e.y,a=e.z,o=Math.sqrt(n*n+r*r+a*a);if(Math.abs(o){t.exports=function(t,e,i){return Math.min(t+e,i)}},44:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},5385:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},8585:t=>{t.exports=function(t,e,i,n){void 0===i&&(i=e+1);var r=(t-e)/(i-e);return r>1?void 0!==n?(r=(n-t)/(n-i))<0&&(r=0):r=1:r<0&&(r=0),r}},372:(t,e,i)=>{var n=i(7473),r=i(2149),s=i(1984),a=i(5689),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),c=new a(0,1,0),d=new a,f=new r,p=new n({initialize:function(t,e,i,n){this.onChangeCallback=s,this.set(t,e,i,n)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,n,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=n||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=n*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.set(i+e*(t.x-i),n+e*(t.y-n),r+e*(t.z-r),s+e*(t.w-s))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var n=f.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+r*s+i*o-n*a,i*h+r*a+n*s-e*o,n*h+r*o+e*a-i*s,r*h-e*s-i*a-n*o)},slerp:function(t,e){var i=this.x,n=this.y,r=this.z,s=this.w,a=t.x,h=t.y,l=t.z,u=t.w,c=i*a+n*h+r*l+s*u;c<0&&(c=-c,a=-a,h=-h,l=-l,u=-u);var d=1-e,f=e;if(1-c>o){var p=Math.acos(c),v=Math.sin(p);d=Math.sin((1-e)*p)/v,f=Math.sin(e*p)/v}return this.set(d*i+f*a,d*n+f*h,d*r+f*l,d*s+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n,s=r?1/r:0;return this.set(-t*s,-e*s,-i*s,n*s)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a+r*s,i*a+n*s,n*a-i*s,r*a-e*s)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a-n*s,i*a+r*s,n*a+e*s,r*a-i*s)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*s,i*a-e*s,n*a+r*s,r*a-n*s)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,n=t.y/2,r=t.z/2,s=Math.cos(i),a=Math.cos(n),o=Math.cos(r),h=Math.sin(i),l=Math.sin(n),u=Math.sin(r);switch(t.order){case"XYZ":this.set(h*a*o+s*l*u,s*l*o-h*a*u,s*a*u+h*l*o,s*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+s*l*u,s*l*o-h*a*u,s*a*u-h*l*o,s*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-s*l*u,s*l*o+h*a*u,s*a*u+h*l*o,s*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-s*l*u,s*l*o+h*a*u,s*a*u-h*l*o,s*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+s*l*u,s*l*o+h*a*u,s*a*u-h*l*o,s*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-s*l*u,s*l*o-h*a*u,s*a*u+h*l*o,s*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,n=i[0],r=i[4],s=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=n+o+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(s-l)*e,(a-r)*e,.25/e)):n>o&&n>c?(e=2*Math.sqrt(1+n-o-c),this.set(.25*e,(r+a)/e,(s+l)/e,(u-h)/e)):o>c?(e=2*Math.sqrt(1+o-n-c),this.set((r+a)/e,.25*e,(h+u)/e,(s-l)/e)):(e=2*Math.sqrt(1+c-n-o),this.set((s+l)/e,(h+u)/e,.25*e,(a-r)/e)),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var s=h[r],a=h[s];e=Math.sqrt(i[3*r+r]-i[3*s+s]-i[3*a+a]+1),l[r]=.5*e,e=.5/e,l[s]=(i[3*s+r]+i[3*r+s])*e,l[a]=(i[3*a+r]+i[3*r+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+s]-i[3*s+a])*e}return this.onChangeCallback(this),this}});t.exports=p},4208:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t*n.RAD_TO_DEG}},1705:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},6650:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,n=2*Math.random()-1,r=Math.sqrt(1-n*n)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=n*e,t}},2037:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},6283:t=>{t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},9876:t=>{t.exports=function(t,e,i,n){var r=Math.cos(n),s=Math.sin(n),a=t.x-e,o=t.y-i;return t.x=a*r-o*s+e,t.y=a*s+o*r+i,t}},8348:t=>{t.exports=function(t,e,i,n,r){var s=n+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},4497:t=>{t.exports=function(t,e,i,n,r){return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},9640:(t,e,i)=>{var n=i(5689),r=i(9652),s=i(372),a=new r,o=new s,h=new n;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},4078:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},855:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.round(t*n)/n}},4936:t=>{t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var r=[],s=[],a=0;a{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},278:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},163:(t,e,i)=>{var n=i(2529);t.exports=function(t,e,i,r){void 0===r&&(r=new n);var s=0,a=0;return t>0&&t<=e*i&&(s=t>e-1?t-(a=Math.floor(t/e))*e:t),r.set(s,a)}},7556:(t,e,i)=>{var n=i(2529);t.exports=function(t,e,i,r,s,a,o,h){void 0===h&&(h=new n);var l=Math.sin(s),u=Math.cos(s),c=u*a,d=l*a,f=-l*o,p=u*o,v=1/(c*p+f*-d);return h.x=p*v*t+-f*v*e+(r*f-i*p)*v,h.y=c*v*e+-d*v*t+(-r*c+i*d)*v,h}},2529:(t,e,i)=>{var n=i(7473),r=i(12),s=new n({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new s(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return r(this.x,t.x,e)&&r(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});s.ZERO=new s,s.RIGHT=new s(1,0),s.LEFT=new s(-1,0),s.UP=new s(0,-1),s.DOWN=new s(0,1),s.ONE=new s(1,1),t.exports=s},5689:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new n(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=n*o-r*a,this.y=r*s-i*o,this.z=i*a-n*s,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z;return this.x=i*a-n*s,this.y=n*r-e*a,this.z=e*s-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+n*r[6],this.y=e*r[1]+i*r[4]+n*r[7],this.z=e*r[2]+i*r[5]+n*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12],this.y=r[1]*e+r[5]*i+r[9]*n+r[13],this.z=r[2]*e+r[6]*i+r[10]*n+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=e*r[0]+i*r[4]+n*r[8]+r[12],a=e*r[1]+i*r[5]+n*r[9]+r[13],o=e*r[2]+i*r[6]+n*r[10]+r[14],h=e*r[3]+i*r[7]+n*r[11]+r[15];return this.x=s/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*n-a*i,l=o*i+a*e-r*n,u=o*n+r*i-s*e,c=-r*e-s*i-a*n;return this.x=h*o+c*-r+l*-a-u*-s,this.y=l*o+c*-s+u*-r-h*-a,this.z=u*o+c*-a+h*-s-l*-r,this},project:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],c=r[6],d=r[7],f=r[8],p=r[9],v=r[10],g=r[11],m=r[12],M=r[13],x=r[14],y=1/(e*h+i*d+n*g+r[15]);return this.x=(e*s+i*l+n*f+m)*y,this.y=(e*a+i*u+n*p+M)*y,this.z=(e*o+i*c+n*v+x)*y,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,n=t.y,r=t.z,s=t.w,a=this.x-i,o=s-this.y-1-n,h=this.z;return this.x=2*a/r-1,this.y=2*o/s-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});n.ZERO=new n,n.RIGHT=new n(1,0,0),n.LEFT=new n(-1,0,0),n.UP=new n(0,-1,0),n.DOWN=new n(0,1,0),n.FORWARD=new n(0,0,1),n.BACK=new n(0,0,-1),n.ONE=new n(1,1,1),t.exports=n},9279:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=n*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this.w=s+e*(t.w-s),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+n*n+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*n-a*i,l=o*i+a*e-r*n,u=o*n+r*i-s*e,c=-r*e-s*i-a*n;return this.x=h*o+c*-r+l*-a-u*-s,this.y=l*o+c*-s+u*-r-h*-a,this.z=u*o+c*-a+h*-s-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},4119:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},8445:t=>{t.exports=function(t,e,i){if(t>=e&&t<=i)return t;var n=i-e;return e+((t-e)%n+n)%n}},6412:t=>{t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},760:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},6909:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},6947:t=>{t.exports=function(t,e,i,n){return Math.atan2(i-t,n-e)}},3426:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t>Math.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},6906:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},3270:(t,e,i)=>{var n=i(104);t.exports=function(){return n(-Math.PI,Math.PI)}},2748:(t,e,i)=>{var n=i(104);t.exports=function(){return n(-180,180)}},936:(t,e,i)=>{var n=i(6906);t.exports=function(t){return n(t+Math.PI)}},1935:(t,e,i)=>{var n=i(7425);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},3692:(t,e,i)=>{var n=i(8445);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},2820:(t,e,i)=>{var n=i(8445);t.exports=function(t){return n(t,-180,180)}},1833:(t,e,i)=>{t.exports={Between:i(6412),BetweenPoints:i(760),BetweenPointsY:i(6909),BetweenY:i(6947),CounterClockwise:i(3426),Normalize:i(6906),Random:i(3270),RandomDegrees:i(2748),Reverse:i(936),RotateTo:i(1935),ShortestBetween:i(5393),Wrap:i(3692),WrapDegrees:i(2820)}},7425:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},1518:t=>{t.exports=function(t,e,i,n){var r=t-i,s=e-n;return Math.sqrt(r*r+s*s)}},5372:t=>{t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}},4430:t=>{t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},4361:t=>{t.exports=function(t,e,i,n){return Math.max(Math.abs(t-i),Math.abs(e-n))}},7798:t=>{t.exports=function(t,e,i,n,r){return void 0===r&&(r=2),Math.sqrt(Math.pow(i-t,r)+Math.pow(n-e,r))}},8290:t=>{t.exports=function(t,e,i,n){return Math.abs(t-i)+Math.abs(e-n)}},3788:t=>{t.exports=function(t,e,i,n){var r=t-i,s=e-n;return r*r+s*s}},6338:(t,e,i)=>{t.exports={Between:i(1518),BetweenPoints:i(5372),BetweenPointsSquared:i(4430),Chebyshev:i(4361),Power:i(7798),Snake:i(8290),Squared:i(3788)}},5751:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},6203:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},9103:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},4938:(t,e,i)=>{t.exports={In:i(5751),Out:i(9103),InOut:i(6203)}},8677:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},4649:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},504:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},8872:(t,e,i)=>{t.exports={In:i(8677),Out:i(504),InOut:i(4649)}},3170:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},2627:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},1349:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},5006:(t,e,i)=>{t.exports={In:i(3170),Out:i(1349),InOut:i(2627)}},6046:t=>{t.exports=function(t){return t*t*t}},9531:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},4836:t=>{t.exports=function(t){return--t*t*t+1}},875:(t,e,i)=>{t.exports={In:i(6046),Out:i(4836),InOut:i(9531)}},7619:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},7437:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},8119:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},2884:(t,e,i)=>{t.exports={In:i(7619),Out:i(8119),InOut:i(7437)}},5456:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},3461:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},2711:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},6287:(t,e,i)=>{t.exports={In:i(5456),Out:i(2711),InOut:i(3461)}},8613:(t,e,i)=>{t.exports={Back:i(4938),Bounce:i(8872),Circular:i(5006),Cubic:i(875),Elastic:i(2884),Expo:i(6287),Linear:i(4233),Quadratic:i(6341),Quartic:i(762),Quintic:i(345),Sine:i(8698),Stepped:i(7051)}},744:t=>{t.exports=function(t){return t}},4233:(t,e,i)=>{t.exports=i(744)},9810:t=>{t.exports=function(t){return t*t}},8163:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},6123:t=>{t.exports=function(t){return t*(2-t)}},6341:(t,e,i)=>{t.exports={In:i(9810),Out:i(6123),InOut:i(8163)}},7337:t=>{t.exports=function(t){return t*t*t*t}},4878:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},9012:t=>{t.exports=function(t){return 1- --t*t*t*t}},762:(t,e,i)=>{t.exports={In:i(7337),Out:i(9012),InOut:i(4878)}},303:t=>{t.exports=function(t){return t*t*t*t*t}},553:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},1632:t=>{t.exports=function(t){return--t*t*t*t*t+1}},345:(t,e,i)=>{t.exports={In:i(303),Out:i(1632),InOut:i(553)}},8455:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},1844:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},990:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},8698:(t,e,i)=>{t.exports={In:i(8455),Out:i(990),InOut:i(1844)}},6745:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},7051:(t,e,i)=>{t.exports=i(6745)},3158:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},12:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},7373:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},2622:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(3158),Equal:i(12),Floor:i(1326),GreaterThan:i(7373),LessThan:i(2622)}},4675:(t,e,i)=>{var n=i(7425),r=i(1030),s={Angle:i(1833),Distance:i(6338),Easing:i(8613),Fuzzy:i(7927),Interpolation:i(2140),Pow2:i(7897),Snap:i(3943),RandomDataGenerator:i(6957),Average:i(3136),Bernstein:i(785),Between:i(7025),CatmullRom:i(48),CeilTo:i(5035),Clamp:i(2915),DegToRad:i(7149),Difference:i(2975),Euler:i(2107),Factorial:i(3916),FloatBetween:i(104),FloorTo:i(4941),FromPercent:i(1555),GetSpeed:i(5005),IsEven:i(3702),IsEvenStrict:i(8820),Linear:i(1743),LinearXY:i(3416),MaxAdd:i(3733),Median:i(44),MinSub:i(5385),Percent:i(8585),RadToDeg:i(4208),RandomXY:i(1705),RandomXYZ:i(6650),RandomXYZW:i(2037),Rotate:i(6283),RotateAround:i(9876),RotateAroundDistance:i(8348),RotateTo:i(4497),RoundAwayFromZero:i(4078),RoundTo:i(855),SinCosTableGenerator:i(4936),SmootherStep:i(278),SmoothStep:i(2733),ToXY:i(163),TransformXY:i(7556),Within:i(4119),Wrap:i(8445),Vector2:i(2529),Vector3:i(5689),Vector4:i(9279),Matrix3:i(2149),Matrix4:i(9652),Quaternion:i(372),RotateVec3:i(9640)};s=r(!1,s,n),t.exports=s},1640:(t,e,i)=>{var n=i(785);t.exports=function(t,e){for(var i=0,r=t.length-1,s=0;s<=r;s++)i+=Math.pow(1-e,r-s)*Math.pow(e,s)*t[s]*n(r,s);return i}},6105:(t,e,i)=>{var n=i(48);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return t[0]===t[i]?(e<0&&(s=Math.floor(r=i*(1+e))),n(r-s,t[(s-1+i)%i],t[s],t[(s+1)%i],t[(s+2)%i])):e<0?t[0]-(n(-r,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(r-s,t[s?s-1:0],t[s],t[i{t.exports=function(t,e,i,n,r){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,r)}},6765:(t,e,i)=>{var n=i(1743);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return e<0?n(t[0],t[1],r):e>1?n(t[i],t[i-1],i-r):n(t[s],t[s+1>i?i:s+1],r-s)}},6388:t=>{t.exports=function(t,e,i,n){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}},5735:(t,e,i)=>{var n=i(2733);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},8705:(t,e,i)=>{var n=i(278);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},2140:(t,e,i)=>{t.exports={Bezier:i(1640),CatmullRom:i(6105),CubicBezier:i(4002),Linear:i(6765),QuadraticBezier:i(6388),SmoothStep:i(5735),SmootherStep:i(8705)}},5443:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},167:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},7897:(t,e,i)=>{t.exports={GetNext:i(5443),IsSize:i(725),IsValue:i(167)}},6957:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var n=0;n>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),n=t[i];t[i]=t[e],t[e]=n}return t}});t.exports=n},5659:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},5461:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),n?(i+t)/e:i+t)}},5131:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),n?(i+t)/e:i+t)}},3943:(t,e,i)=>{t.exports={Ceil:i(5659),Floor:i(5461),To:i(5131)}},8666:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},8456:t=>{var e={},i={},n={register:function(t,i,n,r){void 0===r&&(r=!1),e[t]={plugin:i,mapping:n,custom:r}},registerCustom:function(t,e,n,r){i[t]={plugin:e,mapping:n,data:r}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=n},5722:(t,e,i)=>{var n=i(8666),r=i(7473),s=i(204),a=new r({Extends:n,initialize:function(t,e,i){n.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(s.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},8351:t=>{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},8196:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},3527:t=>{t.exports="resize"},8618:t=>{t.exports="addedtoscene"},4328:t=>{t.exports="boot"},6099:t=>{t.exports="create"},7645:t=>{t.exports="destroy"},2710:t=>{t.exports="pause"},2547:t=>{t.exports="postupdate"},8577:t=>{t.exports="prerender"},8197:t=>{t.exports="preupdate"},8997:t=>{t.exports="ready"},7604:t=>{t.exports="removedfromscene"},8999:t=>{t.exports="render"},9742:t=>{t.exports="resume"},3667:t=>{t.exports="shutdown"},3468:t=>{t.exports="sleep"},7840:t=>{t.exports="start"},9896:t=>{t.exports="transitioncomplete"},5103:t=>{t.exports="transitioninit"},3162:t=>{t.exports="transitionout"},7841:t=>{t.exports="transitionstart"},6454:t=>{t.exports="transitionwake"},6536:t=>{t.exports="update"},3875:t=>{t.exports="wake"},204:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(8618),BOOT:i(4328),CREATE:i(6099),DESTROY:i(7645),PAUSE:i(2710),POST_UPDATE:i(2547),PRE_RENDER:i(8577),PRE_UPDATE:i(8197),READY:i(8997),REMOVED_FROM_SCENE:i(7604),RENDER:i(8999),RESUME:i(9742),SHUTDOWN:i(3667),SLEEP:i(3468),START:i(7840),TRANSITION_COMPLETE:i(9896),TRANSITION_INIT:i(5103),TRANSITION_OUT:i(3162),TRANSITION_START:i(7841),TRANSITION_WAKE:i(6454),UPDATE:i(6536),WAKE:i(3875)}},2362:(t,e,i)=>{var n=i(7473),r=i(2915),s=i(1030),a=new n({initialize:function(t,e,i,n,r,s,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(s,a,n,r)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var r=this.data,s=r.cut;s.x=i,s.y=n,s.w=t,s.h=e,s.r=i+t,s.b=n+e,r.sourceSize.w=t,r.sourceSize.h=e,r.spriteSourceSize.w=t,r.spriteSourceSize.h=e,r.radius=.5*Math.sqrt(t*t+e*e);var a=r.drawImage;return a.x=i,a.y=n,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,n,r,s){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=n,o.w=r,o.h=s,o.r=i+r,o.b=n+s,this.x=i,this.y=n,this.width=r,this.height=s,this.halfWidth=.5*r,this.halfHeight=.5*s,this.centerX=Math.floor(r/2),this.centerY=Math.floor(s/2),this.updateUVs()},setCropUVs:function(t,e,i,n,s,a,o){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=r(e,0,d)),v=l+(i=r(i,0,f)),g=n=r(n,0,d-e),m=s=r(s,0,f-i),M=this.data;if(M.trim){var x=M.spriteSourceSize,y=e+(n=r(n,0,u-e)),w=i+(s=r(s,0,c-i));if(!(x.ry||x.y>w)){var E=Math.max(x.x,e),b=Math.max(x.y,i),T=Math.min(x.r,y)-E,A=Math.min(x.b,w)-b;g=T,m=A,p=a?h+(u-(E-x.x)-T):h+(E-x.x),v=o?l+(c-(b-x.y)-A):l+(b-x.y),e=E,i=b,n=T,s=A}else p=0,v=0,g=0,m=0}else a&&(p=h+(u-e-n)),o&&(v=l+(c-i-s));var R=this.source.width,S=this.source.height;return t.u0=Math.max(0,p/R),t.v0=Math.max(0,v/S),t.u1=Math.min(1,(p+g)/R),t.v1=Math.min(1,(v+m)/S),t.x=e,t.y=i,t.cx=p,t.cy=v,t.cw=g,t.ch=m,t.width=n,t.height=s,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,n,r,s){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=n,this.u1=r,this.v1=s,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=n;var s=this.source.width,a=this.source.height;return this.u0=t/s,this.v0=e/a,this.u1=(t+i)/s,this.v1=(e+n)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=s(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},1864:t=>{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},3747:t=>{t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},7473:t=>{function e(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function n(t,n,r,a){for(var o in n)if(n.hasOwnProperty(o)){var h=e(n,o,r);if(!1!==h){if(i((a||t).prototype,o)){if(s.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=n[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},1792:t=>{t.exports=function(t,e,i,n,r){if(void 0===r&&(r=t),i>0){var s=i-t.length;if(s<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>s&&(e.splice(s),a=s);for(var o=0;o{t.exports=function(t,e,i,n,r,s){if(void 0===i&&(i=0),void 0===s&&(s=t),n>0){var a=n-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),r&&r.call(s,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;n>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),r&&r.call(s,l)}return e}},2513:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var n=i(2497);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var a=0;if(n(t,r,s))for(var o=r;o{t.exports=function(t,e,i){var n,r=[null];for(n=3;n{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s)){var a,o=[null];for(a=5;a{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var n,r,s=1;if(i){if(te.length&&(s=e.length),i?(n=e[s-1][i],(r=e[s][i])-t<=t-n?e[s]:e[s-1]):(n=e[s-1],(r=e[s])-t<=t-n?r:n)}},4493:t=>{var e=function(t,i){void 0===i&&(i=[]);for(var n=0;n{var n=i(2497);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var a=[];if(n(t,r,s))for(var o=r;o{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var a=r;a{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},8683:t=>{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n>r||(t.splice(n,1),r===t.length-1?t.push(e):t.splice(r,0,e)),t}},546:t=>{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var n=t[i-1],r=t.indexOf(n);t[i]=n,t[r]=e}return t}},1419:t=>{t.exports=function(t,e,i){var n=t.indexOf(e);if(-1===n||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},6512:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,n){var r,s=[],a=!1;if((i||n)&&(a=!0,i||(i=""),n||(n="")),e=e;r--)a?s.push(i+r.toString()+n):s.push(r);else for(r=t;r<=e;r++)a?s.push(i+r.toString()+n):s.push(r);return s}},1316:(t,e,i)=>{var n=i(4078);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var r=[],s=Math.max(n((e-t)/(i||1)),0),a=0;a{function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return te?1:0}var n=function(t,r,s,a,o){for(void 0===s&&(s=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>s;){if(a-s>600){var h=a-s+1,l=r-s+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(s,Math.floor(r-l*c/h+d)),p=Math.min(a,Math.floor(r+(h-l)*c/h+d));n(t,r,f,p,o)}var v=t[r],g=s,m=a;for(e(t,s,r),o(t[a],v)>0&&e(t,s,a);g0;)m--}0===o(t[s],v)?e(t,s,m):e(t,++m,a),m<=r&&(s=m+1),r<=m&&(a=m-1)}};t.exports=n},9703:(t,e,i)=>{var n=i(5851),r=i(4912),s=function(t,e,i){for(var n=[],r=0;r{var n=i(8935);t.exports=function(t,e,i,r){var s;if(void 0===r&&(r=t),!Array.isArray(e))return-1!==(s=t.indexOf(e))?(n(t,s),i&&i.call(r,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(s=t.indexOf(h))&&(n(t,s),o.push(h),i&&i.call(r,h)),a--}return o}},4725:(t,e,i)=>{var n=i(8935);t.exports=function(t,e,i,r){if(void 0===r&&(r=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var s=n(t,e);return i&&i.call(r,s),s}},8780:(t,e,i)=>{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===s&&(s=t),n(t,e,i)){var a=i-e,o=t.splice(e,a);if(r)for(var h=0;h{var n=i(8935);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*i);return n(t,r)}},6960:t=>{t.exports=function(t,e,i){var n=t.indexOf(e),r=t.indexOf(i);return-1!==n&&-1===r&&(t[n]=i,!0)}},1021:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n{t.exports=function(t,e,i,n){var r=t.length;if(e<0||e>r||e>=i||i>r){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},5361:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},3718:(t,e,i)=>{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var a=r;a{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},2071:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},8935:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],r=e;r{var n=i(9356);function r(t,e){return String(t).localeCompare(e)}function s(t,e,i,n){var r,s,a,o,h,l=t.length,u=0,c=2*i;for(r=0;rl&&(s=l),a>l&&(a=l),o=r,h=s;;)if(o{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return t[n]=i,t[r]=e,t}},1953:(t,e,i)=>{t.exports={Matrix:i(1237),Add:i(1792),AddAt:i(2280),BringToTop:i(2513),CountAllMatching:i(1771),Each:i(7883),EachInRange:i(5856),FindClosestInSorted:i(3957),Flatten:i(4493),GetAll:i(6245),GetFirst:i(1647),GetRandom:i(5301),MoveDown:i(1842),MoveTo:i(1419),MoveUp:i(6512),MoveAbove:i(8683),MoveBelow:i(546),NumberArray:i(4130),NumberArrayStep:i(1316),QuickSelect:i(9465),Range:i(9703),Remove:i(7161),RemoveAt:i(4725),RemoveBetween:i(8780),RemoveRandomElement:i(5744),Replace:i(6960),RotateLeft:i(1021),RotateRight:i(4027),SafeRange:i(2497),SendToBack:i(5361),SetAll:i(3718),Shuffle:i(4912),SortByDigits:i(2071),SpliceOne:i(8935),StableSort:i(9992),Swap:i(2372)}},1816:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var n=i(7222),r=i(1816);t.exports=function(t){var e="";if(!r(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},6063:t=>{t.exports=function(t){for(var e=0;e{var n=i(7116);t.exports=function(t){return n(t,180)}},2597:(t,e,i)=>{var n=i(7116);t.exports=function(t){return n(t,90)}},7116:(t,e,i)=>{var n=i(1816),r=i(4780);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=r(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=r(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var n=i(7116);t.exports=function(t){return n(t,-90)}},7711:(t,e,i)=>{var n=i(1021),r=i(4027);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?n(t,Math.abs(i)):r(t,i)),0!==e)for(var s=0;s{t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),r=0;r-1;s--)n[r][s]=t[s][r]}return n}},1237:(t,e,i)=>{t.exports={CheckMatrix:i(1816),MatrixToString:i(6655),ReverseColumns:i(582),ReverseRows:i(6063),Rotate180:i(8321),RotateLeft:i(2597),RotateMatrix:i(7116),RotateRight:i(6285),Translate:i(7711),TransposeMatrix:i(4780)}},3911:t=>{var e=function(t){var i,n,r;if("object"!=typeof t||null===t)return t;for(r in i=Array.isArray(t)?[]:{},t)n=t[r],i[r]=e(n);return i};t.exports=e},1030:(t,e,i)=>{var n=i(2482),r=function(){var t,e,i,s,a,o,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l{var n=i(4675),r=i(5851);t.exports=function(t,e,i){var s=r(t,e,null);if(null===s)return i;if(Array.isArray(s))return n.RND.pick(s);if("object"==typeof s){if(s.hasOwnProperty("randInt"))return n.RND.integerInRange(s.randInt[0],s.randInt[1]);if(s.hasOwnProperty("randFloat"))return n.RND.realInRange(s.randFloat[0],s.randFloat[1])}else if("function"==typeof s)return s(e);return s}},4597:t=>{t.exports=function(t,e,i){var n=typeof t;return t&&"number"!==n&&"string"!==n&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},5851:t=>{t.exports=function(t,e,i,n){if(!t&&!n||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(n&&n.hasOwnProperty(e))return n[e];if(-1!==e.indexOf(".")){for(var r=e.split("."),s=t,a=n,o=i,h=i,l=!0,u=!0,c=0;c{t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},7222:t=>{t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===n&&(n=3);var r=0;if(e+1>=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var s=Math.ceil((r=e-t.length)/2);t=new Array(r-s+1).join(i)+t+new Array(s+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}}},e={};var i=function i(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,i),s.exports}(4513);window.SpinePlugin=i})(); \ No newline at end of file +(()=>{var t={4399:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,s||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,a=new Array(s);r{(function(){var e,i,n,r=this&&this.__extends||(e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},e(t,i)},function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)});!function(t){var e,i,n,s=function(){function t(t,e,i){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var n=0;n0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l>>1;;){if(t[(s+1)*i]<=e?n=s+1:r=s,n==r)return(n+1)*i;s=n+r>>>1}},t.linearSearch=function(t,e,i){for(var n=0,r=t.length-i;n<=r;n+=i)if(t[n]>e)return n;return-1},t}();t.Animation=s,function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(e=t.MixBlend||(t.MixBlend={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(i=t.MixDirection||(t.MixDirection={})),function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"}(n=t.TimelineType||(t.TimelineType={}));var a=function(){function e(i){if(i<=0)throw new Error("frameCount must be > 0: "+i);this.curves=t.Utils.newFloatArray((i-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var i=t*e.BEZIER_SIZE;if(i==this.curves.length)return e.LINEAR;var n=this.curves[i];return n==e.LINEAR?e.LINEAR:n==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,i,n,r,s){var a=.03*(2*-i+r),o=.03*(2*-n+s),h=.006*(3*(i-r)+1),l=.006*(3*(n-s)+1),u=2*a+h,c=2*o+l,d=.3*i+a+.16666667*h,f=.3*n+o+.16666667*l,p=t*e.BEZIER_SIZE,v=this.curves;v[p++]=e.BEZIER;for(var g=d,m=f,M=p+e.BEZIER_SIZE-1;p=n){var u=void 0,c=void 0;return s==h?(u=0,c=0):(u=r[s-2],c=r[s-1]),c+(r[s+1]-c)*(n-u)/(o-u)}var d=r[s-1];return d+(1-d)*(n-o)/(1-o)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=a;var o=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e<<1),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.rotate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+a.ROTATION]=i},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(n=u[u.length-a.ENTRIES]){var f=u[u.length+a.PREV_ROTATION];switch(h){case e.setup:c.rotation=c.data.rotation+f*o;break;case e.first:case e.replace:f+=c.data.rotation-c.rotation,f-=360*(16384-(16384.499999999996-f/360|0));case e.add:c.rotation+=f*o}}else{var p=s.binarySearch(u,n,a.ENTRIES),v=u[p+a.PREV_ROTATION],g=u[p],m=this.getCurvePercent((p>>1)-1,1-(n-g)/(u[p+a.PREV_TIME]-g)),M=u[p+a.ROTATION]-v;switch(M=v+(M-360*(16384-(16384.499999999996-M/360|0)))*m,h){case e.setup:c.rotation=c.data.rotation+(M-360*(16384-(16384.499999999996-M/360|0)))*o;break;case e.first:case e.replace:M+=c.data.rotation-c.rotation;case e.add:c.rotation+=(M-360*(16384-(16384.499999999996-M/360|0)))*o}}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_ROTATION=-1,a.ROTATION=1,a}(a);t.RotateTimeline=o;var h=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.translate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,i,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.X]=i,this.frames[t+a.Y]=n},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_X],f=u[u.length+a.PREV_Y];else{var p=s.binarySearch(u,n,a.ENTRIES);d=u[p+a.PREV_X],f=u[p+a.PREV_Y];var v=u[p],g=this.getCurvePercent(p/a.ENTRIES-1,1-(n-v)/(u[p+a.PREV_TIME]-v));d+=(u[p+a.X]-d)*g,f+=(u[p+a.Y]-f)*g}switch(h){case e.setup:c.x=c.data.x+d*o,c.y=c.data.y+f*o;break;case e.first:case e.replace:c.x+=(c.data.x+d-c.x)*o,c.y+=(c.data.y+f-c.y)*o;break;case e.add:c.x+=d*o,c.y+=f*o}}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_X=-2,a.PREV_Y=-1,a.X=1,a.Y=2,a}(a);t.TranslateTimeline=h;var l=function(a){function o(t){return a.call(this,t)||this}return r(o,a),o.prototype.getPropertyId=function(){return(n.scale<<24)+this.boneIndex},o.prototype.apply=function(n,r,a,h,l,u,c){var d=this.frames,f=n.bones[this.boneIndex];if(f.active)if(a=d[d.length-o.ENTRIES])p=d[d.length+o.PREV_X]*f.data.scaleX,v=d[d.length+o.PREV_Y]*f.data.scaleY;else{var g=s.binarySearch(d,a,o.ENTRIES);p=d[g+o.PREV_X],v=d[g+o.PREV_Y];var m=d[g],M=this.getCurvePercent(g/o.ENTRIES-1,1-(a-m)/(d[g+o.PREV_TIME]-m));p=(p+(d[g+o.X]-p)*M)*f.data.scaleX,v=(v+(d[g+o.Y]-v)*M)*f.data.scaleY}if(1==l)u==e.add?(f.scaleX+=p-f.data.scaleX,f.scaleY+=v-f.data.scaleY):(f.scaleX=p,f.scaleY=v);else{var x=0,y=0;if(c==i.mixOut)switch(u){case e.setup:x=f.data.scaleX,y=f.data.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,f.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-y)*l;break;case e.first:case e.replace:x=f.scaleX,y=f.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,f.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-y)*l;break;case e.add:x=f.scaleX,y=f.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-f.data.scaleX)*l,f.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-f.data.scaleY)*l}else switch(u){case e.setup:x=Math.abs(f.data.scaleX)*t.MathUtils.signum(p),y=Math.abs(f.data.scaleY)*t.MathUtils.signum(v),f.scaleX=x+(p-x)*l,f.scaleY=y+(v-y)*l;break;case e.first:case e.replace:x=Math.abs(f.scaleX)*t.MathUtils.signum(p),y=Math.abs(f.scaleY)*t.MathUtils.signum(v),f.scaleX=x+(p-x)*l,f.scaleY=y+(v-y)*l;break;case e.add:x=t.MathUtils.signum(p),y=t.MathUtils.signum(v),f.scaleX=Math.abs(f.scaleX)*x+(p-Math.abs(f.data.scaleX)*x)*l,f.scaleY=Math.abs(f.scaleY)*y+(v-Math.abs(f.data.scaleY)*y)*l}}}},o}(h);t.ScaleTimeline=l;var u=function(t){function i(e){return t.call(this,e)||this}return r(i,t),i.prototype.getPropertyId=function(){return(n.shear<<24)+this.boneIndex},i.prototype.apply=function(t,n,r,a,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(r=u[u.length-i.ENTRIES])d=u[u.length+i.PREV_X],f=u[u.length+i.PREV_Y];else{var p=s.binarySearch(u,r,i.ENTRIES);d=u[p+i.PREV_X],f=u[p+i.PREV_Y];var v=u[p],g=this.getCurvePercent(p/i.ENTRIES-1,1-(r-v)/(u[p+i.PREV_TIME]-v));d+=(u[p+i.X]-d)*g,f+=(u[p+i.Y]-f)*g}switch(h){case e.setup:c.shearX=c.data.shearX+d*o,c.shearY=c.data.shearY+f*o;break;case e.first:case e.replace:c.shearX+=(c.data.shearX+d-c.shearX)*o,c.shearY+=(c.data.shearY+f-c.shearY)*o;break;case e.add:c.shearX+=d*o,c.shearY+=f*o}}},i}(h);t.ShearTimeline=u;var c=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.color<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,i,n,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=i,this.frames[t+a.G]=n,this.frames[t+a.B]=r,this.frames[t+a.A]=s},a.prototype.apply=function(t,i,n,r,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(n=c[c.length-a.ENTRIES]){var M=c.length;p=c[M+a.PREV_R],v=c[M+a.PREV_G],g=c[M+a.PREV_B],m=c[M+a.PREV_A]}else{var x=s.binarySearch(c,n,a.ENTRIES);p=c[x+a.PREV_R],v=c[x+a.PREV_G],g=c[x+a.PREV_B],m=c[x+a.PREV_A];var y=c[x],w=this.getCurvePercent(x/a.ENTRIES-1,1-(n-y)/(c[x+a.PREV_TIME]-y));p+=(c[x+a.R]-p)*w,v+=(c[x+a.G]-v)*w,g+=(c[x+a.B]-g)*w,m+=(c[x+a.A]-m)*w}if(1==o)u.color.set(p,v,g,m);else{d=u.color;h==e.setup&&d.setFromColor(u.data.color),d.add((p-d.r)*o,(v-d.g)*o,(g-d.b)*o,(m-d.a)*o)}}}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_R=-4,a.PREV_G=-3,a.PREV_B=-2,a.PREV_A=-1,a.R=1,a.G=2,a.B=3,a.A=4,a}(a);t.ColorTimeline=c;var d=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.twoColor<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,i,n,r,s,o,h,l){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=i,this.frames[t+a.G]=n,this.frames[t+a.B]=r,this.frames[t+a.A]=s,this.frames[t+a.R2]=o,this.frames[t+a.G2]=h,this.frames[t+a.B2]=l},a.prototype.apply=function(t,i,n,r,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(n=c[c.length-a.ENTRIES]){var b=c.length;g=c[b+a.PREV_R],m=c[b+a.PREV_G],M=c[b+a.PREV_B],x=c[b+a.PREV_A],y=c[b+a.PREV_R2],w=c[b+a.PREV_G2],E=c[b+a.PREV_B2]}else{var T=s.binarySearch(c,n,a.ENTRIES);g=c[T+a.PREV_R],m=c[T+a.PREV_G],M=c[T+a.PREV_B],x=c[T+a.PREV_A],y=c[T+a.PREV_R2],w=c[T+a.PREV_G2],E=c[T+a.PREV_B2];var A=c[T],R=this.getCurvePercent(T/a.ENTRIES-1,1-(n-A)/(c[T+a.PREV_TIME]-A));g+=(c[T+a.R]-g)*R,m+=(c[T+a.G]-m)*R,M+=(c[T+a.B]-M)*R,x+=(c[T+a.A]-x)*R,y+=(c[T+a.R2]-y)*R,w+=(c[T+a.G2]-w)*R,E+=(c[T+a.B2]-E)*R}if(1==o)u.color.set(g,m,M,x),u.darkColor.set(y,w,E,1);else{d=u.color,f=u.darkColor;h==e.setup&&(d.setFromColor(u.data.color),f.setFromColor(u.data.darkColor)),d.add((g-d.r)*o,(m-d.g)*o,(M-d.b)*o,(x-d.a)*o),f.add((y-f.r)*o,(w-f.g)*o,(E-f.b)*o,0)}}}},a.ENTRIES=8,a.PREV_TIME=-8,a.PREV_R=-7,a.PREV_G=-6,a.PREV_B=-5,a.PREV_A=-4,a.PREV_R2=-3,a.PREV_G2=-2,a.PREV_B2=-1,a.R=1,a.G=2,a.B=3,a.A=4,a.R2=5,a.G2=6,a.B2=7,a}(a);t.TwoColorTimeline=d;var f=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return r.prototype.getPropertyId=function(){return(n.attachment<<24)+this.slotIndex},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},r.prototype.apply=function(t,n,r,a,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active)if(l!=i.mixOut){var c=this.frames;if(r=c[c.length-1]?c.length-1:s.binarySearch(c,r,1)-1;var f=this.attachmentNames[d];t.slots[this.slotIndex].setAttachment(null==f?null:t.getAttachment(this.slotIndex,f))}}else h==e.setup&&this.setAttachment(t,u,u.data.attachmentName)},r.prototype.setAttachment=function(t,e,i){e.setAttachment(null==i?null:t.getAttachment(this.slotIndex,i))},r}();t.AttachmentTimeline=f;var p=null,v=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e),n.frameVertices=new Array(e),null==p&&(p=t.Utils.newFloatArray(64)),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.deform<<27)+ +this.attachment.id+this.slotIndex},a.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.frameVertices[t]=i},a.prototype.apply=function(i,n,r,a,o,h,l){var u=i.slots[this.slotIndex];if(u.bone.active){var c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.deformAttachment==this.attachment){var d=u.deform;0==d.length&&(h=e.setup);var f=this.frameVertices,p=f[0].length,v=this.frames;if(r=v[v.length-1]){var w=f[v.length-1];if(1==o)if(h==e.add)if(null==(g=c).bones){M=g.vertices;for(var E=0;Ei)this.apply(t,e,Number.MAX_VALUE,n,r,a,o),e=-1;else if(e>=h[l-1])return;if(!(i0&&h[u-1]==c;)u--;for(;u=h[u];u++)n.push(this.events[u])}}},e}();t.EventTimeline=g;var m=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return r.prototype.getPropertyId=function(){return n.drawOrder<<24},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.drawOrders[t]=i},r.prototype.apply=function(n,r,a,o,h,l,u){var c=n.drawOrder,d=n.slots;if(u!=i.mixOut){var f=this.frames;if(a=f[f.length-1]?f.length-1:s.binarySearch(f,a)-1;var v=this.drawOrders[p];if(null==v)t.Utils.arrayCopy(d,0,c,0,d.length);else for(var g=0,m=v.length;g=c[c.length-o.ENTRIES])l==e.setup?(d.mix=d.data.mix+(c[c.length+o.PREV_MIX]-d.data.mix)*h,d.softness=d.data.softness+(c[c.length+o.PREV_SOFTNESS]-d.data.softness)*h,u==i.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],d.compress=0!=c[c.length+o.PREV_COMPRESS],d.stretch=0!=c[c.length+o.PREV_STRETCH])):(d.mix+=(c[c.length+o.PREV_MIX]-d.mix)*h,d.softness+=(c[c.length+o.PREV_SOFTNESS]-d.softness)*h,u==i.mixIn&&(d.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],d.compress=0!=c[c.length+o.PREV_COMPRESS],d.stretch=0!=c[c.length+o.PREV_STRETCH]));else{var f=s.binarySearch(c,r,o.ENTRIES),p=c[f+o.PREV_MIX],v=c[f+o.PREV_SOFTNESS],g=c[f],m=this.getCurvePercent(f/o.ENTRIES-1,1-(r-g)/(c[f+o.PREV_TIME]-g));l==e.setup?(d.mix=d.data.mix+(p+(c[f+o.MIX]-p)*m-d.data.mix)*h,d.softness=d.data.softness+(v+(c[f+o.SOFTNESS]-v)*m-d.data.softness)*h,u==i.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=c[f+o.PREV_BEND_DIRECTION],d.compress=0!=c[f+o.PREV_COMPRESS],d.stretch=0!=c[f+o.PREV_STRETCH])):(d.mix+=(p+(c[f+o.MIX]-p)*m-d.mix)*h,d.softness+=(v+(c[f+o.SOFTNESS]-v)*m-d.softness)*h,u==i.mixIn&&(d.bendDirection=c[f+o.PREV_BEND_DIRECTION],d.compress=0!=c[f+o.PREV_COMPRESS],d.stretch=0!=c[f+o.PREV_STRETCH]))}},o.ENTRIES=6,o.PREV_TIME=-6,o.PREV_MIX=-5,o.PREV_SOFTNESS=-4,o.PREV_BEND_DIRECTION=-3,o.PREV_COMPRESS=-2,o.PREV_STRETCH=-1,o.MIX=1,o.SOFTNESS=2,o.BEND_DIRECTION=3,o.COMPRESS=4,o.STRETCH=5,o}(a);t.IkConstraintTimeline=M;var x=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.transformConstraint<<24)+this.transformConstraintIndex},a.prototype.setFrame=function(t,e,i,n,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=i,this.frames[t+a.TRANSLATE]=n,this.frames[t+a.SCALE]=r,this.frames[t+a.SHEAR]=s},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES]){var m=u.length;f=u[m+a.PREV_ROTATE],p=u[m+a.PREV_TRANSLATE],v=u[m+a.PREV_SCALE],g=u[m+a.PREV_SHEAR]}else{var M=s.binarySearch(u,n,a.ENTRIES);f=u[M+a.PREV_ROTATE],p=u[M+a.PREV_TRANSLATE],v=u[M+a.PREV_SCALE],g=u[M+a.PREV_SHEAR];var x=u[M],y=this.getCurvePercent(M/a.ENTRIES-1,1-(n-x)/(u[M+a.PREV_TIME]-x));f+=(u[M+a.ROTATE]-f)*y,p+=(u[M+a.TRANSLATE]-p)*y,v+=(u[M+a.SCALE]-v)*y,g+=(u[M+a.SHEAR]-g)*y}if(h==e.setup){d=c.data;c.rotateMix=d.rotateMix+(f-d.rotateMix)*o,c.translateMix=d.translateMix+(p-d.translateMix)*o,c.scaleMix=d.scaleMix+(v-d.scaleMix)*o,c.shearMix=d.shearMix+(g-d.shearMix)*o}else c.rotateMix+=(f-c.rotateMix)*o,c.translateMix+=(p-c.translateMix)*o,c.scaleMix+=(v-c.scaleMix)*o,c.shearMix+=(g-c.shearMix)*o}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_ROTATE=-4,a.PREV_TRANSLATE=-3,a.PREV_SCALE=-2,a.PREV_SHEAR=-1,a.ROTATE=1,a.TRANSLATE=2,a.SCALE=3,a.SHEAR=4,a}(a);t.TransformConstraintTimeline=x;var y=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.pathConstraintPosition<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,i){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.VALUE]=i},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_VALUE];else{var f=s.binarySearch(u,n,a.ENTRIES);d=u[f+a.PREV_VALUE];var p=u[f],v=this.getCurvePercent(f/a.ENTRIES-1,1-(n-p)/(u[f+a.PREV_TIME]-p));d+=(u[f+a.VALUE]-d)*v}h==e.setup?c.position=c.data.position+(d-c.data.position)*o:c.position+=(d-c.position)*o}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_VALUE=-1,a.VALUE=1,a}(a);t.PathConstraintPositionTimeline=y;var w=function(t){function i(e){return t.call(this,e)||this}return r(i,t),i.prototype.getPropertyId=function(){return(n.pathConstraintSpacing<<24)+this.pathConstraintIndex},i.prototype.apply=function(t,n,r,a,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(r=u[u.length-i.ENTRIES])d=u[u.length+i.PREV_VALUE];else{var f=s.binarySearch(u,r,i.ENTRIES);d=u[f+i.PREV_VALUE];var p=u[f],v=this.getCurvePercent(f/i.ENTRIES-1,1-(r-p)/(u[f+i.PREV_TIME]-p));d+=(u[f+i.VALUE]-d)*v}h==e.setup?c.spacing=c.data.spacing+(d-c.data.spacing)*o:c.spacing+=(d-c.spacing)*o}},i}(y);t.PathConstraintSpacingTimeline=w;var E=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.pathConstraintMix<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,i,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=i,this.frames[t+a.TRANSLATE]=n},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_ROTATE],f=u[u.length+a.PREV_TRANSLATE];else{var p=s.binarySearch(u,n,a.ENTRIES);d=u[p+a.PREV_ROTATE],f=u[p+a.PREV_TRANSLATE];var v=u[p],g=this.getCurvePercent(p/a.ENTRIES-1,1-(n-v)/(u[p+a.PREV_TIME]-v));d+=(u[p+a.ROTATE]-d)*g,f+=(u[p+a.TRANSLATE]-f)*g}h==e.setup?(c.rotateMix=c.data.rotateMix+(d-c.data.rotateMix)*o,c.translateMix=c.data.translateMix+(f-c.data.translateMix)*o):(c.rotateMix+=(d-c.rotateMix)*o,c.translateMix+=(f-c.translateMix)*o)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_ROTATE=-2,a.PREV_TRANSLATE=-1,a.ROTATE=1,a.TRANSLATE=2,a}(a);t.PathConstraintMixTimeline=E}(n||(n={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.trackEntryPool=new t.Pool((function(){return new i})),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,i=0,n=e.length;i0){if(r.delay-=s,r.delay>0)continue;s=-r.delay,r.delay=0}var a=r.next;if(null!=a){var o=r.trackLast-a.delay;if(o>=0){for(a.delay=0,a.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*a.timeScale,r.trackTime+=s,this.setCurrent(i,a,!0);null!=a.mixingFrom;)a.mixTime+=t,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&null==r.mixingFrom){e[i]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,null!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=s}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var i=t.mixingFrom;if(null==i)return!0;var n=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,null!=i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(i){if(null==i)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var n=this.events,r=this.tracks,s=!1,a=0,o=r.length;a0)){s=!0;var l=0==a?t.MixBlend.first:h.mixBlend,u=h.alpha;null!=h.mixingFrom?u*=this.applyMixingFrom(h,i,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,d=h.getAnimationTime(),f=h.animation.timelines.length,p=h.animation.timelines;if(0==a&&1==u||l==t.MixBlend.add)for(var v=0;v1&&(a=1),r!=t.MixBlend.first&&(r=s.mixBlend));var o=a0&&this.queueEvents(s,c),this.events.length=0,s.nextAnimationLast=c,s.nextTrackLast=s.trackTime,a},e.prototype.applyAttachmentTimeline=function(i,n,r,s,a){var o=n.slots[i.slotIndex];if(o.bone.active){var h,l=i.frames;if(r=l[l.length-1]?l.length-1:t.Animation.binarySearch(l,r)-1,this.setAttachment(n,o,i.attachmentNames[h],a);o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+e.SETUP)}},e.prototype.setAttachment=function(t,i,n,r){i.setAttachment(null==n?null:t.getAttachment(i.data.index,n)),r&&(i.attachmentState=this.unkeyedState+e.CURRENT)},e.prototype.applyRotateTimeline=function(e,i,n,r,s,a,o,h){if(h&&(a[o]=0),1!=r){var l=e,u=l.frames,c=i.bones[l.boneIndex];if(c.active){var d=0,f=0;if(n=u[u.length-t.RotateTimeline.ENTRIES])f=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(u,n,t.RotateTimeline.ENTRIES),v=u[p+t.RotateTimeline.PREV_ROTATION],g=u[p],m=l.getCurvePercent((p>>1)-1,1-(n-g)/(u[p+t.RotateTimeline.PREV_TIME]-g));f=u[p+t.RotateTimeline.ROTATION]-v,f=v+(f-=360*(16384-(16384.499999999996-f/360|0)))*m+c.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0))}var M=0,x=f-d;if(0==(x-=360*(16384-(16384.499999999996-x/360|0))))M=a[o];else{var y=0,w=0;h?(y=0,w=x):(y=a[o],w=a[o+1]);var E=x>0,b=y>=0;t.MathUtils.signum(w)!=t.MathUtils.signum(x)&&Math.abs(w)<=90&&(Math.abs(y)>180&&(y+=360*t.MathUtils.signum(y)),b=E),M=x+y-y%360,b!=E&&(M+=360*t.MathUtils.signum(y)),a[o]=M}a[o+1]=x,d+=M*r,c.rotation=d-360*(16384-(16384.499999999996-d/360|0))}}else e.apply(i,0,n,null,1,s,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var i=t.animationStart,n=t.animationEnd,r=n-i,s=t.trackLast%r,a=this.events,o=0,h=a.length;on||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:e>=n&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var i=e;;){var n=i.mixingFrom;if(null==n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,i){var n=this.expandToIndex(t);this.tracks[t]=e,null!=n&&(i&&this.queue.interrupt(n),e.mixingFrom=n,n.mixingTo=e,e.mixTime=0,null!=n.mixingFrom&&n.mixDuration>0&&(e.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,i){var n=this.data.skeletonData.findAnimation(e);if(null==n)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,n,i)},e.prototype.setAnimationWith=function(t,e,i){if(null==e)throw new Error("animation cannot be null.");var n=!0,r=this.expandToIndex(t);null!=r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.disposeNext(r),r=r.mixingFrom,n=!1):this.disposeNext(r));var s=this.trackEntry(t,e,i,r);return this.setCurrent(t,s,n),this.queue.drain(),s},e.prototype.addAnimation=function(t,e,i,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,i,n)},e.prototype.addAnimationWith=function(t,e,i,n){if(null==e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(null!=r)for(;null!=r.next;)r=r.next;var s=this.trackEntry(t,e,i,r);if(null==r)this.setCurrent(t,s,!0),this.queue.drain();else if(r.next=s,n<=0){var a=r.animationEnd-r.animationStart;0!=a?(r.loop?n+=a*(1+(r.trackTime/a|0)):n+=Math.max(a,r.trackTime),n-=this.data.getMix(r.animation,e)):n=r.trackTime}return s.delay=n,s},e.prototype.setEmptyAnimation=function(t,i){var n=this.setAnimationWith(t,e.emptyAnimation,!1);return n.mixDuration=i,n.trackEnd=i,n},e.prototype.addEmptyAnimation=function(t,i,n){n<=0&&(n-=i);var r=this.addAnimationWith(t,e.emptyAnimation,!1,n);return r.mixDuration=i,r.trackEnd=i,r},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var i=0,n=this.tracks.length;i0){a[l]=e.HOLD_MIX,o[l]=d;continue t}break}a[l]=e.HOLD_FIRST}else a[l]=e.SUBSEQUENT}},e.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.emptyAnimation=new t.Animation("",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.HOLD_SUBSEQUENT=2,e.HOLD_FIRST=3,e.HOLD_MIX=4,e.SETUP=1,e.CURRENT=2,e}();t.AnimationState=e;var i=function(){function e(){this.mixBlend=t.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return e.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},e.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},e.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},e}();t.TrackEntry=i;var n,r=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(n.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(n.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(n.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(n.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(n.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(n.event),this.objects.push(t),this.objects.push(e)},t.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,i=0;i=0?e.substring(0,e.lastIndexOf("/")):"";e=this.pathPrefix+e,this.toLoad++,this.downloadText(e,(function(a){var o={count:0},h=new Array;try{new t.TextureAtlas(a,(function(e){h.push(""==s?e:s+"/"+e);var i=document.createElement("img");return i.width=16,i.height=16,new t.FakeTexture(i)}))}catch(t){var l=t;return r.errors[e]="Couldn't load texture atlas ".concat(e,": ").concat(l.message),n&&n(e,"Couldn't load texture atlas ".concat(e,": ").concat(l.message)),r.toLoad--,void r.loaded++}for(var u=function(l){var u=!1;r.loadTexture(l,(function(l,c){if(o.count++,o.count==h.length)if(u)r.errors[e]="Couldn't load texture atlas page ".concat(l,"} of atlas ").concat(e),n&&n(e,"Couldn't load texture atlas page ".concat(l," of atlas ").concat(e)),r.toLoad--,r.loaded++;else try{var d=new t.TextureAtlas(a,(function(t){return r.get(""==s?t:s+"/"+t)}));r.assets[e]=d,i&&i(e,d),r.toLoad--,r.loaded++}catch(t){var f=t;r.errors[e]="Couldn't load texture atlas ".concat(e,": ").concat(f.message),n&&n(e,"Couldn't load texture atlas ".concat(e,": ").concat(f.message)),r.toLoad--,r.loaded++}}),(function(t,i){u=!0,o.count++,o.count==h.length&&(r.errors[e]="Couldn't load texture atlas page ".concat(t,"} of atlas ").concat(e),n&&n(e,"Couldn't load texture atlas page ".concat(t," of atlas ").concat(e)),r.toLoad--,r.loaded++)}))},c=0,d=h;c0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(n||(n={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in atlas: "+n+" (region attachment: "+i+")");r.renderObject=r;var s=new t.RegionAttachment(i);return s.setRegion(r),s},e.prototype.newMeshAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in atlas: "+n+" (mesh attachment: "+i+")");r.renderObject=r;var s=new t.MeshAttachment(i);return s.region=r,s},e.prototype.newBoundingBoxAttachment=function(e,i){return new t.BoundingBoxAttachment(i)},e.prototype.newPathAttachment=function(e,i){return new t.PathAttachment(i)},e.prototype.newPointAttachment=function(e,i){return new t.PointAttachment(i)},e.prototype.newClippingAttachment=function(e,i){return new t.ClippingAttachment(i)},e}();t.AtlasAttachmentLoader=e}(n||(n={})),function(t){!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(t.BlendMode||(t.BlendMode={}))}(n||(n={})),function(t){var e=function(){function e(t,e,i){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}return e.prototype.isActive=function(){return this.active},e.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,i,n,r,s,a,o){this.ax=e,this.ay=i,this.arotation=n,this.ascaleX=r,this.ascaleY=s,this.ashearX=a,this.ashearY=o,this.appliedValid=!0;var h=this.parent;if(null==h){var l=this.skeleton,u=n+90+o,c=l.scaleX,d=l.scaleY;return this.a=t.MathUtils.cosDeg(n+a)*r*c,this.b=t.MathUtils.cosDeg(u)*s*c,this.c=t.MathUtils.sinDeg(n+a)*r*d,this.d=t.MathUtils.sinDeg(u)*s*d,this.worldX=e*c+l.x,void(this.worldY=i*d+l.y)}var f=h.a,p=h.b,v=h.c,g=h.d;switch(this.worldX=f*e+p*i+h.worldX,this.worldY=v*e+g*i+h.worldY,this.data.transformMode){case t.TransformMode.Normal:u=n+90+o;var m=t.MathUtils.cosDeg(n+a)*r,M=t.MathUtils.cosDeg(u)*s,x=t.MathUtils.sinDeg(n+a)*r,y=t.MathUtils.sinDeg(u)*s;return this.a=f*m+p*x,this.b=f*M+p*y,this.c=v*m+g*x,void(this.d=v*M+g*y);case t.TransformMode.OnlyTranslation:u=n+90+o;this.a=t.MathUtils.cosDeg(n+a)*r,this.b=t.MathUtils.cosDeg(u)*s,this.c=t.MathUtils.sinDeg(n+a)*r,this.d=t.MathUtils.sinDeg(u)*s;break;case t.TransformMode.NoRotationOrReflection:var w=0;(T=f*f+v*v)>1e-4?(T=Math.abs(f*g-p*v)/T,f/=this.skeleton.scaleX,p=(v/=this.skeleton.scaleY)*T,g=f*T,w=Math.atan2(v,f)*t.MathUtils.radDeg):(f=0,v=0,w=90-Math.atan2(g,p)*t.MathUtils.radDeg);var E=n+a-w,b=n+o-w+90;m=t.MathUtils.cosDeg(E)*r,M=t.MathUtils.cosDeg(b)*s,x=t.MathUtils.sinDeg(E)*r,y=t.MathUtils.sinDeg(b)*s;this.a=f*m-p*x,this.b=f*M-p*y,this.c=v*m+g*x,this.d=v*M+g*y;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var T,A=t.MathUtils.cosDeg(n),R=t.MathUtils.sinDeg(n),S=(f*A+p*R)/this.skeleton.scaleX,C=(v*A+g*R)/this.skeleton.scaleY;(T=Math.sqrt(S*S+C*C))>1e-5&&(T=1/T),S*=T,C*=T,T=Math.sqrt(S*S+C*C),this.data.transformMode==t.TransformMode.NoScale&&f*g-p*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(T=-T);var I=Math.PI/2+Math.atan2(C,S),P=Math.cos(I)*T,L=Math.sin(I)*T;m=t.MathUtils.cosDeg(a)*r,M=t.MathUtils.cosDeg(90+o)*s,x=t.MathUtils.sinDeg(a)*r,y=t.MathUtils.sinDeg(90+o)*s;this.a=S*m+P*x,this.b=S*M+P*y,this.c=C*m+L*x,this.d=C*M+L*y}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},e.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*t.MathUtils.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*t.MathUtils.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var e=this.parent;if(null==e)return this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);var i=e.a,n=e.b,r=e.c,s=e.d,a=1/(i*s-n*r),o=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=o*s*a-h*n*a,this.ay=h*i*a-o*r*a;var l=a*s,u=a*i,c=a*n,d=a*r,f=l*this.a-c*this.c,p=l*this.b-c*this.d,v=u*this.c-d*this.a,g=u*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var m=f*g-p*v;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(f*p+v*g,m)*t.MathUtils.radDeg,this.arotation=Math.atan2(v,f)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,i=this.b,n=this.c,r=this.d,s=1/(e*r-i*n),a=t.x-this.worldX,o=t.y-this.worldY;return t.x=a*r*s-o*i*s,t.y=o*e*s-a*n*s,t},e.prototype.localToWorld=function(t){var e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t},e.prototype.worldToLocalRotation=function(e){var i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return Math.atan2(this.a*i-this.c*n,this.d*n-this.b*i)*t.MathUtils.radDeg+this.rotation-this.shearX},e.prototype.localToWorldRotation=function(e){e-=this.rotation-this.shearX;var i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return Math.atan2(n*this.c+i*this.d,n*this.a+i*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var i=this.a,n=this.b,r=this.c,s=this.d,a=t.MathUtils.cosDeg(e),o=t.MathUtils.sinDeg(e);this.a=a*i-o*r,this.b=a*n-o*s,this.c=o*i+a*r,this.d=o*n+a*s,this.appliedValid=!1},e}();t.Bone=e}(n||(n={})),function(t){var e,i=function(i,n,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=e.Normal,this.skinRequired=!1,this.color=new t.Color,i<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");this.index=i,this.name=n,this.parent=r};t.BoneData=i,function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(e=t.TransformMode||(t.TransformMode={}))}(n||(n={})),function(t){var e=function(t,e,i){this.name=t,this.order=e,this.skinRequired=i};t.ConstraintData=e}(n||(n={})),function(t){var e=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e};t.Event=e}(n||(n={})),function(t){var e=function(t){this.name=t};t.EventData=e}(n||(n={})),function(t){var e=function(){function e(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var i=0;i180?f-=360:f<-180&&(f+=360);var E=e.ascaleX,b=e.ascaleY;if(r||s){switch(e.data.transformMode){case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:p=i-e.worldX,v=n-e.worldY}var T=e.data.length*E,A=Math.sqrt(p*p+v*v);if(r&&AT&&T>1e-4)E*=g=(A/T-1)*o+1,a&&(b*=g)}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*o,E,b,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,i,n,r,s,a,o,h){if(0!=h){e.appliedValid||e.updateAppliedTransform(),i.appliedValid||i.updateAppliedTransform();var l=e.ax,u=e.ay,c=e.ascaleX,d=c,f=e.ascaleY,p=i.ascaleX,v=0,g=0,m=0;c<0?(c=-c,v=180,m=-1):(v=0,m=1),f<0&&(f=-f,m=-m),p<0?(p=-p,g=180):g=0;var M=i.ax,x=0,y=0,w=0,E=e.a,b=e.b,T=e.c,A=e.d,R=Math.abs(c-f)<=1e-4;R?(y=E*M+b*(x=i.ay)+e.worldX,w=T*M+A*x+e.worldY):(x=0,y=E*M+e.worldX,w=T*M+e.worldY);var S=e.parent;E=S.a,b=S.b,T=S.c;var C,I,P=1/(E*(A=S.d)-b*T),L=y-S.worldX,O=w-S.worldY,_=(L*A-O*b)*P-l,k=(O*E-L*T)*P-u,F=Math.sqrt(_*_+k*k),D=i.data.length*p;if(F<1e-4)return this.apply1(e,n,r,!1,a,!1,h),void i.updateWorldTransformWith(M,x,0,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY);var V=((L=n-S.worldX)*A-(O=r-S.worldY)*b)*P-l,N=(O*E-L*T)*P-u,X=V*V+N*N;if(0!=o){o*=c*(p+1)/2;var B=Math.sqrt(X),Y=B-F-D*c+o;if(Y>0){var U=Math.min(1,Y/(2*o))-1;X=(V-=(U=(Y-o*(1-U*U))/B)*V)*V+(N-=U*N)*N}}t:if(R){var z=(X-F*F-(D*=c)*D)/(2*F*D);z<-1?z=-1:z>1&&(z=1,a&&(d*=(Math.sqrt(X)/(F+D)-1)*h+1)),I=Math.acos(z)*s,E=F+D*z,b=D*Math.sin(I),C=Math.atan2(N*E-V*b,V*E+N*b)}else{var W=(E=c*D)*E,G=(b=f*D)*b,H=Math.atan2(N,V),q=-2*G*F,j=G-W;if((A=q*q-4*j*(T=G*F*F+W*X-W*G))>=0){var Z=Math.sqrt(A);q<0&&(Z=-Z);var K=(Z=-(q+Z)/2)/j,Q=T/Z,$=Math.abs(K)=-1&&T<=1&&(T=Math.acos(T),(A=(L=E*Math.cos(T)+F)*L+(O=b*Math.sin(T))*O)st&&(nt=T,st=A,rt=L,at=O)),X<=(et+st)/2?(C=H-Math.atan2(it*s,tt),I=J*s):(C=H-Math.atan2(at*s,rt),I=nt*s)}var ot=Math.atan2(x,M)*m,ht=e.arotation;(C=(C-ot)*t.MathUtils.radDeg+v-ht)>180?C-=360:C<-180&&(C+=360),e.updateWorldTransformWith(l,u,ht+C*h,d,e.ascaleY,0,0),ht=i.arotation,(I=((I+ot)*t.MathUtils.radDeg-i.ashearX)*m+g-ht)>180?I-=360:I<-180&&(I+=360),i.updateWorldTransformWith(M,x,ht+I*h,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY)}else i.updateWorldTransform()},e}();t.IkConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i.bendDirection=1,i.compress=!1,i.stretch=!1,i.uniform=!1,i.mix=1,i.softness=0,i}return r(e,t),e}(t.ConstraintData);t.IkConstraintData=e}(n||(n={})),function(t){var e=function(){function e(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var i=0,n=t.bones.length;i0;if(r>0||s){var a=this.data,o=a.spacingMode==t.SpacingMode.Percent,h=a.rotateMode,l=h==t.RotateMode.Tangent,u=h==t.RotateMode.ChainScale,c=this.bones.length,d=l?c:c+1,f=this.bones,p=t.Utils.setArraySize(this.spaces,d),v=null,g=this.spacing;if(u||!o){u&&(v=t.Utils.setArraySize(this.lengths,c));for(var m=a.spacingMode==t.SpacingMode.Length,M=0,x=d-1;M0?t.MathUtils.degRad:-t.MathUtils.degRad;M=0;for(var P=3;Mt.MathUtils.PI?B-=t.MathUtils.PI2:B<-t.MathUtils.PI&&(B+=t.MathUtils.PI2),B*=n,Y=Math.cos(B),U=Math.sin(B),L.a=Y*D-U*N,L.b=Y*V-U*X,L.c=U*D+Y*N,L.d=U*V+Y*X}L.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(i,n,r,s,a){var o=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*n+2),c=null,d=i.closed,f=i.worldVerticesLength,p=f/6,v=e.NONE;if(!i.constantSpeed){var g=i.lengths,m=g[p-=d?1:2];if(s&&(h*=m),a)for(var M=1;Mm){v!=e.AFTER&&(v=e.AFTER,i.computeWorldVertices(o,f-6,4,c,0,2)),this.addAfterPosition(w-m,c,0,u,x);continue}}for(;;y++){var E=g[y];if(!(w>E)){if(0==y)w/=E;else w=(w-(Z=g[y-1]))/(E-Z);break}}y!=v&&(v=y,d&&y==p?(i.computeWorldVertices(o,f-4,4,c,0,2),i.computeWorldVertices(o,0,4,c,4,2)):i.computeWorldVertices(o,6*y+2,8,c,0,2)),this.addCurvePosition(w,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,x,r||M>0&&0==G)}return u}d?(f+=2,c=t.Utils.setArraySize(this.world,f),i.computeWorldVertices(o,2,f-4,c,0,2),i.computeWorldVertices(o,0,2,c,f-4,2),c[f-2]=c[0],c[f-1]=c[1]):(p--,f-=4,c=t.Utils.setArraySize(this.world,f),i.computeWorldVertices(o,2,f,c,0,2));for(var b=t.Utils.setArraySize(this.curves,p),T=0,A=c[0],R=c[1],S=0,C=0,I=0,P=0,L=0,O=0,_=0,k=0,F=0,D=0,V=0,N=0,X=0,B=0,Y=(M=0,2);MT){this.addAfterPosition(w-T,c,f-4,u,x);continue}}for(;;y++){var H=b[y];if(!(w>H)){if(0==y)w/=H;else w=(w-(Z=b[y-1]))/(H-Z);break}}if(y!=v){v=y;var q=6*y;for(A=c[q],R=c[q+1],S=c[q+2],C=c[q+3],I=c[q+4],P=c[q+5],V=2*(_=.03*(A-2*S+I))+(F=.006*(3*(S-I)-A+(L=c[q+6]))),N=2*(k=.03*(R-2*C+P))+(D=.006*(3*(C-P)-R+(O=c[q+7]))),X=.3*(S-A)+_+.16666667*F,B=.3*(C-R)+k+.16666667*D,z=Math.sqrt(X*X+B*B),U[0]=z,q=1;q<8;q++)X+=V,B+=N,V+=F,N+=D,z+=Math.sqrt(X*X+B*B),U[q]=z;X+=V,B+=N,z+=Math.sqrt(X*X+B*B),U[8]=z,X+=V+F,B+=N+D,z+=Math.sqrt(X*X+B*B),U[9]=z,W=0}for(w*=z;;W++){var j=U[W];if(!(w>j)){var Z;if(0==W)w/=j;else w=W+(w-(Z=U[W-1]))/(j-Z);break}}this.addCurvePosition(.1*w,A,R,S,C,I,P,L,O,u,x,r||M>0&&0==G)}return u},e.prototype.addBeforePosition=function(t,e,i,n,r){var s=e[i],a=e[i+1],o=e[i+2]-s,h=e[i+3]-a,l=Math.atan2(h,o);n[r]=s+t*Math.cos(l),n[r+1]=a+t*Math.sin(l),n[r+2]=l},e.prototype.addAfterPosition=function(t,e,i,n,r){var s=e[i+2],a=e[i+3],o=s-e[i],h=a-e[i+1],l=Math.atan2(h,o);n[r]=s+t*Math.cos(l),n[r+1]=a+t*Math.sin(l),n[r+2]=l},e.prototype.addCurvePosition=function(t,e,i,n,r,s,a,o,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=i,void(l[u+2]=Math.atan2(r-i,n-e));var d=t*t,f=d*t,p=1-t,v=p*p,g=v*p,m=p*t,M=3*m,x=p*M,y=M*t,w=e*g+n*x+s*y+o*f,E=i*g+r*x+a*y+h*f;l[u]=w,l[u+1]=E,c&&(l[u+2]=t<.001?Math.atan2(r-i,n-e):Math.atan2(E-(i*v+r*m*2+a*d),w-(e*v+n*m*2+s*d)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i}return r(e,t),e}(t.ConstraintData);t.PathConstraintData=e,function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(t.PositionMode||(t.PositionMode={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent"}(t.SpacingMode||(t.SpacingMode={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(t.RotateMode||(t.RotateMode={}))}(n||(n={})),function(t){var e=function(){function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t}(),i=function(){function t(t){void 0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}return t.prototype.queueAsset=function(t,i,n){var r=this.clientAssets[t];return null==r&&(r=new e(t),this.clientAssets[t]=r),null!==i&&(r.textureLoader=i),r.toLoad.push(n),this.queuedAssets[n]!==n&&(this.queuedAssets[n]=n,!0)},t.prototype.loadText=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.overrideMimeType("text/html"),n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=n.responseText:i.errors[e]="Couldn't load text ".concat(e,": status ").concat(n.status,", ").concat(n.responseText))},n.open("GET",e,!0),n.send()}},t.prototype.loadJson=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.overrideMimeType("text/html"),n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=JSON.parse(n.responseText):i.errors[e]="Couldn't load text ".concat(e,": status ").concat(n.status,", ").concat(n.responseText))},n.open("GET",e,!0),n.send()}},t.prototype.loadTexture=function(t,e,i){var n=this;if(i=this.pathPrefix+i,this.queueAsset(t,e,i))if(!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts){fetch(i,{mode:"cors"}).then((function(t){return t.ok||(n.errors[i]="Couldn't load image "+i),t.blob()})).then((function(t){return createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"})})).then((function(t){n.rawAssets[i]=t}))}else{var r=new Image;r.crossOrigin="anonymous",r.onload=function(t){n.rawAssets[i]=r},r.onerror=function(t){n.errors[i]="Couldn't load image ".concat(i)},r.src=i}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var i=this.clientAssets[t];return null==i||i.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts,i=0;i0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=i}(n||(n={})),function(t){var e=function(){function e(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(var i=0;i1){var s=n[n.length-1];this._updateCache.indexOf(s)>-1||this.updateCacheReset.push(s)}this._updateCache.push(e),this.sortReset(r.children),n[n.length-1].sorted=!0}},e.prototype.sortPathConstraint=function(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active){var i=e.target,n=i.data.index,r=i.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,n,r),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,r);for(var s=0,a=this.data.skins.length;s-1||this.updateCacheReset.push(s)}else for(r=0;r0){y=new t.DrawOrderTimeline(D);var V=r.slots.length;for(u=0;u=0;f--)X[f]=-1;var B=t.Utils.newArray(V-N,0),Y=0,U=0;for(f=0;f=0;f--)-1==X[f]&&(X[f]=B[--U]);y.setFrame(u,M,X)}s.push(y),o=Math.max(o,y.frames[D-1])}var z=i.readInt(!0);if(z>0){for(y=new t.EventTimeline(z),u=0;u>>1^-(1&i)},t.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},t.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(n),i++}}return e},t.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},t.prototype.readBoolean=function(){return 0!=this.readByte()},t}(),n=function(t,e,i,n,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=n,this.inheritDeform=r},r=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(n||(n={})),function(t){var e=function(){function e(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new t.Pool((function(){return t.Utils.newFloatArray(16)}))}return e.prototype.update=function(e,i){if(null==e)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,r=this.polygons,s=this.polygonPool,a=e.slots,o=a.length;n.length=0,s.freeAll(r),r.length=0;for(var h=0;h=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,i,n){var r=this.minX,s=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&i<=r||e<=s&&n<=s||t>=a&&i>=a||e>=o&&n>=o)return!1;var h=(n-e)/(i-t),l=h*(r-t)+e;if(l>s&&ls&&lr&&ur&&ut.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var i=this.polygons,n=0,r=i.length;n=i||l=i){var u=n[o];u+(i-h)/(l-h)*(n[s]-u)=u&&x<=f||x>=f&&x<=u)&&(x>=e&&x<=n||x>=n&&x<=e)){var y=(l*m-h*v)/M;if((y>=c&&y<=p||y>=p&&y<=c)&&(y>=i&&y<=r||y>=r&&y<=i))return!0}u=f,c=p}return!1},e.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},e.prototype.getWidth=function(){return this.maxX-this.minX},e.prototype.getHeight=function(){return this.maxY-this.minY},e}();t.SkeletonBounds=e}(n||(n={})),function(t){var e=function(){function e(){this.triangulator=new t.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return e.prototype.clipStart=function(i,n){if(null!=this.clipAttachment)return 0;this.clipAttachment=n;var r=n.worldVerticesLength,s=t.Utils.setArraySize(this.clippingPolygon,r);n.computeWorldVertices(i,0,r,s,0,2);var a=this.clippingPolygon;e.makeClockwise(a);for(var o=this.clippingPolygons=this.triangulator.decompose(a,this.triangulator.triangulate(a)),h=0,l=o.length;h>1,X=this.clipOutput,B=t.Utils.setArraySize(u,L+N*p),Y=0;Y=2?(u=o,o=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(i),u.push(n),u.push(r),u.push(s),u.push(t),u.push(e),o.length=0;for(var c=a,d=a.length-4,f=0;;f+=2){for(var p=c[f],v=c[f+1],g=c[f+2],m=c[f+3],M=p-g,x=v-m,y=u,w=u.length-2,E=o.length,b=0;b0;if(M*(A-m)-x*(T-g)>0){if(C){o.push(R),o.push(S);continue}var I=(L=S-A)*(g-p)-(O=R-T)*(m-v);if(Math.abs(I)>1e-6){var P=(O*(v-A)-L*(p-T))/I;o.push(p+(g-p)*P),o.push(v+(m-v)*P)}else o.push(p),o.push(v)}else if(C){var L,O;I=(L=S-A)*(g-p)-(O=R-T)*(m-v);if(Math.abs(I)>1e-6){P=(O*(v-A)-L*(p-T))/I;o.push(p+(g-p)*P),o.push(v+(m-v)*P)}else o.push(p),o.push(v);o.push(R),o.push(S)}l=!0}if(E==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),f==d)break;var _=o;(o=u).length=0,u=_}if(h!=o){h.length=0;f=0;for(var k=o.length-2;f>1;o=0;d--)-1==G[d]&&(G[d]=q[--Z])}y.setFrame(c++,this.getValue(W,"time",0),G)}s.push(y),a=Math.max(a,y.frames[y.getFrameCount()-1])}if(e.events){for(y=new t.EventTimeline(e.events.length),c=0,d=0;d=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=i},i.prototype.addSkin=function(t){for(var e=0;e= 0.");if(null==i)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=e,this.name=i,this.boneData=n};t.SlotData=e}(n||(n={})),function(t){var e,i,n=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return e.MipMapNearestNearest;case"mipmaplinearnearest":return e.MipMapLinearNearest;case"mipmapnearestlinear":return e.MipMapNearestLinear;case"mipmaplinearlinear":return e.MipMapLinearLinear;default:throw new Error("Unknown texture filter ".concat(t))}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return i.MirroredRepeat;case"clamptoedge":return i.ClampToEdge;case"repeat":return i.Repeat;default:throw new Error("Unknown texture wrap ".concat(t))}},t}();t.Texture=n,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(e=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(i=t.TextureWrap||(t.TextureWrap={}));var s=function(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.rotate=!1,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0};t.TextureRegion=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(n);t.FakeTexture=a}(n||(n={})),function(t){var e=function(){function e(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}return e.prototype.load=function(e,r){if(null==r)throw new Error("textureLoader cannot be null.");for(var a=new i(e),o=new Array(4),h=null;;){var l=a.readLine();if(null==l)break;if(0==(l=l.trim()).length)h=null;else if(h){var u=new s;u.name=l,u.page=h;var c=a.readValue();"true"==c.toLocaleLowerCase()?u.degrees=90:"false"==c.toLocaleLowerCase()?u.degrees=0:u.degrees=parseFloat(c),u.rotate=90==u.degrees,a.readTuple(o);var d=parseInt(o[0]),f=parseInt(o[1]);a.readTuple(o);var p=parseInt(o[0]),v=parseInt(o[1]);u.u=d/h.width,u.v=f/h.height,u.rotate?(u.u2=(d+v)/h.width,u.v2=(f+p)/h.height):(u.u2=(d+p)/h.width,u.v2=(f+v)/h.height),u.x=d,u.y=f,u.width=Math.abs(p),u.height=Math.abs(v),4==a.readTuple(o)&&4==a.readTuple(o)&&a.readTuple(o),u.originalWidth=parseInt(o[0]),u.originalHeight=parseInt(o[1]),a.readTuple(o),u.offsetX=parseInt(o[0]),u.offsetY=parseInt(o[1]),u.index=parseInt(a.readValue()),u.texture=h.texture,this.regions.push(u)}else{(h=new n).name=l,2==a.readTuple(o)&&(h.width=parseInt(o[0]),h.height=parseInt(o[1]),a.readTuple(o)),a.readTuple(o),h.minFilter=t.Texture.filterFromString(o[0]),h.magFilter=t.Texture.filterFromString(o[1]);var g=a.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==g?h.uWrap=t.TextureWrap.Repeat:"y"==g?h.vWrap=t.TextureWrap.Repeat:"xy"==g&&(h.uWrap=h.vWrap=t.TextureWrap.Repeat),h.texture=r(l),h.texture.setFilters(h.minFilter,h.magFilter),h.texture.setWraps(h.uWrap,h.vWrap),h.width=h.texture.getImage().width,h.height=h.texture.getImage().height,this.pages.push(h)}}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw new Error("Invalid line: "+e);for(var n=0,r=i+1;n<3;n++){var s=e.indexOf(",",r);if(-1==s)break;t[n]=e.substr(r,s-r).trim(),r=s+1}return t[n]=e.substring(r).trim(),n+1},t}(),n=function(){};t.TextureAtlasPage=n;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=s}(n||(n={})),function(t){var e=function(){function e(e,i){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,this.active=!1,null==e)throw new Error("data cannot be null.");if(null==i)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(var n=0;n0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,d=this.data.offsetShearY*u,f=this.bones,p=0,v=f.length;pt.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2),S*=e;var E=Math.cos(S),b=Math.sin(S);g.a=E*M-b*y,g.b=E*x-b*w,g.c=b*M+E*y,g.d=b*x+E*w,m=!0}if(0!=i){var T=this.temp;s.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(T.x-g.worldX)*i,g.worldY+=(T.y-g.worldY)*i,m=!0}if(n>0){var A=Math.sqrt(g.a*g.a+g.c*g.c),R=Math.sqrt(a*a+h*h);A>1e-5&&(A=(A+(R-A+this.data.offsetScaleX)*n)/A),g.a*=A,g.c*=A,A=Math.sqrt(g.b*g.b+g.d*g.d),R=Math.sqrt(o*o+l*l),A>1e-5&&(A=(A+(R-A+this.data.offsetScaleY)*n)/A),g.b*=A,g.d*=A,m=!0}if(r>0){x=g.b,w=g.d;var S,C=Math.atan2(w,x);(S=Math.atan2(l,o)-Math.atan2(h,a)-(C-Math.atan2(g.c,g.a)))>t.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2),S=C+(S+d)*r;A=Math.sqrt(x*x+w*w);g.b=Math.cos(S)*A,g.d=Math.sin(S)*A,m=!0}m&&(g.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,i=this.translateMix,n=this.scaleMix,r=this.shearMix,s=this.target,a=s.a,o=s.b,h=s.c,l=s.d,u=a*l-o*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,d=this.data.offsetShearY*u,f=this.bones,p=0,v=f.length;pt.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R*=e;var E=Math.cos(R),b=Math.sin(R);g.a=E*M-b*y,g.b=E*x-b*w,g.c=b*M+E*y,g.d=b*x+E*w,m=!0}if(0!=i){var T=this.temp;s.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),g.worldX+=T.x*i,g.worldY+=T.y*i,m=!0}if(n>0){var A=(Math.sqrt(a*a+h*h)-1+this.data.offsetScaleX)*n+1;g.a*=A,g.c*=A,A=(Math.sqrt(o*o+l*l)-1+this.data.offsetScaleY)*n+1,g.b*=A,g.d*=A,m=!0}if(r>0){var R;(R=Math.atan2(l,o)-Math.atan2(h,a))>t.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2);x=g.b,w=g.d;R=Math.atan2(w,x)+(R-t.MathUtils.PI/2+d)*r;A=Math.sqrt(x*x+w*w);g.b=Math.cos(R)*A,g.d=Math.sin(R)*A,m=!0}m&&(g.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a1e-5&&(f=(f+(r.ascaleX-f+this.data.offsetScaleX)*i)/f),p>1e-5&&(p=(p+(r.ascaleY-p+this.data.offsetScaleY)*i)/p));var v=h.ashearY;if(0!=n){u=r.ashearY-v+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*n}h.updateWorldTransformWith(c,d,l,f,p,h.ashearX,v)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a1e-5&&(d*=(r.ascaleX-1+this.data.offsetScaleX)*i+1),f>1e-5&&(f*=(r.ascaleY-1+this.data.offsetScaleY)*i+1));var p=h.ashearY;0!=n&&(p+=(r.ashearY+this.data.offsetShearY)*n),h.updateWorldTransformWith(u,c,l,d,f,h.ashearX,p)}},e}();t.TransformConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i.rotateMix=0,i.translateMix=0,i.scaleMix=0,i.shearMix=0,i.offsetRotation=0,i.offsetX=0,i.offsetY=0,i.offsetScaleX=0,i.offsetScaleY=0,i.offsetShearY=0,i.relative=!1,i.local=!1,i}return r(e,t),e}(t.ConstraintData);t.TransformConstraintData=e}(n||(n={})),function(t){var e=function(){function e(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new t.Pool((function(){return new Array})),this.polygonIndicesPool=new t.Pool((function(){return new Array}))}return e.prototype.triangulate=function(t){var i=t,n=t.length>>1,r=this.indicesArray;r.length=0;for(var s=0;s3;){for(var l=n-1,u=(s=0,1);;){t:if(!a[s]){for(var c=r[l]<<1,d=r[s]<<1,f=r[u]<<1,p=i[c],v=i[c+1],g=i[d],m=i[d+1],M=i[f],x=i[f+1],y=(u+1)%n;y!=l;y=(y+1)%n)if(a[y]){var w=r[y]<<1,E=i[w],b=i[w+1];if(e.positiveArea(M,x,p,v,E,b)&&e.positiveArea(p,v,g,m,E,b)&&e.positiveArea(g,m,M,x,E,b))break t}break}if(0==u){do{if(!a[s])break;s--}while(s>0);break}l=s,s=u,u=(u+1)%n}h.push(r[(n+s-1)%n]),h.push(r[s]),h.push(r[(s+1)%n]),r.splice(s,1),a.splice(s,1);var T=(--n+s-1)%n,A=s==n?0:s;a[T]=e.isConcave(T,n,i,r),a[A]=e.isConcave(A,n,i,r)}return 3==n&&(h.push(r[2]),h.push(r[0]),h.push(r[1])),h},e.prototype.decompose=function(t,i){var n=t,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var s=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(s),s.length=0;var a=this.polygonIndicesPool.obtain();a.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,u=0,c=i.length;u0?(r.push(o),s.push(a)):(this.polygonPool.free(o),this.polygonIndicesPool.free(a)),(o=this.polygonPool.obtain()).length=0,o.push(v),o.push(g),o.push(m),o.push(M),o.push(x),o.push(y),(a=this.polygonIndicesPool.obtain()).length=0,a.push(d),a.push(f),a.push(p),l=e.winding(v,g,m,M,x,y),h=d)}o.length>0&&(r.push(o),s.push(a));for(u=0,c=r.length;u=0;u--)0==(o=r[u]).length&&(r.splice(u,1),this.polygonPool.free(o),a=s[u],s.splice(u,1),this.polygonIndicesPool.free(a));return r},e.isConcave=function(t,e,i,n){var r=n[(e+t-1)%e]<<1,s=n[t]<<1,a=n[(t+1)%e]<<1;return!this.positiveArea(i[r],i[r+1],i[s],i[s+1],i[a],i[a+1])},e.positiveArea=function(t,e,i,n,r,s){return t*(s-n)+i*(e-s)+r*(n-e)>=0},e.winding=function(t,e,i,n,r,s){var a=i-t,o=n-e;return r*o-s*a+a*e-t*o>=0?1:-1},e}();t.Triangulator=e}(n||(n={})),function(t){var e=function(){function t(){this.array=new Array}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return null!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t}();t.IntSet=e;var i=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.r=t,this.g=e,this.b=i,this.a=n}return t.prototype.set=function(t,e,i,n){return this.r=t,this.g=e,this.b=i,this.a=n,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,i,n){return this.r+=t,this.g+=e,this.b+=i,this.a+=n,this.clamp(),this},t.prototype.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.rgba8888ToColor=function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},t.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();t.Color=i;var n=function(){function t(){}return t.clamp=function(t,e,i){return ti?i:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,i){return t.randomTriangularWith(e,i,.5*(e+i))},t.randomTriangularWith=function(t,e,i){var n=Math.random(),r=e-t;return n<=(i-t)/r?t+Math.sqrt(n*r*(i-t)):e-Math.sqrt((1-n)*r*(e-i))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();t.MathUtils=n;var s=function(){function t(){}return t.prototype.apply=function(t,e,i){return t+(e-t)*this.applyInternal(i)},t}();t.Interpolation=s;var a=function(t){function e(e){var i=t.call(this)||this;return i.power=2,i.power=e,i}return r(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1},e}(s);t.Pow=a;var o=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(a);t.PowOut=o;var h=function(){function t(){}return t.arrayCopy=function(t,e,i,n,r){for(var s=e,a=n;s=i?e:t.setArraySize(e,i,n)},t.newArray=function(t,e){for(var i=new Array(t),n=0;n0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();t.TimeKeeper=d;var f=function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*s;var a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,d=0;d0&&(h=o);for(var y,w=(y=t.bone).worldX,E=y.worldY,b=y.a,T=y.b,A=y.c,R=y.d,S=e,C=r;Cthis.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length},e.prototype.setIndices=function(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length},e.prototype.draw=function(t,e){this.drawWithOffset(t,e,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)},e.prototype.drawWithOffset=function(t,e,i,n){var r=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?r.drawElements(e,n,r.UNSIGNED_SHORT,2*i):r.drawArrays(e,i,n),this.unbind(t)},e.prototype.bind=function(t){var e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);for(var i=0,n=0;n0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)},e.prototype.unbind=function(t){for(var e=this.context.gl,i=0;i0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)},e.prototype.update=function(){var t=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=t.createBuffer()),t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),t.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),t.DYNAMIC_DRAW),this.dirtyIndices=!1)},e.prototype.restore=function(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()},e.prototype.dispose=function(){this.context.removeRestorable(this);var t=this.context.gl;t.deleteBuffer(this.verticesBuffer),t.deleteBuffer(this.indicesBuffer)},e}();t.Mesh=e;var i=function(t,e,i){this.name=t,this.type=e,this.numElements=i};t.VertexAttribute=i;var n=function(e){function i(){return e.call(this,t.Shader.POSITION,h.Float,2)||this}return r(i,e),i}(i);t.Position2Attribute=n;var s=function(e){function i(){return e.call(this,t.Shader.POSITION,h.Float,3)||this}return r(i,e),i}(i);t.Position3Attribute=s;var a=function(e){function i(i){return void 0===i&&(i=0),e.call(this,t.Shader.TEXCOORDS+(0==i?"":i),h.Float,2)||this}return r(i,e),i}(i);t.TexCoordAttribute=a;var o=function(e){function i(){return e.call(this,t.Shader.COLOR,h.Float,4)||this}return r(i,e),i}(i);t.ColorAttribute=o;var h,l=function(e){function i(){return e.call(this,t.Shader.COLOR2,h.Float,4)||this}return r(i,e),i}(i);t.Color2Attribute=l,function(t){t[t.Float=0]="Float"}(h=t.VertexAttributeType||(t.VertexAttributeType={}))}(t.webgl||(t.webgl={}))}(n||(n={})),function(t){!function(t){var e=function(){function e(e,i,n){if(void 0===i&&(i=!0),void 0===n&&(n=10920),this.isDrawing=!1,this.shader=null,this.lastTexture=null,this.verticesLength=0,this.indicesLength=0,n>10920)throw new Error("Can't have more than 10920 triangles per batch: "+n);this.context=e instanceof t.ManagedWebGLRenderingContext?e:new t.ManagedWebGLRenderingContext(e);var r=i?[new t.Position2Attribute,new t.ColorAttribute,new t.TexCoordAttribute,new t.Color2Attribute]:[new t.Position2Attribute,new t.ColorAttribute,new t.TexCoordAttribute];this.mesh=new t.Mesh(e,r,n,3*n),this.srcBlend=this.context.gl.SRC_ALPHA,this.dstBlend=this.context.gl.ONE_MINUS_SRC_ALPHA}return e.prototype.begin=function(t){var e=this.context.gl;if(this.isDrawing)throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=t,this.lastTexture=null,this.isDrawing=!0,e.enable(e.BLEND),e.blendFunc(this.srcBlend,this.dstBlend)},e.prototype.setBlendMode=function(t,e){var i=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),i.blendFunc(this.srcBlend,this.dstBlend))},e.prototype.draw=function(t,e,i){t!=this.lastTexture?(this.flush(),this.lastTexture=t):(this.verticesLength+e.length>this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();var n=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);for(var r=this.mesh.getIndices(),s=this.indicesLength,a=0;a0||this.indicesLength>0)&&this.flush(),this.shader=null,this.lastTexture=null,this.isDrawing=!1,t.disable(t.BLEND)},e.prototype.getDrawCalls=function(){return this.drawCalls},e.prototype.dispose=function(){this.mesh.dispose()},e}();t.PolygonBatcher=e}(t.webgl||(t.webgl={}))}(n||(n={})),function(t){!function(e){var i,n=function(){function n(i,n,r){void 0===r&&(r=!0),this.twoColorTint=!1,this.activeRenderer=null,this.QUAD=[0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0],this.QUAD_TRIANGLES=[0,1,2,2,3,0],this.WHITE=new t.Color(1,1,1,1),this.canvas=i,this.context=n instanceof e.ManagedWebGLRenderingContext?n:new e.ManagedWebGLRenderingContext(n),this.twoColorTint=r,this.camera=new e.OrthoCamera(i.width,i.height),this.batcherShader=r?e.Shader.newTwoColoredTextured(this.context):e.Shader.newColoredTextured(this.context),this.batcher=new e.PolygonBatcher(this.context,r),this.shapesShader=e.Shader.newColored(this.context),this.shapes=new e.ShapeRenderer(this.context),this.skeletonRenderer=new e.SkeletonRenderer(this.context,r),this.skeletonDebugRenderer=new e.SkeletonDebugRenderer(this.context)}return n.prototype.begin=function(){this.camera.update(),this.enableRenderer(this.batcher)},n.prototype.drawSkeleton=function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=-1),void 0===n&&(n=-1),this.enableRenderer(this.batcher),this.skeletonRenderer.premultipliedAlpha=e,this.skeletonRenderer.draw(this.batcher,t,i,n)},n.prototype.drawSkeletonDebug=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=null),this.enableRenderer(this.shapes),this.skeletonDebugRenderer.premultipliedAlpha=e,this.skeletonDebugRenderer.draw(this.shapes,t,i)},n.prototype.drawTexture=function(t,e,i,n,r,s){void 0===s&&(s=null),this.enableRenderer(this.batcher),null===s&&(s=this.WHITE);var a=this.QUAD,o=0;a[o++]=e,a[o++]=i,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=0,a[o++]=1,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),a[o++]=e+n,a[o++]=i,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=1,a[o++]=1,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),a[o++]=e+n,a[o++]=i+r,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=1,a[o++]=0,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),a[o++]=e,a[o++]=i+r,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=0,a[o++]=0,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),this.batcher.draw(t,a,this.QUAD_TRIANGLES)},n.prototype.drawTextureUV=function(t,e,i,n,r,s,a,o,h,l){void 0===l&&(l=null),this.enableRenderer(this.batcher),null===l&&(l=this.WHITE);var u=this.QUAD,c=0;u[c++]=e,u[c++]=i,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=s,u[c++]=a,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e+n,u[c++]=i,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=o,u[c++]=a,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e+n,u[c++]=i+r,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=o,u[c++]=h,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e,u[c++]=i+r,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=s,u[c++]=h,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),this.batcher.draw(t,u,this.QUAD_TRIANGLES)},n.prototype.drawTextureRotated=function(e,i,n,r,s,a,o,h,l,u){void 0===l&&(l=null),void 0===u&&(u=!1),this.enableRenderer(this.batcher),null===l&&(l=this.WHITE);var c=this.QUAD,d=i+a,f=n+o,p=-a,v=-o,g=r-a,m=s-o,M=p,x=v,y=p,w=m,E=g,b=m,T=g,A=v,R=0,S=0,C=0,I=0,P=0,L=0,O=0,_=0;if(0!=h){var k=t.MathUtils.cosDeg(h),F=t.MathUtils.sinDeg(h);C=(P=k*E-F*b)+((R=k*M-F*x)-(O=k*y-F*w)),I=(L=F*E+k*b)+((S=F*M+k*x)-(_=F*y+k*w))}else R=M,S=x,O=y,_=w,P=E,L=b,C=T,I=A;R+=d,S+=f,C+=d,I+=f,P+=d,L+=f,O+=d,_+=f;var D=0;c[D++]=R,c[D++]=S,c[D++]=l.r,c[D++]=l.g,c[D++]=l.b,c[D++]=l.a,c[D++]=0,c[D++]=1,this.twoColorTint&&(c[D++]=0,c[D++]=0,c[D++]=0,c[D++]=0),c[D++]=C,c[D++]=I,c[D++]=l.r,c[D++]=l.g,c[D++]=l.b,c[D++]=l.a,c[D++]=1,c[D++]=1,this.twoColorTint&&(c[D++]=0,c[D++]=0,c[D++]=0,c[D++]=0),c[D++]=P,c[D++]=L,c[D++]=l.r,c[D++]=l.g,c[D++]=l.b,c[D++]=l.a,c[D++]=1,c[D++]=0,this.twoColorTint&&(c[D++]=0,c[D++]=0,c[D++]=0,c[D++]=0),c[D++]=O,c[D++]=_,c[D++]=l.r,c[D++]=l.g,c[D++]=l.b,c[D++]=l.a,c[D++]=0,c[D++]=0,this.twoColorTint&&(c[D++]=0,c[D++]=0,c[D++]=0,c[D++]=0),this.batcher.draw(e,c,this.QUAD_TRIANGLES)},n.prototype.drawRegion=function(t,e,i,n,r,s,a){void 0===s&&(s=null),void 0===a&&(a=!1),this.enableRenderer(this.batcher),null===s&&(s=this.WHITE);var o=this.QUAD,h=0;o[h++]=e,o[h++]=i,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u,o[h++]=t.v2,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),o[h++]=e+n,o[h++]=i,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u2,o[h++]=t.v2,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),o[h++]=e+n,o[h++]=i+r,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u2,o[h++]=t.v,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),o[h++]=e,o[h++]=i+r,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u,o[h++]=t.v,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),this.batcher.draw(t.texture,o,this.QUAD_TRIANGLES)},n.prototype.line=function(t,e,i,n,r,s){void 0===r&&(r=null),void 0===s&&(s=null),this.enableRenderer(this.shapes),this.shapes.line(t,e,i,n,r)},n.prototype.triangle=function(t,e,i,n,r,s,a,o,h,l){void 0===o&&(o=null),void 0===h&&(h=null),void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.triangle(t,e,i,n,r,s,a,o,h,l)},n.prototype.quad=function(t,e,i,n,r,s,a,o,h,l,u,c,d){void 0===l&&(l=null),void 0===u&&(u=null),void 0===c&&(c=null),void 0===d&&(d=null),this.enableRenderer(this.shapes),this.shapes.quad(t,e,i,n,r,s,a,o,h,l,u,c,d)},n.prototype.rect=function(t,e,i,n,r,s){void 0===s&&(s=null),this.enableRenderer(this.shapes),this.shapes.rect(t,e,i,n,r,s)},n.prototype.rectLine=function(t,e,i,n,r,s,a){void 0===a&&(a=null),this.enableRenderer(this.shapes),this.shapes.rectLine(t,e,i,n,r,s,a)},n.prototype.polygon=function(t,e,i,n){void 0===n&&(n=null),this.enableRenderer(this.shapes),this.shapes.polygon(t,e,i,n)},n.prototype.circle=function(t,e,i,n,r,s){void 0===r&&(r=null),void 0===s&&(s=0),this.enableRenderer(this.shapes),this.shapes.circle(t,e,i,n,r,s)},n.prototype.curve=function(t,e,i,n,r,s,a,o,h,l){void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.curve(t,e,i,n,r,s,a,o,h,l)},n.prototype.end=function(){this.activeRenderer===this.batcher?this.batcher.end():this.activeRenderer===this.shapes&&this.shapes.end(),this.activeRenderer=null},n.prototype.resize=function(t){var e=this.canvas,n=e.clientWidth,r=e.clientHeight;if(e.width==n&&e.height==r||(e.width=n,e.height=r),this.context.gl.viewport(0,0,e.width,e.height),t===i.Stretch);else if(t===i.Expand)this.camera.setViewport(n,r);else if(t===i.Fit){var s=e.width,a=e.height,o=this.camera.viewportWidth,h=this.camera.viewportHeight,l=h/o10920)throw new Error("Can't have more than 10920 triangles per batch: "+r);this.context=n instanceof e.ManagedWebGLRenderingContext?n:new e.ManagedWebGLRenderingContext(n),this.mesh=new e.Mesh(n,[new e.Position2Attribute,new e.ColorAttribute],r,0),this.srcBlend=this.context.gl.SRC_ALPHA,this.dstBlend=this.context.gl.ONE_MINUS_SRC_ALPHA}return n.prototype.begin=function(t){if(this.isDrawing)throw new Error("ShapeRenderer.begin() has already been called");this.shader=t,this.vertexIndex=0,this.isDrawing=!0;var e=this.context.gl;e.enable(e.BLEND),e.blendFunc(this.srcBlend,this.dstBlend)},n.prototype.setBlendMode=function(t,e){var i=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),i.blendFunc(this.srcBlend,this.dstBlend))},n.prototype.setColor=function(t){this.color.setFromColor(t)},n.prototype.setColorWith=function(t,e,i,n){this.color.set(t,e,i,n)},n.prototype.point=function(t,e,n){void 0===n&&(n=null),this.check(i.Point,1),null===n&&(n=this.color),this.vertex(t,e,n)},n.prototype.line=function(t,e,n,r,s){void 0===s&&(s=null),this.check(i.Line,2);this.mesh.getVertices(),this.vertexIndex;null===s&&(s=this.color),this.vertex(t,e,s),this.vertex(n,r,s)},n.prototype.triangle=function(t,e,n,r,s,a,o,h,l,u){void 0===h&&(h=null),void 0===l&&(l=null),void 0===u&&(u=null),this.check(t?i.Filled:i.Line,3);this.mesh.getVertices(),this.vertexIndex;null===h&&(h=this.color),null===l&&(l=this.color),null===u&&(u=this.color),t?(this.vertex(e,n,h),this.vertex(r,s,l),this.vertex(a,o,u)):(this.vertex(e,n,h),this.vertex(r,s,l),this.vertex(r,s,h),this.vertex(a,o,l),this.vertex(a,o,h),this.vertex(e,n,l))},n.prototype.quad=function(t,e,n,r,s,a,o,h,l,u,c,d,f){void 0===u&&(u=null),void 0===c&&(c=null),void 0===d&&(d=null),void 0===f&&(f=null),this.check(t?i.Filled:i.Line,3);this.mesh.getVertices(),this.vertexIndex;null===u&&(u=this.color),null===c&&(c=this.color),null===d&&(d=this.color),null===f&&(f=this.color),t?(this.vertex(e,n,u),this.vertex(r,s,c),this.vertex(a,o,d),this.vertex(a,o,d),this.vertex(h,l,f),this.vertex(e,n,u)):(this.vertex(e,n,u),this.vertex(r,s,c),this.vertex(r,s,c),this.vertex(a,o,d),this.vertex(a,o,d),this.vertex(h,l,f),this.vertex(h,l,f),this.vertex(e,n,u))},n.prototype.rect=function(t,e,i,n,r,s){void 0===s&&(s=null),this.quad(t,e,i,e+n,i,e+n,i+r,e,i+r,s,s,s,s)},n.prototype.rectLine=function(t,e,n,r,s,a,o){void 0===o&&(o=null),this.check(t?i.Filled:i.Line,8),null===o&&(o=this.color);var h=this.tmp.set(s-n,e-r);h.normalize(),a*=.5;var l=h.x*a,u=h.y*a;t?(this.vertex(e+l,n+u,o),this.vertex(e-l,n-u,o),this.vertex(r+l,s+u,o),this.vertex(r-l,s-u,o),this.vertex(r+l,s+u,o),this.vertex(e-l,n-u,o)):(this.vertex(e+l,n+u,o),this.vertex(e-l,n-u,o),this.vertex(r+l,s+u,o),this.vertex(r-l,s-u,o),this.vertex(r+l,s+u,o),this.vertex(e+l,n+u,o),this.vertex(r-l,s-u,o),this.vertex(e-l,n-u,o))},n.prototype.x=function(t,e,i){this.line(t-i,e-i,t+i,e+i),this.line(t-i,e+i,t+i,e-i)},n.prototype.polygon=function(t,e,n,r){if(void 0===r&&(r=null),n<3)throw new Error("Polygon must contain at least 3 vertices");this.check(i.Line,2*n),null===r&&(r=this.color);this.mesh.getVertices(),this.vertexIndex;n<<=1;for(var s=t[e<<=1],a=t[e+1],o=e+n,h=e,l=e+n-2;h=o?(d=s,f=a):(d=t[h+2],f=t[h+3]),this.vertex(u,c,r),this.vertex(d,f,r)}},n.prototype.circle=function(e,n,r,s,a,o){if(void 0===a&&(a=null),void 0===o&&(o=0),0===o&&(o=Math.max(1,6*t.MathUtils.cbrt(s)|0)),o<=0)throw new Error("segments must be > 0.");null===a&&(a=this.color);var h=2*t.MathUtils.PI/o,l=Math.cos(h),u=Math.sin(h),c=s,d=0;if(e){this.check(i.Filled,3*o+3),o--;for(p=0;p0;)this.vertex(E,b,u),E+=T,b+=A,T+=R,A+=S,R+=C,S+=I,this.vertex(E,b,u);this.vertex(E,b,u),this.vertex(o,h,u)},n.prototype.vertex=function(t,e,i){var n=this.vertexIndex,r=this.mesh.getVertices();r[n++]=t,r[n++]=e,r[n++]=i.r,r[n++]=i.g,r[n++]=i.b,r[n++]=i.a,this.vertexIndex=n},n.prototype.end=function(){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");this.flush(),this.context.gl.disable(this.context.gl.BLEND),this.isDrawing=!1},n.prototype.flush=function(){0!=this.vertexIndex&&(this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0)},n.prototype.check=function(t,e){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");if(this.shapeType==t){if(!(this.mesh.maxVertices()-this.mesh.numVertices()-1)&&null!=d.parent){var f=s+d.data.length*d.a+d.worldX,p=a+d.data.length*d.c+d.worldY;e.rectLine(!0,s+d.worldX,a+d.worldY,f,p,this.boneWidth*this.scale)}}this.drawSkeletonXY&&e.x(s,a,4*this.scale)}if(this.drawRegionAttachments){e.setColor(this.attachmentLineColor);for(u=0,c=(U=n.slots).length;u0){e.setColor(this.attachmentLineColor);var A=g[(x=2*(x>>1))-2],R=g[x-1];for(y=0,w=x;y-1||e.circle(!0,s+d.worldX,a+d.worldY,3*this.scale,i.GREEN,8)}}if(this.drawClipping){var U=n.slots;e.setColor(this.clipColor);for(u=0,c=U.length;u=0&&s==R.data.index&&(E=!0),E){a>=0&&a==R.data.index&&(E=!1);var S=R.getAttachment(),C=null;if(S instanceof t.RegionAttachment){var I=S;v.vertices=this.vertices,v.numVertices=4,v.numFloats=A<<2,I.computeWorldVertices(R.bone,v.vertices,0,A),m=n.QUAD_TRIANGLES,g=I.uvs,C=I.region.renderObject.texture,x=I.color}else{if(!(S instanceof t.MeshAttachment)){if(S instanceof t.ClippingAttachment){var P=S;o.clipStart(R,P);continue}o.clipEndWithSlot(R);continue}var L=S;v.vertices=this.vertices,v.numVertices=L.worldVerticesLength>>1,v.numFloats=v.numVertices*A,v.numFloats>v.vertices.length&&(v.vertices=this.vertices=t.Utils.newFloatArray(v.numFloats)),L.computeWorldVertices(R,0,L.worldVerticesLength,v.vertices,0,A),m=L.triangles,C=L.region.renderObject.texture,g=L.uvs,x=L.color}if(null!=C){var O=R.color,_=this.tempColor;_.r=y.r*O.r*x.r,_.g=y.g*O.g*x.g,_.b=y.b*O.b*x.b,_.a=y.a*O.a*x.a,h&&(_.r*=_.a,_.g*=_.a,_.b*=_.a);var k=this.tempColor2;null==R.darkColor?k.set(0,0,0,1):(h?(k.r=R.darkColor.r*_.a,k.g=R.darkColor.g*_.a,k.b=R.darkColor.b*_.a):k.setFromColor(R.darkColor),k.a=h?1:0);var F=R.data.blendMode;if(F!=u&&(u=F,i.setBlendMode(e.WebGLBlendModeConverter.getSourceGLBlendMode(u,h),e.WebGLBlendModeConverter.getDestGLBlendMode(u))),o.isClipping()){o.clipTriangles(v.vertices,v.numFloats,m,m.length,g,_,k,l);var D=new Float32Array(o.clippedVertices),V=o.clippedTriangles;if(null!=this.vertexEffect){var N=this.vertexEffect,X=D;if(l){Y=0;for(var B=D.length;Y-1&&this.restorables.splice(e,1)},t}();e.ManagedWebGLRenderingContext=i;var n=function(){function e(){}return e.getDestGLBlendMode=function(i){switch(i){case t.BlendMode.Normal:return e.ONE_MINUS_SRC_ALPHA;case t.BlendMode.Additive:return e.ONE;case t.BlendMode.Multiply:case t.BlendMode.Screen:return e.ONE_MINUS_SRC_ALPHA;default:throw new Error("Unknown blend mode: "+i)}},e.getSourceGLBlendMode=function(i,n){switch(void 0===n&&(n=!1),i){case t.BlendMode.Normal:case t.BlendMode.Additive:return n?e.ONE:e.SRC_ALPHA;case t.BlendMode.Multiply:return e.DST_COLOR;case t.BlendMode.Screen:return e.ONE;default:throw new Error("Unknown blend mode: "+i)}},e.ZERO=0,e.ONE=1,e.SRC_COLOR=768,e.ONE_MINUS_SRC_COLOR=769,e.SRC_ALPHA=770,e.ONE_MINUS_SRC_ALPHA=771,e.DST_ALPHA=772,e.ONE_MINUS_DST_ALPHA=773,e.DST_COLOR=774,e}();e.WebGLBlendModeConverter=n}(t.webgl||(t.webgl={}))}(n||(n={})),t.exports=n}).call(window)},3524:(t,e,i)=>{var n=i(7473),r=i(4597),s=i(6732),a=i(2482),o=i(704),h=i(3137),l=i(1192),u=new n({Extends:h,initialize:function(t,e,i,n,s,u,c){var d,f,p,v=[],g=t.cacheManager.custom.spine;if(a(e)){var m=e;for(e=r(m,"key"),f=new o(t,{key:e,url:r(m,"jsonURL"),extension:r(m,"jsonExtension","json"),xhrSettings:r(m,"jsonXhrSettings")}),n=r(m,"atlasURL"),s=r(m,"preMultipliedAlpha"),Array.isArray(n)||(n=[n]),d=0;d{var n=i(2494),r=i(7473),s=i(5851),a=i(3527),o=i(5722),h=i(1847),l=i(3524),u=i(8332),c=i(5782),d=i(1984),f=new r({Extends:o,initialize:function(t,e,i){o.call(this,t,e,i);var r=e.game;this.isWebGL=2===r.config.renderType,this.cache=r.cache.addCustom("spine"),this.spineTextures=r.cache.addCustom("spineTextures"),this.json=r.cache.json,this.textures=r.textures,this.drawDebug=!1,this.gl,this.renderer,this.sceneRenderer,this.skeletonRenderer,this.skeletonDebugRenderer,this.plugin=h,this.temp1,this.temp2,this.isWebGL?(this.runtime=h.webgl,this.renderer=r.renderer,this.gl=r.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=r.renderer,this.getAtlas=this.getAtlasCanvas),this.renderer||(this.renderer={width:r.scale.width,height:r.scale.height,preRender:d,postRender:d,render:d,destroy:d});var a=this.isWebGL;e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",(function(t,e,n,r,s){a&&this.scene.sys.renderer.pipelines.clear();var o=this.scene.sys[i],h=new u(this.scene,o,t,e,n,r,s);return this.displayList.add(h),this.updateList.add(h),a&&this.scene.sys.renderer.pipelines.rebind(),h}),(function(t,e){void 0===t&&(t={}),a&&this.scene.sys.renderer.pipelines.clear();var r=s(t,"key",null),o=s(t,"animationName",null),h=s(t,"loop",!1),l=this.scene.sys[i],c=new u(this.scene,l,0,0,r,o,h);void 0!==e&&(t.add=e),n(this.scene,c,t);var d=s(t,"skinName",!1);d&&c.setSkinByName(d);var f=s(t,"slotName",!1),p=s(t,"attachmentName",null);return f&&c.setAttachment(f,p),a&&this.scene.sys.renderer.pipelines.rebind(),c.refresh()})),e.registerGameObject("spineContainer",(function(t,e,n){var r=this.scene.sys[i],s=new c(this.scene,r,t,e,n);return this.displayList.add(s),s}),(function(t,e){void 0===t&&(t={});var r=s(t,"x",0),a=s(t,"y",0),o=s(t,"children",null),h=this.scene.sys[i],l=new c(this.scene,h,r,a,o);return void 0!==e&&(t.add=e),n(this.scene,l,t),l}))},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(a,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this),this.game.events.once("destroy",this.gameDestroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){var t=function(t,e){if(t!==this.srcBlend||e!==this.dstBlend){var i=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),i.blendFunc(this.srcBlend,this.dstBlend))}},e=this.renderer.spineSceneRenderer;e||((e=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0)).batcher.setBlendMode=t,e.shapes.setBlendMode=t,this.renderer.spineSceneRenderer=e),this.sceneRenderer=e,this.skeletonRenderer=e.skeletonRenderer,this.skeletonDebugRenderer=e.skeletonDebugRenderer,this.temp1=new h.webgl.Vector3(0,0,0),this.temp2=new h.webgl.Vector3(0,0,0)},getAtlasCanvas:function(t){var e=this.cache.get(t);if(e){var i,n=this.spineTextures;if(n.has(t))i=n.get(t);else{var r=this.textures;i=new h.TextureAtlas(e.data,(function(i){return new h.canvas.CanvasTexture(r.get(e.prefix+t+":"+i).getSourceImage())}))}return i}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var i,n=this.spineTextures;if(n.has(t))i=n.get(t);else{var r=this.textures,s=this.sceneRenderer.context.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i=new h.TextureAtlas(e.data,(function(i){return new h.webgl.GLTexture(s,r.get(e.prefix+t+":"+i).getSourceImage(),!1)}))}return i}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,i,n,r,s,a){var o;if(a=a||{},Array.isArray(t))for(var h=0;h{var n=i(7473),r=i(7361),s=i(7738),a=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,n,s){r.call(this,t,i,n,s),this.type="Spine",this.plugin=e},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null,this.plugin=null}});t.exports=a},8064:t=>{t.exports=function(t,e,i,n){var r=e.list;if(0!==r.length){i.addToRenderList(e);var s=e.localTransform;n?(s.loadIdentity(),s.multiply(n),s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.scaleX,e.scaleY)):s.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var n=i(1984),r=i(1984);n=i(434),r=i(8064),t.exports={renderWebGL:n,renderCanvas:r}},434:t=>{t.exports=function(t,e,i,n){var r=e.plugin.sceneRenderer,s=e.list;if(0!==s.length){i.addToRenderList(e);var a=e.localTransform;n?(a.loadIdentity(),a.multiply(n),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.newType&&(t.pipelines.clear(),r.begin());var o=t.nextTypeMatch;t.nextTypeMatch=!0,t.newType=!1;for(var h=0;h{t.exports="complete"},8621:t=>{t.exports="dispose"},8944:t=>{t.exports="end"},7494:t=>{t.exports="event"},1908:t=>{t.exports="interrupted"},5591:t=>{t.exports="start"},5146:(t,e,i)=>{t.exports={COMPLETE:i(6576),DISPOSE:i(8621),END:i(8944),EVENT:i(7494),INTERRUPTED:i(1908),START:i(5591)}},8332:(t,e,i)=>{var n=i(6412),r=i(2915),s=i(7473),a=i(1991),o=i(3131),h=i(9660),l=i(4627),u=i(3212),c=i(8414),d=i(3426),f=i(7149),p=i(2273),v=i(4208),g=i(5146),m=i(2762),M=new s({Extends:p,Mixins:[a,o,h,l,u,c,m],initialize:function(t,e,i,n,r,s,a){p.call(this,t,"Spine"),this.plugin=e,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null,this.root=null,this.bounds=null,this.drawDebug=!1,this.timeScale=1,this.displayOriginX=0,this.displayOriginY=0,this.preMultipliedAlpha=!1,this.blendMode=-1,this.setPosition(i,n),r&&this.setSkeleton(r,s,a)},willRender:function(t,e){var i=!this.skeleton||!(15!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id);if(!e&&!i&&this.parentContainer){var n=this.plugin,r=n.sceneRenderer;n.gl&&r.batcher.isDrawing&&(r.end(),n.renderer.pipelines.rebind())}return i},setAlpha:function(t,e){if(void 0===t&&(t=1),e){var i=this.findSlot(e);i&&(i.color.a=r(t,0,1))}else this.alpha=t;return this},alpha:{get:function(){return this.skeleton.color.a},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.a=e),0===e?this.renderFlags&=-3:this.renderFlags|=2}},red:{get:function(){return this.skeleton.color.r},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.r=e)}},green:{get:function(){return this.skeleton.color.g},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.g=e)}},blue:{get:function(){return this.skeleton.color.b},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.b=e)}},setColor:function(t,e){void 0===t&&(t=16777215);var i=(t>>16&255)/255,n=(t>>8&255)/255,r=(255&t)/255,s=t>16777215?(t>>>24)/255:null,a=this.skeleton;if(e){var o=this.findSlot(e);o&&(a=o)}return a.color.r=i,a.color.g=n,a.color.b=r,null!==s&&(a.color.a=s),this},setSkeletonFromJSON:function(t,e,i,n){return this.setSkeleton(t,e,i,n)},setSkeleton:function(t,e,i,n){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,n);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkin(),s.setToSetupPose(),this.skeleton=s,r=this.plugin.createAnimationState(s),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=v(d(this.rotation))+90),this.state.apply(s),s.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=v(d(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,n){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===i&&(i=0),void 0===n&&(n=0),this.width=t,this.height=e,this.displayOriginX=r.x-i,this.displayOriginY=r.y-n,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,n=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=i,t.scaleY=n,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i{var n=i(3426),r=i(4208),s=i(8445);t.exports=function(t,e,i,a){var o=t.currentContext,h=e.plugin,l=e.skeleton,u=h.skeletonRenderer,c=t._tempMatrix1,d=t._tempMatrix2,f=t._tempMatrix3;i.addToRenderList(e),d.applyITRS(e.x,e.y,e.rotation,Math.abs(e.scaleX),Math.abs(e.scaleY)),c.copyFrom(i.matrix),a?(c.multiplyWithOffset(a,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),d.e=e.x,d.f=e.y,c.multiply(d,f)):(d.e-=i.scrollX*e.scrollFactorX,d.f-=i.scrollY*e.scrollFactorY,c.multiply(d,f)),l.x=f.tx,l.y=f.ty,l.scaleX=f.scaleX,l.scaleY=-1*f.scaleY,e.scaleX<0?(l.scaleX*=-1,e.root.rotation=r(f.rotationNormalized)):e.root.rotation=s(r(n(f.rotationNormalized))+90,0,360),e.scaleY<0&&(l.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*r(f.rotationNormalized):e.root.rotation+=2*r(f.rotationNormalized)),i.renderToTexture&&(l.y=f.ty,l.scaleY*=-1),l.updateWorldTransform(),u.ctx=o,u.debugRendering=h.drawDebug||e.drawDebug,o.save(),u.draw(l),o.restore()}},2762:(t,e,i)=>{var n=i(1984),r=i(1984),s=i(1984);n=i(4290),s=i(780),r=i(2753),t.exports={renderWebGL:n,renderCanvas:r,renderDirect:s}},780:(t,e,i)=>{var n=i(2915),r=i(3426),s=i(2208),a=i(4208),o=i(8445);t.exports=function(t,e,i,h,l){var u=e.plugin,c=e.skeleton,d=u.sceneRenderer;t.pipelines.clear(),d.begin();var f=e.scrollFactorX,p=e.scrollFactorY,v=c.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,c.color.a=n(v*l.alpha,0,1)),i.addToRenderList(e);var g=s(e,i,h).calc,m=t.height;if(c.x=g.tx,c.y=m-g.ty,c.scaleX=g.scaleX,c.scaleY=g.scaleY,e.scaleX<0?(c.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(r(g.rotationNormalized))+90,0,360),e.scaleY<0&&(c.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),c.updateWorldTransform(),d.drawSkeleton(c,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,c.color.a=v),u.drawDebug||e.drawDebug){var M=c.x,x=c.y;c.x=0,c.y=0,d.drawSkeletonDebug(c,e.preMultipliedAlpha),c.x=M,c.y=x}d.end(),t.pipelines.rebind()}},4290:(t,e,i)=>{var n=i(2915),r=i(3426),s=i(2208),a=i(4208),o=i(8445);t.exports=function(t,e,i,h,l){var u=e.plugin,c=e.skeleton,d=u.sceneRenderer;t.newType&&(t.pipelines.clear(),d.begin());var f=e.scrollFactorX,p=e.scrollFactorY,v=c.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,c.color.a=n(v*l.alpha,0,1)),i.addToRenderList(e);var g=s(e,i,h).calc,m=t.height;if(c.x=g.tx,c.y=m-g.ty,c.scaleX=g.scaleX,c.scaleY=g.scaleY,e.scaleX<0?(c.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(r(g.rotationNormalized))+90,0,360),e.scaleY<0&&(c.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),c.updateWorldTransform(),d.drawSkeleton(c,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,c.color.a=v),u.drawDebug||e.drawDebug){var M=c.x,x=c.y;c.x=0,c.y=0,d.drawSkeletonDebug(c,e.preMultipliedAlpha),c.x=M,c.y=x,d.end(),t.pipelines.rebind()}else t.nextTypeMatch||(d.end(),t.pipelines.rebind())}},9454:(t,e,i)=>{var n={VERSION:"3.60.0",BlendModes:i(8351),ScaleModes:i(8196),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},1081:(t,e,i)=>{var n=i(7473),r=i(6748),s=new n({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(r.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n{t.exports="changedata"},7801:t=>{t.exports="changedata-"},4873:t=>{t.exports="destroy"},9966:t=>{t.exports="removedata"},4586:t=>{t.exports="setdata"},6748:(t,e,i)=>{t.exports={CHANGE_DATA:i(9044),CHANGE_DATA_KEY:i(7801),DESTROY:i(4873),REMOVE_DATA:i(9966),SET_DATA:i(4586)}},3004:(t,e,i)=>{var n=i(2776),r={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return r;r.audioData=!!window.Audio,r.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var n=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(n||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(n)};if(r.ogg=i('ogg; codecs="vorbis"'),r.opus=i('ogg; codecs="opus"',"opus"),r.mp3=i("mpeg"),r.wav=i("wav"),r.m4a=i("x-m4a"),r.aac=i("aac"),r.flac=i("flac","x-flac"),r.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(n.edge)r.dolby=!0;else if(n.safari&&n.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var s=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===s&&a>=11||s>10)&&(r.dolby=!0)}}}catch(t){}return r}()},2776:(t,e,i)=>{var n,r=i(5203),s={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(n=navigator.userAgent,/Edg\/\d+/.test(n)?(s.edge=!0,s.es2019=!0):/OPR/.test(n)?(s.opera=!0,s.es2019=!0):/Chrome\/(\d+)/.test(n)&&!r.windowsPhone?(s.chrome=!0,s.chromeVersion=parseInt(RegExp.$1,10),s.es2019=s.chromeVersion>69):/Firefox\D+(\d+)/.test(n)?(s.firefox=!0,s.firefoxVersion=parseInt(RegExp.$1,10),s.es2019=s.firefoxVersion>10):/AppleWebKit/.test(n)&&r.iOS?s.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(s.ie=!0,s.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+) Safari/.test(n)&&!r.windowsPhone?(s.safari=!0,s.safariVersion=parseInt(RegExp.$1,10),s.es2019=s.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(s.ie=!0,s.trident=!0,s.tridentVersion=parseInt(RegExp.$1,10),s.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(s.silk=!0),s)},6505:(t,e,i)=>{var n,r,s,a=i(8073),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",r="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(s=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(s,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+r},s.src=n+"AP804Oa6"+r,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),n=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),n}()),o)},6543:(t,e,i)=>{var n=i(5203),r=i(2776),s=i(8073),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=s.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=s.create2D(this),n=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=n.data instanceof Uint8ClampedArray,s.remove(t),s.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!n.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},3922:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",n="FullScreen",r=["request"+i,"request"+n,"webkitRequest"+i,"webkitRequest"+n,"msRequest"+i,"msRequest"+n,"mozRequest"+n,"mozRequest"+i];for(t=0;t{var n=i(2776),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||n.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":n.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},5203:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},2131:(t,e,i)=>{var n=i(4597),r={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return r;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(r.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(r.h264=!0,r.mp4=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(r.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(r.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(r.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(r.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),r.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e{t.exports={os:i(5203),browser:i(2776),features:i(6543),input:i(1454),audio:i(3004),video:i(2131),fullscreen:i(3922),canvasFeatures:i(6505)}},5686:(t,e,i)=>{var n=i(7473),r=new Float32Array(20),s=new n({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(t){return this._matrix.set(t),this._dirty=!0,this},reset:function(){var t=this._matrix;return t.fill(0),t[0]=1,t[6]=1,t[12]=1,t[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var t=this._data;return this._dirty&&(t.set(this._matrix),t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._dirty=!1),t},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,n=-.5*(i-1);return this.multiply([i,n,n,0,0,n,i,n,0,0,n,n,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),n=Math.sin(t),r=.213,s=.715,a=.072;return this.multiply([r+.787*i+n*-r,s+i*-s+n*-s,a+i*-a+.928*n,0,0,r+i*-r+.143*n,s+i*(1-s)+.14*n,a+i*-a+-.283*n,0,0,r+i*-r+-.787*n,s+i*-s+n*s,a+.928*i+n*a,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply(s.BLACK_WHITE,t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,n=-.5*(i-1);return this.multiply([i,0,0,0,n,0,i,0,0,n,0,0,i,0,n,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply(s.NEGATIVE,t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply(s.DESATURATE_LUMINANCE,t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply(s.SEPIA,t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply(s.LSD,t)},brown:function(t){return void 0===t&&(t=!1),this.multiply(s.BROWN,t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply(s.VINTAGE,t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply(s.KODACHROME,t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply(s.TECHNICOLOR,t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply(s.POLAROID,t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply(s.SHIFT_BGR,t)},multiply:function(t,e){void 0===e&&(e=!1),e||this.reset();var i=this._matrix,n=r;return n.set(i),i.set([n[0]*t[0]+n[1]*t[5]+n[2]*t[10]+n[3]*t[15],n[0]*t[1]+n[1]*t[6]+n[2]*t[11]+n[3]*t[16],n[0]*t[2]+n[1]*t[7]+n[2]*t[12]+n[3]*t[17],n[0]*t[3]+n[1]*t[8]+n[2]*t[13]+n[3]*t[18],n[0]*t[4]+n[1]*t[9]+n[2]*t[14]+n[3]*t[19]+n[4],n[5]*t[0]+n[6]*t[5]+n[7]*t[10]+n[8]*t[15],n[5]*t[1]+n[6]*t[6]+n[7]*t[11]+n[8]*t[16],n[5]*t[2]+n[6]*t[7]+n[7]*t[12]+n[8]*t[17],n[5]*t[3]+n[6]*t[8]+n[7]*t[13]+n[8]*t[18],n[5]*t[4]+n[6]*t[9]+n[7]*t[14]+n[8]*t[19]+n[9],n[10]*t[0]+n[11]*t[5]+n[12]*t[10]+n[13]*t[15],n[10]*t[1]+n[11]*t[6]+n[12]*t[11]+n[13]*t[16],n[10]*t[2]+n[11]*t[7]+n[12]*t[12]+n[13]*t[17],n[10]*t[3]+n[11]*t[8]+n[12]*t[13]+n[13]*t[18],n[10]*t[4]+n[11]*t[9]+n[12]*t[14]+n[13]*t[19]+n[14],n[15]*t[0]+n[16]*t[5]+n[17]*t[10]+n[18]*t[15],n[15]*t[1]+n[16]*t[6]+n[17]*t[11]+n[18]*t[16],n[15]*t[2]+n[16]*t[7]+n[17]*t[12]+n[18]*t[17],n[15]*t[3]+n[16]*t[8]+n[17]*t[13]+n[18]*t[18],n[15]*t[4]+n[16]*t[9]+n[17]*t[14]+n[18]*t[19]+n[19]]),this._dirty=!0,this}});s.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],s.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],s.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],s.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],s.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],s.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],s.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],s.KODACHROME=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],s.TECHNICOLOR=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],s.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],s.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t.exports=s},8073:(t,e,i)=>{var n,r,s,a=i(9454),o=i(2150),h=[],l=!1;t.exports=(s=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return n(t,e,i,a.CANVAS)},create:n=function(t,e,i,n,s){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=a.CANVAS),void 0===s&&(s=!1);var c=r(n);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:n},n===a.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),s&&(c.parent=u),u.width=e,u.height=i,l&&n===a.CANVAS&&o.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return n(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:r=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{var n=i(7473),r=i(3649),s=new n({initialize:function(t,e,i,n,r,s){e||(e=t.sys.make.image({x:i,y:n,key:r,frame:s,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});r.register("bitmapMask",(function(t,e,i,n,r){return new s(this.scene,t,e,i,n,r)})),t.exports=s},6726:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var n=t.gl;t.flush(),0===t.maskStack.length&&(n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var n=t.gl,r=this.geometryMask,s=t.maskCount,a=255;n.colorMask(!1,!1,!1,!1),i?(n.stencilFunc(n.EQUAL,s,a),n.stencilOp(n.KEEP,n.KEEP,n.INCR),s++):(n.stencilFunc(n.EQUAL,s+1,a),n.stencilOp(n.KEEP,n.KEEP,n.DECR)),this.level=s,r.renderWebGL(t,r,e),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),this.invertAlpha?n.stencilFunc(n.NOTEQUAL,s,a):n.stencilFunc(n.EQUAL,s,a)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var n=t.maskStack[t.maskStack.length-1];n.mask.applyStencil(t,n.camera,!1),t.currentCameraMask.mask!==n.mask?(i.mask=n.mask,i.camera=n.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},7340:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,s.BARREL,t),this.amount=e}});t.exports=a},5170:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h){void 0===i&&(i=1),void 0===n&&(n=1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=4),r.call(this,s.BLOOM,t),this.steps=h,this.offsetX=i,this.offsetY=n,this.blurStrength=a,this.strength=o,this.glcolor=[1,1,1],null!=e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4199:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h){void 0===e&&(e=0),void 0===i&&(i=2),void 0===n&&(n=2),void 0===a&&(a=1),void 0===h&&(h=4),r.call(this,s.BLUR,t),this.quality=0,this.x=i,this.y=n,this.steps=h,this.strength=a,this.glcolor=[1,1,1],null!=o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},3132:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===n&&(n=.2),void 0===a&&(a=!1),void 0===o&&(o=1),void 0===h&&(h=1),void 0===l&&(l=1),r.call(this,s.BOKEH,t),this.radius=e,this.amount=i,this.contrast=n,this.isTiltShift=a,this.strength=l,this.blurX=o,this.blurY=h}});t.exports=a},6610:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o){void 0===e&&(e=8),void 0===a&&(a=1),void 0===o&&(o=.005),r.call(this,s.CIRCLE,t),this.scale=a,this.feather=o,this.thickness=e,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],null!=i&&(this.color=i),null!=n&&(this.backgroundColor=n)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundColor:{get:function(){var t=this.glcolor2;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor2;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4931:(t,e,i)=>{var n=i(7473),r=i(5686),s=i(1571),a=new n({Extends:r,initialize:function(t){r.call(this),this.type=s.COLOR_MATRIX,this.gameObject=t,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});t.exports=a},6128:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e){this.type=t,this.gameObject=e,this.active=!0},setActive:function(t){return this.active=t,this},destroy:function(){this.gameObject=null,this.active=!1}});t.exports=n},9195:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===n&&(n=.005),r.call(this,s.DISPLACEMENT,t),this.x=i,this.y=n,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.gameObject.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=a},445:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===i&&(i=4),void 0===n&&(n=0),void 0===a&&(a=!1),r.call(this,s.GLOW,t),this.outerStrength=i,this.innerStrength=n,this.knockout=a,this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},7724:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l,u){void 0===n&&(n=.2),void 0===a&&(a=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l=1),void 0===u&&(u=0),r.call(this,s.GRADIENT,t),this.alpha=n,this.size=u,this.fromX=a,this.fromY=o,this.toX=h,this.toY=l,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],null!=e&&(this.color1=e),null!=i&&(this.color2=i)},color1:{get:function(){var t=this.glcolor1;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor1;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}},color2:{get:function(){var t=this.glcolor2;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor2;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}}});t.exports=a},4412:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,s.PIXELATE,t),this.amount=e}});t.exports=a},75:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=.1),void 0===a&&(a=1),void 0===h&&(h=6),void 0===l&&(l=1),r.call(this,s.SHADOW,t),this.x=e,this.y=i,this.decay=n,this.power=a,this.glcolor=[0,0,0,1],this.samples=h,this.intensity=l,void 0!==o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},8734:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===n&&(n=3),void 0===a&&(a=!1),r.call(this,s.SHINE,t),this.speed=e,this.lineWidth=i,this.gradient=n,this.reveal=a}});t.exports=a},2437:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===a&&(a=.5),r.call(this,s.VIGNETTE,t),this.x=e,this.y=i,this.radius=n,this.strength=a}});t.exports=a},5984:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=!1),r.call(this,s.WIPE,t),this.progress=0,this.wipeWidth=e,this.direction=i,this.axis=n,this.reveal=a}});t.exports=a},1571:t=>{t.exports={GLOW:4,SHADOW:5,PIXELATE:6,VIGNETTE:7,SHINE:8,BLUR:9,GRADIENT:12,BLOOM:13,COLOR_MATRIX:14,CIRCLE:15,BARREL:16,DISPLACEMENT:17,WIPE:18,BOKEH:19}},7347:(t,e,i)=>{var n=i(1030),r=i(1571),s={Barrel:i(7340),Controller:i(6128),Bloom:i(5170),Blur:i(4199),Bokeh:i(3132),Circle:i(6610),ColorMatrix:i(4931),Displacement:i(9195),Glow:i(445),Gradient:i(7724),Pixelate:i(4412),Shadow:i(75),Shine:i(8734),Vignette:i(2437),Wipe:i(5984)};s=n(!1,s,r),t.exports=s},2494:(t,e,i)=>{var n=i(8351),r=i(8361);t.exports=function(t,e,i){e.x=r(i,"x",0),e.y=r(i,"y",0),e.depth=r(i,"depth",0),e.flipX=r(i,"flipX",!1),e.flipY=r(i,"flipY",!1);var s=r(i,"scale",null);"number"==typeof s?e.setScale(s):null!==s&&(e.scaleX=r(s,"x",1),e.scaleY=r(s,"y",1));var a=r(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=r(a,"x",1),e.scrollFactorY=r(a,"y",1)),e.rotation=r(i,"rotation",0);var o=r(i,"angle",null);null!==o&&(e.angle=o),e.alpha=r(i,"alpha",1);var h=r(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),u=r(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=r(i,"blendMode",n.NORMAL),e.visible=r(i,"visible",!0),r(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},2273:(t,e,i)=>{var n=i(7473),r=i(6125),s=i(1081),a=i(4399),o=i(3389),h=i(204),l=new n({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new s(this)),this},setData:function(t,e){return this.data||(this.data=new s(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new s(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new s(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new s(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.preFX&&(this.preFX.destroy(),this.preFX=void 0),this.postFX&&(this.postFX.destroy(),this.postFX=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},3649:(t,e,i)=>{var n=i(7473),r=i(8456),s=i(204),a=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(s.BOOT,this.boot,this),this.events.on(s.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(s.DESTROY,this.destroy,this)},start:function(){this.events.once(s.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(s.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(s.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectFactory",a,"add"),t.exports=a},2208:(t,e,i)=>{var n=i(4227),r=new n,s=new n,a=new n,o={camera:r,sprite:s,calc:a};t.exports=function(t,e,i){var n=r,h=s,l=a;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),n.multiply(h,l),o}},4344:(t,e,i)=>{var n=i(2915),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,r){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=r},4518:(t,e,i)=>{var n=i(2915),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=r},5173:(t,e,i)=>{var n=i(8351),r={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=r},1991:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},8305:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},3131:t=>{var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},1626:(t,e,i)=>{var n=i(7473),r=i(7347),s=i(8935),a=new n({initialize:function(t,e){this.gameObject=t,this.isPost=e,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(t){return void 0===t&&(t=0),this.padding=t,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(t){if(!this.isPost){var e=this.gameObject.scene.sys.renderer;e&&e.pipelines?(this.gameObject.pipeline=e.pipelines.FX_PIPELINE,void 0!==t&&(this.padding=t),this.enabled=!0):this.enabled=!1}},clear:function(){if(this.isPost)this.gameObject.resetPostPipeline(!0);else{for(var t=this.list,e=0;e{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},3671:(t,e,i)=>{var n=i(1392),r=i(9876),s=i(2529),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&r(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t,e){return void 0===t&&(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getTopLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,r,s,a,o,h,l;if(void 0===t&&(t=new n),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),r=t.x,s=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),r=t.x,s=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,r,a,h),t.y=Math.min(i,s,o,l),t.width=Math.max(e,r,a,h)-t.x,t.height=Math.max(i,s,o,l)-t.y,t}};t.exports=a},2246:(t,e,i)=>{var n=i(7499),r=i(6726),s={mask:null,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},createBitmapMask:function(t,e,i,r,s){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new n(this.scene,t,e,i,r,s)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new r(this.scene,t)}};t.exports=s},5085:t=>{var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},77:(t,e,i)=>{var n=i(7149),r=i(1864),s=i(5851),a=i(3747),o=i(2529),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=s(t,"from",0),t.to=s(t,"to",1);var h=r(t,"positionOnPath",!1);this.rotateToPath=r(t,"rotateToPath",!1),this.pathRotationOffset=s(t,"rotationOffset",0);var l=s(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+n(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,r=this.pathVector;if(i.copy(r).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,r),i.add(r),r.add(this.pathOffset),void this.setPosition(r.x,r.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),r),i.add(r),r.add(this.pathOffset);var s=this.x,o=this.y;this.setPosition(r.x,r.y);var h=this.x-s,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+n(this.pathRotationOffset))}}};t.exports=h},986:(t,e,i)=>{var n=i(3911),r={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(t){this.pipelineData={};var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(i){void 0===t&&(t=i.default);var n=i.get(t);if(n)return this.defaultPipeline=n,this.pipeline=n,!0}return!1},setPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){var a=s.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?n(e):e)}return this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},resetPipeline:function(t){return void 0===t&&(t=!1),this.pipeline=this.defaultPipeline,t&&(this.pipelineData={}),null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=r},4461:(t,e,i)=>{var n=i(3911),r=i(1626),s=i(8935),a={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(t){this.postPipelines=[],this.postPipelineData={},this.postFX=new r(this,!0),t&&(this.preFX=new r(this,!1))},setPostPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){Array.isArray(t)||(t=[t]);for(var a=0;a0,this},setPostPipelineData:function(t,e){var i=this.postPipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,n=[],r=0;r=0;n--){var r=i[n];(e&&r.name===t||!e&&r===t)&&(r.destroy(),s(i,n))}return this.hasPostPipeline=this.postPipelines.length>0,this},clearFX:function(){return this.preFX&&this.preFX.clear(),this.postFX&&this.postFX.clear(),this}};t.exports=a},4627:t=>{var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},1868:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},4976:(t,e,i)=>{var n=i(2362),r={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof n?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=r},9243:(t,e,i)=>{var n=i(2362),r={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof n?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=r},5693:t=>{var e={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,n){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,n=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=n,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=e},6125:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},3212:(t,e,i)=>{var n=i(7425),r=i(4227),s=i(7556),a=i(3692),o=i(2820),h=i(2529),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:0!==this._scaleY&&(this.renderFlags|=4)}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:0!==this._scaleX&&(this.renderFlags|=4)}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(e||(e=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,n){i||(i=new h),n||(n=this.scene.sys.cameras.main);var r=n.scrollX,a=n.scrollY,o=t+r*this.scrollFactorX-r,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):s(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},4227:(t,e,i)=>{var n=i(7473),r=i(7425),s=i(2529),a=new n({initialize:function(t,e,i,n,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),this.matrix=new Float32Array([t,e,i,n,r,s,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):n||s?r.TAU-(s>0?Math.acos(-n/this.scaleY):-Math.acos(n/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,r=n[0],s=n[1],a=n[2],o=n[3];return n[0]=r*i+a*e,n[1]=s*i+o*e,n[2]=r*-e+a*i,n[3]=s*-e+o*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,r=i[0],s=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],v=n[5],g=void 0===e?i:e.matrix;return g[0]=u*r+c*a,g[1]=u*s+c*o,g[2]=d*r+f*a,g[3]=d*s+f*o,g[4]=p*r+v*a+h,g[5]=p*s+v*o+l,g},multiplyWithOffset:function(t,e,i){var n=this.matrix,r=t.matrix,s=n[0],a=n[1],o=n[2],h=n[3],l=e*s+i*o+n[4],u=e*a+i*h+n[5],c=r[0],d=r[1],f=r[2],p=r[3],v=r[4],g=r[5];return n[0]=c*s+d*o,n[1]=c*a+d*h,n[2]=f*s+p*o,n[3]=f*a+p*h,n[4]=v*s+g*o+l,n[5]=v*a+g*h+u,this},transform:function(t,e,i,n,r,s){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+n*l,a[3]=i*h+n*u,a[4]=r*o+s*l+c,a[5]=r*h+s*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,r=n[0],s=n[1],a=n[2],o=n[3],h=n[4],l=n[5];return i.x=t*r+e*a+h,i.y=t*s+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=e*r-i*n;return t[0]=r/o,t[1]=-i/o,t[2]=-n/o,t[3]=e/o,t[4]=(n*a-r*s)/o,t[5]=-(e*a-i*s)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,r,s){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=n,a[4]=r,a[5]=s,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],r=e[2],s=e[3],a=i*s-n*r;if(t.translateX=e[4],t.translateY=e[5],i||n){var o=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(r||s){var h=Math.sqrt(r*r+s*s);t.rotation=.5*Math.PI-(s>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,n,r){var s=this.matrix,a=Math.sin(i),o=Math.cos(i);return s[4]=t,s[5]=e,s[0]=o*n,s[1]=a*n,s[2]=-a*r,s[3]=o*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],a=n[1],o=n[2],h=n[3],l=n[4],u=n[5],c=1/(r*h+o*-a);return i.x=h*c*t+-o*c*e+(u*o-l*h)*c,i.y=r*c*e+-a*c*t+(-u*r+l*a)*c,i},setQuad:function(t,e,i,n,r,s){void 0===s&&(s=this.quad);var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return s[0]=t*o+e*l+c,s[1]=t*h+e*u+d,s[2]=t*o+n*l+c,s[3]=t*h+n*u+d,s[4]=i*o+n*l+c,s[5]=i*h+n*u+d,s[6]=i*o+e*l+c,s[7]=i*h+e*u+d,r&&s.forEach((function(t,e){s[e]=Math.round(t)})),s},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var n=this.getX(t,e);return i&&(n=Math.round(n)),n},getYRound:function(t,e,i){var n=this.getY(t,e);return i&&(n=Math.round(n)),n},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},8414:t=>{var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},4286:(t,e,i)=>{t.exports={Alpha:i(4344),AlphaSingle:i(4518),BlendMode:i(5173),ComputedSize:i(1991),Crop:i(8305),Depth:i(3131),Flip:i(9660),FX:i(1626),GetBounds:i(3671),Mask:i(2246),Origin:i(5085),PathFollower:i(77),Pipeline:i(986),PostPipeline:i(4461),ScrollFactor:i(4627),Size:i(1868),Texture:i(4976),TextureCrop:i(9243),Tint:i(5693),ToJSON:i(6125),Transform:i(3212),TransformMatrix:i(4227),Visible:i(8414)}},7361:(t,e,i)=>{var n=i(1953),r=i(8351),s=i(7473),a=i(4286),o=i(3389),h=i(2273),l=i(1392),u=i(3232),c=i(9422),d=i(2529),f=new s({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.PostPipeline,a.Transform,a.Visible,u],initialize:function(t,e,i,n){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(e,i),this.setBlendMode(r.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,n=new l,r=!1;t.setEmpty();for(var s=0;s-1},setAll:function(t,e,i,r){return n.SetAll(this.list,t,e,i,r),this},each:function(t,e){var i,n=[null],r=this.list.slice(),s=r.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},2840:t=>{t.exports=function(t,e,i,n){i.addToRenderList(e);var r=e.list;if(0!==r.length){var s=e.localTransform;n?(s.loadIdentity(),s.multiply(n),s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.scaleX,e.scaleY)):s.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var n=i(1984),r=n,s=n;r=i(4343),s=i(2840),t.exports={renderWebGL:r,renderCanvas:s}},4343:t=>{t.exports=function(t,e,i,n){i.addToRenderList(e);var r=e.list,s=r.length;if(0!==s){var a=e.localTransform;n?(a.loadIdentity(),a.multiply(n),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var o=-1!==e.blendMode;o||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c{t.exports="addedtoscene"},4265:t=>{t.exports="destroy"},8671:t=>{t.exports="removedfromscene"},3420:t=>{t.exports="complete"},601:t=>{t.exports="created"},7919:t=>{t.exports="error"},6231:t=>{t.exports="locked"},5241:t=>{t.exports="loop"},8325:t=>{t.exports="playing"},3356:t=>{t.exports="play"},7513:t=>{t.exports="seeked"},5788:t=>{t.exports="seeking"},7111:t=>{t.exports="stalled"},8118:t=>{t.exports="stop"},9184:t=>{t.exports="textureready"},4287:t=>{t.exports="unlocked"},857:t=>{t.exports="unsupported"},3389:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(6608),DESTROY:i(4265),REMOVED_FROM_SCENE:i(8671),VIDEO_COMPLETE:i(3420),VIDEO_CREATED:i(601),VIDEO_ERROR:i(7919),VIDEO_LOCKED:i(6231),VIDEO_LOOP:i(5241),VIDEO_PLAY:i(3356),VIDEO_PLAYING:i(8325),VIDEO_SEEKED:i(7513),VIDEO_SEEKING:i(5788),VIDEO_STALLED:i(7111),VIDEO_STOP:i(8118),VIDEO_TEXTURE:i(9184),VIDEO_UNLOCKED:i(4287),VIDEO_UNSUPPORTED:i(857)}},1643:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},8881:(t,e,i)=>{var n=i(7655);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},4479:(t,e,i)=>{var n=i(4771),r=i(7655);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=n(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;u{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},284:(t,e,i)=>{var n=i(7473),r=i(8881),s=i(4479),a=i(1643),o=i(3915),h=i(2529),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=n},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return s(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},3915:(t,e,i)=>{var n=i(7655);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},7655:(t,e,i)=>{var n=i(7473),r=i(1643),s=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=r.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=s},5956:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},716:(t,e,i)=>{var n=i(7120),r=i(7655);t.exports=function(t,e,i){if(void 0===i&&(i=new r),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var s=n(t)*e;return e>.5?(s-=t.width+t.height)<=t.width?(i.x=t.right-s,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(s-t.width)):s<=t.width?(i.x=t.x+s,i.y=t.y):(i.x=t.right,i.y=t.y+(s-t.width)),i}},8151:(t,e,i)=>{var n=i(716),r=i(7120);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=r(t)/i);for(var a=0;a{t.exports=function(t){return 2*(t.width+t.height)}},2161:(t,e,i)=>{var n=i(7655);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},1392:(t,e,i)=>{var n=i(7473),r=i(5956),s=i(716),a=i(8151),o=i(1643),h=i(284),l=i(2161),u=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},9422:(t,e,i)=>{var n=i(1392);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=Math.min(t.x,e.x),s=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-r,o=Math.max(t.bottom,e.bottom)-s;return i.setTo(r,s,a,o)}},1593:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1179),a=i(4597),o=i(5593),h=i(7410),l=i(5874),u=i(707),c=new n({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var n=a(e,"url");void 0===n?n=t.path+i+"."+a(e,"extension",""):"string"!=typeof n||n.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(n=t.path+n),this.url=n,this.src="",this.xhrSettings=u(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===r.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=r.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,n=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(n=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,n)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(s.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==r.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(s.FILE_COMPLETE,e,i,t),this.loader.emit(s.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=r.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},9845:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},5593:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},7410:(t,e,i)=>{var n=i(1030),r=i(707);t.exports=function(t,e){var i=void 0===t?r():n({},t);if(e)for(var s in e)void 0!==e[s]&&(i[s]=e[s]);return i}},3137:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1179),a=new n({initialize:function(t,e,i,n){var s=[];n.forEach((function(t){t&&s.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=s,this.state=r.FILE_PENDING,this.complete=!1,this.pending=s.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a{var n=i(7410);t.exports=function(t,e){var i=n(e,t.xhrSettings),r=new XMLHttpRequest;if(r.open("GET",t.src,i.async,i.user,i.password),r.responseType=t.xhrSettings.responseType,r.timeout=i.timeout,i.headers)for(var s in i.headers)r.setRequestHeader(s,i.headers[s]);return i.header&&i.headerValue&&r.setRequestHeader(i.header,i.headerValue),i.requestedWith&&r.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&r.overrideMimeType(i.overrideMimeType),i.withCredentials&&(r.withCredentials=!0),r.onload=t.onLoad.bind(t,r),r.onerror=t.onError.bind(t,r),r.onprogress=t.onProgress.bind(t),r.send(),r}},707:t=>{t.exports=function(t,e,i,n,r,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=0),void 0===s&&(s=!1),{responseType:t,async:e,user:i,password:n,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:s}}},4359:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},462:t=>{t.exports="addfile"},7297:t=>{t.exports="complete"},8660:t=>{t.exports="filecomplete"},6484:t=>{t.exports="filecomplete-"},7972:t=>{t.exports="loaderror"},1906:t=>{t.exports="load"},1441:t=>{t.exports="fileprogress"},1072:t=>{t.exports="postprocess"},1927:t=>{t.exports="progress"},6597:t=>{t.exports="start"},1179:(t,e,i)=>{t.exports={ADD:i(462),COMPLETE:i(7297),FILE_COMPLETE:i(8660),FILE_KEY_COMPLETE:i(6484),FILE_LOAD_ERROR:i(7972),FILE_LOAD:i(1906),FILE_PROGRESS:i(1441),POST_PROCESS:i(1072),PROGRESS:i(1927),START:i(6597)}},6732:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(2482),l=i(5593),u=new n({Extends:s,initialize:function t(e,i,n,r,a){var l,u="png";if(h(i)){var c=i;i=o(c,"key"),n=o(c,"url"),l=o(c,"normalMap"),r=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"frameConfig")}Array.isArray(n)&&(l=n[1],n=n[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:n,xhrSettings:r,config:a};if(s.call(this,e,d),l){var f=new t(e,this.key,l,r,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){s.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){s.revokeObjectURL(t.data),t.onProcessError()},s.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=r.FILE_PROCESSING,t===r.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=r.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=r.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t?t.state>=r.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var n=0;n{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(5851),l=i(2482),u=new n({Extends:s,initialize:function(t,e,i,n,a){var u="json";if(l(e)){var c=e;e=o(c,"key"),i=o(c,"url"),n=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:a};s.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=r.FILE_POPULATED)},onProcess:function(){if(this.state!==r.FILE_POPULATED){this.state=r.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(2482),l=new n({Extends:s,initialize:function(t,e,i,n){var r="text",a="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),n=o(u,"xhrSettings"),a=o(u,"extension",a),r=o(u,"type",r),l=o(u,"cache",l)}var c={type:r,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var n=0;n{t.exports=function(t){for(var e=0,i=0;i{var n=i(3916);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},7025:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},48:t=>{t.exports=function(t,e,i,n,r){var s=.5*(n-e),a=.5*(r-i),o=t*t;return(2*i-2*n+s+a)*(t*o)+(-3*i+3*n-2*s-a)*o+s*t+i}},5035:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},2915:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},7149:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t*n.DEG_TO_RAD}},2975:t=>{t.exports=function(t,e){return Math.abs(t-e)}},2107:(t,e,i)=>{var n=i(2915),r=i(7473),s=i(9652),a=i(1984),o=new s,h=new r({initialize:function t(e,i,n,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=t.DefaultOrder),this._x=e,this._y=i,this._z=n,this._order=r,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,n){return void 0===n&&(n=this._order),this._x=t,this._y=e,this._z=i,this._order=n,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var r=t.val,s=r[0],a=r[4],o=r[8],h=r[1],l=r[5],u=r[9],c=r[2],d=r[6],f=r[10],p=0,v=0,g=0,m=.99999;switch(e){case"XYZ":v=Math.asin(n(o,-1,1)),Math.abs(o){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},104:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},4941:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},1555:(t,e,i)=>{var n=i(2915);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))+e}},5005:t=>{t.exports=function(t,e){return t/e/1e3}},3702:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},8820:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},1743:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},3416:t=>{t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},2149:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*s-a*h,c=-l*r+a*o,d=h*r-s*o,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(a*i-n*s)*f,t[3]=c*f,t[4]=(l*e-n*o)*f,t[5]=(-a*e+n*r)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(s*e-i*r)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=s*l-a*h,t[1]=n*h-i*l,t[2]=i*a-n*s,t[3]=a*o-r*l,t[4]=e*l-n*o,t[5]=n*r-e*a,t[6]=r*h-s*o,t[7]=i*o-e*h,t[8]=e*s-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*s-a*h)+i*(-l*r+a*o)+n*(h*r-s*o)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],v=c[3],g=c[4],m=c[5],M=c[6],x=c[7],y=c[8];return e[0]=d*i+f*s+p*h,e[1]=d*n+f*a+p*l,e[2]=d*r+f*o+p*u,e[3]=v*i+g*s+m*h,e[4]=v*n+g*a+m*l,e[5]=v*r+g*o+m*u,e[6]=M*i+x*s+y*h,e[7]=M*n+x*a+y*l,e[8]=M*r+x*o+y*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*s,e[1]=l*n+h*a,e[2]=l*r+h*o,e[3]=l*s-h*i,e[4]=l*a-h*n,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,r=t.w,s=e+e,a=i+i,o=n+n,h=e*s,l=e*a,u=e*o,c=i*a,d=i*o,f=n*o,p=r*s,v=r*a,g=r*o,m=this.val;return m[0]=1-(c+f),m[3]=l+g,m[6]=u-v,m[1]=l-g,m[4]=1-(h+f),m[7]=d+p,m[2]=u+v,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],v=e[12],g=e[13],m=e[14],M=e[15],x=n*h-r*o,y=n*l-s*o,w=n*u-a*o,E=r*l-s*h,b=r*u-a*h,T=s*u-a*l,A=c*g-d*v,R=c*m-f*v,S=c*M-p*v,C=d*m-f*g,I=d*M-p*g,P=f*M-p*m,L=x*P-y*I+w*C+E*S-b*R+T*A;return L?(L=1/L,i[0]=(h*P-l*I+u*C)*L,i[1]=(l*S-o*P-u*R)*L,i[2]=(o*I-h*S+u*A)*L,i[3]=(s*I-r*P-a*C)*L,i[4]=(n*P-s*S+a*R)*L,i[5]=(r*S-n*I-a*A)*L,i[6]=(g*T-m*b+M*E)*L,i[7]=(m*w-v*T-M*y)*L,i[8]=(v*b-g*w+M*x)*L,this):null}});t.exports=n},9652:(t,e,i)=>{var n=i(7473),r=i(5689),s=1e-6,a=new n({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,n,r,s,a,o,h,l,u,c,d,f,p,v){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=n,g[4]=r,g[5]=s,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=u,g[11]=c,g[12]=d,g[13]=f,g[14]=p,g[15]=v,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var n=o.fromQuat(i).val,r=e.x,s=e.y,a=e.z;return this.setValues(n[0]*r,n[1]*r,n[2]*r,0,n[4]*s,n[5]*s,n[6]*s,0,n[8]*a,n[9]*a,n[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],r=t[6],s=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=n,t[13]=s,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15],m=e*a-i*s,M=e*o-n*s,x=e*h-r*s,y=i*o-n*a,w=i*h-r*a,E=n*h-r*o,b=l*p-u*f,T=l*v-c*f,A=l*g-d*f,R=u*v-c*p,S=u*g-d*p,C=c*g-d*v,I=m*C-M*S+x*R+y*A-w*T+E*b;return I?(I=1/I,this.setValues((a*C-o*S+h*R)*I,(n*S-i*C-r*R)*I,(p*E-v*w+g*y)*I,(c*w-u*E-d*y)*I,(o*A-s*C-h*T)*I,(e*C-n*A+r*T)*I,(v*x-f*E-g*M)*I,(l*E-c*x+d*M)*I,(s*S-a*A+h*b)*I,(i*A-e*S-r*b)*I,(f*w-p*x+g*m)*I,(u*x-l*w-d*m)*I,(a*T-s*R-o*b)*I,(e*R-i*T+n*b)*I,(p*M-f*y-v*m)*I,(l*y-u*M+c*m)*I)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return this.setValues(a*(c*g-d*v)-u*(o*g-h*v)+p*(o*d-h*c),-(i*(c*g-d*v)-u*(n*g-r*v)+p*(n*d-r*c)),i*(o*g-h*v)-a*(n*g-r*v)+p*(n*h-r*o),-(i*(o*d-h*c)-a*(n*d-r*c)+u*(n*h-r*o)),-(s*(c*g-d*v)-l*(o*g-h*v)+f*(o*d-h*c)),e*(c*g-d*v)-l*(n*g-r*v)+f*(n*d-r*c),-(e*(o*g-h*v)-s*(n*g-r*v)+f*(n*h-r*o)),e*(o*d-h*c)-s*(n*d-r*c)+l*(n*h-r*o),s*(u*g-d*p)-l*(a*g-h*p)+f*(a*d-h*u),-(e*(u*g-d*p)-l*(i*g-r*p)+f*(i*d-r*u)),e*(a*g-h*p)-s*(i*g-r*p)+f*(i*h-r*a),-(e*(a*d-h*u)-s*(i*d-r*u)+l*(i*h-r*a)),-(s*(u*v-c*p)-l*(a*v-o*p)+f*(a*c-o*u)),e*(u*v-c*p)-l*(i*v-n*p)+f*(i*c-n*u),-(e*(a*v-o*p)-s*(i*v-n*p)+f*(i*o-n*a)),e*(a*c-o*u)-s*(i*c-n*u)+l*(i*o-n*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return(e*a-i*s)*(c*g-d*v)-(e*o-n*s)*(u*g-d*p)+(e*h-r*s)*(u*v-c*p)+(i*o-n*a)*(l*g-d*f)-(i*h-r*a)*(l*v-c*f)+(n*h-r*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],v=e[13],g=e[14],m=e[15],M=t.val,x=M[0],y=M[1],w=M[2],E=M[3];return e[0]=x*i+y*a+w*u+E*p,e[1]=x*n+y*o+w*c+E*v,e[2]=x*r+y*h+w*d+E*g,e[3]=x*s+y*l+w*f+E*m,x=M[4],y=M[5],w=M[6],E=M[7],e[4]=x*i+y*a+w*u+E*p,e[5]=x*n+y*o+w*c+E*v,e[6]=x*r+y*h+w*d+E*g,e[7]=x*s+y*l+w*f+E*m,x=M[8],y=M[9],w=M[10],E=M[11],e[8]=x*i+y*a+w*u+E*p,e[9]=x*n+y*o+w*c+E*v,e[10]=x*r+y*h+w*d+E*g,e[11]=x*s+y*l+w*f+E*m,x=M[12],y=M[13],w=M[14],E=M[15],e[12]=x*i+y*a+w*u+E*p,e[13]=x*n+y*o+w*c+E*v,e[14]=x*r+y*h+w*d+E*g,e[15]=x*s+y*l+w*f+E*m,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,n=e.val,r=i[0],s=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],f=i[6],p=i[10],v=i[14],g=i[3],m=i[7],M=i[11],x=i[15],y=n[0],w=n[4],E=n[8],b=n[12],T=n[1],A=n[5],R=n[9],S=n[13],C=n[2],I=n[6],P=n[10],L=n[14],O=n[3],_=n[7],k=n[11],F=n[15];return this.setValues(r*y+s*T+a*C+o*O,h*y+l*T+u*C+c*O,d*y+f*T+p*C+v*O,g*y+m*T+M*C+x*O,r*w+s*A+a*I+o*_,h*w+l*A+u*I+c*_,d*w+f*A+p*I+v*_,g*w+m*A+M*I+x*_,r*E+s*R+a*P+o*k,h*E+l*R+u*P+c*k,d*E+f*R+p*P+v*k,g*E+m*R+M*P+x*k,r*b+s*S+a*L+o*F,h*b+l*S+u*L+c*F,d*b+f*S+p*L+v*F,g*b+m*S+M*L+x*F)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var n=this.val;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var n=this.val;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,a=t.y,o=t.z,h=r*s,l=r*a;return this.setValues(h*s+i,h*a-n*o,h*o+n*a,0,h*a+n*o,l*a+i,l*o-n*s,0,h*o-n*a,l*o+n*s,r*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,n=e.x,r=e.y,a=e.z,o=Math.sqrt(n*n+r*r+a*a);if(Math.abs(o){t.exports=function(t,e,i){return Math.min(t+e,i)}},44:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},5385:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},8585:t=>{t.exports=function(t,e,i,n){void 0===i&&(i=e+1);var r=(t-e)/(i-e);return r>1?void 0!==n?(r=(n-t)/(n-i))<0&&(r=0):r=1:r<0&&(r=0),r}},372:(t,e,i)=>{var n=i(7473),r=i(2149),s=i(1984),a=i(5689),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),c=new a(0,1,0),d=new a,f=new r,p=new n({initialize:function(t,e,i,n){this.onChangeCallback=s,this.set(t,e,i,n)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,n,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=n||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=n*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.set(i+e*(t.x-i),n+e*(t.y-n),r+e*(t.z-r),s+e*(t.w-s))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var n=f.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+r*s+i*o-n*a,i*h+r*a+n*s-e*o,n*h+r*o+e*a-i*s,r*h-e*s-i*a-n*o)},slerp:function(t,e){var i=this.x,n=this.y,r=this.z,s=this.w,a=t.x,h=t.y,l=t.z,u=t.w,c=i*a+n*h+r*l+s*u;c<0&&(c=-c,a=-a,h=-h,l=-l,u=-u);var d=1-e,f=e;if(1-c>o){var p=Math.acos(c),v=Math.sin(p);d=Math.sin((1-e)*p)/v,f=Math.sin(e*p)/v}return this.set(d*i+f*a,d*n+f*h,d*r+f*l,d*s+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n,s=r?1/r:0;return this.set(-t*s,-e*s,-i*s,n*s)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a+r*s,i*a+n*s,n*a-i*s,r*a-e*s)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a-n*s,i*a+r*s,n*a+e*s,r*a-i*s)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*s,i*a-e*s,n*a+r*s,r*a-n*s)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,n=t.y/2,r=t.z/2,s=Math.cos(i),a=Math.cos(n),o=Math.cos(r),h=Math.sin(i),l=Math.sin(n),u=Math.sin(r);switch(t.order){case"XYZ":this.set(h*a*o+s*l*u,s*l*o-h*a*u,s*a*u+h*l*o,s*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+s*l*u,s*l*o-h*a*u,s*a*u-h*l*o,s*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-s*l*u,s*l*o+h*a*u,s*a*u+h*l*o,s*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-s*l*u,s*l*o+h*a*u,s*a*u-h*l*o,s*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+s*l*u,s*l*o+h*a*u,s*a*u-h*l*o,s*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-s*l*u,s*l*o-h*a*u,s*a*u+h*l*o,s*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,n=i[0],r=i[4],s=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=n+o+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(s-l)*e,(a-r)*e,.25/e)):n>o&&n>c?(e=2*Math.sqrt(1+n-o-c),this.set(.25*e,(r+a)/e,(s+l)/e,(u-h)/e)):o>c?(e=2*Math.sqrt(1+o-n-c),this.set((r+a)/e,.25*e,(h+u)/e,(s-l)/e)):(e=2*Math.sqrt(1+c-n-o),this.set((s+l)/e,(h+u)/e,.25*e,(a-r)/e)),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var s=h[r],a=h[s];e=Math.sqrt(i[3*r+r]-i[3*s+s]-i[3*a+a]+1),l[r]=.5*e,e=.5/e,l[s]=(i[3*s+r]+i[3*r+s])*e,l[a]=(i[3*a+r]+i[3*r+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+s]-i[3*s+a])*e}return this.onChangeCallback(this),this}});t.exports=p},4208:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t*n.RAD_TO_DEG}},1705:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},6650:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,n=2*Math.random()-1,r=Math.sqrt(1-n*n)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=n*e,t}},2037:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},6283:t=>{t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},9876:t=>{t.exports=function(t,e,i,n){var r=Math.cos(n),s=Math.sin(n),a=t.x-e,o=t.y-i;return t.x=a*r-o*s+e,t.y=a*s+o*r+i,t}},8348:t=>{t.exports=function(t,e,i,n,r){var s=n+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},4497:t=>{t.exports=function(t,e,i,n,r){return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},9640:(t,e,i)=>{var n=i(5689),r=i(9652),s=i(372),a=new r,o=new s,h=new n;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},4078:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},855:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.round(t*n)/n}},4936:t=>{t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var r=[],s=[],a=0;a{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},278:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},163:(t,e,i)=>{var n=i(2529);t.exports=function(t,e,i,r){void 0===r&&(r=new n);var s=0,a=0;return t>0&&t<=e*i&&(s=t>e-1?t-(a=Math.floor(t/e))*e:t),r.set(s,a)}},7556:(t,e,i)=>{var n=i(2529);t.exports=function(t,e,i,r,s,a,o,h){void 0===h&&(h=new n);var l=Math.sin(s),u=Math.cos(s),c=u*a,d=l*a,f=-l*o,p=u*o,v=1/(c*p+f*-d);return h.x=p*v*t+-f*v*e+(r*f-i*p)*v,h.y=c*v*e+-d*v*t+(-r*c+i*d)*v,h}},2529:(t,e,i)=>{var n=i(7473),r=i(12),s=new n({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new s(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return r(this.x,t.x,e)&&r(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});s.ZERO=new s,s.RIGHT=new s(1,0),s.LEFT=new s(-1,0),s.UP=new s(0,-1),s.DOWN=new s(0,1),s.ONE=new s(1,1),t.exports=s},5689:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new n(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=n*o-r*a,this.y=r*s-i*o,this.z=i*a-n*s,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z;return this.x=i*a-n*s,this.y=n*r-e*a,this.z=e*s-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+n*r[6],this.y=e*r[1]+i*r[4]+n*r[7],this.z=e*r[2]+i*r[5]+n*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12],this.y=r[1]*e+r[5]*i+r[9]*n+r[13],this.z=r[2]*e+r[6]*i+r[10]*n+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=e*r[0]+i*r[4]+n*r[8]+r[12],a=e*r[1]+i*r[5]+n*r[9]+r[13],o=e*r[2]+i*r[6]+n*r[10]+r[14],h=e*r[3]+i*r[7]+n*r[11]+r[15];return this.x=s/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*n-a*i,l=o*i+a*e-r*n,u=o*n+r*i-s*e,c=-r*e-s*i-a*n;return this.x=h*o+c*-r+l*-a-u*-s,this.y=l*o+c*-s+u*-r-h*-a,this.z=u*o+c*-a+h*-s-l*-r,this},project:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],c=r[6],d=r[7],f=r[8],p=r[9],v=r[10],g=r[11],m=r[12],M=r[13],x=r[14],y=1/(e*h+i*d+n*g+r[15]);return this.x=(e*s+i*l+n*f+m)*y,this.y=(e*a+i*u+n*p+M)*y,this.z=(e*o+i*c+n*v+x)*y,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,n=t.y,r=t.z,s=t.w,a=this.x-i,o=s-this.y-1-n,h=this.z;return this.x=2*a/r-1,this.y=2*o/s-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});n.ZERO=new n,n.RIGHT=new n(1,0,0),n.LEFT=new n(-1,0,0),n.UP=new n(0,-1,0),n.DOWN=new n(0,1,0),n.FORWARD=new n(0,0,1),n.BACK=new n(0,0,-1),n.ONE=new n(1,1,1),t.exports=n},9279:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=n*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this.w=s+e*(t.w-s),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+n*n+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*n-a*i,l=o*i+a*e-r*n,u=o*n+r*i-s*e,c=-r*e-s*i-a*n;return this.x=h*o+c*-r+l*-a-u*-s,this.y=l*o+c*-s+u*-r-h*-a,this.z=u*o+c*-a+h*-s-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},4119:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},8445:t=>{t.exports=function(t,e,i){if(t>=e&&t<=i)return t;var n=i-e;return e+((t-e)%n+n)%n}},6412:t=>{t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},760:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},6909:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},6947:t=>{t.exports=function(t,e,i,n){return Math.atan2(i-t,n-e)}},3426:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t>Math.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},6906:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},3270:(t,e,i)=>{var n=i(104);t.exports=function(){return n(-Math.PI,Math.PI)}},2748:(t,e,i)=>{var n=i(104);t.exports=function(){return n(-180,180)}},936:(t,e,i)=>{var n=i(6906);t.exports=function(t){return n(t+Math.PI)}},1935:(t,e,i)=>{var n=i(7425);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},3692:(t,e,i)=>{var n=i(8445);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},2820:(t,e,i)=>{var n=i(8445);t.exports=function(t){return n(t,-180,180)}},1833:(t,e,i)=>{t.exports={Between:i(6412),BetweenPoints:i(760),BetweenPointsY:i(6909),BetweenY:i(6947),CounterClockwise:i(3426),Normalize:i(6906),Random:i(3270),RandomDegrees:i(2748),Reverse:i(936),RotateTo:i(1935),ShortestBetween:i(5393),Wrap:i(3692),WrapDegrees:i(2820)}},7425:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},1518:t=>{t.exports=function(t,e,i,n){var r=t-i,s=e-n;return Math.sqrt(r*r+s*s)}},5372:t=>{t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}},4430:t=>{t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},4361:t=>{t.exports=function(t,e,i,n){return Math.max(Math.abs(t-i),Math.abs(e-n))}},7798:t=>{t.exports=function(t,e,i,n,r){return void 0===r&&(r=2),Math.sqrt(Math.pow(i-t,r)+Math.pow(n-e,r))}},8290:t=>{t.exports=function(t,e,i,n){return Math.abs(t-i)+Math.abs(e-n)}},3788:t=>{t.exports=function(t,e,i,n){var r=t-i,s=e-n;return r*r+s*s}},6338:(t,e,i)=>{t.exports={Between:i(1518),BetweenPoints:i(5372),BetweenPointsSquared:i(4430),Chebyshev:i(4361),Power:i(7798),Snake:i(8290),Squared:i(3788)}},5751:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},6203:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},9103:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},4938:(t,e,i)=>{t.exports={In:i(5751),Out:i(9103),InOut:i(6203)}},8677:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},4649:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},504:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},8872:(t,e,i)=>{t.exports={In:i(8677),Out:i(504),InOut:i(4649)}},3170:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},2627:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},1349:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},5006:(t,e,i)=>{t.exports={In:i(3170),Out:i(1349),InOut:i(2627)}},6046:t=>{t.exports=function(t){return t*t*t}},9531:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},4836:t=>{t.exports=function(t){return--t*t*t+1}},875:(t,e,i)=>{t.exports={In:i(6046),Out:i(4836),InOut:i(9531)}},7619:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},7437:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},8119:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},2884:(t,e,i)=>{t.exports={In:i(7619),Out:i(8119),InOut:i(7437)}},5456:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},3461:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},2711:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},6287:(t,e,i)=>{t.exports={In:i(5456),Out:i(2711),InOut:i(3461)}},8613:(t,e,i)=>{t.exports={Back:i(4938),Bounce:i(8872),Circular:i(5006),Cubic:i(875),Elastic:i(2884),Expo:i(6287),Linear:i(4233),Quadratic:i(6341),Quartic:i(762),Quintic:i(345),Sine:i(8698),Stepped:i(7051)}},744:t=>{t.exports=function(t){return t}},4233:(t,e,i)=>{t.exports=i(744)},9810:t=>{t.exports=function(t){return t*t}},8163:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},6123:t=>{t.exports=function(t){return t*(2-t)}},6341:(t,e,i)=>{t.exports={In:i(9810),Out:i(6123),InOut:i(8163)}},7337:t=>{t.exports=function(t){return t*t*t*t}},4878:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},9012:t=>{t.exports=function(t){return 1- --t*t*t*t}},762:(t,e,i)=>{t.exports={In:i(7337),Out:i(9012),InOut:i(4878)}},303:t=>{t.exports=function(t){return t*t*t*t*t}},553:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},1632:t=>{t.exports=function(t){return--t*t*t*t*t+1}},345:(t,e,i)=>{t.exports={In:i(303),Out:i(1632),InOut:i(553)}},8455:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},1844:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},990:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},8698:(t,e,i)=>{t.exports={In:i(8455),Out:i(990),InOut:i(1844)}},6745:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},7051:(t,e,i)=>{t.exports=i(6745)},3158:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},12:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},7373:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},2622:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(3158),Equal:i(12),Floor:i(1326),GreaterThan:i(7373),LessThan:i(2622)}},4675:(t,e,i)=>{var n=i(7425),r=i(1030),s={Angle:i(1833),Distance:i(6338),Easing:i(8613),Fuzzy:i(7927),Interpolation:i(2140),Pow2:i(7897),Snap:i(3943),RandomDataGenerator:i(6957),Average:i(3136),Bernstein:i(785),Between:i(7025),CatmullRom:i(48),CeilTo:i(5035),Clamp:i(2915),DegToRad:i(7149),Difference:i(2975),Euler:i(2107),Factorial:i(3916),FloatBetween:i(104),FloorTo:i(4941),FromPercent:i(1555),GetSpeed:i(5005),IsEven:i(3702),IsEvenStrict:i(8820),Linear:i(1743),LinearXY:i(3416),MaxAdd:i(3733),Median:i(44),MinSub:i(5385),Percent:i(8585),RadToDeg:i(4208),RandomXY:i(1705),RandomXYZ:i(6650),RandomXYZW:i(2037),Rotate:i(6283),RotateAround:i(9876),RotateAroundDistance:i(8348),RotateTo:i(4497),RoundAwayFromZero:i(4078),RoundTo:i(855),SinCosTableGenerator:i(4936),SmootherStep:i(278),SmoothStep:i(2733),ToXY:i(163),TransformXY:i(7556),Within:i(4119),Wrap:i(8445),Vector2:i(2529),Vector3:i(5689),Vector4:i(9279),Matrix3:i(2149),Matrix4:i(9652),Quaternion:i(372),RotateVec3:i(9640)};s=r(!1,s,n),t.exports=s},1640:(t,e,i)=>{var n=i(785);t.exports=function(t,e){for(var i=0,r=t.length-1,s=0;s<=r;s++)i+=Math.pow(1-e,r-s)*Math.pow(e,s)*t[s]*n(r,s);return i}},6105:(t,e,i)=>{var n=i(48);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return t[0]===t[i]?(e<0&&(s=Math.floor(r=i*(1+e))),n(r-s,t[(s-1+i)%i],t[s],t[(s+1)%i],t[(s+2)%i])):e<0?t[0]-(n(-r,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(r-s,t[s?s-1:0],t[s],t[i{t.exports=function(t,e,i,n,r){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,r)}},6765:(t,e,i)=>{var n=i(1743);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return e<0?n(t[0],t[1],r):e>1?n(t[i],t[i-1],i-r):n(t[s],t[s+1>i?i:s+1],r-s)}},6388:t=>{t.exports=function(t,e,i,n){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}},5735:(t,e,i)=>{var n=i(2733);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},8705:(t,e,i)=>{var n=i(278);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},2140:(t,e,i)=>{t.exports={Bezier:i(1640),CatmullRom:i(6105),CubicBezier:i(4002),Linear:i(6765),QuadraticBezier:i(6388),SmoothStep:i(5735),SmootherStep:i(8705)}},5443:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},167:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},7897:(t,e,i)=>{t.exports={GetNext:i(5443),IsSize:i(725),IsValue:i(167)}},6957:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var n=0;n>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),n=t[i];t[i]=t[e],t[e]=n}return t}});t.exports=n},5659:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},5461:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),n?(i+t)/e:i+t)}},5131:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),n?(i+t)/e:i+t)}},3943:(t,e,i)=>{t.exports={Ceil:i(5659),Floor:i(5461),To:i(5131)}},8666:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},8456:t=>{var e={},i={},n={register:function(t,i,n,r){void 0===r&&(r=!1),e[t]={plugin:i,mapping:n,custom:r}},registerCustom:function(t,e,n,r){i[t]={plugin:e,mapping:n,data:r}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=n},5722:(t,e,i)=>{var n=i(8666),r=i(7473),s=i(204),a=new r({Extends:n,initialize:function(t,e,i){n.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(s.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},8351:t=>{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},8196:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},3527:t=>{t.exports="resize"},8618:t=>{t.exports="addedtoscene"},4328:t=>{t.exports="boot"},6099:t=>{t.exports="create"},7645:t=>{t.exports="destroy"},2710:t=>{t.exports="pause"},2547:t=>{t.exports="postupdate"},8577:t=>{t.exports="prerender"},8197:t=>{t.exports="preupdate"},8997:t=>{t.exports="ready"},7604:t=>{t.exports="removedfromscene"},8999:t=>{t.exports="render"},9742:t=>{t.exports="resume"},3667:t=>{t.exports="shutdown"},3468:t=>{t.exports="sleep"},7840:t=>{t.exports="start"},9896:t=>{t.exports="transitioncomplete"},5103:t=>{t.exports="transitioninit"},3162:t=>{t.exports="transitionout"},7841:t=>{t.exports="transitionstart"},6454:t=>{t.exports="transitionwake"},6536:t=>{t.exports="update"},3875:t=>{t.exports="wake"},204:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(8618),BOOT:i(4328),CREATE:i(6099),DESTROY:i(7645),PAUSE:i(2710),POST_UPDATE:i(2547),PRE_RENDER:i(8577),PRE_UPDATE:i(8197),READY:i(8997),REMOVED_FROM_SCENE:i(7604),RENDER:i(8999),RESUME:i(9742),SHUTDOWN:i(3667),SLEEP:i(3468),START:i(7840),TRANSITION_COMPLETE:i(9896),TRANSITION_INIT:i(5103),TRANSITION_OUT:i(3162),TRANSITION_START:i(7841),TRANSITION_WAKE:i(6454),UPDATE:i(6536),WAKE:i(3875)}},2362:(t,e,i)=>{var n=i(7473),r=i(2915),s=i(1030),a=new n({initialize:function(t,e,i,n,r,s,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(s,a,n,r)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var r=this.data,s=r.cut;s.x=i,s.y=n,s.w=t,s.h=e,s.r=i+t,s.b=n+e,r.sourceSize.w=t,r.sourceSize.h=e,r.spriteSourceSize.w=t,r.spriteSourceSize.h=e,r.radius=.5*Math.sqrt(t*t+e*e);var a=r.drawImage;return a.x=i,a.y=n,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,n,r,s){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=n,o.w=r,o.h=s,o.r=i+r,o.b=n+s,this.x=i,this.y=n,this.width=r,this.height=s,this.halfWidth=.5*r,this.halfHeight=.5*s,this.centerX=Math.floor(r/2),this.centerY=Math.floor(s/2),this.updateUVs()},setCropUVs:function(t,e,i,n,s,a,o){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=r(e,0,d)),v=l+(i=r(i,0,f)),g=n=r(n,0,d-e),m=s=r(s,0,f-i),M=this.data;if(M.trim){var x=M.spriteSourceSize,y=e+(n=r(n,0,u-e)),w=i+(s=r(s,0,c-i));if(!(x.ry||x.y>w)){var E=Math.max(x.x,e),b=Math.max(x.y,i),T=Math.min(x.r,y)-E,A=Math.min(x.b,w)-b;g=T,m=A,p=a?h+(u-(E-x.x)-T):h+(E-x.x),v=o?l+(c-(b-x.y)-A):l+(b-x.y),e=E,i=b,n=T,s=A}else p=0,v=0,g=0,m=0}else a&&(p=h+(u-e-n)),o&&(v=l+(c-i-s));var R=this.source.width,S=this.source.height;return t.u0=Math.max(0,p/R),t.v0=Math.max(0,v/S),t.u1=Math.min(1,(p+g)/R),t.v1=Math.min(1,(v+m)/S),t.x=e,t.y=i,t.cx=p,t.cy=v,t.cw=g,t.ch=m,t.width=n,t.height=s,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,n,r,s){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=n,this.u1=r,this.v1=s,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=n;var s=this.source.width,a=this.source.height;return this.u0=t/s,this.v0=e/a,this.u1=(t+i)/s,this.v1=(e+n)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=s(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},1864:t=>{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},3747:t=>{t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},7473:t=>{function e(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function n(t,n,r,a){for(var o in n)if(n.hasOwnProperty(o)){var h=e(n,o,r);if(!1!==h){if(i((a||t).prototype,o)){if(s.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=n[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},1792:t=>{t.exports=function(t,e,i,n,r){if(void 0===r&&(r=t),i>0){var s=i-t.length;if(s<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>s&&(e.splice(s),a=s);for(var o=0;o{t.exports=function(t,e,i,n,r,s){if(void 0===i&&(i=0),void 0===s&&(s=t),n>0){var a=n-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),r&&r.call(s,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;n>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),r&&r.call(s,l)}return e}},2513:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var n=i(2497);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var a=0;if(n(t,r,s))for(var o=r;o{t.exports=function(t,e,i){var n,r=[null];for(n=3;n{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s)){var a,o=[null];for(a=5;a{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var n,r,s=1;if(i){if(te.length&&(s=e.length),i?(n=e[s-1][i],(r=e[s][i])-t<=t-n?e[s]:e[s-1]):(n=e[s-1],(r=e[s])-t<=t-n?r:n)}},4493:t=>{var e=function(t,i){void 0===i&&(i=[]);for(var n=0;n{var n=i(2497);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var a=[];if(n(t,r,s))for(var o=r;o{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var a=r;a{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},8683:t=>{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n>r||(t.splice(n,1),r===t.length-1?t.push(e):t.splice(r,0,e)),t}},546:t=>{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var n=t[i-1],r=t.indexOf(n);t[i]=n,t[r]=e}return t}},1419:t=>{t.exports=function(t,e,i){var n=t.indexOf(e);if(-1===n||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},6512:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,n){var r,s=[],a=!1;if((i||n)&&(a=!0,i||(i=""),n||(n="")),e=e;r--)a?s.push(i+r.toString()+n):s.push(r);else for(r=t;r<=e;r++)a?s.push(i+r.toString()+n):s.push(r);return s}},1316:(t,e,i)=>{var n=i(4078);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var r=[],s=Math.max(n((e-t)/(i||1)),0),a=0;a{function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return te?1:0}var n=function(t,r,s,a,o){for(void 0===s&&(s=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>s;){if(a-s>600){var h=a-s+1,l=r-s+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(s,Math.floor(r-l*c/h+d)),p=Math.min(a,Math.floor(r+(h-l)*c/h+d));n(t,r,f,p,o)}var v=t[r],g=s,m=a;for(e(t,s,r),o(t[a],v)>0&&e(t,s,a);g0;)m--}0===o(t[s],v)?e(t,s,m):e(t,++m,a),m<=r&&(s=m+1),r<=m&&(a=m-1)}};t.exports=n},9703:(t,e,i)=>{var n=i(5851),r=i(4912),s=function(t,e,i){for(var n=[],r=0;r{var n=i(8935);t.exports=function(t,e,i,r){var s;if(void 0===r&&(r=t),!Array.isArray(e))return-1!==(s=t.indexOf(e))?(n(t,s),i&&i.call(r,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(s=t.indexOf(h))&&(n(t,s),o.push(h),i&&i.call(r,h)),a--}return o}},4725:(t,e,i)=>{var n=i(8935);t.exports=function(t,e,i,r){if(void 0===r&&(r=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var s=n(t,e);return i&&i.call(r,s),s}},8780:(t,e,i)=>{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===s&&(s=t),n(t,e,i)){var a=i-e,o=t.splice(e,a);if(r)for(var h=0;h{var n=i(8935);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*i);return n(t,r)}},6960:t=>{t.exports=function(t,e,i){var n=t.indexOf(e),r=t.indexOf(i);return-1!==n&&-1===r&&(t[n]=i,!0)}},1021:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n{t.exports=function(t,e,i,n){var r=t.length;if(e<0||e>r||e>=i||i>r){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},5361:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},3718:(t,e,i)=>{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var a=r;a{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},2071:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},8935:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],r=e;r{var n=i(9356);function r(t,e){return String(t).localeCompare(e)}function s(t,e,i,n){var r,s,a,o,h,l=t.length,u=0,c=2*i;for(r=0;rl&&(s=l),a>l&&(a=l),o=r,h=s;;)if(o{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return t[n]=i,t[r]=e,t}},1953:(t,e,i)=>{t.exports={Matrix:i(1237),Add:i(1792),AddAt:i(2280),BringToTop:i(2513),CountAllMatching:i(1771),Each:i(7883),EachInRange:i(5856),FindClosestInSorted:i(3957),Flatten:i(4493),GetAll:i(6245),GetFirst:i(1647),GetRandom:i(5301),MoveDown:i(1842),MoveTo:i(1419),MoveUp:i(6512),MoveAbove:i(8683),MoveBelow:i(546),NumberArray:i(4130),NumberArrayStep:i(1316),QuickSelect:i(9465),Range:i(9703),Remove:i(7161),RemoveAt:i(4725),RemoveBetween:i(8780),RemoveRandomElement:i(5744),Replace:i(6960),RotateLeft:i(1021),RotateRight:i(4027),SafeRange:i(2497),SendToBack:i(5361),SetAll:i(3718),Shuffle:i(4912),SortByDigits:i(2071),SpliceOne:i(8935),StableSort:i(9992),Swap:i(2372)}},1816:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var n=i(7222),r=i(1816);t.exports=function(t){var e="";if(!r(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},6063:t=>{t.exports=function(t){for(var e=0;e{var n=i(7116);t.exports=function(t){return n(t,180)}},2597:(t,e,i)=>{var n=i(7116);t.exports=function(t){return n(t,90)}},7116:(t,e,i)=>{var n=i(1816),r=i(4780);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=r(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=r(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var n=i(7116);t.exports=function(t){return n(t,-90)}},7711:(t,e,i)=>{var n=i(1021),r=i(4027);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?n(t,Math.abs(i)):r(t,i)),0!==e)for(var s=0;s{t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),r=0;r-1;s--)n[r][s]=t[s][r]}return n}},1237:(t,e,i)=>{t.exports={CheckMatrix:i(1816),MatrixToString:i(6655),ReverseColumns:i(582),ReverseRows:i(6063),Rotate180:i(8321),RotateLeft:i(2597),RotateMatrix:i(7116),RotateRight:i(6285),Translate:i(7711),TransposeMatrix:i(4780)}},3911:t=>{var e=function(t){var i,n,r;if("object"!=typeof t||null===t)return t;for(r in i=Array.isArray(t)?[]:{},t)n=t[r],i[r]=e(n);return i};t.exports=e},1030:(t,e,i)=>{var n=i(2482),r=function(){var t,e,i,s,a,o,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l{var n=i(4675),r=i(5851);t.exports=function(t,e,i){var s=r(t,e,null);if(null===s)return i;if(Array.isArray(s))return n.RND.pick(s);if("object"==typeof s){if(s.hasOwnProperty("randInt"))return n.RND.integerInRange(s.randInt[0],s.randInt[1]);if(s.hasOwnProperty("randFloat"))return n.RND.realInRange(s.randFloat[0],s.randFloat[1])}else if("function"==typeof s)return s(e);return s}},4597:t=>{t.exports=function(t,e,i){var n=typeof t;return t&&"number"!==n&&"string"!==n&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},5851:t=>{t.exports=function(t,e,i,n){if(!t&&!n||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(n&&n.hasOwnProperty(e))return n[e];if(-1!==e.indexOf(".")){for(var r=e.split("."),s=t,a=n,o=i,h=i,l=!0,u=!0,c=0;c{t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},7222:t=>{t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===n&&(n=3);var r=0;if(e+1>=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var s=Math.ceil((r=e-t.length)/2);t=new Array(r-s+1).join(i)+t+new Array(s+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}}},e={};var i=function i(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,i),s.exports}(4513);window.SpinePlugin=i})(); \ No newline at end of file diff --git a/plugins/spine/dist/SpineWebGLPlugin.js b/plugins/spine/dist/SpineWebGLPlugin.js index 8f0292a1a..65e942a31 100644 --- a/plugins/spine/dist/SpineWebGLPlugin.js +++ b/plugins/spine/dist/SpineWebGLPlugin.js @@ -14810,7 +14810,7 @@ var CONST = { * @type {string} * @since 3.0.0 */ - VERSION: '3.60.0-beta.20', + VERSION: '3.60.0', BlendModes: __webpack_require__(8351), @@ -16772,7 +16772,7 @@ module.exports = init(); /***/ }), /***/ 2131: -/***/ ((module) => { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -16780,9 +16780,13 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var GetFastValue = __webpack_require__(4597); + /** * Determines the video support of the browser running this Phaser Game instance. + * * These values are read-only and populated during the boot sequence of the game. + * * They are then referenced by internal game systems and are available for you to access * via `this.sys.game.device.video` from within any Scene. * @@ -16798,6 +16802,7 @@ module.exports = init(); * @property {boolean} ogg - Can this device play ogg video files? * @property {boolean} vp9 - Can this device play vp9 video files? * @property {boolean} webm - Can this device play webm video files? + * @property {function} getVideoURL - Returns the first video URL that can be played by this browser. */ var Video = { @@ -16807,7 +16812,8 @@ var Video = { m4v: false, ogg: false, vp9: false, - webm: false + webm: false, + hasRequestVideoFrame: false }; @@ -16864,6 +16870,55 @@ function init () // Nothing to do } + if (videoElement.parentNode) + { + videoElement.parentNode.removeChild(videoElement); + } + + Video.getVideoURL = function (urls) + { + if (!Array.isArray(urls)) + { + urls = [ urls ]; + } + + for (var i = 0; i < urls.length; i++) + { + var url = GetFastValue(urls[i], 'url', urls[i]); + + if (url.indexOf('blob:') === 0) + { + return { + url: url, + type: '' + }; + } + + var videoType; + + if (url.indexOf('data:') === 0) + { + videoType = url.split(',')[0].match(/\/(.*?);/); + } + else + { + videoType = url.match(/\.([a-zA-Z0-9]+)($|\?)/); + } + + videoType = GetFastValue(urls[i], 'type', (videoType) ? videoType[1] : '').toLowerCase(); + + if (Video[videoType]) + { + return { + url: url, + type: videoType + }; + } + } + + return null; + }; + return Video; } @@ -18032,8 +18087,8 @@ var GameObjectFactory = __webpack_require__(3649); * * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means - * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects - * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the + * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects. + * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the * corresponding pixel in the mask. * * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, @@ -18566,7 +18621,7 @@ module.exports = GeometryMask; /***/ }), -/***/ 8325: +/***/ 7340: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -18652,6 +18707,23 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Bloom FX Controller. + * + * This FX controller manages the bloom effect for a Game Object. + * + * Bloom is an effect used to reproduce an imaging artifact of real-world cameras. + * The effect produces fringes of light extending from the borders of bright areas in an image, + * contributing to the illusion of an extremely bright light overwhelming the + * camera or eye capturing the scene. + * + * A Bloom effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBloom(); + * sprite.postFX.addBloom(); + * ``` * * @class Bloom * @extends Phaser.FX.Controller @@ -18660,7 +18732,7 @@ var FX_CONST = __webpack_require__(1571); * @since 3.60.0 * * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. - * @param {number} [color] - The color of the Bloom, as a hex value. + * @param {number} [color=0xffffff] - The color of the Bloom, as a hex value. * @param {number} [offsetX=1] - The horizontal offset of the bloom effect. * @param {number} [offsetY=1] - The vertical offset of the bloom effect. * @param {number} [blurStrength=1] - The strength of the blur process of the bloom effect. @@ -18800,6 +18872,23 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Blur FX Controller. + * + * This FX controller manages the blur effect for a Game Object. + * + * A Gaussian blur is the result of blurring an image by a Gaussian function. It is a widely used effect, + * typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a + * smooth blur resembling that of viewing the image through a translucent screen, distinctly different + * from the bokeh effect produced by an out-of-focus lens or the shadow of an object under usual illumination. + * + * A Blur effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBlur(); + * sprite.postFX.addBlur(); + * ``` * * @class Blur * @extends Phaser.FX.Controller @@ -18962,6 +19051,27 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Bokeh FX Controller. + * + * This FX controller manages the bokeh effect for a Game Object. + * + * Bokeh refers to a visual effect that mimics the photographic technique of creating a shallow depth of field. + * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground + * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering + * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. + * + * This effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature + * effect by blurring everything except a small area of the image. This effect is achieved by blurring the + * top and bottom elements, while keeping the center area in focus. + * + * A Bokeh effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBokeh(); + * sprite.postFX.addBokeh(); + * ``` * * @class Bokeh * @extends Phaser.FX.Controller @@ -18996,13 +19106,77 @@ var Bokeh = new Class({ Controller.call(this, FX_CONST.BOKEH, gameObject); + /** + * The radius of the bokeh effect. + * + * This is a float value, where a radius of 0 will result in no effect being applied, + * and a radius of 1 will result in a strong bokeh. However, you can exceed this value + * for even stronger effects. + * + * @name Phaser.FX.Bokeh#radius + * @type {number} + * @since 3.60.0 + */ this.radius = radius; + + /** + * The amount, or strength, of the bokeh effect. Defaults to 1. + * + * @name Phaser.FX.Bokeh#amount + * @type {number} + * @since 3.60.0 + */ this.amount = amount; + + /** + * The color contrast, or brightness, of the bokeh effect. Defaults to 0.2. + * + * @name Phaser.FX.Bokeh#contrast + * @type {number} + * @since 3.60.0 + */ this.contrast = contrast; + /** + * Is this a Tilt Shift effect or a standard bokeh effect? + * + * @name Phaser.FX.Bokeh#isTiltShift + * @type {boolean} + * @since 3.60.0 + */ this.isTiltShift = isTiltShift; + + /** + * If a Tilt Shift effect this controls the strength of the blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#strength + * @type {number} + * @since 3.60.0 + */ this.strength = strength; + + /** + * If a Tilt Shift effect this controls the amount of horizontal blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#blurX + * @type {number} + * @since 3.60.0 + */ this.blurX = blurX; + + /** + * If a Tilt Shift effect this controls the amount of vertical blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#blurY + * @type {number} + * @since 3.60.0 + */ this.blurY = blurY; } @@ -19028,6 +19202,26 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Circle FX Controller. + * + * This FX controller manages the circle effect for a Game Object. + * + * This effect will draw a circle around the texture of the Game Object, effectively masking off + * any area outside of the circle without the need for an actual mask. You can control the thickness + * of the circle, the color of the circle and the color of the background, should the texture be + * transparent. You can also control the feathering applied to the circle, allowing for a harsh or soft edge. + * + * Please note that adding this effect to a Game Object will not change the input area or physics body of + * the Game Object, should it have one. + * + * A Circle effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addCircle(); + * sprite.postFX.addCircle(); + * ``` * * @class Circle * @extends Phaser.FX.Controller @@ -19037,7 +19231,7 @@ var FX_CONST = __webpack_require__(1571); * * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. * @param {number} [thickness=8] - The width of the circle around the texture, in pixels. - * @param {number} [color=16724914] - The color of the circular ring, given as a number value. + * @param {number} [color=0xfeedb6] - The color of the circular ring, given as a number value. * @param {number} [backgroundColor=0xff0000] - The color of the background, behind the texture, given as a number value. * @param {number} [scale=1] - The scale of the circle. The default scale is 1, which is a circle the full size of the underlying texture. * @param {number} [feather=0.005] - The amount of feathering to apply to the circle from the ring. @@ -19197,6 +19391,24 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The ColorMatrix FX Controller. + * + * This FX controller manages the color matrix effect for a Game Object. + * + * The color matrix effect is a visual technique that involves manipulating the colors of an image + * or scene using a mathematical matrix. This process can adjust hue, saturation, brightness, and contrast, + * allowing developers to create various stylistic appearances or mood settings within the game. + * Common applications include simulating different lighting conditions, applying color filters, + * or achieving a specific visual style. + * + * A ColorMatrix effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addColorMatrix(); + * sprite.postFX.addColorMatrix(); + * ``` * * @class ColorMatrix * @extends Phaser.Display.ColorMatrix @@ -19272,6 +19484,9 @@ var Class = __webpack_require__(7473); /** * @classdesc + * FX Controller is the base class that all built-in FX use. + * + * You should not normally create an instance of this class directly, but instead use one of the built-in FX that extend it. * * @class Controller * @memberof Phaser.FX @@ -19309,6 +19524,10 @@ var Controller = new Class({ * Toggle this boolean to enable or disable this effect, * without removing and adding it from the Game Object. * + * Only works for Pre FX. + * + * Post FX are always active. + * * @name Phaser.FX.Controller#active * @type {boolean} * @since 3.60.0 @@ -19316,6 +19535,25 @@ var Controller = new Class({ this.active = true; }, + /** + * Sets the active state of this FX Controller. + * + * A disabled FX Controller will not be updated. + * + * @method Phaser.FX.Controller#setActive + * @since 3.60.0 + * + * @param {boolean} value - `true` to enable this FX Controller, or `false` to disable it. + * + * @return {this} This FX Controller instance. + */ + setActive: function (value) + { + this.active = value; + + return this; + }, + /** * Destroys this FX Controller. * @@ -19350,6 +19588,24 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Displacement FX Controller. + * + * This FX controller manages the displacement effect for a Game Object. + * + * The displacement effect is a visual technique that alters the position of pixels in an image + * or texture based on the values of a displacement map. This effect is used to create the illusion + * of depth, surface irregularities, or distortion in otherwise flat elements. It can be applied to + * characters, objects, or backgrounds to enhance realism, convey movement, or achieve various + * stylistic appearances. + * + * A Displacement effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addDisplacement(); + * sprite.postFX.addDisplacement(); + * ``` * * @class Displacement * @extends Phaser.FX.Controller @@ -19358,9 +19614,9 @@ var FX_CONST = __webpack_require__(1571); * @since 3.60.0 * * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. - * @param {string} [key='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. - * @param {number} [x=0.005] - The amount of horizontal displacement to apply. - * @param {number} [y=0.005] - The amount of vertical displacement to apply. + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * @param {number} [x=0.005] - The amount of horizontal displacement to apply. A very small float number, such as 0.005. + * @param {number} [y=0.005] - The amount of vertical displacement to apply. A very small float number, such as 0.005. */ var Displacement = new Class({ @@ -19368,9 +19624,9 @@ var Displacement = new Class({ initialize: - function Displacement (gameObject, displacementTexture, x, y) + function Displacement (gameObject, texture, x, y) { - if (displacementTexture === undefined) { displacementTexture = '__WHITE'; } + if (texture === undefined) { texture = '__WHITE'; } if (x === undefined) { x = 0.005; } if (y === undefined) { y = 0.005; } @@ -19403,9 +19659,21 @@ var Displacement = new Class({ */ this.glTexture; - this.setTexture(displacementTexture); + this.setTexture(texture); }, + /** + * Sets the Texture to be used for the displacement effect. + * + * You can only use a whole texture, not a frame from a texture atlas or sprite sheet. + * + * @method Phaser.GameObjects.Components.FX#setTexture + * @since 3.60.0 + * + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * + * @return {this} This FX Controller. + */ setTexture: function (texture) { var phaserTexture = this.gameObject.scene.sys.textures.getFrame(texture); @@ -19414,6 +19682,8 @@ var Displacement = new Class({ { this.glTexture = phaserTexture.glTexture; } + + return this; } }); @@ -19442,10 +19712,10 @@ var FX_CONST = __webpack_require__(1571); * * This FX controller manages the glow effect for a Game Object. * - * A glow effect allows you to apply a soft, blurred 'glow' around either the outside, - * inside, or both of a Game Object. The color and strength of the glow can be modified. - * - * You can modify most of its properties in real-time to adjust the visual effect. + * The glow effect is a visual technique that creates a soft, luminous halo around game objects, + * characters, or UI elements. This effect is used to emphasize importance, enhance visual appeal, + * or convey a sense of energy, magic, or otherworldly presence. The effect can also be set on + * the inside of the Game Object. The color and strength of the glow can be modified. * * A Glow effect is added to a Game Object via the FX component: * @@ -19573,6 +19843,23 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Gradient FX Controller. + * + * This FX controller manages the gradient effect for a Game Object. + * + * The gradient overlay effect is a visual technique where a smooth color transition is applied over Game Objects, + * such as sprites or UI components. This effect is used to enhance visual appeal, emphasize depth, or create + * stylistic and atmospheric variations. It can also be utilized to convey information, such as representing + * progress or health status through color changes. + * + * A Gradient effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addGradient(); + * sprite.postFX.addGradient(); + * ``` * * @class Gradient * @extends Phaser.FX.Controller @@ -19769,6 +20056,23 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Pixelate FX Controller. + * + * This FX controller manages the pixelate effect for a Game Object. + * + * The pixelate effect is a visual technique that deliberately reduces the resolution or detail of an image, + * creating a blocky or mosaic appearance composed of large, visible pixels. This effect can be used for stylistic + * purposes, as a homage to retro gaming, or as a means to obscure certain elements within the game, such as + * during a transition or to censor specific content. + * + * A Pixelate effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addPixelate(); + * sprite.postFX.addPixelate(); + * ``` * * @class Pixelate * @extends Phaser.FX.Controller @@ -19823,6 +20127,22 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Shadow FX Controller. + * + * This FX controller manages the shadow effect for a Game Object. + * + * The shadow effect is a visual technique used to create the illusion of depth and realism by adding darker, + * offset silhouettes or shapes beneath game objects, characters, or environments. These simulated shadows + * help to enhance the visual appeal and immersion, making the 2D game world appear more dynamic and three-dimensional. + * + * A Shadow effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addShadow(); + * sprite.postFX.addShadow(); + * ``` * * @class Shadow * @extends Phaser.FX.Controller @@ -19976,6 +20296,23 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Shine FX Controller. + * + * This FX controller manages the shift effect for a Game Object. + * + * The shine effect is a visual technique that simulates the appearance of reflective + * or glossy surfaces by passing a light beam across a Game Object. This effect is used to + * enhance visual appeal, emphasize certain features, and create a sense of depth or + * material properties. + * + * A Shine effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addShine(); + * sprite.postFX.addShine(); + * ``` * * @class Shine * @extends Phaser.FX.Controller @@ -20063,6 +20400,22 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Vignette FX Controller. + * + * This FX controller manages the vignette effect for a Game Object. + * + * The vignette effect is a visual technique where the edges of the screen, or a Game Object, gradually darken or blur, + * creating a frame-like appearance. This effect is used to draw the player's focus towards the central action or subject, + * enhance immersion, and provide a cinematic or artistic quality to the game's visuals. + * + * A Vignette effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addVignette(); + * sprite.postFX.addVignette(); + * ``` * * @class Vignette * @extends Phaser.FX.Controller @@ -20150,6 +20503,34 @@ var FX_CONST = __webpack_require__(1571); /** * @classdesc + * The Wipe FX Controller. + * + * This FX controller manages the wipe effect for a Game Object. + * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * + * A Wipe effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addWipe(); + * sprite.postFX.addWipe(); + * sprite.preFX.addReveal(); + * sprite.postFX.addReveal(); + * ``` * * @class Wipe * @extends Phaser.FX.Controller @@ -20178,14 +20559,6 @@ var Wipe = new Class({ Controller.call(this, FX_CONST.WIPE, gameObject); - // left to right: direction 0, axis 0 - // right to left: direction 1, axis 0 - // top to bottom: direction 1, axis 1 - // bottom to top: direction 1, axis 0 - // wipe: reveal 0 - // reveal: reveal 1 - // progress: 0 - 1 - /** * The progress of the Wipe effect. This value is normalized to the range 0 to 1. * @@ -20417,7 +20790,7 @@ var FX_CONST = __webpack_require__(1571); var FX = { - Barrel: __webpack_require__(8325), + Barrel: __webpack_require__(7340), Controller: __webpack_require__(6128), Bloom: __webpack_require__(5170), Blur: __webpack_require__(4199), @@ -22720,6 +23093,57 @@ var SpliceOne = __webpack_require__(8935); /** * @classdesc + * The FX Component features a set of methods used for applying a range of special built-in effects to a Game Object. + * + * The effects include the following: + * + * * Barrel Distortion + * * Bloom + * * Blur + * * Bokeh / Tilt Shift + * * Circle Outline + * * Color Matrix + * * Glow + * * Displacement + * * Gradient + * * Pixelate + * * Shine + * * Shadow + * * Vignette + * * Wipe / Reveal + * + * All Game Objects support Post FX. These are effects applied after the Game Object has been rendered. + * + * Texture-based Game Objects also support Pre FX, including: + * + * * Image + * * Sprite + * * TileSprite + * * Text + * * RenderTexture + * * Video + * + * And any Game Object that extends the above. + * + * The difference between Pre FX and Post FX are that all Post FX take place in a canvas (renderer) sized frame buffer, + * after the Game Object has been rendered. Pre FX, however, take place in a texture sized frame buffer, which is sized + * based on the Game Object itself. The end result is then composited back to the main game canvas. For intensive effects, + * such as blur, bloom or glow, which can require many iterations, this is a much more efficient way to apply the effect, + * as only it only has to work on a Game Object sized texture and not all pixels in the canvas. + * + * In short, you should always try and use a Pre FX if you can. + * + * Due to the way that FX work they can be stacked-up. For example, you can apply a blur to a Game Object, then apply + * a bloom effect to the same Game Object. The bloom effect will be applied to the blurred texture, not the original. + * Keep the order in mind when stacking effects. + * + * All effects are WebGL only and do not have canvas counterparts. + * + * As you can appreciate, some effects are more expensive than others. For example, a bloom effect is going to be more + * expensive than a simple color matrix effect, so please consider using them wisely and performance test your target + * platforms early on in production. + * + * This component is created automatically by the `PostPipeline` class and does not need to be instantiated directly. * * @class FX * @memberof Phaser.GameObjects.Components @@ -22729,7 +23153,6 @@ var SpliceOne = __webpack_require__(8935); * * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that owns this FX Component. * @param {boolean} isPost - Is this a Pre or Post FX Component? -+- * */ var FX = new Class({ @@ -22742,6 +23165,7 @@ var FX = new Class({ * * @name Phaser.GameObjects.Components.FX#gameObject * @type {Phaser.GameObjects.GameObject} + * @readonly * @since 3.60.0 */ this.gameObject = gameObject; @@ -22751,6 +23175,7 @@ var FX = new Class({ * * @name Phaser.GameObjects.Components.FX#isPost * @type {boolean} + * @readonly * @since 3.60.0 */ this.isPost = isPost; @@ -22758,7 +23183,8 @@ var FX = new Class({ /** * Has this FX Component been enabled? * - * You should treat this property as read-only. + * You should treat this property as read-only, although it is toggled + * automaticaly during internal use. * * @name Phaser.GameObjects.Components.FX#enabled * @type {boolean} @@ -22767,8 +23193,11 @@ var FX = new Class({ this.enabled = false; /** - * An array containing all of the FX Controllers that - * have been added to this FX Component. + * An array containing all of the Pre FX Controllers that + * have been added to this FX Component. They are processed in + * the order they are added. + * + * This array is empty if this is a Post FX Component. * * @name Phaser.GameObjects.Components.FX#list * @type {Phaser.FX.Controller[]} @@ -22778,13 +23207,15 @@ var FX = new Class({ /** * The amount of extra padding to be applied to this Game Object - * when it is being rendered by a PreFX or SpriteFX Pipeline. + * when it is being rendered by a PreFX Pipeline. * * Lots of FX require additional spacing added to the texture the * Game Object uses, for example a glow or shadow effect, and this * method allows you to control how much extra padding is included * in addition to the texture size. * + * You do not need to set this if you're only using Post FX. + * * @name Phaser.GameObjects.Components.FX#padding * @type {number} * @default 0 @@ -22802,6 +23233,8 @@ var FX = new Class({ * method allows you to control how much extra padding is included * in addition to the texture size. * + * You do not need to set this if you're only using Post FX. + * * @method Phaser.GameObjects.Components.FX#setPadding * @webglOnly * @since 3.60.0 @@ -22858,6 +23291,8 @@ var FX = new Class({ * * You can check the `enabled` property to see if the Game Object is already enabled, or not. * + * This only applies to Pre FX. Post FX are always enabled. + * * @method Phaser.GameObjects.Components.FX#enable * @since 3.60.0 * @@ -22865,6 +23300,11 @@ var FX = new Class({ */ enable: function (padding) { + if (this.isPost) + { + return; + } + var renderer = this.gameObject.scene.sys.renderer; if (renderer && renderer.pipelines) @@ -22888,46 +23328,97 @@ var FX = new Class({ * Destroys and removes all FX Controllers that are part of this FX Component, * then disables it. * + * If this is a Pre FX Component it will only remove Pre FX. + * If this is a Post FX Component it will only remove Post FX. + * + * To remove both at once use the `GameObject.clearFX` method instead. + * * @method Phaser.GameObjects.Components.FX#clear * @since 3.60.0 + * + * @return {this} This Game Object instance. */ clear: function () { - var list = this.list; - - for (var i = 0; i < list.length; i++) + if (this.isPost) { - list[i].destroy(); + this.gameObject.resetPostPipeline(true); + } + else + { + var list = this.list; + + for (var i = 0; i < list.length; i++) + { + list[i].destroy(); + } + + this.list = []; } - this.list = []; - this.enabled = false; + + return this.gameObject; }, /** - * Searches for the given FX Controler within this FX Component. + * Searches for the given FX Controller within this FX Component. * - * If found, the controller is removed from this compoent and then destroyed. + * If found, the controller is removed from this component and then destroyed. * * @method Phaser.GameObjects.Components.FX#remove * @since 3.60.0 * + * @generic {Phaser.FX.Controller} T + * @genericUse {T} - [fx] + * * @param {Phaser.FX.Controller} fx - The FX Controller to remove from this FX Component. + * + * @return {this} This Game Object instance. */ remove: function (fx) { - var list = this.list; + var i; - for (var i = 0; i < list.length; i++) + if (this.isPost) { - if (list[i] === fx) - { - SpliceOne(list, i); + var pipelines = this.gameObject.getPostPipeline(String(fx.type)); - fx.destroy(); + if (!Array.isArray(pipelines)) + { + pipelines = [ pipelines ]; + } + + for (i = 0; i < pipelines.length; i++) + { + var pipeline = pipelines[i]; + + if (pipeline.controller === fx) + { + this.gameObject.removePostPipeline(pipeline); + + fx.destroy(); + + break; + } } } + else + { + var list = this.list; + + for (i = 0; i < list.length; i++) + { + if (list[i] === fx) + { + SpliceOne(list, i); + + fx.destroy(); + } + } + } + + return this.gameObject; }, /** @@ -22936,20 +23427,25 @@ var FX = new Class({ * This will reset the pipeline on the Game Object that owns this component back to its * default and flag this component as disabled. * - * You can re-enable it again by calling `enable`. + * You can re-enable it again by calling `enable` for Pre FX or by adding an FX for Post FX. * * Optionally, set `clear` to destroy all current FX Controllers. * * @method Phaser.GameObjects.Components.FX#disable * @since 3.60.0 * - * @param {boolean} [clear=false] - Destroy and remove all FX Controllers that are part of this FX Component. + * @param {boolean} [clear=false] - Destroy and remove all FX Controllers that are part of this component. + * + * @return {this} This Game Object instance. */ disable: function (clear) { if (clear === undefined) { clear = false; } - this.gameObject.resetPipeline(); + if (!this.isPost) + { + this.gameObject.resetPipeline(); + } this.enabled = false; @@ -22957,6 +23453,8 @@ var FX = new Class({ { this.clear(); } + + return this.gameObject; }, /** @@ -22969,6 +23467,9 @@ var FX = new Class({ * @method Phaser.GameObjects.Components.FX#add * @since 3.60.0 * + * @generic {Phaser.FX.Controller} T + * @genericUse {T} - [fx] + * * @param {Phaser.FX.Controller} fx - The FX Controller to add to this FX Component. * @param {object} [config] - Optional configuration object that is passed to the pipeline during instantiation. * @@ -23012,6 +23513,11 @@ var FX = new Class({ /** * Adds a Glow effect. * + * The glow effect is a visual technique that creates a soft, luminous halo around game objects, + * characters, or UI elements. This effect is used to emphasize importance, enhance visual appeal, + * or convey a sense of energy, magic, or otherworldly presence. The effect can also be set on + * the inside of the Game Object. The color and strength of the glow can be modified. + * * @method Phaser.GameObjects.Components.FX#addGlow * @since 3.60.0 * @@ -23032,6 +23538,10 @@ var FX = new Class({ /** * Adds a Shadow effect. * + * The shadow effect is a visual technique used to create the illusion of depth and realism by adding darker, + * offset silhouettes or shapes beneath game objects, characters, or environments. These simulated shadows + * help to enhance the visual appeal and immersion, making the 2D game world appear more dynamic and three-dimensional. + * * @method Phaser.GameObjects.Components.FX#addShadow * @since 3.60.0 * @@ -23053,6 +23563,11 @@ var FX = new Class({ /** * Adds a Pixelate effect. * + * The pixelate effect is a visual technique that deliberately reduces the resolution or detail of an image, + * creating a blocky or mosaic appearance composed of large, visible pixels. This effect can be used for stylistic + * purposes, as a homage to retro gaming, or as a means to obscure certain elements within the game, such as + * during a transition or to censor specific content. + * * @method Phaser.GameObjects.Components.FX#addPixelate * @since 3.60.0 * @@ -23068,6 +23583,10 @@ var FX = new Class({ /** * Adds a Vignette effect. * + * The vignette effect is a visual technique where the edges of the screen, or a Game Object, gradually darken or blur, + * creating a frame-like appearance. This effect is used to draw the player's focus towards the central action or subject, + * enhance immersion, and provide a cinematic or artistic quality to the game's visuals. + * * @method Phaser.GameObjects.Components.FX#addVignette * @since 3.60.0 * @@ -23086,6 +23605,11 @@ var FX = new Class({ /** * Adds a Shine effect. * + * The shine effect is a visual technique that simulates the appearance of reflective + * or glossy surfaces by passing a light beam across a Game Object. This effect is used to + * enhance visual appeal, emphasize certain features, and create a sense of depth or + * material properties. + * * @method Phaser.GameObjects.Components.FX#addShine * @since 3.60.0 * @@ -23104,6 +23628,11 @@ var FX = new Class({ /** * Adds a Blur effect. * + * A Gaussian blur is the result of blurring an image by a Gaussian function. It is a widely used effect, + * typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a + * smooth blur resembling that of viewing the image through a translucent screen, distinctly different + * from the bokeh effect produced by an out-of-focus lens or the shadow of an object under usual illumination. + * * @method Phaser.GameObjects.Components.FX#addBlur * @since 3.60.0 * @@ -23124,6 +23653,11 @@ var FX = new Class({ /** * Adds a Gradient effect. * + * The gradient overlay effect is a visual technique where a smooth color transition is applied over Game Objects, + * such as sprites or UI components. This effect is used to enhance visual appeal, emphasize depth, or create + * stylistic and atmospheric variations. It can also be utilized to convey information, such as representing + * progress or health status through color changes. + * * @method Phaser.GameObjects.Components.FX#addGradient * @since 3.60.0 * @@ -23146,6 +23680,11 @@ var FX = new Class({ /** * Adds a Bloom effect. * + * Bloom is an effect used to reproduce an imaging artifact of real-world cameras. + * The effect produces fringes of light extending from the borders of bright areas in an image, + * contributing to the illusion of an extremely bright light overwhelming the + * camera or eye capturing the scene. + * * @method Phaser.GameObjects.Components.FX#addBloom * @since 3.60.0 * @@ -23166,6 +23705,12 @@ var FX = new Class({ /** * Adds a ColorMatrix effect. * + * The color matrix effect is a visual technique that involves manipulating the colors of an image + * or scene using a mathematical matrix. This process can adjust hue, saturation, brightness, and contrast, + * allowing developers to create various stylistic appearances or mood settings within the game. + * Common applications include simulating different lighting conditions, applying color filters, + * or achieving a specific visual style. + * * @method Phaser.GameObjects.Components.FX#addColorMatrix * @since 3.60.0 * @@ -23179,11 +23724,19 @@ var FX = new Class({ /** * Adds a Circle effect. * + * This effect will draw a circle around the texture of the Game Object, effectively masking off + * any area outside of the circle without the need for an actual mask. You can control the thickness + * of the circle, the color of the circle and the color of the background, should the texture be + * transparent. You can also control the feathering applied to the circle, allowing for a harsh or soft edge. + * + * Please note that adding this effect to a Game Object will not change the input area or physics body of + * the Game Object, should it have one. + * * @method Phaser.GameObjects.Components.FX#addCircle * @since 3.60.0 * * @param {number} [thickness=8] - The width of the circle around the texture, in pixels. - * @param {number} [color=16724914] - The color of the circular ring, given as a number value. + * @param {number} [color=0xfeedb6] - The color of the circular ring, given as a number value. * @param {number} [backgroundColor=0xff0000] - The color of the background, behind the texture, given as a number value. * @param {number} [scale=1] - The scale of the circle. The default scale is 1, which is a circle the full size of the underlying texture. * @param {number} [feather=0.005] - The amount of feathering to apply to the circle from the ring. @@ -23198,6 +23751,9 @@ var FX = new Class({ /** * Adds a Barrel effect. * + * A barrel effect allows you to apply either a 'pinch' or 'expand' distortion to + * a Game Object. The amount of the effect can be modified in real-time. + * * @method Phaser.GameObjects.Components.FX#addBarrel * @since 3.60.0 * @@ -23213,23 +23769,43 @@ var FX = new Class({ /** * Adds a Displacement effect. * + * The displacement effect is a visual technique that alters the position of pixels in an image + * or texture based on the values of a displacement map. This effect is used to create the illusion + * of depth, surface irregularities, or distortion in otherwise flat elements. It can be applied to + * characters, objects, or backgrounds to enhance realism, convey movement, or achieve various + * stylistic appearances. + * * @method Phaser.GameObjects.Components.FX#addDisplacement * @since 3.60.0 * - * @param {string} [key='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. - * @param {number} [x=0.005] - The amount of horizontal displacement to apply. - * @param {number} [y=0.005] - The amount of vertical displacement to apply. + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * @param {number} [x=0.005] - The amount of horizontal displacement to apply. A very small float number, such as 0.005. + * @param {number} [y=0.005] - The amount of vertical displacement to apply. A very small float number, such as 0.005. * * @return {Phaser.FX.Displacement} The Displacement FX Controller. */ - addDisplacement: function (displacementTexture, x, y) + addDisplacement: function (texture, x, y) { - return this.add(new Effects.Displacement(this.gameObject, displacementTexture, x, y)); + return this.add(new Effects.Displacement(this.gameObject, texture, x, y)); }, /** * Adds a Wipe effect. * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * * @method Phaser.GameObjects.Components.FX#addWipe * @since 3.60.0 * @@ -23247,6 +23823,20 @@ var FX = new Class({ /** * Adds a Reveal Wipe effect. * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * * @method Phaser.GameObjects.Components.FX#addReveal * @since 3.60.0 * @@ -23264,6 +23854,13 @@ var FX = new Class({ /** * Adds a Bokeh effect. * + * Bokeh refers to a visual effect that mimics the photographic technique of creating a shallow depth of field. + * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground + * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering + * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. + * + * See also Tilt Shift. + * * @method Phaser.GameObjects.Components.FX#addBokeh * @since 3.60.0 * @@ -23279,7 +23876,13 @@ var FX = new Class({ }, /** - * Adds a TiltShift effect. + * Adds a Tilt Shift effect. + * + * This Bokeh effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature + * effect by blurring everything except a small area of the image. This effect is achieved by blurring the + * top and bottom elements, while keeping the center area in focus. + * + * See also Bokeh. * * @method Phaser.GameObjects.Components.FX#addTiltShift * @since 3.60.0 @@ -23287,9 +23890,9 @@ var FX = new Class({ * @param {number} [radius=0.5] - The radius of the bokeh effect. * @param {number} [amount=1] - The amount of the bokeh effect. * @param {number} [contrast=0.2] - The color contrast of the bokeh effect. - * @param {number} [blurX=1] - If Tilt Shift, the amount of horizontal blur. - * @param {number} [blurY=1] - If Tilt Shift, the amount of vertical blur. - * @param {number} [strength=1] - If Tilt Shift, the strength of the blur. + * @param {number} [blurX=1] - The amount of horizontal blur. + * @param {number} [blurY=1] - The amount of vertical blur. + * @param {number} [strength=1] - The strength of the blur. * * @return {Phaser.FX.Bokeh} The Bokeh TiltShift FX Controller. */ @@ -23515,12 +24118,12 @@ var GetBounds = { * @private * @since 3.18.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} output - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} output - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ prepareBoundsOutput: function (output, includeParent) { @@ -23543,40 +24146,45 @@ var GetBounds = { /** * Gets the center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getCenter * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ - getCenter: function (output) + getCenter: function (output, includeParent) { if (output === undefined) { output = new Vector2(); } output.x = this.x - (this.displayWidth * this.originX) + (this.displayWidth / 2); output.y = this.y - (this.displayHeight * this.originY) + (this.displayHeight / 2); - return output; + return this.prepareBoundsOutput(output, includeParent); }, /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getTopLeft * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getTopLeft: function (output, includeParent) { @@ -23590,17 +24198,19 @@ var GetBounds = { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getTopCenter * @since 3.18.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getTopCenter: function (output, includeParent) { @@ -23614,17 +24224,19 @@ var GetBounds = { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getTopRight * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getTopRight: function (output, includeParent) { @@ -23638,17 +24250,19 @@ var GetBounds = { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getLeftCenter * @since 3.18.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getLeftCenter: function (output, includeParent) { @@ -23662,17 +24276,19 @@ var GetBounds = { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getRightCenter * @since 3.18.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getRightCenter: function (output, includeParent) { @@ -23686,17 +24302,19 @@ var GetBounds = { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getBottomLeft * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getBottomLeft: function (output, includeParent) { @@ -23710,17 +24328,19 @@ var GetBounds = { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getBottomCenter * @since 3.18.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getBottomCenter: function (output, includeParent) { @@ -23734,17 +24354,19 @@ var GetBounds = { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. * * @method Phaser.GameObjects.Components.GetBounds#getBottomRight * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. */ getBottomRight: function (output, includeParent) { @@ -23758,6 +24380,7 @@ var GetBounds = { /** * Gets the bounds of this Game Object, regardless of origin. + * * The values are stored and returned in a Rectangle, or Rectangle-like, object. * * @method Phaser.GameObjects.Components.GetBounds#getBounds @@ -24953,7 +25576,7 @@ var PostPipeline = { * Please see the FX Class for more details and available methods. * * @name Phaser.GameObjects.Components.PostPipeline#preFX - * @type {Phaser.GameObjects.Components.FX} + * @type {?Phaser.GameObjects.Components.FX} * @webglOnly * @since 3.60.0 */ @@ -24975,6 +25598,8 @@ var PostPipeline = { * * Please see the FX Class for more details and available methods. * + * This property is always `null` until the `initPostPipeline` method is called. + * * @name Phaser.GameObjects.Components.PostPipeline#postFX * @type {Phaser.GameObjects.Components.FX} * @webglOnly @@ -25183,6 +25808,8 @@ var PostPipeline = { */ removePostPipeline: function (pipeline) { + var isString = (typeof pipeline === 'string'); + var pipelines = this.postPipelines; for (var i = pipelines.length - 1; i >= 0; i--) @@ -25190,8 +25817,8 @@ var PostPipeline = { var instance = pipelines[i]; if ( - (typeof pipeline === 'string' && instance.name === pipeline) || - (typeof pipeline !== 'string' && instance instanceof pipeline)) + (isString && instance.name === pipeline) || + (!isString && instance === pipeline)) { instance.destroy(); @@ -25201,6 +25828,34 @@ var PostPipeline = { this.hasPostPipeline = (this.postPipelines.length > 0); + return this; + }, + + /** + * Removes all Pre and Post FX Controllers from this Game Object. + * + * If you wish to remove a single controller, use the `preFX.remove(fx)` or `postFX.remove(fx)` methods instead. + * + * If you wish to clear a single controller, use the `preFX.clear()` or `postFX.clear()` methods instead. + * + * @method Phaser.GameObjects.Components.PostPipeline#clearFX + * @webglOnly + * @since 3.60.0 + * + * @return {this} This Game Object. + */ + clearFX: function () + { + if (this.preFX) + { + this.preFX.clear(); + } + + if (this.postFX) + { + this.postFX.clear(); + } + return this; } @@ -28440,28 +29095,19 @@ var Container = new Class({ { var entry = children[i]; - if (entry.getTextBounds) - { - var textBounds = entry.getTextBounds().global; - tempRect.setTo(textBounds.x, textBounds.y, textBounds.width, textBounds.height); - } - else if (entry.getBounds) + if (entry.getBounds) { entry.getBounds(tempRect); - } - else - { - continue; - } - if (!hasSetFirst) - { - output.setTo(tempRect.x, tempRect.y, tempRect.width, tempRect.height); - hasSetFirst = true; - } - else - { - Union(tempRect, output, output); + if (!hasSetFirst) + { + output.setTo(tempRect.x, tempRect.y, tempRect.width, tempRect.height); + hasSetFirst = true; + } + else + { + Union(tempRect, output, output); + } } } } @@ -29858,11 +30504,43 @@ module.exports = 'created'; * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. - * @param {Event} event - The native DOM event the browser raised during playback. + * @param {DOMException|string} event - The native DOM event the browser raised during playback. */ module.exports = 'error'; +/***/ }), + +/***/ 6231: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Locked Event. + * + * This event is dispatched when a Video was attempted to be played, but the browser prevented it + * from doing so due to the Media Engagement Interaction policy. + * + * If you get this event you will need to wait for the user to interact with the browser before + * the video will play. This is a browser security measure to prevent autoplaying videos with + * audio. An interaction includes a mouse click, a touch, or a key press. + * + * Listen for it from a Video Game Object instance using `Video.on('locked', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_LOCKED + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. + */ +module.exports = 'locked'; + + /***/ }), /***/ 5241: @@ -29897,6 +30575,35 @@ module.exports = 'error'; module.exports = 'loop'; +/***/ }), + +/***/ 8325: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Playing Event. + * + * The playing event is fired after playback is first started, + * and whenever it is restarted. For example it is fired when playback + * resumes after having been paused or delayed due to lack of data. + * + * Listen for it from a Video Game Object instance using `Video.on('playing', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_PLAYING + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. + */ +module.exports = 'playing'; + + /***/ }), /***/ 3356: @@ -29982,6 +30689,46 @@ module.exports = 'seeked'; module.exports = 'seeking'; +/***/ }), + +/***/ 7111: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Stalled Event. + * + * This event is dispatched by a Video Game Object when the video playback stalls. + * + * This can happen if the video is buffering. + * + * If will fire for any of the following native DOM events: + * + * `stalled` + * `suspend` + * `waiting` + * + * Listen for it from a Video Game Object instance using `Video.on('stalled', listener)`. + * + * Note that being stalled isn't always a negative thing. A video can be stalled if it + * has downloaded enough data in to its buffer to not need to download any more until + * the current batch of frames have rendered. + * + * @event Phaser.GameObjects.Events#VIDEO_STALLED + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. + * @param {Event} event - The native DOM event the browser raised during playback. + */ +module.exports = 'stalled'; + + /***/ }), /***/ 8118: @@ -30012,7 +30759,7 @@ module.exports = 'stop'; /***/ }), -/***/ 5529: +/***/ 9184: /***/ ((module) => { /** @@ -30022,20 +30769,25 @@ module.exports = 'stop'; */ /** - * The Video Game Object Timeout Event. + * The Video Game Object Texture Ready Event. * - * This event is dispatched when a Video has exhausted its allocated time while trying to connect to a video - * source to start playback. + * This event is dispatched by a Video Game Object when it has finished creating its texture. * - * Listen for it from a Video Game Object instance using `Video.on('timeout', listener)`. + * This happens when the video has finished loading enough data for its first frame. * - * @event Phaser.GameObjects.Events#VIDEO_TIMEOUT + * If you wish to use the Video texture elsewhere in your game, such as as a Sprite texture, + * then you should listen for this event first, before creating the Sprites that use it. + * + * Listen for it from a Video Game Object instance using `Video.on('textureready', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_TEXTURE * @type {string} - * @since 3.20.0 + * @since 3.60.0 * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which timed out. + * @param {Phaser.GameObjects.Video} video - The Video Game Object that emitted the event. + * @param {Phaser.Textures.Texture} texture - The Texture that was created. */ -module.exports = 'timeout'; +module.exports = 'textureready'; /***/ }), @@ -30066,6 +30818,36 @@ module.exports = 'timeout'; module.exports = 'unlocked'; +/***/ }), + +/***/ 857: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Unsupported Event. + * + * This event is dispatched by a Video Game Object if the media source + * (which may be specified as a MediaStream, MediaSource, Blob, or File, + * for example) doesn't represent a supported media format. + * + * Listen for it from a Video Game Object instance using `Video.on('unsupported', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_UNSUPPORTED + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. + * @param {DOMException|string} event - The native DOM event the browser raised during playback. + */ +module.exports = 'unsupported'; + + /***/ }), /***/ 3389: @@ -30089,13 +30871,17 @@ module.exports = { VIDEO_COMPLETE: __webpack_require__(3420), VIDEO_CREATED: __webpack_require__(601), VIDEO_ERROR: __webpack_require__(7919), + VIDEO_LOCKED: __webpack_require__(6231), VIDEO_LOOP: __webpack_require__(5241), VIDEO_PLAY: __webpack_require__(3356), + VIDEO_PLAYING: __webpack_require__(8325), VIDEO_SEEKED: __webpack_require__(7513), VIDEO_SEEKING: __webpack_require__(5788), + VIDEO_STALLED: __webpack_require__(7111), VIDEO_STOP: __webpack_require__(8118), - VIDEO_TIMEOUT: __webpack_require__(5529), - VIDEO_UNLOCKED: __webpack_require__(4287) + VIDEO_TEXTURE: __webpack_require__(9184), + VIDEO_UNLOCKED: __webpack_require__(4287), + VIDEO_UNSUPPORTED: __webpack_require__(857) }; @@ -42223,7 +43009,7 @@ var MATH_CONST = { /** * The value of PI * 0.5. * - * Yes, we undertstand that this should actually be PI * 2, but + * Yes, we understand that this should actually be PI * 2, but * it has been like this for so long we can't change it now. * If you need PI * 2, use the PI2 constant instead. * diff --git a/plugins/spine/dist/SpineWebGLPlugin.min.js b/plugins/spine/dist/SpineWebGLPlugin.min.js index 1212f405e..6d0f7951f 100644 --- a/plugins/spine/dist/SpineWebGLPlugin.min.js +++ b/plugins/spine/dist/SpineWebGLPlugin.min.js @@ -1 +1 @@ -(()=>{var t={4399:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,s||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,a=new Array(s);r{(function(){var e,i,n,r=this&&this.__extends||(e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},e(t,i)},function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)});!function(t){var e,i,n,s=function(){function t(t,e,i){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var n=0;n0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l>>1;;){if(t[(s+1)*i]<=e?n=s+1:r=s,n==r)return(n+1)*i;s=n+r>>>1}},t.linearSearch=function(t,e,i){for(var n=0,r=t.length-i;n<=r;n+=i)if(t[n]>e)return n;return-1},t}();t.Animation=s,function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(e=t.MixBlend||(t.MixBlend={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(i=t.MixDirection||(t.MixDirection={})),function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"}(n=t.TimelineType||(t.TimelineType={}));var a=function(){function e(i){if(i<=0)throw new Error("frameCount must be > 0: "+i);this.curves=t.Utils.newFloatArray((i-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var i=t*e.BEZIER_SIZE;if(i==this.curves.length)return e.LINEAR;var n=this.curves[i];return n==e.LINEAR?e.LINEAR:n==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,i,n,r,s){var a=.03*(2*-i+r),o=.03*(2*-n+s),h=.006*(3*(i-r)+1),l=.006*(3*(n-s)+1),u=2*a+h,c=2*o+l,d=.3*i+a+.16666667*h,f=.3*n+o+.16666667*l,p=t*e.BEZIER_SIZE,v=this.curves;v[p++]=e.BEZIER;for(var g=d,m=f,M=p+e.BEZIER_SIZE-1;p=n){var u=void 0,c=void 0;return s==h?(u=0,c=0):(u=r[s-2],c=r[s-1]),c+(r[s+1]-c)*(n-u)/(o-u)}var d=r[s-1];return d+(1-d)*(n-o)/(1-o)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=a;var o=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e<<1),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.rotate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+a.ROTATION]=i},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(n=u[u.length-a.ENTRIES]){var f=u[u.length+a.PREV_ROTATION];switch(h){case e.setup:c.rotation=c.data.rotation+f*o;break;case e.first:case e.replace:f+=c.data.rotation-c.rotation,f-=360*(16384-(16384.499999999996-f/360|0));case e.add:c.rotation+=f*o}}else{var p=s.binarySearch(u,n,a.ENTRIES),v=u[p+a.PREV_ROTATION],g=u[p],m=this.getCurvePercent((p>>1)-1,1-(n-g)/(u[p+a.PREV_TIME]-g)),M=u[p+a.ROTATION]-v;switch(M=v+(M-360*(16384-(16384.499999999996-M/360|0)))*m,h){case e.setup:c.rotation=c.data.rotation+(M-360*(16384-(16384.499999999996-M/360|0)))*o;break;case e.first:case e.replace:M+=c.data.rotation-c.rotation;case e.add:c.rotation+=(M-360*(16384-(16384.499999999996-M/360|0)))*o}}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_ROTATION=-1,a.ROTATION=1,a}(a);t.RotateTimeline=o;var h=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.translate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,i,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.X]=i,this.frames[t+a.Y]=n},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_X],f=u[u.length+a.PREV_Y];else{var p=s.binarySearch(u,n,a.ENTRIES);d=u[p+a.PREV_X],f=u[p+a.PREV_Y];var v=u[p],g=this.getCurvePercent(p/a.ENTRIES-1,1-(n-v)/(u[p+a.PREV_TIME]-v));d+=(u[p+a.X]-d)*g,f+=(u[p+a.Y]-f)*g}switch(h){case e.setup:c.x=c.data.x+d*o,c.y=c.data.y+f*o;break;case e.first:case e.replace:c.x+=(c.data.x+d-c.x)*o,c.y+=(c.data.y+f-c.y)*o;break;case e.add:c.x+=d*o,c.y+=f*o}}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_X=-2,a.PREV_Y=-1,a.X=1,a.Y=2,a}(a);t.TranslateTimeline=h;var l=function(a){function o(t){return a.call(this,t)||this}return r(o,a),o.prototype.getPropertyId=function(){return(n.scale<<24)+this.boneIndex},o.prototype.apply=function(n,r,a,h,l,u,c){var d=this.frames,f=n.bones[this.boneIndex];if(f.active)if(a=d[d.length-o.ENTRIES])p=d[d.length+o.PREV_X]*f.data.scaleX,v=d[d.length+o.PREV_Y]*f.data.scaleY;else{var g=s.binarySearch(d,a,o.ENTRIES);p=d[g+o.PREV_X],v=d[g+o.PREV_Y];var m=d[g],M=this.getCurvePercent(g/o.ENTRIES-1,1-(a-m)/(d[g+o.PREV_TIME]-m));p=(p+(d[g+o.X]-p)*M)*f.data.scaleX,v=(v+(d[g+o.Y]-v)*M)*f.data.scaleY}if(1==l)u==e.add?(f.scaleX+=p-f.data.scaleX,f.scaleY+=v-f.data.scaleY):(f.scaleX=p,f.scaleY=v);else{var x=0,y=0;if(c==i.mixOut)switch(u){case e.setup:x=f.data.scaleX,y=f.data.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,f.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-y)*l;break;case e.first:case e.replace:x=f.scaleX,y=f.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,f.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-y)*l;break;case e.add:x=f.scaleX,y=f.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-f.data.scaleX)*l,f.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-f.data.scaleY)*l}else switch(u){case e.setup:x=Math.abs(f.data.scaleX)*t.MathUtils.signum(p),y=Math.abs(f.data.scaleY)*t.MathUtils.signum(v),f.scaleX=x+(p-x)*l,f.scaleY=y+(v-y)*l;break;case e.first:case e.replace:x=Math.abs(f.scaleX)*t.MathUtils.signum(p),y=Math.abs(f.scaleY)*t.MathUtils.signum(v),f.scaleX=x+(p-x)*l,f.scaleY=y+(v-y)*l;break;case e.add:x=t.MathUtils.signum(p),y=t.MathUtils.signum(v),f.scaleX=Math.abs(f.scaleX)*x+(p-Math.abs(f.data.scaleX)*x)*l,f.scaleY=Math.abs(f.scaleY)*y+(v-Math.abs(f.data.scaleY)*y)*l}}}},o}(h);t.ScaleTimeline=l;var u=function(t){function i(e){return t.call(this,e)||this}return r(i,t),i.prototype.getPropertyId=function(){return(n.shear<<24)+this.boneIndex},i.prototype.apply=function(t,n,r,a,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(r=u[u.length-i.ENTRIES])d=u[u.length+i.PREV_X],f=u[u.length+i.PREV_Y];else{var p=s.binarySearch(u,r,i.ENTRIES);d=u[p+i.PREV_X],f=u[p+i.PREV_Y];var v=u[p],g=this.getCurvePercent(p/i.ENTRIES-1,1-(r-v)/(u[p+i.PREV_TIME]-v));d+=(u[p+i.X]-d)*g,f+=(u[p+i.Y]-f)*g}switch(h){case e.setup:c.shearX=c.data.shearX+d*o,c.shearY=c.data.shearY+f*o;break;case e.first:case e.replace:c.shearX+=(c.data.shearX+d-c.shearX)*o,c.shearY+=(c.data.shearY+f-c.shearY)*o;break;case e.add:c.shearX+=d*o,c.shearY+=f*o}}},i}(h);t.ShearTimeline=u;var c=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.color<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,i,n,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=i,this.frames[t+a.G]=n,this.frames[t+a.B]=r,this.frames[t+a.A]=s},a.prototype.apply=function(t,i,n,r,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(n=c[c.length-a.ENTRIES]){var M=c.length;p=c[M+a.PREV_R],v=c[M+a.PREV_G],g=c[M+a.PREV_B],m=c[M+a.PREV_A]}else{var x=s.binarySearch(c,n,a.ENTRIES);p=c[x+a.PREV_R],v=c[x+a.PREV_G],g=c[x+a.PREV_B],m=c[x+a.PREV_A];var y=c[x],w=this.getCurvePercent(x/a.ENTRIES-1,1-(n-y)/(c[x+a.PREV_TIME]-y));p+=(c[x+a.R]-p)*w,v+=(c[x+a.G]-v)*w,g+=(c[x+a.B]-g)*w,m+=(c[x+a.A]-m)*w}if(1==o)u.color.set(p,v,g,m);else{d=u.color;h==e.setup&&d.setFromColor(u.data.color),d.add((p-d.r)*o,(v-d.g)*o,(g-d.b)*o,(m-d.a)*o)}}}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_R=-4,a.PREV_G=-3,a.PREV_B=-2,a.PREV_A=-1,a.R=1,a.G=2,a.B=3,a.A=4,a}(a);t.ColorTimeline=c;var d=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.twoColor<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,i,n,r,s,o,h,l){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=i,this.frames[t+a.G]=n,this.frames[t+a.B]=r,this.frames[t+a.A]=s,this.frames[t+a.R2]=o,this.frames[t+a.G2]=h,this.frames[t+a.B2]=l},a.prototype.apply=function(t,i,n,r,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(n=c[c.length-a.ENTRIES]){var b=c.length;g=c[b+a.PREV_R],m=c[b+a.PREV_G],M=c[b+a.PREV_B],x=c[b+a.PREV_A],y=c[b+a.PREV_R2],w=c[b+a.PREV_G2],E=c[b+a.PREV_B2]}else{var T=s.binarySearch(c,n,a.ENTRIES);g=c[T+a.PREV_R],m=c[T+a.PREV_G],M=c[T+a.PREV_B],x=c[T+a.PREV_A],y=c[T+a.PREV_R2],w=c[T+a.PREV_G2],E=c[T+a.PREV_B2];var A=c[T],R=this.getCurvePercent(T/a.ENTRIES-1,1-(n-A)/(c[T+a.PREV_TIME]-A));g+=(c[T+a.R]-g)*R,m+=(c[T+a.G]-m)*R,M+=(c[T+a.B]-M)*R,x+=(c[T+a.A]-x)*R,y+=(c[T+a.R2]-y)*R,w+=(c[T+a.G2]-w)*R,E+=(c[T+a.B2]-E)*R}if(1==o)u.color.set(g,m,M,x),u.darkColor.set(y,w,E,1);else{d=u.color,f=u.darkColor;h==e.setup&&(d.setFromColor(u.data.color),f.setFromColor(u.data.darkColor)),d.add((g-d.r)*o,(m-d.g)*o,(M-d.b)*o,(x-d.a)*o),f.add((y-f.r)*o,(w-f.g)*o,(E-f.b)*o,0)}}}},a.ENTRIES=8,a.PREV_TIME=-8,a.PREV_R=-7,a.PREV_G=-6,a.PREV_B=-5,a.PREV_A=-4,a.PREV_R2=-3,a.PREV_G2=-2,a.PREV_B2=-1,a.R=1,a.G=2,a.B=3,a.A=4,a.R2=5,a.G2=6,a.B2=7,a}(a);t.TwoColorTimeline=d;var f=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return r.prototype.getPropertyId=function(){return(n.attachment<<24)+this.slotIndex},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},r.prototype.apply=function(t,n,r,a,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active)if(l!=i.mixOut){var c=this.frames;if(r=c[c.length-1]?c.length-1:s.binarySearch(c,r,1)-1;var f=this.attachmentNames[d];t.slots[this.slotIndex].setAttachment(null==f?null:t.getAttachment(this.slotIndex,f))}}else h==e.setup&&this.setAttachment(t,u,u.data.attachmentName)},r.prototype.setAttachment=function(t,e,i){e.setAttachment(null==i?null:t.getAttachment(this.slotIndex,i))},r}();t.AttachmentTimeline=f;var p=null,v=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e),n.frameVertices=new Array(e),null==p&&(p=t.Utils.newFloatArray(64)),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.deform<<27)+ +this.attachment.id+this.slotIndex},a.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.frameVertices[t]=i},a.prototype.apply=function(i,n,r,a,o,h,l){var u=i.slots[this.slotIndex];if(u.bone.active){var c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.deformAttachment==this.attachment){var d=u.deform;0==d.length&&(h=e.setup);var f=this.frameVertices,p=f[0].length,v=this.frames;if(r=v[v.length-1]){var w=f[v.length-1];if(1==o)if(h==e.add)if(null==(g=c).bones){M=g.vertices;for(var E=0;Ei)this.apply(t,e,Number.MAX_VALUE,n,r,a,o),e=-1;else if(e>=h[l-1])return;if(!(i0&&h[u-1]==c;)u--;for(;u=h[u];u++)n.push(this.events[u])}}},e}();t.EventTimeline=g;var m=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return r.prototype.getPropertyId=function(){return n.drawOrder<<24},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.drawOrders[t]=i},r.prototype.apply=function(n,r,a,o,h,l,u){var c=n.drawOrder,d=n.slots;if(u!=i.mixOut){var f=this.frames;if(a=f[f.length-1]?f.length-1:s.binarySearch(f,a)-1;var v=this.drawOrders[p];if(null==v)t.Utils.arrayCopy(d,0,c,0,d.length);else for(var g=0,m=v.length;g=c[c.length-o.ENTRIES])l==e.setup?(d.mix=d.data.mix+(c[c.length+o.PREV_MIX]-d.data.mix)*h,d.softness=d.data.softness+(c[c.length+o.PREV_SOFTNESS]-d.data.softness)*h,u==i.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],d.compress=0!=c[c.length+o.PREV_COMPRESS],d.stretch=0!=c[c.length+o.PREV_STRETCH])):(d.mix+=(c[c.length+o.PREV_MIX]-d.mix)*h,d.softness+=(c[c.length+o.PREV_SOFTNESS]-d.softness)*h,u==i.mixIn&&(d.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],d.compress=0!=c[c.length+o.PREV_COMPRESS],d.stretch=0!=c[c.length+o.PREV_STRETCH]));else{var f=s.binarySearch(c,r,o.ENTRIES),p=c[f+o.PREV_MIX],v=c[f+o.PREV_SOFTNESS],g=c[f],m=this.getCurvePercent(f/o.ENTRIES-1,1-(r-g)/(c[f+o.PREV_TIME]-g));l==e.setup?(d.mix=d.data.mix+(p+(c[f+o.MIX]-p)*m-d.data.mix)*h,d.softness=d.data.softness+(v+(c[f+o.SOFTNESS]-v)*m-d.data.softness)*h,u==i.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=c[f+o.PREV_BEND_DIRECTION],d.compress=0!=c[f+o.PREV_COMPRESS],d.stretch=0!=c[f+o.PREV_STRETCH])):(d.mix+=(p+(c[f+o.MIX]-p)*m-d.mix)*h,d.softness+=(v+(c[f+o.SOFTNESS]-v)*m-d.softness)*h,u==i.mixIn&&(d.bendDirection=c[f+o.PREV_BEND_DIRECTION],d.compress=0!=c[f+o.PREV_COMPRESS],d.stretch=0!=c[f+o.PREV_STRETCH]))}},o.ENTRIES=6,o.PREV_TIME=-6,o.PREV_MIX=-5,o.PREV_SOFTNESS=-4,o.PREV_BEND_DIRECTION=-3,o.PREV_COMPRESS=-2,o.PREV_STRETCH=-1,o.MIX=1,o.SOFTNESS=2,o.BEND_DIRECTION=3,o.COMPRESS=4,o.STRETCH=5,o}(a);t.IkConstraintTimeline=M;var x=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.transformConstraint<<24)+this.transformConstraintIndex},a.prototype.setFrame=function(t,e,i,n,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=i,this.frames[t+a.TRANSLATE]=n,this.frames[t+a.SCALE]=r,this.frames[t+a.SHEAR]=s},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES]){var m=u.length;f=u[m+a.PREV_ROTATE],p=u[m+a.PREV_TRANSLATE],v=u[m+a.PREV_SCALE],g=u[m+a.PREV_SHEAR]}else{var M=s.binarySearch(u,n,a.ENTRIES);f=u[M+a.PREV_ROTATE],p=u[M+a.PREV_TRANSLATE],v=u[M+a.PREV_SCALE],g=u[M+a.PREV_SHEAR];var x=u[M],y=this.getCurvePercent(M/a.ENTRIES-1,1-(n-x)/(u[M+a.PREV_TIME]-x));f+=(u[M+a.ROTATE]-f)*y,p+=(u[M+a.TRANSLATE]-p)*y,v+=(u[M+a.SCALE]-v)*y,g+=(u[M+a.SHEAR]-g)*y}if(h==e.setup){d=c.data;c.rotateMix=d.rotateMix+(f-d.rotateMix)*o,c.translateMix=d.translateMix+(p-d.translateMix)*o,c.scaleMix=d.scaleMix+(v-d.scaleMix)*o,c.shearMix=d.shearMix+(g-d.shearMix)*o}else c.rotateMix+=(f-c.rotateMix)*o,c.translateMix+=(p-c.translateMix)*o,c.scaleMix+=(v-c.scaleMix)*o,c.shearMix+=(g-c.shearMix)*o}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_ROTATE=-4,a.PREV_TRANSLATE=-3,a.PREV_SCALE=-2,a.PREV_SHEAR=-1,a.ROTATE=1,a.TRANSLATE=2,a.SCALE=3,a.SHEAR=4,a}(a);t.TransformConstraintTimeline=x;var y=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.pathConstraintPosition<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,i){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.VALUE]=i},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_VALUE];else{var f=s.binarySearch(u,n,a.ENTRIES);d=u[f+a.PREV_VALUE];var p=u[f],v=this.getCurvePercent(f/a.ENTRIES-1,1-(n-p)/(u[f+a.PREV_TIME]-p));d+=(u[f+a.VALUE]-d)*v}h==e.setup?c.position=c.data.position+(d-c.data.position)*o:c.position+=(d-c.position)*o}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_VALUE=-1,a.VALUE=1,a}(a);t.PathConstraintPositionTimeline=y;var w=function(t){function i(e){return t.call(this,e)||this}return r(i,t),i.prototype.getPropertyId=function(){return(n.pathConstraintSpacing<<24)+this.pathConstraintIndex},i.prototype.apply=function(t,n,r,a,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(r=u[u.length-i.ENTRIES])d=u[u.length+i.PREV_VALUE];else{var f=s.binarySearch(u,r,i.ENTRIES);d=u[f+i.PREV_VALUE];var p=u[f],v=this.getCurvePercent(f/i.ENTRIES-1,1-(r-p)/(u[f+i.PREV_TIME]-p));d+=(u[f+i.VALUE]-d)*v}h==e.setup?c.spacing=c.data.spacing+(d-c.data.spacing)*o:c.spacing+=(d-c.spacing)*o}},i}(y);t.PathConstraintSpacingTimeline=w;var E=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.pathConstraintMix<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,i,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=i,this.frames[t+a.TRANSLATE]=n},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_ROTATE],f=u[u.length+a.PREV_TRANSLATE];else{var p=s.binarySearch(u,n,a.ENTRIES);d=u[p+a.PREV_ROTATE],f=u[p+a.PREV_TRANSLATE];var v=u[p],g=this.getCurvePercent(p/a.ENTRIES-1,1-(n-v)/(u[p+a.PREV_TIME]-v));d+=(u[p+a.ROTATE]-d)*g,f+=(u[p+a.TRANSLATE]-f)*g}h==e.setup?(c.rotateMix=c.data.rotateMix+(d-c.data.rotateMix)*o,c.translateMix=c.data.translateMix+(f-c.data.translateMix)*o):(c.rotateMix+=(d-c.rotateMix)*o,c.translateMix+=(f-c.translateMix)*o)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_ROTATE=-2,a.PREV_TRANSLATE=-1,a.ROTATE=1,a.TRANSLATE=2,a}(a);t.PathConstraintMixTimeline=E}(n||(n={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.trackEntryPool=new t.Pool((function(){return new i})),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,i=0,n=e.length;i0){if(r.delay-=s,r.delay>0)continue;s=-r.delay,r.delay=0}var a=r.next;if(null!=a){var o=r.trackLast-a.delay;if(o>=0){for(a.delay=0,a.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*a.timeScale,r.trackTime+=s,this.setCurrent(i,a,!0);null!=a.mixingFrom;)a.mixTime+=t,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&null==r.mixingFrom){e[i]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,null!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=s}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var i=t.mixingFrom;if(null==i)return!0;var n=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,null!=i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(i){if(null==i)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var n=this.events,r=this.tracks,s=!1,a=0,o=r.length;a0)){s=!0;var l=0==a?t.MixBlend.first:h.mixBlend,u=h.alpha;null!=h.mixingFrom?u*=this.applyMixingFrom(h,i,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,d=h.getAnimationTime(),f=h.animation.timelines.length,p=h.animation.timelines;if(0==a&&1==u||l==t.MixBlend.add)for(var v=0;v1&&(a=1),r!=t.MixBlend.first&&(r=s.mixBlend));var o=a0&&this.queueEvents(s,c),this.events.length=0,s.nextAnimationLast=c,s.nextTrackLast=s.trackTime,a},e.prototype.applyAttachmentTimeline=function(i,n,r,s,a){var o=n.slots[i.slotIndex];if(o.bone.active){var h,l=i.frames;if(r=l[l.length-1]?l.length-1:t.Animation.binarySearch(l,r)-1,this.setAttachment(n,o,i.attachmentNames[h],a);o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+e.SETUP)}},e.prototype.setAttachment=function(t,i,n,r){i.setAttachment(null==n?null:t.getAttachment(i.data.index,n)),r&&(i.attachmentState=this.unkeyedState+e.CURRENT)},e.prototype.applyRotateTimeline=function(e,i,n,r,s,a,o,h){if(h&&(a[o]=0),1!=r){var l=e,u=l.frames,c=i.bones[l.boneIndex];if(c.active){var d=0,f=0;if(n=u[u.length-t.RotateTimeline.ENTRIES])f=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(u,n,t.RotateTimeline.ENTRIES),v=u[p+t.RotateTimeline.PREV_ROTATION],g=u[p],m=l.getCurvePercent((p>>1)-1,1-(n-g)/(u[p+t.RotateTimeline.PREV_TIME]-g));f=u[p+t.RotateTimeline.ROTATION]-v,f=v+(f-=360*(16384-(16384.499999999996-f/360|0)))*m+c.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0))}var M=0,x=f-d;if(0==(x-=360*(16384-(16384.499999999996-x/360|0))))M=a[o];else{var y=0,w=0;h?(y=0,w=x):(y=a[o],w=a[o+1]);var E=x>0,b=y>=0;t.MathUtils.signum(w)!=t.MathUtils.signum(x)&&Math.abs(w)<=90&&(Math.abs(y)>180&&(y+=360*t.MathUtils.signum(y)),b=E),M=x+y-y%360,b!=E&&(M+=360*t.MathUtils.signum(y)),a[o]=M}a[o+1]=x,d+=M*r,c.rotation=d-360*(16384-(16384.499999999996-d/360|0))}}else e.apply(i,0,n,null,1,s,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var i=t.animationStart,n=t.animationEnd,r=n-i,s=t.trackLast%r,a=this.events,o=0,h=a.length;on||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:e>=n&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var i=e;;){var n=i.mixingFrom;if(null==n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,i){var n=this.expandToIndex(t);this.tracks[t]=e,null!=n&&(i&&this.queue.interrupt(n),e.mixingFrom=n,n.mixingTo=e,e.mixTime=0,null!=n.mixingFrom&&n.mixDuration>0&&(e.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,i){var n=this.data.skeletonData.findAnimation(e);if(null==n)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,n,i)},e.prototype.setAnimationWith=function(t,e,i){if(null==e)throw new Error("animation cannot be null.");var n=!0,r=this.expandToIndex(t);null!=r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.disposeNext(r),r=r.mixingFrom,n=!1):this.disposeNext(r));var s=this.trackEntry(t,e,i,r);return this.setCurrent(t,s,n),this.queue.drain(),s},e.prototype.addAnimation=function(t,e,i,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,i,n)},e.prototype.addAnimationWith=function(t,e,i,n){if(null==e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(null!=r)for(;null!=r.next;)r=r.next;var s=this.trackEntry(t,e,i,r);if(null==r)this.setCurrent(t,s,!0),this.queue.drain();else if(r.next=s,n<=0){var a=r.animationEnd-r.animationStart;0!=a?(r.loop?n+=a*(1+(r.trackTime/a|0)):n+=Math.max(a,r.trackTime),n-=this.data.getMix(r.animation,e)):n=r.trackTime}return s.delay=n,s},e.prototype.setEmptyAnimation=function(t,i){var n=this.setAnimationWith(t,e.emptyAnimation,!1);return n.mixDuration=i,n.trackEnd=i,n},e.prototype.addEmptyAnimation=function(t,i,n){n<=0&&(n-=i);var r=this.addAnimationWith(t,e.emptyAnimation,!1,n);return r.mixDuration=i,r.trackEnd=i,r},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var i=0,n=this.tracks.length;i0){a[l]=e.HOLD_MIX,o[l]=d;continue t}break}a[l]=e.HOLD_FIRST}else a[l]=e.SUBSEQUENT}},e.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.emptyAnimation=new t.Animation("",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.HOLD_SUBSEQUENT=2,e.HOLD_FIRST=3,e.HOLD_MIX=4,e.SETUP=1,e.CURRENT=2,e}();t.AnimationState=e;var i=function(){function e(){this.mixBlend=t.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return e.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},e.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},e.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},e}();t.TrackEntry=i;var n,r=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(n.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(n.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(n.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(n.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(n.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(n.event),this.objects.push(t),this.objects.push(e)},t.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,i=0;i=0?e.substring(0,e.lastIndexOf("/")):"";e=this.pathPrefix+e,this.toLoad++,this.downloadText(e,(function(a){var o={count:0},h=new Array;try{new t.TextureAtlas(a,(function(e){h.push(""==s?e:s+"/"+e);var i=document.createElement("img");return i.width=16,i.height=16,new t.FakeTexture(i)}))}catch(t){var l=t;return r.errors[e]="Couldn't load texture atlas ".concat(e,": ").concat(l.message),n&&n(e,"Couldn't load texture atlas ".concat(e,": ").concat(l.message)),r.toLoad--,void r.loaded++}for(var u=function(l){var u=!1;r.loadTexture(l,(function(l,c){if(o.count++,o.count==h.length)if(u)r.errors[e]="Couldn't load texture atlas page ".concat(l,"} of atlas ").concat(e),n&&n(e,"Couldn't load texture atlas page ".concat(l," of atlas ").concat(e)),r.toLoad--,r.loaded++;else try{var d=new t.TextureAtlas(a,(function(t){return r.get(""==s?t:s+"/"+t)}));r.assets[e]=d,i&&i(e,d),r.toLoad--,r.loaded++}catch(t){var f=t;r.errors[e]="Couldn't load texture atlas ".concat(e,": ").concat(f.message),n&&n(e,"Couldn't load texture atlas ".concat(e,": ").concat(f.message)),r.toLoad--,r.loaded++}}),(function(t,i){u=!0,o.count++,o.count==h.length&&(r.errors[e]="Couldn't load texture atlas page ".concat(t,"} of atlas ").concat(e),n&&n(e,"Couldn't load texture atlas page ".concat(t," of atlas ").concat(e)),r.toLoad--,r.loaded++)}))},c=0,d=h;c0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(n||(n={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in atlas: "+n+" (region attachment: "+i+")");r.renderObject=r;var s=new t.RegionAttachment(i);return s.setRegion(r),s},e.prototype.newMeshAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in atlas: "+n+" (mesh attachment: "+i+")");r.renderObject=r;var s=new t.MeshAttachment(i);return s.region=r,s},e.prototype.newBoundingBoxAttachment=function(e,i){return new t.BoundingBoxAttachment(i)},e.prototype.newPathAttachment=function(e,i){return new t.PathAttachment(i)},e.prototype.newPointAttachment=function(e,i){return new t.PointAttachment(i)},e.prototype.newClippingAttachment=function(e,i){return new t.ClippingAttachment(i)},e}();t.AtlasAttachmentLoader=e}(n||(n={})),function(t){!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(t.BlendMode||(t.BlendMode={}))}(n||(n={})),function(t){var e=function(){function e(t,e,i){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}return e.prototype.isActive=function(){return this.active},e.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,i,n,r,s,a,o){this.ax=e,this.ay=i,this.arotation=n,this.ascaleX=r,this.ascaleY=s,this.ashearX=a,this.ashearY=o,this.appliedValid=!0;var h=this.parent;if(null==h){var l=this.skeleton,u=n+90+o,c=l.scaleX,d=l.scaleY;return this.a=t.MathUtils.cosDeg(n+a)*r*c,this.b=t.MathUtils.cosDeg(u)*s*c,this.c=t.MathUtils.sinDeg(n+a)*r*d,this.d=t.MathUtils.sinDeg(u)*s*d,this.worldX=e*c+l.x,void(this.worldY=i*d+l.y)}var f=h.a,p=h.b,v=h.c,g=h.d;switch(this.worldX=f*e+p*i+h.worldX,this.worldY=v*e+g*i+h.worldY,this.data.transformMode){case t.TransformMode.Normal:u=n+90+o;var m=t.MathUtils.cosDeg(n+a)*r,M=t.MathUtils.cosDeg(u)*s,x=t.MathUtils.sinDeg(n+a)*r,y=t.MathUtils.sinDeg(u)*s;return this.a=f*m+p*x,this.b=f*M+p*y,this.c=v*m+g*x,void(this.d=v*M+g*y);case t.TransformMode.OnlyTranslation:u=n+90+o;this.a=t.MathUtils.cosDeg(n+a)*r,this.b=t.MathUtils.cosDeg(u)*s,this.c=t.MathUtils.sinDeg(n+a)*r,this.d=t.MathUtils.sinDeg(u)*s;break;case t.TransformMode.NoRotationOrReflection:var w=0;(T=f*f+v*v)>1e-4?(T=Math.abs(f*g-p*v)/T,f/=this.skeleton.scaleX,p=(v/=this.skeleton.scaleY)*T,g=f*T,w=Math.atan2(v,f)*t.MathUtils.radDeg):(f=0,v=0,w=90-Math.atan2(g,p)*t.MathUtils.radDeg);var E=n+a-w,b=n+o-w+90;m=t.MathUtils.cosDeg(E)*r,M=t.MathUtils.cosDeg(b)*s,x=t.MathUtils.sinDeg(E)*r,y=t.MathUtils.sinDeg(b)*s;this.a=f*m-p*x,this.b=f*M-p*y,this.c=v*m+g*x,this.d=v*M+g*y;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var T,A=t.MathUtils.cosDeg(n),R=t.MathUtils.sinDeg(n),S=(f*A+p*R)/this.skeleton.scaleX,C=(v*A+g*R)/this.skeleton.scaleY;(T=Math.sqrt(S*S+C*C))>1e-5&&(T=1/T),S*=T,C*=T,T=Math.sqrt(S*S+C*C),this.data.transformMode==t.TransformMode.NoScale&&f*g-p*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(T=-T);var I=Math.PI/2+Math.atan2(C,S),P=Math.cos(I)*T,L=Math.sin(I)*T;m=t.MathUtils.cosDeg(a)*r,M=t.MathUtils.cosDeg(90+o)*s,x=t.MathUtils.sinDeg(a)*r,y=t.MathUtils.sinDeg(90+o)*s;this.a=S*m+P*x,this.b=S*M+P*y,this.c=C*m+L*x,this.d=C*M+L*y}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},e.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*t.MathUtils.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*t.MathUtils.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var e=this.parent;if(null==e)return this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);var i=e.a,n=e.b,r=e.c,s=e.d,a=1/(i*s-n*r),o=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=o*s*a-h*n*a,this.ay=h*i*a-o*r*a;var l=a*s,u=a*i,c=a*n,d=a*r,f=l*this.a-c*this.c,p=l*this.b-c*this.d,v=u*this.c-d*this.a,g=u*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var m=f*g-p*v;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(f*p+v*g,m)*t.MathUtils.radDeg,this.arotation=Math.atan2(v,f)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,i=this.b,n=this.c,r=this.d,s=1/(e*r-i*n),a=t.x-this.worldX,o=t.y-this.worldY;return t.x=a*r*s-o*i*s,t.y=o*e*s-a*n*s,t},e.prototype.localToWorld=function(t){var e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t},e.prototype.worldToLocalRotation=function(e){var i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return Math.atan2(this.a*i-this.c*n,this.d*n-this.b*i)*t.MathUtils.radDeg+this.rotation-this.shearX},e.prototype.localToWorldRotation=function(e){e-=this.rotation-this.shearX;var i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return Math.atan2(n*this.c+i*this.d,n*this.a+i*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var i=this.a,n=this.b,r=this.c,s=this.d,a=t.MathUtils.cosDeg(e),o=t.MathUtils.sinDeg(e);this.a=a*i-o*r,this.b=a*n-o*s,this.c=o*i+a*r,this.d=o*n+a*s,this.appliedValid=!1},e}();t.Bone=e}(n||(n={})),function(t){var e,i=function(i,n,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=e.Normal,this.skinRequired=!1,this.color=new t.Color,i<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");this.index=i,this.name=n,this.parent=r};t.BoneData=i,function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(e=t.TransformMode||(t.TransformMode={}))}(n||(n={})),function(t){var e=function(t,e,i){this.name=t,this.order=e,this.skinRequired=i};t.ConstraintData=e}(n||(n={})),function(t){var e=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e};t.Event=e}(n||(n={})),function(t){var e=function(t){this.name=t};t.EventData=e}(n||(n={})),function(t){var e=function(){function e(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var i=0;i180?f-=360:f<-180&&(f+=360);var E=e.ascaleX,b=e.ascaleY;if(r||s){switch(e.data.transformMode){case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:p=i-e.worldX,v=n-e.worldY}var T=e.data.length*E,A=Math.sqrt(p*p+v*v);if(r&&AT&&T>1e-4)E*=g=(A/T-1)*o+1,a&&(b*=g)}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*o,E,b,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,i,n,r,s,a,o,h){if(0!=h){e.appliedValid||e.updateAppliedTransform(),i.appliedValid||i.updateAppliedTransform();var l=e.ax,u=e.ay,c=e.ascaleX,d=c,f=e.ascaleY,p=i.ascaleX,v=0,g=0,m=0;c<0?(c=-c,v=180,m=-1):(v=0,m=1),f<0&&(f=-f,m=-m),p<0?(p=-p,g=180):g=0;var M=i.ax,x=0,y=0,w=0,E=e.a,b=e.b,T=e.c,A=e.d,R=Math.abs(c-f)<=1e-4;R?(y=E*M+b*(x=i.ay)+e.worldX,w=T*M+A*x+e.worldY):(x=0,y=E*M+e.worldX,w=T*M+e.worldY);var S=e.parent;E=S.a,b=S.b,T=S.c;var C,I,P=1/(E*(A=S.d)-b*T),L=y-S.worldX,O=w-S.worldY,_=(L*A-O*b)*P-l,k=(O*E-L*T)*P-u,F=Math.sqrt(_*_+k*k),D=i.data.length*p;if(F<1e-4)return this.apply1(e,n,r,!1,a,!1,h),void i.updateWorldTransformWith(M,x,0,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY);var V=((L=n-S.worldX)*A-(O=r-S.worldY)*b)*P-l,N=(O*E-L*T)*P-u,B=V*V+N*N;if(0!=o){o*=c*(p+1)/2;var X=Math.sqrt(B),U=X-F-D*c+o;if(U>0){var Y=Math.min(1,U/(2*o))-1;B=(V-=(Y=(U-o*(1-Y*Y))/X)*V)*V+(N-=Y*N)*N}}t:if(R){var z=(B-F*F-(D*=c)*D)/(2*F*D);z<-1?z=-1:z>1&&(z=1,a&&(d*=(Math.sqrt(B)/(F+D)-1)*h+1)),I=Math.acos(z)*s,E=F+D*z,b=D*Math.sin(I),C=Math.atan2(N*E-V*b,V*E+N*b)}else{var W=(E=c*D)*E,G=(b=f*D)*b,H=Math.atan2(N,V),q=-2*G*F,j=G-W;if((A=q*q-4*j*(T=G*F*F+W*B-W*G))>=0){var K=Math.sqrt(A);q<0&&(K=-K);var Z=(K=-(q+K)/2)/j,Q=T/K,$=Math.abs(Z)=-1&&T<=1&&(T=Math.acos(T),(A=(L=E*Math.cos(T)+F)*L+(O=b*Math.sin(T))*O)st&&(nt=T,st=A,rt=L,at=O)),B<=(et+st)/2?(C=H-Math.atan2(it*s,tt),I=J*s):(C=H-Math.atan2(at*s,rt),I=nt*s)}var ot=Math.atan2(x,M)*m,ht=e.arotation;(C=(C-ot)*t.MathUtils.radDeg+v-ht)>180?C-=360:C<-180&&(C+=360),e.updateWorldTransformWith(l,u,ht+C*h,d,e.ascaleY,0,0),ht=i.arotation,(I=((I+ot)*t.MathUtils.radDeg-i.ashearX)*m+g-ht)>180?I-=360:I<-180&&(I+=360),i.updateWorldTransformWith(M,x,ht+I*h,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY)}else i.updateWorldTransform()},e}();t.IkConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i.bendDirection=1,i.compress=!1,i.stretch=!1,i.uniform=!1,i.mix=1,i.softness=0,i}return r(e,t),e}(t.ConstraintData);t.IkConstraintData=e}(n||(n={})),function(t){var e=function(){function e(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var i=0,n=t.bones.length;i0;if(r>0||s){var a=this.data,o=a.spacingMode==t.SpacingMode.Percent,h=a.rotateMode,l=h==t.RotateMode.Tangent,u=h==t.RotateMode.ChainScale,c=this.bones.length,d=l?c:c+1,f=this.bones,p=t.Utils.setArraySize(this.spaces,d),v=null,g=this.spacing;if(u||!o){u&&(v=t.Utils.setArraySize(this.lengths,c));for(var m=a.spacingMode==t.SpacingMode.Length,M=0,x=d-1;M0?t.MathUtils.degRad:-t.MathUtils.degRad;M=0;for(var P=3;Mt.MathUtils.PI?X-=t.MathUtils.PI2:X<-t.MathUtils.PI&&(X+=t.MathUtils.PI2),X*=n,U=Math.cos(X),Y=Math.sin(X),L.a=U*D-Y*N,L.b=U*V-Y*B,L.c=Y*D+U*N,L.d=Y*V+U*B}L.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(i,n,r,s,a){var o=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*n+2),c=null,d=i.closed,f=i.worldVerticesLength,p=f/6,v=e.NONE;if(!i.constantSpeed){var g=i.lengths,m=g[p-=d?1:2];if(s&&(h*=m),a)for(var M=1;Mm){v!=e.AFTER&&(v=e.AFTER,i.computeWorldVertices(o,f-6,4,c,0,2)),this.addAfterPosition(w-m,c,0,u,x);continue}}for(;;y++){var E=g[y];if(!(w>E)){if(0==y)w/=E;else w=(w-(K=g[y-1]))/(E-K);break}}y!=v&&(v=y,d&&y==p?(i.computeWorldVertices(o,f-4,4,c,0,2),i.computeWorldVertices(o,0,4,c,4,2)):i.computeWorldVertices(o,6*y+2,8,c,0,2)),this.addCurvePosition(w,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,x,r||M>0&&0==G)}return u}d?(f+=2,c=t.Utils.setArraySize(this.world,f),i.computeWorldVertices(o,2,f-4,c,0,2),i.computeWorldVertices(o,0,2,c,f-4,2),c[f-2]=c[0],c[f-1]=c[1]):(p--,f-=4,c=t.Utils.setArraySize(this.world,f),i.computeWorldVertices(o,2,f,c,0,2));for(var b=t.Utils.setArraySize(this.curves,p),T=0,A=c[0],R=c[1],S=0,C=0,I=0,P=0,L=0,O=0,_=0,k=0,F=0,D=0,V=0,N=0,B=0,X=0,U=(M=0,2);MT){this.addAfterPosition(w-T,c,f-4,u,x);continue}}for(;;y++){var H=b[y];if(!(w>H)){if(0==y)w/=H;else w=(w-(K=b[y-1]))/(H-K);break}}if(y!=v){v=y;var q=6*y;for(A=c[q],R=c[q+1],S=c[q+2],C=c[q+3],I=c[q+4],P=c[q+5],V=2*(_=.03*(A-2*S+I))+(F=.006*(3*(S-I)-A+(L=c[q+6]))),N=2*(k=.03*(R-2*C+P))+(D=.006*(3*(C-P)-R+(O=c[q+7]))),B=.3*(S-A)+_+.16666667*F,X=.3*(C-R)+k+.16666667*D,z=Math.sqrt(B*B+X*X),Y[0]=z,q=1;q<8;q++)B+=V,X+=N,V+=F,N+=D,z+=Math.sqrt(B*B+X*X),Y[q]=z;B+=V,X+=N,z+=Math.sqrt(B*B+X*X),Y[8]=z,B+=V+F,X+=N+D,z+=Math.sqrt(B*B+X*X),Y[9]=z,W=0}for(w*=z;;W++){var j=Y[W];if(!(w>j)){var K;if(0==W)w/=j;else w=W+(w-(K=Y[W-1]))/(j-K);break}}this.addCurvePosition(.1*w,A,R,S,C,I,P,L,O,u,x,r||M>0&&0==G)}return u},e.prototype.addBeforePosition=function(t,e,i,n,r){var s=e[i],a=e[i+1],o=e[i+2]-s,h=e[i+3]-a,l=Math.atan2(h,o);n[r]=s+t*Math.cos(l),n[r+1]=a+t*Math.sin(l),n[r+2]=l},e.prototype.addAfterPosition=function(t,e,i,n,r){var s=e[i+2],a=e[i+3],o=s-e[i],h=a-e[i+1],l=Math.atan2(h,o);n[r]=s+t*Math.cos(l),n[r+1]=a+t*Math.sin(l),n[r+2]=l},e.prototype.addCurvePosition=function(t,e,i,n,r,s,a,o,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=i,void(l[u+2]=Math.atan2(r-i,n-e));var d=t*t,f=d*t,p=1-t,v=p*p,g=v*p,m=p*t,M=3*m,x=p*M,y=M*t,w=e*g+n*x+s*y+o*f,E=i*g+r*x+a*y+h*f;l[u]=w,l[u+1]=E,c&&(l[u+2]=t<.001?Math.atan2(r-i,n-e):Math.atan2(E-(i*v+r*m*2+a*d),w-(e*v+n*m*2+s*d)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i}return r(e,t),e}(t.ConstraintData);t.PathConstraintData=e,function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(t.PositionMode||(t.PositionMode={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent"}(t.SpacingMode||(t.SpacingMode={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(t.RotateMode||(t.RotateMode={}))}(n||(n={})),function(t){var e=function(){function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t}(),i=function(){function t(t){void 0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}return t.prototype.queueAsset=function(t,i,n){var r=this.clientAssets[t];return null==r&&(r=new e(t),this.clientAssets[t]=r),null!==i&&(r.textureLoader=i),r.toLoad.push(n),this.queuedAssets[n]!==n&&(this.queuedAssets[n]=n,!0)},t.prototype.loadText=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.overrideMimeType("text/html"),n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=n.responseText:i.errors[e]="Couldn't load text ".concat(e,": status ").concat(n.status,", ").concat(n.responseText))},n.open("GET",e,!0),n.send()}},t.prototype.loadJson=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.overrideMimeType("text/html"),n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=JSON.parse(n.responseText):i.errors[e]="Couldn't load text ".concat(e,": status ").concat(n.status,", ").concat(n.responseText))},n.open("GET",e,!0),n.send()}},t.prototype.loadTexture=function(t,e,i){var n=this;if(i=this.pathPrefix+i,this.queueAsset(t,e,i))if(!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts){fetch(i,{mode:"cors"}).then((function(t){return t.ok||(n.errors[i]="Couldn't load image "+i),t.blob()})).then((function(t){return createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"})})).then((function(t){n.rawAssets[i]=t}))}else{var r=new Image;r.crossOrigin="anonymous",r.onload=function(t){n.rawAssets[i]=r},r.onerror=function(t){n.errors[i]="Couldn't load image ".concat(i)},r.src=i}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var i=this.clientAssets[t];return null==i||i.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts,i=0;i0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=i}(n||(n={})),function(t){var e=function(){function e(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(var i=0;i1){var s=n[n.length-1];this._updateCache.indexOf(s)>-1||this.updateCacheReset.push(s)}this._updateCache.push(e),this.sortReset(r.children),n[n.length-1].sorted=!0}},e.prototype.sortPathConstraint=function(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active){var i=e.target,n=i.data.index,r=i.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,n,r),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,r);for(var s=0,a=this.data.skins.length;s-1||this.updateCacheReset.push(s)}else for(r=0;r0){y=new t.DrawOrderTimeline(D);var V=r.slots.length;for(u=0;u=0;f--)B[f]=-1;var X=t.Utils.newArray(V-N,0),U=0,Y=0;for(f=0;f=0;f--)-1==B[f]&&(B[f]=X[--Y]);y.setFrame(u,M,B)}s.push(y),o=Math.max(o,y.frames[D-1])}var z=i.readInt(!0);if(z>0){for(y=new t.EventTimeline(z),u=0;u>>1^-(1&i)},t.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},t.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(n),i++}}return e},t.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},t.prototype.readBoolean=function(){return 0!=this.readByte()},t}(),n=function(t,e,i,n,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=n,this.inheritDeform=r},r=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(n||(n={})),function(t){var e=function(){function e(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new t.Pool((function(){return t.Utils.newFloatArray(16)}))}return e.prototype.update=function(e,i){if(null==e)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,r=this.polygons,s=this.polygonPool,a=e.slots,o=a.length;n.length=0,s.freeAll(r),r.length=0;for(var h=0;h=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,i,n){var r=this.minX,s=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&i<=r||e<=s&&n<=s||t>=a&&i>=a||e>=o&&n>=o)return!1;var h=(n-e)/(i-t),l=h*(r-t)+e;if(l>s&&ls&&lr&&ur&&ut.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var i=this.polygons,n=0,r=i.length;n=i||l=i){var u=n[o];u+(i-h)/(l-h)*(n[s]-u)=u&&x<=f||x>=f&&x<=u)&&(x>=e&&x<=n||x>=n&&x<=e)){var y=(l*m-h*v)/M;if((y>=c&&y<=p||y>=p&&y<=c)&&(y>=i&&y<=r||y>=r&&y<=i))return!0}u=f,c=p}return!1},e.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},e.prototype.getWidth=function(){return this.maxX-this.minX},e.prototype.getHeight=function(){return this.maxY-this.minY},e}();t.SkeletonBounds=e}(n||(n={})),function(t){var e=function(){function e(){this.triangulator=new t.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return e.prototype.clipStart=function(i,n){if(null!=this.clipAttachment)return 0;this.clipAttachment=n;var r=n.worldVerticesLength,s=t.Utils.setArraySize(this.clippingPolygon,r);n.computeWorldVertices(i,0,r,s,0,2);var a=this.clippingPolygon;e.makeClockwise(a);for(var o=this.clippingPolygons=this.triangulator.decompose(a,this.triangulator.triangulate(a)),h=0,l=o.length;h>1,B=this.clipOutput,X=t.Utils.setArraySize(u,L+N*p),U=0;U=2?(u=o,o=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(i),u.push(n),u.push(r),u.push(s),u.push(t),u.push(e),o.length=0;for(var c=a,d=a.length-4,f=0;;f+=2){for(var p=c[f],v=c[f+1],g=c[f+2],m=c[f+3],M=p-g,x=v-m,y=u,w=u.length-2,E=o.length,b=0;b0;if(M*(A-m)-x*(T-g)>0){if(C){o.push(R),o.push(S);continue}var I=(L=S-A)*(g-p)-(O=R-T)*(m-v);if(Math.abs(I)>1e-6){var P=(O*(v-A)-L*(p-T))/I;o.push(p+(g-p)*P),o.push(v+(m-v)*P)}else o.push(p),o.push(v)}else if(C){var L,O;I=(L=S-A)*(g-p)-(O=R-T)*(m-v);if(Math.abs(I)>1e-6){P=(O*(v-A)-L*(p-T))/I;o.push(p+(g-p)*P),o.push(v+(m-v)*P)}else o.push(p),o.push(v);o.push(R),o.push(S)}l=!0}if(E==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),f==d)break;var _=o;(o=u).length=0,u=_}if(h!=o){h.length=0;f=0;for(var k=o.length-2;f>1;o=0;d--)-1==G[d]&&(G[d]=q[--K])}y.setFrame(c++,this.getValue(W,"time",0),G)}s.push(y),a=Math.max(a,y.frames[y.getFrameCount()-1])}if(e.events){for(y=new t.EventTimeline(e.events.length),c=0,d=0;d=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=i},i.prototype.addSkin=function(t){for(var e=0;e= 0.");if(null==i)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=e,this.name=i,this.boneData=n};t.SlotData=e}(n||(n={})),function(t){var e,i,n=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return e.MipMapNearestNearest;case"mipmaplinearnearest":return e.MipMapLinearNearest;case"mipmapnearestlinear":return e.MipMapNearestLinear;case"mipmaplinearlinear":return e.MipMapLinearLinear;default:throw new Error("Unknown texture filter ".concat(t))}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return i.MirroredRepeat;case"clamptoedge":return i.ClampToEdge;case"repeat":return i.Repeat;default:throw new Error("Unknown texture wrap ".concat(t))}},t}();t.Texture=n,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(e=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(i=t.TextureWrap||(t.TextureWrap={}));var s=function(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.rotate=!1,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0};t.TextureRegion=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(n);t.FakeTexture=a}(n||(n={})),function(t){var e=function(){function e(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}return e.prototype.load=function(e,r){if(null==r)throw new Error("textureLoader cannot be null.");for(var a=new i(e),o=new Array(4),h=null;;){var l=a.readLine();if(null==l)break;if(0==(l=l.trim()).length)h=null;else if(h){var u=new s;u.name=l,u.page=h;var c=a.readValue();"true"==c.toLocaleLowerCase()?u.degrees=90:"false"==c.toLocaleLowerCase()?u.degrees=0:u.degrees=parseFloat(c),u.rotate=90==u.degrees,a.readTuple(o);var d=parseInt(o[0]),f=parseInt(o[1]);a.readTuple(o);var p=parseInt(o[0]),v=parseInt(o[1]);u.u=d/h.width,u.v=f/h.height,u.rotate?(u.u2=(d+v)/h.width,u.v2=(f+p)/h.height):(u.u2=(d+p)/h.width,u.v2=(f+v)/h.height),u.x=d,u.y=f,u.width=Math.abs(p),u.height=Math.abs(v),4==a.readTuple(o)&&4==a.readTuple(o)&&a.readTuple(o),u.originalWidth=parseInt(o[0]),u.originalHeight=parseInt(o[1]),a.readTuple(o),u.offsetX=parseInt(o[0]),u.offsetY=parseInt(o[1]),u.index=parseInt(a.readValue()),u.texture=h.texture,this.regions.push(u)}else{(h=new n).name=l,2==a.readTuple(o)&&(h.width=parseInt(o[0]),h.height=parseInt(o[1]),a.readTuple(o)),a.readTuple(o),h.minFilter=t.Texture.filterFromString(o[0]),h.magFilter=t.Texture.filterFromString(o[1]);var g=a.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==g?h.uWrap=t.TextureWrap.Repeat:"y"==g?h.vWrap=t.TextureWrap.Repeat:"xy"==g&&(h.uWrap=h.vWrap=t.TextureWrap.Repeat),h.texture=r(l),h.texture.setFilters(h.minFilter,h.magFilter),h.texture.setWraps(h.uWrap,h.vWrap),h.width=h.texture.getImage().width,h.height=h.texture.getImage().height,this.pages.push(h)}}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw new Error("Invalid line: "+e);for(var n=0,r=i+1;n<3;n++){var s=e.indexOf(",",r);if(-1==s)break;t[n]=e.substr(r,s-r).trim(),r=s+1}return t[n]=e.substring(r).trim(),n+1},t}(),n=function(){};t.TextureAtlasPage=n;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=s}(n||(n={})),function(t){var e=function(){function e(e,i){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,this.active=!1,null==e)throw new Error("data cannot be null.");if(null==i)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(var n=0;n0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,d=this.data.offsetShearY*u,f=this.bones,p=0,v=f.length;pt.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2),S*=e;var E=Math.cos(S),b=Math.sin(S);g.a=E*M-b*y,g.b=E*x-b*w,g.c=b*M+E*y,g.d=b*x+E*w,m=!0}if(0!=i){var T=this.temp;s.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(T.x-g.worldX)*i,g.worldY+=(T.y-g.worldY)*i,m=!0}if(n>0){var A=Math.sqrt(g.a*g.a+g.c*g.c),R=Math.sqrt(a*a+h*h);A>1e-5&&(A=(A+(R-A+this.data.offsetScaleX)*n)/A),g.a*=A,g.c*=A,A=Math.sqrt(g.b*g.b+g.d*g.d),R=Math.sqrt(o*o+l*l),A>1e-5&&(A=(A+(R-A+this.data.offsetScaleY)*n)/A),g.b*=A,g.d*=A,m=!0}if(r>0){x=g.b,w=g.d;var S,C=Math.atan2(w,x);(S=Math.atan2(l,o)-Math.atan2(h,a)-(C-Math.atan2(g.c,g.a)))>t.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2),S=C+(S+d)*r;A=Math.sqrt(x*x+w*w);g.b=Math.cos(S)*A,g.d=Math.sin(S)*A,m=!0}m&&(g.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,i=this.translateMix,n=this.scaleMix,r=this.shearMix,s=this.target,a=s.a,o=s.b,h=s.c,l=s.d,u=a*l-o*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,d=this.data.offsetShearY*u,f=this.bones,p=0,v=f.length;pt.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R*=e;var E=Math.cos(R),b=Math.sin(R);g.a=E*M-b*y,g.b=E*x-b*w,g.c=b*M+E*y,g.d=b*x+E*w,m=!0}if(0!=i){var T=this.temp;s.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),g.worldX+=T.x*i,g.worldY+=T.y*i,m=!0}if(n>0){var A=(Math.sqrt(a*a+h*h)-1+this.data.offsetScaleX)*n+1;g.a*=A,g.c*=A,A=(Math.sqrt(o*o+l*l)-1+this.data.offsetScaleY)*n+1,g.b*=A,g.d*=A,m=!0}if(r>0){var R;(R=Math.atan2(l,o)-Math.atan2(h,a))>t.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2);x=g.b,w=g.d;R=Math.atan2(w,x)+(R-t.MathUtils.PI/2+d)*r;A=Math.sqrt(x*x+w*w);g.b=Math.cos(R)*A,g.d=Math.sin(R)*A,m=!0}m&&(g.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a1e-5&&(f=(f+(r.ascaleX-f+this.data.offsetScaleX)*i)/f),p>1e-5&&(p=(p+(r.ascaleY-p+this.data.offsetScaleY)*i)/p));var v=h.ashearY;if(0!=n){u=r.ashearY-v+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*n}h.updateWorldTransformWith(c,d,l,f,p,h.ashearX,v)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a1e-5&&(d*=(r.ascaleX-1+this.data.offsetScaleX)*i+1),f>1e-5&&(f*=(r.ascaleY-1+this.data.offsetScaleY)*i+1));var p=h.ashearY;0!=n&&(p+=(r.ashearY+this.data.offsetShearY)*n),h.updateWorldTransformWith(u,c,l,d,f,h.ashearX,p)}},e}();t.TransformConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i.rotateMix=0,i.translateMix=0,i.scaleMix=0,i.shearMix=0,i.offsetRotation=0,i.offsetX=0,i.offsetY=0,i.offsetScaleX=0,i.offsetScaleY=0,i.offsetShearY=0,i.relative=!1,i.local=!1,i}return r(e,t),e}(t.ConstraintData);t.TransformConstraintData=e}(n||(n={})),function(t){var e=function(){function e(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new t.Pool((function(){return new Array})),this.polygonIndicesPool=new t.Pool((function(){return new Array}))}return e.prototype.triangulate=function(t){var i=t,n=t.length>>1,r=this.indicesArray;r.length=0;for(var s=0;s3;){for(var l=n-1,u=(s=0,1);;){t:if(!a[s]){for(var c=r[l]<<1,d=r[s]<<1,f=r[u]<<1,p=i[c],v=i[c+1],g=i[d],m=i[d+1],M=i[f],x=i[f+1],y=(u+1)%n;y!=l;y=(y+1)%n)if(a[y]){var w=r[y]<<1,E=i[w],b=i[w+1];if(e.positiveArea(M,x,p,v,E,b)&&e.positiveArea(p,v,g,m,E,b)&&e.positiveArea(g,m,M,x,E,b))break t}break}if(0==u){do{if(!a[s])break;s--}while(s>0);break}l=s,s=u,u=(u+1)%n}h.push(r[(n+s-1)%n]),h.push(r[s]),h.push(r[(s+1)%n]),r.splice(s,1),a.splice(s,1);var T=(--n+s-1)%n,A=s==n?0:s;a[T]=e.isConcave(T,n,i,r),a[A]=e.isConcave(A,n,i,r)}return 3==n&&(h.push(r[2]),h.push(r[0]),h.push(r[1])),h},e.prototype.decompose=function(t,i){var n=t,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var s=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(s),s.length=0;var a=this.polygonIndicesPool.obtain();a.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,u=0,c=i.length;u0?(r.push(o),s.push(a)):(this.polygonPool.free(o),this.polygonIndicesPool.free(a)),(o=this.polygonPool.obtain()).length=0,o.push(v),o.push(g),o.push(m),o.push(M),o.push(x),o.push(y),(a=this.polygonIndicesPool.obtain()).length=0,a.push(d),a.push(f),a.push(p),l=e.winding(v,g,m,M,x,y),h=d)}o.length>0&&(r.push(o),s.push(a));for(u=0,c=r.length;u=0;u--)0==(o=r[u]).length&&(r.splice(u,1),this.polygonPool.free(o),a=s[u],s.splice(u,1),this.polygonIndicesPool.free(a));return r},e.isConcave=function(t,e,i,n){var r=n[(e+t-1)%e]<<1,s=n[t]<<1,a=n[(t+1)%e]<<1;return!this.positiveArea(i[r],i[r+1],i[s],i[s+1],i[a],i[a+1])},e.positiveArea=function(t,e,i,n,r,s){return t*(s-n)+i*(e-s)+r*(n-e)>=0},e.winding=function(t,e,i,n,r,s){var a=i-t,o=n-e;return r*o-s*a+a*e-t*o>=0?1:-1},e}();t.Triangulator=e}(n||(n={})),function(t){var e=function(){function t(){this.array=new Array}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return null!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t}();t.IntSet=e;var i=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.r=t,this.g=e,this.b=i,this.a=n}return t.prototype.set=function(t,e,i,n){return this.r=t,this.g=e,this.b=i,this.a=n,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,i,n){return this.r+=t,this.g+=e,this.b+=i,this.a+=n,this.clamp(),this},t.prototype.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.rgba8888ToColor=function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},t.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();t.Color=i;var n=function(){function t(){}return t.clamp=function(t,e,i){return ti?i:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,i){return t.randomTriangularWith(e,i,.5*(e+i))},t.randomTriangularWith=function(t,e,i){var n=Math.random(),r=e-t;return n<=(i-t)/r?t+Math.sqrt(n*r*(i-t)):e-Math.sqrt((1-n)*r*(e-i))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();t.MathUtils=n;var s=function(){function t(){}return t.prototype.apply=function(t,e,i){return t+(e-t)*this.applyInternal(i)},t}();t.Interpolation=s;var a=function(t){function e(e){var i=t.call(this)||this;return i.power=2,i.power=e,i}return r(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1},e}(s);t.Pow=a;var o=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(a);t.PowOut=o;var h=function(){function t(){}return t.arrayCopy=function(t,e,i,n,r){for(var s=e,a=n;s=i?e:t.setArraySize(e,i,n)},t.newArray=function(t,e){for(var i=new Array(t),n=0;n0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();t.TimeKeeper=d;var f=function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*s;var a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,d=0;d0&&(h=o);for(var y,w=(y=t.bone).worldX,E=y.worldY,b=y.a,T=y.b,A=y.c,R=y.d,S=e,C=r;Cthis.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length},e.prototype.setIndices=function(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length},e.prototype.draw=function(t,e){this.drawWithOffset(t,e,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)},e.prototype.drawWithOffset=function(t,e,i,n){var r=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?r.drawElements(e,n,r.UNSIGNED_SHORT,2*i):r.drawArrays(e,i,n),this.unbind(t)},e.prototype.bind=function(t){var e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);for(var i=0,n=0;n0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)},e.prototype.unbind=function(t){for(var e=this.context.gl,i=0;i0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)},e.prototype.update=function(){var t=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=t.createBuffer()),t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),t.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),t.DYNAMIC_DRAW),this.dirtyIndices=!1)},e.prototype.restore=function(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()},e.prototype.dispose=function(){this.context.removeRestorable(this);var t=this.context.gl;t.deleteBuffer(this.verticesBuffer),t.deleteBuffer(this.indicesBuffer)},e}();t.Mesh=e;var i=function(t,e,i){this.name=t,this.type=e,this.numElements=i};t.VertexAttribute=i;var n=function(e){function i(){return e.call(this,t.Shader.POSITION,h.Float,2)||this}return r(i,e),i}(i);t.Position2Attribute=n;var s=function(e){function i(){return e.call(this,t.Shader.POSITION,h.Float,3)||this}return r(i,e),i}(i);t.Position3Attribute=s;var a=function(e){function i(i){return void 0===i&&(i=0),e.call(this,t.Shader.TEXCOORDS+(0==i?"":i),h.Float,2)||this}return r(i,e),i}(i);t.TexCoordAttribute=a;var o=function(e){function i(){return e.call(this,t.Shader.COLOR,h.Float,4)||this}return r(i,e),i}(i);t.ColorAttribute=o;var h,l=function(e){function i(){return e.call(this,t.Shader.COLOR2,h.Float,4)||this}return r(i,e),i}(i);t.Color2Attribute=l,function(t){t[t.Float=0]="Float"}(h=t.VertexAttributeType||(t.VertexAttributeType={}))}(t.webgl||(t.webgl={}))}(n||(n={})),function(t){!function(t){var e=function(){function e(e,i,n){if(void 0===i&&(i=!0),void 0===n&&(n=10920),this.isDrawing=!1,this.shader=null,this.lastTexture=null,this.verticesLength=0,this.indicesLength=0,n>10920)throw new Error("Can't have more than 10920 triangles per batch: "+n);this.context=e instanceof t.ManagedWebGLRenderingContext?e:new t.ManagedWebGLRenderingContext(e);var r=i?[new t.Position2Attribute,new t.ColorAttribute,new t.TexCoordAttribute,new t.Color2Attribute]:[new t.Position2Attribute,new t.ColorAttribute,new t.TexCoordAttribute];this.mesh=new t.Mesh(e,r,n,3*n),this.srcBlend=this.context.gl.SRC_ALPHA,this.dstBlend=this.context.gl.ONE_MINUS_SRC_ALPHA}return e.prototype.begin=function(t){var e=this.context.gl;if(this.isDrawing)throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=t,this.lastTexture=null,this.isDrawing=!0,e.enable(e.BLEND),e.blendFunc(this.srcBlend,this.dstBlend)},e.prototype.setBlendMode=function(t,e){var i=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),i.blendFunc(this.srcBlend,this.dstBlend))},e.prototype.draw=function(t,e,i){t!=this.lastTexture?(this.flush(),this.lastTexture=t):(this.verticesLength+e.length>this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();var n=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);for(var r=this.mesh.getIndices(),s=this.indicesLength,a=0;a0||this.indicesLength>0)&&this.flush(),this.shader=null,this.lastTexture=null,this.isDrawing=!1,t.disable(t.BLEND)},e.prototype.getDrawCalls=function(){return this.drawCalls},e.prototype.dispose=function(){this.mesh.dispose()},e}();t.PolygonBatcher=e}(t.webgl||(t.webgl={}))}(n||(n={})),function(t){!function(e){var i,n=function(){function n(i,n,r){void 0===r&&(r=!0),this.twoColorTint=!1,this.activeRenderer=null,this.QUAD=[0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0],this.QUAD_TRIANGLES=[0,1,2,2,3,0],this.WHITE=new t.Color(1,1,1,1),this.canvas=i,this.context=n instanceof e.ManagedWebGLRenderingContext?n:new e.ManagedWebGLRenderingContext(n),this.twoColorTint=r,this.camera=new e.OrthoCamera(i.width,i.height),this.batcherShader=r?e.Shader.newTwoColoredTextured(this.context):e.Shader.newColoredTextured(this.context),this.batcher=new e.PolygonBatcher(this.context,r),this.shapesShader=e.Shader.newColored(this.context),this.shapes=new e.ShapeRenderer(this.context),this.skeletonRenderer=new e.SkeletonRenderer(this.context,r),this.skeletonDebugRenderer=new e.SkeletonDebugRenderer(this.context)}return n.prototype.begin=function(){this.camera.update(),this.enableRenderer(this.batcher)},n.prototype.drawSkeleton=function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=-1),void 0===n&&(n=-1),this.enableRenderer(this.batcher),this.skeletonRenderer.premultipliedAlpha=e,this.skeletonRenderer.draw(this.batcher,t,i,n)},n.prototype.drawSkeletonDebug=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=null),this.enableRenderer(this.shapes),this.skeletonDebugRenderer.premultipliedAlpha=e,this.skeletonDebugRenderer.draw(this.shapes,t,i)},n.prototype.drawTexture=function(t,e,i,n,r,s){void 0===s&&(s=null),this.enableRenderer(this.batcher),null===s&&(s=this.WHITE);var a=this.QUAD,o=0;a[o++]=e,a[o++]=i,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=0,a[o++]=1,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),a[o++]=e+n,a[o++]=i,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=1,a[o++]=1,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),a[o++]=e+n,a[o++]=i+r,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=1,a[o++]=0,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),a[o++]=e,a[o++]=i+r,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=0,a[o++]=0,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),this.batcher.draw(t,a,this.QUAD_TRIANGLES)},n.prototype.drawTextureUV=function(t,e,i,n,r,s,a,o,h,l){void 0===l&&(l=null),this.enableRenderer(this.batcher),null===l&&(l=this.WHITE);var u=this.QUAD,c=0;u[c++]=e,u[c++]=i,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=s,u[c++]=a,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e+n,u[c++]=i,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=o,u[c++]=a,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e+n,u[c++]=i+r,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=o,u[c++]=h,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e,u[c++]=i+r,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=s,u[c++]=h,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),this.batcher.draw(t,u,this.QUAD_TRIANGLES)},n.prototype.drawTextureRotated=function(e,i,n,r,s,a,o,h,l,u){void 0===l&&(l=null),void 0===u&&(u=!1),this.enableRenderer(this.batcher),null===l&&(l=this.WHITE);var c=this.QUAD,d=i+a,f=n+o,p=-a,v=-o,g=r-a,m=s-o,M=p,x=v,y=p,w=m,E=g,b=m,T=g,A=v,R=0,S=0,C=0,I=0,P=0,L=0,O=0,_=0;if(0!=h){var k=t.MathUtils.cosDeg(h),F=t.MathUtils.sinDeg(h);C=(P=k*E-F*b)+((R=k*M-F*x)-(O=k*y-F*w)),I=(L=F*E+k*b)+((S=F*M+k*x)-(_=F*y+k*w))}else R=M,S=x,O=y,_=w,P=E,L=b,C=T,I=A;R+=d,S+=f,C+=d,I+=f,P+=d,L+=f,O+=d,_+=f;var D=0;c[D++]=R,c[D++]=S,c[D++]=l.r,c[D++]=l.g,c[D++]=l.b,c[D++]=l.a,c[D++]=0,c[D++]=1,this.twoColorTint&&(c[D++]=0,c[D++]=0,c[D++]=0,c[D++]=0),c[D++]=C,c[D++]=I,c[D++]=l.r,c[D++]=l.g,c[D++]=l.b,c[D++]=l.a,c[D++]=1,c[D++]=1,this.twoColorTint&&(c[D++]=0,c[D++]=0,c[D++]=0,c[D++]=0),c[D++]=P,c[D++]=L,c[D++]=l.r,c[D++]=l.g,c[D++]=l.b,c[D++]=l.a,c[D++]=1,c[D++]=0,this.twoColorTint&&(c[D++]=0,c[D++]=0,c[D++]=0,c[D++]=0),c[D++]=O,c[D++]=_,c[D++]=l.r,c[D++]=l.g,c[D++]=l.b,c[D++]=l.a,c[D++]=0,c[D++]=0,this.twoColorTint&&(c[D++]=0,c[D++]=0,c[D++]=0,c[D++]=0),this.batcher.draw(e,c,this.QUAD_TRIANGLES)},n.prototype.drawRegion=function(t,e,i,n,r,s,a){void 0===s&&(s=null),void 0===a&&(a=!1),this.enableRenderer(this.batcher),null===s&&(s=this.WHITE);var o=this.QUAD,h=0;o[h++]=e,o[h++]=i,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u,o[h++]=t.v2,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),o[h++]=e+n,o[h++]=i,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u2,o[h++]=t.v2,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),o[h++]=e+n,o[h++]=i+r,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u2,o[h++]=t.v,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),o[h++]=e,o[h++]=i+r,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u,o[h++]=t.v,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),this.batcher.draw(t.texture,o,this.QUAD_TRIANGLES)},n.prototype.line=function(t,e,i,n,r,s){void 0===r&&(r=null),void 0===s&&(s=null),this.enableRenderer(this.shapes),this.shapes.line(t,e,i,n,r)},n.prototype.triangle=function(t,e,i,n,r,s,a,o,h,l){void 0===o&&(o=null),void 0===h&&(h=null),void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.triangle(t,e,i,n,r,s,a,o,h,l)},n.prototype.quad=function(t,e,i,n,r,s,a,o,h,l,u,c,d){void 0===l&&(l=null),void 0===u&&(u=null),void 0===c&&(c=null),void 0===d&&(d=null),this.enableRenderer(this.shapes),this.shapes.quad(t,e,i,n,r,s,a,o,h,l,u,c,d)},n.prototype.rect=function(t,e,i,n,r,s){void 0===s&&(s=null),this.enableRenderer(this.shapes),this.shapes.rect(t,e,i,n,r,s)},n.prototype.rectLine=function(t,e,i,n,r,s,a){void 0===a&&(a=null),this.enableRenderer(this.shapes),this.shapes.rectLine(t,e,i,n,r,s,a)},n.prototype.polygon=function(t,e,i,n){void 0===n&&(n=null),this.enableRenderer(this.shapes),this.shapes.polygon(t,e,i,n)},n.prototype.circle=function(t,e,i,n,r,s){void 0===r&&(r=null),void 0===s&&(s=0),this.enableRenderer(this.shapes),this.shapes.circle(t,e,i,n,r,s)},n.prototype.curve=function(t,e,i,n,r,s,a,o,h,l){void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.curve(t,e,i,n,r,s,a,o,h,l)},n.prototype.end=function(){this.activeRenderer===this.batcher?this.batcher.end():this.activeRenderer===this.shapes&&this.shapes.end(),this.activeRenderer=null},n.prototype.resize=function(t){var e=this.canvas,n=e.clientWidth,r=e.clientHeight;if(e.width==n&&e.height==r||(e.width=n,e.height=r),this.context.gl.viewport(0,0,e.width,e.height),t===i.Stretch);else if(t===i.Expand)this.camera.setViewport(n,r);else if(t===i.Fit){var s=e.width,a=e.height,o=this.camera.viewportWidth,h=this.camera.viewportHeight,l=h/o10920)throw new Error("Can't have more than 10920 triangles per batch: "+r);this.context=n instanceof e.ManagedWebGLRenderingContext?n:new e.ManagedWebGLRenderingContext(n),this.mesh=new e.Mesh(n,[new e.Position2Attribute,new e.ColorAttribute],r,0),this.srcBlend=this.context.gl.SRC_ALPHA,this.dstBlend=this.context.gl.ONE_MINUS_SRC_ALPHA}return n.prototype.begin=function(t){if(this.isDrawing)throw new Error("ShapeRenderer.begin() has already been called");this.shader=t,this.vertexIndex=0,this.isDrawing=!0;var e=this.context.gl;e.enable(e.BLEND),e.blendFunc(this.srcBlend,this.dstBlend)},n.prototype.setBlendMode=function(t,e){var i=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),i.blendFunc(this.srcBlend,this.dstBlend))},n.prototype.setColor=function(t){this.color.setFromColor(t)},n.prototype.setColorWith=function(t,e,i,n){this.color.set(t,e,i,n)},n.prototype.point=function(t,e,n){void 0===n&&(n=null),this.check(i.Point,1),null===n&&(n=this.color),this.vertex(t,e,n)},n.prototype.line=function(t,e,n,r,s){void 0===s&&(s=null),this.check(i.Line,2);this.mesh.getVertices(),this.vertexIndex;null===s&&(s=this.color),this.vertex(t,e,s),this.vertex(n,r,s)},n.prototype.triangle=function(t,e,n,r,s,a,o,h,l,u){void 0===h&&(h=null),void 0===l&&(l=null),void 0===u&&(u=null),this.check(t?i.Filled:i.Line,3);this.mesh.getVertices(),this.vertexIndex;null===h&&(h=this.color),null===l&&(l=this.color),null===u&&(u=this.color),t?(this.vertex(e,n,h),this.vertex(r,s,l),this.vertex(a,o,u)):(this.vertex(e,n,h),this.vertex(r,s,l),this.vertex(r,s,h),this.vertex(a,o,l),this.vertex(a,o,h),this.vertex(e,n,l))},n.prototype.quad=function(t,e,n,r,s,a,o,h,l,u,c,d,f){void 0===u&&(u=null),void 0===c&&(c=null),void 0===d&&(d=null),void 0===f&&(f=null),this.check(t?i.Filled:i.Line,3);this.mesh.getVertices(),this.vertexIndex;null===u&&(u=this.color),null===c&&(c=this.color),null===d&&(d=this.color),null===f&&(f=this.color),t?(this.vertex(e,n,u),this.vertex(r,s,c),this.vertex(a,o,d),this.vertex(a,o,d),this.vertex(h,l,f),this.vertex(e,n,u)):(this.vertex(e,n,u),this.vertex(r,s,c),this.vertex(r,s,c),this.vertex(a,o,d),this.vertex(a,o,d),this.vertex(h,l,f),this.vertex(h,l,f),this.vertex(e,n,u))},n.prototype.rect=function(t,e,i,n,r,s){void 0===s&&(s=null),this.quad(t,e,i,e+n,i,e+n,i+r,e,i+r,s,s,s,s)},n.prototype.rectLine=function(t,e,n,r,s,a,o){void 0===o&&(o=null),this.check(t?i.Filled:i.Line,8),null===o&&(o=this.color);var h=this.tmp.set(s-n,e-r);h.normalize(),a*=.5;var l=h.x*a,u=h.y*a;t?(this.vertex(e+l,n+u,o),this.vertex(e-l,n-u,o),this.vertex(r+l,s+u,o),this.vertex(r-l,s-u,o),this.vertex(r+l,s+u,o),this.vertex(e-l,n-u,o)):(this.vertex(e+l,n+u,o),this.vertex(e-l,n-u,o),this.vertex(r+l,s+u,o),this.vertex(r-l,s-u,o),this.vertex(r+l,s+u,o),this.vertex(e+l,n+u,o),this.vertex(r-l,s-u,o),this.vertex(e-l,n-u,o))},n.prototype.x=function(t,e,i){this.line(t-i,e-i,t+i,e+i),this.line(t-i,e+i,t+i,e-i)},n.prototype.polygon=function(t,e,n,r){if(void 0===r&&(r=null),n<3)throw new Error("Polygon must contain at least 3 vertices");this.check(i.Line,2*n),null===r&&(r=this.color);this.mesh.getVertices(),this.vertexIndex;n<<=1;for(var s=t[e<<=1],a=t[e+1],o=e+n,h=e,l=e+n-2;h=o?(d=s,f=a):(d=t[h+2],f=t[h+3]),this.vertex(u,c,r),this.vertex(d,f,r)}},n.prototype.circle=function(e,n,r,s,a,o){if(void 0===a&&(a=null),void 0===o&&(o=0),0===o&&(o=Math.max(1,6*t.MathUtils.cbrt(s)|0)),o<=0)throw new Error("segments must be > 0.");null===a&&(a=this.color);var h=2*t.MathUtils.PI/o,l=Math.cos(h),u=Math.sin(h),c=s,d=0;if(e){this.check(i.Filled,3*o+3),o--;for(p=0;p0;)this.vertex(E,b,u),E+=T,b+=A,T+=R,A+=S,R+=C,S+=I,this.vertex(E,b,u);this.vertex(E,b,u),this.vertex(o,h,u)},n.prototype.vertex=function(t,e,i){var n=this.vertexIndex,r=this.mesh.getVertices();r[n++]=t,r[n++]=e,r[n++]=i.r,r[n++]=i.g,r[n++]=i.b,r[n++]=i.a,this.vertexIndex=n},n.prototype.end=function(){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");this.flush(),this.context.gl.disable(this.context.gl.BLEND),this.isDrawing=!1},n.prototype.flush=function(){0!=this.vertexIndex&&(this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0)},n.prototype.check=function(t,e){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");if(this.shapeType==t){if(!(this.mesh.maxVertices()-this.mesh.numVertices()-1)&&null!=d.parent){var f=s+d.data.length*d.a+d.worldX,p=a+d.data.length*d.c+d.worldY;e.rectLine(!0,s+d.worldX,a+d.worldY,f,p,this.boneWidth*this.scale)}}this.drawSkeletonXY&&e.x(s,a,4*this.scale)}if(this.drawRegionAttachments){e.setColor(this.attachmentLineColor);for(u=0,c=(Y=n.slots).length;u0){e.setColor(this.attachmentLineColor);var A=g[(x=2*(x>>1))-2],R=g[x-1];for(y=0,w=x;y-1||e.circle(!0,s+d.worldX,a+d.worldY,3*this.scale,i.GREEN,8)}}if(this.drawClipping){var Y=n.slots;e.setColor(this.clipColor);for(u=0,c=Y.length;u=0&&s==R.data.index&&(E=!0),E){a>=0&&a==R.data.index&&(E=!1);var S=R.getAttachment(),C=null;if(S instanceof t.RegionAttachment){var I=S;v.vertices=this.vertices,v.numVertices=4,v.numFloats=A<<2,I.computeWorldVertices(R.bone,v.vertices,0,A),m=n.QUAD_TRIANGLES,g=I.uvs,C=I.region.renderObject.texture,x=I.color}else{if(!(S instanceof t.MeshAttachment)){if(S instanceof t.ClippingAttachment){var P=S;o.clipStart(R,P);continue}o.clipEndWithSlot(R);continue}var L=S;v.vertices=this.vertices,v.numVertices=L.worldVerticesLength>>1,v.numFloats=v.numVertices*A,v.numFloats>v.vertices.length&&(v.vertices=this.vertices=t.Utils.newFloatArray(v.numFloats)),L.computeWorldVertices(R,0,L.worldVerticesLength,v.vertices,0,A),m=L.triangles,C=L.region.renderObject.texture,g=L.uvs,x=L.color}if(null!=C){var O=R.color,_=this.tempColor;_.r=y.r*O.r*x.r,_.g=y.g*O.g*x.g,_.b=y.b*O.b*x.b,_.a=y.a*O.a*x.a,h&&(_.r*=_.a,_.g*=_.a,_.b*=_.a);var k=this.tempColor2;null==R.darkColor?k.set(0,0,0,1):(h?(k.r=R.darkColor.r*_.a,k.g=R.darkColor.g*_.a,k.b=R.darkColor.b*_.a):k.setFromColor(R.darkColor),k.a=h?1:0);var F=R.data.blendMode;if(F!=u&&(u=F,i.setBlendMode(e.WebGLBlendModeConverter.getSourceGLBlendMode(u,h),e.WebGLBlendModeConverter.getDestGLBlendMode(u))),o.isClipping()){o.clipTriangles(v.vertices,v.numFloats,m,m.length,g,_,k,l);var D=new Float32Array(o.clippedVertices),V=o.clippedTriangles;if(null!=this.vertexEffect){var N=this.vertexEffect,B=D;if(l){U=0;for(var X=D.length;U-1&&this.restorables.splice(e,1)},t}();e.ManagedWebGLRenderingContext=i;var n=function(){function e(){}return e.getDestGLBlendMode=function(i){switch(i){case t.BlendMode.Normal:return e.ONE_MINUS_SRC_ALPHA;case t.BlendMode.Additive:return e.ONE;case t.BlendMode.Multiply:case t.BlendMode.Screen:return e.ONE_MINUS_SRC_ALPHA;default:throw new Error("Unknown blend mode: "+i)}},e.getSourceGLBlendMode=function(i,n){switch(void 0===n&&(n=!1),i){case t.BlendMode.Normal:case t.BlendMode.Additive:return n?e.ONE:e.SRC_ALPHA;case t.BlendMode.Multiply:return e.DST_COLOR;case t.BlendMode.Screen:return e.ONE;default:throw new Error("Unknown blend mode: "+i)}},e.ZERO=0,e.ONE=1,e.SRC_COLOR=768,e.ONE_MINUS_SRC_COLOR=769,e.SRC_ALPHA=770,e.ONE_MINUS_SRC_ALPHA=771,e.DST_ALPHA=772,e.ONE_MINUS_DST_ALPHA=773,e.DST_COLOR=774,e}();e.WebGLBlendModeConverter=n}(t.webgl||(t.webgl={}))}(n||(n={})),t.exports=n}).call(window)},3524:(t,e,i)=>{var n=i(7473),r=i(4597),s=i(6732),a=i(2482),o=i(704),h=i(3137),l=i(1192),u=new n({Extends:h,initialize:function(t,e,i,n,s,u,c){var d,f,p,v=[],g=t.cacheManager.custom.spine;if(a(e)){var m=e;for(e=r(m,"key"),f=new o(t,{key:e,url:r(m,"jsonURL"),extension:r(m,"jsonExtension","json"),xhrSettings:r(m,"jsonXhrSettings")}),n=r(m,"atlasURL"),s=r(m,"preMultipliedAlpha"),Array.isArray(n)||(n=[n]),d=0;d{var n=i(2494),r=i(7473),s=i(5851),a=i(3527),o=i(5722),h=i(6937),l=i(3524),u=i(8332),c=i(5782),d=i(1984),f=new r({Extends:o,initialize:function(t,e,i){o.call(this,t,e,i);var r=e.game;this.isWebGL=2===r.config.renderType,this.cache=r.cache.addCustom("spine"),this.spineTextures=r.cache.addCustom("spineTextures"),this.json=r.cache.json,this.textures=r.textures,this.drawDebug=!1,this.gl,this.renderer,this.sceneRenderer,this.skeletonRenderer,this.skeletonDebugRenderer,this.plugin=h,this.temp1,this.temp2,this.isWebGL?(this.runtime=h.webgl,this.renderer=r.renderer,this.gl=r.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=r.renderer,this.getAtlas=this.getAtlasCanvas),this.renderer||(this.renderer={width:r.scale.width,height:r.scale.height,preRender:d,postRender:d,render:d,destroy:d});var a=this.isWebGL;e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",(function(t,e,n,r,s){a&&this.scene.sys.renderer.pipelines.clear();var o=this.scene.sys[i],h=new u(this.scene,o,t,e,n,r,s);return this.displayList.add(h),this.updateList.add(h),a&&this.scene.sys.renderer.pipelines.rebind(),h}),(function(t,e){void 0===t&&(t={}),a&&this.scene.sys.renderer.pipelines.clear();var r=s(t,"key",null),o=s(t,"animationName",null),h=s(t,"loop",!1),l=this.scene.sys[i],c=new u(this.scene,l,0,0,r,o,h);void 0!==e&&(t.add=e),n(this.scene,c,t);var d=s(t,"skinName",!1);d&&c.setSkinByName(d);var f=s(t,"slotName",!1),p=s(t,"attachmentName",null);return f&&c.setAttachment(f,p),a&&this.scene.sys.renderer.pipelines.rebind(),c.refresh()})),e.registerGameObject("spineContainer",(function(t,e,n){var r=this.scene.sys[i],s=new c(this.scene,r,t,e,n);return this.displayList.add(s),s}),(function(t,e){void 0===t&&(t={});var r=s(t,"x",0),a=s(t,"y",0),o=s(t,"children",null),h=this.scene.sys[i],l=new c(this.scene,h,r,a,o);return void 0!==e&&(t.add=e),n(this.scene,l,t),l}))},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(a,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this),this.game.events.once("destroy",this.gameDestroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){var t=function(t,e){if(t!==this.srcBlend||e!==this.dstBlend){var i=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),i.blendFunc(this.srcBlend,this.dstBlend))}},e=this.renderer.spineSceneRenderer;e||((e=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0)).batcher.setBlendMode=t,e.shapes.setBlendMode=t,this.renderer.spineSceneRenderer=e),this.sceneRenderer=e,this.skeletonRenderer=e.skeletonRenderer,this.skeletonDebugRenderer=e.skeletonDebugRenderer,this.temp1=new h.webgl.Vector3(0,0,0),this.temp2=new h.webgl.Vector3(0,0,0)},getAtlasCanvas:function(t){var e=this.cache.get(t);if(e){var i,n=this.spineTextures;if(n.has(t))i=n.get(t);else{var r=this.textures;i=new h.TextureAtlas(e.data,(function(i){return new h.canvas.CanvasTexture(r.get(e.prefix+t+":"+i).getSourceImage())}))}return i}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var i,n=this.spineTextures;if(n.has(t))i=n.get(t);else{var r=this.textures,s=this.sceneRenderer.context.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i=new h.TextureAtlas(e.data,(function(i){return new h.webgl.GLTexture(s,r.get(e.prefix+t+":"+i).getSourceImage(),!1)}))}return i}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,i,n,r,s,a){var o;if(a=a||{},Array.isArray(t))for(var h=0;h{var n=i(7473),r=i(7361),s=i(7738),a=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,n,s){r.call(this,t,i,n,s),this.type="Spine",this.plugin=e},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null,this.plugin=null}});t.exports=a},7738:(t,e,i)=>{var n=i(1984),r=i(1984);n=i(434),t.exports={renderWebGL:n,renderCanvas:r}},434:t=>{t.exports=function(t,e,i,n){var r=e.plugin.sceneRenderer,s=e.list;if(0!==s.length){i.addToRenderList(e);var a=e.localTransform;n?(a.loadIdentity(),a.multiply(n),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.newType&&(t.pipelines.clear(),r.begin());var o=t.nextTypeMatch;t.nextTypeMatch=!0,t.newType=!1;for(var h=0;h{t.exports="complete"},8621:t=>{t.exports="dispose"},8944:t=>{t.exports="end"},7494:t=>{t.exports="event"},1908:t=>{t.exports="interrupted"},5591:t=>{t.exports="start"},5146:(t,e,i)=>{t.exports={COMPLETE:i(6576),DISPOSE:i(8621),END:i(8944),EVENT:i(7494),INTERRUPTED:i(1908),START:i(5591)}},8332:(t,e,i)=>{var n=i(6412),r=i(2915),s=i(7473),a=i(1991),o=i(3131),h=i(9660),l=i(4627),u=i(3212),c=i(8414),d=i(3426),f=i(7149),p=i(2273),v=i(4208),g=i(5146),m=i(2762),M=new s({Extends:p,Mixins:[a,o,h,l,u,c,m],initialize:function(t,e,i,n,r,s,a){p.call(this,t,"Spine"),this.plugin=e,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null,this.root=null,this.bounds=null,this.drawDebug=!1,this.timeScale=1,this.displayOriginX=0,this.displayOriginY=0,this.preMultipliedAlpha=!1,this.blendMode=-1,this.setPosition(i,n),r&&this.setSkeleton(r,s,a)},willRender:function(t,e){var i=!this.skeleton||!(15!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id);if(!e&&!i&&this.parentContainer){var n=this.plugin,r=n.sceneRenderer;n.gl&&r.batcher.isDrawing&&(r.end(),n.renderer.pipelines.rebind())}return i},setAlpha:function(t,e){if(void 0===t&&(t=1),e){var i=this.findSlot(e);i&&(i.color.a=r(t,0,1))}else this.alpha=t;return this},alpha:{get:function(){return this.skeleton.color.a},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.a=e),0===e?this.renderFlags&=-3:this.renderFlags|=2}},red:{get:function(){return this.skeleton.color.r},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.r=e)}},green:{get:function(){return this.skeleton.color.g},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.g=e)}},blue:{get:function(){return this.skeleton.color.b},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.b=e)}},setColor:function(t,e){void 0===t&&(t=16777215);var i=(t>>16&255)/255,n=(t>>8&255)/255,r=(255&t)/255,s=t>16777215?(t>>>24)/255:null,a=this.skeleton;if(e){var o=this.findSlot(e);o&&(a=o)}return a.color.r=i,a.color.g=n,a.color.b=r,null!==s&&(a.color.a=s),this},setSkeletonFromJSON:function(t,e,i,n){return this.setSkeleton(t,e,i,n)},setSkeleton:function(t,e,i,n){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,n);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkin(),s.setToSetupPose(),this.skeleton=s,r=this.plugin.createAnimationState(s),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=v(d(this.rotation))+90),this.state.apply(s),s.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=v(d(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,n){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===i&&(i=0),void 0===n&&(n=0),this.width=t,this.height=e,this.displayOriginX=r.x-i,this.displayOriginY=r.y-n,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,n=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=i,t.scaleY=n,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i{var n=i(1984),r=i(1984),s=i(1984);n=i(4290),s=i(780),t.exports={renderWebGL:n,renderCanvas:r,renderDirect:s}},780:(t,e,i)=>{var n=i(2915),r=i(3426),s=i(2208),a=i(4208),o=i(8445);t.exports=function(t,e,i,h,l){var u=e.plugin,c=e.skeleton,d=u.sceneRenderer;t.pipelines.clear(),d.begin();var f=e.scrollFactorX,p=e.scrollFactorY,v=c.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,c.color.a=n(v*l.alpha,0,1)),i.addToRenderList(e);var g=s(e,i,h).calc,m=t.height;if(c.x=g.tx,c.y=m-g.ty,c.scaleX=g.scaleX,c.scaleY=g.scaleY,e.scaleX<0?(c.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(r(g.rotationNormalized))+90,0,360),e.scaleY<0&&(c.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),c.updateWorldTransform(),d.drawSkeleton(c,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,c.color.a=v),u.drawDebug||e.drawDebug){var M=c.x,x=c.y;c.x=0,c.y=0,d.drawSkeletonDebug(c,e.preMultipliedAlpha),c.x=M,c.y=x}d.end(),t.pipelines.rebind()}},4290:(t,e,i)=>{var n=i(2915),r=i(3426),s=i(2208),a=i(4208),o=i(8445);t.exports=function(t,e,i,h,l){var u=e.plugin,c=e.skeleton,d=u.sceneRenderer;t.newType&&(t.pipelines.clear(),d.begin());var f=e.scrollFactorX,p=e.scrollFactorY,v=c.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,c.color.a=n(v*l.alpha,0,1)),i.addToRenderList(e);var g=s(e,i,h).calc,m=t.height;if(c.x=g.tx,c.y=m-g.ty,c.scaleX=g.scaleX,c.scaleY=g.scaleY,e.scaleX<0?(c.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(r(g.rotationNormalized))+90,0,360),e.scaleY<0&&(c.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),c.updateWorldTransform(),d.drawSkeleton(c,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,c.color.a=v),u.drawDebug||e.drawDebug){var M=c.x,x=c.y;c.x=0,c.y=0,d.drawSkeletonDebug(c,e.preMultipliedAlpha),c.x=M,c.y=x,d.end(),t.pipelines.rebind()}else t.nextTypeMatch||(d.end(),t.pipelines.rebind())}},9454:(t,e,i)=>{var n={VERSION:"3.60.0-beta.20",BlendModes:i(8351),ScaleModes:i(8196),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},1081:(t,e,i)=>{var n=i(7473),r=i(6748),s=new n({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(r.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n{t.exports="changedata"},7801:t=>{t.exports="changedata-"},4873:t=>{t.exports="destroy"},9966:t=>{t.exports="removedata"},4586:t=>{t.exports="setdata"},6748:(t,e,i)=>{t.exports={CHANGE_DATA:i(9044),CHANGE_DATA_KEY:i(7801),DESTROY:i(4873),REMOVE_DATA:i(9966),SET_DATA:i(4586)}},3004:(t,e,i)=>{var n=i(2776),r={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return r;r.audioData=!!window.Audio,r.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var n=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(n||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(n)};if(r.ogg=i('ogg; codecs="vorbis"'),r.opus=i('ogg; codecs="opus"',"opus"),r.mp3=i("mpeg"),r.wav=i("wav"),r.m4a=i("x-m4a"),r.aac=i("aac"),r.flac=i("flac","x-flac"),r.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(n.edge)r.dolby=!0;else if(n.safari&&n.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var s=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===s&&a>=11||s>10)&&(r.dolby=!0)}}}catch(t){}return r}()},2776:(t,e,i)=>{var n,r=i(5203),s={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(n=navigator.userAgent,/Edg\/\d+/.test(n)?(s.edge=!0,s.es2019=!0):/OPR/.test(n)?(s.opera=!0,s.es2019=!0):/Chrome\/(\d+)/.test(n)&&!r.windowsPhone?(s.chrome=!0,s.chromeVersion=parseInt(RegExp.$1,10),s.es2019=s.chromeVersion>69):/Firefox\D+(\d+)/.test(n)?(s.firefox=!0,s.firefoxVersion=parseInt(RegExp.$1,10),s.es2019=s.firefoxVersion>10):/AppleWebKit/.test(n)&&r.iOS?s.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(s.ie=!0,s.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+) Safari/.test(n)&&!r.windowsPhone?(s.safari=!0,s.safariVersion=parseInt(RegExp.$1,10),s.es2019=s.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(s.ie=!0,s.trident=!0,s.tridentVersion=parseInt(RegExp.$1,10),s.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(s.silk=!0),s)},6505:(t,e,i)=>{var n,r,s,a=i(8073),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",r="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(s=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(s,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+r},s.src=n+"AP804Oa6"+r,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),n=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),n}()),o)},6543:(t,e,i)=>{var n=i(5203),r=i(2776),s=i(8073),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=s.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=s.create2D(this),n=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=n.data instanceof Uint8ClampedArray,s.remove(t),s.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!n.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},3922:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",n="FullScreen",r=["request"+i,"request"+n,"webkitRequest"+i,"webkitRequest"+n,"msRequest"+i,"msRequest"+n,"mozRequest"+n,"mozRequest"+i];for(t=0;t{var n=i(2776),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||n.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":n.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},5203:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},2131:t=>{var e={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=document.createElement("video"),i=!!t.canPlayType,n=/^no$/;try{i&&(t.canPlayType('video/ogg; codecs="theora"').replace(n,"")&&(e.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(n,"")&&(e.h264=!0,e.mp4=!0),t.canPlayType("video/x-m4v").replace(n,"")&&(e.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(n,"")&&(e.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(n,"")&&(e.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(n,"")&&(e.hls=!0))}catch(t){}return e}()},9356:(t,e,i)=>{t.exports={os:i(5203),browser:i(2776),features:i(6543),input:i(1454),audio:i(3004),video:i(2131),fullscreen:i(3922),canvasFeatures:i(6505)}},5686:(t,e,i)=>{var n=i(7473),r=new Float32Array(20),s=new n({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(t){return this._matrix.set(t),this._dirty=!0,this},reset:function(){var t=this._matrix;return t.fill(0),t[0]=1,t[6]=1,t[12]=1,t[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var t=this._data;return this._dirty&&(t.set(this._matrix),t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._dirty=!1),t},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,n=-.5*(i-1);return this.multiply([i,n,n,0,0,n,i,n,0,0,n,n,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),n=Math.sin(t),r=.213,s=.715,a=.072;return this.multiply([r+.787*i+n*-r,s+i*-s+n*-s,a+i*-a+.928*n,0,0,r+i*-r+.143*n,s+i*(1-s)+.14*n,a+i*-a+-.283*n,0,0,r+i*-r+-.787*n,s+i*-s+n*s,a+.928*i+n*a,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply(s.BLACK_WHITE,t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,n=-.5*(i-1);return this.multiply([i,0,0,0,n,0,i,0,0,n,0,0,i,0,n,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply(s.NEGATIVE,t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply(s.DESATURATE_LUMINANCE,t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply(s.SEPIA,t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply(s.LSD,t)},brown:function(t){return void 0===t&&(t=!1),this.multiply(s.BROWN,t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply(s.VINTAGE,t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply(s.KODACHROME,t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply(s.TECHNICOLOR,t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply(s.POLAROID,t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply(s.SHIFT_BGR,t)},multiply:function(t,e){void 0===e&&(e=!1),e||this.reset();var i=this._matrix,n=r;return n.set(i),i.set([n[0]*t[0]+n[1]*t[5]+n[2]*t[10]+n[3]*t[15],n[0]*t[1]+n[1]*t[6]+n[2]*t[11]+n[3]*t[16],n[0]*t[2]+n[1]*t[7]+n[2]*t[12]+n[3]*t[17],n[0]*t[3]+n[1]*t[8]+n[2]*t[13]+n[3]*t[18],n[0]*t[4]+n[1]*t[9]+n[2]*t[14]+n[3]*t[19]+n[4],n[5]*t[0]+n[6]*t[5]+n[7]*t[10]+n[8]*t[15],n[5]*t[1]+n[6]*t[6]+n[7]*t[11]+n[8]*t[16],n[5]*t[2]+n[6]*t[7]+n[7]*t[12]+n[8]*t[17],n[5]*t[3]+n[6]*t[8]+n[7]*t[13]+n[8]*t[18],n[5]*t[4]+n[6]*t[9]+n[7]*t[14]+n[8]*t[19]+n[9],n[10]*t[0]+n[11]*t[5]+n[12]*t[10]+n[13]*t[15],n[10]*t[1]+n[11]*t[6]+n[12]*t[11]+n[13]*t[16],n[10]*t[2]+n[11]*t[7]+n[12]*t[12]+n[13]*t[17],n[10]*t[3]+n[11]*t[8]+n[12]*t[13]+n[13]*t[18],n[10]*t[4]+n[11]*t[9]+n[12]*t[14]+n[13]*t[19]+n[14],n[15]*t[0]+n[16]*t[5]+n[17]*t[10]+n[18]*t[15],n[15]*t[1]+n[16]*t[6]+n[17]*t[11]+n[18]*t[16],n[15]*t[2]+n[16]*t[7]+n[17]*t[12]+n[18]*t[17],n[15]*t[3]+n[16]*t[8]+n[17]*t[13]+n[18]*t[18],n[15]*t[4]+n[16]*t[9]+n[17]*t[14]+n[18]*t[19]+n[19]]),this._dirty=!0,this}});s.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],s.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],s.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],s.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],s.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],s.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],s.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],s.KODACHROME=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],s.TECHNICOLOR=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],s.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],s.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t.exports=s},8073:(t,e,i)=>{var n,r,s,a=i(9454),o=i(2150),h=[],l=!1;t.exports=(s=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return n(t,e,i,a.CANVAS)},create:n=function(t,e,i,n,s){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=a.CANVAS),void 0===s&&(s=!1);var c=r(n);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:n},n===a.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),s&&(c.parent=u),u.width=e,u.height=i,l&&n===a.CANVAS&&o.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return n(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:r=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{var n=i(7473),r=i(3649),s=new n({initialize:function(t,e,i,n,r,s){e||(e=t.sys.make.image({x:i,y:n,key:r,frame:s,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});r.register("bitmapMask",(function(t,e,i,n,r){return new s(this.scene,t,e,i,n,r)})),t.exports=s},6726:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var n=t.gl;t.flush(),0===t.maskStack.length&&(n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var n=t.gl,r=this.geometryMask,s=t.maskCount,a=255;n.colorMask(!1,!1,!1,!1),i?(n.stencilFunc(n.EQUAL,s,a),n.stencilOp(n.KEEP,n.KEEP,n.INCR),s++):(n.stencilFunc(n.EQUAL,s+1,a),n.stencilOp(n.KEEP,n.KEEP,n.DECR)),this.level=s,r.renderWebGL(t,r,e),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),this.invertAlpha?n.stencilFunc(n.NOTEQUAL,s,a):n.stencilFunc(n.EQUAL,s,a)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var n=t.maskStack[t.maskStack.length-1];n.mask.applyStencil(t,n.camera,!1),t.currentCameraMask.mask!==n.mask?(i.mask=n.mask,i.camera=n.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},8325:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,s.BARREL,t),this.amount=e}});t.exports=a},5170:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h){void 0===i&&(i=1),void 0===n&&(n=1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=4),r.call(this,s.BLOOM,t),this.steps=h,this.offsetX=i,this.offsetY=n,this.blurStrength=a,this.strength=o,this.glcolor=[1,1,1],null!=e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4199:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h){void 0===e&&(e=0),void 0===i&&(i=2),void 0===n&&(n=2),void 0===a&&(a=1),void 0===h&&(h=4),r.call(this,s.BLUR,t),this.quality=0,this.x=i,this.y=n,this.steps=h,this.strength=a,this.glcolor=[1,1,1],null!=o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},3132:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===n&&(n=.2),void 0===a&&(a=!1),void 0===o&&(o=1),void 0===h&&(h=1),void 0===l&&(l=1),r.call(this,s.BOKEH,t),this.radius=e,this.amount=i,this.contrast=n,this.isTiltShift=a,this.strength=l,this.blurX=o,this.blurY=h}});t.exports=a},6610:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o){void 0===e&&(e=8),void 0===a&&(a=1),void 0===o&&(o=.005),r.call(this,s.CIRCLE,t),this.scale=a,this.feather=o,this.thickness=e,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],null!=i&&(this.color=i),null!=n&&(this.backgroundColor=n)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundColor:{get:function(){var t=this.glcolor2;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor2;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4931:(t,e,i)=>{var n=i(7473),r=i(5686),s=i(1571),a=new n({Extends:r,initialize:function(t){r.call(this),this.type=s.COLOR_MATRIX,this.gameObject=t,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});t.exports=a},6128:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e){this.type=t,this.gameObject=e,this.active=!0},destroy:function(){this.gameObject=null,this.active=!1}});t.exports=n},9195:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===n&&(n=.005),r.call(this,s.DISPLACEMENT,t),this.x=i,this.y=n,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.gameObject.scene.sys.textures.getFrame(t);e&&(this.glTexture=e.glTexture)}});t.exports=a},445:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===i&&(i=4),void 0===n&&(n=0),void 0===a&&(a=!1),r.call(this,s.GLOW,t),this.outerStrength=i,this.innerStrength=n,this.knockout=a,this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},7724:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l,u){void 0===n&&(n=.2),void 0===a&&(a=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l=1),void 0===u&&(u=0),r.call(this,s.GRADIENT,t),this.alpha=n,this.size=u,this.fromX=a,this.fromY=o,this.toX=h,this.toY=l,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],null!=e&&(this.color1=e),null!=i&&(this.color2=i)},color1:{get:function(){var t=this.glcolor1;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor1;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}},color2:{get:function(){var t=this.glcolor2;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor2;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}}});t.exports=a},4412:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,s.PIXELATE,t),this.amount=e}});t.exports=a},75:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=.1),void 0===a&&(a=1),void 0===h&&(h=6),void 0===l&&(l=1),r.call(this,s.SHADOW,t),this.x=e,this.y=i,this.decay=n,this.power=a,this.glcolor=[0,0,0,1],this.samples=h,this.intensity=l,void 0!==o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},8734:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===n&&(n=3),void 0===a&&(a=!1),r.call(this,s.SHINE,t),this.speed=e,this.lineWidth=i,this.gradient=n,this.reveal=a}});t.exports=a},2437:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===a&&(a=.5),r.call(this,s.VIGNETTE,t),this.x=e,this.y=i,this.radius=n,this.strength=a}});t.exports=a},5984:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=!1),r.call(this,s.WIPE,t),this.progress=0,this.wipeWidth=e,this.direction=i,this.axis=n,this.reveal=a}});t.exports=a},1571:t=>{t.exports={GLOW:4,SHADOW:5,PIXELATE:6,VIGNETTE:7,SHINE:8,BLUR:9,GRADIENT:12,BLOOM:13,COLOR_MATRIX:14,CIRCLE:15,BARREL:16,DISPLACEMENT:17,WIPE:18,BOKEH:19}},7347:(t,e,i)=>{var n=i(1030),r=i(1571),s={Barrel:i(8325),Controller:i(6128),Bloom:i(5170),Blur:i(4199),Bokeh:i(3132),Circle:i(6610),ColorMatrix:i(4931),Displacement:i(9195),Glow:i(445),Gradient:i(7724),Pixelate:i(4412),Shadow:i(75),Shine:i(8734),Vignette:i(2437),Wipe:i(5984)};s=n(!1,s,r),t.exports=s},2494:(t,e,i)=>{var n=i(8351),r=i(8361);t.exports=function(t,e,i){e.x=r(i,"x",0),e.y=r(i,"y",0),e.depth=r(i,"depth",0),e.flipX=r(i,"flipX",!1),e.flipY=r(i,"flipY",!1);var s=r(i,"scale",null);"number"==typeof s?e.setScale(s):null!==s&&(e.scaleX=r(s,"x",1),e.scaleY=r(s,"y",1));var a=r(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=r(a,"x",1),e.scrollFactorY=r(a,"y",1)),e.rotation=r(i,"rotation",0);var o=r(i,"angle",null);null!==o&&(e.angle=o),e.alpha=r(i,"alpha",1);var h=r(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),u=r(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=r(i,"blendMode",n.NORMAL),e.visible=r(i,"visible",!0),r(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},2273:(t,e,i)=>{var n=i(7473),r=i(6125),s=i(1081),a=i(4399),o=i(3389),h=i(204),l=new n({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new s(this)),this},setData:function(t,e){return this.data||(this.data=new s(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new s(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new s(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new s(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.preFX&&(this.preFX.destroy(),this.preFX=void 0),this.postFX&&(this.postFX.destroy(),this.postFX=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},3649:(t,e,i)=>{var n=i(7473),r=i(8456),s=i(204),a=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(s.BOOT,this.boot,this),this.events.on(s.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(s.DESTROY,this.destroy,this)},start:function(){this.events.once(s.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(s.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(s.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectFactory",a,"add"),t.exports=a},2208:(t,e,i)=>{var n=i(4227),r=new n,s=new n,a=new n,o={camera:r,sprite:s,calc:a};t.exports=function(t,e,i){var n=r,h=s,l=a;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),n.multiply(h,l),o}},4344:(t,e,i)=>{var n=i(2915),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,r){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=r},4518:(t,e,i)=>{var n=i(2915),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=r},5173:(t,e,i)=>{var n=i(8351),r={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=r},1991:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},8305:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},3131:t=>{var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},1626:(t,e,i)=>{var n=i(7473),r=i(7347),s=i(8935),a=new n({initialize:function(t,e){this.gameObject=t,this.isPost=e,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(t){return void 0===t&&(t=0),this.padding=t,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(t){var e=this.gameObject.scene.sys.renderer;e&&e.pipelines?(this.gameObject.pipeline=e.pipelines.FX_PIPELINE,void 0!==t&&(this.padding=t),this.enabled=!0):this.enabled=!1},clear:function(){for(var t=this.list,e=0;e{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},3671:(t,e,i)=>{var n=i(1392),r=i(9876),s=i(2529),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&r(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t){return void 0===t&&(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,r,s,a,o,h,l;if(void 0===t&&(t=new n),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),r=t.x,s=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),r=t.x,s=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,r,a,h),t.y=Math.min(i,s,o,l),t.width=Math.max(e,r,a,h)-t.x,t.height=Math.max(i,s,o,l)-t.y,t}};t.exports=a},2246:(t,e,i)=>{var n=i(7499),r=i(6726),s={mask:null,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},createBitmapMask:function(t,e,i,r,s){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new n(this.scene,t,e,i,r,s)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new r(this.scene,t)}};t.exports=s},5085:t=>{var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},77:(t,e,i)=>{var n=i(7149),r=i(1864),s=i(5851),a=i(3747),o=i(2529),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=s(t,"from",0),t.to=s(t,"to",1);var h=r(t,"positionOnPath",!1);this.rotateToPath=r(t,"rotateToPath",!1),this.pathRotationOffset=s(t,"rotationOffset",0);var l=s(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+n(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,r=this.pathVector;if(i.copy(r).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,r),i.add(r),r.add(this.pathOffset),void this.setPosition(r.x,r.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),r),i.add(r),r.add(this.pathOffset);var s=this.x,o=this.y;this.setPosition(r.x,r.y);var h=this.x-s,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+n(this.pathRotationOffset))}}};t.exports=h},986:(t,e,i)=>{var n=i(3911),r={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(t){this.pipelineData={};var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(i){void 0===t&&(t=i.default);var n=i.get(t);if(n)return this.defaultPipeline=n,this.pipeline=n,!0}return!1},setPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){var a=s.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?n(e):e)}return this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},resetPipeline:function(t){return void 0===t&&(t=!1),this.pipeline=this.defaultPipeline,t&&(this.pipelineData={}),null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=r},4461:(t,e,i)=>{var n=i(3911),r=i(1626),s=i(8935),a={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(t){this.postPipelines=[],this.postPipelineData={},this.postFX=new r(this,!0),t&&(this.preFX=new r(this,!1))},setPostPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){Array.isArray(t)||(t=[t]);for(var a=0;a0,this},setPostPipelineData:function(t,e){var i=this.postPipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,n=[],r=0;r=0;i--){var n=e[i];("string"==typeof t&&n.name===t||"string"!=typeof t&&n instanceof t)&&(n.destroy(),s(e,i))}return this.hasPostPipeline=this.postPipelines.length>0,this}};t.exports=a},4627:t=>{var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},1868:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},4976:(t,e,i)=>{var n=i(2362),r={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof n?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=r},9243:(t,e,i)=>{var n=i(2362),r={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof n?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=r},5693:t=>{var e={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,n){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,n=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=n,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=e},6125:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},3212:(t,e,i)=>{var n=i(7425),r=i(4227),s=i(7556),a=i(3692),o=i(2820),h=i(2529),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:0!==this._scaleY&&(this.renderFlags|=4)}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:0!==this._scaleX&&(this.renderFlags|=4)}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(e||(e=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,n){i||(i=new h),n||(n=this.scene.sys.cameras.main);var r=n.scrollX,a=n.scrollY,o=t+r*this.scrollFactorX-r,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):s(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},4227:(t,e,i)=>{var n=i(7473),r=i(7425),s=i(2529),a=new n({initialize:function(t,e,i,n,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),this.matrix=new Float32Array([t,e,i,n,r,s,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):n||s?r.TAU-(s>0?Math.acos(-n/this.scaleY):-Math.acos(n/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,r=n[0],s=n[1],a=n[2],o=n[3];return n[0]=r*i+a*e,n[1]=s*i+o*e,n[2]=r*-e+a*i,n[3]=s*-e+o*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,r=i[0],s=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],v=n[5],g=void 0===e?i:e.matrix;return g[0]=u*r+c*a,g[1]=u*s+c*o,g[2]=d*r+f*a,g[3]=d*s+f*o,g[4]=p*r+v*a+h,g[5]=p*s+v*o+l,g},multiplyWithOffset:function(t,e,i){var n=this.matrix,r=t.matrix,s=n[0],a=n[1],o=n[2],h=n[3],l=e*s+i*o+n[4],u=e*a+i*h+n[5],c=r[0],d=r[1],f=r[2],p=r[3],v=r[4],g=r[5];return n[0]=c*s+d*o,n[1]=c*a+d*h,n[2]=f*s+p*o,n[3]=f*a+p*h,n[4]=v*s+g*o+l,n[5]=v*a+g*h+u,this},transform:function(t,e,i,n,r,s){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+n*l,a[3]=i*h+n*u,a[4]=r*o+s*l+c,a[5]=r*h+s*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,r=n[0],s=n[1],a=n[2],o=n[3],h=n[4],l=n[5];return i.x=t*r+e*a+h,i.y=t*s+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=e*r-i*n;return t[0]=r/o,t[1]=-i/o,t[2]=-n/o,t[3]=e/o,t[4]=(n*a-r*s)/o,t[5]=-(e*a-i*s)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,r,s){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=n,a[4]=r,a[5]=s,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],r=e[2],s=e[3],a=i*s-n*r;if(t.translateX=e[4],t.translateY=e[5],i||n){var o=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(r||s){var h=Math.sqrt(r*r+s*s);t.rotation=.5*Math.PI-(s>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,n,r){var s=this.matrix,a=Math.sin(i),o=Math.cos(i);return s[4]=t,s[5]=e,s[0]=o*n,s[1]=a*n,s[2]=-a*r,s[3]=o*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],a=n[1],o=n[2],h=n[3],l=n[4],u=n[5],c=1/(r*h+o*-a);return i.x=h*c*t+-o*c*e+(u*o-l*h)*c,i.y=r*c*e+-a*c*t+(-u*r+l*a)*c,i},setQuad:function(t,e,i,n,r,s){void 0===s&&(s=this.quad);var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return s[0]=t*o+e*l+c,s[1]=t*h+e*u+d,s[2]=t*o+n*l+c,s[3]=t*h+n*u+d,s[4]=i*o+n*l+c,s[5]=i*h+n*u+d,s[6]=i*o+e*l+c,s[7]=i*h+e*u+d,r&&s.forEach((function(t,e){s[e]=Math.round(t)})),s},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var n=this.getX(t,e);return i&&(n=Math.round(n)),n},getYRound:function(t,e,i){var n=this.getY(t,e);return i&&(n=Math.round(n)),n},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},8414:t=>{var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},4286:(t,e,i)=>{t.exports={Alpha:i(4344),AlphaSingle:i(4518),BlendMode:i(5173),ComputedSize:i(1991),Crop:i(8305),Depth:i(3131),Flip:i(9660),FX:i(1626),GetBounds:i(3671),Mask:i(2246),Origin:i(5085),PathFollower:i(77),Pipeline:i(986),PostPipeline:i(4461),ScrollFactor:i(4627),Size:i(1868),Texture:i(4976),TextureCrop:i(9243),Tint:i(5693),ToJSON:i(6125),Transform:i(3212),TransformMatrix:i(4227),Visible:i(8414)}},7361:(t,e,i)=>{var n=i(1953),r=i(8351),s=i(7473),a=i(4286),o=i(3389),h=i(2273),l=i(1392),u=i(3232),c=i(9422),d=i(2529),f=new s({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.PostPipeline,a.Transform,a.Visible,u],initialize:function(t,e,i,n){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(e,i),this.setBlendMode(r.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,n=new l,r=!1;t.setEmpty();for(var s=0;s-1},setAll:function(t,e,i,r){return n.SetAll(this.list,t,e,i,r),this},each:function(t,e){var i,n=[null],r=this.list.slice(),s=r.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},3232:(t,e,i)=>{var n=i(1984),r=n,s=n;r=i(4343),t.exports={renderWebGL:r,renderCanvas:s}},4343:t=>{t.exports=function(t,e,i,n){i.addToRenderList(e);var r=e.list,s=r.length;if(0!==s){var a=e.localTransform;n?(a.loadIdentity(),a.multiply(n),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var o=-1!==e.blendMode;o||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c{t.exports="addedtoscene"},4265:t=>{t.exports="destroy"},8671:t=>{t.exports="removedfromscene"},3420:t=>{t.exports="complete"},601:t=>{t.exports="created"},7919:t=>{t.exports="error"},5241:t=>{t.exports="loop"},3356:t=>{t.exports="play"},7513:t=>{t.exports="seeked"},5788:t=>{t.exports="seeking"},8118:t=>{t.exports="stop"},5529:t=>{t.exports="timeout"},4287:t=>{t.exports="unlocked"},3389:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(6608),DESTROY:i(4265),REMOVED_FROM_SCENE:i(8671),VIDEO_COMPLETE:i(3420),VIDEO_CREATED:i(601),VIDEO_ERROR:i(7919),VIDEO_LOOP:i(5241),VIDEO_PLAY:i(3356),VIDEO_SEEKED:i(7513),VIDEO_SEEKING:i(5788),VIDEO_STOP:i(8118),VIDEO_TIMEOUT:i(5529),VIDEO_UNLOCKED:i(4287)}},1643:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},8881:(t,e,i)=>{var n=i(7655);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},4479:(t,e,i)=>{var n=i(4771),r=i(7655);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=n(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;u{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},284:(t,e,i)=>{var n=i(7473),r=i(8881),s=i(4479),a=i(1643),o=i(3915),h=i(2529),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=n},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return s(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},3915:(t,e,i)=>{var n=i(7655);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},7655:(t,e,i)=>{var n=i(7473),r=i(1643),s=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=r.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=s},5956:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},716:(t,e,i)=>{var n=i(7120),r=i(7655);t.exports=function(t,e,i){if(void 0===i&&(i=new r),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var s=n(t)*e;return e>.5?(s-=t.width+t.height)<=t.width?(i.x=t.right-s,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(s-t.width)):s<=t.width?(i.x=t.x+s,i.y=t.y):(i.x=t.right,i.y=t.y+(s-t.width)),i}},8151:(t,e,i)=>{var n=i(716),r=i(7120);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=r(t)/i);for(var a=0;a{t.exports=function(t){return 2*(t.width+t.height)}},2161:(t,e,i)=>{var n=i(7655);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},1392:(t,e,i)=>{var n=i(7473),r=i(5956),s=i(716),a=i(8151),o=i(1643),h=i(284),l=i(2161),u=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},9422:(t,e,i)=>{var n=i(1392);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=Math.min(t.x,e.x),s=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-r,o=Math.max(t.bottom,e.bottom)-s;return i.setTo(r,s,a,o)}},1593:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1179),a=i(4597),o=i(5593),h=i(7410),l=i(5874),u=i(707),c=new n({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var n=a(e,"url");void 0===n?n=t.path+i+"."+a(e,"extension",""):"string"!=typeof n||n.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(n=t.path+n),this.url=n,this.src="",this.xhrSettings=u(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===r.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=r.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,n=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(n=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,n)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(s.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==r.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(s.FILE_COMPLETE,e,i,t),this.loader.emit(s.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=r.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},9845:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},5593:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},7410:(t,e,i)=>{var n=i(1030),r=i(707);t.exports=function(t,e){var i=void 0===t?r():n({},t);if(e)for(var s in e)void 0!==e[s]&&(i[s]=e[s]);return i}},3137:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1179),a=new n({initialize:function(t,e,i,n){var s=[];n.forEach((function(t){t&&s.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=s,this.state=r.FILE_PENDING,this.complete=!1,this.pending=s.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a{var n=i(7410);t.exports=function(t,e){var i=n(e,t.xhrSettings),r=new XMLHttpRequest;if(r.open("GET",t.src,i.async,i.user,i.password),r.responseType=t.xhrSettings.responseType,r.timeout=i.timeout,i.headers)for(var s in i.headers)r.setRequestHeader(s,i.headers[s]);return i.header&&i.headerValue&&r.setRequestHeader(i.header,i.headerValue),i.requestedWith&&r.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&r.overrideMimeType(i.overrideMimeType),i.withCredentials&&(r.withCredentials=!0),r.onload=t.onLoad.bind(t,r),r.onerror=t.onError.bind(t,r),r.onprogress=t.onProgress.bind(t),r.send(),r}},707:t=>{t.exports=function(t,e,i,n,r,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=0),void 0===s&&(s=!1),{responseType:t,async:e,user:i,password:n,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:s}}},4359:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},462:t=>{t.exports="addfile"},7297:t=>{t.exports="complete"},8660:t=>{t.exports="filecomplete"},6484:t=>{t.exports="filecomplete-"},7972:t=>{t.exports="loaderror"},1906:t=>{t.exports="load"},1441:t=>{t.exports="fileprogress"},1072:t=>{t.exports="postprocess"},1927:t=>{t.exports="progress"},6597:t=>{t.exports="start"},1179:(t,e,i)=>{t.exports={ADD:i(462),COMPLETE:i(7297),FILE_COMPLETE:i(8660),FILE_KEY_COMPLETE:i(6484),FILE_LOAD_ERROR:i(7972),FILE_LOAD:i(1906),FILE_PROGRESS:i(1441),POST_PROCESS:i(1072),PROGRESS:i(1927),START:i(6597)}},6732:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(2482),l=i(5593),u=new n({Extends:s,initialize:function t(e,i,n,r,a){var l,u="png";if(h(i)){var c=i;i=o(c,"key"),n=o(c,"url"),l=o(c,"normalMap"),r=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"frameConfig")}Array.isArray(n)&&(l=n[1],n=n[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:n,xhrSettings:r,config:a};if(s.call(this,e,d),l){var f=new t(e,this.key,l,r,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){s.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){s.revokeObjectURL(t.data),t.onProcessError()},s.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=r.FILE_PROCESSING,t===r.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=r.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=r.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t?t.state>=r.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var n=0;n{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(5851),l=i(2482),u=new n({Extends:s,initialize:function(t,e,i,n,a){var u="json";if(l(e)){var c=e;e=o(c,"key"),i=o(c,"url"),n=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:a};s.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=r.FILE_POPULATED)},onProcess:function(){if(this.state!==r.FILE_POPULATED){this.state=r.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(2482),l=new n({Extends:s,initialize:function(t,e,i,n){var r="text",a="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),n=o(u,"xhrSettings"),a=o(u,"extension",a),r=o(u,"type",r),l=o(u,"cache",l)}var c={type:r,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var n=0;n{t.exports=function(t){for(var e=0,i=0;i{var n=i(3916);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},7025:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},48:t=>{t.exports=function(t,e,i,n,r){var s=.5*(n-e),a=.5*(r-i),o=t*t;return(2*i-2*n+s+a)*(t*o)+(-3*i+3*n-2*s-a)*o+s*t+i}},5035:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},2915:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},7149:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t*n.DEG_TO_RAD}},2975:t=>{t.exports=function(t,e){return Math.abs(t-e)}},2107:(t,e,i)=>{var n=i(2915),r=i(7473),s=i(9652),a=i(1984),o=new s,h=new r({initialize:function t(e,i,n,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=t.DefaultOrder),this._x=e,this._y=i,this._z=n,this._order=r,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,n){return void 0===n&&(n=this._order),this._x=t,this._y=e,this._z=i,this._order=n,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var r=t.val,s=r[0],a=r[4],o=r[8],h=r[1],l=r[5],u=r[9],c=r[2],d=r[6],f=r[10],p=0,v=0,g=0,m=.99999;switch(e){case"XYZ":v=Math.asin(n(o,-1,1)),Math.abs(o){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},104:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},4941:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},1555:(t,e,i)=>{var n=i(2915);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))+e}},5005:t=>{t.exports=function(t,e){return t/e/1e3}},3702:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},8820:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},1743:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},3416:t=>{t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},2149:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*s-a*h,c=-l*r+a*o,d=h*r-s*o,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(a*i-n*s)*f,t[3]=c*f,t[4]=(l*e-n*o)*f,t[5]=(-a*e+n*r)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(s*e-i*r)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=s*l-a*h,t[1]=n*h-i*l,t[2]=i*a-n*s,t[3]=a*o-r*l,t[4]=e*l-n*o,t[5]=n*r-e*a,t[6]=r*h-s*o,t[7]=i*o-e*h,t[8]=e*s-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*s-a*h)+i*(-l*r+a*o)+n*(h*r-s*o)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],v=c[3],g=c[4],m=c[5],M=c[6],x=c[7],y=c[8];return e[0]=d*i+f*s+p*h,e[1]=d*n+f*a+p*l,e[2]=d*r+f*o+p*u,e[3]=v*i+g*s+m*h,e[4]=v*n+g*a+m*l,e[5]=v*r+g*o+m*u,e[6]=M*i+x*s+y*h,e[7]=M*n+x*a+y*l,e[8]=M*r+x*o+y*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*s,e[1]=l*n+h*a,e[2]=l*r+h*o,e[3]=l*s-h*i,e[4]=l*a-h*n,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,r=t.w,s=e+e,a=i+i,o=n+n,h=e*s,l=e*a,u=e*o,c=i*a,d=i*o,f=n*o,p=r*s,v=r*a,g=r*o,m=this.val;return m[0]=1-(c+f),m[3]=l+g,m[6]=u-v,m[1]=l-g,m[4]=1-(h+f),m[7]=d+p,m[2]=u+v,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],v=e[12],g=e[13],m=e[14],M=e[15],x=n*h-r*o,y=n*l-s*o,w=n*u-a*o,E=r*l-s*h,b=r*u-a*h,T=s*u-a*l,A=c*g-d*v,R=c*m-f*v,S=c*M-p*v,C=d*m-f*g,I=d*M-p*g,P=f*M-p*m,L=x*P-y*I+w*C+E*S-b*R+T*A;return L?(L=1/L,i[0]=(h*P-l*I+u*C)*L,i[1]=(l*S-o*P-u*R)*L,i[2]=(o*I-h*S+u*A)*L,i[3]=(s*I-r*P-a*C)*L,i[4]=(n*P-s*S+a*R)*L,i[5]=(r*S-n*I-a*A)*L,i[6]=(g*T-m*b+M*E)*L,i[7]=(m*w-v*T-M*y)*L,i[8]=(v*b-g*w+M*x)*L,this):null}});t.exports=n},9652:(t,e,i)=>{var n=i(7473),r=i(5689),s=1e-6,a=new n({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,n,r,s,a,o,h,l,u,c,d,f,p,v){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=n,g[4]=r,g[5]=s,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=u,g[11]=c,g[12]=d,g[13]=f,g[14]=p,g[15]=v,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var n=o.fromQuat(i).val,r=e.x,s=e.y,a=e.z;return this.setValues(n[0]*r,n[1]*r,n[2]*r,0,n[4]*s,n[5]*s,n[6]*s,0,n[8]*a,n[9]*a,n[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],r=t[6],s=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=n,t[13]=s,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15],m=e*a-i*s,M=e*o-n*s,x=e*h-r*s,y=i*o-n*a,w=i*h-r*a,E=n*h-r*o,b=l*p-u*f,T=l*v-c*f,A=l*g-d*f,R=u*v-c*p,S=u*g-d*p,C=c*g-d*v,I=m*C-M*S+x*R+y*A-w*T+E*b;return I?(I=1/I,this.setValues((a*C-o*S+h*R)*I,(n*S-i*C-r*R)*I,(p*E-v*w+g*y)*I,(c*w-u*E-d*y)*I,(o*A-s*C-h*T)*I,(e*C-n*A+r*T)*I,(v*x-f*E-g*M)*I,(l*E-c*x+d*M)*I,(s*S-a*A+h*b)*I,(i*A-e*S-r*b)*I,(f*w-p*x+g*m)*I,(u*x-l*w-d*m)*I,(a*T-s*R-o*b)*I,(e*R-i*T+n*b)*I,(p*M-f*y-v*m)*I,(l*y-u*M+c*m)*I)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return this.setValues(a*(c*g-d*v)-u*(o*g-h*v)+p*(o*d-h*c),-(i*(c*g-d*v)-u*(n*g-r*v)+p*(n*d-r*c)),i*(o*g-h*v)-a*(n*g-r*v)+p*(n*h-r*o),-(i*(o*d-h*c)-a*(n*d-r*c)+u*(n*h-r*o)),-(s*(c*g-d*v)-l*(o*g-h*v)+f*(o*d-h*c)),e*(c*g-d*v)-l*(n*g-r*v)+f*(n*d-r*c),-(e*(o*g-h*v)-s*(n*g-r*v)+f*(n*h-r*o)),e*(o*d-h*c)-s*(n*d-r*c)+l*(n*h-r*o),s*(u*g-d*p)-l*(a*g-h*p)+f*(a*d-h*u),-(e*(u*g-d*p)-l*(i*g-r*p)+f*(i*d-r*u)),e*(a*g-h*p)-s*(i*g-r*p)+f*(i*h-r*a),-(e*(a*d-h*u)-s*(i*d-r*u)+l*(i*h-r*a)),-(s*(u*v-c*p)-l*(a*v-o*p)+f*(a*c-o*u)),e*(u*v-c*p)-l*(i*v-n*p)+f*(i*c-n*u),-(e*(a*v-o*p)-s*(i*v-n*p)+f*(i*o-n*a)),e*(a*c-o*u)-s*(i*c-n*u)+l*(i*o-n*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return(e*a-i*s)*(c*g-d*v)-(e*o-n*s)*(u*g-d*p)+(e*h-r*s)*(u*v-c*p)+(i*o-n*a)*(l*g-d*f)-(i*h-r*a)*(l*v-c*f)+(n*h-r*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],v=e[13],g=e[14],m=e[15],M=t.val,x=M[0],y=M[1],w=M[2],E=M[3];return e[0]=x*i+y*a+w*u+E*p,e[1]=x*n+y*o+w*c+E*v,e[2]=x*r+y*h+w*d+E*g,e[3]=x*s+y*l+w*f+E*m,x=M[4],y=M[5],w=M[6],E=M[7],e[4]=x*i+y*a+w*u+E*p,e[5]=x*n+y*o+w*c+E*v,e[6]=x*r+y*h+w*d+E*g,e[7]=x*s+y*l+w*f+E*m,x=M[8],y=M[9],w=M[10],E=M[11],e[8]=x*i+y*a+w*u+E*p,e[9]=x*n+y*o+w*c+E*v,e[10]=x*r+y*h+w*d+E*g,e[11]=x*s+y*l+w*f+E*m,x=M[12],y=M[13],w=M[14],E=M[15],e[12]=x*i+y*a+w*u+E*p,e[13]=x*n+y*o+w*c+E*v,e[14]=x*r+y*h+w*d+E*g,e[15]=x*s+y*l+w*f+E*m,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,n=e.val,r=i[0],s=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],f=i[6],p=i[10],v=i[14],g=i[3],m=i[7],M=i[11],x=i[15],y=n[0],w=n[4],E=n[8],b=n[12],T=n[1],A=n[5],R=n[9],S=n[13],C=n[2],I=n[6],P=n[10],L=n[14],O=n[3],_=n[7],k=n[11],F=n[15];return this.setValues(r*y+s*T+a*C+o*O,h*y+l*T+u*C+c*O,d*y+f*T+p*C+v*O,g*y+m*T+M*C+x*O,r*w+s*A+a*I+o*_,h*w+l*A+u*I+c*_,d*w+f*A+p*I+v*_,g*w+m*A+M*I+x*_,r*E+s*R+a*P+o*k,h*E+l*R+u*P+c*k,d*E+f*R+p*P+v*k,g*E+m*R+M*P+x*k,r*b+s*S+a*L+o*F,h*b+l*S+u*L+c*F,d*b+f*S+p*L+v*F,g*b+m*S+M*L+x*F)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var n=this.val;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var n=this.val;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,a=t.y,o=t.z,h=r*s,l=r*a;return this.setValues(h*s+i,h*a-n*o,h*o+n*a,0,h*a+n*o,l*a+i,l*o-n*s,0,h*o-n*a,l*o+n*s,r*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,n=e.x,r=e.y,a=e.z,o=Math.sqrt(n*n+r*r+a*a);if(Math.abs(o){t.exports=function(t,e,i){return Math.min(t+e,i)}},44:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},5385:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},8585:t=>{t.exports=function(t,e,i,n){void 0===i&&(i=e+1);var r=(t-e)/(i-e);return r>1?void 0!==n?(r=(n-t)/(n-i))<0&&(r=0):r=1:r<0&&(r=0),r}},372:(t,e,i)=>{var n=i(7473),r=i(2149),s=i(1984),a=i(5689),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),c=new a(0,1,0),d=new a,f=new r,p=new n({initialize:function(t,e,i,n){this.onChangeCallback=s,this.set(t,e,i,n)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,n,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=n||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=n*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.set(i+e*(t.x-i),n+e*(t.y-n),r+e*(t.z-r),s+e*(t.w-s))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var n=f.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+r*s+i*o-n*a,i*h+r*a+n*s-e*o,n*h+r*o+e*a-i*s,r*h-e*s-i*a-n*o)},slerp:function(t,e){var i=this.x,n=this.y,r=this.z,s=this.w,a=t.x,h=t.y,l=t.z,u=t.w,c=i*a+n*h+r*l+s*u;c<0&&(c=-c,a=-a,h=-h,l=-l,u=-u);var d=1-e,f=e;if(1-c>o){var p=Math.acos(c),v=Math.sin(p);d=Math.sin((1-e)*p)/v,f=Math.sin(e*p)/v}return this.set(d*i+f*a,d*n+f*h,d*r+f*l,d*s+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n,s=r?1/r:0;return this.set(-t*s,-e*s,-i*s,n*s)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a+r*s,i*a+n*s,n*a-i*s,r*a-e*s)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a-n*s,i*a+r*s,n*a+e*s,r*a-i*s)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*s,i*a-e*s,n*a+r*s,r*a-n*s)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,n=t.y/2,r=t.z/2,s=Math.cos(i),a=Math.cos(n),o=Math.cos(r),h=Math.sin(i),l=Math.sin(n),u=Math.sin(r);switch(t.order){case"XYZ":this.set(h*a*o+s*l*u,s*l*o-h*a*u,s*a*u+h*l*o,s*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+s*l*u,s*l*o-h*a*u,s*a*u-h*l*o,s*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-s*l*u,s*l*o+h*a*u,s*a*u+h*l*o,s*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-s*l*u,s*l*o+h*a*u,s*a*u-h*l*o,s*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+s*l*u,s*l*o+h*a*u,s*a*u-h*l*o,s*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-s*l*u,s*l*o-h*a*u,s*a*u+h*l*o,s*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,n=i[0],r=i[4],s=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=n+o+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(s-l)*e,(a-r)*e,.25/e)):n>o&&n>c?(e=2*Math.sqrt(1+n-o-c),this.set(.25*e,(r+a)/e,(s+l)/e,(u-h)/e)):o>c?(e=2*Math.sqrt(1+o-n-c),this.set((r+a)/e,.25*e,(h+u)/e,(s-l)/e)):(e=2*Math.sqrt(1+c-n-o),this.set((s+l)/e,(h+u)/e,.25*e,(a-r)/e)),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var s=h[r],a=h[s];e=Math.sqrt(i[3*r+r]-i[3*s+s]-i[3*a+a]+1),l[r]=.5*e,e=.5/e,l[s]=(i[3*s+r]+i[3*r+s])*e,l[a]=(i[3*a+r]+i[3*r+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+s]-i[3*s+a])*e}return this.onChangeCallback(this),this}});t.exports=p},4208:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t*n.RAD_TO_DEG}},1705:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},6650:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,n=2*Math.random()-1,r=Math.sqrt(1-n*n)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=n*e,t}},2037:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},6283:t=>{t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},9876:t=>{t.exports=function(t,e,i,n){var r=Math.cos(n),s=Math.sin(n),a=t.x-e,o=t.y-i;return t.x=a*r-o*s+e,t.y=a*s+o*r+i,t}},8348:t=>{t.exports=function(t,e,i,n,r){var s=n+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},4497:t=>{t.exports=function(t,e,i,n,r){return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},9640:(t,e,i)=>{var n=i(5689),r=i(9652),s=i(372),a=new r,o=new s,h=new n;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},4078:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},855:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.round(t*n)/n}},4936:t=>{t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var r=[],s=[],a=0;a{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},278:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},163:(t,e,i)=>{var n=i(2529);t.exports=function(t,e,i,r){void 0===r&&(r=new n);var s=0,a=0;return t>0&&t<=e*i&&(s=t>e-1?t-(a=Math.floor(t/e))*e:t),r.set(s,a)}},7556:(t,e,i)=>{var n=i(2529);t.exports=function(t,e,i,r,s,a,o,h){void 0===h&&(h=new n);var l=Math.sin(s),u=Math.cos(s),c=u*a,d=l*a,f=-l*o,p=u*o,v=1/(c*p+f*-d);return h.x=p*v*t+-f*v*e+(r*f-i*p)*v,h.y=c*v*e+-d*v*t+(-r*c+i*d)*v,h}},2529:(t,e,i)=>{var n=i(7473),r=i(12),s=new n({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new s(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return r(this.x,t.x,e)&&r(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});s.ZERO=new s,s.RIGHT=new s(1,0),s.LEFT=new s(-1,0),s.UP=new s(0,-1),s.DOWN=new s(0,1),s.ONE=new s(1,1),t.exports=s},5689:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new n(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=n*o-r*a,this.y=r*s-i*o,this.z=i*a-n*s,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z;return this.x=i*a-n*s,this.y=n*r-e*a,this.z=e*s-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+n*r[6],this.y=e*r[1]+i*r[4]+n*r[7],this.z=e*r[2]+i*r[5]+n*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12],this.y=r[1]*e+r[5]*i+r[9]*n+r[13],this.z=r[2]*e+r[6]*i+r[10]*n+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=e*r[0]+i*r[4]+n*r[8]+r[12],a=e*r[1]+i*r[5]+n*r[9]+r[13],o=e*r[2]+i*r[6]+n*r[10]+r[14],h=e*r[3]+i*r[7]+n*r[11]+r[15];return this.x=s/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*n-a*i,l=o*i+a*e-r*n,u=o*n+r*i-s*e,c=-r*e-s*i-a*n;return this.x=h*o+c*-r+l*-a-u*-s,this.y=l*o+c*-s+u*-r-h*-a,this.z=u*o+c*-a+h*-s-l*-r,this},project:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],c=r[6],d=r[7],f=r[8],p=r[9],v=r[10],g=r[11],m=r[12],M=r[13],x=r[14],y=1/(e*h+i*d+n*g+r[15]);return this.x=(e*s+i*l+n*f+m)*y,this.y=(e*a+i*u+n*p+M)*y,this.z=(e*o+i*c+n*v+x)*y,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,n=t.y,r=t.z,s=t.w,a=this.x-i,o=s-this.y-1-n,h=this.z;return this.x=2*a/r-1,this.y=2*o/s-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});n.ZERO=new n,n.RIGHT=new n(1,0,0),n.LEFT=new n(-1,0,0),n.UP=new n(0,-1,0),n.DOWN=new n(0,1,0),n.FORWARD=new n(0,0,1),n.BACK=new n(0,0,-1),n.ONE=new n(1,1,1),t.exports=n},9279:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=n*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this.w=s+e*(t.w-s),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+n*n+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*n-a*i,l=o*i+a*e-r*n,u=o*n+r*i-s*e,c=-r*e-s*i-a*n;return this.x=h*o+c*-r+l*-a-u*-s,this.y=l*o+c*-s+u*-r-h*-a,this.z=u*o+c*-a+h*-s-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},4119:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},8445:t=>{t.exports=function(t,e,i){if(t>=e&&t<=i)return t;var n=i-e;return e+((t-e)%n+n)%n}},6412:t=>{t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},760:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},6909:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},6947:t=>{t.exports=function(t,e,i,n){return Math.atan2(i-t,n-e)}},3426:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t>Math.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},6906:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},3270:(t,e,i)=>{var n=i(104);t.exports=function(){return n(-Math.PI,Math.PI)}},2748:(t,e,i)=>{var n=i(104);t.exports=function(){return n(-180,180)}},936:(t,e,i)=>{var n=i(6906);t.exports=function(t){return n(t+Math.PI)}},1935:(t,e,i)=>{var n=i(7425);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},3692:(t,e,i)=>{var n=i(8445);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},2820:(t,e,i)=>{var n=i(8445);t.exports=function(t){return n(t,-180,180)}},1833:(t,e,i)=>{t.exports={Between:i(6412),BetweenPoints:i(760),BetweenPointsY:i(6909),BetweenY:i(6947),CounterClockwise:i(3426),Normalize:i(6906),Random:i(3270),RandomDegrees:i(2748),Reverse:i(936),RotateTo:i(1935),ShortestBetween:i(5393),Wrap:i(3692),WrapDegrees:i(2820)}},7425:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},1518:t=>{t.exports=function(t,e,i,n){var r=t-i,s=e-n;return Math.sqrt(r*r+s*s)}},5372:t=>{t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}},4430:t=>{t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},4361:t=>{t.exports=function(t,e,i,n){return Math.max(Math.abs(t-i),Math.abs(e-n))}},7798:t=>{t.exports=function(t,e,i,n,r){return void 0===r&&(r=2),Math.sqrt(Math.pow(i-t,r)+Math.pow(n-e,r))}},8290:t=>{t.exports=function(t,e,i,n){return Math.abs(t-i)+Math.abs(e-n)}},3788:t=>{t.exports=function(t,e,i,n){var r=t-i,s=e-n;return r*r+s*s}},6338:(t,e,i)=>{t.exports={Between:i(1518),BetweenPoints:i(5372),BetweenPointsSquared:i(4430),Chebyshev:i(4361),Power:i(7798),Snake:i(8290),Squared:i(3788)}},5751:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},6203:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},9103:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},4938:(t,e,i)=>{t.exports={In:i(5751),Out:i(9103),InOut:i(6203)}},8677:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},4649:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},504:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},8872:(t,e,i)=>{t.exports={In:i(8677),Out:i(504),InOut:i(4649)}},3170:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},2627:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},1349:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},5006:(t,e,i)=>{t.exports={In:i(3170),Out:i(1349),InOut:i(2627)}},6046:t=>{t.exports=function(t){return t*t*t}},9531:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},4836:t=>{t.exports=function(t){return--t*t*t+1}},875:(t,e,i)=>{t.exports={In:i(6046),Out:i(4836),InOut:i(9531)}},7619:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},7437:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},8119:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},2884:(t,e,i)=>{t.exports={In:i(7619),Out:i(8119),InOut:i(7437)}},5456:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},3461:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},2711:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},6287:(t,e,i)=>{t.exports={In:i(5456),Out:i(2711),InOut:i(3461)}},8613:(t,e,i)=>{t.exports={Back:i(4938),Bounce:i(8872),Circular:i(5006),Cubic:i(875),Elastic:i(2884),Expo:i(6287),Linear:i(4233),Quadratic:i(6341),Quartic:i(762),Quintic:i(345),Sine:i(8698),Stepped:i(7051)}},744:t=>{t.exports=function(t){return t}},4233:(t,e,i)=>{t.exports=i(744)},9810:t=>{t.exports=function(t){return t*t}},8163:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},6123:t=>{t.exports=function(t){return t*(2-t)}},6341:(t,e,i)=>{t.exports={In:i(9810),Out:i(6123),InOut:i(8163)}},7337:t=>{t.exports=function(t){return t*t*t*t}},4878:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},9012:t=>{t.exports=function(t){return 1- --t*t*t*t}},762:(t,e,i)=>{t.exports={In:i(7337),Out:i(9012),InOut:i(4878)}},303:t=>{t.exports=function(t){return t*t*t*t*t}},553:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},1632:t=>{t.exports=function(t){return--t*t*t*t*t+1}},345:(t,e,i)=>{t.exports={In:i(303),Out:i(1632),InOut:i(553)}},8455:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},1844:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},990:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},8698:(t,e,i)=>{t.exports={In:i(8455),Out:i(990),InOut:i(1844)}},6745:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},7051:(t,e,i)=>{t.exports=i(6745)},3158:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},12:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},7373:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},2622:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(3158),Equal:i(12),Floor:i(1326),GreaterThan:i(7373),LessThan:i(2622)}},4675:(t,e,i)=>{var n=i(7425),r=i(1030),s={Angle:i(1833),Distance:i(6338),Easing:i(8613),Fuzzy:i(7927),Interpolation:i(2140),Pow2:i(7897),Snap:i(3943),RandomDataGenerator:i(6957),Average:i(3136),Bernstein:i(785),Between:i(7025),CatmullRom:i(48),CeilTo:i(5035),Clamp:i(2915),DegToRad:i(7149),Difference:i(2975),Euler:i(2107),Factorial:i(3916),FloatBetween:i(104),FloorTo:i(4941),FromPercent:i(1555),GetSpeed:i(5005),IsEven:i(3702),IsEvenStrict:i(8820),Linear:i(1743),LinearXY:i(3416),MaxAdd:i(3733),Median:i(44),MinSub:i(5385),Percent:i(8585),RadToDeg:i(4208),RandomXY:i(1705),RandomXYZ:i(6650),RandomXYZW:i(2037),Rotate:i(6283),RotateAround:i(9876),RotateAroundDistance:i(8348),RotateTo:i(4497),RoundAwayFromZero:i(4078),RoundTo:i(855),SinCosTableGenerator:i(4936),SmootherStep:i(278),SmoothStep:i(2733),ToXY:i(163),TransformXY:i(7556),Within:i(4119),Wrap:i(8445),Vector2:i(2529),Vector3:i(5689),Vector4:i(9279),Matrix3:i(2149),Matrix4:i(9652),Quaternion:i(372),RotateVec3:i(9640)};s=r(!1,s,n),t.exports=s},1640:(t,e,i)=>{var n=i(785);t.exports=function(t,e){for(var i=0,r=t.length-1,s=0;s<=r;s++)i+=Math.pow(1-e,r-s)*Math.pow(e,s)*t[s]*n(r,s);return i}},6105:(t,e,i)=>{var n=i(48);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return t[0]===t[i]?(e<0&&(s=Math.floor(r=i*(1+e))),n(r-s,t[(s-1+i)%i],t[s],t[(s+1)%i],t[(s+2)%i])):e<0?t[0]-(n(-r,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(r-s,t[s?s-1:0],t[s],t[i{t.exports=function(t,e,i,n,r){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,r)}},6765:(t,e,i)=>{var n=i(1743);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return e<0?n(t[0],t[1],r):e>1?n(t[i],t[i-1],i-r):n(t[s],t[s+1>i?i:s+1],r-s)}},6388:t=>{t.exports=function(t,e,i,n){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}},5735:(t,e,i)=>{var n=i(2733);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},8705:(t,e,i)=>{var n=i(278);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},2140:(t,e,i)=>{t.exports={Bezier:i(1640),CatmullRom:i(6105),CubicBezier:i(4002),Linear:i(6765),QuadraticBezier:i(6388),SmoothStep:i(5735),SmootherStep:i(8705)}},5443:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},167:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},7897:(t,e,i)=>{t.exports={GetNext:i(5443),IsSize:i(725),IsValue:i(167)}},6957:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var n=0;n>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),n=t[i];t[i]=t[e],t[e]=n}return t}});t.exports=n},5659:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},5461:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),n?(i+t)/e:i+t)}},5131:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),n?(i+t)/e:i+t)}},3943:(t,e,i)=>{t.exports={Ceil:i(5659),Floor:i(5461),To:i(5131)}},8666:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},8456:t=>{var e={},i={},n={register:function(t,i,n,r){void 0===r&&(r=!1),e[t]={plugin:i,mapping:n,custom:r}},registerCustom:function(t,e,n,r){i[t]={plugin:e,mapping:n,data:r}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=n},5722:(t,e,i)=>{var n=i(8666),r=i(7473),s=i(204),a=new r({Extends:n,initialize:function(t,e,i){n.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(s.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},8351:t=>{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},8196:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},3527:t=>{t.exports="resize"},8618:t=>{t.exports="addedtoscene"},4328:t=>{t.exports="boot"},6099:t=>{t.exports="create"},7645:t=>{t.exports="destroy"},2710:t=>{t.exports="pause"},2547:t=>{t.exports="postupdate"},8577:t=>{t.exports="prerender"},8197:t=>{t.exports="preupdate"},8997:t=>{t.exports="ready"},7604:t=>{t.exports="removedfromscene"},8999:t=>{t.exports="render"},9742:t=>{t.exports="resume"},3667:t=>{t.exports="shutdown"},3468:t=>{t.exports="sleep"},7840:t=>{t.exports="start"},9896:t=>{t.exports="transitioncomplete"},5103:t=>{t.exports="transitioninit"},3162:t=>{t.exports="transitionout"},7841:t=>{t.exports="transitionstart"},6454:t=>{t.exports="transitionwake"},6536:t=>{t.exports="update"},3875:t=>{t.exports="wake"},204:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(8618),BOOT:i(4328),CREATE:i(6099),DESTROY:i(7645),PAUSE:i(2710),POST_UPDATE:i(2547),PRE_RENDER:i(8577),PRE_UPDATE:i(8197),READY:i(8997),REMOVED_FROM_SCENE:i(7604),RENDER:i(8999),RESUME:i(9742),SHUTDOWN:i(3667),SLEEP:i(3468),START:i(7840),TRANSITION_COMPLETE:i(9896),TRANSITION_INIT:i(5103),TRANSITION_OUT:i(3162),TRANSITION_START:i(7841),TRANSITION_WAKE:i(6454),UPDATE:i(6536),WAKE:i(3875)}},2362:(t,e,i)=>{var n=i(7473),r=i(2915),s=i(1030),a=new n({initialize:function(t,e,i,n,r,s,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(s,a,n,r)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var r=this.data,s=r.cut;s.x=i,s.y=n,s.w=t,s.h=e,s.r=i+t,s.b=n+e,r.sourceSize.w=t,r.sourceSize.h=e,r.spriteSourceSize.w=t,r.spriteSourceSize.h=e,r.radius=.5*Math.sqrt(t*t+e*e);var a=r.drawImage;return a.x=i,a.y=n,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,n,r,s){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=n,o.w=r,o.h=s,o.r=i+r,o.b=n+s,this.x=i,this.y=n,this.width=r,this.height=s,this.halfWidth=.5*r,this.halfHeight=.5*s,this.centerX=Math.floor(r/2),this.centerY=Math.floor(s/2),this.updateUVs()},setCropUVs:function(t,e,i,n,s,a,o){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=r(e,0,d)),v=l+(i=r(i,0,f)),g=n=r(n,0,d-e),m=s=r(s,0,f-i),M=this.data;if(M.trim){var x=M.spriteSourceSize,y=e+(n=r(n,0,u-e)),w=i+(s=r(s,0,c-i));if(!(x.ry||x.y>w)){var E=Math.max(x.x,e),b=Math.max(x.y,i),T=Math.min(x.r,y)-E,A=Math.min(x.b,w)-b;g=T,m=A,p=a?h+(u-(E-x.x)-T):h+(E-x.x),v=o?l+(c-(b-x.y)-A):l+(b-x.y),e=E,i=b,n=T,s=A}else p=0,v=0,g=0,m=0}else a&&(p=h+(u-e-n)),o&&(v=l+(c-i-s));var R=this.source.width,S=this.source.height;return t.u0=Math.max(0,p/R),t.v0=Math.max(0,v/S),t.u1=Math.min(1,(p+g)/R),t.v1=Math.min(1,(v+m)/S),t.x=e,t.y=i,t.cx=p,t.cy=v,t.cw=g,t.ch=m,t.width=n,t.height=s,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,n,r,s){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=n,this.u1=r,this.v1=s,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=n;var s=this.source.width,a=this.source.height;return this.u0=t/s,this.v0=e/a,this.u1=(t+i)/s,this.v1=(e+n)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=s(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},1864:t=>{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},3747:t=>{t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},7473:t=>{function e(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function n(t,n,r,a){for(var o in n)if(n.hasOwnProperty(o)){var h=e(n,o,r);if(!1!==h){if(i((a||t).prototype,o)){if(s.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=n[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},1792:t=>{t.exports=function(t,e,i,n,r){if(void 0===r&&(r=t),i>0){var s=i-t.length;if(s<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>s&&(e.splice(s),a=s);for(var o=0;o{t.exports=function(t,e,i,n,r,s){if(void 0===i&&(i=0),void 0===s&&(s=t),n>0){var a=n-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),r&&r.call(s,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;n>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),r&&r.call(s,l)}return e}},2513:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var n=i(2497);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var a=0;if(n(t,r,s))for(var o=r;o{t.exports=function(t,e,i){var n,r=[null];for(n=3;n{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s)){var a,o=[null];for(a=5;a{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var n,r,s=1;if(i){if(te.length&&(s=e.length),i?(n=e[s-1][i],(r=e[s][i])-t<=t-n?e[s]:e[s-1]):(n=e[s-1],(r=e[s])-t<=t-n?r:n)}},4493:t=>{var e=function(t,i){void 0===i&&(i=[]);for(var n=0;n{var n=i(2497);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var a=[];if(n(t,r,s))for(var o=r;o{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var a=r;a{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},8683:t=>{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n>r||(t.splice(n,1),r===t.length-1?t.push(e):t.splice(r,0,e)),t}},546:t=>{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var n=t[i-1],r=t.indexOf(n);t[i]=n,t[r]=e}return t}},1419:t=>{t.exports=function(t,e,i){var n=t.indexOf(e);if(-1===n||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},6512:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,n){var r,s=[],a=!1;if((i||n)&&(a=!0,i||(i=""),n||(n="")),e=e;r--)a?s.push(i+r.toString()+n):s.push(r);else for(r=t;r<=e;r++)a?s.push(i+r.toString()+n):s.push(r);return s}},1316:(t,e,i)=>{var n=i(4078);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var r=[],s=Math.max(n((e-t)/(i||1)),0),a=0;a{function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return te?1:0}var n=function(t,r,s,a,o){for(void 0===s&&(s=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>s;){if(a-s>600){var h=a-s+1,l=r-s+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(s,Math.floor(r-l*c/h+d)),p=Math.min(a,Math.floor(r+(h-l)*c/h+d));n(t,r,f,p,o)}var v=t[r],g=s,m=a;for(e(t,s,r),o(t[a],v)>0&&e(t,s,a);g0;)m--}0===o(t[s],v)?e(t,s,m):e(t,++m,a),m<=r&&(s=m+1),r<=m&&(a=m-1)}};t.exports=n},9703:(t,e,i)=>{var n=i(5851),r=i(4912),s=function(t,e,i){for(var n=[],r=0;r{var n=i(8935);t.exports=function(t,e,i,r){var s;if(void 0===r&&(r=t),!Array.isArray(e))return-1!==(s=t.indexOf(e))?(n(t,s),i&&i.call(r,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(s=t.indexOf(h))&&(n(t,s),o.push(h),i&&i.call(r,h)),a--}return o}},4725:(t,e,i)=>{var n=i(8935);t.exports=function(t,e,i,r){if(void 0===r&&(r=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var s=n(t,e);return i&&i.call(r,s),s}},8780:(t,e,i)=>{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===s&&(s=t),n(t,e,i)){var a=i-e,o=t.splice(e,a);if(r)for(var h=0;h{var n=i(8935);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*i);return n(t,r)}},6960:t=>{t.exports=function(t,e,i){var n=t.indexOf(e),r=t.indexOf(i);return-1!==n&&-1===r&&(t[n]=i,!0)}},1021:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n{t.exports=function(t,e,i,n){var r=t.length;if(e<0||e>r||e>=i||i>r){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},5361:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},3718:(t,e,i)=>{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var a=r;a{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},2071:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},8935:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],r=e;r{var n=i(9356);function r(t,e){return String(t).localeCompare(e)}function s(t,e,i,n){var r,s,a,o,h,l=t.length,u=0,c=2*i;for(r=0;rl&&(s=l),a>l&&(a=l),o=r,h=s;;)if(o{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return t[n]=i,t[r]=e,t}},1953:(t,e,i)=>{t.exports={Matrix:i(1237),Add:i(1792),AddAt:i(2280),BringToTop:i(2513),CountAllMatching:i(1771),Each:i(7883),EachInRange:i(5856),FindClosestInSorted:i(3957),Flatten:i(4493),GetAll:i(6245),GetFirst:i(1647),GetRandom:i(5301),MoveDown:i(1842),MoveTo:i(1419),MoveUp:i(6512),MoveAbove:i(8683),MoveBelow:i(546),NumberArray:i(4130),NumberArrayStep:i(1316),QuickSelect:i(9465),Range:i(9703),Remove:i(7161),RemoveAt:i(4725),RemoveBetween:i(8780),RemoveRandomElement:i(5744),Replace:i(6960),RotateLeft:i(1021),RotateRight:i(4027),SafeRange:i(2497),SendToBack:i(5361),SetAll:i(3718),Shuffle:i(4912),SortByDigits:i(2071),SpliceOne:i(8935),StableSort:i(9992),Swap:i(2372)}},1816:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var n=i(7222),r=i(1816);t.exports=function(t){var e="";if(!r(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},6063:t=>{t.exports=function(t){for(var e=0;e{var n=i(7116);t.exports=function(t){return n(t,180)}},2597:(t,e,i)=>{var n=i(7116);t.exports=function(t){return n(t,90)}},7116:(t,e,i)=>{var n=i(1816),r=i(4780);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=r(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=r(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var n=i(7116);t.exports=function(t){return n(t,-90)}},7711:(t,e,i)=>{var n=i(1021),r=i(4027);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?n(t,Math.abs(i)):r(t,i)),0!==e)for(var s=0;s{t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),r=0;r-1;s--)n[r][s]=t[s][r]}return n}},1237:(t,e,i)=>{t.exports={CheckMatrix:i(1816),MatrixToString:i(6655),ReverseColumns:i(582),ReverseRows:i(6063),Rotate180:i(8321),RotateLeft:i(2597),RotateMatrix:i(7116),RotateRight:i(6285),Translate:i(7711),TransposeMatrix:i(4780)}},3911:t=>{var e=function(t){var i,n,r;if("object"!=typeof t||null===t)return t;for(r in i=Array.isArray(t)?[]:{},t)n=t[r],i[r]=e(n);return i};t.exports=e},1030:(t,e,i)=>{var n=i(2482),r=function(){var t,e,i,s,a,o,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l{var n=i(4675),r=i(5851);t.exports=function(t,e,i){var s=r(t,e,null);if(null===s)return i;if(Array.isArray(s))return n.RND.pick(s);if("object"==typeof s){if(s.hasOwnProperty("randInt"))return n.RND.integerInRange(s.randInt[0],s.randInt[1]);if(s.hasOwnProperty("randFloat"))return n.RND.realInRange(s.randFloat[0],s.randFloat[1])}else if("function"==typeof s)return s(e);return s}},4597:t=>{t.exports=function(t,e,i){var n=typeof t;return t&&"number"!==n&&"string"!==n&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},5851:t=>{t.exports=function(t,e,i,n){if(!t&&!n||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(n&&n.hasOwnProperty(e))return n[e];if(-1!==e.indexOf(".")){for(var r=e.split("."),s=t,a=n,o=i,h=i,l=!0,u=!0,c=0;c{t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},7222:t=>{t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===n&&(n=3);var r=0;if(e+1>=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var s=Math.ceil((r=e-t.length)/2);t=new Array(r-s+1).join(i)+t+new Array(s+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}}},e={};var i=function i(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,i),s.exports}(4513);window.SpinePlugin=i})(); \ No newline at end of file +(()=>{var t={4399:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,s||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,a=new Array(s);r{(function(){var e,i,n,r=this&&this.__extends||(e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},e(t,i)},function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)});!function(t){var e,i,n,s=function(){function t(t,e,i){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var n=0;n0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l>>1;;){if(t[(s+1)*i]<=e?n=s+1:r=s,n==r)return(n+1)*i;s=n+r>>>1}},t.linearSearch=function(t,e,i){for(var n=0,r=t.length-i;n<=r;n+=i)if(t[n]>e)return n;return-1},t}();t.Animation=s,function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(e=t.MixBlend||(t.MixBlend={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(i=t.MixDirection||(t.MixDirection={})),function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"}(n=t.TimelineType||(t.TimelineType={}));var a=function(){function e(i){if(i<=0)throw new Error("frameCount must be > 0: "+i);this.curves=t.Utils.newFloatArray((i-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var i=t*e.BEZIER_SIZE;if(i==this.curves.length)return e.LINEAR;var n=this.curves[i];return n==e.LINEAR?e.LINEAR:n==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,i,n,r,s){var a=.03*(2*-i+r),o=.03*(2*-n+s),h=.006*(3*(i-r)+1),l=.006*(3*(n-s)+1),u=2*a+h,c=2*o+l,d=.3*i+a+.16666667*h,f=.3*n+o+.16666667*l,p=t*e.BEZIER_SIZE,v=this.curves;v[p++]=e.BEZIER;for(var g=d,m=f,M=p+e.BEZIER_SIZE-1;p=n){var u=void 0,c=void 0;return s==h?(u=0,c=0):(u=r[s-2],c=r[s-1]),c+(r[s+1]-c)*(n-u)/(o-u)}var d=r[s-1];return d+(1-d)*(n-o)/(1-o)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=a;var o=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e<<1),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.rotate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+a.ROTATION]=i},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(n=u[u.length-a.ENTRIES]){var f=u[u.length+a.PREV_ROTATION];switch(h){case e.setup:c.rotation=c.data.rotation+f*o;break;case e.first:case e.replace:f+=c.data.rotation-c.rotation,f-=360*(16384-(16384.499999999996-f/360|0));case e.add:c.rotation+=f*o}}else{var p=s.binarySearch(u,n,a.ENTRIES),v=u[p+a.PREV_ROTATION],g=u[p],m=this.getCurvePercent((p>>1)-1,1-(n-g)/(u[p+a.PREV_TIME]-g)),M=u[p+a.ROTATION]-v;switch(M=v+(M-360*(16384-(16384.499999999996-M/360|0)))*m,h){case e.setup:c.rotation=c.data.rotation+(M-360*(16384-(16384.499999999996-M/360|0)))*o;break;case e.first:case e.replace:M+=c.data.rotation-c.rotation;case e.add:c.rotation+=(M-360*(16384-(16384.499999999996-M/360|0)))*o}}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_ROTATION=-1,a.ROTATION=1,a}(a);t.RotateTimeline=o;var h=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.translate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,i,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.X]=i,this.frames[t+a.Y]=n},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_X],f=u[u.length+a.PREV_Y];else{var p=s.binarySearch(u,n,a.ENTRIES);d=u[p+a.PREV_X],f=u[p+a.PREV_Y];var v=u[p],g=this.getCurvePercent(p/a.ENTRIES-1,1-(n-v)/(u[p+a.PREV_TIME]-v));d+=(u[p+a.X]-d)*g,f+=(u[p+a.Y]-f)*g}switch(h){case e.setup:c.x=c.data.x+d*o,c.y=c.data.y+f*o;break;case e.first:case e.replace:c.x+=(c.data.x+d-c.x)*o,c.y+=(c.data.y+f-c.y)*o;break;case e.add:c.x+=d*o,c.y+=f*o}}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_X=-2,a.PREV_Y=-1,a.X=1,a.Y=2,a}(a);t.TranslateTimeline=h;var l=function(a){function o(t){return a.call(this,t)||this}return r(o,a),o.prototype.getPropertyId=function(){return(n.scale<<24)+this.boneIndex},o.prototype.apply=function(n,r,a,h,l,u,c){var d=this.frames,f=n.bones[this.boneIndex];if(f.active)if(a=d[d.length-o.ENTRIES])p=d[d.length+o.PREV_X]*f.data.scaleX,v=d[d.length+o.PREV_Y]*f.data.scaleY;else{var g=s.binarySearch(d,a,o.ENTRIES);p=d[g+o.PREV_X],v=d[g+o.PREV_Y];var m=d[g],M=this.getCurvePercent(g/o.ENTRIES-1,1-(a-m)/(d[g+o.PREV_TIME]-m));p=(p+(d[g+o.X]-p)*M)*f.data.scaleX,v=(v+(d[g+o.Y]-v)*M)*f.data.scaleY}if(1==l)u==e.add?(f.scaleX+=p-f.data.scaleX,f.scaleY+=v-f.data.scaleY):(f.scaleX=p,f.scaleY=v);else{var x=0,y=0;if(c==i.mixOut)switch(u){case e.setup:x=f.data.scaleX,y=f.data.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,f.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-y)*l;break;case e.first:case e.replace:x=f.scaleX,y=f.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,f.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-y)*l;break;case e.add:x=f.scaleX,y=f.scaleY,f.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-f.data.scaleX)*l,f.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-f.data.scaleY)*l}else switch(u){case e.setup:x=Math.abs(f.data.scaleX)*t.MathUtils.signum(p),y=Math.abs(f.data.scaleY)*t.MathUtils.signum(v),f.scaleX=x+(p-x)*l,f.scaleY=y+(v-y)*l;break;case e.first:case e.replace:x=Math.abs(f.scaleX)*t.MathUtils.signum(p),y=Math.abs(f.scaleY)*t.MathUtils.signum(v),f.scaleX=x+(p-x)*l,f.scaleY=y+(v-y)*l;break;case e.add:x=t.MathUtils.signum(p),y=t.MathUtils.signum(v),f.scaleX=Math.abs(f.scaleX)*x+(p-Math.abs(f.data.scaleX)*x)*l,f.scaleY=Math.abs(f.scaleY)*y+(v-Math.abs(f.data.scaleY)*y)*l}}}},o}(h);t.ScaleTimeline=l;var u=function(t){function i(e){return t.call(this,e)||this}return r(i,t),i.prototype.getPropertyId=function(){return(n.shear<<24)+this.boneIndex},i.prototype.apply=function(t,n,r,a,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(r=u[u.length-i.ENTRIES])d=u[u.length+i.PREV_X],f=u[u.length+i.PREV_Y];else{var p=s.binarySearch(u,r,i.ENTRIES);d=u[p+i.PREV_X],f=u[p+i.PREV_Y];var v=u[p],g=this.getCurvePercent(p/i.ENTRIES-1,1-(r-v)/(u[p+i.PREV_TIME]-v));d+=(u[p+i.X]-d)*g,f+=(u[p+i.Y]-f)*g}switch(h){case e.setup:c.shearX=c.data.shearX+d*o,c.shearY=c.data.shearY+f*o;break;case e.first:case e.replace:c.shearX+=(c.data.shearX+d-c.shearX)*o,c.shearY+=(c.data.shearY+f-c.shearY)*o;break;case e.add:c.shearX+=d*o,c.shearY+=f*o}}},i}(h);t.ShearTimeline=u;var c=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.color<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,i,n,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=i,this.frames[t+a.G]=n,this.frames[t+a.B]=r,this.frames[t+a.A]=s},a.prototype.apply=function(t,i,n,r,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(n=c[c.length-a.ENTRIES]){var M=c.length;p=c[M+a.PREV_R],v=c[M+a.PREV_G],g=c[M+a.PREV_B],m=c[M+a.PREV_A]}else{var x=s.binarySearch(c,n,a.ENTRIES);p=c[x+a.PREV_R],v=c[x+a.PREV_G],g=c[x+a.PREV_B],m=c[x+a.PREV_A];var y=c[x],w=this.getCurvePercent(x/a.ENTRIES-1,1-(n-y)/(c[x+a.PREV_TIME]-y));p+=(c[x+a.R]-p)*w,v+=(c[x+a.G]-v)*w,g+=(c[x+a.B]-g)*w,m+=(c[x+a.A]-m)*w}if(1==o)u.color.set(p,v,g,m);else{d=u.color;h==e.setup&&d.setFromColor(u.data.color),d.add((p-d.r)*o,(v-d.g)*o,(g-d.b)*o,(m-d.a)*o)}}}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_R=-4,a.PREV_G=-3,a.PREV_B=-2,a.PREV_A=-1,a.R=1,a.G=2,a.B=3,a.A=4,a}(a);t.ColorTimeline=c;var d=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.twoColor<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,i,n,r,s,o,h,l){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=i,this.frames[t+a.G]=n,this.frames[t+a.B]=r,this.frames[t+a.A]=s,this.frames[t+a.R2]=o,this.frames[t+a.G2]=h,this.frames[t+a.B2]=l},a.prototype.apply=function(t,i,n,r,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(n=c[c.length-a.ENTRIES]){var b=c.length;g=c[b+a.PREV_R],m=c[b+a.PREV_G],M=c[b+a.PREV_B],x=c[b+a.PREV_A],y=c[b+a.PREV_R2],w=c[b+a.PREV_G2],E=c[b+a.PREV_B2]}else{var T=s.binarySearch(c,n,a.ENTRIES);g=c[T+a.PREV_R],m=c[T+a.PREV_G],M=c[T+a.PREV_B],x=c[T+a.PREV_A],y=c[T+a.PREV_R2],w=c[T+a.PREV_G2],E=c[T+a.PREV_B2];var A=c[T],R=this.getCurvePercent(T/a.ENTRIES-1,1-(n-A)/(c[T+a.PREV_TIME]-A));g+=(c[T+a.R]-g)*R,m+=(c[T+a.G]-m)*R,M+=(c[T+a.B]-M)*R,x+=(c[T+a.A]-x)*R,y+=(c[T+a.R2]-y)*R,w+=(c[T+a.G2]-w)*R,E+=(c[T+a.B2]-E)*R}if(1==o)u.color.set(g,m,M,x),u.darkColor.set(y,w,E,1);else{d=u.color,f=u.darkColor;h==e.setup&&(d.setFromColor(u.data.color),f.setFromColor(u.data.darkColor)),d.add((g-d.r)*o,(m-d.g)*o,(M-d.b)*o,(x-d.a)*o),f.add((y-f.r)*o,(w-f.g)*o,(E-f.b)*o,0)}}}},a.ENTRIES=8,a.PREV_TIME=-8,a.PREV_R=-7,a.PREV_G=-6,a.PREV_B=-5,a.PREV_A=-4,a.PREV_R2=-3,a.PREV_G2=-2,a.PREV_B2=-1,a.R=1,a.G=2,a.B=3,a.A=4,a.R2=5,a.G2=6,a.B2=7,a}(a);t.TwoColorTimeline=d;var f=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return r.prototype.getPropertyId=function(){return(n.attachment<<24)+this.slotIndex},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},r.prototype.apply=function(t,n,r,a,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active)if(l!=i.mixOut){var c=this.frames;if(r=c[c.length-1]?c.length-1:s.binarySearch(c,r,1)-1;var f=this.attachmentNames[d];t.slots[this.slotIndex].setAttachment(null==f?null:t.getAttachment(this.slotIndex,f))}}else h==e.setup&&this.setAttachment(t,u,u.data.attachmentName)},r.prototype.setAttachment=function(t,e,i){e.setAttachment(null==i?null:t.getAttachment(this.slotIndex,i))},r}();t.AttachmentTimeline=f;var p=null,v=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e),n.frameVertices=new Array(e),null==p&&(p=t.Utils.newFloatArray(64)),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.deform<<27)+ +this.attachment.id+this.slotIndex},a.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.frameVertices[t]=i},a.prototype.apply=function(i,n,r,a,o,h,l){var u=i.slots[this.slotIndex];if(u.bone.active){var c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.deformAttachment==this.attachment){var d=u.deform;0==d.length&&(h=e.setup);var f=this.frameVertices,p=f[0].length,v=this.frames;if(r=v[v.length-1]){var w=f[v.length-1];if(1==o)if(h==e.add)if(null==(g=c).bones){M=g.vertices;for(var E=0;Ei)this.apply(t,e,Number.MAX_VALUE,n,r,a,o),e=-1;else if(e>=h[l-1])return;if(!(i0&&h[u-1]==c;)u--;for(;u=h[u];u++)n.push(this.events[u])}}},e}();t.EventTimeline=g;var m=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return r.prototype.getPropertyId=function(){return n.drawOrder<<24},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.drawOrders[t]=i},r.prototype.apply=function(n,r,a,o,h,l,u){var c=n.drawOrder,d=n.slots;if(u!=i.mixOut){var f=this.frames;if(a=f[f.length-1]?f.length-1:s.binarySearch(f,a)-1;var v=this.drawOrders[p];if(null==v)t.Utils.arrayCopy(d,0,c,0,d.length);else for(var g=0,m=v.length;g=c[c.length-o.ENTRIES])l==e.setup?(d.mix=d.data.mix+(c[c.length+o.PREV_MIX]-d.data.mix)*h,d.softness=d.data.softness+(c[c.length+o.PREV_SOFTNESS]-d.data.softness)*h,u==i.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],d.compress=0!=c[c.length+o.PREV_COMPRESS],d.stretch=0!=c[c.length+o.PREV_STRETCH])):(d.mix+=(c[c.length+o.PREV_MIX]-d.mix)*h,d.softness+=(c[c.length+o.PREV_SOFTNESS]-d.softness)*h,u==i.mixIn&&(d.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],d.compress=0!=c[c.length+o.PREV_COMPRESS],d.stretch=0!=c[c.length+o.PREV_STRETCH]));else{var f=s.binarySearch(c,r,o.ENTRIES),p=c[f+o.PREV_MIX],v=c[f+o.PREV_SOFTNESS],g=c[f],m=this.getCurvePercent(f/o.ENTRIES-1,1-(r-g)/(c[f+o.PREV_TIME]-g));l==e.setup?(d.mix=d.data.mix+(p+(c[f+o.MIX]-p)*m-d.data.mix)*h,d.softness=d.data.softness+(v+(c[f+o.SOFTNESS]-v)*m-d.data.softness)*h,u==i.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=c[f+o.PREV_BEND_DIRECTION],d.compress=0!=c[f+o.PREV_COMPRESS],d.stretch=0!=c[f+o.PREV_STRETCH])):(d.mix+=(p+(c[f+o.MIX]-p)*m-d.mix)*h,d.softness+=(v+(c[f+o.SOFTNESS]-v)*m-d.softness)*h,u==i.mixIn&&(d.bendDirection=c[f+o.PREV_BEND_DIRECTION],d.compress=0!=c[f+o.PREV_COMPRESS],d.stretch=0!=c[f+o.PREV_STRETCH]))}},o.ENTRIES=6,o.PREV_TIME=-6,o.PREV_MIX=-5,o.PREV_SOFTNESS=-4,o.PREV_BEND_DIRECTION=-3,o.PREV_COMPRESS=-2,o.PREV_STRETCH=-1,o.MIX=1,o.SOFTNESS=2,o.BEND_DIRECTION=3,o.COMPRESS=4,o.STRETCH=5,o}(a);t.IkConstraintTimeline=M;var x=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.transformConstraint<<24)+this.transformConstraintIndex},a.prototype.setFrame=function(t,e,i,n,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=i,this.frames[t+a.TRANSLATE]=n,this.frames[t+a.SCALE]=r,this.frames[t+a.SHEAR]=s},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES]){var m=u.length;f=u[m+a.PREV_ROTATE],p=u[m+a.PREV_TRANSLATE],v=u[m+a.PREV_SCALE],g=u[m+a.PREV_SHEAR]}else{var M=s.binarySearch(u,n,a.ENTRIES);f=u[M+a.PREV_ROTATE],p=u[M+a.PREV_TRANSLATE],v=u[M+a.PREV_SCALE],g=u[M+a.PREV_SHEAR];var x=u[M],y=this.getCurvePercent(M/a.ENTRIES-1,1-(n-x)/(u[M+a.PREV_TIME]-x));f+=(u[M+a.ROTATE]-f)*y,p+=(u[M+a.TRANSLATE]-p)*y,v+=(u[M+a.SCALE]-v)*y,g+=(u[M+a.SHEAR]-g)*y}if(h==e.setup){d=c.data;c.rotateMix=d.rotateMix+(f-d.rotateMix)*o,c.translateMix=d.translateMix+(p-d.translateMix)*o,c.scaleMix=d.scaleMix+(v-d.scaleMix)*o,c.shearMix=d.shearMix+(g-d.shearMix)*o}else c.rotateMix+=(f-c.rotateMix)*o,c.translateMix+=(p-c.translateMix)*o,c.scaleMix+=(v-c.scaleMix)*o,c.shearMix+=(g-c.shearMix)*o}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_ROTATE=-4,a.PREV_TRANSLATE=-3,a.PREV_SCALE=-2,a.PREV_SHEAR=-1,a.ROTATE=1,a.TRANSLATE=2,a.SCALE=3,a.SHEAR=4,a}(a);t.TransformConstraintTimeline=x;var y=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.pathConstraintPosition<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,i){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.VALUE]=i},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_VALUE];else{var f=s.binarySearch(u,n,a.ENTRIES);d=u[f+a.PREV_VALUE];var p=u[f],v=this.getCurvePercent(f/a.ENTRIES-1,1-(n-p)/(u[f+a.PREV_TIME]-p));d+=(u[f+a.VALUE]-d)*v}h==e.setup?c.position=c.data.position+(d-c.data.position)*o:c.position+=(d-c.position)*o}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_VALUE=-1,a.VALUE=1,a}(a);t.PathConstraintPositionTimeline=y;var w=function(t){function i(e){return t.call(this,e)||this}return r(i,t),i.prototype.getPropertyId=function(){return(n.pathConstraintSpacing<<24)+this.pathConstraintIndex},i.prototype.apply=function(t,n,r,a,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(r=u[u.length-i.ENTRIES])d=u[u.length+i.PREV_VALUE];else{var f=s.binarySearch(u,r,i.ENTRIES);d=u[f+i.PREV_VALUE];var p=u[f],v=this.getCurvePercent(f/i.ENTRIES-1,1-(r-p)/(u[f+i.PREV_TIME]-p));d+=(u[f+i.VALUE]-d)*v}h==e.setup?c.spacing=c.data.spacing+(d-c.data.spacing)*o:c.spacing+=(d-c.spacing)*o}},i}(y);t.PathConstraintSpacingTimeline=w;var E=function(i){function a(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return r(a,i),a.prototype.getPropertyId=function(){return(n.pathConstraintMix<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,i,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=i,this.frames[t+a.TRANSLATE]=n},a.prototype.apply=function(t,i,n,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(n=u[u.length-a.ENTRIES])d=u[u.length+a.PREV_ROTATE],f=u[u.length+a.PREV_TRANSLATE];else{var p=s.binarySearch(u,n,a.ENTRIES);d=u[p+a.PREV_ROTATE],f=u[p+a.PREV_TRANSLATE];var v=u[p],g=this.getCurvePercent(p/a.ENTRIES-1,1-(n-v)/(u[p+a.PREV_TIME]-v));d+=(u[p+a.ROTATE]-d)*g,f+=(u[p+a.TRANSLATE]-f)*g}h==e.setup?(c.rotateMix=c.data.rotateMix+(d-c.data.rotateMix)*o,c.translateMix=c.data.translateMix+(f-c.data.translateMix)*o):(c.rotateMix+=(d-c.rotateMix)*o,c.translateMix+=(f-c.translateMix)*o)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_ROTATE=-2,a.PREV_TRANSLATE=-1,a.ROTATE=1,a.TRANSLATE=2,a}(a);t.PathConstraintMixTimeline=E}(n||(n={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.trackEntryPool=new t.Pool((function(){return new i})),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,i=0,n=e.length;i0){if(r.delay-=s,r.delay>0)continue;s=-r.delay,r.delay=0}var a=r.next;if(null!=a){var o=r.trackLast-a.delay;if(o>=0){for(a.delay=0,a.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*a.timeScale,r.trackTime+=s,this.setCurrent(i,a,!0);null!=a.mixingFrom;)a.mixTime+=t,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&null==r.mixingFrom){e[i]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,null!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=s}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var i=t.mixingFrom;if(null==i)return!0;var n=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,null!=i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(i){if(null==i)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var n=this.events,r=this.tracks,s=!1,a=0,o=r.length;a0)){s=!0;var l=0==a?t.MixBlend.first:h.mixBlend,u=h.alpha;null!=h.mixingFrom?u*=this.applyMixingFrom(h,i,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,d=h.getAnimationTime(),f=h.animation.timelines.length,p=h.animation.timelines;if(0==a&&1==u||l==t.MixBlend.add)for(var v=0;v1&&(a=1),r!=t.MixBlend.first&&(r=s.mixBlend));var o=a0&&this.queueEvents(s,c),this.events.length=0,s.nextAnimationLast=c,s.nextTrackLast=s.trackTime,a},e.prototype.applyAttachmentTimeline=function(i,n,r,s,a){var o=n.slots[i.slotIndex];if(o.bone.active){var h,l=i.frames;if(r=l[l.length-1]?l.length-1:t.Animation.binarySearch(l,r)-1,this.setAttachment(n,o,i.attachmentNames[h],a);o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+e.SETUP)}},e.prototype.setAttachment=function(t,i,n,r){i.setAttachment(null==n?null:t.getAttachment(i.data.index,n)),r&&(i.attachmentState=this.unkeyedState+e.CURRENT)},e.prototype.applyRotateTimeline=function(e,i,n,r,s,a,o,h){if(h&&(a[o]=0),1!=r){var l=e,u=l.frames,c=i.bones[l.boneIndex];if(c.active){var d=0,f=0;if(n=u[u.length-t.RotateTimeline.ENTRIES])f=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(u,n,t.RotateTimeline.ENTRIES),v=u[p+t.RotateTimeline.PREV_ROTATION],g=u[p],m=l.getCurvePercent((p>>1)-1,1-(n-g)/(u[p+t.RotateTimeline.PREV_TIME]-g));f=u[p+t.RotateTimeline.ROTATION]-v,f=v+(f-=360*(16384-(16384.499999999996-f/360|0)))*m+c.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0))}var M=0,x=f-d;if(0==(x-=360*(16384-(16384.499999999996-x/360|0))))M=a[o];else{var y=0,w=0;h?(y=0,w=x):(y=a[o],w=a[o+1]);var E=x>0,b=y>=0;t.MathUtils.signum(w)!=t.MathUtils.signum(x)&&Math.abs(w)<=90&&(Math.abs(y)>180&&(y+=360*t.MathUtils.signum(y)),b=E),M=x+y-y%360,b!=E&&(M+=360*t.MathUtils.signum(y)),a[o]=M}a[o+1]=x,d+=M*r,c.rotation=d-360*(16384-(16384.499999999996-d/360|0))}}else e.apply(i,0,n,null,1,s,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var i=t.animationStart,n=t.animationEnd,r=n-i,s=t.trackLast%r,a=this.events,o=0,h=a.length;on||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:e>=n&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var i=e;;){var n=i.mixingFrom;if(null==n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,i){var n=this.expandToIndex(t);this.tracks[t]=e,null!=n&&(i&&this.queue.interrupt(n),e.mixingFrom=n,n.mixingTo=e,e.mixTime=0,null!=n.mixingFrom&&n.mixDuration>0&&(e.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,i){var n=this.data.skeletonData.findAnimation(e);if(null==n)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,n,i)},e.prototype.setAnimationWith=function(t,e,i){if(null==e)throw new Error("animation cannot be null.");var n=!0,r=this.expandToIndex(t);null!=r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.disposeNext(r),r=r.mixingFrom,n=!1):this.disposeNext(r));var s=this.trackEntry(t,e,i,r);return this.setCurrent(t,s,n),this.queue.drain(),s},e.prototype.addAnimation=function(t,e,i,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,i,n)},e.prototype.addAnimationWith=function(t,e,i,n){if(null==e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(null!=r)for(;null!=r.next;)r=r.next;var s=this.trackEntry(t,e,i,r);if(null==r)this.setCurrent(t,s,!0),this.queue.drain();else if(r.next=s,n<=0){var a=r.animationEnd-r.animationStart;0!=a?(r.loop?n+=a*(1+(r.trackTime/a|0)):n+=Math.max(a,r.trackTime),n-=this.data.getMix(r.animation,e)):n=r.trackTime}return s.delay=n,s},e.prototype.setEmptyAnimation=function(t,i){var n=this.setAnimationWith(t,e.emptyAnimation,!1);return n.mixDuration=i,n.trackEnd=i,n},e.prototype.addEmptyAnimation=function(t,i,n){n<=0&&(n-=i);var r=this.addAnimationWith(t,e.emptyAnimation,!1,n);return r.mixDuration=i,r.trackEnd=i,r},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var i=0,n=this.tracks.length;i0){a[l]=e.HOLD_MIX,o[l]=d;continue t}break}a[l]=e.HOLD_FIRST}else a[l]=e.SUBSEQUENT}},e.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.emptyAnimation=new t.Animation("",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.HOLD_SUBSEQUENT=2,e.HOLD_FIRST=3,e.HOLD_MIX=4,e.SETUP=1,e.CURRENT=2,e}();t.AnimationState=e;var i=function(){function e(){this.mixBlend=t.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return e.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},e.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},e.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},e}();t.TrackEntry=i;var n,r=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(n.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(n.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(n.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(n.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(n.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(n.event),this.objects.push(t),this.objects.push(e)},t.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,i=0;i=0?e.substring(0,e.lastIndexOf("/")):"";e=this.pathPrefix+e,this.toLoad++,this.downloadText(e,(function(a){var o={count:0},h=new Array;try{new t.TextureAtlas(a,(function(e){h.push(""==s?e:s+"/"+e);var i=document.createElement("img");return i.width=16,i.height=16,new t.FakeTexture(i)}))}catch(t){var l=t;return r.errors[e]="Couldn't load texture atlas ".concat(e,": ").concat(l.message),n&&n(e,"Couldn't load texture atlas ".concat(e,": ").concat(l.message)),r.toLoad--,void r.loaded++}for(var u=function(l){var u=!1;r.loadTexture(l,(function(l,c){if(o.count++,o.count==h.length)if(u)r.errors[e]="Couldn't load texture atlas page ".concat(l,"} of atlas ").concat(e),n&&n(e,"Couldn't load texture atlas page ".concat(l," of atlas ").concat(e)),r.toLoad--,r.loaded++;else try{var d=new t.TextureAtlas(a,(function(t){return r.get(""==s?t:s+"/"+t)}));r.assets[e]=d,i&&i(e,d),r.toLoad--,r.loaded++}catch(t){var f=t;r.errors[e]="Couldn't load texture atlas ".concat(e,": ").concat(f.message),n&&n(e,"Couldn't load texture atlas ".concat(e,": ").concat(f.message)),r.toLoad--,r.loaded++}}),(function(t,i){u=!0,o.count++,o.count==h.length&&(r.errors[e]="Couldn't load texture atlas page ".concat(t,"} of atlas ").concat(e),n&&n(e,"Couldn't load texture atlas page ".concat(t," of atlas ").concat(e)),r.toLoad--,r.loaded++)}))},c=0,d=h;c0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(n||(n={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in atlas: "+n+" (region attachment: "+i+")");r.renderObject=r;var s=new t.RegionAttachment(i);return s.setRegion(r),s},e.prototype.newMeshAttachment=function(e,i,n){var r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in atlas: "+n+" (mesh attachment: "+i+")");r.renderObject=r;var s=new t.MeshAttachment(i);return s.region=r,s},e.prototype.newBoundingBoxAttachment=function(e,i){return new t.BoundingBoxAttachment(i)},e.prototype.newPathAttachment=function(e,i){return new t.PathAttachment(i)},e.prototype.newPointAttachment=function(e,i){return new t.PointAttachment(i)},e.prototype.newClippingAttachment=function(e,i){return new t.ClippingAttachment(i)},e}();t.AtlasAttachmentLoader=e}(n||(n={})),function(t){!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(t.BlendMode||(t.BlendMode={}))}(n||(n={})),function(t){var e=function(){function e(t,e,i){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}return e.prototype.isActive=function(){return this.active},e.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,i,n,r,s,a,o){this.ax=e,this.ay=i,this.arotation=n,this.ascaleX=r,this.ascaleY=s,this.ashearX=a,this.ashearY=o,this.appliedValid=!0;var h=this.parent;if(null==h){var l=this.skeleton,u=n+90+o,c=l.scaleX,d=l.scaleY;return this.a=t.MathUtils.cosDeg(n+a)*r*c,this.b=t.MathUtils.cosDeg(u)*s*c,this.c=t.MathUtils.sinDeg(n+a)*r*d,this.d=t.MathUtils.sinDeg(u)*s*d,this.worldX=e*c+l.x,void(this.worldY=i*d+l.y)}var f=h.a,p=h.b,v=h.c,g=h.d;switch(this.worldX=f*e+p*i+h.worldX,this.worldY=v*e+g*i+h.worldY,this.data.transformMode){case t.TransformMode.Normal:u=n+90+o;var m=t.MathUtils.cosDeg(n+a)*r,M=t.MathUtils.cosDeg(u)*s,x=t.MathUtils.sinDeg(n+a)*r,y=t.MathUtils.sinDeg(u)*s;return this.a=f*m+p*x,this.b=f*M+p*y,this.c=v*m+g*x,void(this.d=v*M+g*y);case t.TransformMode.OnlyTranslation:u=n+90+o;this.a=t.MathUtils.cosDeg(n+a)*r,this.b=t.MathUtils.cosDeg(u)*s,this.c=t.MathUtils.sinDeg(n+a)*r,this.d=t.MathUtils.sinDeg(u)*s;break;case t.TransformMode.NoRotationOrReflection:var w=0;(T=f*f+v*v)>1e-4?(T=Math.abs(f*g-p*v)/T,f/=this.skeleton.scaleX,p=(v/=this.skeleton.scaleY)*T,g=f*T,w=Math.atan2(v,f)*t.MathUtils.radDeg):(f=0,v=0,w=90-Math.atan2(g,p)*t.MathUtils.radDeg);var E=n+a-w,b=n+o-w+90;m=t.MathUtils.cosDeg(E)*r,M=t.MathUtils.cosDeg(b)*s,x=t.MathUtils.sinDeg(E)*r,y=t.MathUtils.sinDeg(b)*s;this.a=f*m-p*x,this.b=f*M-p*y,this.c=v*m+g*x,this.d=v*M+g*y;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var T,A=t.MathUtils.cosDeg(n),R=t.MathUtils.sinDeg(n),S=(f*A+p*R)/this.skeleton.scaleX,C=(v*A+g*R)/this.skeleton.scaleY;(T=Math.sqrt(S*S+C*C))>1e-5&&(T=1/T),S*=T,C*=T,T=Math.sqrt(S*S+C*C),this.data.transformMode==t.TransformMode.NoScale&&f*g-p*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(T=-T);var I=Math.PI/2+Math.atan2(C,S),P=Math.cos(I)*T,L=Math.sin(I)*T;m=t.MathUtils.cosDeg(a)*r,M=t.MathUtils.cosDeg(90+o)*s,x=t.MathUtils.sinDeg(a)*r,y=t.MathUtils.sinDeg(90+o)*s;this.a=S*m+P*x,this.b=S*M+P*y,this.c=C*m+L*x,this.d=C*M+L*y}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},e.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*t.MathUtils.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*t.MathUtils.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var e=this.parent;if(null==e)return this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);var i=e.a,n=e.b,r=e.c,s=e.d,a=1/(i*s-n*r),o=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=o*s*a-h*n*a,this.ay=h*i*a-o*r*a;var l=a*s,u=a*i,c=a*n,d=a*r,f=l*this.a-c*this.c,p=l*this.b-c*this.d,v=u*this.c-d*this.a,g=u*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var m=f*g-p*v;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(f*p+v*g,m)*t.MathUtils.radDeg,this.arotation=Math.atan2(v,f)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,i=this.b,n=this.c,r=this.d,s=1/(e*r-i*n),a=t.x-this.worldX,o=t.y-this.worldY;return t.x=a*r*s-o*i*s,t.y=o*e*s-a*n*s,t},e.prototype.localToWorld=function(t){var e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t},e.prototype.worldToLocalRotation=function(e){var i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return Math.atan2(this.a*i-this.c*n,this.d*n-this.b*i)*t.MathUtils.radDeg+this.rotation-this.shearX},e.prototype.localToWorldRotation=function(e){e-=this.rotation-this.shearX;var i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return Math.atan2(n*this.c+i*this.d,n*this.a+i*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var i=this.a,n=this.b,r=this.c,s=this.d,a=t.MathUtils.cosDeg(e),o=t.MathUtils.sinDeg(e);this.a=a*i-o*r,this.b=a*n-o*s,this.c=o*i+a*r,this.d=o*n+a*s,this.appliedValid=!1},e}();t.Bone=e}(n||(n={})),function(t){var e,i=function(i,n,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=e.Normal,this.skinRequired=!1,this.color=new t.Color,i<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");this.index=i,this.name=n,this.parent=r};t.BoneData=i,function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(e=t.TransformMode||(t.TransformMode={}))}(n||(n={})),function(t){var e=function(t,e,i){this.name=t,this.order=e,this.skinRequired=i};t.ConstraintData=e}(n||(n={})),function(t){var e=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e};t.Event=e}(n||(n={})),function(t){var e=function(t){this.name=t};t.EventData=e}(n||(n={})),function(t){var e=function(){function e(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var i=0;i180?f-=360:f<-180&&(f+=360);var E=e.ascaleX,b=e.ascaleY;if(r||s){switch(e.data.transformMode){case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:p=i-e.worldX,v=n-e.worldY}var T=e.data.length*E,A=Math.sqrt(p*p+v*v);if(r&&AT&&T>1e-4)E*=g=(A/T-1)*o+1,a&&(b*=g)}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*o,E,b,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,i,n,r,s,a,o,h){if(0!=h){e.appliedValid||e.updateAppliedTransform(),i.appliedValid||i.updateAppliedTransform();var l=e.ax,u=e.ay,c=e.ascaleX,d=c,f=e.ascaleY,p=i.ascaleX,v=0,g=0,m=0;c<0?(c=-c,v=180,m=-1):(v=0,m=1),f<0&&(f=-f,m=-m),p<0?(p=-p,g=180):g=0;var M=i.ax,x=0,y=0,w=0,E=e.a,b=e.b,T=e.c,A=e.d,R=Math.abs(c-f)<=1e-4;R?(y=E*M+b*(x=i.ay)+e.worldX,w=T*M+A*x+e.worldY):(x=0,y=E*M+e.worldX,w=T*M+e.worldY);var S=e.parent;E=S.a,b=S.b,T=S.c;var C,I,P=1/(E*(A=S.d)-b*T),L=y-S.worldX,O=w-S.worldY,_=(L*A-O*b)*P-l,k=(O*E-L*T)*P-u,F=Math.sqrt(_*_+k*k),D=i.data.length*p;if(F<1e-4)return this.apply1(e,n,r,!1,a,!1,h),void i.updateWorldTransformWith(M,x,0,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY);var V=((L=n-S.worldX)*A-(O=r-S.worldY)*b)*P-l,N=(O*E-L*T)*P-u,B=V*V+N*N;if(0!=o){o*=c*(p+1)/2;var X=Math.sqrt(B),U=X-F-D*c+o;if(U>0){var Y=Math.min(1,U/(2*o))-1;B=(V-=(Y=(U-o*(1-Y*Y))/X)*V)*V+(N-=Y*N)*N}}t:if(R){var z=(B-F*F-(D*=c)*D)/(2*F*D);z<-1?z=-1:z>1&&(z=1,a&&(d*=(Math.sqrt(B)/(F+D)-1)*h+1)),I=Math.acos(z)*s,E=F+D*z,b=D*Math.sin(I),C=Math.atan2(N*E-V*b,V*E+N*b)}else{var W=(E=c*D)*E,G=(b=f*D)*b,H=Math.atan2(N,V),q=-2*G*F,j=G-W;if((A=q*q-4*j*(T=G*F*F+W*B-W*G))>=0){var K=Math.sqrt(A);q<0&&(K=-K);var Z=(K=-(q+K)/2)/j,Q=T/K,$=Math.abs(Z)=-1&&T<=1&&(T=Math.acos(T),(A=(L=E*Math.cos(T)+F)*L+(O=b*Math.sin(T))*O)st&&(nt=T,st=A,rt=L,at=O)),B<=(et+st)/2?(C=H-Math.atan2(it*s,tt),I=J*s):(C=H-Math.atan2(at*s,rt),I=nt*s)}var ot=Math.atan2(x,M)*m,ht=e.arotation;(C=(C-ot)*t.MathUtils.radDeg+v-ht)>180?C-=360:C<-180&&(C+=360),e.updateWorldTransformWith(l,u,ht+C*h,d,e.ascaleY,0,0),ht=i.arotation,(I=((I+ot)*t.MathUtils.radDeg-i.ashearX)*m+g-ht)>180?I-=360:I<-180&&(I+=360),i.updateWorldTransformWith(M,x,ht+I*h,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY)}else i.updateWorldTransform()},e}();t.IkConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i.bendDirection=1,i.compress=!1,i.stretch=!1,i.uniform=!1,i.mix=1,i.softness=0,i}return r(e,t),e}(t.ConstraintData);t.IkConstraintData=e}(n||(n={})),function(t){var e=function(){function e(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var i=0,n=t.bones.length;i0;if(r>0||s){var a=this.data,o=a.spacingMode==t.SpacingMode.Percent,h=a.rotateMode,l=h==t.RotateMode.Tangent,u=h==t.RotateMode.ChainScale,c=this.bones.length,d=l?c:c+1,f=this.bones,p=t.Utils.setArraySize(this.spaces,d),v=null,g=this.spacing;if(u||!o){u&&(v=t.Utils.setArraySize(this.lengths,c));for(var m=a.spacingMode==t.SpacingMode.Length,M=0,x=d-1;M0?t.MathUtils.degRad:-t.MathUtils.degRad;M=0;for(var P=3;Mt.MathUtils.PI?X-=t.MathUtils.PI2:X<-t.MathUtils.PI&&(X+=t.MathUtils.PI2),X*=n,U=Math.cos(X),Y=Math.sin(X),L.a=U*D-Y*N,L.b=U*V-Y*B,L.c=Y*D+U*N,L.d=Y*V+U*B}L.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(i,n,r,s,a){var o=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*n+2),c=null,d=i.closed,f=i.worldVerticesLength,p=f/6,v=e.NONE;if(!i.constantSpeed){var g=i.lengths,m=g[p-=d?1:2];if(s&&(h*=m),a)for(var M=1;Mm){v!=e.AFTER&&(v=e.AFTER,i.computeWorldVertices(o,f-6,4,c,0,2)),this.addAfterPosition(w-m,c,0,u,x);continue}}for(;;y++){var E=g[y];if(!(w>E)){if(0==y)w/=E;else w=(w-(K=g[y-1]))/(E-K);break}}y!=v&&(v=y,d&&y==p?(i.computeWorldVertices(o,f-4,4,c,0,2),i.computeWorldVertices(o,0,4,c,4,2)):i.computeWorldVertices(o,6*y+2,8,c,0,2)),this.addCurvePosition(w,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,x,r||M>0&&0==G)}return u}d?(f+=2,c=t.Utils.setArraySize(this.world,f),i.computeWorldVertices(o,2,f-4,c,0,2),i.computeWorldVertices(o,0,2,c,f-4,2),c[f-2]=c[0],c[f-1]=c[1]):(p--,f-=4,c=t.Utils.setArraySize(this.world,f),i.computeWorldVertices(o,2,f,c,0,2));for(var b=t.Utils.setArraySize(this.curves,p),T=0,A=c[0],R=c[1],S=0,C=0,I=0,P=0,L=0,O=0,_=0,k=0,F=0,D=0,V=0,N=0,B=0,X=0,U=(M=0,2);MT){this.addAfterPosition(w-T,c,f-4,u,x);continue}}for(;;y++){var H=b[y];if(!(w>H)){if(0==y)w/=H;else w=(w-(K=b[y-1]))/(H-K);break}}if(y!=v){v=y;var q=6*y;for(A=c[q],R=c[q+1],S=c[q+2],C=c[q+3],I=c[q+4],P=c[q+5],V=2*(_=.03*(A-2*S+I))+(F=.006*(3*(S-I)-A+(L=c[q+6]))),N=2*(k=.03*(R-2*C+P))+(D=.006*(3*(C-P)-R+(O=c[q+7]))),B=.3*(S-A)+_+.16666667*F,X=.3*(C-R)+k+.16666667*D,z=Math.sqrt(B*B+X*X),Y[0]=z,q=1;q<8;q++)B+=V,X+=N,V+=F,N+=D,z+=Math.sqrt(B*B+X*X),Y[q]=z;B+=V,X+=N,z+=Math.sqrt(B*B+X*X),Y[8]=z,B+=V+F,X+=N+D,z+=Math.sqrt(B*B+X*X),Y[9]=z,W=0}for(w*=z;;W++){var j=Y[W];if(!(w>j)){var K;if(0==W)w/=j;else w=W+(w-(K=Y[W-1]))/(j-K);break}}this.addCurvePosition(.1*w,A,R,S,C,I,P,L,O,u,x,r||M>0&&0==G)}return u},e.prototype.addBeforePosition=function(t,e,i,n,r){var s=e[i],a=e[i+1],o=e[i+2]-s,h=e[i+3]-a,l=Math.atan2(h,o);n[r]=s+t*Math.cos(l),n[r+1]=a+t*Math.sin(l),n[r+2]=l},e.prototype.addAfterPosition=function(t,e,i,n,r){var s=e[i+2],a=e[i+3],o=s-e[i],h=a-e[i+1],l=Math.atan2(h,o);n[r]=s+t*Math.cos(l),n[r+1]=a+t*Math.sin(l),n[r+2]=l},e.prototype.addCurvePosition=function(t,e,i,n,r,s,a,o,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=i,void(l[u+2]=Math.atan2(r-i,n-e));var d=t*t,f=d*t,p=1-t,v=p*p,g=v*p,m=p*t,M=3*m,x=p*M,y=M*t,w=e*g+n*x+s*y+o*f,E=i*g+r*x+a*y+h*f;l[u]=w,l[u+1]=E,c&&(l[u+2]=t<.001?Math.atan2(r-i,n-e):Math.atan2(E-(i*v+r*m*2+a*d),w-(e*v+n*m*2+s*d)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i}return r(e,t),e}(t.ConstraintData);t.PathConstraintData=e,function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(t.PositionMode||(t.PositionMode={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent"}(t.SpacingMode||(t.SpacingMode={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(t.RotateMode||(t.RotateMode={}))}(n||(n={})),function(t){var e=function(){function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t}(),i=function(){function t(t){void 0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}return t.prototype.queueAsset=function(t,i,n){var r=this.clientAssets[t];return null==r&&(r=new e(t),this.clientAssets[t]=r),null!==i&&(r.textureLoader=i),r.toLoad.push(n),this.queuedAssets[n]!==n&&(this.queuedAssets[n]=n,!0)},t.prototype.loadText=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.overrideMimeType("text/html"),n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=n.responseText:i.errors[e]="Couldn't load text ".concat(e,": status ").concat(n.status,", ").concat(n.responseText))},n.open("GET",e,!0),n.send()}},t.prototype.loadJson=function(t,e){var i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.overrideMimeType("text/html"),n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=JSON.parse(n.responseText):i.errors[e]="Couldn't load text ".concat(e,": status ").concat(n.status,", ").concat(n.responseText))},n.open("GET",e,!0),n.send()}},t.prototype.loadTexture=function(t,e,i){var n=this;if(i=this.pathPrefix+i,this.queueAsset(t,e,i))if(!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts){fetch(i,{mode:"cors"}).then((function(t){return t.ok||(n.errors[i]="Couldn't load image "+i),t.blob()})).then((function(t){return createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"})})).then((function(t){n.rawAssets[i]=t}))}else{var r=new Image;r.crossOrigin="anonymous",r.onload=function(t){n.rawAssets[i]=r},r.onerror=function(t){n.errors[i]="Couldn't load image ".concat(i)},r.src=i}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var i=this.clientAssets[t];return null==i||i.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts,i=0;i0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=i}(n||(n={})),function(t){var e=function(){function e(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(var i=0;i1){var s=n[n.length-1];this._updateCache.indexOf(s)>-1||this.updateCacheReset.push(s)}this._updateCache.push(e),this.sortReset(r.children),n[n.length-1].sorted=!0}},e.prototype.sortPathConstraint=function(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active){var i=e.target,n=i.data.index,r=i.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,n,r),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,r);for(var s=0,a=this.data.skins.length;s-1||this.updateCacheReset.push(s)}else for(r=0;r0){y=new t.DrawOrderTimeline(D);var V=r.slots.length;for(u=0;u=0;f--)B[f]=-1;var X=t.Utils.newArray(V-N,0),U=0,Y=0;for(f=0;f=0;f--)-1==B[f]&&(B[f]=X[--Y]);y.setFrame(u,M,B)}s.push(y),o=Math.max(o,y.frames[D-1])}var z=i.readInt(!0);if(z>0){for(y=new t.EventTimeline(z),u=0;u>>1^-(1&i)},t.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},t.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(n),i++}}return e},t.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},t.prototype.readBoolean=function(){return 0!=this.readByte()},t}(),n=function(t,e,i,n,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=n,this.inheritDeform=r},r=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(n||(n={})),function(t){var e=function(){function e(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new t.Pool((function(){return t.Utils.newFloatArray(16)}))}return e.prototype.update=function(e,i){if(null==e)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,r=this.polygons,s=this.polygonPool,a=e.slots,o=a.length;n.length=0,s.freeAll(r),r.length=0;for(var h=0;h=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,i,n){var r=this.minX,s=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&i<=r||e<=s&&n<=s||t>=a&&i>=a||e>=o&&n>=o)return!1;var h=(n-e)/(i-t),l=h*(r-t)+e;if(l>s&&ls&&lr&&ur&&ut.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var i=this.polygons,n=0,r=i.length;n=i||l=i){var u=n[o];u+(i-h)/(l-h)*(n[s]-u)=u&&x<=f||x>=f&&x<=u)&&(x>=e&&x<=n||x>=n&&x<=e)){var y=(l*m-h*v)/M;if((y>=c&&y<=p||y>=p&&y<=c)&&(y>=i&&y<=r||y>=r&&y<=i))return!0}u=f,c=p}return!1},e.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},e.prototype.getWidth=function(){return this.maxX-this.minX},e.prototype.getHeight=function(){return this.maxY-this.minY},e}();t.SkeletonBounds=e}(n||(n={})),function(t){var e=function(){function e(){this.triangulator=new t.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return e.prototype.clipStart=function(i,n){if(null!=this.clipAttachment)return 0;this.clipAttachment=n;var r=n.worldVerticesLength,s=t.Utils.setArraySize(this.clippingPolygon,r);n.computeWorldVertices(i,0,r,s,0,2);var a=this.clippingPolygon;e.makeClockwise(a);for(var o=this.clippingPolygons=this.triangulator.decompose(a,this.triangulator.triangulate(a)),h=0,l=o.length;h>1,B=this.clipOutput,X=t.Utils.setArraySize(u,L+N*p),U=0;U=2?(u=o,o=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(i),u.push(n),u.push(r),u.push(s),u.push(t),u.push(e),o.length=0;for(var c=a,d=a.length-4,f=0;;f+=2){for(var p=c[f],v=c[f+1],g=c[f+2],m=c[f+3],M=p-g,x=v-m,y=u,w=u.length-2,E=o.length,b=0;b0;if(M*(A-m)-x*(T-g)>0){if(C){o.push(R),o.push(S);continue}var I=(L=S-A)*(g-p)-(O=R-T)*(m-v);if(Math.abs(I)>1e-6){var P=(O*(v-A)-L*(p-T))/I;o.push(p+(g-p)*P),o.push(v+(m-v)*P)}else o.push(p),o.push(v)}else if(C){var L,O;I=(L=S-A)*(g-p)-(O=R-T)*(m-v);if(Math.abs(I)>1e-6){P=(O*(v-A)-L*(p-T))/I;o.push(p+(g-p)*P),o.push(v+(m-v)*P)}else o.push(p),o.push(v);o.push(R),o.push(S)}l=!0}if(E==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),f==d)break;var _=o;(o=u).length=0,u=_}if(h!=o){h.length=0;f=0;for(var k=o.length-2;f>1;o=0;d--)-1==G[d]&&(G[d]=q[--K])}y.setFrame(c++,this.getValue(W,"time",0),G)}s.push(y),a=Math.max(a,y.frames[y.getFrameCount()-1])}if(e.events){for(y=new t.EventTimeline(e.events.length),c=0,d=0;d=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=i},i.prototype.addSkin=function(t){for(var e=0;e= 0.");if(null==i)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=e,this.name=i,this.boneData=n};t.SlotData=e}(n||(n={})),function(t){var e,i,n=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return e.MipMapNearestNearest;case"mipmaplinearnearest":return e.MipMapLinearNearest;case"mipmapnearestlinear":return e.MipMapNearestLinear;case"mipmaplinearlinear":return e.MipMapLinearLinear;default:throw new Error("Unknown texture filter ".concat(t))}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return i.MirroredRepeat;case"clamptoedge":return i.ClampToEdge;case"repeat":return i.Repeat;default:throw new Error("Unknown texture wrap ".concat(t))}},t}();t.Texture=n,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(e=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(i=t.TextureWrap||(t.TextureWrap={}));var s=function(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.rotate=!1,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0};t.TextureRegion=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(n);t.FakeTexture=a}(n||(n={})),function(t){var e=function(){function e(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}return e.prototype.load=function(e,r){if(null==r)throw new Error("textureLoader cannot be null.");for(var a=new i(e),o=new Array(4),h=null;;){var l=a.readLine();if(null==l)break;if(0==(l=l.trim()).length)h=null;else if(h){var u=new s;u.name=l,u.page=h;var c=a.readValue();"true"==c.toLocaleLowerCase()?u.degrees=90:"false"==c.toLocaleLowerCase()?u.degrees=0:u.degrees=parseFloat(c),u.rotate=90==u.degrees,a.readTuple(o);var d=parseInt(o[0]),f=parseInt(o[1]);a.readTuple(o);var p=parseInt(o[0]),v=parseInt(o[1]);u.u=d/h.width,u.v=f/h.height,u.rotate?(u.u2=(d+v)/h.width,u.v2=(f+p)/h.height):(u.u2=(d+p)/h.width,u.v2=(f+v)/h.height),u.x=d,u.y=f,u.width=Math.abs(p),u.height=Math.abs(v),4==a.readTuple(o)&&4==a.readTuple(o)&&a.readTuple(o),u.originalWidth=parseInt(o[0]),u.originalHeight=parseInt(o[1]),a.readTuple(o),u.offsetX=parseInt(o[0]),u.offsetY=parseInt(o[1]),u.index=parseInt(a.readValue()),u.texture=h.texture,this.regions.push(u)}else{(h=new n).name=l,2==a.readTuple(o)&&(h.width=parseInt(o[0]),h.height=parseInt(o[1]),a.readTuple(o)),a.readTuple(o),h.minFilter=t.Texture.filterFromString(o[0]),h.magFilter=t.Texture.filterFromString(o[1]);var g=a.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==g?h.uWrap=t.TextureWrap.Repeat:"y"==g?h.vWrap=t.TextureWrap.Repeat:"xy"==g&&(h.uWrap=h.vWrap=t.TextureWrap.Repeat),h.texture=r(l),h.texture.setFilters(h.minFilter,h.magFilter),h.texture.setWraps(h.uWrap,h.vWrap),h.width=h.texture.getImage().width,h.height=h.texture.getImage().height,this.pages.push(h)}}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw new Error("Invalid line: "+e);for(var n=0,r=i+1;n<3;n++){var s=e.indexOf(",",r);if(-1==s)break;t[n]=e.substr(r,s-r).trim(),r=s+1}return t[n]=e.substring(r).trim(),n+1},t}(),n=function(){};t.TextureAtlasPage=n;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=s}(n||(n={})),function(t){var e=function(){function e(e,i){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,this.active=!1,null==e)throw new Error("data cannot be null.");if(null==i)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(var n=0;n0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,d=this.data.offsetShearY*u,f=this.bones,p=0,v=f.length;pt.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2),S*=e;var E=Math.cos(S),b=Math.sin(S);g.a=E*M-b*y,g.b=E*x-b*w,g.c=b*M+E*y,g.d=b*x+E*w,m=!0}if(0!=i){var T=this.temp;s.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(T.x-g.worldX)*i,g.worldY+=(T.y-g.worldY)*i,m=!0}if(n>0){var A=Math.sqrt(g.a*g.a+g.c*g.c),R=Math.sqrt(a*a+h*h);A>1e-5&&(A=(A+(R-A+this.data.offsetScaleX)*n)/A),g.a*=A,g.c*=A,A=Math.sqrt(g.b*g.b+g.d*g.d),R=Math.sqrt(o*o+l*l),A>1e-5&&(A=(A+(R-A+this.data.offsetScaleY)*n)/A),g.b*=A,g.d*=A,m=!0}if(r>0){x=g.b,w=g.d;var S,C=Math.atan2(w,x);(S=Math.atan2(l,o)-Math.atan2(h,a)-(C-Math.atan2(g.c,g.a)))>t.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2),S=C+(S+d)*r;A=Math.sqrt(x*x+w*w);g.b=Math.cos(S)*A,g.d=Math.sin(S)*A,m=!0}m&&(g.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,i=this.translateMix,n=this.scaleMix,r=this.shearMix,s=this.target,a=s.a,o=s.b,h=s.c,l=s.d,u=a*l-o*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,d=this.data.offsetShearY*u,f=this.bones,p=0,v=f.length;pt.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R*=e;var E=Math.cos(R),b=Math.sin(R);g.a=E*M-b*y,g.b=E*x-b*w,g.c=b*M+E*y,g.d=b*x+E*w,m=!0}if(0!=i){var T=this.temp;s.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),g.worldX+=T.x*i,g.worldY+=T.y*i,m=!0}if(n>0){var A=(Math.sqrt(a*a+h*h)-1+this.data.offsetScaleX)*n+1;g.a*=A,g.c*=A,A=(Math.sqrt(o*o+l*l)-1+this.data.offsetScaleY)*n+1,g.b*=A,g.d*=A,m=!0}if(r>0){var R;(R=Math.atan2(l,o)-Math.atan2(h,a))>t.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2);x=g.b,w=g.d;R=Math.atan2(w,x)+(R-t.MathUtils.PI/2+d)*r;A=Math.sqrt(x*x+w*w);g.b=Math.cos(R)*A,g.d=Math.sin(R)*A,m=!0}m&&(g.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a1e-5&&(f=(f+(r.ascaleX-f+this.data.offsetScaleX)*i)/f),p>1e-5&&(p=(p+(r.ascaleY-p+this.data.offsetScaleY)*i)/p));var v=h.ashearY;if(0!=n){u=r.ashearY-v+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*n}h.updateWorldTransformWith(c,d,l,f,p,h.ashearX,v)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a1e-5&&(d*=(r.ascaleX-1+this.data.offsetScaleX)*i+1),f>1e-5&&(f*=(r.ascaleY-1+this.data.offsetScaleY)*i+1));var p=h.ashearY;0!=n&&(p+=(r.ashearY+this.data.offsetShearY)*n),h.updateWorldTransformWith(u,c,l,d,f,h.ashearX,p)}},e}();t.TransformConstraint=e}(n||(n={})),function(t){var e=function(t){function e(e){var i=t.call(this,e,0,!1)||this;return i.bones=new Array,i.rotateMix=0,i.translateMix=0,i.scaleMix=0,i.shearMix=0,i.offsetRotation=0,i.offsetX=0,i.offsetY=0,i.offsetScaleX=0,i.offsetScaleY=0,i.offsetShearY=0,i.relative=!1,i.local=!1,i}return r(e,t),e}(t.ConstraintData);t.TransformConstraintData=e}(n||(n={})),function(t){var e=function(){function e(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new t.Pool((function(){return new Array})),this.polygonIndicesPool=new t.Pool((function(){return new Array}))}return e.prototype.triangulate=function(t){var i=t,n=t.length>>1,r=this.indicesArray;r.length=0;for(var s=0;s3;){for(var l=n-1,u=(s=0,1);;){t:if(!a[s]){for(var c=r[l]<<1,d=r[s]<<1,f=r[u]<<1,p=i[c],v=i[c+1],g=i[d],m=i[d+1],M=i[f],x=i[f+1],y=(u+1)%n;y!=l;y=(y+1)%n)if(a[y]){var w=r[y]<<1,E=i[w],b=i[w+1];if(e.positiveArea(M,x,p,v,E,b)&&e.positiveArea(p,v,g,m,E,b)&&e.positiveArea(g,m,M,x,E,b))break t}break}if(0==u){do{if(!a[s])break;s--}while(s>0);break}l=s,s=u,u=(u+1)%n}h.push(r[(n+s-1)%n]),h.push(r[s]),h.push(r[(s+1)%n]),r.splice(s,1),a.splice(s,1);var T=(--n+s-1)%n,A=s==n?0:s;a[T]=e.isConcave(T,n,i,r),a[A]=e.isConcave(A,n,i,r)}return 3==n&&(h.push(r[2]),h.push(r[0]),h.push(r[1])),h},e.prototype.decompose=function(t,i){var n=t,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var s=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(s),s.length=0;var a=this.polygonIndicesPool.obtain();a.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,u=0,c=i.length;u0?(r.push(o),s.push(a)):(this.polygonPool.free(o),this.polygonIndicesPool.free(a)),(o=this.polygonPool.obtain()).length=0,o.push(v),o.push(g),o.push(m),o.push(M),o.push(x),o.push(y),(a=this.polygonIndicesPool.obtain()).length=0,a.push(d),a.push(f),a.push(p),l=e.winding(v,g,m,M,x,y),h=d)}o.length>0&&(r.push(o),s.push(a));for(u=0,c=r.length;u=0;u--)0==(o=r[u]).length&&(r.splice(u,1),this.polygonPool.free(o),a=s[u],s.splice(u,1),this.polygonIndicesPool.free(a));return r},e.isConcave=function(t,e,i,n){var r=n[(e+t-1)%e]<<1,s=n[t]<<1,a=n[(t+1)%e]<<1;return!this.positiveArea(i[r],i[r+1],i[s],i[s+1],i[a],i[a+1])},e.positiveArea=function(t,e,i,n,r,s){return t*(s-n)+i*(e-s)+r*(n-e)>=0},e.winding=function(t,e,i,n,r,s){var a=i-t,o=n-e;return r*o-s*a+a*e-t*o>=0?1:-1},e}();t.Triangulator=e}(n||(n={})),function(t){var e=function(){function t(){this.array=new Array}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return null!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t}();t.IntSet=e;var i=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.r=t,this.g=e,this.b=i,this.a=n}return t.prototype.set=function(t,e,i,n){return this.r=t,this.g=e,this.b=i,this.a=n,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,i,n){return this.r+=t,this.g+=e,this.b+=i,this.a+=n,this.clamp(),this},t.prototype.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.rgba8888ToColor=function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},t.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();t.Color=i;var n=function(){function t(){}return t.clamp=function(t,e,i){return ti?i:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,i){return t.randomTriangularWith(e,i,.5*(e+i))},t.randomTriangularWith=function(t,e,i){var n=Math.random(),r=e-t;return n<=(i-t)/r?t+Math.sqrt(n*r*(i-t)):e-Math.sqrt((1-n)*r*(e-i))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();t.MathUtils=n;var s=function(){function t(){}return t.prototype.apply=function(t,e,i){return t+(e-t)*this.applyInternal(i)},t}();t.Interpolation=s;var a=function(t){function e(e){var i=t.call(this)||this;return i.power=2,i.power=e,i}return r(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1},e}(s);t.Pow=a;var o=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(a);t.PowOut=o;var h=function(){function t(){}return t.arrayCopy=function(t,e,i,n,r){for(var s=e,a=n;s=i?e:t.setArraySize(e,i,n)},t.newArray=function(t,e){for(var i=new Array(t),n=0;n0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();t.TimeKeeper=d;var f=function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*s;var a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,d=0;d0&&(h=o);for(var y,w=(y=t.bone).worldX,E=y.worldY,b=y.a,T=y.b,A=y.c,R=y.d,S=e,C=r;Cthis.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length},e.prototype.setIndices=function(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length},e.prototype.draw=function(t,e){this.drawWithOffset(t,e,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)},e.prototype.drawWithOffset=function(t,e,i,n){var r=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?r.drawElements(e,n,r.UNSIGNED_SHORT,2*i):r.drawArrays(e,i,n),this.unbind(t)},e.prototype.bind=function(t){var e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);for(var i=0,n=0;n0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)},e.prototype.unbind=function(t){for(var e=this.context.gl,i=0;i0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)},e.prototype.update=function(){var t=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=t.createBuffer()),t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),t.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),t.DYNAMIC_DRAW),this.dirtyIndices=!1)},e.prototype.restore=function(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()},e.prototype.dispose=function(){this.context.removeRestorable(this);var t=this.context.gl;t.deleteBuffer(this.verticesBuffer),t.deleteBuffer(this.indicesBuffer)},e}();t.Mesh=e;var i=function(t,e,i){this.name=t,this.type=e,this.numElements=i};t.VertexAttribute=i;var n=function(e){function i(){return e.call(this,t.Shader.POSITION,h.Float,2)||this}return r(i,e),i}(i);t.Position2Attribute=n;var s=function(e){function i(){return e.call(this,t.Shader.POSITION,h.Float,3)||this}return r(i,e),i}(i);t.Position3Attribute=s;var a=function(e){function i(i){return void 0===i&&(i=0),e.call(this,t.Shader.TEXCOORDS+(0==i?"":i),h.Float,2)||this}return r(i,e),i}(i);t.TexCoordAttribute=a;var o=function(e){function i(){return e.call(this,t.Shader.COLOR,h.Float,4)||this}return r(i,e),i}(i);t.ColorAttribute=o;var h,l=function(e){function i(){return e.call(this,t.Shader.COLOR2,h.Float,4)||this}return r(i,e),i}(i);t.Color2Attribute=l,function(t){t[t.Float=0]="Float"}(h=t.VertexAttributeType||(t.VertexAttributeType={}))}(t.webgl||(t.webgl={}))}(n||(n={})),function(t){!function(t){var e=function(){function e(e,i,n){if(void 0===i&&(i=!0),void 0===n&&(n=10920),this.isDrawing=!1,this.shader=null,this.lastTexture=null,this.verticesLength=0,this.indicesLength=0,n>10920)throw new Error("Can't have more than 10920 triangles per batch: "+n);this.context=e instanceof t.ManagedWebGLRenderingContext?e:new t.ManagedWebGLRenderingContext(e);var r=i?[new t.Position2Attribute,new t.ColorAttribute,new t.TexCoordAttribute,new t.Color2Attribute]:[new t.Position2Attribute,new t.ColorAttribute,new t.TexCoordAttribute];this.mesh=new t.Mesh(e,r,n,3*n),this.srcBlend=this.context.gl.SRC_ALPHA,this.dstBlend=this.context.gl.ONE_MINUS_SRC_ALPHA}return e.prototype.begin=function(t){var e=this.context.gl;if(this.isDrawing)throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=t,this.lastTexture=null,this.isDrawing=!0,e.enable(e.BLEND),e.blendFunc(this.srcBlend,this.dstBlend)},e.prototype.setBlendMode=function(t,e){var i=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),i.blendFunc(this.srcBlend,this.dstBlend))},e.prototype.draw=function(t,e,i){t!=this.lastTexture?(this.flush(),this.lastTexture=t):(this.verticesLength+e.length>this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();var n=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);for(var r=this.mesh.getIndices(),s=this.indicesLength,a=0;a0||this.indicesLength>0)&&this.flush(),this.shader=null,this.lastTexture=null,this.isDrawing=!1,t.disable(t.BLEND)},e.prototype.getDrawCalls=function(){return this.drawCalls},e.prototype.dispose=function(){this.mesh.dispose()},e}();t.PolygonBatcher=e}(t.webgl||(t.webgl={}))}(n||(n={})),function(t){!function(e){var i,n=function(){function n(i,n,r){void 0===r&&(r=!0),this.twoColorTint=!1,this.activeRenderer=null,this.QUAD=[0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0],this.QUAD_TRIANGLES=[0,1,2,2,3,0],this.WHITE=new t.Color(1,1,1,1),this.canvas=i,this.context=n instanceof e.ManagedWebGLRenderingContext?n:new e.ManagedWebGLRenderingContext(n),this.twoColorTint=r,this.camera=new e.OrthoCamera(i.width,i.height),this.batcherShader=r?e.Shader.newTwoColoredTextured(this.context):e.Shader.newColoredTextured(this.context),this.batcher=new e.PolygonBatcher(this.context,r),this.shapesShader=e.Shader.newColored(this.context),this.shapes=new e.ShapeRenderer(this.context),this.skeletonRenderer=new e.SkeletonRenderer(this.context,r),this.skeletonDebugRenderer=new e.SkeletonDebugRenderer(this.context)}return n.prototype.begin=function(){this.camera.update(),this.enableRenderer(this.batcher)},n.prototype.drawSkeleton=function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=-1),void 0===n&&(n=-1),this.enableRenderer(this.batcher),this.skeletonRenderer.premultipliedAlpha=e,this.skeletonRenderer.draw(this.batcher,t,i,n)},n.prototype.drawSkeletonDebug=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=null),this.enableRenderer(this.shapes),this.skeletonDebugRenderer.premultipliedAlpha=e,this.skeletonDebugRenderer.draw(this.shapes,t,i)},n.prototype.drawTexture=function(t,e,i,n,r,s){void 0===s&&(s=null),this.enableRenderer(this.batcher),null===s&&(s=this.WHITE);var a=this.QUAD,o=0;a[o++]=e,a[o++]=i,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=0,a[o++]=1,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),a[o++]=e+n,a[o++]=i,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=1,a[o++]=1,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),a[o++]=e+n,a[o++]=i+r,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=1,a[o++]=0,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),a[o++]=e,a[o++]=i+r,a[o++]=s.r,a[o++]=s.g,a[o++]=s.b,a[o++]=s.a,a[o++]=0,a[o++]=0,this.twoColorTint&&(a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0),this.batcher.draw(t,a,this.QUAD_TRIANGLES)},n.prototype.drawTextureUV=function(t,e,i,n,r,s,a,o,h,l){void 0===l&&(l=null),this.enableRenderer(this.batcher),null===l&&(l=this.WHITE);var u=this.QUAD,c=0;u[c++]=e,u[c++]=i,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=s,u[c++]=a,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e+n,u[c++]=i,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=o,u[c++]=a,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e+n,u[c++]=i+r,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=o,u[c++]=h,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e,u[c++]=i+r,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=s,u[c++]=h,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),this.batcher.draw(t,u,this.QUAD_TRIANGLES)},n.prototype.drawTextureRotated=function(e,i,n,r,s,a,o,h,l,u){void 0===l&&(l=null),void 0===u&&(u=!1),this.enableRenderer(this.batcher),null===l&&(l=this.WHITE);var c=this.QUAD,d=i+a,f=n+o,p=-a,v=-o,g=r-a,m=s-o,M=p,x=v,y=p,w=m,E=g,b=m,T=g,A=v,R=0,S=0,C=0,I=0,P=0,L=0,O=0,_=0;if(0!=h){var k=t.MathUtils.cosDeg(h),F=t.MathUtils.sinDeg(h);C=(P=k*E-F*b)+((R=k*M-F*x)-(O=k*y-F*w)),I=(L=F*E+k*b)+((S=F*M+k*x)-(_=F*y+k*w))}else R=M,S=x,O=y,_=w,P=E,L=b,C=T,I=A;R+=d,S+=f,C+=d,I+=f,P+=d,L+=f,O+=d,_+=f;var D=0;c[D++]=R,c[D++]=S,c[D++]=l.r,c[D++]=l.g,c[D++]=l.b,c[D++]=l.a,c[D++]=0,c[D++]=1,this.twoColorTint&&(c[D++]=0,c[D++]=0,c[D++]=0,c[D++]=0),c[D++]=C,c[D++]=I,c[D++]=l.r,c[D++]=l.g,c[D++]=l.b,c[D++]=l.a,c[D++]=1,c[D++]=1,this.twoColorTint&&(c[D++]=0,c[D++]=0,c[D++]=0,c[D++]=0),c[D++]=P,c[D++]=L,c[D++]=l.r,c[D++]=l.g,c[D++]=l.b,c[D++]=l.a,c[D++]=1,c[D++]=0,this.twoColorTint&&(c[D++]=0,c[D++]=0,c[D++]=0,c[D++]=0),c[D++]=O,c[D++]=_,c[D++]=l.r,c[D++]=l.g,c[D++]=l.b,c[D++]=l.a,c[D++]=0,c[D++]=0,this.twoColorTint&&(c[D++]=0,c[D++]=0,c[D++]=0,c[D++]=0),this.batcher.draw(e,c,this.QUAD_TRIANGLES)},n.prototype.drawRegion=function(t,e,i,n,r,s,a){void 0===s&&(s=null),void 0===a&&(a=!1),this.enableRenderer(this.batcher),null===s&&(s=this.WHITE);var o=this.QUAD,h=0;o[h++]=e,o[h++]=i,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u,o[h++]=t.v2,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),o[h++]=e+n,o[h++]=i,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u2,o[h++]=t.v2,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),o[h++]=e+n,o[h++]=i+r,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u2,o[h++]=t.v,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),o[h++]=e,o[h++]=i+r,o[h++]=s.r,o[h++]=s.g,o[h++]=s.b,o[h++]=s.a,o[h++]=t.u,o[h++]=t.v,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),this.batcher.draw(t.texture,o,this.QUAD_TRIANGLES)},n.prototype.line=function(t,e,i,n,r,s){void 0===r&&(r=null),void 0===s&&(s=null),this.enableRenderer(this.shapes),this.shapes.line(t,e,i,n,r)},n.prototype.triangle=function(t,e,i,n,r,s,a,o,h,l){void 0===o&&(o=null),void 0===h&&(h=null),void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.triangle(t,e,i,n,r,s,a,o,h,l)},n.prototype.quad=function(t,e,i,n,r,s,a,o,h,l,u,c,d){void 0===l&&(l=null),void 0===u&&(u=null),void 0===c&&(c=null),void 0===d&&(d=null),this.enableRenderer(this.shapes),this.shapes.quad(t,e,i,n,r,s,a,o,h,l,u,c,d)},n.prototype.rect=function(t,e,i,n,r,s){void 0===s&&(s=null),this.enableRenderer(this.shapes),this.shapes.rect(t,e,i,n,r,s)},n.prototype.rectLine=function(t,e,i,n,r,s,a){void 0===a&&(a=null),this.enableRenderer(this.shapes),this.shapes.rectLine(t,e,i,n,r,s,a)},n.prototype.polygon=function(t,e,i,n){void 0===n&&(n=null),this.enableRenderer(this.shapes),this.shapes.polygon(t,e,i,n)},n.prototype.circle=function(t,e,i,n,r,s){void 0===r&&(r=null),void 0===s&&(s=0),this.enableRenderer(this.shapes),this.shapes.circle(t,e,i,n,r,s)},n.prototype.curve=function(t,e,i,n,r,s,a,o,h,l){void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.curve(t,e,i,n,r,s,a,o,h,l)},n.prototype.end=function(){this.activeRenderer===this.batcher?this.batcher.end():this.activeRenderer===this.shapes&&this.shapes.end(),this.activeRenderer=null},n.prototype.resize=function(t){var e=this.canvas,n=e.clientWidth,r=e.clientHeight;if(e.width==n&&e.height==r||(e.width=n,e.height=r),this.context.gl.viewport(0,0,e.width,e.height),t===i.Stretch);else if(t===i.Expand)this.camera.setViewport(n,r);else if(t===i.Fit){var s=e.width,a=e.height,o=this.camera.viewportWidth,h=this.camera.viewportHeight,l=h/o10920)throw new Error("Can't have more than 10920 triangles per batch: "+r);this.context=n instanceof e.ManagedWebGLRenderingContext?n:new e.ManagedWebGLRenderingContext(n),this.mesh=new e.Mesh(n,[new e.Position2Attribute,new e.ColorAttribute],r,0),this.srcBlend=this.context.gl.SRC_ALPHA,this.dstBlend=this.context.gl.ONE_MINUS_SRC_ALPHA}return n.prototype.begin=function(t){if(this.isDrawing)throw new Error("ShapeRenderer.begin() has already been called");this.shader=t,this.vertexIndex=0,this.isDrawing=!0;var e=this.context.gl;e.enable(e.BLEND),e.blendFunc(this.srcBlend,this.dstBlend)},n.prototype.setBlendMode=function(t,e){var i=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),i.blendFunc(this.srcBlend,this.dstBlend))},n.prototype.setColor=function(t){this.color.setFromColor(t)},n.prototype.setColorWith=function(t,e,i,n){this.color.set(t,e,i,n)},n.prototype.point=function(t,e,n){void 0===n&&(n=null),this.check(i.Point,1),null===n&&(n=this.color),this.vertex(t,e,n)},n.prototype.line=function(t,e,n,r,s){void 0===s&&(s=null),this.check(i.Line,2);this.mesh.getVertices(),this.vertexIndex;null===s&&(s=this.color),this.vertex(t,e,s),this.vertex(n,r,s)},n.prototype.triangle=function(t,e,n,r,s,a,o,h,l,u){void 0===h&&(h=null),void 0===l&&(l=null),void 0===u&&(u=null),this.check(t?i.Filled:i.Line,3);this.mesh.getVertices(),this.vertexIndex;null===h&&(h=this.color),null===l&&(l=this.color),null===u&&(u=this.color),t?(this.vertex(e,n,h),this.vertex(r,s,l),this.vertex(a,o,u)):(this.vertex(e,n,h),this.vertex(r,s,l),this.vertex(r,s,h),this.vertex(a,o,l),this.vertex(a,o,h),this.vertex(e,n,l))},n.prototype.quad=function(t,e,n,r,s,a,o,h,l,u,c,d,f){void 0===u&&(u=null),void 0===c&&(c=null),void 0===d&&(d=null),void 0===f&&(f=null),this.check(t?i.Filled:i.Line,3);this.mesh.getVertices(),this.vertexIndex;null===u&&(u=this.color),null===c&&(c=this.color),null===d&&(d=this.color),null===f&&(f=this.color),t?(this.vertex(e,n,u),this.vertex(r,s,c),this.vertex(a,o,d),this.vertex(a,o,d),this.vertex(h,l,f),this.vertex(e,n,u)):(this.vertex(e,n,u),this.vertex(r,s,c),this.vertex(r,s,c),this.vertex(a,o,d),this.vertex(a,o,d),this.vertex(h,l,f),this.vertex(h,l,f),this.vertex(e,n,u))},n.prototype.rect=function(t,e,i,n,r,s){void 0===s&&(s=null),this.quad(t,e,i,e+n,i,e+n,i+r,e,i+r,s,s,s,s)},n.prototype.rectLine=function(t,e,n,r,s,a,o){void 0===o&&(o=null),this.check(t?i.Filled:i.Line,8),null===o&&(o=this.color);var h=this.tmp.set(s-n,e-r);h.normalize(),a*=.5;var l=h.x*a,u=h.y*a;t?(this.vertex(e+l,n+u,o),this.vertex(e-l,n-u,o),this.vertex(r+l,s+u,o),this.vertex(r-l,s-u,o),this.vertex(r+l,s+u,o),this.vertex(e-l,n-u,o)):(this.vertex(e+l,n+u,o),this.vertex(e-l,n-u,o),this.vertex(r+l,s+u,o),this.vertex(r-l,s-u,o),this.vertex(r+l,s+u,o),this.vertex(e+l,n+u,o),this.vertex(r-l,s-u,o),this.vertex(e-l,n-u,o))},n.prototype.x=function(t,e,i){this.line(t-i,e-i,t+i,e+i),this.line(t-i,e+i,t+i,e-i)},n.prototype.polygon=function(t,e,n,r){if(void 0===r&&(r=null),n<3)throw new Error("Polygon must contain at least 3 vertices");this.check(i.Line,2*n),null===r&&(r=this.color);this.mesh.getVertices(),this.vertexIndex;n<<=1;for(var s=t[e<<=1],a=t[e+1],o=e+n,h=e,l=e+n-2;h=o?(d=s,f=a):(d=t[h+2],f=t[h+3]),this.vertex(u,c,r),this.vertex(d,f,r)}},n.prototype.circle=function(e,n,r,s,a,o){if(void 0===a&&(a=null),void 0===o&&(o=0),0===o&&(o=Math.max(1,6*t.MathUtils.cbrt(s)|0)),o<=0)throw new Error("segments must be > 0.");null===a&&(a=this.color);var h=2*t.MathUtils.PI/o,l=Math.cos(h),u=Math.sin(h),c=s,d=0;if(e){this.check(i.Filled,3*o+3),o--;for(p=0;p0;)this.vertex(E,b,u),E+=T,b+=A,T+=R,A+=S,R+=C,S+=I,this.vertex(E,b,u);this.vertex(E,b,u),this.vertex(o,h,u)},n.prototype.vertex=function(t,e,i){var n=this.vertexIndex,r=this.mesh.getVertices();r[n++]=t,r[n++]=e,r[n++]=i.r,r[n++]=i.g,r[n++]=i.b,r[n++]=i.a,this.vertexIndex=n},n.prototype.end=function(){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");this.flush(),this.context.gl.disable(this.context.gl.BLEND),this.isDrawing=!1},n.prototype.flush=function(){0!=this.vertexIndex&&(this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0)},n.prototype.check=function(t,e){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");if(this.shapeType==t){if(!(this.mesh.maxVertices()-this.mesh.numVertices()-1)&&null!=d.parent){var f=s+d.data.length*d.a+d.worldX,p=a+d.data.length*d.c+d.worldY;e.rectLine(!0,s+d.worldX,a+d.worldY,f,p,this.boneWidth*this.scale)}}this.drawSkeletonXY&&e.x(s,a,4*this.scale)}if(this.drawRegionAttachments){e.setColor(this.attachmentLineColor);for(u=0,c=(Y=n.slots).length;u0){e.setColor(this.attachmentLineColor);var A=g[(x=2*(x>>1))-2],R=g[x-1];for(y=0,w=x;y-1||e.circle(!0,s+d.worldX,a+d.worldY,3*this.scale,i.GREEN,8)}}if(this.drawClipping){var Y=n.slots;e.setColor(this.clipColor);for(u=0,c=Y.length;u=0&&s==R.data.index&&(E=!0),E){a>=0&&a==R.data.index&&(E=!1);var S=R.getAttachment(),C=null;if(S instanceof t.RegionAttachment){var I=S;v.vertices=this.vertices,v.numVertices=4,v.numFloats=A<<2,I.computeWorldVertices(R.bone,v.vertices,0,A),m=n.QUAD_TRIANGLES,g=I.uvs,C=I.region.renderObject.texture,x=I.color}else{if(!(S instanceof t.MeshAttachment)){if(S instanceof t.ClippingAttachment){var P=S;o.clipStart(R,P);continue}o.clipEndWithSlot(R);continue}var L=S;v.vertices=this.vertices,v.numVertices=L.worldVerticesLength>>1,v.numFloats=v.numVertices*A,v.numFloats>v.vertices.length&&(v.vertices=this.vertices=t.Utils.newFloatArray(v.numFloats)),L.computeWorldVertices(R,0,L.worldVerticesLength,v.vertices,0,A),m=L.triangles,C=L.region.renderObject.texture,g=L.uvs,x=L.color}if(null!=C){var O=R.color,_=this.tempColor;_.r=y.r*O.r*x.r,_.g=y.g*O.g*x.g,_.b=y.b*O.b*x.b,_.a=y.a*O.a*x.a,h&&(_.r*=_.a,_.g*=_.a,_.b*=_.a);var k=this.tempColor2;null==R.darkColor?k.set(0,0,0,1):(h?(k.r=R.darkColor.r*_.a,k.g=R.darkColor.g*_.a,k.b=R.darkColor.b*_.a):k.setFromColor(R.darkColor),k.a=h?1:0);var F=R.data.blendMode;if(F!=u&&(u=F,i.setBlendMode(e.WebGLBlendModeConverter.getSourceGLBlendMode(u,h),e.WebGLBlendModeConverter.getDestGLBlendMode(u))),o.isClipping()){o.clipTriangles(v.vertices,v.numFloats,m,m.length,g,_,k,l);var D=new Float32Array(o.clippedVertices),V=o.clippedTriangles;if(null!=this.vertexEffect){var N=this.vertexEffect,B=D;if(l){U=0;for(var X=D.length;U-1&&this.restorables.splice(e,1)},t}();e.ManagedWebGLRenderingContext=i;var n=function(){function e(){}return e.getDestGLBlendMode=function(i){switch(i){case t.BlendMode.Normal:return e.ONE_MINUS_SRC_ALPHA;case t.BlendMode.Additive:return e.ONE;case t.BlendMode.Multiply:case t.BlendMode.Screen:return e.ONE_MINUS_SRC_ALPHA;default:throw new Error("Unknown blend mode: "+i)}},e.getSourceGLBlendMode=function(i,n){switch(void 0===n&&(n=!1),i){case t.BlendMode.Normal:case t.BlendMode.Additive:return n?e.ONE:e.SRC_ALPHA;case t.BlendMode.Multiply:return e.DST_COLOR;case t.BlendMode.Screen:return e.ONE;default:throw new Error("Unknown blend mode: "+i)}},e.ZERO=0,e.ONE=1,e.SRC_COLOR=768,e.ONE_MINUS_SRC_COLOR=769,e.SRC_ALPHA=770,e.ONE_MINUS_SRC_ALPHA=771,e.DST_ALPHA=772,e.ONE_MINUS_DST_ALPHA=773,e.DST_COLOR=774,e}();e.WebGLBlendModeConverter=n}(t.webgl||(t.webgl={}))}(n||(n={})),t.exports=n}).call(window)},3524:(t,e,i)=>{var n=i(7473),r=i(4597),s=i(6732),a=i(2482),o=i(704),h=i(3137),l=i(1192),u=new n({Extends:h,initialize:function(t,e,i,n,s,u,c){var d,f,p,v=[],g=t.cacheManager.custom.spine;if(a(e)){var m=e;for(e=r(m,"key"),f=new o(t,{key:e,url:r(m,"jsonURL"),extension:r(m,"jsonExtension","json"),xhrSettings:r(m,"jsonXhrSettings")}),n=r(m,"atlasURL"),s=r(m,"preMultipliedAlpha"),Array.isArray(n)||(n=[n]),d=0;d{var n=i(2494),r=i(7473),s=i(5851),a=i(3527),o=i(5722),h=i(6937),l=i(3524),u=i(8332),c=i(5782),d=i(1984),f=new r({Extends:o,initialize:function(t,e,i){o.call(this,t,e,i);var r=e.game;this.isWebGL=2===r.config.renderType,this.cache=r.cache.addCustom("spine"),this.spineTextures=r.cache.addCustom("spineTextures"),this.json=r.cache.json,this.textures=r.textures,this.drawDebug=!1,this.gl,this.renderer,this.sceneRenderer,this.skeletonRenderer,this.skeletonDebugRenderer,this.plugin=h,this.temp1,this.temp2,this.isWebGL?(this.runtime=h.webgl,this.renderer=r.renderer,this.gl=r.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=r.renderer,this.getAtlas=this.getAtlasCanvas),this.renderer||(this.renderer={width:r.scale.width,height:r.scale.height,preRender:d,postRender:d,render:d,destroy:d});var a=this.isWebGL;e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",(function(t,e,n,r,s){a&&this.scene.sys.renderer.pipelines.clear();var o=this.scene.sys[i],h=new u(this.scene,o,t,e,n,r,s);return this.displayList.add(h),this.updateList.add(h),a&&this.scene.sys.renderer.pipelines.rebind(),h}),(function(t,e){void 0===t&&(t={}),a&&this.scene.sys.renderer.pipelines.clear();var r=s(t,"key",null),o=s(t,"animationName",null),h=s(t,"loop",!1),l=this.scene.sys[i],c=new u(this.scene,l,0,0,r,o,h);void 0!==e&&(t.add=e),n(this.scene,c,t);var d=s(t,"skinName",!1);d&&c.setSkinByName(d);var f=s(t,"slotName",!1),p=s(t,"attachmentName",null);return f&&c.setAttachment(f,p),a&&this.scene.sys.renderer.pipelines.rebind(),c.refresh()})),e.registerGameObject("spineContainer",(function(t,e,n){var r=this.scene.sys[i],s=new c(this.scene,r,t,e,n);return this.displayList.add(s),s}),(function(t,e){void 0===t&&(t={});var r=s(t,"x",0),a=s(t,"y",0),o=s(t,"children",null),h=this.scene.sys[i],l=new c(this.scene,h,r,a,o);return void 0!==e&&(t.add=e),n(this.scene,l,t),l}))},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(a,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this),this.game.events.once("destroy",this.gameDestroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){var t=function(t,e){if(t!==this.srcBlend||e!==this.dstBlend){var i=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),i.blendFunc(this.srcBlend,this.dstBlend))}},e=this.renderer.spineSceneRenderer;e||((e=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0)).batcher.setBlendMode=t,e.shapes.setBlendMode=t,this.renderer.spineSceneRenderer=e),this.sceneRenderer=e,this.skeletonRenderer=e.skeletonRenderer,this.skeletonDebugRenderer=e.skeletonDebugRenderer,this.temp1=new h.webgl.Vector3(0,0,0),this.temp2=new h.webgl.Vector3(0,0,0)},getAtlasCanvas:function(t){var e=this.cache.get(t);if(e){var i,n=this.spineTextures;if(n.has(t))i=n.get(t);else{var r=this.textures;i=new h.TextureAtlas(e.data,(function(i){return new h.canvas.CanvasTexture(r.get(e.prefix+t+":"+i).getSourceImage())}))}return i}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var i,n=this.spineTextures;if(n.has(t))i=n.get(t);else{var r=this.textures,s=this.sceneRenderer.context.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i=new h.TextureAtlas(e.data,(function(i){return new h.webgl.GLTexture(s,r.get(e.prefix+t+":"+i).getSourceImage(),!1)}))}return i}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,i,n,r,s,a){var o;if(a=a||{},Array.isArray(t))for(var h=0;h{var n=i(7473),r=i(7361),s=i(7738),a=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,n,s){r.call(this,t,i,n,s),this.type="Spine",this.plugin=e},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null,this.plugin=null}});t.exports=a},7738:(t,e,i)=>{var n=i(1984),r=i(1984);n=i(434),t.exports={renderWebGL:n,renderCanvas:r}},434:t=>{t.exports=function(t,e,i,n){var r=e.plugin.sceneRenderer,s=e.list;if(0!==s.length){i.addToRenderList(e);var a=e.localTransform;n?(a.loadIdentity(),a.multiply(n),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.newType&&(t.pipelines.clear(),r.begin());var o=t.nextTypeMatch;t.nextTypeMatch=!0,t.newType=!1;for(var h=0;h{t.exports="complete"},8621:t=>{t.exports="dispose"},8944:t=>{t.exports="end"},7494:t=>{t.exports="event"},1908:t=>{t.exports="interrupted"},5591:t=>{t.exports="start"},5146:(t,e,i)=>{t.exports={COMPLETE:i(6576),DISPOSE:i(8621),END:i(8944),EVENT:i(7494),INTERRUPTED:i(1908),START:i(5591)}},8332:(t,e,i)=>{var n=i(6412),r=i(2915),s=i(7473),a=i(1991),o=i(3131),h=i(9660),l=i(4627),u=i(3212),c=i(8414),d=i(3426),f=i(7149),p=i(2273),v=i(4208),g=i(5146),m=i(2762),M=new s({Extends:p,Mixins:[a,o,h,l,u,c,m],initialize:function(t,e,i,n,r,s,a){p.call(this,t,"Spine"),this.plugin=e,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null,this.root=null,this.bounds=null,this.drawDebug=!1,this.timeScale=1,this.displayOriginX=0,this.displayOriginY=0,this.preMultipliedAlpha=!1,this.blendMode=-1,this.setPosition(i,n),r&&this.setSkeleton(r,s,a)},willRender:function(t,e){var i=!this.skeleton||!(15!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id);if(!e&&!i&&this.parentContainer){var n=this.plugin,r=n.sceneRenderer;n.gl&&r.batcher.isDrawing&&(r.end(),n.renderer.pipelines.rebind())}return i},setAlpha:function(t,e){if(void 0===t&&(t=1),e){var i=this.findSlot(e);i&&(i.color.a=r(t,0,1))}else this.alpha=t;return this},alpha:{get:function(){return this.skeleton.color.a},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.a=e),0===e?this.renderFlags&=-3:this.renderFlags|=2}},red:{get:function(){return this.skeleton.color.r},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.r=e)}},green:{get:function(){return this.skeleton.color.g},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.g=e)}},blue:{get:function(){return this.skeleton.color.b},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.b=e)}},setColor:function(t,e){void 0===t&&(t=16777215);var i=(t>>16&255)/255,n=(t>>8&255)/255,r=(255&t)/255,s=t>16777215?(t>>>24)/255:null,a=this.skeleton;if(e){var o=this.findSlot(e);o&&(a=o)}return a.color.r=i,a.color.g=n,a.color.b=r,null!==s&&(a.color.a=s),this},setSkeletonFromJSON:function(t,e,i,n){return this.setSkeleton(t,e,i,n)},setSkeleton:function(t,e,i,n){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,n);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkin(),s.setToSetupPose(),this.skeleton=s,r=this.plugin.createAnimationState(s),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=v(d(this.rotation))+90),this.state.apply(s),s.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=v(d(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,n){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===i&&(i=0),void 0===n&&(n=0),this.width=t,this.height=e,this.displayOriginX=r.x-i,this.displayOriginY=r.y-n,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,n=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=i,t.scaleY=n,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i{var n=i(1984),r=i(1984),s=i(1984);n=i(4290),s=i(780),t.exports={renderWebGL:n,renderCanvas:r,renderDirect:s}},780:(t,e,i)=>{var n=i(2915),r=i(3426),s=i(2208),a=i(4208),o=i(8445);t.exports=function(t,e,i,h,l){var u=e.plugin,c=e.skeleton,d=u.sceneRenderer;t.pipelines.clear(),d.begin();var f=e.scrollFactorX,p=e.scrollFactorY,v=c.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,c.color.a=n(v*l.alpha,0,1)),i.addToRenderList(e);var g=s(e,i,h).calc,m=t.height;if(c.x=g.tx,c.y=m-g.ty,c.scaleX=g.scaleX,c.scaleY=g.scaleY,e.scaleX<0?(c.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(r(g.rotationNormalized))+90,0,360),e.scaleY<0&&(c.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),c.updateWorldTransform(),d.drawSkeleton(c,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,c.color.a=v),u.drawDebug||e.drawDebug){var M=c.x,x=c.y;c.x=0,c.y=0,d.drawSkeletonDebug(c,e.preMultipliedAlpha),c.x=M,c.y=x}d.end(),t.pipelines.rebind()}},4290:(t,e,i)=>{var n=i(2915),r=i(3426),s=i(2208),a=i(4208),o=i(8445);t.exports=function(t,e,i,h,l){var u=e.plugin,c=e.skeleton,d=u.sceneRenderer;t.newType&&(t.pipelines.clear(),d.begin());var f=e.scrollFactorX,p=e.scrollFactorY,v=c.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,c.color.a=n(v*l.alpha,0,1)),i.addToRenderList(e);var g=s(e,i,h).calc,m=t.height;if(c.x=g.tx,c.y=m-g.ty,c.scaleX=g.scaleX,c.scaleY=g.scaleY,e.scaleX<0?(c.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(r(g.rotationNormalized))+90,0,360),e.scaleY<0&&(c.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),c.updateWorldTransform(),d.drawSkeleton(c,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,c.color.a=v),u.drawDebug||e.drawDebug){var M=c.x,x=c.y;c.x=0,c.y=0,d.drawSkeletonDebug(c,e.preMultipliedAlpha),c.x=M,c.y=x,d.end(),t.pipelines.rebind()}else t.nextTypeMatch||(d.end(),t.pipelines.rebind())}},9454:(t,e,i)=>{var n={VERSION:"3.60.0",BlendModes:i(8351),ScaleModes:i(8196),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},1081:(t,e,i)=>{var n=i(7473),r=i(6748),s=new n({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(r.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n{t.exports="changedata"},7801:t=>{t.exports="changedata-"},4873:t=>{t.exports="destroy"},9966:t=>{t.exports="removedata"},4586:t=>{t.exports="setdata"},6748:(t,e,i)=>{t.exports={CHANGE_DATA:i(9044),CHANGE_DATA_KEY:i(7801),DESTROY:i(4873),REMOVE_DATA:i(9966),SET_DATA:i(4586)}},3004:(t,e,i)=>{var n=i(2776),r={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return r;r.audioData=!!window.Audio,r.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var n=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(n||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(n)};if(r.ogg=i('ogg; codecs="vorbis"'),r.opus=i('ogg; codecs="opus"',"opus"),r.mp3=i("mpeg"),r.wav=i("wav"),r.m4a=i("x-m4a"),r.aac=i("aac"),r.flac=i("flac","x-flac"),r.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(n.edge)r.dolby=!0;else if(n.safari&&n.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var s=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===s&&a>=11||s>10)&&(r.dolby=!0)}}}catch(t){}return r}()},2776:(t,e,i)=>{var n,r=i(5203),s={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(n=navigator.userAgent,/Edg\/\d+/.test(n)?(s.edge=!0,s.es2019=!0):/OPR/.test(n)?(s.opera=!0,s.es2019=!0):/Chrome\/(\d+)/.test(n)&&!r.windowsPhone?(s.chrome=!0,s.chromeVersion=parseInt(RegExp.$1,10),s.es2019=s.chromeVersion>69):/Firefox\D+(\d+)/.test(n)?(s.firefox=!0,s.firefoxVersion=parseInt(RegExp.$1,10),s.es2019=s.firefoxVersion>10):/AppleWebKit/.test(n)&&r.iOS?s.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(s.ie=!0,s.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+) Safari/.test(n)&&!r.windowsPhone?(s.safari=!0,s.safariVersion=parseInt(RegExp.$1,10),s.es2019=s.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(s.ie=!0,s.trident=!0,s.tridentVersion=parseInt(RegExp.$1,10),s.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(s.silk=!0),s)},6505:(t,e,i)=>{var n,r,s,a=i(8073),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",r="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(s=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(s,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+r},s.src=n+"AP804Oa6"+r,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),n=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),n}()),o)},6543:(t,e,i)=>{var n=i(5203),r=i(2776),s=i(8073),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=s.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=s.create2D(this),n=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=n.data instanceof Uint8ClampedArray,s.remove(t),s.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!n.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},3922:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",n="FullScreen",r=["request"+i,"request"+n,"webkitRequest"+i,"webkitRequest"+n,"msRequest"+i,"msRequest"+n,"mozRequest"+n,"mozRequest"+i];for(t=0;t{var n=i(2776),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||n.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":n.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},5203:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},2131:(t,e,i)=>{var n=i(4597),r={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return r;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(r.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(r.h264=!0,r.mp4=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(r.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(r.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(r.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(r.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),r.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e{t.exports={os:i(5203),browser:i(2776),features:i(6543),input:i(1454),audio:i(3004),video:i(2131),fullscreen:i(3922),canvasFeatures:i(6505)}},5686:(t,e,i)=>{var n=i(7473),r=new Float32Array(20),s=new n({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(t){return this._matrix.set(t),this._dirty=!0,this},reset:function(){var t=this._matrix;return t.fill(0),t[0]=1,t[6]=1,t[12]=1,t[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var t=this._data;return this._dirty&&(t.set(this._matrix),t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._dirty=!1),t},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,n=-.5*(i-1);return this.multiply([i,n,n,0,0,n,i,n,0,0,n,n,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),n=Math.sin(t),r=.213,s=.715,a=.072;return this.multiply([r+.787*i+n*-r,s+i*-s+n*-s,a+i*-a+.928*n,0,0,r+i*-r+.143*n,s+i*(1-s)+.14*n,a+i*-a+-.283*n,0,0,r+i*-r+-.787*n,s+i*-s+n*s,a+.928*i+n*a,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply(s.BLACK_WHITE,t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,n=-.5*(i-1);return this.multiply([i,0,0,0,n,0,i,0,0,n,0,0,i,0,n,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply(s.NEGATIVE,t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply(s.DESATURATE_LUMINANCE,t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply(s.SEPIA,t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply(s.LSD,t)},brown:function(t){return void 0===t&&(t=!1),this.multiply(s.BROWN,t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply(s.VINTAGE,t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply(s.KODACHROME,t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply(s.TECHNICOLOR,t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply(s.POLAROID,t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply(s.SHIFT_BGR,t)},multiply:function(t,e){void 0===e&&(e=!1),e||this.reset();var i=this._matrix,n=r;return n.set(i),i.set([n[0]*t[0]+n[1]*t[5]+n[2]*t[10]+n[3]*t[15],n[0]*t[1]+n[1]*t[6]+n[2]*t[11]+n[3]*t[16],n[0]*t[2]+n[1]*t[7]+n[2]*t[12]+n[3]*t[17],n[0]*t[3]+n[1]*t[8]+n[2]*t[13]+n[3]*t[18],n[0]*t[4]+n[1]*t[9]+n[2]*t[14]+n[3]*t[19]+n[4],n[5]*t[0]+n[6]*t[5]+n[7]*t[10]+n[8]*t[15],n[5]*t[1]+n[6]*t[6]+n[7]*t[11]+n[8]*t[16],n[5]*t[2]+n[6]*t[7]+n[7]*t[12]+n[8]*t[17],n[5]*t[3]+n[6]*t[8]+n[7]*t[13]+n[8]*t[18],n[5]*t[4]+n[6]*t[9]+n[7]*t[14]+n[8]*t[19]+n[9],n[10]*t[0]+n[11]*t[5]+n[12]*t[10]+n[13]*t[15],n[10]*t[1]+n[11]*t[6]+n[12]*t[11]+n[13]*t[16],n[10]*t[2]+n[11]*t[7]+n[12]*t[12]+n[13]*t[17],n[10]*t[3]+n[11]*t[8]+n[12]*t[13]+n[13]*t[18],n[10]*t[4]+n[11]*t[9]+n[12]*t[14]+n[13]*t[19]+n[14],n[15]*t[0]+n[16]*t[5]+n[17]*t[10]+n[18]*t[15],n[15]*t[1]+n[16]*t[6]+n[17]*t[11]+n[18]*t[16],n[15]*t[2]+n[16]*t[7]+n[17]*t[12]+n[18]*t[17],n[15]*t[3]+n[16]*t[8]+n[17]*t[13]+n[18]*t[18],n[15]*t[4]+n[16]*t[9]+n[17]*t[14]+n[18]*t[19]+n[19]]),this._dirty=!0,this}});s.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],s.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],s.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],s.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],s.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],s.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],s.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],s.KODACHROME=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],s.TECHNICOLOR=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],s.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],s.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t.exports=s},8073:(t,e,i)=>{var n,r,s,a=i(9454),o=i(2150),h=[],l=!1;t.exports=(s=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return n(t,e,i,a.CANVAS)},create:n=function(t,e,i,n,s){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=a.CANVAS),void 0===s&&(s=!1);var c=r(n);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:n},n===a.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),s&&(c.parent=u),u.width=e,u.height=i,l&&n===a.CANVAS&&o.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return n(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:r=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{var n=i(7473),r=i(3649),s=new n({initialize:function(t,e,i,n,r,s){e||(e=t.sys.make.image({x:i,y:n,key:r,frame:s,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});r.register("bitmapMask",(function(t,e,i,n,r){return new s(this.scene,t,e,i,n,r)})),t.exports=s},6726:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var n=t.gl;t.flush(),0===t.maskStack.length&&(n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var n=t.gl,r=this.geometryMask,s=t.maskCount,a=255;n.colorMask(!1,!1,!1,!1),i?(n.stencilFunc(n.EQUAL,s,a),n.stencilOp(n.KEEP,n.KEEP,n.INCR),s++):(n.stencilFunc(n.EQUAL,s+1,a),n.stencilOp(n.KEEP,n.KEEP,n.DECR)),this.level=s,r.renderWebGL(t,r,e),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),this.invertAlpha?n.stencilFunc(n.NOTEQUAL,s,a):n.stencilFunc(n.EQUAL,s,a)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var n=t.maskStack[t.maskStack.length-1];n.mask.applyStencil(t,n.camera,!1),t.currentCameraMask.mask!==n.mask?(i.mask=n.mask,i.camera=n.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},7340:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,s.BARREL,t),this.amount=e}});t.exports=a},5170:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h){void 0===i&&(i=1),void 0===n&&(n=1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=4),r.call(this,s.BLOOM,t),this.steps=h,this.offsetX=i,this.offsetY=n,this.blurStrength=a,this.strength=o,this.glcolor=[1,1,1],null!=e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4199:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h){void 0===e&&(e=0),void 0===i&&(i=2),void 0===n&&(n=2),void 0===a&&(a=1),void 0===h&&(h=4),r.call(this,s.BLUR,t),this.quality=0,this.x=i,this.y=n,this.steps=h,this.strength=a,this.glcolor=[1,1,1],null!=o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},3132:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===n&&(n=.2),void 0===a&&(a=!1),void 0===o&&(o=1),void 0===h&&(h=1),void 0===l&&(l=1),r.call(this,s.BOKEH,t),this.radius=e,this.amount=i,this.contrast=n,this.isTiltShift=a,this.strength=l,this.blurX=o,this.blurY=h}});t.exports=a},6610:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o){void 0===e&&(e=8),void 0===a&&(a=1),void 0===o&&(o=.005),r.call(this,s.CIRCLE,t),this.scale=a,this.feather=o,this.thickness=e,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],null!=i&&(this.color=i),null!=n&&(this.backgroundColor=n)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundColor:{get:function(){var t=this.glcolor2;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor2;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4931:(t,e,i)=>{var n=i(7473),r=i(5686),s=i(1571),a=new n({Extends:r,initialize:function(t){r.call(this),this.type=s.COLOR_MATRIX,this.gameObject=t,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});t.exports=a},6128:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e){this.type=t,this.gameObject=e,this.active=!0},setActive:function(t){return this.active=t,this},destroy:function(){this.gameObject=null,this.active=!1}});t.exports=n},9195:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===n&&(n=.005),r.call(this,s.DISPLACEMENT,t),this.x=i,this.y=n,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.gameObject.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=a},445:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===i&&(i=4),void 0===n&&(n=0),void 0===a&&(a=!1),r.call(this,s.GLOW,t),this.outerStrength=i,this.innerStrength=n,this.knockout=a,this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},7724:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l,u){void 0===n&&(n=.2),void 0===a&&(a=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l=1),void 0===u&&(u=0),r.call(this,s.GRADIENT,t),this.alpha=n,this.size=u,this.fromX=a,this.fromY=o,this.toX=h,this.toY=l,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],null!=e&&(this.color1=e),null!=i&&(this.color2=i)},color1:{get:function(){var t=this.glcolor1;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor1;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}},color2:{get:function(){var t=this.glcolor2;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor2;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}}});t.exports=a},4412:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,s.PIXELATE,t),this.amount=e}});t.exports=a},75:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=.1),void 0===a&&(a=1),void 0===h&&(h=6),void 0===l&&(l=1),r.call(this,s.SHADOW,t),this.x=e,this.y=i,this.decay=n,this.power=a,this.glcolor=[0,0,0,1],this.samples=h,this.intensity=l,void 0!==o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},8734:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===n&&(n=3),void 0===a&&(a=!1),r.call(this,s.SHINE,t),this.speed=e,this.lineWidth=i,this.gradient=n,this.reveal=a}});t.exports=a},2437:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===a&&(a=.5),r.call(this,s.VIGNETTE,t),this.x=e,this.y=i,this.radius=n,this.strength=a}});t.exports=a},5984:(t,e,i)=>{var n=i(7473),r=i(6128),s=i(1571),a=new n({Extends:r,initialize:function(t,e,i,n,a){void 0===e&&(e=.1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=!1),r.call(this,s.WIPE,t),this.progress=0,this.wipeWidth=e,this.direction=i,this.axis=n,this.reveal=a}});t.exports=a},1571:t=>{t.exports={GLOW:4,SHADOW:5,PIXELATE:6,VIGNETTE:7,SHINE:8,BLUR:9,GRADIENT:12,BLOOM:13,COLOR_MATRIX:14,CIRCLE:15,BARREL:16,DISPLACEMENT:17,WIPE:18,BOKEH:19}},7347:(t,e,i)=>{var n=i(1030),r=i(1571),s={Barrel:i(7340),Controller:i(6128),Bloom:i(5170),Blur:i(4199),Bokeh:i(3132),Circle:i(6610),ColorMatrix:i(4931),Displacement:i(9195),Glow:i(445),Gradient:i(7724),Pixelate:i(4412),Shadow:i(75),Shine:i(8734),Vignette:i(2437),Wipe:i(5984)};s=n(!1,s,r),t.exports=s},2494:(t,e,i)=>{var n=i(8351),r=i(8361);t.exports=function(t,e,i){e.x=r(i,"x",0),e.y=r(i,"y",0),e.depth=r(i,"depth",0),e.flipX=r(i,"flipX",!1),e.flipY=r(i,"flipY",!1);var s=r(i,"scale",null);"number"==typeof s?e.setScale(s):null!==s&&(e.scaleX=r(s,"x",1),e.scaleY=r(s,"y",1));var a=r(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=r(a,"x",1),e.scrollFactorY=r(a,"y",1)),e.rotation=r(i,"rotation",0);var o=r(i,"angle",null);null!==o&&(e.angle=o),e.alpha=r(i,"alpha",1);var h=r(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),u=r(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=r(i,"blendMode",n.NORMAL),e.visible=r(i,"visible",!0),r(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},2273:(t,e,i)=>{var n=i(7473),r=i(6125),s=i(1081),a=i(4399),o=i(3389),h=i(204),l=new n({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new s(this)),this},setData:function(t,e){return this.data||(this.data=new s(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new s(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new s(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new s(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.preFX&&(this.preFX.destroy(),this.preFX=void 0),this.postFX&&(this.postFX.destroy(),this.postFX=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},3649:(t,e,i)=>{var n=i(7473),r=i(8456),s=i(204),a=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(s.BOOT,this.boot,this),this.events.on(s.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(s.DESTROY,this.destroy,this)},start:function(){this.events.once(s.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(s.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(s.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectFactory",a,"add"),t.exports=a},2208:(t,e,i)=>{var n=i(4227),r=new n,s=new n,a=new n,o={camera:r,sprite:s,calc:a};t.exports=function(t,e,i){var n=r,h=s,l=a;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),n.multiply(h,l),o}},4344:(t,e,i)=>{var n=i(2915),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,r){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=r},4518:(t,e,i)=>{var n=i(2915),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=r},5173:(t,e,i)=>{var n=i(8351),r={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=r},1991:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},8305:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},3131:t=>{var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},1626:(t,e,i)=>{var n=i(7473),r=i(7347),s=i(8935),a=new n({initialize:function(t,e){this.gameObject=t,this.isPost=e,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(t){return void 0===t&&(t=0),this.padding=t,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(t){if(!this.isPost){var e=this.gameObject.scene.sys.renderer;e&&e.pipelines?(this.gameObject.pipeline=e.pipelines.FX_PIPELINE,void 0!==t&&(this.padding=t),this.enabled=!0):this.enabled=!1}},clear:function(){if(this.isPost)this.gameObject.resetPostPipeline(!0);else{for(var t=this.list,e=0;e{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},3671:(t,e,i)=>{var n=i(1392),r=i(9876),s=i(2529),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&r(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t,e){return void 0===t&&(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getTopLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,r,s,a,o,h,l;if(void 0===t&&(t=new n),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),r=t.x,s=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),r=t.x,s=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,r,a,h),t.y=Math.min(i,s,o,l),t.width=Math.max(e,r,a,h)-t.x,t.height=Math.max(i,s,o,l)-t.y,t}};t.exports=a},2246:(t,e,i)=>{var n=i(7499),r=i(6726),s={mask:null,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},createBitmapMask:function(t,e,i,r,s){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new n(this.scene,t,e,i,r,s)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new r(this.scene,t)}};t.exports=s},5085:t=>{var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},77:(t,e,i)=>{var n=i(7149),r=i(1864),s=i(5851),a=i(3747),o=i(2529),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=s(t,"from",0),t.to=s(t,"to",1);var h=r(t,"positionOnPath",!1);this.rotateToPath=r(t,"rotateToPath",!1),this.pathRotationOffset=s(t,"rotationOffset",0);var l=s(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+n(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,r=this.pathVector;if(i.copy(r).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,r),i.add(r),r.add(this.pathOffset),void this.setPosition(r.x,r.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),r),i.add(r),r.add(this.pathOffset);var s=this.x,o=this.y;this.setPosition(r.x,r.y);var h=this.x-s,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+n(this.pathRotationOffset))}}};t.exports=h},986:(t,e,i)=>{var n=i(3911),r={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(t){this.pipelineData={};var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(i){void 0===t&&(t=i.default);var n=i.get(t);if(n)return this.defaultPipeline=n,this.pipeline=n,!0}return!1},setPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){var a=s.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?n(e):e)}return this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},resetPipeline:function(t){return void 0===t&&(t=!1),this.pipeline=this.defaultPipeline,t&&(this.pipelineData={}),null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=r},4461:(t,e,i)=>{var n=i(3911),r=i(1626),s=i(8935),a={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(t){this.postPipelines=[],this.postPipelineData={},this.postFX=new r(this,!0),t&&(this.preFX=new r(this,!1))},setPostPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){Array.isArray(t)||(t=[t]);for(var a=0;a0,this},setPostPipelineData:function(t,e){var i=this.postPipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,n=[],r=0;r=0;n--){var r=i[n];(e&&r.name===t||!e&&r===t)&&(r.destroy(),s(i,n))}return this.hasPostPipeline=this.postPipelines.length>0,this},clearFX:function(){return this.preFX&&this.preFX.clear(),this.postFX&&this.postFX.clear(),this}};t.exports=a},4627:t=>{var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},1868:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},4976:(t,e,i)=>{var n=i(2362),r={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof n?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=r},9243:(t,e,i)=>{var n=i(2362),r={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof n?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=r},5693:t=>{var e={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,n){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,n=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=n,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=e},6125:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},3212:(t,e,i)=>{var n=i(7425),r=i(4227),s=i(7556),a=i(3692),o=i(2820),h=i(2529),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:0!==this._scaleY&&(this.renderFlags|=4)}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:0!==this._scaleX&&(this.renderFlags|=4)}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(e||(e=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,n){i||(i=new h),n||(n=this.scene.sys.cameras.main);var r=n.scrollX,a=n.scrollY,o=t+r*this.scrollFactorX-r,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):s(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},4227:(t,e,i)=>{var n=i(7473),r=i(7425),s=i(2529),a=new n({initialize:function(t,e,i,n,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),this.matrix=new Float32Array([t,e,i,n,r,s,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):n||s?r.TAU-(s>0?Math.acos(-n/this.scaleY):-Math.acos(n/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,r=n[0],s=n[1],a=n[2],o=n[3];return n[0]=r*i+a*e,n[1]=s*i+o*e,n[2]=r*-e+a*i,n[3]=s*-e+o*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,r=i[0],s=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],v=n[5],g=void 0===e?i:e.matrix;return g[0]=u*r+c*a,g[1]=u*s+c*o,g[2]=d*r+f*a,g[3]=d*s+f*o,g[4]=p*r+v*a+h,g[5]=p*s+v*o+l,g},multiplyWithOffset:function(t,e,i){var n=this.matrix,r=t.matrix,s=n[0],a=n[1],o=n[2],h=n[3],l=e*s+i*o+n[4],u=e*a+i*h+n[5],c=r[0],d=r[1],f=r[2],p=r[3],v=r[4],g=r[5];return n[0]=c*s+d*o,n[1]=c*a+d*h,n[2]=f*s+p*o,n[3]=f*a+p*h,n[4]=v*s+g*o+l,n[5]=v*a+g*h+u,this},transform:function(t,e,i,n,r,s){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+n*l,a[3]=i*h+n*u,a[4]=r*o+s*l+c,a[5]=r*h+s*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,r=n[0],s=n[1],a=n[2],o=n[3],h=n[4],l=n[5];return i.x=t*r+e*a+h,i.y=t*s+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=e*r-i*n;return t[0]=r/o,t[1]=-i/o,t[2]=-n/o,t[3]=e/o,t[4]=(n*a-r*s)/o,t[5]=-(e*a-i*s)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,r,s){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=n,a[4]=r,a[5]=s,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],r=e[2],s=e[3],a=i*s-n*r;if(t.translateX=e[4],t.translateY=e[5],i||n){var o=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(r||s){var h=Math.sqrt(r*r+s*s);t.rotation=.5*Math.PI-(s>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,n,r){var s=this.matrix,a=Math.sin(i),o=Math.cos(i);return s[4]=t,s[5]=e,s[0]=o*n,s[1]=a*n,s[2]=-a*r,s[3]=o*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],a=n[1],o=n[2],h=n[3],l=n[4],u=n[5],c=1/(r*h+o*-a);return i.x=h*c*t+-o*c*e+(u*o-l*h)*c,i.y=r*c*e+-a*c*t+(-u*r+l*a)*c,i},setQuad:function(t,e,i,n,r,s){void 0===s&&(s=this.quad);var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return s[0]=t*o+e*l+c,s[1]=t*h+e*u+d,s[2]=t*o+n*l+c,s[3]=t*h+n*u+d,s[4]=i*o+n*l+c,s[5]=i*h+n*u+d,s[6]=i*o+e*l+c,s[7]=i*h+e*u+d,r&&s.forEach((function(t,e){s[e]=Math.round(t)})),s},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var n=this.getX(t,e);return i&&(n=Math.round(n)),n},getYRound:function(t,e,i){var n=this.getY(t,e);return i&&(n=Math.round(n)),n},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},8414:t=>{var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},4286:(t,e,i)=>{t.exports={Alpha:i(4344),AlphaSingle:i(4518),BlendMode:i(5173),ComputedSize:i(1991),Crop:i(8305),Depth:i(3131),Flip:i(9660),FX:i(1626),GetBounds:i(3671),Mask:i(2246),Origin:i(5085),PathFollower:i(77),Pipeline:i(986),PostPipeline:i(4461),ScrollFactor:i(4627),Size:i(1868),Texture:i(4976),TextureCrop:i(9243),Tint:i(5693),ToJSON:i(6125),Transform:i(3212),TransformMatrix:i(4227),Visible:i(8414)}},7361:(t,e,i)=>{var n=i(1953),r=i(8351),s=i(7473),a=i(4286),o=i(3389),h=i(2273),l=i(1392),u=i(3232),c=i(9422),d=i(2529),f=new s({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.PostPipeline,a.Transform,a.Visible,u],initialize:function(t,e,i,n){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(e,i),this.setBlendMode(r.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,n=new l,r=!1;t.setEmpty();for(var s=0;s-1},setAll:function(t,e,i,r){return n.SetAll(this.list,t,e,i,r),this},each:function(t,e){var i,n=[null],r=this.list.slice(),s=r.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},3232:(t,e,i)=>{var n=i(1984),r=n,s=n;r=i(4343),t.exports={renderWebGL:r,renderCanvas:s}},4343:t=>{t.exports=function(t,e,i,n){i.addToRenderList(e);var r=e.list,s=r.length;if(0!==s){var a=e.localTransform;n?(a.loadIdentity(),a.multiply(n),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var o=-1!==e.blendMode;o||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c{t.exports="addedtoscene"},4265:t=>{t.exports="destroy"},8671:t=>{t.exports="removedfromscene"},3420:t=>{t.exports="complete"},601:t=>{t.exports="created"},7919:t=>{t.exports="error"},6231:t=>{t.exports="locked"},5241:t=>{t.exports="loop"},8325:t=>{t.exports="playing"},3356:t=>{t.exports="play"},7513:t=>{t.exports="seeked"},5788:t=>{t.exports="seeking"},7111:t=>{t.exports="stalled"},8118:t=>{t.exports="stop"},9184:t=>{t.exports="textureready"},4287:t=>{t.exports="unlocked"},857:t=>{t.exports="unsupported"},3389:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(6608),DESTROY:i(4265),REMOVED_FROM_SCENE:i(8671),VIDEO_COMPLETE:i(3420),VIDEO_CREATED:i(601),VIDEO_ERROR:i(7919),VIDEO_LOCKED:i(6231),VIDEO_LOOP:i(5241),VIDEO_PLAY:i(3356),VIDEO_PLAYING:i(8325),VIDEO_SEEKED:i(7513),VIDEO_SEEKING:i(5788),VIDEO_STALLED:i(7111),VIDEO_STOP:i(8118),VIDEO_TEXTURE:i(9184),VIDEO_UNLOCKED:i(4287),VIDEO_UNSUPPORTED:i(857)}},1643:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},8881:(t,e,i)=>{var n=i(7655);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},4479:(t,e,i)=>{var n=i(4771),r=i(7655);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=n(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;u{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},284:(t,e,i)=>{var n=i(7473),r=i(8881),s=i(4479),a=i(1643),o=i(3915),h=i(2529),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=n},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return s(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},3915:(t,e,i)=>{var n=i(7655);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},7655:(t,e,i)=>{var n=i(7473),r=i(1643),s=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=r.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=s},5956:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},716:(t,e,i)=>{var n=i(7120),r=i(7655);t.exports=function(t,e,i){if(void 0===i&&(i=new r),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var s=n(t)*e;return e>.5?(s-=t.width+t.height)<=t.width?(i.x=t.right-s,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(s-t.width)):s<=t.width?(i.x=t.x+s,i.y=t.y):(i.x=t.right,i.y=t.y+(s-t.width)),i}},8151:(t,e,i)=>{var n=i(716),r=i(7120);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=r(t)/i);for(var a=0;a{t.exports=function(t){return 2*(t.width+t.height)}},2161:(t,e,i)=>{var n=i(7655);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},1392:(t,e,i)=>{var n=i(7473),r=i(5956),s=i(716),a=i(8151),o=i(1643),h=i(284),l=i(2161),u=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},9422:(t,e,i)=>{var n=i(1392);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=Math.min(t.x,e.x),s=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-r,o=Math.max(t.bottom,e.bottom)-s;return i.setTo(r,s,a,o)}},1593:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1179),a=i(4597),o=i(5593),h=i(7410),l=i(5874),u=i(707),c=new n({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var n=a(e,"url");void 0===n?n=t.path+i+"."+a(e,"extension",""):"string"!=typeof n||n.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(n=t.path+n),this.url=n,this.src="",this.xhrSettings=u(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===r.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=r.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,n=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(n=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,n)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(s.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==r.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(s.FILE_COMPLETE,e,i,t),this.loader.emit(s.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=r.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},9845:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},5593:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},7410:(t,e,i)=>{var n=i(1030),r=i(707);t.exports=function(t,e){var i=void 0===t?r():n({},t);if(e)for(var s in e)void 0!==e[s]&&(i[s]=e[s]);return i}},3137:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1179),a=new n({initialize:function(t,e,i,n){var s=[];n.forEach((function(t){t&&s.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=s,this.state=r.FILE_PENDING,this.complete=!1,this.pending=s.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a{var n=i(7410);t.exports=function(t,e){var i=n(e,t.xhrSettings),r=new XMLHttpRequest;if(r.open("GET",t.src,i.async,i.user,i.password),r.responseType=t.xhrSettings.responseType,r.timeout=i.timeout,i.headers)for(var s in i.headers)r.setRequestHeader(s,i.headers[s]);return i.header&&i.headerValue&&r.setRequestHeader(i.header,i.headerValue),i.requestedWith&&r.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&r.overrideMimeType(i.overrideMimeType),i.withCredentials&&(r.withCredentials=!0),r.onload=t.onLoad.bind(t,r),r.onerror=t.onError.bind(t,r),r.onprogress=t.onProgress.bind(t),r.send(),r}},707:t=>{t.exports=function(t,e,i,n,r,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=0),void 0===s&&(s=!1),{responseType:t,async:e,user:i,password:n,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:s}}},4359:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},462:t=>{t.exports="addfile"},7297:t=>{t.exports="complete"},8660:t=>{t.exports="filecomplete"},6484:t=>{t.exports="filecomplete-"},7972:t=>{t.exports="loaderror"},1906:t=>{t.exports="load"},1441:t=>{t.exports="fileprogress"},1072:t=>{t.exports="postprocess"},1927:t=>{t.exports="progress"},6597:t=>{t.exports="start"},1179:(t,e,i)=>{t.exports={ADD:i(462),COMPLETE:i(7297),FILE_COMPLETE:i(8660),FILE_KEY_COMPLETE:i(6484),FILE_LOAD_ERROR:i(7972),FILE_LOAD:i(1906),FILE_PROGRESS:i(1441),POST_PROCESS:i(1072),PROGRESS:i(1927),START:i(6597)}},6732:(t,e,i)=>{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(2482),l=i(5593),u=new n({Extends:s,initialize:function t(e,i,n,r,a){var l,u="png";if(h(i)){var c=i;i=o(c,"key"),n=o(c,"url"),l=o(c,"normalMap"),r=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"frameConfig")}Array.isArray(n)&&(l=n[1],n=n[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:n,xhrSettings:r,config:a};if(s.call(this,e,d),l){var f=new t(e,this.key,l,r,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){s.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){s.revokeObjectURL(t.data),t.onProcessError()},s.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=r.FILE_PROCESSING,t===r.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=r.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=r.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t?t.state>=r.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var n=0;n{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(5851),l=i(2482),u=new n({Extends:s,initialize:function(t,e,i,n,a){var u="json";if(l(e)){var c=e;e=o(c,"key"),i=o(c,"url"),n=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:a};s.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=r.FILE_POPULATED)},onProcess:function(){if(this.state!==r.FILE_POPULATED){this.state=r.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r{var n=i(7473),r=i(4359),s=i(1593),a=i(9845),o=i(4597),h=i(2482),l=new n({Extends:s,initialize:function(t,e,i,n){var r="text",a="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),n=o(u,"xhrSettings"),a=o(u,"extension",a),r=o(u,"type",r),l=o(u,"cache",l)}var c={type:r,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var n=0;n{t.exports=function(t){for(var e=0,i=0;i{var n=i(3916);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},7025:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},48:t=>{t.exports=function(t,e,i,n,r){var s=.5*(n-e),a=.5*(r-i),o=t*t;return(2*i-2*n+s+a)*(t*o)+(-3*i+3*n-2*s-a)*o+s*t+i}},5035:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},2915:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},7149:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t*n.DEG_TO_RAD}},2975:t=>{t.exports=function(t,e){return Math.abs(t-e)}},2107:(t,e,i)=>{var n=i(2915),r=i(7473),s=i(9652),a=i(1984),o=new s,h=new r({initialize:function t(e,i,n,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=t.DefaultOrder),this._x=e,this._y=i,this._z=n,this._order=r,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,n){return void 0===n&&(n=this._order),this._x=t,this._y=e,this._z=i,this._order=n,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var r=t.val,s=r[0],a=r[4],o=r[8],h=r[1],l=r[5],u=r[9],c=r[2],d=r[6],f=r[10],p=0,v=0,g=0,m=.99999;switch(e){case"XYZ":v=Math.asin(n(o,-1,1)),Math.abs(o){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},104:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},4941:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},1555:(t,e,i)=>{var n=i(2915);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))+e}},5005:t=>{t.exports=function(t,e){return t/e/1e3}},3702:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},8820:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},1743:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},3416:t=>{t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},2149:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*s-a*h,c=-l*r+a*o,d=h*r-s*o,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(a*i-n*s)*f,t[3]=c*f,t[4]=(l*e-n*o)*f,t[5]=(-a*e+n*r)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(s*e-i*r)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=s*l-a*h,t[1]=n*h-i*l,t[2]=i*a-n*s,t[3]=a*o-r*l,t[4]=e*l-n*o,t[5]=n*r-e*a,t[6]=r*h-s*o,t[7]=i*o-e*h,t[8]=e*s-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*s-a*h)+i*(-l*r+a*o)+n*(h*r-s*o)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],v=c[3],g=c[4],m=c[5],M=c[6],x=c[7],y=c[8];return e[0]=d*i+f*s+p*h,e[1]=d*n+f*a+p*l,e[2]=d*r+f*o+p*u,e[3]=v*i+g*s+m*h,e[4]=v*n+g*a+m*l,e[5]=v*r+g*o+m*u,e[6]=M*i+x*s+y*h,e[7]=M*n+x*a+y*l,e[8]=M*r+x*o+y*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*s,e[1]=l*n+h*a,e[2]=l*r+h*o,e[3]=l*s-h*i,e[4]=l*a-h*n,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,r=t.w,s=e+e,a=i+i,o=n+n,h=e*s,l=e*a,u=e*o,c=i*a,d=i*o,f=n*o,p=r*s,v=r*a,g=r*o,m=this.val;return m[0]=1-(c+f),m[3]=l+g,m[6]=u-v,m[1]=l-g,m[4]=1-(h+f),m[7]=d+p,m[2]=u+v,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],v=e[12],g=e[13],m=e[14],M=e[15],x=n*h-r*o,y=n*l-s*o,w=n*u-a*o,E=r*l-s*h,b=r*u-a*h,T=s*u-a*l,A=c*g-d*v,R=c*m-f*v,S=c*M-p*v,C=d*m-f*g,I=d*M-p*g,P=f*M-p*m,L=x*P-y*I+w*C+E*S-b*R+T*A;return L?(L=1/L,i[0]=(h*P-l*I+u*C)*L,i[1]=(l*S-o*P-u*R)*L,i[2]=(o*I-h*S+u*A)*L,i[3]=(s*I-r*P-a*C)*L,i[4]=(n*P-s*S+a*R)*L,i[5]=(r*S-n*I-a*A)*L,i[6]=(g*T-m*b+M*E)*L,i[7]=(m*w-v*T-M*y)*L,i[8]=(v*b-g*w+M*x)*L,this):null}});t.exports=n},9652:(t,e,i)=>{var n=i(7473),r=i(5689),s=1e-6,a=new n({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,n,r,s,a,o,h,l,u,c,d,f,p,v){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=n,g[4]=r,g[5]=s,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=u,g[11]=c,g[12]=d,g[13]=f,g[14]=p,g[15]=v,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var n=o.fromQuat(i).val,r=e.x,s=e.y,a=e.z;return this.setValues(n[0]*r,n[1]*r,n[2]*r,0,n[4]*s,n[5]*s,n[6]*s,0,n[8]*a,n[9]*a,n[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],r=t[6],s=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=n,t[13]=s,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15],m=e*a-i*s,M=e*o-n*s,x=e*h-r*s,y=i*o-n*a,w=i*h-r*a,E=n*h-r*o,b=l*p-u*f,T=l*v-c*f,A=l*g-d*f,R=u*v-c*p,S=u*g-d*p,C=c*g-d*v,I=m*C-M*S+x*R+y*A-w*T+E*b;return I?(I=1/I,this.setValues((a*C-o*S+h*R)*I,(n*S-i*C-r*R)*I,(p*E-v*w+g*y)*I,(c*w-u*E-d*y)*I,(o*A-s*C-h*T)*I,(e*C-n*A+r*T)*I,(v*x-f*E-g*M)*I,(l*E-c*x+d*M)*I,(s*S-a*A+h*b)*I,(i*A-e*S-r*b)*I,(f*w-p*x+g*m)*I,(u*x-l*w-d*m)*I,(a*T-s*R-o*b)*I,(e*R-i*T+n*b)*I,(p*M-f*y-v*m)*I,(l*y-u*M+c*m)*I)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return this.setValues(a*(c*g-d*v)-u*(o*g-h*v)+p*(o*d-h*c),-(i*(c*g-d*v)-u*(n*g-r*v)+p*(n*d-r*c)),i*(o*g-h*v)-a*(n*g-r*v)+p*(n*h-r*o),-(i*(o*d-h*c)-a*(n*d-r*c)+u*(n*h-r*o)),-(s*(c*g-d*v)-l*(o*g-h*v)+f*(o*d-h*c)),e*(c*g-d*v)-l*(n*g-r*v)+f*(n*d-r*c),-(e*(o*g-h*v)-s*(n*g-r*v)+f*(n*h-r*o)),e*(o*d-h*c)-s*(n*d-r*c)+l*(n*h-r*o),s*(u*g-d*p)-l*(a*g-h*p)+f*(a*d-h*u),-(e*(u*g-d*p)-l*(i*g-r*p)+f*(i*d-r*u)),e*(a*g-h*p)-s*(i*g-r*p)+f*(i*h-r*a),-(e*(a*d-h*u)-s*(i*d-r*u)+l*(i*h-r*a)),-(s*(u*v-c*p)-l*(a*v-o*p)+f*(a*c-o*u)),e*(u*v-c*p)-l*(i*v-n*p)+f*(i*c-n*u),-(e*(a*v-o*p)-s*(i*v-n*p)+f*(i*o-n*a)),e*(a*c-o*u)-s*(i*c-n*u)+l*(i*o-n*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return(e*a-i*s)*(c*g-d*v)-(e*o-n*s)*(u*g-d*p)+(e*h-r*s)*(u*v-c*p)+(i*o-n*a)*(l*g-d*f)-(i*h-r*a)*(l*v-c*f)+(n*h-r*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],v=e[13],g=e[14],m=e[15],M=t.val,x=M[0],y=M[1],w=M[2],E=M[3];return e[0]=x*i+y*a+w*u+E*p,e[1]=x*n+y*o+w*c+E*v,e[2]=x*r+y*h+w*d+E*g,e[3]=x*s+y*l+w*f+E*m,x=M[4],y=M[5],w=M[6],E=M[7],e[4]=x*i+y*a+w*u+E*p,e[5]=x*n+y*o+w*c+E*v,e[6]=x*r+y*h+w*d+E*g,e[7]=x*s+y*l+w*f+E*m,x=M[8],y=M[9],w=M[10],E=M[11],e[8]=x*i+y*a+w*u+E*p,e[9]=x*n+y*o+w*c+E*v,e[10]=x*r+y*h+w*d+E*g,e[11]=x*s+y*l+w*f+E*m,x=M[12],y=M[13],w=M[14],E=M[15],e[12]=x*i+y*a+w*u+E*p,e[13]=x*n+y*o+w*c+E*v,e[14]=x*r+y*h+w*d+E*g,e[15]=x*s+y*l+w*f+E*m,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,n=e.val,r=i[0],s=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],f=i[6],p=i[10],v=i[14],g=i[3],m=i[7],M=i[11],x=i[15],y=n[0],w=n[4],E=n[8],b=n[12],T=n[1],A=n[5],R=n[9],S=n[13],C=n[2],I=n[6],P=n[10],L=n[14],O=n[3],_=n[7],k=n[11],F=n[15];return this.setValues(r*y+s*T+a*C+o*O,h*y+l*T+u*C+c*O,d*y+f*T+p*C+v*O,g*y+m*T+M*C+x*O,r*w+s*A+a*I+o*_,h*w+l*A+u*I+c*_,d*w+f*A+p*I+v*_,g*w+m*A+M*I+x*_,r*E+s*R+a*P+o*k,h*E+l*R+u*P+c*k,d*E+f*R+p*P+v*k,g*E+m*R+M*P+x*k,r*b+s*S+a*L+o*F,h*b+l*S+u*L+c*F,d*b+f*S+p*L+v*F,g*b+m*S+M*L+x*F)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var n=this.val;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var n=this.val;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,a=t.y,o=t.z,h=r*s,l=r*a;return this.setValues(h*s+i,h*a-n*o,h*o+n*a,0,h*a+n*o,l*a+i,l*o-n*s,0,h*o-n*a,l*o+n*s,r*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,n=e.x,r=e.y,a=e.z,o=Math.sqrt(n*n+r*r+a*a);if(Math.abs(o){t.exports=function(t,e,i){return Math.min(t+e,i)}},44:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},5385:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},8585:t=>{t.exports=function(t,e,i,n){void 0===i&&(i=e+1);var r=(t-e)/(i-e);return r>1?void 0!==n?(r=(n-t)/(n-i))<0&&(r=0):r=1:r<0&&(r=0),r}},372:(t,e,i)=>{var n=i(7473),r=i(2149),s=i(1984),a=i(5689),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),c=new a(0,1,0),d=new a,f=new r,p=new n({initialize:function(t,e,i,n){this.onChangeCallback=s,this.set(t,e,i,n)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,n,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=n||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=n*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.set(i+e*(t.x-i),n+e*(t.y-n),r+e*(t.z-r),s+e*(t.w-s))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var n=f.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+r*s+i*o-n*a,i*h+r*a+n*s-e*o,n*h+r*o+e*a-i*s,r*h-e*s-i*a-n*o)},slerp:function(t,e){var i=this.x,n=this.y,r=this.z,s=this.w,a=t.x,h=t.y,l=t.z,u=t.w,c=i*a+n*h+r*l+s*u;c<0&&(c=-c,a=-a,h=-h,l=-l,u=-u);var d=1-e,f=e;if(1-c>o){var p=Math.acos(c),v=Math.sin(p);d=Math.sin((1-e)*p)/v,f=Math.sin(e*p)/v}return this.set(d*i+f*a,d*n+f*h,d*r+f*l,d*s+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n,s=r?1/r:0;return this.set(-t*s,-e*s,-i*s,n*s)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a+r*s,i*a+n*s,n*a-i*s,r*a-e*s)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a-n*s,i*a+r*s,n*a+e*s,r*a-i*s)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*s,i*a-e*s,n*a+r*s,r*a-n*s)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,n=t.y/2,r=t.z/2,s=Math.cos(i),a=Math.cos(n),o=Math.cos(r),h=Math.sin(i),l=Math.sin(n),u=Math.sin(r);switch(t.order){case"XYZ":this.set(h*a*o+s*l*u,s*l*o-h*a*u,s*a*u+h*l*o,s*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+s*l*u,s*l*o-h*a*u,s*a*u-h*l*o,s*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-s*l*u,s*l*o+h*a*u,s*a*u+h*l*o,s*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-s*l*u,s*l*o+h*a*u,s*a*u-h*l*o,s*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+s*l*u,s*l*o+h*a*u,s*a*u-h*l*o,s*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-s*l*u,s*l*o-h*a*u,s*a*u+h*l*o,s*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,n=i[0],r=i[4],s=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=n+o+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(s-l)*e,(a-r)*e,.25/e)):n>o&&n>c?(e=2*Math.sqrt(1+n-o-c),this.set(.25*e,(r+a)/e,(s+l)/e,(u-h)/e)):o>c?(e=2*Math.sqrt(1+o-n-c),this.set((r+a)/e,.25*e,(h+u)/e,(s-l)/e)):(e=2*Math.sqrt(1+c-n-o),this.set((s+l)/e,(h+u)/e,.25*e,(a-r)/e)),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var s=h[r],a=h[s];e=Math.sqrt(i[3*r+r]-i[3*s+s]-i[3*a+a]+1),l[r]=.5*e,e=.5/e,l[s]=(i[3*s+r]+i[3*r+s])*e,l[a]=(i[3*a+r]+i[3*r+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+s]-i[3*s+a])*e}return this.onChangeCallback(this),this}});t.exports=p},4208:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t*n.RAD_TO_DEG}},1705:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},6650:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,n=2*Math.random()-1,r=Math.sqrt(1-n*n)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=n*e,t}},2037:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},6283:t=>{t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},9876:t=>{t.exports=function(t,e,i,n){var r=Math.cos(n),s=Math.sin(n),a=t.x-e,o=t.y-i;return t.x=a*r-o*s+e,t.y=a*s+o*r+i,t}},8348:t=>{t.exports=function(t,e,i,n,r){var s=n+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},4497:t=>{t.exports=function(t,e,i,n,r){return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},9640:(t,e,i)=>{var n=i(5689),r=i(9652),s=i(372),a=new r,o=new s,h=new n;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},4078:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},855:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.round(t*n)/n}},4936:t=>{t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var r=[],s=[],a=0;a{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},278:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},163:(t,e,i)=>{var n=i(2529);t.exports=function(t,e,i,r){void 0===r&&(r=new n);var s=0,a=0;return t>0&&t<=e*i&&(s=t>e-1?t-(a=Math.floor(t/e))*e:t),r.set(s,a)}},7556:(t,e,i)=>{var n=i(2529);t.exports=function(t,e,i,r,s,a,o,h){void 0===h&&(h=new n);var l=Math.sin(s),u=Math.cos(s),c=u*a,d=l*a,f=-l*o,p=u*o,v=1/(c*p+f*-d);return h.x=p*v*t+-f*v*e+(r*f-i*p)*v,h.y=c*v*e+-d*v*t+(-r*c+i*d)*v,h}},2529:(t,e,i)=>{var n=i(7473),r=i(12),s=new n({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new s(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return r(this.x,t.x,e)&&r(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});s.ZERO=new s,s.RIGHT=new s(1,0),s.LEFT=new s(-1,0),s.UP=new s(0,-1),s.DOWN=new s(0,1),s.ONE=new s(1,1),t.exports=s},5689:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new n(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=n*o-r*a,this.y=r*s-i*o,this.z=i*a-n*s,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z;return this.x=i*a-n*s,this.y=n*r-e*a,this.z=e*s-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+n*r[6],this.y=e*r[1]+i*r[4]+n*r[7],this.z=e*r[2]+i*r[5]+n*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12],this.y=r[1]*e+r[5]*i+r[9]*n+r[13],this.z=r[2]*e+r[6]*i+r[10]*n+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=e*r[0]+i*r[4]+n*r[8]+r[12],a=e*r[1]+i*r[5]+n*r[9]+r[13],o=e*r[2]+i*r[6]+n*r[10]+r[14],h=e*r[3]+i*r[7]+n*r[11]+r[15];return this.x=s/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*n-a*i,l=o*i+a*e-r*n,u=o*n+r*i-s*e,c=-r*e-s*i-a*n;return this.x=h*o+c*-r+l*-a-u*-s,this.y=l*o+c*-s+u*-r-h*-a,this.z=u*o+c*-a+h*-s-l*-r,this},project:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],c=r[6],d=r[7],f=r[8],p=r[9],v=r[10],g=r[11],m=r[12],M=r[13],x=r[14],y=1/(e*h+i*d+n*g+r[15]);return this.x=(e*s+i*l+n*f+m)*y,this.y=(e*a+i*u+n*p+M)*y,this.z=(e*o+i*c+n*v+x)*y,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,n=t.y,r=t.z,s=t.w,a=this.x-i,o=s-this.y-1-n,h=this.z;return this.x=2*a/r-1,this.y=2*o/s-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});n.ZERO=new n,n.RIGHT=new n(1,0,0),n.LEFT=new n(-1,0,0),n.UP=new n(0,-1,0),n.DOWN=new n(0,1,0),n.FORWARD=new n(0,0,1),n.BACK=new n(0,0,-1),n.ONE=new n(1,1,1),t.exports=n},9279:(t,e,i)=>{var n=new(i(7473))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=n*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this.w=s+e*(t.w-s),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+n*n+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*n-a*i,l=o*i+a*e-r*n,u=o*n+r*i-s*e,c=-r*e-s*i-a*n;return this.x=h*o+c*-r+l*-a-u*-s,this.y=l*o+c*-s+u*-r-h*-a,this.z=u*o+c*-a+h*-s-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},4119:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},8445:t=>{t.exports=function(t,e,i){if(t>=e&&t<=i)return t;var n=i-e;return e+((t-e)%n+n)%n}},6412:t=>{t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},760:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},6909:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},6947:t=>{t.exports=function(t,e,i,n){return Math.atan2(i-t,n-e)}},3426:(t,e,i)=>{var n=i(7425);t.exports=function(t){return t>Math.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},6906:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},3270:(t,e,i)=>{var n=i(104);t.exports=function(){return n(-Math.PI,Math.PI)}},2748:(t,e,i)=>{var n=i(104);t.exports=function(){return n(-180,180)}},936:(t,e,i)=>{var n=i(6906);t.exports=function(t){return n(t+Math.PI)}},1935:(t,e,i)=>{var n=i(7425);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},3692:(t,e,i)=>{var n=i(8445);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},2820:(t,e,i)=>{var n=i(8445);t.exports=function(t){return n(t,-180,180)}},1833:(t,e,i)=>{t.exports={Between:i(6412),BetweenPoints:i(760),BetweenPointsY:i(6909),BetweenY:i(6947),CounterClockwise:i(3426),Normalize:i(6906),Random:i(3270),RandomDegrees:i(2748),Reverse:i(936),RotateTo:i(1935),ShortestBetween:i(5393),Wrap:i(3692),WrapDegrees:i(2820)}},7425:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},1518:t=>{t.exports=function(t,e,i,n){var r=t-i,s=e-n;return Math.sqrt(r*r+s*s)}},5372:t=>{t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}},4430:t=>{t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},4361:t=>{t.exports=function(t,e,i,n){return Math.max(Math.abs(t-i),Math.abs(e-n))}},7798:t=>{t.exports=function(t,e,i,n,r){return void 0===r&&(r=2),Math.sqrt(Math.pow(i-t,r)+Math.pow(n-e,r))}},8290:t=>{t.exports=function(t,e,i,n){return Math.abs(t-i)+Math.abs(e-n)}},3788:t=>{t.exports=function(t,e,i,n){var r=t-i,s=e-n;return r*r+s*s}},6338:(t,e,i)=>{t.exports={Between:i(1518),BetweenPoints:i(5372),BetweenPointsSquared:i(4430),Chebyshev:i(4361),Power:i(7798),Snake:i(8290),Squared:i(3788)}},5751:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},6203:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},9103:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},4938:(t,e,i)=>{t.exports={In:i(5751),Out:i(9103),InOut:i(6203)}},8677:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},4649:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},504:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},8872:(t,e,i)=>{t.exports={In:i(8677),Out:i(504),InOut:i(4649)}},3170:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},2627:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},1349:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},5006:(t,e,i)=>{t.exports={In:i(3170),Out:i(1349),InOut:i(2627)}},6046:t=>{t.exports=function(t){return t*t*t}},9531:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},4836:t=>{t.exports=function(t){return--t*t*t+1}},875:(t,e,i)=>{t.exports={In:i(6046),Out:i(4836),InOut:i(9531)}},7619:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},7437:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},8119:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},2884:(t,e,i)=>{t.exports={In:i(7619),Out:i(8119),InOut:i(7437)}},5456:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},3461:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},2711:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},6287:(t,e,i)=>{t.exports={In:i(5456),Out:i(2711),InOut:i(3461)}},8613:(t,e,i)=>{t.exports={Back:i(4938),Bounce:i(8872),Circular:i(5006),Cubic:i(875),Elastic:i(2884),Expo:i(6287),Linear:i(4233),Quadratic:i(6341),Quartic:i(762),Quintic:i(345),Sine:i(8698),Stepped:i(7051)}},744:t=>{t.exports=function(t){return t}},4233:(t,e,i)=>{t.exports=i(744)},9810:t=>{t.exports=function(t){return t*t}},8163:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},6123:t=>{t.exports=function(t){return t*(2-t)}},6341:(t,e,i)=>{t.exports={In:i(9810),Out:i(6123),InOut:i(8163)}},7337:t=>{t.exports=function(t){return t*t*t*t}},4878:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},9012:t=>{t.exports=function(t){return 1- --t*t*t*t}},762:(t,e,i)=>{t.exports={In:i(7337),Out:i(9012),InOut:i(4878)}},303:t=>{t.exports=function(t){return t*t*t*t*t}},553:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},1632:t=>{t.exports=function(t){return--t*t*t*t*t+1}},345:(t,e,i)=>{t.exports={In:i(303),Out:i(1632),InOut:i(553)}},8455:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},1844:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},990:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},8698:(t,e,i)=>{t.exports={In:i(8455),Out:i(990),InOut:i(1844)}},6745:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},7051:(t,e,i)=>{t.exports=i(6745)},3158:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},12:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},7373:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},2622:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(3158),Equal:i(12),Floor:i(1326),GreaterThan:i(7373),LessThan:i(2622)}},4675:(t,e,i)=>{var n=i(7425),r=i(1030),s={Angle:i(1833),Distance:i(6338),Easing:i(8613),Fuzzy:i(7927),Interpolation:i(2140),Pow2:i(7897),Snap:i(3943),RandomDataGenerator:i(6957),Average:i(3136),Bernstein:i(785),Between:i(7025),CatmullRom:i(48),CeilTo:i(5035),Clamp:i(2915),DegToRad:i(7149),Difference:i(2975),Euler:i(2107),Factorial:i(3916),FloatBetween:i(104),FloorTo:i(4941),FromPercent:i(1555),GetSpeed:i(5005),IsEven:i(3702),IsEvenStrict:i(8820),Linear:i(1743),LinearXY:i(3416),MaxAdd:i(3733),Median:i(44),MinSub:i(5385),Percent:i(8585),RadToDeg:i(4208),RandomXY:i(1705),RandomXYZ:i(6650),RandomXYZW:i(2037),Rotate:i(6283),RotateAround:i(9876),RotateAroundDistance:i(8348),RotateTo:i(4497),RoundAwayFromZero:i(4078),RoundTo:i(855),SinCosTableGenerator:i(4936),SmootherStep:i(278),SmoothStep:i(2733),ToXY:i(163),TransformXY:i(7556),Within:i(4119),Wrap:i(8445),Vector2:i(2529),Vector3:i(5689),Vector4:i(9279),Matrix3:i(2149),Matrix4:i(9652),Quaternion:i(372),RotateVec3:i(9640)};s=r(!1,s,n),t.exports=s},1640:(t,e,i)=>{var n=i(785);t.exports=function(t,e){for(var i=0,r=t.length-1,s=0;s<=r;s++)i+=Math.pow(1-e,r-s)*Math.pow(e,s)*t[s]*n(r,s);return i}},6105:(t,e,i)=>{var n=i(48);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return t[0]===t[i]?(e<0&&(s=Math.floor(r=i*(1+e))),n(r-s,t[(s-1+i)%i],t[s],t[(s+1)%i],t[(s+2)%i])):e<0?t[0]-(n(-r,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(r-s,t[s?s-1:0],t[s],t[i{t.exports=function(t,e,i,n,r){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,r)}},6765:(t,e,i)=>{var n=i(1743);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return e<0?n(t[0],t[1],r):e>1?n(t[i],t[i-1],i-r):n(t[s],t[s+1>i?i:s+1],r-s)}},6388:t=>{t.exports=function(t,e,i,n){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}},5735:(t,e,i)=>{var n=i(2733);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},8705:(t,e,i)=>{var n=i(278);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},2140:(t,e,i)=>{t.exports={Bezier:i(1640),CatmullRom:i(6105),CubicBezier:i(4002),Linear:i(6765),QuadraticBezier:i(6388),SmoothStep:i(5735),SmootherStep:i(8705)}},5443:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},167:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},7897:(t,e,i)=>{t.exports={GetNext:i(5443),IsSize:i(725),IsValue:i(167)}},6957:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var n=0;n>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),n=t[i];t[i]=t[e],t[e]=n}return t}});t.exports=n},5659:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},5461:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),n?(i+t)/e:i+t)}},5131:t=>{t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),n?(i+t)/e:i+t)}},3943:(t,e,i)=>{t.exports={Ceil:i(5659),Floor:i(5461),To:i(5131)}},8666:(t,e,i)=>{var n=new(i(7473))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},8456:t=>{var e={},i={},n={register:function(t,i,n,r){void 0===r&&(r=!1),e[t]={plugin:i,mapping:n,custom:r}},registerCustom:function(t,e,n,r){i[t]={plugin:e,mapping:n,data:r}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=n},5722:(t,e,i)=>{var n=i(8666),r=i(7473),s=i(204),a=new r({Extends:n,initialize:function(t,e,i){n.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(s.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},8351:t=>{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},8196:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},3527:t=>{t.exports="resize"},8618:t=>{t.exports="addedtoscene"},4328:t=>{t.exports="boot"},6099:t=>{t.exports="create"},7645:t=>{t.exports="destroy"},2710:t=>{t.exports="pause"},2547:t=>{t.exports="postupdate"},8577:t=>{t.exports="prerender"},8197:t=>{t.exports="preupdate"},8997:t=>{t.exports="ready"},7604:t=>{t.exports="removedfromscene"},8999:t=>{t.exports="render"},9742:t=>{t.exports="resume"},3667:t=>{t.exports="shutdown"},3468:t=>{t.exports="sleep"},7840:t=>{t.exports="start"},9896:t=>{t.exports="transitioncomplete"},5103:t=>{t.exports="transitioninit"},3162:t=>{t.exports="transitionout"},7841:t=>{t.exports="transitionstart"},6454:t=>{t.exports="transitionwake"},6536:t=>{t.exports="update"},3875:t=>{t.exports="wake"},204:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(8618),BOOT:i(4328),CREATE:i(6099),DESTROY:i(7645),PAUSE:i(2710),POST_UPDATE:i(2547),PRE_RENDER:i(8577),PRE_UPDATE:i(8197),READY:i(8997),REMOVED_FROM_SCENE:i(7604),RENDER:i(8999),RESUME:i(9742),SHUTDOWN:i(3667),SLEEP:i(3468),START:i(7840),TRANSITION_COMPLETE:i(9896),TRANSITION_INIT:i(5103),TRANSITION_OUT:i(3162),TRANSITION_START:i(7841),TRANSITION_WAKE:i(6454),UPDATE:i(6536),WAKE:i(3875)}},2362:(t,e,i)=>{var n=i(7473),r=i(2915),s=i(1030),a=new n({initialize:function(t,e,i,n,r,s,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(s,a,n,r)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var r=this.data,s=r.cut;s.x=i,s.y=n,s.w=t,s.h=e,s.r=i+t,s.b=n+e,r.sourceSize.w=t,r.sourceSize.h=e,r.spriteSourceSize.w=t,r.spriteSourceSize.h=e,r.radius=.5*Math.sqrt(t*t+e*e);var a=r.drawImage;return a.x=i,a.y=n,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,n,r,s){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=n,o.w=r,o.h=s,o.r=i+r,o.b=n+s,this.x=i,this.y=n,this.width=r,this.height=s,this.halfWidth=.5*r,this.halfHeight=.5*s,this.centerX=Math.floor(r/2),this.centerY=Math.floor(s/2),this.updateUVs()},setCropUVs:function(t,e,i,n,s,a,o){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=r(e,0,d)),v=l+(i=r(i,0,f)),g=n=r(n,0,d-e),m=s=r(s,0,f-i),M=this.data;if(M.trim){var x=M.spriteSourceSize,y=e+(n=r(n,0,u-e)),w=i+(s=r(s,0,c-i));if(!(x.ry||x.y>w)){var E=Math.max(x.x,e),b=Math.max(x.y,i),T=Math.min(x.r,y)-E,A=Math.min(x.b,w)-b;g=T,m=A,p=a?h+(u-(E-x.x)-T):h+(E-x.x),v=o?l+(c-(b-x.y)-A):l+(b-x.y),e=E,i=b,n=T,s=A}else p=0,v=0,g=0,m=0}else a&&(p=h+(u-e-n)),o&&(v=l+(c-i-s));var R=this.source.width,S=this.source.height;return t.u0=Math.max(0,p/R),t.v0=Math.max(0,v/S),t.u1=Math.min(1,(p+g)/R),t.v1=Math.min(1,(v+m)/S),t.x=e,t.y=i,t.cx=p,t.cy=v,t.cw=g,t.ch=m,t.width=n,t.height=s,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,n,r,s){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=n,this.u1=r,this.v1=s,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=n;var s=this.source.width,a=this.source.height;return this.u0=t/s,this.v0=e/a,this.u1=(t+i)/s,this.v1=(e+n)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=s(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},1864:t=>{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},3747:t=>{t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},7473:t=>{function e(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function n(t,n,r,a){for(var o in n)if(n.hasOwnProperty(o)){var h=e(n,o,r);if(!1!==h){if(i((a||t).prototype,o)){if(s.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=n[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},1792:t=>{t.exports=function(t,e,i,n,r){if(void 0===r&&(r=t),i>0){var s=i-t.length;if(s<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>s&&(e.splice(s),a=s);for(var o=0;o{t.exports=function(t,e,i,n,r,s){if(void 0===i&&(i=0),void 0===s&&(s=t),n>0){var a=n-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),r&&r.call(s,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;n>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),r&&r.call(s,l)}return e}},2513:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var n=i(2497);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var a=0;if(n(t,r,s))for(var o=r;o{t.exports=function(t,e,i){var n,r=[null];for(n=3;n{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s)){var a,o=[null];for(a=5;a{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var n,r,s=1;if(i){if(te.length&&(s=e.length),i?(n=e[s-1][i],(r=e[s][i])-t<=t-n?e[s]:e[s-1]):(n=e[s-1],(r=e[s])-t<=t-n?r:n)}},4493:t=>{var e=function(t,i){void 0===i&&(i=[]);for(var n=0;n{var n=i(2497);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var a=[];if(n(t,r,s))for(var o=r;o{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var a=r;a{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},8683:t=>{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n>r||(t.splice(n,1),r===t.length-1?t.push(e):t.splice(r,0,e)),t}},546:t=>{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var n=t[i-1],r=t.indexOf(n);t[i]=n,t[r]=e}return t}},1419:t=>{t.exports=function(t,e,i){var n=t.indexOf(e);if(-1===n||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},6512:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,n){var r,s=[],a=!1;if((i||n)&&(a=!0,i||(i=""),n||(n="")),e=e;r--)a?s.push(i+r.toString()+n):s.push(r);else for(r=t;r<=e;r++)a?s.push(i+r.toString()+n):s.push(r);return s}},1316:(t,e,i)=>{var n=i(4078);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var r=[],s=Math.max(n((e-t)/(i||1)),0),a=0;a{function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return te?1:0}var n=function(t,r,s,a,o){for(void 0===s&&(s=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>s;){if(a-s>600){var h=a-s+1,l=r-s+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(s,Math.floor(r-l*c/h+d)),p=Math.min(a,Math.floor(r+(h-l)*c/h+d));n(t,r,f,p,o)}var v=t[r],g=s,m=a;for(e(t,s,r),o(t[a],v)>0&&e(t,s,a);g0;)m--}0===o(t[s],v)?e(t,s,m):e(t,++m,a),m<=r&&(s=m+1),r<=m&&(a=m-1)}};t.exports=n},9703:(t,e,i)=>{var n=i(5851),r=i(4912),s=function(t,e,i){for(var n=[],r=0;r{var n=i(8935);t.exports=function(t,e,i,r){var s;if(void 0===r&&(r=t),!Array.isArray(e))return-1!==(s=t.indexOf(e))?(n(t,s),i&&i.call(r,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(s=t.indexOf(h))&&(n(t,s),o.push(h),i&&i.call(r,h)),a--}return o}},4725:(t,e,i)=>{var n=i(8935);t.exports=function(t,e,i,r){if(void 0===r&&(r=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var s=n(t,e);return i&&i.call(r,s),s}},8780:(t,e,i)=>{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===s&&(s=t),n(t,e,i)){var a=i-e,o=t.splice(e,a);if(r)for(var h=0;h{var n=i(8935);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*i);return n(t,r)}},6960:t=>{t.exports=function(t,e,i){var n=t.indexOf(e),r=t.indexOf(i);return-1!==n&&-1===r&&(t[n]=i,!0)}},1021:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n{t.exports=function(t,e,i,n){var r=t.length;if(e<0||e>r||e>=i||i>r){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},5361:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},3718:(t,e,i)=>{var n=i(2497);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var a=r;a{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},2071:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},8935:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],r=e;r{var n=i(9356);function r(t,e){return String(t).localeCompare(e)}function s(t,e,i,n){var r,s,a,o,h,l=t.length,u=0,c=2*i;for(r=0;rl&&(s=l),a>l&&(a=l),o=r,h=s;;)if(o{t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return t[n]=i,t[r]=e,t}},1953:(t,e,i)=>{t.exports={Matrix:i(1237),Add:i(1792),AddAt:i(2280),BringToTop:i(2513),CountAllMatching:i(1771),Each:i(7883),EachInRange:i(5856),FindClosestInSorted:i(3957),Flatten:i(4493),GetAll:i(6245),GetFirst:i(1647),GetRandom:i(5301),MoveDown:i(1842),MoveTo:i(1419),MoveUp:i(6512),MoveAbove:i(8683),MoveBelow:i(546),NumberArray:i(4130),NumberArrayStep:i(1316),QuickSelect:i(9465),Range:i(9703),Remove:i(7161),RemoveAt:i(4725),RemoveBetween:i(8780),RemoveRandomElement:i(5744),Replace:i(6960),RotateLeft:i(1021),RotateRight:i(4027),SafeRange:i(2497),SendToBack:i(5361),SetAll:i(3718),Shuffle:i(4912),SortByDigits:i(2071),SpliceOne:i(8935),StableSort:i(9992),Swap:i(2372)}},1816:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var n=i(7222),r=i(1816);t.exports=function(t){var e="";if(!r(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},6063:t=>{t.exports=function(t){for(var e=0;e{var n=i(7116);t.exports=function(t){return n(t,180)}},2597:(t,e,i)=>{var n=i(7116);t.exports=function(t){return n(t,90)}},7116:(t,e,i)=>{var n=i(1816),r=i(4780);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=r(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=r(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var n=i(7116);t.exports=function(t){return n(t,-90)}},7711:(t,e,i)=>{var n=i(1021),r=i(4027);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?n(t,Math.abs(i)):r(t,i)),0!==e)for(var s=0;s{t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),r=0;r-1;s--)n[r][s]=t[s][r]}return n}},1237:(t,e,i)=>{t.exports={CheckMatrix:i(1816),MatrixToString:i(6655),ReverseColumns:i(582),ReverseRows:i(6063),Rotate180:i(8321),RotateLeft:i(2597),RotateMatrix:i(7116),RotateRight:i(6285),Translate:i(7711),TransposeMatrix:i(4780)}},3911:t=>{var e=function(t){var i,n,r;if("object"!=typeof t||null===t)return t;for(r in i=Array.isArray(t)?[]:{},t)n=t[r],i[r]=e(n);return i};t.exports=e},1030:(t,e,i)=>{var n=i(2482),r=function(){var t,e,i,s,a,o,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l{var n=i(4675),r=i(5851);t.exports=function(t,e,i){var s=r(t,e,null);if(null===s)return i;if(Array.isArray(s))return n.RND.pick(s);if("object"==typeof s){if(s.hasOwnProperty("randInt"))return n.RND.integerInRange(s.randInt[0],s.randInt[1]);if(s.hasOwnProperty("randFloat"))return n.RND.realInRange(s.randFloat[0],s.randFloat[1])}else if("function"==typeof s)return s(e);return s}},4597:t=>{t.exports=function(t,e,i){var n=typeof t;return t&&"number"!==n&&"string"!==n&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},5851:t=>{t.exports=function(t,e,i,n){if(!t&&!n||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(n&&n.hasOwnProperty(e))return n[e];if(-1!==e.indexOf(".")){for(var r=e.split("."),s=t,a=n,o=i,h=i,l=!0,u=!0,c=0;c{t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},7222:t=>{t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===n&&(n=3);var r=0;if(e+1>=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var s=Math.ceil((r=e-t.length)/2);t=new Array(r-s+1).join(i)+t+new Array(s+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}}},e={};var i=function i(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,i),s.exports}(4513);window.SpinePlugin=i})(); \ No newline at end of file diff --git a/plugins/spine4.1/dist/SpineCanvasPlugin.js b/plugins/spine4.1/dist/SpineCanvasPlugin.js index ce4bad8dc..11832dbf9 100644 --- a/plugins/spine4.1/dist/SpineCanvasPlugin.js +++ b/plugins/spine4.1/dist/SpineCanvasPlugin.js @@ -1,9188 +1,352 @@ -window["SpinePlugin"] = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 69); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports) { +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ 4399: +/***/ ((module) => { + +"use strict"; + + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private */ +function Events() {} -// Taken from klasse by mattdesl https://github.com/mattdesl/klasse +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); -function hasGetterOrSetter (def) -{ - return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function'); -} - -function getProperty (definition, k, isClassDescriptor) -{ - // This may be a lightweight object, OR it might be a property that was defined previously. - - // For simple class descriptors we can just assume its NOT previously defined. - var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k); - - if (!isClassDescriptor && def.value && typeof def.value === 'object') - { - def = def.value; - } - - // This might be a regular property, or it may be a getter/setter the user defined in a class. - if (def && hasGetterOrSetter(def)) - { - if (typeof def.enumerable === 'undefined') - { - def.enumerable = true; - } - - if (typeof def.configurable === 'undefined') - { - def.configurable = true; - } - - return def; - } - else - { - return false; - } -} - -function hasNonConfigurable (obj, k) -{ - var prop = Object.getOwnPropertyDescriptor(obj, k); - - if (!prop) - { - return false; - } - - if (prop.value && typeof prop.value === 'object') - { - prop = prop.value; - } - - if (prop.configurable === false) - { - return true; - } - - return false; + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; } /** - * Extends the given `myClass` object's prototype with the properties of `definition`. + * Representation of a single event listener. * - * @function extend - * @ignore - * @param {Object} ctor The constructor object to mix into. - * @param {Object} definition A dictionary of functions for the class. - * @param {boolean} isClassDescriptor Is the definition a class descriptor? - * @param {Object} [extend] The parent constructor object. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private */ -function extend (ctor, definition, isClassDescriptor, extend) -{ - for (var k in definition) - { - if (!definition.hasOwnProperty(k)) - { - continue; - } - - var def = getProperty(definition, k, isClassDescriptor); - - if (def !== false) - { - // If Extends is used, we will check its prototype to see if the final variable exists. - - var parent = extend || ctor; - - if (hasNonConfigurable(parent.prototype, k)) - { - // Just skip the final property - if (Class.ignoreFinals) - { - continue; - } - - // We cannot re-define a property that is configurable=false. - // So we will consider them final and throw an error. This is by - // default so it is clear to the developer what is happening. - // You can set ignoreFinals to true if you need to extend a class - // which has configurable=false; it will simply not re-define final properties. - throw new Error('cannot override final property \'' + k + '\', set Class.ignoreFinals = true to skip'); - } - - Object.defineProperty(ctor.prototype, k, def); - } - else - { - ctor.prototype[k] = definition[k]; - } - } +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; } /** - * Applies the given `mixins` to the prototype of `myClass`. + * Add a listener for a given event. * - * @function mixin - * @ignore - * @param {Object} myClass The constructor object to mix into. - * @param {Object|Array} mixins The mixins to apply to the constructor. + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private */ -function mixin (myClass, mixins) -{ - if (!mixins) - { - return; - } +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } - if (!Array.isArray(mixins)) - { - mixins = [ mixins ]; - } + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; - for (var i = 0; i < mixins.length; i++) - { - extend(myClass, mixins[i].prototype || mixins[i]); - } + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; } /** - * Creates a new class with the given descriptor. - * The constructor, defined by the name `initialize`, - * is an optional function. If unspecified, an anonymous - * function will be used which calls the parent class (if - * one exists). + * Clear event by name. * - * You can also use `Extends` and `Mixins` to provide subclassing - * and inheritance. - * - * @class Phaser.Class - * @constructor - * @param {Object} definition a dictionary of functions for the class - * @example - * - * var MyClass = new Phaser.Class({ - * - * initialize: function() { - * this.foo = 2.0; - * }, - * - * bar: function() { - * return this.foo + 5; - * } - * }); + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private */ -function Class (definition) -{ - if (!definition) - { - definition = {}; - } - - // The variable name here dictates what we see in Chrome debugger - var initialize; - var Extends; - - if (definition.initialize) - { - if (typeof definition.initialize !== 'function') - { - throw new Error('initialize must be a function'); - } - - initialize = definition.initialize; - - // Usually we should avoid 'delete' in V8 at all costs. - // However, its unlikely to make any performance difference - // here since we only call this on class creation (i.e. not object creation). - delete definition.initialize; - } - else if (definition.Extends) - { - var base = definition.Extends; - - initialize = function () - { - base.apply(this, arguments); - }; - } - else - { - initialize = function () {}; - } - - if (definition.Extends) - { - initialize.prototype = Object.create(definition.Extends.prototype); - initialize.prototype.constructor = initialize; - - // For getOwnPropertyDescriptor to work, we need to act directly on the Extends (or Mixin) - - Extends = definition.Extends; - - delete definition.Extends; - } - else - { - initialize.prototype.constructor = initialize; - } - - // Grab the mixins, if they are specified... - var mixins = null; - - if (definition.Mixins) - { - mixins = definition.Mixins; - delete definition.Mixins; - } - - // First, mixin if we can. - mixin(initialize, mixins); - - // Now we grab the actual definition which defines the overrides. - extend(initialize, definition, true, Extends); - - return initialize; +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; } -Class.extend = extend; -Class.mixin = mixin; -Class.ignoreFinals = false; - -module.exports = Class; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports) { - /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * A NOOP (No Operation) callback function. + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. * - * Used internally by Phaser when it's more expensive to determine if a callback exists - * than it is to just invoke an empty function. - * - * @function Phaser.Utils.NOOP - * @since 3.0.0 - */ -var NOOP = function () -{ - // NOOP -}; - -module.exports = NOOP; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); -var FuzzyEqual = __webpack_require__(34); - -/** - * @classdesc - * A representation of a vector in 2D space. - * - * A two-component vector. - * - * @class Vector2 - * @memberof Phaser.Math * @constructor - * @since 3.0.0 - * - * @param {number|Phaser.Types.Math.Vector2Like} [x=0] - The x component, or an object with `x` and `y` properties. - * @param {number} [y=x] - The y component. + * @public */ -var Vector2 = new Class({ - - initialize: - - function Vector2 (x, y) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector2#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector2#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - } - else - { - if (y === undefined) { y = x; } - - this.x = x || 0; - this.y = y || 0; - } - }, - - /** - * Make a clone of this Vector2. - * - * @method Phaser.Math.Vector2#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} A clone of this Vector2. - */ - clone: function () - { - return new Vector2(this.x, this.y); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector2#copy - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - copy: function (src) - { - this.x = src.x || 0; - this.y = src.y || 0; - - return this; - }, - - /** - * Set the component values of this Vector from a given Vector2Like object. - * - * @method Phaser.Math.Vector2#setFromObject - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setFromObject: function (obj) - { - this.x = obj.x || 0; - this.y = obj.y || 0; - - return this; - }, - - /** - * Set the `x` and `y` components of the this Vector to the given `x` and `y` values. - * - * @method Phaser.Math.Vector2#set - * @since 3.0.0 - * - * @param {number} x - The x value to set for this Vector. - * @param {number} [y=x] - The y value to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - set: function (x, y) - { - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - }, - - /** - * This method is an alias for `Vector2.set`. - * - * @method Phaser.Math.Vector2#setTo - * @since 3.4.0 - * - * @param {number} x - The x value to set for this Vector. - * @param {number} [y=x] - The y value to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setTo: function (x, y) - { - return this.set(x, y); - }, - - /** - * Sets the `x` and `y` values of this object from a given polar coordinate. - * - * @method Phaser.Math.Vector2#setToPolar - * @since 3.0.0 - * - * @param {number} azimuth - The angular coordinate, in radians. - * @param {number} [radius=1] - The radial coordinate (length). - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setToPolar: function (azimuth, radius) - { - if (radius == null) { radius = 1; } - - this.x = Math.cos(azimuth) * radius; - this.y = Math.sin(azimuth) * radius; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict equality check against each Vector's components. - * - * @method Phaser.Math.Vector2#equals - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. - * - * @return {boolean} Whether the given Vector is equal to this Vector. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y)); - }, - - /** - * Check whether this Vector is approximately equal to a given Vector. - * - * @method Phaser.Math.Vector2#fuzzyEquals - * @since 3.23.0 - * - * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. - * @param {number} [epsilon=0.0001] - The tolerance value. - * - * @return {boolean} Whether both absolute differences of the x and y components are smaller than `epsilon`. - */ - fuzzyEquals: function (v, epsilon) - { - return (FuzzyEqual(this.x, v.x, epsilon) && FuzzyEqual(this.y, v.y, epsilon)); - }, - - /** - * Calculate the angle between this Vector and the positive x-axis, in radians. - * - * @method Phaser.Math.Vector2#angle - * @since 3.0.0 - * - * @return {number} The angle between this Vector, and the positive x-axis, given in radians. - */ - angle: function () - { - // computes the angle in radians with respect to the positive x-axis - - var angle = Math.atan2(this.y, this.x); - - if (angle < 0) - { - angle += 2 * Math.PI; - } - - return angle; - }, - - /** - * Set the angle of this Vector. - * - * @method Phaser.Math.Vector2#setAngle - * @since 3.23.0 - * - * @param {number} angle - The angle, in radians. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setAngle: function (angle) - { - return this.setToPolar(angle, this.length()); - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector2#add - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - add: function (src) - { - this.x += src.x; - this.y += src.y; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector2#subtract - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - subtract: function (src) - { - this.x -= src.x; - this.y -= src.y; - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector2#multiply - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - multiply: function (src) - { - this.x *= src.x; - this.y *= src.y; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector2#scale - * @since 3.0.0 - * - * @param {number} value - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - scale: function (value) - { - if (isFinite(value)) - { - this.x *= value; - this.y *= value; - } - else - { - this.x = 0; - this.y = 0; - } - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector2#divide - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - divide: function (src) - { - this.x /= src.x; - this.y /= src.y; - - return this; - }, - - /** - * Negate the `x` and `y` components of this Vector. - * - * @method Phaser.Math.Vector2#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#distance - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (src) - { - var dx = src.x - this.x; - var dy = src.y - this.y; - - return Math.sqrt(dx * dx + dy * dy); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector2#distanceSq - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (src) - { - var dx = src.x - this.x; - var dy = src.y - this.y; - - return dx * dx + dy * dy; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - - return Math.sqrt(x * x + y * y); - }, - - /** - * Set the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#setLength - * @since 3.23.0 - * - * @param {number} length - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setLength: function (length) - { - return this.normalize().scale(length); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector2#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - - return x * x + y * y; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector2#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var len = x * x + y * y; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - } - - return this; - }, - - /** - * Rotate this Vector to its perpendicular, in the positive direction. - * - * @method Phaser.Math.Vector2#normalizeRightHand - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalizeRightHand: function () - { - var x = this.x; - - this.x = this.y * -1; - this.y = x; - - return this; - }, - - /** - * Rotate this Vector to its perpendicular, in the negative direction. - * - * @method Phaser.Math.Vector2#normalizeLeftHand - * @since 3.23.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalizeLeftHand: function () - { - var x = this.x; - - this.x = this.y; - this.y = x * -1; - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#dot - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to dot product with this Vector2. - * - * @return {number} The dot product of this Vector and the given Vector. - */ - dot: function (src) - { - return this.x * src.x + this.y * src.y; - }, - - /** - * Calculate the cross product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#cross - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to cross with this Vector2. - * - * @return {number} The cross product of this Vector and the given Vector. - */ - cross: function (src) - { - return this.x * src.y - this.y * src.x; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector2#lerp - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - lerp: function (src, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - - this.x = ax + t * (src.x - ax); - this.y = ay + t * (src.y - ay); - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector2#transformMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - transformMat3: function (mat) - { - var x = this.x; - var y = this.y; - var m = mat.val; - - this.x = m[0] * x + m[3] * y + m[6]; - this.y = m[1] * x + m[4] * y + m[7]; - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector2#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[12]; - this.y = m[1] * x + m[5] * y + m[13]; - - return this; - }, - - /** - * Make this Vector the zero vector (0, 0). - * - * @method Phaser.Math.Vector2#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - reset: function () - { - this.x = 0; - this.y = 0; - - return this; - }, - - /** - * Limit the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#limit - * @since 3.23.0 - * - * @param {number} max - The maximum length. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - limit: function (max) - { - var len = this.length(); - - if (len && len > max) - { - this.scale(max / len); - } - - return this; - }, - - /** - * Reflect this Vector off a line defined by a normal. - * - * @method Phaser.Math.Vector2#reflect - * @since 3.23.0 - * - * @param {Phaser.Math.Vector2} normal - A vector perpendicular to the line. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - reflect: function (normal) - { - normal = normal.clone().normalize(); - - return this.subtract(normal.scale(2 * this.dot(normal))); - }, - - /** - * Reflect this Vector across another. - * - * @method Phaser.Math.Vector2#mirror - * @since 3.23.0 - * - * @param {Phaser.Math.Vector2} axis - A vector to reflect across. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - mirror: function (axis) - { - return this.reflect(axis).negate(); - }, - - /** - * Rotate this Vector by an angle amount. - * - * @method Phaser.Math.Vector2#rotate - * @since 3.23.0 - * - * @param {number} delta - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - rotate: function (delta) - { - var cos = Math.cos(delta); - var sin = Math.sin(delta); - - return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); - }, - - /** - * Project this Vector onto another. - * - * @method Phaser.Math.Vector2#project - * @since 3.60.0 - * - * @param {Phaser.Math.Vector2} src - The vector to project onto. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - project: function (src) - { - var scalar = this.dot(src) / src.dot(src); - - return this.copy(src).scale(scalar); - } - -}); - -/** - * A static zero Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.ZERO - * @type {Phaser.Math.Vector2} - * @since 3.1.0 - */ -Vector2.ZERO = new Vector2(); - -/** - * A static right Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.RIGHT - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.RIGHT = new Vector2(1, 0); - -/** - * A static left Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.LEFT - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.LEFT = new Vector2(-1, 0); - -/** - * A static up Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.UP - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.UP = new Vector2(0, -1); - -/** - * A static down Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.DOWN - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.DOWN = new Vector2(0, 1); - -/** - * A static one Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.ONE - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.ONE = new Vector2(1, 1); - -module.exports = Vector2; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MATH_CONST = { - - /** - * The value of PI * 2. - * - * @name Phaser.Math.PI2 - * @type {number} - * @since 3.0.0 - */ - PI2: Math.PI * 2, - - /** - * The value of PI * 0.5. - * - * @name Phaser.Math.TAU - * @type {number} - * @since 3.0.0 - */ - TAU: Math.PI * 0.5, - - /** - * An epsilon value (1.0e-6) - * - * @name Phaser.Math.EPSILON - * @type {number} - * @since 3.0.0 - */ - EPSILON: 1.0e-6, - - /** - * For converting degrees to radians (PI / 180) - * - * @name Phaser.Math.DEG_TO_RAD - * @type {number} - * @since 3.0.0 - */ - DEG_TO_RAD: Math.PI / 180, - - /** - * For converting radians to degrees (180 / PI) - * - * @name Phaser.Math.RAD_TO_DEG - * @type {number} - * @since 3.0.0 - */ - RAD_TO_DEG: 180 / Math.PI, - - /** - * An instance of the Random Number Generator. - * This is not set until the Game boots. - * - * @name Phaser.Math.RND - * @type {Phaser.Math.RandomDataGenerator} - * @since 3.0.0 - */ - RND: null, - - /** - * The minimum safe integer this browser supports. - * We use a const for backward compatibility with Internet Explorer. - * - * @name Phaser.Math.MIN_SAFE_INTEGER - * @type {number} - * @since 3.21.0 - */ - MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER || -9007199254740991, - - /** - * The maximum safe integer this browser supports. - * We use a const for backward compatibility with Internet Explorer. - * - * @name Phaser.Math.MAX_SAFE_INTEGER - * @type {number} - * @since 3.21.0 - */ - MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER || 9007199254740991 - -}; - -module.exports = MATH_CONST; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Force a value within the boundaries by clamping it to the range `min`, `max`. - * - * @function Phaser.Math.Clamp - * @since 3.0.0 - * - * @param {number} value - The value to be clamped. - * @param {number} min - The minimum bounds. - * @param {number} max - The maximum bounds. - * - * @return {number} The clamped value. - */ -var Clamp = function (value, min, max) -{ - return Math.max(min, Math.min(max, value)); -}; - -module.exports = Clamp; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Tests if the start and end indexes are a safe range for the given array. - * - * @function Phaser.Utils.Array.SafeRange - * @since 3.4.0 - * - * @param {array} array - The array to check. - * @param {number} startIndex - The start index. - * @param {number} endIndex - The end index. - * @param {boolean} [throwError=true] - Throw an error if the range is out of bounds. - * - * @return {boolean} True if the range is safe, otherwise false. - */ -var SafeRange = function (array, startIndex, endIndex, throwError) -{ - var len = array.length; - - if (startIndex < 0 || - startIndex > len || - startIndex >= endIndex || - endIndex > len) - { - if (throwError) - { - throw new Error('Range Error: Values outside acceptable range'); - } - - return false; - } - else - { - return true; - } -}; - -module.exports = SafeRange; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * This is a slightly modified version of jQuery.isPlainObject. - * A plain object is an object whose internal class property is [object Object]. - * - * @function Phaser.Utils.Objects.IsPlainObject - * @since 3.0.0 - * - * @param {object} obj - The object to inspect. - * - * @return {boolean} `true` if the object is plain, otherwise `false`. - */ -var IsPlainObject = function (obj) -{ - // Not plain objects: - // - Any object or value whose internal [[Class]] property is not "[object Object]" - // - DOM nodes - // - window - if (!obj || typeof(obj) !== 'object' || obj.nodeType || obj === obj.window) - { - return false; - } - - // Support: Firefox <20 - // The try/catch suppresses exceptions thrown when attempting to access - // the "constructor" property of certain host objects, ie. |window.location| - // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 - try - { - if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf')) - { - return false; - } - } - catch (e) - { - return false; - } - - // If the function hasn't returned already, we're confident that - // |obj| is a plain object, created by {} or constructed with new Object - return true; -}; - -module.exports = IsPlainObject; - - -/***/ }), -/* 7 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Retrieves a value from an object, or an alternative object, falling to a back-up default value if not found. - * - * The key is a string, which can be split based on the use of the period character. - * - * For example: - * - * ```javascript - * const source = { - * lives: 3, - * render: { - * screen: { - * width: 1024 - * } - * } - * } - * - * const lives = GetValue(source, 'lives', 1); - * const width = GetValue(source, 'render.screen.width', 800); - * const height = GetValue(source, 'render.screen.height', 600); - * ``` - * - * In the code above, `lives` will be 3 because it's defined at the top level of `source`. - * The `width` value will be 1024 because it can be found inside the `render.screen` object. - * The `height` value will be 600, the default value, because it is missing from the `render.screen` object. - * - * @function Phaser.Utils.Objects.GetValue - * @since 3.0.0 - * - * @param {object} source - The primary object to try to retrieve the value from. If not found in here, `altSource` is checked. - * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. - * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. - * @param {object} [altSource] - An alternative object to retrieve the value from. If the property exists in `source` then `altSource` will not be used. - * - * @return {*} The value of the requested key. - */ -var GetValue = function (source, key, defaultValue, altSource) -{ - if ((!source && !altSource) || typeof source === 'number') - { - return defaultValue; - } - else if (source && source.hasOwnProperty(key)) - { - return source[key]; - } - else if (altSource && altSource.hasOwnProperty(key)) - { - return altSource[key]; - } - else if (key.indexOf('.') !== -1) - { - var keys = key.split('.'); - var parentA = source; - var parentB = altSource; - var valueA = defaultValue; - var valueB = defaultValue; - var valueAFound = true; - var valueBFound = true; - - // Use for loop here so we can break early - for (var i = 0; i < keys.length; i++) - { - if (parentA && parentA.hasOwnProperty(keys[i])) - { - // Yes parentA has a key property, let's carry on down - valueA = parentA[keys[i]]; - parentA = parentA[keys[i]]; - } - else - { - valueAFound = false; - } - - if (parentB && parentB.hasOwnProperty(keys[i])) - { - // Yes parentB has a key property, let's carry on down - valueB = parentB[keys[i]]; - parentB = parentB[keys[i]]; - } - else - { - valueBFound = false; - } - } - - if (valueAFound) - { - return valueA; - } - else if (valueBFound) - { - return valueB; - } - else - { - return defaultValue; - } - } - else - { - return defaultValue; - } -}; - -module.exports = GetValue; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue} - * - * @function Phaser.Utils.Objects.GetFastValue - * @since 3.0.0 - * - * @param {object} source - The object to search - * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods) - * @param {*} [defaultValue] - The default value to use if the key does not exist. - * - * @return {*} The value if found; otherwise, defaultValue (null if none provided) - */ -var GetFastValue = function (source, key, defaultValue) -{ - var t = typeof(source); - - if (!source || t === 'number' || t === 'string') - { - return defaultValue; - } - else if (source.hasOwnProperty(key) && source[key] !== undefined) - { - return source[key]; - } - else - { - return defaultValue; - } -}; - -module.exports = GetFastValue; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var FILE_CONST = { - - /** - * The Loader is idle. - * - * @name Phaser.Loader.LOADER_IDLE - * @type {number} - * @since 3.0.0 - */ - LOADER_IDLE: 0, - - /** - * The Loader is actively loading. - * - * @name Phaser.Loader.LOADER_LOADING - * @type {number} - * @since 3.0.0 - */ - LOADER_LOADING: 1, - - /** - * The Loader is processing files is has loaded. - * - * @name Phaser.Loader.LOADER_PROCESSING - * @type {number} - * @since 3.0.0 - */ - LOADER_PROCESSING: 2, - - /** - * The Loader has completed loading and processing. - * - * @name Phaser.Loader.LOADER_COMPLETE - * @type {number} - * @since 3.0.0 - */ - LOADER_COMPLETE: 3, - - /** - * The Loader is shutting down. - * - * @name Phaser.Loader.LOADER_SHUTDOWN - * @type {number} - * @since 3.0.0 - */ - LOADER_SHUTDOWN: 4, - - /** - * The Loader has been destroyed. - * - * @name Phaser.Loader.LOADER_DESTROYED - * @type {number} - * @since 3.0.0 - */ - LOADER_DESTROYED: 5, - - /** - * File is in the load queue but not yet started. - * - * @name Phaser.Loader.FILE_PENDING - * @type {number} - * @since 3.0.0 - */ - FILE_PENDING: 10, - - /** - * File has been started to load by the loader (onLoad called) - * - * @name Phaser.Loader.FILE_LOADING - * @type {number} - * @since 3.0.0 - */ - FILE_LOADING: 11, - - /** - * File has loaded successfully, awaiting processing. - * - * @name Phaser.Loader.FILE_LOADED - * @type {number} - * @since 3.0.0 - */ - FILE_LOADED: 12, - - /** - * File failed to load. - * - * @name Phaser.Loader.FILE_FAILED - * @type {number} - * @since 3.0.0 - */ - FILE_FAILED: 13, - - /** - * File is being processed (onProcess callback) - * - * @name Phaser.Loader.FILE_PROCESSING - * @type {number} - * @since 3.0.0 - */ - FILE_PROCESSING: 14, - - /** - * The File has errored somehow during processing. - * - * @name Phaser.Loader.FILE_ERRORED - * @type {number} - * @since 3.0.0 - */ - FILE_ERRORED: 16, - - /** - * File has finished processing. - * - * @name Phaser.Loader.FILE_COMPLETE - * @type {number} - * @since 3.0.0 - */ - FILE_COMPLETE: 17, - - /** - * File has been destroyed. - * - * @name Phaser.Loader.FILE_DESTROYED - * @type {number} - * @since 3.0.0 - */ - FILE_DESTROYED: 18, - - /** - * File was populated from local data and doesn't need an HTTP request. - * - * @name Phaser.Loader.FILE_POPULATED - * @type {number} - * @since 3.0.0 - */ - FILE_POPULATED: 19, - - /** - * File is pending being destroyed. - * - * @name Phaser.Loader.FILE_PENDING_DESTROY - * @type {number} - * @since 3.60.0 - */ - FILE_PENDING_DESTROY: 20 - -}; - -module.exports = FILE_CONST; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Removes a single item from an array and returns it without creating gc, like the native splice does. - * Based on code by Mike Reinstein. - * - * @function Phaser.Utils.Array.SpliceOne - * @since 3.0.0 - * - * @param {array} array - The array to splice from. - * @param {number} index - The index of the item which should be spliced. - * - * @return {*} The item which was spliced (removed). - */ -var SpliceOne = function (array, index) -{ - if (index >= array.length) - { - return; - } - - var len = array.length - 1; - - var item = array[index]; - - for (var i = index; i < len; i++) - { - array[i] = array[i + 1]; - } - - array.length = len; - - return item; -}; - -module.exports = SpliceOne; - - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var GEOM_CONST = __webpack_require__(29); - -/** - * @classdesc - * Defines a Point in 2D space, with an x and y component. - * - * @class Point - * @memberof Phaser.Geom - * @constructor - * @since 3.0.0 - * - * @param {number} [x=0] - The x coordinate of this Point. - * @param {number} [y=x] - The y coordinate of this Point. - */ -var Point = new Class({ - - initialize: - - function Point (x, y) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = x; } - - /** - * The geometry constant type of this object: `GEOM_CONST.POINT`. - * Used for fast type comparisons. - * - * @name Phaser.Geom.Point#type - * @type {number} - * @readonly - * @since 3.19.0 - */ - this.type = GEOM_CONST.POINT; - - /** - * The x coordinate of this Point. - * - * @name Phaser.Geom.Point#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = x; - - /** - * The y coordinate of this Point. - * - * @name Phaser.Geom.Point#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = y; - }, - - /** - * Set the x and y coordinates of the point to the given values. - * - * @method Phaser.Geom.Point#setTo - * @since 3.0.0 - * - * @param {number} [x=0] - The x coordinate of this Point. - * @param {number} [y=x] - The y coordinate of this Point. - * - * @return {this} This Point object. - */ - setTo: function (x, y) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - } - -}); - -module.exports = Point; - - -/***/ }), -/* 12 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Phaser Blend Modes. - * - * @namespace Phaser.BlendModes - * @since 3.0.0 - */ - -module.exports = { - - /** - * Skips the Blend Mode check in the renderer. - * - * @name Phaser.BlendModes.SKIP_CHECK - * @type {number} - * @const - * @since 3.0.0 - */ - SKIP_CHECK: -1, - - /** - * Normal blend mode. For Canvas and WebGL. - * This is the default setting and draws new shapes on top of the existing canvas content. - * - * @name Phaser.BlendModes.NORMAL - * @type {number} - * @const - * @since 3.0.0 - */ - NORMAL: 0, - - /** - * Add blend mode. For Canvas and WebGL. - * Where both shapes overlap the color is determined by adding color values. - * - * @name Phaser.BlendModes.ADD - * @type {number} - * @const - * @since 3.0.0 - */ - ADD: 1, - - /** - * Multiply blend mode. For Canvas and WebGL. - * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. - * - * @name Phaser.BlendModes.MULTIPLY - * @type {number} - * @const - * @since 3.0.0 - */ - MULTIPLY: 2, - - /** - * Screen blend mode. For Canvas and WebGL. - * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) - * - * @name Phaser.BlendModes.SCREEN - * @type {number} - * @const - * @since 3.0.0 - */ - SCREEN: 3, - - /** - * Overlay blend mode. For Canvas only. - * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. - * - * @name Phaser.BlendModes.OVERLAY - * @type {number} - * @const - * @since 3.0.0 - */ - OVERLAY: 4, - - /** - * Darken blend mode. For Canvas only. - * Retains the darkest pixels of both layers. - * - * @name Phaser.BlendModes.DARKEN - * @type {number} - * @const - * @since 3.0.0 - */ - DARKEN: 5, - - /** - * Lighten blend mode. For Canvas only. - * Retains the lightest pixels of both layers. - * - * @name Phaser.BlendModes.LIGHTEN - * @type {number} - * @const - * @since 3.0.0 - */ - LIGHTEN: 6, - - /** - * Color Dodge blend mode. For Canvas only. - * Divides the bottom layer by the inverted top layer. - * - * @name Phaser.BlendModes.COLOR_DODGE - * @type {number} - * @const - * @since 3.0.0 - */ - COLOR_DODGE: 7, - - /** - * Color Burn blend mode. For Canvas only. - * Divides the inverted bottom layer by the top layer, and then inverts the result. - * - * @name Phaser.BlendModes.COLOR_BURN - * @type {number} - * @const - * @since 3.0.0 - */ - COLOR_BURN: 8, - - /** - * Hard Light blend mode. For Canvas only. - * A combination of multiply and screen like overlay, but with top and bottom layer swapped. - * - * @name Phaser.BlendModes.HARD_LIGHT - * @type {number} - * @const - * @since 3.0.0 - */ - HARD_LIGHT: 9, - - /** - * Soft Light blend mode. For Canvas only. - * A softer version of hard-light. Pure black or white does not result in pure black or white. - * - * @name Phaser.BlendModes.SOFT_LIGHT - * @type {number} - * @const - * @since 3.0.0 - */ - SOFT_LIGHT: 10, - - /** - * Difference blend mode. For Canvas only. - * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. - * - * @name Phaser.BlendModes.DIFFERENCE - * @type {number} - * @const - * @since 3.0.0 - */ - DIFFERENCE: 11, - - /** - * Exclusion blend mode. For Canvas only. - * Like difference, but with lower contrast. - * - * @name Phaser.BlendModes.EXCLUSION - * @type {number} - * @const - * @since 3.0.0 - */ - EXCLUSION: 12, - - /** - * Hue blend mode. For Canvas only. - * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. - * - * @name Phaser.BlendModes.HUE - * @type {number} - * @const - * @since 3.0.0 - */ - HUE: 13, - - /** - * Saturation blend mode. For Canvas only. - * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. - * - * @name Phaser.BlendModes.SATURATION - * @type {number} - * @const - * @since 3.0.0 - */ - SATURATION: 14, - - /** - * Color blend mode. For Canvas only. - * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. - * - * @name Phaser.BlendModes.COLOR - * @type {number} - * @const - * @since 3.0.0 - */ - COLOR: 15, - - /** - * Luminosity blend mode. For Canvas only. - * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. - * - * @name Phaser.BlendModes.LUMINOSITY - * @type {number} - * @const - * @since 3.0.0 - */ - LUMINOSITY: 16, - - /** - * Alpha erase blend mode. For Canvas and WebGL. - * - * @name Phaser.BlendModes.ERASE - * @type {number} - * @const - * @since 3.0.0 - */ - ERASE: 17, - - /** - * Source-in blend mode. For Canvas only. - * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. - * - * @name Phaser.BlendModes.SOURCE_IN - * @type {number} - * @const - * @since 3.0.0 - */ - SOURCE_IN: 18, - - /** - * Source-out blend mode. For Canvas only. - * The new shape is drawn where it doesn't overlap the existing canvas content. - * - * @name Phaser.BlendModes.SOURCE_OUT - * @type {number} - * @const - * @since 3.0.0 - */ - SOURCE_OUT: 19, - - /** - * Source-out blend mode. For Canvas only. - * The new shape is only drawn where it overlaps the existing canvas content. - * - * @name Phaser.BlendModes.SOURCE_ATOP - * @type {number} - * @const - * @since 3.0.0 - */ - SOURCE_ATOP: 20, - - /** - * Destination-over blend mode. For Canvas only. - * New shapes are drawn behind the existing canvas content. - * - * @name Phaser.BlendModes.DESTINATION_OVER - * @type {number} - * @const - * @since 3.0.0 - */ - DESTINATION_OVER: 21, - - /** - * Destination-in blend mode. For Canvas only. - * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. - * - * @name Phaser.BlendModes.DESTINATION_IN - * @type {number} - * @const - * @since 3.0.0 - */ - DESTINATION_IN: 22, - - /** - * Destination-out blend mode. For Canvas only. - * The existing content is kept where it doesn't overlap the new shape. - * - * @name Phaser.BlendModes.DESTINATION_OUT - * @type {number} - * @const - * @since 3.0.0 - */ - DESTINATION_OUT: 23, - - /** - * Destination-out blend mode. For Canvas only. - * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. - * - * @name Phaser.BlendModes.DESTINATION_ATOP - * @type {number} - * @const - * @since 3.0.0 - */ - DESTINATION_ATOP: 24, - - /** - * Lighten blend mode. For Canvas only. - * Where both shapes overlap the color is determined by adding color values. - * - * @name Phaser.BlendModes.LIGHTER - * @type {number} - * @const - * @since 3.0.0 - */ - LIGHTER: 25, - - /** - * Copy blend mode. For Canvas only. - * Only the new shape is shown. - * - * @name Phaser.BlendModes.COPY - * @type {number} - * @const - * @since 3.0.0 - */ - COPY: 26, - - /** - * Xor blend mode. For Canvas only. - * Shapes are made transparent where both overlap and drawn normal everywhere else. - * - * @name Phaser.BlendModes.XOR - * @type {number} - * @const - * @since 3.0.0 - */ - XOR: 27 - -}; - - -/***/ }), -/* 13 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Wrap the given `value` between `min` and `max`. - * - * @function Phaser.Math.Wrap - * @since 3.0.0 - * - * @param {number} value - The value to wrap. - * @param {number} min - The minimum value. - * @param {number} max - The maximum value. - * - * @return {number} The wrapped value. - */ -var Wrap = function (value, min, max) -{ - var range = max - min; - - return (min + ((((value - min) % range) + range) % range)); -}; - -module.exports = Wrap; - - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A representation of a vector in 3D space. - * - * A three-component vector. - * - * @class Vector3 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - */ -var Vector3 = new Class({ - - initialize: - - function Vector3 (x, y, z) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector3#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector3#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - /** - * The z component of this Vector. - * - * @name Phaser.Math.Vector3#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.z = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - } - }, - - /** - * Set this Vector to point up. - * - * Sets the y component of the vector to 1, and the others to 0. - * - * @method Phaser.Math.Vector3#up - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - up: function () - { - this.x = 0; - this.y = 1; - this.z = 0; - - return this; - }, - - /** - * Sets the components of this Vector to be the `Math.min` result from the given vector. - * - * @method Phaser.Math.Vector3#min - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to check the minimum values against. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - min: function (v) - { - this.x = Math.min(this.x, v.x); - this.y = Math.min(this.y, v.y); - this.z = Math.min(this.z, v.z); - - return this; - }, - - /** - * Sets the components of this Vector to be the `Math.max` result from the given vector. - * - * @method Phaser.Math.Vector3#max - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to check the maximum values against. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - max: function (v) - { - this.x = Math.max(this.x, v.x); - this.y = Math.max(this.y, v.y); - this.z = Math.max(this.z, v.z); - - return this; - }, - - /** - * Make a clone of this Vector3. - * - * @method Phaser.Math.Vector3#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. - */ - clone: function () - { - return new Vector3(this.x, this.y, this.z); - }, - - /** - * Adds the two given Vector3s and sets the results into this Vector3. - * - * @method Phaser.Math.Vector3#addVectors - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} a - The first Vector to add. - * @param {Phaser.Math.Vector3} b - The second Vector to add. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - addVectors: function (a, b) - { - this.x = a.x + b.x; - this.y = a.y + b.y; - this.z = a.z + b.z; - - return this; - }, - - /** - * Calculate the cross (vector) product of two given Vectors. - * - * @method Phaser.Math.Vector3#crossVectors - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} a - The first Vector to multiply. - * @param {Phaser.Math.Vector3} b - The second Vector to multiply. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - crossVectors: function (a, b) - { - var ax = a.x; - var ay = a.y; - var az = a.z; - var bx = b.x; - var by = b.y; - var bz = b.z; - - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict equality check against each Vector's components. - * - * @method Phaser.Math.Vector3#equals - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. - * - * @return {boolean} True if the two vectors strictly match, otherwise false. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector3#copy - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - copy: function (src) - { - this.x = src.x; - this.y = src.y; - this.z = src.z || 0; - - return this; - }, - - /** - * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. - * - * @method Phaser.Math.Vector3#set - * @since 3.0.0 - * - * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. - * @param {number} [y] - The y value to set for this Vector. - * @param {number} [z] - The z value to set for this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - set: function (x, y, z) - { - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - } - - return this; - }, - - /** - * Sets the components of this Vector3 from the position of the given Matrix4. - * - * @method Phaser.Math.Vector3#setFromMatrixPosition - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the position from. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - setFromMatrixPosition: function (m) - { - return this.fromArray(m.val, 12); - }, - - /** - * Sets the components of this Vector3 from the Matrix4 column specified. - * - * @method Phaser.Math.Vector3#setFromMatrixColumn - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the column from. - * @param {number} index - The column index. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - setFromMatrixColumn: function (mat4, index) - { - return this.fromArray(mat4.val, index * 4); - }, - - /** - * Sets the components of this Vector3 from the given array, based on the offset. - * - * Vector3.x = array[offset] - * Vector3.y = array[offset + 1] - * Vector3.z = array[offset + 2] - * - * @method Phaser.Math.Vector3#fromArray - * @since 3.50.0 - * - * @param {number[]} array - The array of values to get this Vector from. - * @param {number} [offset=0] - The offset index into the array. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - fromArray: function (array, offset) - { - if (offset === undefined) { offset = 0; } - - this.x = array[offset]; - this.y = array[offset + 1]; - this.z = array[offset + 2]; - - return this; - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector3#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - add: function (v) - { - this.x += v.x; - this.y += v.y; - this.z += v.z || 0; - - return this; - }, - - /** - * Add the given value to each component of this Vector. - * - * @method Phaser.Math.Vector3#addScalar - * @since 3.50.0 - * - * @param {number} s - The amount to add to this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - addScalar: function (s) - { - this.x += s; - this.y += s; - this.z += s; - - return this; - }, - - /** - * Add and scale a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector3#addScale - * @since 3.50.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. - * @param {number} scale - The amount to scale `v` by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - addScale: function (v, scale) - { - this.x += v.x * scale; - this.y += v.y * scale; - this.z += v.z * scale || 0; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector3#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - subtract: function (v) - { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z || 0; - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - multiply: function (v) - { - this.x *= v.x; - this.y *= v.y; - this.z *= v.z || 1; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector3#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - scale: function (scale) - { - if (isFinite(scale)) - { - this.x *= scale; - this.y *= scale; - this.z *= scale; - } - else - { - this.x = 0; - this.y = 0; - this.z = 0; - } - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#divide - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - divide: function (v) - { - this.x /= v.x; - this.y /= v.y; - this.z /= v.z || 1; - - return this; - }, - - /** - * Negate the `x`, `y` and `z` components of this Vector. - * - * @method Phaser.Math.Vector3#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector3#distance - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - - return Math.sqrt(dx * dx + dy * dy + dz * dz); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector3#distanceSq - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - - return dx * dx + dy * dy + dz * dz; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector3#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return Math.sqrt(x * x + y * y + z * z); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector3#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return x * x + y * y + z * z; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector3#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var len = x * x + y * y + z * z; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - this.z = z * len; - } - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector3#dot - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. - * - * @return {number} The dot product of this Vector and `v`. - */ - dot: function (v) - { - return this.x * v.x + this.y * v.y + this.z * v.z; - }, - - /** - * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. - * - * @method Phaser.Math.Vector3#cross - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector to cross product with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - cross: function (v) - { - var ax = this.x; - var ay = this.y; - var az = this.z; - var bx = v.x; - var by = v.y; - var bz = v.z; - - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - - return this; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector3#lerp - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - lerp: function (v, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - var az = this.z; - - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - - return this; - }, - - /** - * Takes a Matrix3 and applies it to this Vector3. - * - * @method Phaser.Math.Vector3#applyMatrix3 - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix3} mat3 - The Matrix3 to apply to this Vector3. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - applyMatrix3: function (mat3) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat3.val; - - this.x = m[0] * x + m[3] * y + m[6] * z; - this.y = m[1] * x + m[4] * y + m[7] * z; - this.z = m[2] * x + m[5] * y + m[8] * z; - - return this; - }, - - /** - * Takes a Matrix4 and applies it to this Vector3. - * - * @method Phaser.Math.Vector3#applyMatrix4 - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to apply to this Vector3. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - applyMatrix4: function (mat4) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat4.val; - - var w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]); - - this.x = (m[0] * x + m[4] * y + m[8] * z + m[12]) * w; - this.y = (m[1] * x + m[5] * y + m[9] * z + m[13]) * w; - this.z = (m[2] * x + m[6] * y + m[10] * z + m[14]) * w; - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector3#transformMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat3: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = x * m[0] + y * m[3] + z * m[6]; - this.y = x * m[1] + y * m[4] + z * m[7]; - this.z = x * m[2] + y * m[5] + z * m[8]; - - return this; - }, - - /** - * Transform this Vector with the given Matrix4. - * - * @method Phaser.Math.Vector3#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; - this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; - this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; - - return this; - }, - - /** - * Transforms the coordinates of this Vector3 with the given Matrix4. - * - * @method Phaser.Math.Vector3#transformCoordinates - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformCoordinates: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; - var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; - var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; - var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; - - this.x = tx / tw; - this.y = ty / tw; - this.z = tz / tw; - - return this; - }, - - /** - * Transform this Vector with the given Quaternion. - * - * @method Phaser.Math.Vector3#transformQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformQuat: function (q) - { - // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations - var x = this.x; - var y = this.y; - var z = this.z; - var qx = q.x; - var qy = q.y; - var qz = q.z; - var qw = q.w; - - // calculate quat * vec - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = -qx * x - qy * y - qz * z; - - // calculate result * inverse quat - this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; - this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; - this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; - - return this; - }, - - /** - * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, - * e.g. unprojecting a 2D point into 3D space. - * - * @method Phaser.Math.Vector3#project - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - project: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var a00 = m[0]; - var a01 = m[1]; - var a02 = m[2]; - var a03 = m[3]; - var a10 = m[4]; - var a11 = m[5]; - var a12 = m[6]; - var a13 = m[7]; - var a20 = m[8]; - var a21 = m[9]; - var a22 = m[10]; - var a23 = m[11]; - var a30 = m[12]; - var a31 = m[13]; - var a32 = m[14]; - var a33 = m[15]; - - var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); - - this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; - this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; - this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; - - return this; - }, - - /** - * Multiplies this Vector3 by the given view and projection matrices. - * - * @method Phaser.Math.Vector3#projectViewMatrix - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} viewMatrix - A View Matrix. - * @param {Phaser.Math.Matrix4} projectionMatrix - A Projection Matrix. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - projectViewMatrix: function (viewMatrix, projectionMatrix) - { - return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix); - }, - - /** - * Multiplies this Vector3 by the given inversed projection matrix and world matrix. - * - * @method Phaser.Math.Vector3#unprojectViewMatrix - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} projectionMatrix - An inversed Projection Matrix. - * @param {Phaser.Math.Matrix4} worldMatrix - A World View Matrix. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - unprojectViewMatrix: function (projectionMatrix, worldMatrix) - { - return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix); - }, - - /** - * Unproject this point from 2D space to 3D space. - * The point should have its x and y properties set to - * 2D screen space, and the z either at 0 (near plane) - * or 1 (far plane). The provided matrix is assumed to already - * be combined, i.e. projection * view * model. - * - * After this operation, this vector's (x, y, z) components will - * represent the unprojected 3D coordinate. - * - * @method Phaser.Math.Vector3#unproject - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. - * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - unproject: function (viewport, invProjectionView) - { - var viewX = viewport.x; - var viewY = viewport.y; - var viewWidth = viewport.z; - var viewHeight = viewport.w; - - var x = this.x - viewX; - var y = (viewHeight - this.y - 1) - viewY; - var z = this.z; - - this.x = (2 * x) / viewWidth - 1; - this.y = (2 * y) / viewHeight - 1; - this.z = 2 * z - 1; - - return this.project(invProjectionView); - }, - - /** - * Make this Vector the zero vector (0, 0, 0). - * - * @method Phaser.Math.Vector3#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - reset: function () - { - this.x = 0; - this.y = 0; - this.z = 0; - - return this; - } - -}); - -/** - * A static zero Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ZERO - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.ZERO = new Vector3(); - -/** - * A static right Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.RIGHT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.RIGHT = new Vector3(1, 0, 0); - -/** - * A static left Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.LEFT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.LEFT = new Vector3(-1, 0, 0); - -/** - * A static up Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.UP - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.UP = new Vector3(0, -1, 0); - -/** - * A static down Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.DOWN - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.DOWN = new Vector3(0, 1, 0); - -/** - * A static forward Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.FORWARD - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.FORWARD = new Vector3(0, 0, 1); - -/** - * A static back Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.BACK - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.BACK = new Vector3(0, 0, -1); - -/** - * A static one Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ONE - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.ONE = new Vector3(1, 1, 1); - -module.exports = Vector3; - - -/***/ }), -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CheckMatrix = __webpack_require__(26); -var TransposeMatrix = __webpack_require__(61); - -/** - * Rotates the array matrix based on the given rotation value. - * - * The value can be given in degrees: 90, -90, 270, -270 or 180, - * or a string command: `rotateLeft`, `rotateRight` or `rotate180`. - * - * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.RotateMatrix - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array to rotate. - * @param {(number|string)} [direction=90] - The amount to rotate the matrix by. - * - * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. - */ -var RotateMatrix = function (matrix, direction) -{ - if (direction === undefined) { direction = 90; } - - if (!CheckMatrix(matrix)) - { - return null; - } - - if (typeof direction !== 'string') - { - direction = ((direction % 360) + 360) % 360; - } - - if (direction === 90 || direction === -270 || direction === 'rotateLeft') - { - matrix = TransposeMatrix(matrix); - matrix.reverse(); - } - else if (direction === -90 || direction === 270 || direction === 'rotateRight') - { - matrix.reverse(); - matrix = TransposeMatrix(matrix); - } - else if (Math.abs(direction) === 180 || direction === 'rotate180') - { - for (var i = 0; i < matrix.length; i++) - { - matrix[i].reverse(); - } - - matrix.reverse(); - } - - return matrix; -}; - -module.exports = RotateMatrix; - - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var OS = __webpack_require__(27); - -/** - * Determines the browser type and version running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.browser` from within any Scene. - * - * @typedef {object} Phaser.Device.Browser - * @since 3.0.0 - * - * @property {boolean} chrome - Set to true if running in Chrome. - * @property {boolean} edge - Set to true if running in Microsoft Edge browser. - * @property {boolean} firefox - Set to true if running in Firefox. - * @property {boolean} ie - Set to true if running in Internet Explorer 11 or less (not Edge). - * @property {boolean} mobileSafari - Set to true if running in Mobile Safari. - * @property {boolean} opera - Set to true if running in Opera. - * @property {boolean} safari - Set to true if running in Safari. - * @property {boolean} silk - Set to true if running in the Silk browser (as used on the Amazon Kindle) - * @property {boolean} trident - Set to true if running a Trident version of Internet Explorer (IE11+) - * @property {number} chromeVersion - If running in Chrome this will contain the major version number. - * @property {number} firefoxVersion - If running in Firefox this will contain the major version number. - * @property {number} ieVersion - If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Browser.trident and Browser.tridentVersion. - * @property {number} safariVersion - If running in Safari this will contain the major version number. - * @property {number} tridentVersion - If running in Internet Explorer 11 this will contain the major version number. See {@link http://msdn.microsoft.com/en-us/library/ie/ms537503(v=vs.85).aspx} - */ -var Browser = { - - chrome: false, - chromeVersion: 0, - edge: false, - firefox: false, - firefoxVersion: 0, - ie: false, - ieVersion: 0, - mobileSafari: false, - opera: false, - safari: false, - safariVersion: 0, - silk: false, - trident: false, - tridentVersion: 0, - es2019: false - -}; - -function init () -{ - var ua = navigator.userAgent; - - if ((/Edg\/\d+/).test(ua)) - { - Browser.edge = true; - Browser.es2019 = true; - } - else if ((/OPR/).test(ua)) { - Browser.opera = true; - Browser.es2019 = true; - } - else if ((/Chrome\/(\d+)/).test(ua) && !OS.windowsPhone) - { - Browser.chrome = true; - Browser.chromeVersion = parseInt(RegExp.$1, 10); - Browser.es2019 = (Browser.chromeVersion > 69); - } - else if ((/Firefox\D+(\d+)/).test(ua)) - { - Browser.firefox = true; - Browser.firefoxVersion = parseInt(RegExp.$1, 10); - Browser.es2019 = (Browser.firefoxVersion > 10); - } - else if ((/AppleWebKit/).test(ua) && OS.iOS) - { - Browser.mobileSafari = true; - } - else if ((/MSIE (\d+\.\d+);/).test(ua)) - { - Browser.ie = true; - Browser.ieVersion = parseInt(RegExp.$1, 10); - } - else if ((/Version\/(\d+\.\d+) Safari/).test(ua) && !OS.windowsPhone) - { - Browser.safari = true; - Browser.safariVersion = parseInt(RegExp.$1, 10); - Browser.es2019 = (Browser.safariVersion > 10); - } - else if ((/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/).test(ua)) - { - Browser.ie = true; - Browser.trident = true; - Browser.tridentVersion = parseInt(RegExp.$1, 10); - Browser.ieVersion = parseInt(RegExp.$3, 10); - } - - // Silk gets its own if clause because its ua also contains 'Safari' - if ((/Silk/).test(ua)) - { - Browser.silk = true; - } - - return Browser; +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; } -module.exports = init(); - - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var IsPlainObject = __webpack_require__(6); - -// @param {boolean} deep - Perform a deep copy? -// @param {object} target - The target object to copy to. -// @return {object} The extended object. - -/** - * This is a slightly modified version of http://api.jquery.com/jQuery.extend/ + * Return an array listing the events for which the emitter has registered + * listeners. * - * @function Phaser.Utils.Objects.Extend - * @since 3.0.0 - * - * @param {...*} [args] - The objects that will be mixed. - * - * @return {object} The extended object. + * @returns {Array} + * @public */ -var Extend = function () -{ - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; - // Handle a deep copy situation - if (typeof target === 'boolean') - { - deep = target; - target = arguments[1] || {}; + if (this._eventsCount === 0) return names; - // skip the boolean and the target - i = 2; - } + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } - // extend Phaser if only one argument is passed - if (length === i) - { - target = this; - --i; - } + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } - for (; i < length; i++) - { - // Only deal with non-null/undefined values - if ((options = arguments[i]) != null) - { - // Extend the base object - for (name in options) - { - src = target[name]; - copy = options[name]; - - // Prevent never-ending loop - if (target === copy) - { - continue; - } - - // Recurse if we're merging plain objects or arrays - if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) - { - if (copyIsArray) - { - copyIsArray = false; - clone = src && Array.isArray(src) ? src : []; - } - else - { - clone = src && IsPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[name] = Extend(deep, clone, copy); - - // Don't bring in undefined values - } - else if (copy !== undefined) - { - target[name] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -module.exports = Extend; - - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(3); - -/** - * Takes an angle in Phasers default clockwise format and converts it so that - * 0 is North, 90 is West, 180 is South and 270 is East, - * therefore running counter-clockwise instead of clockwise. - * - * You can pass in the angle from a Game Object using: - * - * ```javascript - * var converted = CounterClockwise(gameobject.rotation); - * ``` - * - * All values for this function are in radians. - * - * @function Phaser.Math.Angle.CounterClockwise - * @since 3.16.0 - * - * @param {number} angle - The angle to convert, in radians. - * - * @return {number} The converted angle, in radians. - */ -var CounterClockwise = function (angle) -{ - if (angle > Math.PI) - { - angle -= CONST.PI2; - } - - return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); -}; - -module.exports = CounterClockwise; - - -/***/ }), -/* 19 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Generate a random floating point number between the two given bounds, minimum inclusive, maximum exclusive. - * - * @function Phaser.Math.FloatBetween - * @since 3.0.0 - * - * @param {number} min - The lower bound for the float, inclusive. - * @param {number} max - The upper bound for the float exclusive. - * - * @return {number} A random float within the given range. - */ -var FloatBetween = function (min, max) -{ - return Math.random() * (max - min) + min; -}; - -module.exports = FloatBetween; - - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(3); - -/** - * Convert the given angle from degrees, to the equivalent angle in radians. - * - * @function Phaser.Math.DegToRad - * @since 3.0.0 - * - * @param {number} degrees - The angle (in degrees) to convert to radians. - * - * @return {number} The given angle converted to radians. - */ -var DegToRad = function (degrees) -{ - return degrees * CONST.DEG_TO_RAD; -}; - -module.exports = DegToRad; - - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Vector3 = __webpack_require__(14); - -/** - * @ignore - */ -var EPSILON = 0.000001; - -/** - * @classdesc - * A four-dimensional matrix. - * - * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji - * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - * - * @class Matrix4 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. - */ -var Matrix4 = new Class({ - - initialize: - - function Matrix4 (m) - { - /** - * The matrix values. - * - * @name Phaser.Math.Matrix4#val - * @type {Float32Array} - * @since 3.0.0 - */ - this.val = new Float32Array(16); - - if (m) - { - // Assume Matrix4 with val: - this.copy(m); - } - else - { - // Default to identity - this.identity(); - } - }, - - /** - * Make a clone of this Matrix4. - * - * @method Phaser.Math.Matrix4#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} A clone of this Matrix4. - */ - clone: function () - { - return new Matrix4(this); - }, - - /** - * This method is an alias for `Matrix4.copy`. - * - * @method Phaser.Math.Matrix4#set - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. - * - * @return {this} This Matrix4. - */ - set: function (src) - { - return this.copy(src); - }, - - /** - * Sets all values of this Matrix4. - * - * @method Phaser.Math.Matrix4#setValues - * @since 3.50.0 - * - * @param {number} m00 - The m00 value. - * @param {number} m01 - The m01 value. - * @param {number} m02 - The m02 value. - * @param {number} m03 - The m03 value. - * @param {number} m10 - The m10 value. - * @param {number} m11 - The m11 value. - * @param {number} m12 - The m12 value. - * @param {number} m13 - The m13 value. - * @param {number} m20 - The m20 value. - * @param {number} m21 - The m21 value. - * @param {number} m22 - The m22 value. - * @param {number} m23 - The m23 value. - * @param {number} m30 - The m30 value. - * @param {number} m31 - The m31 value. - * @param {number} m32 - The m32 value. - * @param {number} m33 - The m33 value. - * - * @return {this} This Matrix4 instance. - */ - setValues: function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) - { - var out = this.val; - - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m03; - out[4] = m10; - out[5] = m11; - out[6] = m12; - out[7] = m13; - out[8] = m20; - out[9] = m21; - out[10] = m22; - out[11] = m23; - out[12] = m30; - out[13] = m31; - out[14] = m32; - out[15] = m33; - - return this; - }, - - /** - * Copy the values of a given Matrix into this Matrix. - * - * @method Phaser.Math.Matrix4#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. - * - * @return {this} This Matrix4. - */ - copy: function (src) - { - var a = src.val; - - return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); - }, - - /** - * Set the values of this Matrix from the given array. - * - * @method Phaser.Math.Matrix4#fromArray - * @since 3.0.0 - * - * @param {number[]} a - The array to copy the values from. Must have at least 16 elements. - * - * @return {this} This Matrix4. - */ - fromArray: function (a) - { - return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); - }, - - /** - * Reset this Matrix. - * - * Sets all values to `0`. - * - * @method Phaser.Math.Matrix4#zero - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - zero: function () - { - return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - }, - - /** - * Generates a transform matrix based on the given position, scale and rotation. - * - * @method Phaser.Math.Matrix4#transform - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} position - The position vector. - * @param {Phaser.Math.Vector3} scale - The scale vector. - * @param {Phaser.Math.Quaternion} rotation - The rotation quaternion. - * - * @return {this} This Matrix4. - */ - transform: function (position, scale, rotation) - { - var rotMatrix = _tempMat1.fromQuat(rotation); - - var rm = rotMatrix.val; - - var sx = scale.x; - var sy = scale.y; - var sz = scale.z; - - return this.setValues( - rm[0] * sx, - rm[1] * sx, - rm[2] * sx, - 0, - - rm[4] * sy, - rm[5] * sy, - rm[6] * sy, - 0, - - rm[8] * sz, - rm[9] * sz, - rm[10] * sz, - 0, - - position.x, - position.y, - position.z, - 1 - ); - }, - - /** - * Set the `x`, `y` and `z` values of this Matrix. - * - * @method Phaser.Math.Matrix4#xyz - * @since 3.0.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {number} z - The z value. - * - * @return {this} This Matrix4. - */ - xyz: function (x, y, z) - { - this.identity(); - - var out = this.val; - - out[12] = x; - out[13] = y; - out[14] = z; - - return this; - }, - - /** - * Set the scaling values of this Matrix. - * - * @method Phaser.Math.Matrix4#scaling - * @since 3.0.0 - * - * @param {number} x - The x scaling value. - * @param {number} y - The y scaling value. - * @param {number} z - The z scaling value. - * - * @return {this} This Matrix4. - */ - scaling: function (x, y, z) - { - this.zero(); - - var out = this.val; - - out[0] = x; - out[5] = y; - out[10] = z; - out[15] = 1; - - return this; - }, - - /** - * Reset this Matrix to an identity (default) matrix. - * - * @method Phaser.Math.Matrix4#identity - * @since 3.0.0 - * - * @return {this} This Matrix4. - */ - identity: function () - { - return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); - }, - - /** - * Transpose this Matrix. - * - * @method Phaser.Math.Matrix4#transpose - * @since 3.0.0 - * - * @return {this} This Matrix4. - */ - transpose: function () - { - var a = this.val; - - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a12 = a[6]; - var a13 = a[7]; - var a23 = a[11]; - - a[1] = a[4]; - a[2] = a[8]; - a[3] = a[12]; - a[4] = a01; - a[6] = a[9]; - a[7] = a[13]; - a[8] = a02; - a[9] = a12; - a[11] = a[14]; - a[12] = a03; - a[13] = a13; - a[14] = a23; - - return this; - }, - - /** - * Copies the given Matrix4 into this Matrix and then inverses it. - * - * @method Phaser.Math.Matrix4#getInverse - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to invert into this Matrix4. - * - * @return {this} This Matrix4. - */ - getInverse: function (m) - { - this.copy(m); - - return this.invert(); - }, - - /** - * Invert this Matrix. - * - * @method Phaser.Math.Matrix4#invert - * @since 3.0.0 - * - * @return {this} This Matrix4. - */ - invert: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) - { - return this; - } - - det = 1 / det; - - return this.setValues( - (a11 * b11 - a12 * b10 + a13 * b09) * det, - (a02 * b10 - a01 * b11 - a03 * b09) * det, - (a31 * b05 - a32 * b04 + a33 * b03) * det, - (a22 * b04 - a21 * b05 - a23 * b03) * det, - (a12 * b08 - a10 * b11 - a13 * b07) * det, - (a00 * b11 - a02 * b08 + a03 * b07) * det, - (a32 * b02 - a30 * b05 - a33 * b01) * det, - (a20 * b05 - a22 * b02 + a23 * b01) * det, - (a10 * b10 - a11 * b08 + a13 * b06) * det, - (a01 * b08 - a00 * b10 - a03 * b06) * det, - (a30 * b04 - a31 * b02 + a33 * b00) * det, - (a21 * b02 - a20 * b04 - a23 * b00) * det, - (a11 * b07 - a10 * b09 - a12 * b06) * det, - (a00 * b09 - a01 * b07 + a02 * b06) * det, - (a31 * b01 - a30 * b03 - a32 * b00) * det, - (a20 * b03 - a21 * b01 + a22 * b00) * det - ); - }, - - /** - * Calculate the adjoint, or adjugate, of this Matrix. - * - * @method Phaser.Math.Matrix4#adjoint - * @since 3.0.0 - * - * @return {this} This Matrix4. - */ - adjoint: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - return this.setValues( - (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)), - -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), - (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)), - -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), - -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)), - (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)), - -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)), - (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)), - (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)), - -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)), - (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)), - -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)), - -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)), - (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)), - -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)), - (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)) - ); - }, - - /** - * Calculate the determinant of this Matrix. - * - * @method Phaser.Math.Matrix4#determinant - * @since 3.0.0 - * - * @return {number} The determinant of this Matrix. - */ - determinant: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * @method Phaser.Math.Matrix4#multiply - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. - * - * @return {this} This Matrix4. - */ - multiply: function (src) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b = src.val; - - // Cache only the current line of the second matrix - var b0 = b[0]; - var b1 = b[1]; - var b2 = b[2]; - var b3 = b[3]; - - a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[4]; - b1 = b[5]; - b2 = b[6]; - b3 = b[7]; - - a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[8]; - b1 = b[9]; - b2 = b[10]; - b3 = b[11]; - - a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[12]; - b1 = b[13]; - b2 = b[14]; - b3 = b[15]; - - a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - return this; - }, - - /** - * Multiply the values of this Matrix4 by those given in the `src` argument. - * - * @method Phaser.Math.Matrix4#multiplyLocal - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. - * - * @return {this} This Matrix4. - */ - multiplyLocal: function (src) - { - var a = this.val; - var b = src.val; - - return this.setValues( - a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12], - a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13], - a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14], - a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15], - - a[4] * b[0] + a[5] * b[4] + a[6] * b[8] + a[7] * b[12], - a[4] * b[1] + a[5] * b[5] + a[6] * b[9] + a[7] * b[13], - a[4] * b[2] + a[5] * b[6] + a[6] * b[10] + a[7] * b[14], - a[4] * b[3] + a[5] * b[7] + a[6] * b[11] + a[7] * b[15], - - a[8] * b[0] + a[9] * b[4] + a[10] * b[8] + a[11] * b[12], - a[8] * b[1] + a[9] * b[5] + a[10] * b[9] + a[11] * b[13], - a[8] * b[2] + a[9] * b[6] + a[10] * b[10] + a[11] * b[14], - a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11] * b[15], - - a[12] * b[0] + a[13] * b[4] + a[14] * b[8] + a[15] * b[12], - a[12] * b[1] + a[13] * b[5] + a[14] * b[9] + a[15] * b[13], - a[12] * b[2] + a[13] * b[6] + a[14] * b[10] + a[15] * b[14], - a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15] - ); - }, - - /** - * Multiplies the given Matrix4 object with this Matrix. - * - * This is the same as calling `multiplyMatrices(m, this)`. - * - * @method Phaser.Math.Matrix4#premultiply - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to multiply with this one. - * - * @return {this} This Matrix4. - */ - premultiply: function (m) - { - return this.multiplyMatrices(m, this); - }, - - /** - * Multiplies the two given Matrix4 objects and stores the results in this Matrix. - * - * @method Phaser.Math.Matrix4#multiplyMatrices - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} a - The first Matrix4 to multiply. - * @param {Phaser.Math.Matrix4} b - The second Matrix4 to multiply. - * - * @return {this} This Matrix4. - */ - multiplyMatrices: function (a, b) - { - var am = a.val; - var bm = b.val; - - var a11 = am[0]; - var a12 = am[4]; - var a13 = am[8]; - var a14 = am[12]; - var a21 = am[1]; - var a22 = am[5]; - var a23 = am[9]; - var a24 = am[13]; - var a31 = am[2]; - var a32 = am[6]; - var a33 = am[10]; - var a34 = am[14]; - var a41 = am[3]; - var a42 = am[7]; - var a43 = am[11]; - var a44 = am[15]; - - var b11 = bm[0]; - var b12 = bm[4]; - var b13 = bm[8]; - var b14 = bm[12]; - var b21 = bm[1]; - var b22 = bm[5]; - var b23 = bm[9]; - var b24 = bm[13]; - var b31 = bm[2]; - var b32 = bm[6]; - var b33 = bm[10]; - var b34 = bm[14]; - var b41 = bm[3]; - var b42 = bm[7]; - var b43 = bm[11]; - var b44 = bm[15]; - - return this.setValues( - a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41, - a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41, - a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41, - a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41, - a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42, - a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42, - a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42, - a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42, - a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43, - a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43, - a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43, - a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43, - a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44, - a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44, - a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44, - a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44 - ); - }, - - /** - * Translate this Matrix using the given Vector. - * - * @method Phaser.Math.Matrix4#translate - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. - * - * @return {this} This Matrix4. - */ - translate: function (v) - { - return this.translateXYZ(v.x, v.y, v.z); - }, - - /** - * Translate this Matrix using the given values. - * - * @method Phaser.Math.Matrix4#translateXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {this} This Matrix4. - */ - translateXYZ: function (x, y, z) - { - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. - * - * @method Phaser.Math.Matrix4#scale - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. - * - * @return {this} This Matrix4. - */ - scale: function (v) - { - return this.scaleXYZ(v.x, v.y, v.z); - }, - - /** - * Apply a scale transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#scaleXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {this} This Matrix4. - */ - scaleXYZ: function (x, y, z) - { - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; - }, - - /** - * Derive a rotation matrix around the given axis. - * - * @method Phaser.Math.Matrix4#makeRotationAxis - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. - * @param {number} angle - The rotation angle in radians. - * - * @return {this} This Matrix4. - */ - makeRotationAxis: function (axis, angle) - { - // Based on http://www.gamedev.net/reference/articles/article1199.asp - - var c = Math.cos(angle); - var s = Math.sin(angle); - var t = 1 - c; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var tx = t * x; - var ty = t * y; - - return this.setValues( - tx * x + c, tx * y - s * z, tx * z + s * y, 0, - tx * y + s * z, ty * y + c, ty * z - s * x, 0, - tx * z - s * y, ty * z + s * x, t * z * z + c, 0, - 0, 0, 0, 1 - ); - }, - - /** - * Apply a rotation transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#rotate - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. - * - * @return {this} This Matrix4. - */ - rotate: function (rad, axis) - { - var a = this.val; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var len = Math.sqrt(x * x + y * y + z * z); - - if (Math.abs(len) < EPSILON) - { - return this; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - - var s = Math.sin(rad); - var c = Math.cos(rad); - var t = 1 - c; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - // Construct the elements of the rotation matrix - var b00 = x * x * t + c; - var b01 = y * x * t + z * s; - var b02 = z * x * t - y * s; - - var b10 = x * y * t - z * s; - var b11 = y * y * t + c; - var b12 = z * y * t + x * s; - - var b20 = x * z * t + y * s; - var b21 = y * z * t - x * s; - var b22 = z * z * t + c; - - // Perform rotation-specific matrix multiplication - return this.setValues( - a00 * b00 + a10 * b01 + a20 * b02, - a01 * b00 + a11 * b01 + a21 * b02, - a02 * b00 + a12 * b01 + a22 * b02, - a03 * b00 + a13 * b01 + a23 * b02, - a00 * b10 + a10 * b11 + a20 * b12, - a01 * b10 + a11 * b11 + a21 * b12, - a02 * b10 + a12 * b11 + a22 * b12, - a03 * b10 + a13 * b11 + a23 * b12, - a00 * b20 + a10 * b21 + a20 * b22, - a01 * b20 + a11 * b21 + a21 * b22, - a02 * b20 + a12 * b21 + a22 * b22, - a03 * b20 + a13 * b21 + a23 * b22, - a30, a31, a32, a33 - ); - }, - - /** - * Rotate this matrix on its X axis. - * - * @method Phaser.Math.Matrix4#rotateX - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * - * @return {this} This Matrix4. - */ - rotateX: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[4] = a10 * c + a20 * s; - a[5] = a11 * c + a21 * s; - a[6] = a12 * c + a22 * s; - a[7] = a13 * c + a23 * s; - a[8] = a20 * c - a10 * s; - a[9] = a21 * c - a11 * s; - a[10] = a22 * c - a12 * s; - a[11] = a23 * c - a13 * s; - - return this; - }, - - /** - * Rotate this matrix on its Y axis. - * - * @method Phaser.Math.Matrix4#rotateY - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {this} This Matrix4. - */ - rotateY: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c - a20 * s; - a[1] = a01 * c - a21 * s; - a[2] = a02 * c - a22 * s; - a[3] = a03 * c - a23 * s; - a[8] = a00 * s + a20 * c; - a[9] = a01 * s + a21 * c; - a[10] = a02 * s + a22 * c; - a[11] = a03 * s + a23 * c; - - return this; - }, - - /** - * Rotate this matrix on its Z axis. - * - * @method Phaser.Math.Matrix4#rotateZ - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {this} This Matrix4. - */ - rotateZ: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c + a10 * s; - a[1] = a01 * c + a11 * s; - a[2] = a02 * c + a12 * s; - a[3] = a03 * c + a13 * s; - a[4] = a10 * c - a00 * s; - a[5] = a11 * c - a01 * s; - a[6] = a12 * c - a02 * s; - a[7] = a13 * c - a03 * s; - - return this; - }, - - /** - * Set the values of this Matrix from the given rotation Quaternion and translation Vector. - * - * @method Phaser.Math.Matrix4#fromRotationTranslation - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. - * @param {Phaser.Math.Vector3} v - The Vector to set translation from. - * - * @return {this} This Matrix4. - */ - fromRotationTranslation: function (q, v) - { - // Quaternion math - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - return this.setValues( - 1 - (yy + zz), - xy + wz, - xz - wy, - 0, - - xy - wz, - 1 - (xx + zz), - yz + wx, - 0, - - xz + wy, - yz - wx, - 1 - (xx + yy), - 0, - - v.x, - v.y, - v.z, - 1 - ); - }, - - /** - * Set the values of this Matrix from the given Quaternion. - * - * @method Phaser.Math.Matrix4#fromQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. - * - * @return {this} This Matrix4. - */ - fromQuat: function (q) - { - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - return this.setValues( - 1 - (yy + zz), - xy + wz, - xz - wy, - 0, - - xy - wz, - 1 - (xx + zz), - yz + wx, - 0, - - xz + wy, - yz - wx, - 1 - (xx + yy), - 0, - - 0, - 0, - 0, - 1 - ); - }, - - /** - * Generate a frustum matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#frustum - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {this} This Matrix4. - */ - frustum: function (left, right, bottom, top, near, far) - { - var rl = 1 / (right - left); - var tb = 1 / (top - bottom); - var nf = 1 / (near - far); - - return this.setValues( - (near * 2) * rl, - 0, - 0, - 0, - - 0, - (near * 2) * tb, - 0, - 0, - - (right + left) * rl, - (top + bottom) * tb, - (far + near) * nf, - -1, - - 0, - 0, - (far * near * 2) * nf, - 0 - ); - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspective - * @since 3.0.0 - * - * @param {number} fovy - Vertical field of view in radians - * @param {number} aspect - Aspect ratio. Typically viewport width /height. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {this} This Matrix4. - */ - perspective: function (fovy, aspect, near, far) - { - var f = 1.0 / Math.tan(fovy / 2); - var nf = 1 / (near - far); - - return this.setValues( - f / aspect, - 0, - 0, - 0, - - 0, - f, - 0, - 0, - - 0, - 0, - (far + near) * nf, - -1, - - 0, - 0, - (2 * far * near) * nf, - 0 - ); - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspectiveLH - * @since 3.0.0 - * - * @param {number} width - The width of the frustum. - * @param {number} height - The height of the frustum. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {this} This Matrix4. - */ - perspectiveLH: function (width, height, near, far) - { - return this.setValues( - (2 * near) / width, - 0, - 0, - 0, - - 0, - (2 * near) / height, - 0, - 0, - - 0, - 0, - -far / (near - far), - 1, - - 0, - 0, - (near * far) / (near - far), - 0 - ); - }, - - /** - * Generate an orthogonal projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#ortho - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {this} This Matrix4. - */ - ortho: function (left, right, bottom, top, near, far) - { - var lr = left - right; - var bt = bottom - top; - var nf = near - far; - - // Avoid division by zero - lr = (lr === 0) ? lr : 1 / lr; - bt = (bt === 0) ? bt : 1 / bt; - nf = (nf === 0) ? nf : 1 / nf; - - return this.setValues( - -2 * lr, - 0, - 0, - 0, - - 0, - -2 * bt, - 0, - 0, - - 0, - 0, - 2 * nf, - 0, - - (left + right) * lr, - (top + bottom) * bt, - (far + near) * nf, - 1 - ); - }, - - /** - * Generate a right-handed look-at matrix with the given eye position, target and up axis. - * - * @method Phaser.Math.Matrix4#lookAtRH - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} eye - Position of the viewer. - * @param {Phaser.Math.Vector3} target - Point the viewer is looking at. - * @param {Phaser.Math.Vector3} up - vec3 pointing up. - * - * @return {this} This Matrix4. - */ - lookAtRH: function (eye, target, up) - { - var m = this.val; - - _z.subVectors(eye, target); - - if (_z.getLengthSquared() === 0) - { - // eye and target are in the same position - _z.z = 1; - } - - _z.normalize(); - _x.crossVectors(up, _z); - - if (_x.getLengthSquared() === 0) - { - // up and z are parallel - - if (Math.abs(up.z) === 1) - { - _z.x += 0.0001; - } - else - { - _z.z += 0.0001; - } - - _z.normalize(); - _x.crossVectors(up, _z); - } - - _x.normalize(); - _y.crossVectors(_z, _x); - - m[0] = _x.x; - m[1] = _x.y; - m[2] = _x.z; - m[4] = _y.x; - m[5] = _y.y; - m[6] = _y.z; - m[8] = _z.x; - m[9] = _z.y; - m[10] = _z.z; - - return this; - }, - - /** - * Generate a look-at matrix with the given eye position, focal point, and up axis. - * - * @method Phaser.Math.Matrix4#lookAt - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} eye - Position of the viewer - * @param {Phaser.Math.Vector3} center - Point the viewer is looking at - * @param {Phaser.Math.Vector3} up - vec3 pointing up. - * - * @return {this} This Matrix4. - */ - lookAt: function (eye, center, up) - { - var eyex = eye.x; - var eyey = eye.y; - var eyez = eye.z; - - var upx = up.x; - var upy = up.y; - var upz = up.z; - - var centerx = center.x; - var centery = center.y; - var centerz = center.z; - - if (Math.abs(eyex - centerx) < EPSILON && - Math.abs(eyey - centery) < EPSILON && - Math.abs(eyez - centerz) < EPSILON) - { - return this.identity(); - } - - var z0 = eyex - centerx; - var z1 = eyey - centery; - var z2 = eyez - centerz; - - var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); - - z0 *= len; - z1 *= len; - z2 *= len; - - var x0 = upy * z2 - upz * z1; - var x1 = upz * z0 - upx * z2; - var x2 = upx * z1 - upy * z0; - - len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); - - if (!len) - { - x0 = 0; - x1 = 0; - x2 = 0; - } - else - { - len = 1 / len; - x0 *= len; - x1 *= len; - x2 *= len; - } - - var y0 = z1 * x2 - z2 * x1; - var y1 = z2 * x0 - z0 * x2; - var y2 = z0 * x1 - z1 * x0; - - len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); - - if (!len) - { - y0 = 0; - y1 = 0; - y2 = 0; - } - else - { - len = 1 / len; - y0 *= len; - y1 *= len; - y2 *= len; - } - - return this.setValues( - x0, - y0, - z0, - 0, - - x1, - y1, - z1, - 0, - - x2, - y2, - z2, - 0, - - -(x0 * eyex + x1 * eyey + x2 * eyez), - -(y0 * eyex + y1 * eyey + y2 * eyez), - -(z0 * eyex + z1 * eyey + z2 * eyez), - 1 - ); - }, - - /** - * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. - * - * @method Phaser.Math.Matrix4#yawPitchRoll - * @since 3.0.0 - * - * @param {number} yaw - The yaw value. - * @param {number} pitch - The pitch value. - * @param {number} roll - The roll value. - * - * @return {this} This Matrix4. - */ - yawPitchRoll: function (yaw, pitch, roll) - { - this.zero(); - _tempMat1.zero(); - _tempMat2.zero(); - - var m0 = this.val; - var m1 = _tempMat1.val; - var m2 = _tempMat2.val; - - // Rotate Z - var s = Math.sin(roll); - var c = Math.cos(roll); - - m0[10] = 1; - m0[15] = 1; - m0[0] = c; - m0[1] = s; - m0[4] = -s; - m0[5] = c; - - // Rotate X - s = Math.sin(pitch); - c = Math.cos(pitch); - - m1[0] = 1; - m1[15] = 1; - m1[5] = c; - m1[10] = c; - m1[9] = -s; - m1[6] = s; - - // Rotate Y - s = Math.sin(yaw); - c = Math.cos(yaw); - - m2[5] = 1; - m2[15] = 1; - m2[0] = c; - m2[2] = -s; - m2[8] = s; - m2[10] = c; - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - return this; - }, - - /** - * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. - * - * @method Phaser.Math.Matrix4#setWorldMatrix - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. - * @param {Phaser.Math.Vector3} position - The position of the world matrix. - * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. - * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. - * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. - * - * @return {this} This Matrix4. - */ - setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) - { - this.yawPitchRoll(rotation.y, rotation.x, rotation.z); - - _tempMat1.scaling(scale.x, scale.y, scale.z); - _tempMat2.xyz(position.x, position.y, position.z); - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - if (viewMatrix) - { - this.multiplyLocal(viewMatrix); - } - - if (projectionMatrix) - { - this.multiplyLocal(projectionMatrix); - } - - return this; - }, - - /** - * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. - * - * @method Phaser.Math.Matrix4#multiplyToMat4 - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix4 to multiply with this one. - * @param {Phaser.Math.Matrix4} out - The receiving Matrix. - * - * @return {Phaser.Math.Matrix4} This `out` Matrix4. - */ - multiplyToMat4: function (src, out) - { - var a = this.val; - var b = src.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = b[0]; - var b01 = b[1]; - var b02 = b[2]; - var b03 = b[3]; - var b10 = b[4]; - var b11 = b[5]; - var b12 = b[6]; - var b13 = b[7]; - var b20 = b[8]; - var b21 = b[9]; - var b22 = b[10]; - var b23 = b[11]; - var b30 = b[12]; - var b31 = b[13]; - var b32 = b[14]; - var b33 = b[15]; - - return out.setValues( - b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, - b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31, - b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32, - b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33, - - b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, - b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, - b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, - b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, - - b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, - b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, - b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, - b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, - - b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, - b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, - b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, - b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 - ); - }, - - /** - * Takes the rotation and position vectors and builds this Matrix4 from them. - * - * @method Phaser.Math.Matrix4#fromRotationXYTranslation - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} rotation - The rotation vector. - * @param {Phaser.Math.Vector3} position - The position vector. - * @param {boolean} translateFirst - Should the operation translate then rotate (`true`), or rotate then translate? (`false`) - * - * @return {this} This Matrix4. - */ - fromRotationXYTranslation: function (rotation, position, translateFirst) - { - var x = position.x; - var y = position.y; - var z = position.z; - - var sx = Math.sin(rotation.x); - var cx = Math.cos(rotation.x); - - var sy = Math.sin(rotation.y); - var cy = Math.cos(rotation.y); - - var a30 = x; - var a31 = y; - var a32 = z; - - // Rotate X - - var b21 = -sx; - - // Rotate Y - - var c01 = 0 - b21 * sy; - - var c02 = 0 - cx * sy; - - var c21 = b21 * cy; - - var c22 = cx * cy; - - // Translate - if (!translateFirst) - { - // a30 = cy * x + 0 * y + sy * z; - a30 = cy * x + sy * z; - a31 = c01 * x + cx * y + c21 * z; - a32 = c02 * x + sx * y + c22 * z; - } - - return this.setValues( - cy, - c01, - c02, - 0, - 0, - cx, - sx, - 0, - sy, - c21, - c22, - 0, - a30, - a31, - a32, - 1 - ); - }, - - /** - * Returns the maximum axis scale from this Matrix4. - * - * @method Phaser.Math.Matrix4#getMaxScaleOnAxis - * @since 3.50.0 - * - * @return {number} The maximum axis scale. - */ - getMaxScaleOnAxis: function () - { - var m = this.val; - - var scaleXSq = m[0] * m[0] + m[1] * m[1] + m[2] * m[2]; - var scaleYSq = m[4] * m[4] + m[5] * m[5] + m[6] * m[6]; - var scaleZSq = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; - - return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); - } - -}); - -/** - * @ignore - */ -var _tempMat1 = new Matrix4(); - -/** - * @ignore - */ -var _tempMat2 = new Matrix4(); - -/** - * @ignore - */ -var _x = new Vector3(); - -/** - * @ignore - */ -var _y = new Vector3(); - -/** - * @ignore - */ -var _z = new Vector3(); - -module.exports = Matrix4; - - -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(3); - -/** - * Convert the given angle in radians, to the equivalent angle in degrees. - * - * @function Phaser.Math.RadToDeg - * @since 3.0.0 - * - * @param {number} radians - The angle in radians to convert ot degrees. - * - * @return {number} The given angle converted to degrees. - */ -var RadToDeg = function (radians) -{ - return radians * CONST.RAD_TO_DEG; -}; - -module.exports = RadToDeg; - - -/***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Scenes.Events - */ - -module.exports = { - - ADDED_TO_SCENE: __webpack_require__(187), - BOOT: __webpack_require__(188), - CREATE: __webpack_require__(189), - DESTROY: __webpack_require__(190), - PAUSE: __webpack_require__(191), - POST_UPDATE: __webpack_require__(192), - PRE_RENDER: __webpack_require__(193), - PRE_UPDATE: __webpack_require__(194), - READY: __webpack_require__(195), - REMOVED_FROM_SCENE: __webpack_require__(196), - RENDER: __webpack_require__(197), - RESUME: __webpack_require__(198), - SHUTDOWN: __webpack_require__(199), - SLEEP: __webpack_require__(200), - START: __webpack_require__(201), - TRANSITION_COMPLETE: __webpack_require__(202), - TRANSITION_INIT: __webpack_require__(203), - TRANSITION_OUT: __webpack_require__(204), - TRANSITION_START: __webpack_require__(205), - TRANSITION_WAKE: __webpack_require__(206), - UPDATE: __webpack_require__(207), - WAKE: __webpack_require__(208) - -}; - - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(9); -var Events = __webpack_require__(47); -var GetFastValue = __webpack_require__(8); -var GetURL = __webpack_require__(48); -var MergeXHRSettings = __webpack_require__(49); -var XHRLoader = __webpack_require__(221); -var XHRSettings = __webpack_require__(50); - -/** - * @classdesc - * The base File class used by all File Types that the Loader can support. - * You shouldn't create an instance of a File directly, but should extend it with your own class, setting a custom type and processing methods. - * - * @class File - * @memberof Phaser.Loader - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. - * @param {Phaser.Types.Loader.FileConfig} fileConfig - The file configuration object, as created by the file type. - */ -var File = new Class({ - - initialize: - - function File (loader, fileConfig) - { - /** - * A reference to the Loader that is going to load this file. - * - * @name Phaser.Loader.File#loader - * @type {Phaser.Loader.LoaderPlugin} - * @since 3.0.0 - */ - this.loader = loader; - - /** - * A reference to the Cache, or Texture Manager, that is going to store this file if it loads. - * - * @name Phaser.Loader.File#cache - * @type {(Phaser.Cache.BaseCache|Phaser.Textures.TextureManager)} - * @since 3.7.0 - */ - this.cache = GetFastValue(fileConfig, 'cache', false); - - /** - * The file type string (image, json, etc) for sorting within the Loader. - * - * @name Phaser.Loader.File#type - * @type {string} - * @since 3.0.0 - */ - this.type = GetFastValue(fileConfig, 'type', false); - - if (!this.type) - { - throw new Error('Invalid File type: ' + this.type); - } - - /** - * Unique cache key (unique within its file type) - * - * @name Phaser.Loader.File#key - * @type {string} - * @since 3.0.0 - */ - this.key = GetFastValue(fileConfig, 'key', false); - - var loadKey = this.key; - - if (loader.prefix && loader.prefix !== '') - { - this.key = loader.prefix + loadKey; - } - - if (!this.key) - { - throw new Error('Invalid File key: ' + this.key); - } - - var url = GetFastValue(fileConfig, 'url'); - - if (url === undefined) - { - url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); - } - else if (typeof url === 'string' && !url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)) - { - url = loader.path + url; - } - - /** - * The URL of the file, not including baseURL. - * - * Automatically has Loader.path prepended to it if a string. - * - * Can also be a JavaScript Object, such as the results of parsing JSON data. - * - * @name Phaser.Loader.File#url - * @type {object|string} - * @since 3.0.0 - */ - this.url = url; - - /** - * The final URL this file will load from, including baseURL and path. - * Set automatically when the Loader calls 'load' on this file. - * - * @name Phaser.Loader.File#src - * @type {string} - * @since 3.0.0 - */ - this.src = ''; - - /** - * The merged XHRSettings for this file. - * - * @name Phaser.Loader.File#xhrSettings - * @type {Phaser.Types.Loader.XHRSettingsObject} - * @since 3.0.0 - */ - this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined)); - - if (GetFastValue(fileConfig, 'xhrSettings', false)) - { - this.xhrSettings = MergeXHRSettings(this.xhrSettings, GetFastValue(fileConfig, 'xhrSettings', {})); - } - - /** - * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File. - * - * @name Phaser.Loader.File#xhrLoader - * @type {?XMLHttpRequest} - * @since 3.0.0 - */ - this.xhrLoader = null; - - /** - * The current state of the file. One of the FILE_CONST values. - * - * @name Phaser.Loader.File#state - * @type {number} - * @since 3.0.0 - */ - this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING; - - /** - * The total size of this file. - * Set by onProgress and only if loading via XHR. - * - * @name Phaser.Loader.File#bytesTotal - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.bytesTotal = 0; - - /** - * Updated as the file loads. - * Only set if loading via XHR. - * - * @name Phaser.Loader.File#bytesLoaded - * @type {number} - * @default -1 - * @since 3.0.0 - */ - this.bytesLoaded = -1; - - /** - * A percentage value between 0 and 1 indicating how much of this file has loaded. - * Only set if loading via XHR. - * - * @name Phaser.Loader.File#percentComplete - * @type {number} - * @default -1 - * @since 3.0.0 - */ - this.percentComplete = -1; - - /** - * For CORs based loading. - * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set) - * - * @name Phaser.Loader.File#crossOrigin - * @type {(string|undefined)} - * @since 3.0.0 - */ - this.crossOrigin = undefined; - - /** - * The processed file data, stored here after the file has loaded. - * - * @name Phaser.Loader.File#data - * @type {*} - * @since 3.0.0 - */ - this.data = undefined; - - /** - * A config object that can be used by file types to store transitional data. - * - * @name Phaser.Loader.File#config - * @type {*} - * @since 3.0.0 - */ - this.config = GetFastValue(fileConfig, 'config', {}); - - /** - * If this is a multipart file, i.e. an atlas and its json together, then this is a reference - * to the parent MultiFile. Set and used internally by the Loader or specific file types. - * - * @name Phaser.Loader.File#multiFile - * @type {?Phaser.Loader.MultiFile} - * @since 3.7.0 - */ - this.multiFile; - - /** - * Does this file have an associated linked file? Such as an image and a normal map. - * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't - * actually bound by data, where-as a linkFile is. - * - * @name Phaser.Loader.File#linkFile - * @type {?Phaser.Loader.File} - * @since 3.7.0 - */ - this.linkFile; - }, - - /** - * Links this File with another, so they depend upon each other for loading and processing. - * - * @method Phaser.Loader.File#setLink - * @since 3.7.0 - * - * @param {Phaser.Loader.File} fileB - The file to link to this one. - */ - setLink: function (fileB) - { - this.linkFile = fileB; - - fileB.linkFile = this; - }, - - /** - * Resets the XHRLoader instance this file is using. - * - * @method Phaser.Loader.File#resetXHR - * @since 3.0.0 - */ - resetXHR: function () - { - if (this.xhrLoader) - { - this.xhrLoader.onload = undefined; - this.xhrLoader.onerror = undefined; - this.xhrLoader.onprogress = undefined; - } - }, - - /** - * Called by the Loader, starts the actual file downloading. - * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. - * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. - * - * @method Phaser.Loader.File#load - * @since 3.0.0 - */ - load: function () - { - if (this.state === CONST.FILE_POPULATED) - { - // Can happen for example in a JSONFile if they've provided a JSON object instead of a URL - this.loader.nextFile(this, true); - } - else - { - this.state = CONST.FILE_LOADING; - - this.src = GetURL(this, this.loader.baseURL); - - if (this.src.indexOf('data:') === 0) - { - console.warn('Local data URIs are not supported: ' + this.key); - } - else - { - // The creation of this XHRLoader starts the load process going. - // It will automatically call the following, based on the load outcome: - // - // xhr.onload = this.onLoad - // xhr.onerror = this.onError - // xhr.onprogress = this.onProgress - - this.xhrLoader = XHRLoader(this, this.loader.xhr); - } - } - }, - - /** - * Called when the file finishes loading, is sent a DOM ProgressEvent. - * - * @method Phaser.Loader.File#onLoad - * @since 3.0.0 - * - * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event. - * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load. - */ - onLoad: function (xhr, event) - { - var isLocalFile = xhr.responseURL && this.loader.localSchemes.some(function (scheme) - { - return xhr.responseURL.indexOf(scheme) === 0; - }); - - var localFileOk = (isLocalFile && event.target.status === 0); - - var success = !(event.target && event.target.status !== 200) || localFileOk; - - // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called. - if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599) - { - success = false; - } - - this.state = CONST.FILE_LOADED; - - this.resetXHR(); - - this.loader.nextFile(this, success); - }, - - /** - * Called if the file errors while loading, is sent a DOM ProgressEvent. - * - * @method Phaser.Loader.File#onError - * @since 3.0.0 - * - * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event. - * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this error. - */ - onError: function () - { - this.resetXHR(); - - this.loader.nextFile(this, false); - }, - - /** - * Called during the file load progress. Is sent a DOM ProgressEvent. - * - * @method Phaser.Loader.File#onProgress - * @fires Phaser.Loader.Events#FILE_PROGRESS - * @since 3.0.0 - * - * @param {ProgressEvent} event - The DOM ProgressEvent. - */ - onProgress: function (event) - { - if (event.lengthComputable) - { - this.bytesLoaded = event.loaded; - this.bytesTotal = event.total; - - this.percentComplete = Math.min((this.bytesLoaded / this.bytesTotal), 1); - - this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete); - } - }, - - /** - * Usually overridden by the FileTypes and is called by Loader.nextFile. - * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage. - * - * @method Phaser.Loader.File#onProcess - * @since 3.0.0 - */ - onProcess: function () - { - this.state = CONST.FILE_PROCESSING; - - this.onProcessComplete(); - }, - - /** - * Called when the File has completed processing. - * Checks on the state of its multifile, if set. - * - * @method Phaser.Loader.File#onProcessComplete - * @since 3.7.0 - */ - onProcessComplete: function () - { - this.state = CONST.FILE_COMPLETE; - - if (this.multiFile) - { - this.multiFile.onFileComplete(this); - } - - this.loader.fileProcessComplete(this); - }, - - /** - * Called when the File has completed processing but it generated an error. - * Checks on the state of its multifile, if set. - * - * @method Phaser.Loader.File#onProcessError - * @since 3.7.0 - */ - onProcessError: function () - { - // eslint-disable-next-line no-console - console.error('Failed to process file: %s "%s"', this.type, this.key); - - this.state = CONST.FILE_ERRORED; - - if (this.multiFile) - { - this.multiFile.onFileFailed(this); - } - - this.loader.fileProcessComplete(this); - }, - - /** - * Checks if a key matching the one used by this file exists in the target Cache or not. - * This is called automatically by the LoaderPlugin to decide if the file can be safely - * loaded or will conflict. - * - * @method Phaser.Loader.File#hasCacheConflict - * @since 3.7.0 - * - * @return {boolean} `true` if adding this file will cause a conflict, otherwise `false`. - */ - hasCacheConflict: function () - { - return (this.cache && this.cache.exists(this.key)); - }, - - /** - * Adds this file to its target cache upon successful loading and processing. - * This method is often overridden by specific file types. - * - * @method Phaser.Loader.File#addToCache - * @since 3.7.0 - */ - addToCache: function () - { - if (this.cache && this.data) - { - this.cache.add(this.key, this.data); - } - }, - - /** - * Called once the file has been added to its cache and is now ready for deletion from the Loader. - * It will emit a `filecomplete` event from the LoaderPlugin. - * - * @method Phaser.Loader.File#pendingDestroy - * @fires Phaser.Loader.Events#FILE_COMPLETE - * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE - * @since 3.7.0 - */ - pendingDestroy: function (data) - { - if (this.state === CONST.FILE_PENDING_DESTROY) - { - return; - } - - if (data === undefined) { data = this.data; } - - var key = this.key; - var type = this.type; - - this.loader.emit(Events.FILE_COMPLETE, key, type, data); - this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data); - - this.loader.flagForRemoval(this); - - this.state = CONST.FILE_PENDING_DESTROY; - }, - - /** - * Destroy this File and any references it holds. - * - * @method Phaser.Loader.File#destroy - * @since 3.7.0 - */ - destroy: function () - { - this.loader = null; - this.cache = null; - this.xhrSettings = null; - this.multiFile = null; - this.linkFile = null; - this.data = null; - } - -}); - -/** - * Static method for creating object URL using URL API and setting it as image 'src' attribute. - * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader. - * - * @method Phaser.Loader.File.createObjectURL - * @static - * @since 3.7.0 - * - * @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL. - * @param {Blob} blob - A Blob object to create an object URL for. - * @param {string} defaultType - Default mime type used if blob type is not available. - */ -File.createObjectURL = function (image, blob, defaultType) -{ - if (typeof URL === 'function') - { - image.src = URL.createObjectURL(blob); - } - else - { - var reader = new FileReader(); - - reader.onload = function () - { - image.removeAttribute('crossOrigin'); - image.src = 'data:' + (blob.type || defaultType) + ';base64,' + reader.result.split(',')[1]; - }; - - reader.onerror = image.onerror; - - reader.readAsDataURL(blob); - } + return names; }; /** - * Static method for releasing an existing object URL which was previously created - * by calling {@link File#createObjectURL} method. + * Return the listeners registered for a given event. * - * @method Phaser.Loader.File.revokeObjectURL - * @static - * @since 3.7.0 - * - * @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked. + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public */ -File.revokeObjectURL = function (image) -{ - if (typeof URL === 'function') - { - URL.revokeObjectURL(image.src); - } +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + + return ee; }; -module.exports = File; - - -/***/ }), -/* 25 */ -/***/ (function(module, exports) { - /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; -var types = {}; - -/** - * @namespace Phaser.Loader.FileTypesManager - */ - -var FileTypesManager = { - - /** - * Static method called when a LoaderPlugin is created. - * - * Loops through the local types object and injects all of them as - * properties into the LoaderPlugin instance. - * - * @method Phaser.Loader.FileTypesManager.install - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into. - */ - install: function (loader) - { - for (var key in types) - { - loader[key] = types[key]; - } - }, - - /** - * Static method called directly by the File Types. - * - * The key is a reference to the function used to load the files via the Loader, i.e. `image`. - * - * @method Phaser.Loader.FileTypesManager.register - * @since 3.0.0 - * - * @param {string} key - The key that will be used as the method name in the LoaderPlugin. - * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked. - */ - register: function (key, factoryFunction) - { - types[key] = factoryFunction; - }, - - /** - * Removed all associated file types. - * - * @method Phaser.Loader.FileTypesManager.destroy - * @since 3.0.0 - */ - destroy: function () - { - types = {}; - } - + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; }; -module.exports = FileTypesManager; - - -/***/ }), -/* 26 */ -/***/ (function(module, exports) { - /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; -/** - * Checks if an array can be used as a matrix. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.CheckMatrix - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix] - * - * @param {T[][]} [matrix] - The array to check. - * - * @return {boolean} `true` if the given `matrix` array is a valid matrix. - */ -var CheckMatrix = function (matrix) -{ - if (!Array.isArray(matrix) || !Array.isArray(matrix[0])) - { - return false; + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; } - // How long is the first row? - var size = matrix[0].length; - - // Validate the rest of the rows are the same length - for (var i = 1; i < matrix.length; i++) - { - if (matrix[i].length !== size) - { - return false; - } + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; } - return true; + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; }; -module.exports = CheckMatrix; - - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process) {/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - /** - * Determines the operating system of the device running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.os` from within any Scene. + * Add a listener for a given event. * - * @typedef {object} Phaser.Device.OS - * @since 3.0.0 - * - * @property {boolean} android - Is running on android? - * @property {boolean} chromeOS - Is running on chromeOS? - * @property {boolean} cordova - Is the game running under Apache Cordova? - * @property {boolean} crosswalk - Is the game running under the Intel Crosswalk XDK? - * @property {boolean} desktop - Is running on a desktop? - * @property {boolean} ejecta - Is the game running under Ejecta? - * @property {boolean} electron - Is the game running under GitHub Electron? - * @property {boolean} iOS - Is running on iOS? - * @property {boolean} iPad - Is running on iPad? - * @property {boolean} iPhone - Is running on iPhone? - * @property {boolean} kindle - Is running on an Amazon Kindle? - * @property {boolean} linux - Is running on linux? - * @property {boolean} macOS - Is running on macOS? - * @property {boolean} node - Is the game running under Node.js? - * @property {boolean} nodeWebkit - Is the game running under Node-Webkit? - * @property {boolean} webApp - Set to true if running as a WebApp, i.e. within a WebView - * @property {boolean} windows - Is running on windows? - * @property {boolean} windowsPhone - Is running on a Windows Phone? - * @property {number} iOSVersion - If running in iOS this will contain the major version number. - * @property {number} pixelRatio - PixelRatio of the host device? + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public */ -var OS = { - - android: false, - chromeOS: false, - cordova: false, - crosswalk: false, - desktop: false, - ejecta: false, - electron: false, - iOS: false, - iOSVersion: 0, - iPad: false, - iPhone: false, - kindle: false, - linux: false, - macOS: false, - node: false, - nodeWebkit: false, - pixelRatio: 1, - webApp: false, - windows: false, - windowsPhone: false - +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); }; -function init () -{ - if (typeof importScripts === 'function') - { - return OS; +/** + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); +}; + +/** + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } } - var ua = navigator.userAgent; + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } - if ((/Windows/).test(ua)) - { - OS.windows = true; - } - else if ((/Mac OS/).test(ua) && !((/like Mac OS/).test(ua))) - { - // Because iOS 13 identifies as Mac OS: - if (navigator.maxTouchPoints && navigator.maxTouchPoints > 2) - { - OS.iOS = true; - OS.iPad = true; + return this; +}; - (navigator.appVersion).match(/Version\/(\d+)/); +/** + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; - OS.iOSVersion = parseInt(RegExp.$1, 10); - } - else - { - OS.macOS = true; - } - } - else if ((/Android/).test(ua)) - { - OS.android = true; - } - else if ((/Linux/).test(ua)) - { - OS.linux = true; - } - else if ((/iP[ao]d|iPhone/i).test(ua)) - { - OS.iOS = true; + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } - (navigator.appVersion).match(/OS (\d+)/); + return this; +}; - OS.iOSVersion = parseInt(RegExp.$1, 10); +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; - OS.iPhone = ua.toLowerCase().indexOf('iphone') !== -1; - OS.iPad = ua.toLowerCase().indexOf('ipad') !== -1; - } - else if ((/Kindle/).test(ua) || (/\bKF[A-Z][A-Z]+/).test(ua) || (/Silk.*Mobile Safari/).test(ua)) - { - OS.kindle = true; +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; - // This will NOT detect early generations of Kindle Fire, I think there is no reliable way... - // E.g. "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true" - } - else if ((/CrOS/).test(ua)) - { - OS.chromeOS = true; - } +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; - if ((/Windows Phone/i).test(ua) || (/IEMobile/i).test(ua)) - { - OS.android = false; - OS.iOS = false; - OS.macOS = false; - OS.windows = true; - OS.windowsPhone = true; - } - - var silk = (/Silk/).test(ua); - - if (OS.windows || OS.macOS || (OS.linux && !silk) || OS.chromeOS) - { - OS.desktop = true; - } - - // Windows Phone / Table reset - if (OS.windowsPhone || (((/Windows NT/i).test(ua)) && ((/Touch/i).test(ua)))) - { - OS.desktop = false; - } - - // WebApp mode in iOS - if (navigator.standalone) - { - OS.webApp = true; - } - - if (typeof importScripts !== 'function') - { - if (window.cordova !== undefined) - { - OS.cordova = true; - } - - if (window.ejecta !== undefined) - { - OS.ejecta = true; - } - } - - if (typeof process !== 'undefined' && process.versions && process.versions.node) - { - OS.node = true; - } - - if (OS.node && typeof process.versions === 'object') - { - OS.nodeWebkit = !!process.versions['node-webkit']; - - OS.electron = !!process.versions.electron; - } - - if ((/Crosswalk/).test(ua)) - { - OS.crosswalk = true; - } - - OS.pixelRatio = window['devicePixelRatio'] || 1; - - return OS; +// +// Expose the module. +// +if (true) { + module.exports = EventEmitter; } -module.exports = init(); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(298))) /***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Contains = __webpack_require__(316); -var GetPoint = __webpack_require__(66); -var GetPoints = __webpack_require__(317); -var GEOM_CONST = __webpack_require__(29); -var Line = __webpack_require__(318); -var Random = __webpack_require__(323); - -/** - * @classdesc - * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height) - * - * @class Rectangle - * @memberof Phaser.Geom - * @constructor - * @since 3.0.0 - * - * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. - * @param {number} [width=0] - The width of the Rectangle. - * @param {number} [height=0] - The height of the Rectangle. - */ -var Rectangle = new Class({ - - initialize: - - function Rectangle (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = 0; } - if (height === undefined) { height = 0; } - - /** - * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. - * Used for fast type comparisons. - * - * @name Phaser.Geom.Rectangle#type - * @type {number} - * @readonly - * @since 3.19.0 - */ - this.type = GEOM_CONST.RECTANGLE; - - /** - * The X coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = x; - - /** - * The Y coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = y; - - /** - * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. - * - * @name Phaser.Geom.Rectangle#width - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.width = width; - - /** - * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. - * - * @name Phaser.Geom.Rectangle#height - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.height = height; - }, - - /** - * Checks if the given point is inside the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#contains - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. - * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ - contains: function (x, y) - { - return Contains(this, x, y); - }, - - /** - * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * - * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * - * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. - * - * @method Phaser.Geom.Rectangle#getPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [output,$return] - * - * @param {number} position - The normalized distance into the Rectangle's perimeter to return. - * @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point. - * - * @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given. - */ - getPoint: function (position, output) - { - return GetPoint(this, position, output); - }, - - /** - * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. - * - * @method Phaser.Geom.Rectangle#getPoints - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point[]} O - [output,$return] - * - * @param {number} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. - * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. - * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points. - * - * @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided. - */ - getPoints: function (quantity, stepRate, output) - { - return GetPoints(this, quantity, stepRate, output); - }, - - /** - * Returns a random point within the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#getRandomPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [point,$return] - * - * @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point. - * - * @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided. - */ - getRandomPoint: function (point) - { - return Random(this, point); - }, - - /** - * Sets the position, width, and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setTo - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} y - The Y coordinate of the top left corner of the Rectangle. - * @param {number} width - The width of the Rectangle. - * @param {number} height - The height of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setTo: function (x, y, width, height) - { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - - return this; - }, - - /** - * Resets the position, width, and height of the Rectangle to 0. - * - * @method Phaser.Geom.Rectangle#setEmpty - * @since 3.0.0 - * - * @return {this} This Rectangle object. - */ - setEmpty: function () - { - return this.setTo(0, 0, 0, 0); - }, - - /** - * Sets the position of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setPosition - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setPosition: function (x, y) - { - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - }, - - /** - * Sets the width and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setSize - * @since 3.0.0 - * - * @param {number} width - The width to set the Rectangle to. - * @param {number} [height=width] - The height to set the Rectangle to. - * - * @return {this} This Rectangle object. - */ - setSize: function (width, height) - { - if (height === undefined) { height = width; } - - this.width = width; - this.height = height; - - return this; - }, - - /** - * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. - * - * @method Phaser.Geom.Rectangle#isEmpty - * @since 3.0.0 - * - * @return {boolean} `true` if the Rectangle is empty. A Rectangle object is empty if its width or height is less than or equal to 0. - */ - isEmpty: function () - { - return (this.width <= 0 || this.height <= 0); - }, - - /** - * Returns a Line object that corresponds to the top of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineA - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle. - */ - getLineA: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.y, this.right, this.y); - - return line; - }, - - /** - * Returns a Line object that corresponds to the right of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineB - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle. - */ - getLineB: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.y, this.right, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the bottom of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineC - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle. - */ - getLineC: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.bottom, this.x, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the left of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineD - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle. - */ - getLineD: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.bottom, this.x, this.y); - - return line; - }, - - /** - * The x coordinate of the left of the Rectangle. - * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. - * - * @name Phaser.Geom.Rectangle#left - * @type {number} - * @since 3.0.0 - */ - left: { - - get: function () - { - return this.x; - }, - - set: function (value) - { - if (value >= this.right) - { - this.width = 0; - } - else - { - this.width = this.right - value; - } - - this.x = value; - } - - }, - - /** - * The sum of the x and width properties. - * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. - * - * @name Phaser.Geom.Rectangle#right - * @type {number} - * @since 3.0.0 - */ - right: { - - get: function () - { - return this.x + this.width; - }, - - set: function (value) - { - if (value <= this.x) - { - this.width = 0; - } - else - { - this.width = value - this.x; - } - } - - }, - - /** - * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. - * However it does affect the height property, whereas changing the y value does not affect the height property. - * - * @name Phaser.Geom.Rectangle#top - * @type {number} - * @since 3.0.0 - */ - top: { - - get: function () - { - return this.y; - }, - - set: function (value) - { - if (value >= this.bottom) - { - this.height = 0; - } - else - { - this.height = (this.bottom - value); - } - - this.y = value; - } - - }, - - /** - * The sum of the y and height properties. - * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. - * - * @name Phaser.Geom.Rectangle#bottom - * @type {number} - * @since 3.0.0 - */ - bottom: { - - get: function () - { - return this.y + this.height; - }, - - set: function (value) - { - if (value <= this.y) - { - this.height = 0; - } - else - { - this.height = value - this.y; - } - } - - }, - - /** - * The x coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerX - * @type {number} - * @since 3.0.0 - */ - centerX: { - - get: function () - { - return this.x + (this.width / 2); - }, - - set: function (value) - { - this.x = value - (this.width / 2); - } - - }, - - /** - * The y coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerY - * @type {number} - * @since 3.0.0 - */ - centerY: { - - get: function () - { - return this.y + (this.height / 2); - }, - - set: function (value) - { - this.y = value - (this.height / 2); - } - - } - -}); - -module.exports = Rectangle; - - -/***/ }), -/* 29 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GEOM_CONST = { - - /** - * A Circle Geometry object type. - * - * @name Phaser.Geom.CIRCLE - * @type {number} - * @since 3.19.0 - */ - CIRCLE: 0, - - /** - * An Ellipse Geometry object type. - * - * @name Phaser.Geom.ELLIPSE - * @type {number} - * @since 3.19.0 - */ - ELLIPSE: 1, - - /** - * A Line Geometry object type. - * - * @name Phaser.Geom.LINE - * @type {number} - * @since 3.19.0 - */ - LINE: 2, - - /** - * A Point Geometry object type. - * - * @name Phaser.Geom.POINT - * @type {number} - * @since 3.19.0 - */ - POINT: 3, - - /** - * A Polygon Geometry object type. - * - * @name Phaser.Geom.POLYGON - * @type {number} - * @since 3.19.0 - */ - POLYGON: 4, - - /** - * A Rectangle Geometry object type. - * - * @name Phaser.Geom.RECTANGLE - * @type {number} - * @since 3.19.0 - */ - RECTANGLE: 5, - - /** - * A Triangle Geometry object type. - * - * @name Phaser.Geom.TRIANGLE - * @type {number} - * @since 3.19.0 - */ - TRIANGLE: 6 - -}; - -module.exports = GEOM_CONST; - - -/***/ }), -/* 30 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Find the angle of a segment from (x1, y1) -> (x2, y2). - * - * @function Phaser.Math.Angle.Between - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The angle in radians. - */ -var Between = function (x1, y1, x2, y2) -{ - return Math.atan2(y2 - y1, x2 - x1); -}; - -module.exports = Between; - - -/***/ }), -/* 31 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Normalize an angle to the [0, 2pi] range. - * - * @function Phaser.Math.Angle.Normalize - * @since 3.0.0 - * - * @param {number} angle - The angle to normalize, in radians. - * - * @return {number} The normalized angle, in radians. - */ -var Normalize = function (angle) -{ - angle = angle % (2 * Math.PI); - - if (angle >= 0) - { - return angle; - } - else - { - return angle + 2 * Math.PI; - } -}; - -module.exports = Normalize; - - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MathWrap = __webpack_require__(13); - -/** - * Wrap an angle. - * - * Wraps the angle to a value in the range of -PI to PI. - * - * @function Phaser.Math.Angle.Wrap - * @since 3.0.0 - * - * @param {number} angle - The angle to wrap, in radians. - * - * @return {number} The wrapped angle, in radians. - */ -var Wrap = function (angle) -{ - return MathWrap(angle, -Math.PI, Math.PI); -}; - -module.exports = Wrap; - - -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Wrap = __webpack_require__(13); - -/** - * Wrap an angle in degrees. - * - * Wraps the angle to a value in the range of -180 to 180. - * - * @function Phaser.Math.Angle.WrapDegrees - * @since 3.0.0 - * - * @param {number} angle - The angle to wrap, in degrees. - * - * @return {number} The wrapped angle, in degrees. - */ -var WrapDegrees = function (angle) -{ - return Wrap(angle, -180, 180); -}; - -module.exports = WrapDegrees; - - -/***/ }), -/* 34 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check whether the given values are fuzzily equal. - * - * Two numbers are fuzzily equal if their difference is less than `epsilon`. - * - * @function Phaser.Math.Fuzzy.Equal - * @since 3.0.0 - * - * @param {number} a - The first value. - * @param {number} b - The second value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`. - */ -var Equal = function (a, b, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return Math.abs(a - b) < epsilon; -}; - -module.exports = Equal; - - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Factorial = __webpack_require__(36); - -/** - * Calculates the Bernstein basis from the three factorial coefficients. - * - * @function Phaser.Math.Bernstein - * @since 3.0.0 - * - * @param {number} n - The first value. - * @param {number} i - The second value. - * - * @return {number} The Bernstein basis of Factorial(n) / Factorial(i) / Factorial(n - i) - */ -var Bernstein = function (n, i) -{ - return Factorial(n) / Factorial(i) / Factorial(n - i); -}; - -module.exports = Bernstein; - - -/***/ }), -/* 36 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates the factorial of a given number for integer values greater than 0. - * - * @function Phaser.Math.Factorial - * @since 3.0.0 - * - * @param {number} value - A positive integer to calculate the factorial of. - * - * @return {number} The factorial of the given number. - */ -var Factorial = function (value) -{ - if (value === 0) - { - return 1; - } - - var res = value; - - while (--value) - { - res *= value; - } - - return res; -}; - -module.exports = Factorial; - - -/***/ }), -/* 37 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates a Catmull-Rom value from the given points, based on an alpha of 0.5. - * - * @function Phaser.Math.CatmullRom - * @since 3.0.0 - * - * @param {number} t - The amount to interpolate by. - * @param {number} p0 - The first control point. - * @param {number} p1 - The second control point. - * @param {number} p2 - The third control point. - * @param {number} p3 - The fourth control point. - * - * @return {number} The Catmull-Rom value. - */ -var CatmullRom = function (t, p0, p1, p2, p3) -{ - var v0 = (p2 - p0) * 0.5; - var v1 = (p3 - p1) * 0.5; - var t2 = t * t; - var t3 = t * t2; - - return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1; -}; - -module.exports = CatmullRom; - - -/***/ }), -/* 38 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates a linear (interpolation) value over t. - * - * @function Phaser.Math.Linear - * @since 3.0.0 - * - * @param {number} p0 - The first point. - * @param {number} p1 - The second point. - * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1. - * - * @return {number} The step t% of the way between p0 and p1. - */ -var Linear = function (p0, p1, t) -{ - return (p1 - p0) * t + p0; -}; - -module.exports = Linear; - - -/***/ }), -/* 39 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate a smooth interpolation percentage of `x` between `min` and `max`. - * - * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, - * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, - * between 0 and 1 otherwise. - * - * @function Phaser.Math.SmoothStep - * @since 3.0.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep} - * - * @param {number} x - The input value. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The percentage of interpolation, between 0 and 1. - */ -var SmoothStep = function (x, min, max) -{ - if (x <= min) - { - return 0; - } - - if (x >= max) - { - return 1; - } - - x = (x - min) / (max - min); - - return x * x * (3 - 2 * x); -}; - -module.exports = SmoothStep; - - -/***/ }), -/* 40 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate a smoother interpolation percentage of `x` between `min` and `max`. - * - * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, - * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, - * between 0 and 1 otherwise. - * - * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}. - * - * @function Phaser.Math.SmootherStep - * @since 3.0.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} - * - * @param {number} x - The input value. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The percentage of interpolation, between 0 and 1. - */ -var SmootherStep = function (x, min, max) -{ - x = Math.max(0, Math.min(1, (x - min) / (max - min))); - - return x * x * x * (x * (x * 6 - 15) + 10); -}; - -module.exports = SmootherStep; - - -/***/ }), -/* 41 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotate a `point` around `x` and `y` to the given `angle`, at the same distance. - * - * In polar notation, this maps a point from (r, t) to (r, angle), vs. the origin (x, y). - * - * @function Phaser.Math.RotateAround - * @since 3.0.0 - * - * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] - * - * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. - * @param {number} x - The horizontal coordinate to rotate around. - * @param {number} y - The vertical coordinate to rotate around. - * @param {number} angle - The angle of rotation in radians. - * - * @return {Phaser.Types.Math.Vector2Like} The given point. - */ -var RotateAround = function (point, x, y, angle) -{ - var c = Math.cos(angle); - var s = Math.sin(angle); - - var tx = point.x - x; - var ty = point.y - y; - - point.x = tx * c - ty * s + x; - point.y = tx * s + ty * c + y; - - return point; -}; - -module.exports = RotateAround; - - -/***/ }), -/* 42 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down. - * - * @function Phaser.Math.RoundAwayFromZero - * @since 3.0.0 - * - * @param {number} value - The number to round. - * - * @return {number} The rounded number, rounded away from zero. - */ -var RoundAwayFromZero = function (value) -{ - // "Opposite" of truncate. - return (value > 0) ? Math.ceil(value) : Math.floor(value); -}; - -module.exports = RoundAwayFromZero; - - -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Vector2 = __webpack_require__(2); - -/** - * Takes the `x` and `y` coordinates and transforms them into the same space as - * defined by the position, rotation and scale values. - * - * @function Phaser.Math.TransformXY - * @since 3.0.0 - * - * @param {number} x - The x coordinate to be transformed. - * @param {number} y - The y coordinate to be transformed. - * @param {number} positionX - Horizontal position of the transform point. - * @param {number} positionY - Vertical position of the transform point. - * @param {number} rotation - Rotation of the transform point, in radians. - * @param {number} scaleX - Horizontal scale of the transform point. - * @param {number} scaleY - Vertical scale of the transform point. - * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates. - * - * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point. - */ -var TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output) -{ - if (output === undefined) { output = new Vector2(); } - - var radianSin = Math.sin(rotation); - var radianCos = Math.cos(rotation); - - // Rotate and Scale - var a = radianCos * scaleX; - var b = radianSin * scaleX; - var c = -radianSin * scaleY; - var d = radianCos * scaleY; - - // Invert - var id = 1 / ((a * d) + (c * -b)); - - output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id); - output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id); - - return output; -}; - -module.exports = TransformXY; - - -/***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A three-dimensional matrix. - * - * Defaults to the identity matrix when instantiated. - * - * @class Matrix3 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from. - */ -var Matrix3 = new Class({ - - initialize: - - function Matrix3 (m) - { - /** - * The matrix values. - * - * @name Phaser.Math.Matrix3#val - * @type {Float32Array} - * @since 3.0.0 - */ - this.val = new Float32Array(9); - - if (m) - { - // Assume Matrix3 with val: - this.copy(m); - } - else - { - // Default to identity - this.identity(); - } - }, - - /** - * Make a clone of this Matrix3. - * - * @method Phaser.Math.Matrix3#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} A clone of this Matrix3. - */ - clone: function () - { - return new Matrix3(this); - }, - - /** - * This method is an alias for `Matrix3.copy`. - * - * @method Phaser.Math.Matrix3#set - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - set: function (src) - { - return this.copy(src); - }, - - /** - * Copy the values of a given Matrix into this Matrix. - * - * @method Phaser.Math.Matrix3#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - copy: function (src) - { - var out = this.val; - var a = src.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - - return this; - }, - - /** - * Copy the values of a given Matrix4 into this Matrix3. - * - * @method Phaser.Math.Matrix3#fromMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - fromMat4: function (m) - { - var a = m.val; - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[4]; - out[4] = a[5]; - out[5] = a[6]; - out[6] = a[8]; - out[7] = a[9]; - out[8] = a[10]; - - return this; - }, - - /** - * Set the values of this Matrix from the given array. - * - * @method Phaser.Math.Matrix3#fromArray - * @since 3.0.0 - * - * @param {array} a - The array to copy the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - fromArray: function (a) - { - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - - return this; - }, - - /** - * Reset this Matrix to an identity (default) matrix. - * - * @method Phaser.Math.Matrix3#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - identity: function () - { - var out = this.val; - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 1; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - - return this; - }, - - /** - * Transpose this Matrix. - * - * @method Phaser.Math.Matrix3#transpose - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - transpose: function () - { - var a = this.val; - var a01 = a[1]; - var a02 = a[2]; - var a12 = a[5]; - - a[1] = a[3]; - a[2] = a[6]; - a[3] = a01; - a[5] = a[7]; - a[6] = a02; - a[7] = a12; - - return this; - }, - - /** - * Invert this Matrix. - * - * @method Phaser.Math.Matrix3#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - invert: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - var b01 = a22 * a11 - a12 * a21; - var b11 = -a22 * a10 + a12 * a20; - var b21 = a21 * a10 - a11 * a20; - - // Calculate the determinant - var det = a00 * b01 + a01 * b11 + a02 * b21; - - if (!det) - { - return null; - } - - det = 1 / det; - - a[0] = b01 * det; - a[1] = (-a22 * a01 + a02 * a21) * det; - a[2] = (a12 * a01 - a02 * a11) * det; - a[3] = b11 * det; - a[4] = (a22 * a00 - a02 * a20) * det; - a[5] = (-a12 * a00 + a02 * a10) * det; - a[6] = b21 * det; - a[7] = (-a21 * a00 + a01 * a20) * det; - a[8] = (a11 * a00 - a01 * a10) * det; - - return this; - }, - - /** - * Calculate the adjoint, or adjugate, of this Matrix. - * - * @method Phaser.Math.Matrix3#adjoint - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - adjoint: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - a[0] = (a11 * a22 - a12 * a21); - a[1] = (a02 * a21 - a01 * a22); - a[2] = (a01 * a12 - a02 * a11); - a[3] = (a12 * a20 - a10 * a22); - a[4] = (a00 * a22 - a02 * a20); - a[5] = (a02 * a10 - a00 * a12); - a[6] = (a10 * a21 - a11 * a20); - a[7] = (a01 * a20 - a00 * a21); - a[8] = (a00 * a11 - a01 * a10); - - return this; - }, - - /** - * Calculate the determinant of this Matrix. - * - * @method Phaser.Math.Matrix3#determinant - * @since 3.0.0 - * - * @return {number} The determinant of this Matrix. - */ - determinant: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * @method Phaser.Math.Matrix3#multiply - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - multiply: function (src) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - var b = src.val; - - var b00 = b[0]; - var b01 = b[1]; - var b02 = b[2]; - var b10 = b[3]; - var b11 = b[4]; - var b12 = b[5]; - var b20 = b[6]; - var b21 = b[7]; - var b22 = b[8]; - - a[0] = b00 * a00 + b01 * a10 + b02 * a20; - a[1] = b00 * a01 + b01 * a11 + b02 * a21; - a[2] = b00 * a02 + b01 * a12 + b02 * a22; - - a[3] = b10 * a00 + b11 * a10 + b12 * a20; - a[4] = b10 * a01 + b11 * a11 + b12 * a21; - a[5] = b10 * a02 + b11 * a12 + b12 * a22; - - a[6] = b20 * a00 + b21 * a10 + b22 * a20; - a[7] = b20 * a01 + b21 * a11 + b22 * a21; - a[8] = b20 * a02 + b21 * a12 + b22 * a22; - - return this; - }, - - /** - * Translate this Matrix using the given Vector. - * - * @method Phaser.Math.Matrix3#translate - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - translate: function (v) - { - var a = this.val; - var x = v.x; - var y = v.y; - - a[6] = x * a[0] + y * a[3] + a[6]; - a[7] = x * a[1] + y * a[4] + a[7]; - a[8] = x * a[2] + y * a[5] + a[8]; - - return this; - }, - - /** - * Apply a rotation transformation to this Matrix. - * - * @method Phaser.Math.Matrix3#rotate - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - rotate: function (rad) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - - var s = Math.sin(rad); - var c = Math.cos(rad); - - a[0] = c * a00 + s * a10; - a[1] = c * a01 + s * a11; - a[2] = c * a02 + s * a12; - - a[3] = c * a10 - s * a00; - a[4] = c * a11 - s * a01; - a[5] = c * a12 - s * a02; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * Uses the `x` and `y` components of the given Vector to scale the Matrix. - * - * @method Phaser.Math.Matrix3#scale - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - scale: function (v) - { - var a = this.val; - var x = v.x; - var y = v.y; - - a[0] = x * a[0]; - a[1] = x * a[1]; - a[2] = x * a[2]; - - a[3] = y * a[3]; - a[4] = y * a[4]; - a[5] = y * a[5]; - - return this; - }, - - /** - * Set the values of this Matrix from the given Quaternion. - * - * @method Phaser.Math.Matrix3#fromQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - fromQuat: function (q) - { - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - var out = this.val; - - out[0] = 1 - (yy + zz); - out[3] = xy + wz; - out[6] = xz - wy; - - out[1] = xy - wz; - out[4] = 1 - (xx + zz); - out[7] = yz + wx; - - out[2] = xz + wy; - out[5] = yz - wx; - out[8] = 1 - (xx + yy); - - return this; - }, - - /** - * Set the values of this Matrix3 to be normalized from the given Matrix4. - * - * @method Phaser.Math.Matrix3#normalFromMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to normalize the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - normalFromMat4: function (m) - { - var a = m.val; - var out = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) - { - return null; - } - - det = 1 / det; - - out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - - out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - - out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - - return this; - } - -}); - -module.exports = Matrix3; - - -/***/ }), -/* 45 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); -var Matrix3 = __webpack_require__(44); -var NOOP = __webpack_require__(1); -var Vector3 = __webpack_require__(14); - -var EPSILON = 0.000001; - -// Some shared 'private' arrays -var siNext = new Int8Array([ 1, 2, 0 ]); -var tmp = new Float32Array([ 0, 0, 0 ]); - -var xUnitVec3 = new Vector3(1, 0, 0); -var yUnitVec3 = new Vector3(0, 1, 0); - -var tmpvec = new Vector3(); -var tmpMat3 = new Matrix3(); - -/** - * @classdesc - * A quaternion. - * - * @class Quaternion - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number} [x=0] - The x component. - * @param {number} [y=0] - The y component. - * @param {number} [z=0] - The z component. - * @param {number} [w=1] - The w component. - */ -var Quaternion = new Class({ - - initialize: - - function Quaternion (x, y, z, w) - { - /** - * The x component of this Quaternion. - * - * @name Phaser.Math.Quaternion#_x - * @type {number} - * @default 0 - * @private - * @since 3.50.0 - */ - - /** - * The y component of this Quaternion. - * - * @name Phaser.Math.Quaternion#_y - * @type {number} - * @default 0 - * @private - * @since 3.50.0 - */ - - /** - * The z component of this Quaternion. - * - * @name Phaser.Math.Quaternion#_z - * @type {number} - * @default 0 - * @private - * @since 3.50.0 - */ - - /** - * The w component of this Quaternion. - * - * @name Phaser.Math.Quaternion#_w - * @type {number} - * @default 0 - * @private - * @since 3.50.0 - */ - - /** - * This callback is invoked, if set, each time a value in this quaternion is changed. - * The callback is passed one argument, a reference to this quaternion. - * - * @name Phaser.Math.Quaternion#onChangeCallback - * @type {function} - * @since 3.50.0 - */ - this.onChangeCallback = NOOP; - - this.set(x, y, z, w); - }, - - /** - * The x component of this Quaternion. - * - * @name Phaser.Math.Quaternion#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - x: { - get: function () - { - return this._x; - }, - - set: function (value) - { - this._x = value; - - this.onChangeCallback(this); - } - }, - - /** - * The y component of this Quaternion. - * - * @name Phaser.Math.Quaternion#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - y: { - get: function () - { - return this._y; - }, - - set: function (value) - { - this._y = value; - - this.onChangeCallback(this); - } - }, - - /** - * The z component of this Quaternion. - * - * @name Phaser.Math.Quaternion#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - z: { - get: function () - { - return this._z; - }, - - set: function (value) - { - this._z = value; - - this.onChangeCallback(this); - } - }, - - /** - * The w component of this Quaternion. - * - * @name Phaser.Math.Quaternion#w - * @type {number} - * @default 0 - * @since 3.0.0 - */ - w: { - get: function () - { - return this._w; - }, - - set: function (value) - { - this._w = value; - - this.onChangeCallback(this); - } - }, - - /** - * Copy the components of a given Quaternion or Vector into this Quaternion. - * - * @method Phaser.Math.Quaternion#copy - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - copy: function (src) - { - return this.set(src); - }, - - /** - * Set the components of this Quaternion and optionally call the `onChangeCallback`. - * - * @method Phaser.Math.Quaternion#set - * @since 3.0.0 - * - * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components. - * @param {number} [y=0] - The y component. - * @param {number} [z=0] - The z component. - * @param {number} [w=0] - The w component. - * @param {boolean} [update=true] - Call the `onChangeCallback`? - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - set: function (x, y, z, w, update) - { - if (update === undefined) { update = true; } - - if (typeof x === 'object') - { - this._x = x.x || 0; - this._y = x.y || 0; - this._z = x.z || 0; - this._w = x.w || 0; - } - else - { - this._x = x || 0; - this._y = y || 0; - this._z = z || 0; - this._w = w || 0; - } - - if (update) - { - this.onChangeCallback(this); - } - - return this; - }, - - /** - * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise. - * - * @method Phaser.Math.Quaternion#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - add: function (v) - { - this._x += v.x; - this._y += v.y; - this._z += v.z; - this._w += v.w; - - this.onChangeCallback(this); - - return this; - }, - - /** - * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise. - * - * @method Phaser.Math.Quaternion#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - subtract: function (v) - { - this._x -= v.x; - this._y -= v.y; - this._z -= v.z; - this._w -= v.w; - - this.onChangeCallback(this); - - return this; - }, - - /** - * Scale this Quaternion by the given value. - * - * @method Phaser.Math.Quaternion#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Quaternion by. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - scale: function (scale) - { - this._x *= scale; - this._y *= scale; - this._z *= scale; - this._w *= scale; - - this.onChangeCallback(this); - - return this; - }, - - /** - * Calculate the length of this Quaternion. - * - * @method Phaser.Math.Quaternion#length - * @since 3.0.0 - * - * @return {number} The length of this Quaternion. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return Math.sqrt(x * x + y * y + z * z + w * w); - }, - - /** - * Calculate the length of this Quaternion squared. - * - * @method Phaser.Math.Quaternion#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Quaternion, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return x * x + y * y + z * z + w * w; - }, - - /** - * Normalize this Quaternion. - * - * @method Phaser.Math.Quaternion#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - var len = x * x + y * y + z * z + w * w; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this._x = x * len; - this._y = y * len; - this._z = z * len; - this._w = w * len; - } - - this.onChangeCallback(this); - - return this; - }, - - /** - * Calculate the dot product of this Quaternion and the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#dot - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion. - * - * @return {number} The dot product of this Quaternion and the given Quaternion or Vector. - */ - dot: function (v) - { - return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; - }, - - /** - * Linearly interpolate this Quaternion towards the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#lerp - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards. - * @param {number} [t=0] - The percentage of interpolation. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - lerp: function (v, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - return this.set( - ax + t * (v.x - ax), - ay + t * (v.y - ay), - az + t * (v.z - az), - aw + t * (v.w - aw) - ); - }, - - /** - * Rotates this Quaternion based on the two given vectors. - * - * @method Phaser.Math.Quaternion#rotationTo - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} a - The transform rotation vector. - * @param {Phaser.Math.Vector3} b - The target rotation vector. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotationTo: function (a, b) - { - var dot = a.x * b.x + a.y * b.y + a.z * b.z; - - if (dot < -0.999999) - { - if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON) - { - tmpvec.copy(yUnitVec3).cross(a); - } - - tmpvec.normalize(); - - return this.setAxisAngle(tmpvec, Math.PI); - - } - else if (dot > 0.999999) - { - return this.set(0, 0, 0, 1); - } - else - { - tmpvec.copy(a).cross(b); - - this._x = tmpvec.x; - this._y = tmpvec.y; - this._z = tmpvec.z; - this._w = 1 + dot; - - return this.normalize(); - } - }, - - /** - * Set the axes of this Quaternion. - * - * @method Phaser.Math.Quaternion#setAxes - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} view - The view axis. - * @param {Phaser.Math.Vector3} right - The right axis. - * @param {Phaser.Math.Vector3} up - The upwards axis. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setAxes: function (view, right, up) - { - var m = tmpMat3.val; - - m[0] = right.x; - m[3] = right.y; - m[6] = right.z; - - m[1] = up.x; - m[4] = up.y; - m[7] = up.z; - - m[2] = -view.x; - m[5] = -view.y; - m[8] = -view.z; - - return this.fromMat3(tmpMat3).normalize(); - }, - - /** - * Reset this Matrix to an identity (default) Quaternion. - * - * @method Phaser.Math.Quaternion#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - identity: function () - { - return this.set(0, 0, 0, 1); - }, - - /** - * Set the axis angle of this Quaternion. - * - * @method Phaser.Math.Quaternion#setAxisAngle - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} axis - The axis. - * @param {number} rad - The angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setAxisAngle: function (axis, rad) - { - rad = rad * 0.5; - - var s = Math.sin(rad); - - return this.set( - s * axis.x, - s * axis.y, - s * axis.z, - Math.cos(rad) - ); - }, - - /** - * Multiply this Quaternion by the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - multiply: function (b) - { - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bx = b.x; - var by = b.y; - var bz = b.z; - var bw = b.w; - - return this.set( - ax * bw + aw * bx + ay * bz - az * by, - ay * bw + aw * by + az * bx - ax * bz, - az * bw + aw * bz + ax * by - ay * bx, - aw * bw - ax * bx - ay * by - az * bz - ); - }, - - /** - * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#slerp - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards. - * @param {number} t - The percentage of interpolation. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - slerp: function (b, t) - { - // benchmarks: http://jsperf.com/quaternion-slerp-implementations - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bx = b.x; - var by = b.y; - var bz = b.z; - var bw = b.w; - - // calc cosine - var cosom = ax * bx + ay * by + az * bz + aw * bw; - - // adjust signs (if necessary) - if (cosom < 0) - { - cosom = -cosom; - bx = - bx; - by = - by; - bz = - bz; - bw = - bw; - } - - // "from" and "to" quaternions are very close - // ... so we can do a linear interpolation - var scale0 = 1 - t; - var scale1 = t; - - // calculate coefficients - if ((1 - cosom) > EPSILON) - { - // standard case (slerp) - var omega = Math.acos(cosom); - var sinom = Math.sin(omega); - - scale0 = Math.sin((1.0 - t) * omega) / sinom; - scale1 = Math.sin(t * omega) / sinom; - } - - // calculate final values - return this.set( - scale0 * ax + scale1 * bx, - scale0 * ay + scale1 * by, - scale0 * az + scale1 * bz, - scale0 * aw + scale1 * bw - ); - }, - - /** - * Invert this Quaternion. - * - * @method Phaser.Math.Quaternion#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - invert: function () - { - var a0 = this.x; - var a1 = this.y; - var a2 = this.z; - var a3 = this.w; - - var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; - var invDot = (dot) ? 1 / dot : 0; - - return this.set( - -a0 * invDot, - -a1 * invDot, - -a2 * invDot, - a3 * invDot - ); - }, - - /** - * Convert this Quaternion into its conjugate. - * - * Sets the x, y and z components. - * - * @method Phaser.Math.Quaternion#conjugate - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - conjugate: function () - { - this._x = -this.x; - this._y = -this.y; - this._z = -this.z; - - this.onChangeCallback(this); - - return this; - }, - - /** - * Rotate this Quaternion on the X axis. - * - * @method Phaser.Math.Quaternion#rotateX - * @since 3.0.0 - * - * @param {number} rad - The rotation angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotateX: function (rad) - { - rad *= 0.5; - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bx = Math.sin(rad); - var bw = Math.cos(rad); - - return this.set( - ax * bw + aw * bx, - ay * bw + az * bx, - az * bw - ay * bx, - aw * bw - ax * bx - ); - }, - - /** - * Rotate this Quaternion on the Y axis. - * - * @method Phaser.Math.Quaternion#rotateY - * @since 3.0.0 - * - * @param {number} rad - The rotation angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotateY: function (rad) - { - rad *= 0.5; - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var by = Math.sin(rad); - var bw = Math.cos(rad); - - return this.set( - ax * bw - az * by, - ay * bw + aw * by, - az * bw + ax * by, - aw * bw - ay * by - ); - }, - - /** - * Rotate this Quaternion on the Z axis. - * - * @method Phaser.Math.Quaternion#rotateZ - * @since 3.0.0 - * - * @param {number} rad - The rotation angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotateZ: function (rad) - { - rad *= 0.5; - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bz = Math.sin(rad); - var bw = Math.cos(rad); - - return this.set( - ax * bw + ay * bz, - ay * bw - ax * bz, - az * bw + aw * bz, - aw * bw - az * bz - ); - }, - - /** - * Create a unit (or rotation) Quaternion from its x, y, and z components. - * - * Sets the w component. - * - * @method Phaser.Math.Quaternion#calculateW - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - calculateW: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - this.w = -Math.sqrt(1.0 - x * x - y * y - z * z); - - return this; - }, - - /** - * Set this Quaternion from the given Euler, based on Euler order. - * - * @method Phaser.Math.Quaternion#setFromEuler - * @since 3.50.0 - * - * @param {Phaser.Math.Euler} euler - The Euler to convert from. - * @param {boolean} [update=true] - Run the `onChangeCallback`? - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setFromEuler: function (euler, update) - { - var x = euler.x / 2; - var y = euler.y / 2; - var z = euler.z / 2; - - var c1 = Math.cos(x); - var c2 = Math.cos(y); - var c3 = Math.cos(z); - - var s1 = Math.sin(x); - var s2 = Math.sin(y); - var s3 = Math.sin(z); - - switch (euler.order) - { - case 'XYZ': - { - this.set( - s1 * c2 * c3 + c1 * s2 * s3, - c1 * s2 * c3 - s1 * c2 * s3, - c1 * c2 * s3 + s1 * s2 * c3, - c1 * c2 * c3 - s1 * s2 * s3, - update - ); - - break; - } - - case 'YXZ': - { - this.set( - s1 * c2 * c3 + c1 * s2 * s3, - c1 * s2 * c3 - s1 * c2 * s3, - c1 * c2 * s3 - s1 * s2 * c3, - c1 * c2 * c3 + s1 * s2 * s3, - update - ); - - break; - } - - case 'ZXY': - { - this.set( - s1 * c2 * c3 - c1 * s2 * s3, - c1 * s2 * c3 + s1 * c2 * s3, - c1 * c2 * s3 + s1 * s2 * c3, - c1 * c2 * c3 - s1 * s2 * s3, - update - ); - - break; - } - - case 'ZYX': - { - this.set( - s1 * c2 * c3 - c1 * s2 * s3, - c1 * s2 * c3 + s1 * c2 * s3, - c1 * c2 * s3 - s1 * s2 * c3, - c1 * c2 * c3 + s1 * s2 * s3, - update - ); - - break; - } - - case 'YZX': - { - this.set( - s1 * c2 * c3 + c1 * s2 * s3, - c1 * s2 * c3 + s1 * c2 * s3, - c1 * c2 * s3 - s1 * s2 * c3, - c1 * c2 * c3 - s1 * s2 * s3, - update - ); - - break; - } - - case 'XZY': - { - this.set( - s1 * c2 * c3 - c1 * s2 * s3, - c1 * s2 * c3 - s1 * c2 * s3, - c1 * c2 * s3 + s1 * s2 * c3, - c1 * c2 * c3 + s1 * s2 * s3, - update - ); - - break; - } - } - - return this; - }, - - /** - * Sets the rotation of this Quaternion from the given Matrix4. - * - * @method Phaser.Math.Quaternion#setFromRotationMatrix - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to set the rotation from. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setFromRotationMatrix: function (mat4) - { - var m = mat4.val; - - var m11 = m[0]; - var m12 = m[4]; - var m13 = m[8]; - var m21 = m[1]; - var m22 = m[5]; - var m23 = m[9]; - var m31 = m[2]; - var m32 = m[6]; - var m33 = m[10]; - - var trace = m11 + m22 + m33; - var s; - - if (trace > 0) - { - s = 0.5 / Math.sqrt(trace + 1.0); - - this.set( - (m32 - m23) * s, - (m13 - m31) * s, - (m21 - m12) * s, - 0.25 / s - ); - } - else if (m11 > m22 && m11 > m33) - { - s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); - - this.set( - 0.25 * s, - (m12 + m21) / s, - (m13 + m31) / s, - (m32 - m23) / s - ); - } - else if (m22 > m33) - { - s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); - - this.set( - (m12 + m21) / s, - 0.25 * s, - (m23 + m32) / s, - (m13 - m31) / s - ); - } - else - { - s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); - - this.set( - (m13 + m31) / s, - (m23 + m32) / s, - 0.25 * s, - (m21 - m12) / s - ); - } - - return this; - }, - - /** - * Convert the given Matrix into this Quaternion. - * - * @method Phaser.Math.Quaternion#fromMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - fromMat3: function (mat) - { - // benchmarks: - // http://jsperf.com/typed-array-access-speed - // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion - - // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes - // article "Quaternion Calculus and Fast Animation". - var m = mat.val; - var fTrace = m[0] + m[4] + m[8]; - var fRoot; - - if (fTrace > 0) - { - // |w| > 1/2, may as well choose w > 1/2 - fRoot = Math.sqrt(fTrace + 1.0); // 2w - - this.w = 0.5 * fRoot; - - fRoot = 0.5 / fRoot; // 1/(4w) - - this._x = (m[7] - m[5]) * fRoot; - this._y = (m[2] - m[6]) * fRoot; - this._z = (m[3] - m[1]) * fRoot; - } - else - { - // |w| <= 1/2 - var i = 0; - - if (m[4] > m[0]) - { - i = 1; - } - - if (m[8] > m[i * 3 + i]) - { - i = 2; - } - - var j = siNext[i]; - var k = siNext[j]; - - // This isn't quite as clean without array access - fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); - tmp[i] = 0.5 * fRoot; - - fRoot = 0.5 / fRoot; - - tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; - tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; - - this._x = tmp[0]; - this._y = tmp[1]; - this._z = tmp[2]; - this._w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; - } - - this.onChangeCallback(this); - - return this; - } - -}); - -module.exports = Quaternion; - - -/***/ }), -/* 46 */ -/***/ (function(module, exports) { +/***/ 5159: +/***/ ((module) => { /*** IMPORTS FROM imports-loader ***/ @@ -18731,4921 +9895,9 @@ module.exports = spine; /***/ }), -/* 47 */ -/***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Loader.Events - */ - -module.exports = { - - ADD: __webpack_require__(211), - COMPLETE: __webpack_require__(212), - FILE_COMPLETE: __webpack_require__(213), - FILE_KEY_COMPLETE: __webpack_require__(214), - FILE_LOAD_ERROR: __webpack_require__(215), - FILE_LOAD: __webpack_require__(216), - FILE_PROGRESS: __webpack_require__(217), - POST_PROCESS: __webpack_require__(218), - PROGRESS: __webpack_require__(219), - START: __webpack_require__(220) - -}; - - -/***/ }), -/* 48 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Given a File and a baseURL value this returns the URL the File will use to download from. - * - * @function Phaser.Loader.GetURL - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - The File object. - * @param {string} baseURL - A default base URL. - * - * @return {string} The URL the File will use. - */ -var GetURL = function (file, baseURL) -{ - if (!file.url) - { - return false; - } - - if (file.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)) - { - return file.url; - } - else - { - return baseURL + file.url; - } -}; - -module.exports = GetURL; - - -/***/ }), -/* 49 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Extend = __webpack_require__(17); -var XHRSettings = __webpack_require__(50); - -/** - * Takes two XHRSettings Objects and creates a new XHRSettings object from them. - * - * The new object is seeded by the values given in the global settings, but any setting in - * the local object overrides the global ones. - * - * @function Phaser.Loader.MergeXHRSettings - * @since 3.0.0 - * - * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object. - * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object. - * - * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object. - */ -var MergeXHRSettings = function (global, local) -{ - var output = (global === undefined) ? XHRSettings() : Extend({}, global); - - if (local) - { - for (var setting in local) - { - if (local[setting] !== undefined) - { - output[setting] = local[setting]; - } - } - } - - return output; -}; - -module.exports = MergeXHRSettings; - - -/***/ }), -/* 50 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Creates an XHRSettings Object with default values. - * - * @function Phaser.Loader.XHRSettings - * @since 3.0.0 - * - * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'. - * @param {boolean} [async=true] - Should the XHR request use async or not? - * @param {string} [user=''] - Optional username for the XHR request. - * @param {string} [password=''] - Optional password for the XHR request. - * @param {number} [timeout=0] - Optional XHR timeout value. - * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value. - * - * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. - */ -var XHRSettings = function (responseType, async, user, password, timeout, withCredentials) -{ - if (responseType === undefined) { responseType = ''; } - if (async === undefined) { async = true; } - if (user === undefined) { user = ''; } - if (password === undefined) { password = ''; } - if (timeout === undefined) { timeout = 0; } - if (withCredentials === undefined) { withCredentials = false; } - - // Before sending a request, set the xhr.responseType to "text", - // "arraybuffer", "blob", or "document", depending on your data needs. - // Note, setting xhr.responseType = '' (or omitting) will default the response to "text". - - return { - - // Ignored by the Loader, only used by File. - responseType: responseType, - - async: async, - - // credentials - user: user, - password: password, - - // timeout in ms (0 = no timeout) - timeout: timeout, - - // setRequestHeader - headers: undefined, - header: undefined, - headerValue: undefined, - requestedWith: false, - - // overrideMimeType - overrideMimeType: undefined, - - // withCredentials - withCredentials: withCredentials - - }; -}; - -module.exports = XHRSettings; - - -/***/ }), -/* 51 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for calculating and setting the size of a non-Frame based Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.ComputedSize - * @since 3.0.0 - */ - -var ComputedSize = { - - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - * - * @name Phaser.GameObjects.Components.ComputedSize#width - * @type {number} - * @since 3.0.0 - */ - width: 0, - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - * - * @name Phaser.GameObjects.Components.ComputedSize#height - * @type {number} - * @since 3.0.0 - */ - height: 0, - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.ComputedSize#displayWidth - * @type {number} - * @since 3.0.0 - */ - displayWidth: { - - get: function () - { - return this.scaleX * this.width; - }, - - set: function (value) - { - this.scaleX = value / this.width; - } - - }, - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.ComputedSize#displayHeight - * @type {number} - * @since 3.0.0 - */ - displayHeight: { - - get: function () - { - return this.scaleY * this.height; - }, - - set: function (value) - { - this.scaleY = value / this.height; - } - - }, - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * - * @method Phaser.GameObjects.Components.ComputedSize#setSize - * @since 3.4.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setSize: function (width, height) - { - this.width = width; - this.height = height; - - return this; - }, - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * - * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize - * @since 3.4.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setDisplaySize: function (width, height) - { - this.displayWidth = width; - this.displayHeight = height; - - return this; - } - -}; - -module.exports = ComputedSize; - - -/***/ }), -/* 52 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for setting the depth of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Depth - * @since 3.0.0 - */ - -var Depth = { - - /** - * Private internal value. Holds the depth of the Game Object. - * - * @name Phaser.GameObjects.Components.Depth#_depth - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - _depth: 0, - - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @name Phaser.GameObjects.Components.Depth#depth - * @type {number} - * @since 3.0.0 - */ - depth: { - - get: function () - { - return this._depth; - }, - - set: function (value) - { - if (this.displayList) - { - this.displayList.queueDepthSort(); - } - - this._depth = value; - } - - }, - - /** - * The depth of this Game Object within the Scene. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @method Phaser.GameObjects.Components.Depth#setDepth - * @since 3.0.0 - * - * @param {number} value - The depth of this Game Object. Ensure this value is only ever a number data-type. - * - * @return {this} This Game Object instance. - */ - setDepth: function (value) - { - if (value === undefined) { value = 0; } - - this.depth = value; - - return this; - } - -}; - -module.exports = Depth; - - -/***/ }), -/* 53 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for visually flipping a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Flip - * @since 3.0.0 - */ - -var Flip = { - - /** - * The horizontally flipped state of the Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @name Phaser.GameObjects.Components.Flip#flipX - * @type {boolean} - * @default false - * @since 3.0.0 - */ - flipX: false, - - /** - * The vertically flipped state of the Game Object. - * - * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @name Phaser.GameObjects.Components.Flip#flipY - * @type {boolean} - * @default false - * @since 3.0.0 - */ - flipY: false, - - /** - * Toggles the horizontal flipped state of this Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @method Phaser.GameObjects.Components.Flip#toggleFlipX - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - toggleFlipX: function () - { - this.flipX = !this.flipX; - - return this; - }, - - /** - * Toggles the vertical flipped state of this Game Object. - * - * @method Phaser.GameObjects.Components.Flip#toggleFlipY - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - toggleFlipY: function () - { - this.flipY = !this.flipY; - - return this; - }, - - /** - * Sets the horizontal flipped state of this Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @method Phaser.GameObjects.Components.Flip#setFlipX - * @since 3.0.0 - * - * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. - */ - setFlipX: function (value) - { - this.flipX = value; - - return this; - }, - - /** - * Sets the vertical flipped state of this Game Object. - * - * @method Phaser.GameObjects.Components.Flip#setFlipY - * @since 3.0.0 - * - * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. - */ - setFlipY: function (value) - { - this.flipY = value; - - return this; - }, - - /** - * Sets the horizontal and vertical flipped state of this Game Object. - * - * A Game Object that is flipped will render inversed on the flipped axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @method Phaser.GameObjects.Components.Flip#setFlip - * @since 3.0.0 - * - * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped. - * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. - */ - setFlip: function (x, y) - { - this.flipX = x; - this.flipY = y; - - return this; - }, - - /** - * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. - * - * @method Phaser.GameObjects.Components.Flip#resetFlip - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - resetFlip: function () - { - this.flipX = false; - this.flipY = false; - - return this; - } - -}; - -module.exports = Flip; - - -/***/ }), -/* 54 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for getting and setting the Scroll Factor of a Game Object. - * - * @namespace Phaser.GameObjects.Components.ScrollFactor - * @since 3.0.0 - */ - -var ScrollFactor = { - - /** - * The horizontal scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * - * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scrollFactorX: 1, - - /** - * The vertical scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * - * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scrollFactorY: 1, - - /** - * Sets the scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * - * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor - * @since 3.0.0 - * - * @param {number} x - The horizontal scroll factor of this Game Object. - * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. - * - * @return {this} This Game Object instance. - */ - setScrollFactor: function (x, y) - { - if (y === undefined) { y = x; } - - this.scrollFactorX = x; - this.scrollFactorY = y; - - return this; - } - -}; - -module.exports = ScrollFactor; - - -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MATH_CONST = __webpack_require__(3); -var TransformMatrix = __webpack_require__(56); -var TransformXY = __webpack_require__(43); -var WrapAngle = __webpack_require__(32); -var WrapAngleDegrees = __webpack_require__(33); -var Vector2 = __webpack_require__(2); - -// global bitmask flag for GameObject.renderMask (used by Scale) -var _FLAG = 4; // 0100 - -/** - * Provides methods used for getting and setting the position, scale and rotation of a Game Object. - * - * @namespace Phaser.GameObjects.Components.Transform - * @since 3.0.0 - */ - -var Transform = { - - /** - * A property indicating that a Game Object has this component. - * - * @name Phaser.GameObjects.Components.Transform#hasTransformComponent - * @type {boolean} - * @readonly - * @default true - * @since 3.60.0 - */ - hasTransformComponent: true, - - /** - * Private internal value. Holds the horizontal scale value. - * - * @name Phaser.GameObjects.Components.Transform#_scaleX - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _scaleX: 1, - - /** - * Private internal value. Holds the vertical scale value. - * - * @name Phaser.GameObjects.Components.Transform#_scaleY - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _scaleY: 1, - - /** - * Private internal value. Holds the rotation value in radians. - * - * @name Phaser.GameObjects.Components.Transform#_rotation - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - _rotation: 0, - - /** - * The x position of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - x: 0, - - /** - * The y position of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - y: 0, - - /** - * The z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#depth} instead. - * - * @name Phaser.GameObjects.Components.Transform#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - z: 0, - - /** - * The w position of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#w - * @type {number} - * @default 0 - * @since 3.0.0 - */ - w: 0, - - /** - * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object - * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * - * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this - * isn't the case, use the `scaleX` or `scaleY` properties instead. - * - * @name Phaser.GameObjects.Components.Transform#scale - * @type {number} - * @default 1 - * @since 3.18.0 - */ - scale: { - - get: function () - { - return (this._scaleX + this._scaleY) / 2; - }, - - set: function (value) - { - this._scaleX = value; - this._scaleY = value; - - if (value === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The horizontal scale of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#scaleX - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scaleX: { - - get: function () - { - return this._scaleX; - }, - - set: function (value) - { - this._scaleX = value; - - if (value === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The vertical scale of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#scaleY - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scaleY: { - - get: function () - { - return this._scaleY; - }, - - set: function (value) - { - this._scaleY = value; - - if (value === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The angle of this Game Object as expressed in degrees. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left - * and -90 is up. - * - * If you prefer to work in radians, see the `rotation` property instead. - * - * @name Phaser.GameObjects.Components.Transform#angle - * @type {number} - * @default 0 - * @since 3.0.0 - */ - angle: { - - get: function () - { - return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG); - }, - - set: function (value) - { - // value is in degrees - this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD; - } - }, - - /** - * The angle of this Game Object in radians. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left - * and -PI/2 is up. - * - * If you prefer to work in degrees, see the `angle` property instead. - * - * @name Phaser.GameObjects.Components.Transform#rotation - * @type {number} - * @default 1 - * @since 3.0.0 - */ - rotation: { - - get: function () - { - return this._rotation; - }, - - set: function (value) - { - // value is in radians - this._rotation = WrapAngle(value); - } - }, - - /** - * Sets the position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setPosition - * @since 3.0.0 - * - * @param {number} [x=0] - The x position of this Game Object. - * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value. - * @param {number} [z=0] - The z position of this Game Object. - * @param {number} [w=0] - The w position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setPosition: function (x, y, z, w) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = x; } - if (z === undefined) { z = 0; } - if (w === undefined) { w = 0; } - - this.x = x; - this.y = y; - this.z = z; - this.w = w; - - return this; - }, - - /** - * Copies an object's coordinates to this Game Object's position. - * - * @method Phaser.GameObjects.Components.Transform#copyPosition - * @since 3.50.0 - * - * @param {(Phaser.Types.Math.Vector2Like|Phaser.Types.Math.Vector3Like|Phaser.Types.Math.Vector4Like)} source - An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. - * - * @return {this} This Game Object instance. - */ - copyPosition: function (source) - { - if (source.x !== undefined) { this.x = source.x; } - if (source.y !== undefined) { this.y = source.y; } - if (source.z !== undefined) { this.z = source.z; } - if (source.w !== undefined) { this.w = source.w; } - - return this; - }, - - /** - * Sets the position of this Game Object to be a random position within the confines of - * the given area. - * - * If no area is specified a random position between 0 x 0 and the game width x height is used instead. - * - * The position does not factor in the size of this Game Object, meaning that only the origin is - * guaranteed to be within the area. - * - * @method Phaser.GameObjects.Components.Transform#setRandomPosition - * @since 3.8.0 - * - * @param {number} [x=0] - The x position of the top-left of the random area. - * @param {number} [y=0] - The y position of the top-left of the random area. - * @param {number} [width] - The width of the random area. - * @param {number} [height] - The height of the random area. - * - * @return {this} This Game Object instance. - */ - setRandomPosition: function (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = this.scene.sys.scale.width; } - if (height === undefined) { height = this.scene.sys.scale.height; } - - this.x = x + (Math.random() * width); - this.y = y + (Math.random() * height); - - return this; - }, - - /** - * Sets the rotation of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setRotation - * @since 3.0.0 - * - * @param {number} [radians=0] - The rotation of this Game Object, in radians. - * - * @return {this} This Game Object instance. - */ - setRotation: function (radians) - { - if (radians === undefined) { radians = 0; } - - this.rotation = radians; - - return this; - }, - - /** - * Sets the angle of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setAngle - * @since 3.0.0 - * - * @param {number} [degrees=0] - The rotation of this Game Object, in degrees. - * - * @return {this} This Game Object instance. - */ - setAngle: function (degrees) - { - if (degrees === undefined) { degrees = 0; } - - this.angle = degrees; - - return this; - }, - - /** - * Sets the scale of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setScale - * @since 3.0.0 - * - * @param {number} x - The horizontal scale of this Game Object. - * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value. - * - * @return {this} This Game Object instance. - */ - setScale: function (x, y) - { - if (x === undefined) { x = 1; } - if (y === undefined) { y = x; } - - this.scaleX = x; - this.scaleY = y; - - return this; - }, - - /** - * Sets the x position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setX - * @since 3.0.0 - * - * @param {number} [value=0] - The x position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setX: function (value) - { - if (value === undefined) { value = 0; } - - this.x = value; - - return this; - }, - - /** - * Sets the y position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setY - * @since 3.0.0 - * - * @param {number} [value=0] - The y position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setY: function (value) - { - if (value === undefined) { value = 0; } - - this.y = value; - - return this; - }, - - /** - * Sets the z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. - * - * @method Phaser.GameObjects.Components.Transform#setZ - * @since 3.0.0 - * - * @param {number} [value=0] - The z position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setZ: function (value) - { - if (value === undefined) { value = 0; } - - this.z = value; - - return this; - }, - - /** - * Sets the w position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setW - * @since 3.0.0 - * - * @param {number} [value=0] - The w position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setW: function (value) - { - if (value === undefined) { value = 0; } - - this.w = value; - - return this; - }, - - /** - * Gets the local transform matrix for this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix - * @since 3.4.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. - * - * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. - */ - getLocalTransformMatrix: function (tempMatrix) - { - if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } - - return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); - }, - - /** - * Gets the world transform matrix for this Game Object, factoring in any parent Containers. - * - * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix - * @since 3.4.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations. - * - * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. - */ - getWorldTransformMatrix: function (tempMatrix, parentMatrix) - { - if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } - if (parentMatrix === undefined) { parentMatrix = new TransformMatrix(); } - - var parent = this.parentContainer; - - if (!parent) - { - return this.getLocalTransformMatrix(tempMatrix); - } - - tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); - - while (parent) - { - parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY); - - parentMatrix.multiply(tempMatrix, tempMatrix); - - parent = parent.parentContainer; - } - - return tempMatrix; - }, - - /** - * Takes the given `x` and `y` coordinates and converts them into local space for this - * Game Object, taking into account parent and local transforms, and the Display Origin. - * - * The returned Vector2 contains the translated point in its properties. - * - * A Camera needs to be provided in order to handle modified scroll factors. If no - * camera is specified, it will use the `main` camera from the Scene to which this - * Game Object belongs. - * - * @method Phaser.GameObjects.Components.Transform#getLocalPoint - * @since 3.50.0 - * - * @param {number} x - The x position to translate. - * @param {number} y - The y position to translate. - * @param {Phaser.Math.Vector2} [point] - A Vector2, or point-like object, to store the results in. - * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera which is being tested against. If not given will use the Scene default camera. - * - * @return {Phaser.Math.Vector2} The translated point. - */ - getLocalPoint: function (x, y, point, camera) - { - if (!point) { point = new Vector2(); } - if (!camera) { camera = this.scene.sys.cameras.main; } - - var csx = camera.scrollX; - var csy = camera.scrollY; - - var px = x + (csx * this.scrollFactorX) - csx; - var py = y + (csy * this.scrollFactorY) - csy; - - if (this.parentContainer) - { - this.getWorldTransformMatrix().applyInverse(px, py, point); - } - else - { - TransformXY(px, py, this.x, this.y, this.rotation, this.scaleX, this.scaleY, point); - } - - // Normalize origin - if (this._originComponent) - { - point.x += this._displayOriginX; - point.y += this._displayOriginY; - } - - return point; - }, - - /** - * Gets the sum total rotation of all of this Game Objects parent Containers. - * - * The returned value is in radians and will be zero if this Game Object has no parent container. - * - * @method Phaser.GameObjects.Components.Transform#getParentRotation - * @since 3.18.0 - * - * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object. - */ - getParentRotation: function () - { - var rotation = 0; - - var parent = this.parentContainer; - - while (parent) - { - rotation += parent.rotation; - - parent = parent.parentContainer; - } - - return rotation; - } - -}; - -module.exports = Transform; - - -/***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var MATH_CONST = __webpack_require__(3); -var Vector2 = __webpack_require__(2); - -/** - * @classdesc - * A Matrix used for display transformations for rendering. - * - * It is represented like so: - * - * ``` - * | a | c | tx | - * | b | d | ty | - * | 0 | 0 | 1 | - * ``` - * - * @class TransformMatrix - * @memberof Phaser.GameObjects.Components - * @constructor - * @since 3.0.0 - * - * @param {number} [a=1] - The Scale X value. - * @param {number} [b=0] - The Skew Y value. - * @param {number} [c=0] - The Skew X value. - * @param {number} [d=1] - The Scale Y value. - * @param {number} [tx=0] - The Translate X value. - * @param {number} [ty=0] - The Translate Y value. - */ -var TransformMatrix = new Class({ - - initialize: - - function TransformMatrix (a, b, c, d, tx, ty) - { - if (a === undefined) { a = 1; } - if (b === undefined) { b = 0; } - if (c === undefined) { c = 0; } - if (d === undefined) { d = 1; } - if (tx === undefined) { tx = 0; } - if (ty === undefined) { ty = 0; } - - /** - * The matrix values. - * - * @name Phaser.GameObjects.Components.TransformMatrix#matrix - * @type {Float32Array} - * @since 3.0.0 - */ - this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]); - - /** - * The decomposed matrix. - * - * @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix - * @type {object} - * @since 3.0.0 - */ - this.decomposedMatrix = { - translateX: 0, - translateY: 0, - scaleX: 1, - scaleY: 1, - rotation: 0 - }; - - /** - * The temporary quad value cache. - * - * @name Phaser.GameObjects.Components.TransformMatrix#quad - * @type {Float32Array} - * @since 3.60.0 - */ - this.quad = new Float32Array(8); - }, - - /** - * The Scale X value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#a - * @type {number} - * @since 3.4.0 - */ - a: { - - get: function () - { - return this.matrix[0]; - }, - - set: function (value) - { - this.matrix[0] = value; - } - - }, - - /** - * The Skew Y value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#b - * @type {number} - * @since 3.4.0 - */ - b: { - - get: function () - { - return this.matrix[1]; - }, - - set: function (value) - { - this.matrix[1] = value; - } - - }, - - /** - * The Skew X value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#c - * @type {number} - * @since 3.4.0 - */ - c: { - - get: function () - { - return this.matrix[2]; - }, - - set: function (value) - { - this.matrix[2] = value; - } - - }, - - /** - * The Scale Y value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#d - * @type {number} - * @since 3.4.0 - */ - d: { - - get: function () - { - return this.matrix[3]; - }, - - set: function (value) - { - this.matrix[3] = value; - } - - }, - - /** - * The Translate X value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#e - * @type {number} - * @since 3.11.0 - */ - e: { - - get: function () - { - return this.matrix[4]; - }, - - set: function (value) - { - this.matrix[4] = value; - } - - }, - - /** - * The Translate Y value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#f - * @type {number} - * @since 3.11.0 - */ - f: { - - get: function () - { - return this.matrix[5]; - }, - - set: function (value) - { - this.matrix[5] = value; - } - - }, - - /** - * The Translate X value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#tx - * @type {number} - * @since 3.4.0 - */ - tx: { - - get: function () - { - return this.matrix[4]; - }, - - set: function (value) - { - this.matrix[4] = value; - } - - }, - - /** - * The Translate Y value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#ty - * @type {number} - * @since 3.4.0 - */ - ty: { - - get: function () - { - return this.matrix[5]; - }, - - set: function (value) - { - this.matrix[5] = value; - } - - }, - - /** - * The rotation of the Matrix. Value is in radians. - * - * @name Phaser.GameObjects.Components.TransformMatrix#rotation - * @type {number} - * @readonly - * @since 3.4.0 - */ - rotation: { - - get: function () - { - return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1); - } - - }, - - /** - * The rotation of the Matrix, normalized to be within the Phaser right-handed - * clockwise rotation space. Value is in radians. - * - * @name Phaser.GameObjects.Components.TransformMatrix#rotationNormalized - * @type {number} - * @readonly - * @since 3.19.0 - */ - rotationNormalized: { - - get: function () - { - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - - if (a || b) - { - // var r = Math.sqrt(a * a + b * b); - - return (b > 0) ? Math.acos(a / this.scaleX) : -Math.acos(a / this.scaleX); - } - else if (c || d) - { - // var s = Math.sqrt(c * c + d * d); - - return MATH_CONST.TAU - ((d > 0) ? Math.acos(-c / this.scaleY) : -Math.acos(c / this.scaleY)); - } - else - { - return 0; - } - } - - }, - - /** - * The decomposed horizontal scale of the Matrix. This value is always positive. - * - * @name Phaser.GameObjects.Components.TransformMatrix#scaleX - * @type {number} - * @readonly - * @since 3.4.0 - */ - scaleX: { - - get: function () - { - return Math.sqrt((this.a * this.a) + (this.b * this.b)); - } - - }, - - /** - * The decomposed vertical scale of the Matrix. This value is always positive. - * - * @name Phaser.GameObjects.Components.TransformMatrix#scaleY - * @type {number} - * @readonly - * @since 3.4.0 - */ - scaleY: { - - get: function () - { - return Math.sqrt((this.c * this.c) + (this.d * this.d)); - } - - }, - - /** - * Reset the Matrix to an identity matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity - * @since 3.0.0 - * - * @return {this} This TransformMatrix. - */ - loadIdentity: function () - { - var matrix = this.matrix; - - matrix[0] = 1; - matrix[1] = 0; - matrix[2] = 0; - matrix[3] = 1; - matrix[4] = 0; - matrix[5] = 0; - - return this; - }, - - /** - * Translate the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#translate - * @since 3.0.0 - * - * @param {number} x - The horizontal translation value. - * @param {number} y - The vertical translation value. - * - * @return {this} This TransformMatrix. - */ - translate: function (x, y) - { - var matrix = this.matrix; - - matrix[4] = matrix[0] * x + matrix[2] * y + matrix[4]; - matrix[5] = matrix[1] * x + matrix[3] * y + matrix[5]; - - return this; - }, - - /** - * Scale the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#scale - * @since 3.0.0 - * - * @param {number} x - The horizontal scale value. - * @param {number} y - The vertical scale value. - * - * @return {this} This TransformMatrix. - */ - scale: function (x, y) - { - var matrix = this.matrix; - - matrix[0] *= x; - matrix[1] *= x; - matrix[2] *= y; - matrix[3] *= y; - - return this; - }, - - /** - * Rotate the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#rotate - * @since 3.0.0 - * - * @param {number} angle - The angle of rotation in radians. - * - * @return {this} This TransformMatrix. - */ - rotate: function (angle) - { - var sin = Math.sin(angle); - var cos = Math.cos(angle); - - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - - matrix[0] = a * cos + c * sin; - matrix[1] = b * cos + d * sin; - matrix[2] = a * -sin + c * cos; - matrix[3] = b * -sin + d * cos; - - return this; - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * If an `out` Matrix is given then the results will be stored in it. - * If it is not given, this matrix will be updated in place instead. - * Use an `out` Matrix if you do not wish to mutate this matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#multiply - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} rhs - The Matrix to multiply by. - * @param {Phaser.GameObjects.Components.TransformMatrix} [out] - An optional Matrix to store the results in. - * - * @return {(this|Phaser.GameObjects.Components.TransformMatrix)} Either this TransformMatrix, or the `out` Matrix, if given in the arguments. - */ - multiply: function (rhs, out) - { - var matrix = this.matrix; - var source = rhs.matrix; - - var localA = matrix[0]; - var localB = matrix[1]; - var localC = matrix[2]; - var localD = matrix[3]; - var localE = matrix[4]; - var localF = matrix[5]; - - var sourceA = source[0]; - var sourceB = source[1]; - var sourceC = source[2]; - var sourceD = source[3]; - var sourceE = source[4]; - var sourceF = source[5]; - - var destinationMatrix = (out === undefined) ? matrix : out.matrix; - - destinationMatrix[0] = (sourceA * localA) + (sourceB * localC); - destinationMatrix[1] = (sourceA * localB) + (sourceB * localD); - destinationMatrix[2] = (sourceC * localA) + (sourceD * localC); - destinationMatrix[3] = (sourceC * localB) + (sourceD * localD); - destinationMatrix[4] = (sourceE * localA) + (sourceF * localC) + localE; - destinationMatrix[5] = (sourceE * localB) + (sourceF * localD) + localF; - - return destinationMatrix; - }, - - /** - * Multiply this Matrix by the matrix given, including the offset. - * - * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`. - * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`. - * - * @method Phaser.GameObjects.Components.TransformMatrix#multiplyWithOffset - * @since 3.11.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from. - * @param {number} offsetX - Horizontal offset to factor in to the multiplication. - * @param {number} offsetY - Vertical offset to factor in to the multiplication. - * - * @return {this} This TransformMatrix. - */ - multiplyWithOffset: function (src, offsetX, offsetY) - { - var matrix = this.matrix; - var otherMatrix = src.matrix; - - var a0 = matrix[0]; - var b0 = matrix[1]; - var c0 = matrix[2]; - var d0 = matrix[3]; - var tx0 = matrix[4]; - var ty0 = matrix[5]; - - var pse = offsetX * a0 + offsetY * c0 + tx0; - var psf = offsetX * b0 + offsetY * d0 + ty0; - - var a1 = otherMatrix[0]; - var b1 = otherMatrix[1]; - var c1 = otherMatrix[2]; - var d1 = otherMatrix[3]; - var tx1 = otherMatrix[4]; - var ty1 = otherMatrix[5]; - - matrix[0] = a1 * a0 + b1 * c0; - matrix[1] = a1 * b0 + b1 * d0; - matrix[2] = c1 * a0 + d1 * c0; - matrix[3] = c1 * b0 + d1 * d0; - matrix[4] = tx1 * a0 + ty1 * c0 + pse; - matrix[5] = tx1 * b0 + ty1 * d0 + psf; - - return this; - }, - - /** - * Transform the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#transform - * @since 3.0.0 - * - * @param {number} a - The Scale X value. - * @param {number} b - The Shear Y value. - * @param {number} c - The Shear X value. - * @param {number} d - The Scale Y value. - * @param {number} tx - The Translate X value. - * @param {number} ty - The Translate Y value. - * - * @return {this} This TransformMatrix. - */ - transform: function (a, b, c, d, tx, ty) - { - var matrix = this.matrix; - - var a0 = matrix[0]; - var b0 = matrix[1]; - var c0 = matrix[2]; - var d0 = matrix[3]; - var tx0 = matrix[4]; - var ty0 = matrix[5]; - - matrix[0] = a * a0 + b * c0; - matrix[1] = a * b0 + b * d0; - matrix[2] = c * a0 + d * c0; - matrix[3] = c * b0 + d * d0; - matrix[4] = tx * a0 + ty * c0 + tx0; - matrix[5] = tx * b0 + ty * d0 + ty0; - - return this; - }, - - /** - * Transform a point in to the local space of this Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint - * @since 3.0.0 - * - * @param {number} x - The x coordinate of the point to transform. - * @param {number} y - The y coordinate of the point to transform. - * @param {Phaser.Types.Math.Vector2Like} [point] - Optional Point object to store the transformed coordinates in. - * - * @return {Phaser.Types.Math.Vector2Like} The Point containing the transformed coordinates. - */ - transformPoint: function (x, y, point) - { - if (point === undefined) { point = { x: 0, y: 0 }; } - - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - var tx = matrix[4]; - var ty = matrix[5]; - - point.x = x * a + y * c + tx; - point.y = x * b + y * d + ty; - - return point; - }, - - /** - * Invert the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#invert - * @since 3.0.0 - * - * @return {this} This TransformMatrix. - */ - invert: function () - { - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - var tx = matrix[4]; - var ty = matrix[5]; - - var n = a * d - b * c; - - matrix[0] = d / n; - matrix[1] = -b / n; - matrix[2] = -c / n; - matrix[3] = a / n; - matrix[4] = (c * ty - d * tx) / n; - matrix[5] = -(a * ty - b * tx) / n; - - return this; - }, - - /** - * Set the values of this Matrix to copy those of the matrix given. - * - * @method Phaser.GameObjects.Components.TransformMatrix#copyFrom - * @since 3.11.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from. - * - * @return {this} This TransformMatrix. - */ - copyFrom: function (src) - { - var matrix = this.matrix; - - matrix[0] = src.a; - matrix[1] = src.b; - matrix[2] = src.c; - matrix[3] = src.d; - matrix[4] = src.e; - matrix[5] = src.f; - - return this; - }, - - /** - * Set the values of this Matrix to copy those of the array given. - * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. - * - * @method Phaser.GameObjects.Components.TransformMatrix#copyFromArray - * @since 3.11.0 - * - * @param {array} src - The array of values to set into this matrix. - * - * @return {this} This TransformMatrix. - */ - copyFromArray: function (src) - { - var matrix = this.matrix; - - matrix[0] = src[0]; - matrix[1] = src[1]; - matrix[2] = src[2]; - matrix[3] = src[3]; - matrix[4] = src[4]; - matrix[5] = src[5]; - - return this; - }, - - /** - * Copy the values from this Matrix to the given Canvas Rendering Context. - * This will use the Context.transform method. - * - * @method Phaser.GameObjects.Components.TransformMatrix#copyToContext - * @since 3.12.0 - * - * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to. - * - * @return {CanvasRenderingContext2D} The Canvas Rendering Context. - */ - copyToContext: function (ctx) - { - var matrix = this.matrix; - - ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); - - return ctx; - }, - - /** - * Copy the values from this Matrix to the given Canvas Rendering Context. - * This will use the Context.setTransform method. - * - * @method Phaser.GameObjects.Components.TransformMatrix#setToContext - * @since 3.12.0 - * - * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to. - * - * @return {CanvasRenderingContext2D} The Canvas Rendering Context. - */ - setToContext: function (ctx) - { - var matrix = this.matrix; - - ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); - - return ctx; - }, - - /** - * Copy the values in this Matrix to the array given. - * - * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. - * - * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray - * @since 3.12.0 - * - * @param {array} [out] - The array to copy the matrix values in to. - * - * @return {array} An array where elements 0 to 5 contain the values from this matrix. - */ - copyToArray: function (out) - { - var matrix = this.matrix; - - if (out === undefined) - { - out = [ matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] ]; - } - else - { - out[0] = matrix[0]; - out[1] = matrix[1]; - out[2] = matrix[2]; - out[3] = matrix[3]; - out[4] = matrix[4]; - out[5] = matrix[5]; - } - - return out; - }, - - /** - * Set the values of this Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#setTransform - * @since 3.0.0 - * - * @param {number} a - The Scale X value. - * @param {number} b - The Shear Y value. - * @param {number} c - The Shear X value. - * @param {number} d - The Scale Y value. - * @param {number} tx - The Translate X value. - * @param {number} ty - The Translate Y value. - * - * @return {this} This TransformMatrix. - */ - setTransform: function (a, b, c, d, tx, ty) - { - var matrix = this.matrix; - - matrix[0] = a; - matrix[1] = b; - matrix[2] = c; - matrix[3] = d; - matrix[4] = tx; - matrix[5] = ty; - - return this; - }, - - /** - * Decompose this Matrix into its translation, scale and rotation values using QR decomposition. - * - * The result must be applied in the following order to reproduce the current matrix: - * - * translate -> rotate -> scale - * - * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix - * @since 3.0.0 - * - * @return {object} The decomposed Matrix. - */ - decomposeMatrix: function () - { - var decomposedMatrix = this.decomposedMatrix; - - var matrix = this.matrix; - - // a = scale X (1) - // b = shear Y (0) - // c = shear X (0) - // d = scale Y (1) - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - - var determ = a * d - b * c; - - decomposedMatrix.translateX = matrix[4]; - decomposedMatrix.translateY = matrix[5]; - - if (a || b) - { - var r = Math.sqrt(a * a + b * b); - - decomposedMatrix.rotation = (b > 0) ? Math.acos(a / r) : -Math.acos(a / r); - decomposedMatrix.scaleX = r; - decomposedMatrix.scaleY = determ / r; - } - else if (c || d) - { - var s = Math.sqrt(c * c + d * d); - - decomposedMatrix.rotation = Math.PI * 0.5 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s)); - decomposedMatrix.scaleX = determ / s; - decomposedMatrix.scaleY = s; - } - else - { - decomposedMatrix.rotation = 0; - decomposedMatrix.scaleX = 0; - decomposedMatrix.scaleY = 0; - } - - return decomposedMatrix; - }, - - /** - * Apply the identity, translate, rotate and scale operations on the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#applyITRS - * @since 3.0.0 - * - * @param {number} x - The horizontal translation. - * @param {number} y - The vertical translation. - * @param {number} rotation - The angle of rotation in radians. - * @param {number} scaleX - The horizontal scale. - * @param {number} scaleY - The vertical scale. - * - * @return {this} This TransformMatrix. - */ - applyITRS: function (x, y, rotation, scaleX, scaleY) - { - var matrix = this.matrix; - - var radianSin = Math.sin(rotation); - var radianCos = Math.cos(rotation); - - // Translate - matrix[4] = x; - matrix[5] = y; - - // Rotate and Scale - matrix[0] = radianCos * scaleX; - matrix[1] = radianSin * scaleX; - matrix[2] = -radianSin * scaleY; - matrix[3] = radianCos * scaleY; - - return this; - }, - - /** - * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of - * the current matrix with its transformation applied. - * - * Can be used to translate points from world to local space. - * - * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse - * @since 3.12.0 - * - * @param {number} x - The x position to translate. - * @param {number} y - The y position to translate. - * @param {Phaser.Math.Vector2} [output] - A Vector2, or point-like object, to store the results in. - * - * @return {Phaser.Math.Vector2} The coordinates, inverse-transformed through this matrix. - */ - applyInverse: function (x, y, output) - { - if (output === undefined) { output = new Vector2(); } - - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - var tx = matrix[4]; - var ty = matrix[5]; - - var id = 1 / ((a * d) + (c * -b)); - - output.x = (d * id * x) + (-c * id * y) + (((ty * c) - (tx * d)) * id); - output.y = (a * id * y) + (-b * id * x) + (((-ty * a) + (tx * b)) * id); - - return output; - }, - - /** - * Performs the 8 calculations required to create the vertices of - * a quad based on this matrix and the given x/y/xw/yh values. - * - * The result is stored in `TransformMatrix.quad`, which is returned - * from this method. - * - * @method Phaser.GameObjects.Components.TransformMatrix#setQuad - * @since 3.60.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {number} xw - The xw value. - * @param {number} yh - The yh value. - * @param {boolean} roundPixels - Pass the results via Math.round? - * @param {Float32Array} [quad] - Optional Float32Array to store the results in. Otherwises uses the local quad array. - * - * @return {Float32Array} The quad Float32Array. - */ - setQuad: function (x, y, xw, yh, roundPixels, quad) - { - if (quad === undefined) { quad = this.quad; } - - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - var e = matrix[4]; - var f = matrix[5]; - - quad[0] = x * a + y * c + e; - quad[1] = x * b + y * d + f; - - quad[2] = x * a + yh * c + e; - quad[3] = x * b + yh * d + f; - - quad[4] = xw * a + yh * c + e; - quad[5] = xw * b + yh * d + f; - - quad[6] = xw * a + y * c + e; - quad[7] = xw * b + y * d + f; - - if (roundPixels) - { - quad.forEach(function (value, index) - { - quad[index] = Math.round(value); - }); - } - - return quad; - }, - - /** - * Returns the X component of this matrix multiplied by the given values. - * This is the same as `x * a + y * c + e`. - * - * @method Phaser.GameObjects.Components.TransformMatrix#getX - * @since 3.12.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * - * @return {number} The calculated x value. - */ - getX: function (x, y) - { - return x * this.a + y * this.c + this.e; - }, - - /** - * Returns the Y component of this matrix multiplied by the given values. - * This is the same as `x * b + y * d + f`. - * - * @method Phaser.GameObjects.Components.TransformMatrix#getY - * @since 3.12.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * - * @return {number} The calculated y value. - */ - getY: function (x, y) - { - return x * this.b + y * this.d + this.f; - }, - - /** - * Returns the X component of this matrix multiplied by the given values. - * - * This is the same as `x * a + y * c + e`, optionally passing via `Math.round`. - * - * @method Phaser.GameObjects.Components.TransformMatrix#getXRound - * @since 3.50.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {boolean} [round=false] - Math.round the resulting value? - * - * @return {number} The calculated x value. - */ - getXRound: function (x, y, round) - { - var v = this.getX(x, y); - - if (round) - { - v = Math.round(v); - } - - return v; - }, - - /** - * Returns the Y component of this matrix multiplied by the given values. - * - * This is the same as `x * b + y * d + f`, optionally passing via `Math.round`. - * - * @method Phaser.GameObjects.Components.TransformMatrix#getYRound - * @since 3.50.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {boolean} [round=false] - Math.round the resulting value? - * - * @return {number} The calculated y value. - */ - getYRound: function (x, y, round) - { - var v = this.getY(x, y); - - if (round) - { - v = Math.round(v); - } - - return v; - }, - - /** - * Returns a string that can be used in a CSS Transform call as a `matrix` property. - * - * @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix - * @since 3.12.0 - * - * @return {string} A string containing the CSS Transform matrix values. - */ - getCSSMatrix: function () - { - var m = this.matrix; - - return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')'; - }, - - /** - * Destroys this Transform Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#destroy - * @since 3.4.0 - */ - destroy: function () - { - this.matrix = null; - this.quad = null; - this.decomposedMatrix = null; - } - -}); - -module.exports = TransformMatrix; - - -/***/ }), -/* 57 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// bitmask flag for GameObject.renderMask -var _FLAG = 1; // 0001 - -/** - * Provides methods used for setting the visibility of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Visible - * @since 3.0.0 - */ - -var Visible = { - - /** - * Private internal value. Holds the visible value. - * - * @name Phaser.GameObjects.Components.Visible#_visible - * @type {boolean} - * @private - * @default true - * @since 3.0.0 - */ - _visible: true, - - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * - * @name Phaser.GameObjects.Components.Visible#visible - * @type {boolean} - * @since 3.0.0 - */ - visible: { - - get: function () - { - return this._visible; - }, - - set: function (value) - { - if (value) - { - this._visible = true; - this.renderFlags |= _FLAG; - } - else - { - this._visible = false; - this.renderFlags &= ~_FLAG; - } - } - - }, - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * - * @method Phaser.GameObjects.Components.Visible#setVisible - * @since 3.0.0 - * - * @param {boolean} value - The visible state of the Game Object. - * - * @return {this} This Game Object instance. - */ - setVisible: function (value) - { - this.visible = value; - - return this; - } -}; - -module.exports = Visible; - - -/***/ }), -/* 58 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var ComponentsToJSON = __webpack_require__(59); -var DataManager = __webpack_require__(226); -var EventEmitter = __webpack_require__(233); -var Events = __webpack_require__(60); -var SceneEvents = __webpack_require__(23); - -/** - * @classdesc - * The base class that all Game Objects extend. - * You don't create GameObjects directly and they cannot be added to the display list. - * Instead, use them as the base for your own custom classes. - * - * @class GameObject - * @memberof Phaser.GameObjects - * @extends Phaser.Events.EventEmitter - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. - * @param {string} type - A textual representation of the type of Game Object, i.e. `sprite`. - */ -var GameObject = new Class({ - - Extends: EventEmitter, - - initialize: - - function GameObject (scene, type) - { - EventEmitter.call(this); - - /** - * A reference to the Scene to which this Game Object belongs. - * - * Game Objects can only belong to one Scene. - * - * You should consider this property as being read-only. You cannot move a - * Game Object to another Scene by simply changing it. - * - * @name Phaser.GameObjects.GameObject#scene - * @type {Phaser.Scene} - * @since 3.0.0 - */ - this.scene = scene; - - /** - * Holds a reference to the Display List that contains this Game Object. - * - * This is set automatically when this Game Object is added to a Scene or Layer. - * - * You should treat this property as being read-only. - * - * @name Phaser.GameObjects.GameObject#displayList - * @type {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} - * @default null - * @since 3.50.0 - */ - this.displayList = null; - - /** - * A textual representation of this Game Object, i.e. `sprite`. - * Used internally by Phaser but is available for your own custom classes to populate. - * - * @name Phaser.GameObjects.GameObject#type - * @type {string} - * @since 3.0.0 - */ - this.type = type; - - /** - * The current state of this Game Object. - * - * Phaser itself will never modify this value, although plugins may do so. - * - * Use this property to track the state of a Game Object during its lifetime. For example, it could change from - * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant - * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. - * If you need to store complex data about your Game Object, look at using the Data Component instead. - * - * @name Phaser.GameObjects.GameObject#state - * @type {(number|string)} - * @since 3.16.0 - */ - this.state = 0; - - /** - * The parent Container of this Game Object, if it has one. - * - * @name Phaser.GameObjects.GameObject#parentContainer - * @type {Phaser.GameObjects.Container} - * @since 3.4.0 - */ - this.parentContainer = null; - - /** - * The name of this Game Object. - * Empty by default and never populated by Phaser, this is left for developers to use. - * - * @name Phaser.GameObjects.GameObject#name - * @type {string} - * @default '' - * @since 3.0.0 - */ - this.name = ''; - - /** - * The active state of this Game Object. - * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. - * An active object is one which is having its logic and internal systems updated. - * - * @name Phaser.GameObjects.GameObject#active - * @type {boolean} - * @default true - * @since 3.0.0 - */ - this.active = true; - - /** - * The Tab Index of the Game Object. - * Reserved for future use by plugins and the Input Manager. - * - * @name Phaser.GameObjects.GameObject#tabIndex - * @type {number} - * @default -1 - * @since 3.0.0 - */ - this.tabIndex = -1; - - /** - * A Data Manager. - * It allows you to store, query and get key/value paired information specific to this Game Object. - * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. - * - * @name Phaser.GameObjects.GameObject#data - * @type {Phaser.Data.DataManager} - * @default null - * @since 3.0.0 - */ - this.data = null; - - /** - * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. - * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. - * If those components are not used by your custom class then you can use this bitmask as you wish. - * - * @name Phaser.GameObjects.GameObject#renderFlags - * @type {number} - * @default 15 - * @since 3.0.0 - */ - this.renderFlags = 15; - - /** - * A bitmask that controls if this Game Object is drawn by a Camera or not. - * Not usually set directly, instead call `Camera.ignore`, however you can - * set this property directly using the Camera.id property: - * - * @example - * this.cameraFilter |= camera.id - * - * @name Phaser.GameObjects.GameObject#cameraFilter - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.cameraFilter = 0; - - /** - * If this Game Object is enabled for input then this property will contain an InteractiveObject instance. - * Not usually set directly. Instead call `GameObject.setInteractive()`. - * - * @name Phaser.GameObjects.GameObject#input - * @type {?Phaser.Types.Input.InteractiveObject} - * @default null - * @since 3.0.0 - */ - this.input = null; - - /** - * If this Game Object is enabled for Arcade or Matter Physics then this property will contain a reference to a Physics Body. - * - * @name Phaser.GameObjects.GameObject#body - * @type {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|MatterJS.BodyType)} - * @default null - * @since 3.0.0 - */ - this.body = null; - - /** - * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`. - * This includes calls that may come from a Group, Container or the Scene itself. - * While it allows you to persist a Game Object across Scenes, please understand you are entirely - * responsible for managing references to and from this Game Object. - * - * @name Phaser.GameObjects.GameObject#ignoreDestroy - * @type {boolean} - * @default false - * @since 3.5.0 - */ - this.ignoreDestroy = false; - - this.on(Events.ADDED_TO_SCENE, this.addedToScene, this); - this.on(Events.REMOVED_FROM_SCENE, this.removedFromScene, this); - - // Tell the Scene to re-sort the children - scene.sys.queueDepthSort(); - }, - - /** - * Sets the `active` property of this Game Object and returns this Game Object for further chaining. - * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList. - * - * @method Phaser.GameObjects.GameObject#setActive - * @since 3.0.0 - * - * @param {boolean} value - True if this Game Object should be set as active, false if not. - * - * @return {this} This GameObject. - */ - setActive: function (value) - { - this.active = value; - - return this; - }, - - /** - * Sets the `name` property of this Game Object and returns this Game Object for further chaining. - * The `name` property is not populated by Phaser and is presented for your own use. - * - * @method Phaser.GameObjects.GameObject#setName - * @since 3.0.0 - * - * @param {string} value - The name to be given to this Game Object. - * - * @return {this} This GameObject. - */ - setName: function (value) - { - this.name = value; - - return this; - }, - - /** - * Sets the current state of this Game Object. - * - * Phaser itself will never modify the State of a Game Object, although plugins may do so. - * - * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. - * The state value should typically be an integer (ideally mapped to a constant - * in your game code), but could also be a string. It is recommended to keep it light and simple. - * If you need to store complex data about your Game Object, look at using the Data Component instead. - * - * @method Phaser.GameObjects.GameObject#setState - * @since 3.16.0 - * - * @param {(number|string)} value - The state of the Game Object. - * - * @return {this} This GameObject. - */ - setState: function (value) - { - this.state = value; - - return this; - }, - - /** - * Adds a Data Manager component to this Game Object. - * - * @method Phaser.GameObjects.GameObject#setDataEnabled - * @since 3.0.0 - * @see Phaser.Data.DataManager - * - * @return {this} This GameObject. - */ - setDataEnabled: function () - { - if (!this.data) - { - this.data = new DataManager(this); - } - - return this; - }, - - /** - * Allows you to store a key value pair within this Game Objects Data Manager. - * - * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled - * before setting the value. - * - * If the key doesn't already exist in the Data Manager then it is created. - * - * ```javascript - * sprite.setData('name', 'Red Gem Stone'); - * ``` - * - * You can also pass in an object of key value pairs as the first argument: - * - * ```javascript - * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); - * ``` - * - * To get a value back again you can call `getData`: - * - * ```javascript - * sprite.getData('gold'); - * ``` - * - * Or you can access the value directly via the `values` property, where it works like any other variable: - * - * ```javascript - * sprite.data.values.gold += 50; - * ``` - * - * When the value is first set, a `setdata` event is emitted from this Game Object. - * - * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. - * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. - * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. - * - * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. - * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. - * - * @method Phaser.GameObjects.GameObject#setData - * @since 3.0.0 - * - * @generic {any} T - * @genericUse {(string|T)} - [key] - * - * @param {(string|object)} key - The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. - * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored. - * - * @return {this} This GameObject. - */ - setData: function (key, value) - { - if (!this.data) - { - this.data = new DataManager(this); - } - - this.data.set(key, value); - - return this; - }, - - /** - * Increase a value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is increased from 0. - * - * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled - * before setting the value. - * - * If the key doesn't already exist in the Data Manager then it is created. - * - * When the value is first set, a `setdata` event is emitted from this Game Object. - * - * @method Phaser.GameObjects.GameObject#incData - * @since 3.23.0 - * - * @generic {any} T - * @genericUse {(string|T)} - [key] - * - * @param {(string|object)} key - The key to increase the value for. - * @param {*} [data] - The value to increase for the given key. - * - * @return {this} This GameObject. - */ - incData: function (key, value) - { - if (!this.data) - { - this.data = new DataManager(this); - } - - this.data.inc(key, value); - - return this; - }, - - /** - * Toggle a boolean value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is toggled from false. - * - * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled - * before setting the value. - * - * If the key doesn't already exist in the Data Manager then it is created. - * - * When the value is first set, a `setdata` event is emitted from this Game Object. - * - * @method Phaser.GameObjects.GameObject#toggleData - * @since 3.23.0 - * - * @generic {any} T - * @genericUse {(string|T)} - [key] - * - * @param {(string|object)} key - The key to toggle the value for. - * - * @return {this} This GameObject. - */ - toggleData: function (key) - { - if (!this.data) - { - this.data = new DataManager(this); - } - - this.data.toggle(key); - - return this; - }, - - /** - * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. - * - * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: - * - * ```javascript - * sprite.getData('gold'); - * ``` - * - * Or access the value directly: - * - * ```javascript - * sprite.data.values.gold; - * ``` - * - * You can also pass in an array of keys, in which case an array of values will be returned: - * - * ```javascript - * sprite.getData([ 'gold', 'armor', 'health' ]); - * ``` - * - * This approach is useful for destructuring arrays in ES6. - * - * @method Phaser.GameObjects.GameObject#getData - * @since 3.0.0 - * - * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys. - * - * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array. - */ - getData: function (key) - { - if (!this.data) - { - this.data = new DataManager(this); - } - - return this.data.get(key); - }, - - /** - * Pass this Game Object to the Input Manager to enable it for Input. - * - * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area - * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced - * input detection. - * - * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If - * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific - * shape for it to use. - * - * You can also provide an Input Configuration Object as the only argument to this method. - * - * @example - * sprite.setInteractive(); - * - * @example - * sprite.setInteractive(new Phaser.Geom.Circle(45, 46, 45), Phaser.Geom.Circle.Contains); - * - * @example - * graphics.setInteractive(new Phaser.Geom.Rectangle(0, 0, 128, 128), Phaser.Geom.Rectangle.Contains); - * - * @method Phaser.GameObjects.GameObject#setInteractive - * @since 3.0.0 - * - * @param {(Phaser.Types.Input.InputConfiguration|any)} [hitArea] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not given it will try to create a Rectangle based on the texture frame. - * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The callback that determines if the pointer is within the Hit Area shape or not. If you provide a shape you must also provide a callback. - * @param {boolean} [dropZone=false] - Should this Game Object be treated as a drop zone target? - * - * @return {this} This GameObject. - */ - setInteractive: function (hitArea, hitAreaCallback, dropZone) - { - this.scene.sys.input.enable(this, hitArea, hitAreaCallback, dropZone); - - return this; - }, - - /** - * If this Game Object has previously been enabled for input, this will disable it. - * - * An object that is disabled for input stops processing or being considered for - * input events, but can be turned back on again at any time by simply calling - * `setInteractive()` with no arguments provided. - * - * If want to completely remove interaction from this Game Object then use `removeInteractive` instead. - * - * @method Phaser.GameObjects.GameObject#disableInteractive - * @since 3.7.0 - * - * @return {this} This GameObject. - */ - disableInteractive: function () - { - this.scene.sys.input.disable(this); - - return this; - }, - - /** - * If this Game Object has previously been enabled for input, this will queue it - * for removal, causing it to no longer be interactive. The removal happens on - * the next game step, it is not immediate. - * - * The Interactive Object that was assigned to this Game Object will be destroyed, - * removed from the Input Manager and cleared from this Game Object. - * - * If you wish to re-enable this Game Object at a later date you will need to - * re-create its InteractiveObject by calling `setInteractive` again. - * - * If you wish to only temporarily stop an object from receiving input then use - * `disableInteractive` instead, as that toggles the interactive state, where-as - * this erases it completely. - * - * If you wish to resize a hit area, don't remove and then set it as being - * interactive. Instead, access the hitarea object directly and resize the shape - * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the - * shape is a Rectangle, which it is by default.) - * - * @method Phaser.GameObjects.GameObject#removeInteractive - * @since 3.7.0 - * - * @return {this} This GameObject. - */ - removeInteractive: function () - { - this.scene.sys.input.clear(this); - - this.input = undefined; - - return this; - }, - - /** - * This callback is invoked when this Game Object is added to a Scene. - * - * Can be overriden by custom Game Objects, but be aware of some Game Objects that - * will use this, such as Sprites, to add themselves into the Update List. - * - * You can also listen for the `ADDED_TO_SCENE` event from this Game Object. - * - * @method Phaser.GameObjects.GameObject#addedToScene - * @since 3.50.0 - */ - addedToScene: function () - { - }, - - /** - * This callback is invoked when this Game Object is removed from a Scene. - * - * Can be overriden by custom Game Objects, but be aware of some Game Objects that - * will use this, such as Sprites, to removed themselves from the Update List. - * - * You can also listen for the `REMOVED_FROM_SCENE` event from this Game Object. - * - * @method Phaser.GameObjects.GameObject#removedFromScene - * @since 3.50.0 - */ - removedFromScene: function () - { - }, - - /** - * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. - * - * @method Phaser.GameObjects.GameObject#update - * @since 3.0.0 - * - * @param {...*} [args] - args - */ - update: function () - { - }, - - /** - * Returns a JSON representation of the Game Object. - * - * @method Phaser.GameObjects.GameObject#toJSON - * @since 3.0.0 - * - * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. - */ - toJSON: function () - { - return ComponentsToJSON(this); - }, - - /** - * Compares the renderMask with the renderFlags to see if this Game Object will render or not. - * Also checks the Game Object against the given Cameras exclusion list. - * - * @method Phaser.GameObjects.GameObject#willRender - * @since 3.0.0 - * - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object. - * - * @return {boolean} True if the Game Object should be rendered, otherwise false. - */ - willRender: function (camera) - { - var listWillRender = (this.displayList && this.displayList.active) ? this.displayList.willRender(camera) : true; - - return !(!listWillRender || GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); - }, - - /** - * Returns an array containing the display list index of either this Game Object, or if it has one, - * its parent Container. It then iterates up through all of the parent containers until it hits the - * root of the display list (which is index 0 in the returned array). - * - * Used internally by the InputPlugin but also useful if you wish to find out the display depth of - * this Game Object and all of its ancestors. - * - * @method Phaser.GameObjects.GameObject#getIndexList - * @since 3.4.0 - * - * @return {number[]} An array of display list position indexes. - */ - getIndexList: function () - { - // eslint-disable-next-line consistent-this - var child = this; - var parent = this.parentContainer; - - var indexes = []; - - while (parent) - { - indexes.unshift(parent.getIndex(child)); - - child = parent; - - if (!parent.parentContainer) - { - break; - } - else - { - parent = parent.parentContainer; - } - } - - if (this.displayList) - { - indexes.unshift(this.displayList.getIndex(child)); - } - else - { - indexes.unshift(this.scene.sys.displayList.getIndex(child)); - } - - return indexes; - }, - - /** - * Adds this Game Object to the given Display List. - * - * If no Display List is specified, it will default to the Display List owned by the Scene to which - * this Game Object belongs. - * - * A Game Object can only exist on one Display List at any given time, but may move freely between them. - * - * If this Game Object is already on another Display List when this method is called, it will first - * be removed from it, before being added to the new list. - * - * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. - * - * If a Game Object isn't on any display list, it will not be rendered. If you just wish to temporarly - * disable it from rendering, consider using the `setVisible` method, instead. - * - * @method Phaser.GameObjects.GameObject#addToDisplayList - * @fires Phaser.Scenes.Events#ADDED_TO_SCENE - * @fires Phaser.GameObjects.Events#ADDED_TO_SCENE - * @since 3.53.0 - * - * @param {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} [displayList] - The Display List to add to. Defaults to the Scene Display List. - * - * @return {this} This Game Object. - */ - addToDisplayList: function (displayList) - { - if (displayList === undefined) { displayList = this.scene.sys.displayList; } - - if (this.displayList && this.displayList !== displayList) - { - this.removeFromDisplayList(); - } - - // Don't repeat if it's already on this list - if (!displayList.exists(this)) - { - this.displayList = displayList; - - displayList.add(this, true); - - displayList.queueDepthSort(); - - this.emit(Events.ADDED_TO_SCENE, this, this.scene); - - displayList.events.emit(SceneEvents.ADDED_TO_SCENE, this, this.scene); - } - - return this; - }, - - /** - * Adds this Game Object to the Update List belonging to the Scene. - * - * When a Game Object is added to the Update List it will have its `preUpdate` method called - * every game frame. This method is passed two parameters: `delta` and `time`. - * - * If you wish to run your own logic within `preUpdate` then you should always call - * `preUpdate.super(delta, time)` within it, or it may fail to process required operations, - * such as Sprite animations. - * - * @method Phaser.GameObjects.GameObject#addToUpdateList - * @since 3.53.0 - * - * @return {this} This Game Object. - */ - addToUpdateList: function () - { - if (this.scene && this.preUpdate) - { - this.scene.sys.updateList.add(this); - } - - return this; - }, - - /** - * Removes this Game Object from the Display List it is currently on. - * - * A Game Object can only exist on one Display List at any given time, but may move freely removed - * and added back at a later stage. - * - * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. - * - * If a Game Object isn't on any Display List, it will not be rendered. If you just wish to temporarly - * disable it from rendering, consider using the `setVisible` method, instead. - * - * @method Phaser.GameObjects.GameObject#removeFromDisplayList - * @fires Phaser.Scenes.Events#REMOVED_FROM_SCENE - * @fires Phaser.GameObjects.Events#REMOVED_FROM_SCENE - * @since 3.53.0 - * - * @return {this} This Game Object. - */ - removeFromDisplayList: function () - { - var displayList = this.displayList || this.scene.sys.displayList; - - if (displayList && displayList.exists(this)) - { - displayList.remove(this, true); - - displayList.queueDepthSort(); - - this.displayList = null; - - this.emit(Events.REMOVED_FROM_SCENE, this, this.scene); - - displayList.events.emit(SceneEvents.REMOVED_FROM_SCENE, this, this.scene); - } - - return this; - }, - - /** - * Removes this Game Object from the Scene's Update List. - * - * When a Game Object is on the Update List, it will have its `preUpdate` method called - * every game frame. Calling this method will remove it from the list, preventing this. - * - * Removing a Game Object from the Update List will stop most internal functions working. - * For example, removing a Sprite from the Update List will prevent it from being able to - * run animations. - * - * @method Phaser.GameObjects.GameObject#removeFromUpdateList - * @since 3.53.0 - * - * @return {this} This Game Object. - */ - removeFromUpdateList: function () - { - if (this.scene && this.preUpdate) - { - this.scene.sys.updateList.remove(this); - } - - return this; - }, - - /** - * Destroys this Game Object removing it from the Display List and Update List and - * severing all ties to parent resources. - * - * Also removes itself from the Input Manager and Physics Manager if previously enabled. - * - * Use this to remove a Game Object from your game if you don't ever plan to use it again. - * As long as no reference to it exists within your own code it should become free for - * garbage collection by the browser. - * - * If you just want to temporarily disable an object then look at using the - * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. - * - * @method Phaser.GameObjects.GameObject#destroy - * @fires Phaser.GameObjects.Events#DESTROY - * @since 3.0.0 - * - * @param {boolean} [fromScene=false] - `True` if this Game Object is being destroyed by the Scene, `false` if not. - */ - destroy: function (fromScene) - { - // This Game Object has already been destroyed - if (!this.scene || this.ignoreDestroy) - { - return; - } - - if (fromScene === undefined) { fromScene = false; } - - if (this.preDestroy) - { - this.preDestroy.call(this); - } - - this.emit(Events.DESTROY, this, fromScene); - - this.removeAllListeners(); - - if (this.postPipelines) - { - this.resetPostPipeline(true); - } - - this.removeFromDisplayList(); - this.removeFromUpdateList(); - - if (this.input) - { - this.scene.sys.input.clear(this); - - this.input = undefined; - } - - if (this.data) - { - this.data.destroy(); - - this.data = undefined; - } - - if (this.body) - { - this.body.destroy(); - - this.body = undefined; - } - - this.active = false; - this.visible = false; - - this.scene = undefined; - this.parentContainer = undefined; - } - -}); - -/** - * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. - * - * @constant {number} RENDER_MASK - * @memberof Phaser.GameObjects.GameObject - * @default - */ -GameObject.RENDER_MASK = 15; - -module.exports = GameObject; - - -/***/ }), -/* 59 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Build a JSON representation of the given Game Object. - * - * This is typically extended further by Game Object specific implementations. - * - * @method Phaser.GameObjects.Components.ToJSON - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON. - * - * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. - */ -var ToJSON = function (gameObject) -{ - var out = { - name: gameObject.name, - type: gameObject.type, - x: gameObject.x, - y: gameObject.y, - depth: gameObject.depth, - scale: { - x: gameObject.scaleX, - y: gameObject.scaleY - }, - origin: { - x: gameObject.originX, - y: gameObject.originY - }, - flipX: gameObject.flipX, - flipY: gameObject.flipY, - rotation: gameObject.rotation, - alpha: gameObject.alpha, - visible: gameObject.visible, - blendMode: gameObject.blendMode, - textureKey: '', - frameKey: '', - data: {} - }; - - if (gameObject.texture) - { - out.textureKey = gameObject.texture.key; - out.frameKey = gameObject.frame.name; - } - - return out; -}; - -module.exports = ToJSON; - - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.GameObjects.Events - */ - -module.exports = { - - ADDED_TO_SCENE: __webpack_require__(234), - DESTROY: __webpack_require__(235), - REMOVED_FROM_SCENE: __webpack_require__(236), - VIDEO_COMPLETE: __webpack_require__(237), - VIDEO_CREATED: __webpack_require__(238), - VIDEO_ERROR: __webpack_require__(239), - VIDEO_LOOP: __webpack_require__(240), - VIDEO_PLAY: __webpack_require__(241), - VIDEO_SEEKED: __webpack_require__(242), - VIDEO_SEEKING: __webpack_require__(243), - VIDEO_STOP: __webpack_require__(244), - VIDEO_TIMEOUT: __webpack_require__(245), - VIDEO_UNLOCKED: __webpack_require__(246) - -}; - - -/***/ }), -/* 61 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Transposes the elements of the given matrix (array of arrays). - * - * The transpose of a matrix is a new matrix whose rows are the columns of the original. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.TransposeMatrix - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [array,$return] - * - * @param {T[][]} [array] - The array matrix to transpose. - * - * @return {T[][]} A new array matrix which is a transposed version of the given array. - */ -var TransposeMatrix = function (array) -{ - var sourceRowCount = array.length; - var sourceColCount = array[0].length; - - var result = new Array(sourceColCount); - - for (var i = 0; i < sourceColCount; i++) - { - result[i] = new Array(sourceRowCount); - - for (var j = sourceRowCount - 1; j > -1; j--) - { - result[i][j] = array[j][i]; - } - } - - return result; -}; - -module.exports = TransposeMatrix; - - -/***/ }), -/* 62 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the start of the array to the end, shifting all items in the process. - * The "rotation" happens to the left. - * - * @function Phaser.Utils.Array.RotateLeft - * @since 3.0.0 - * - * @param {array} array - The array to shift to the left. This array is modified in place. - * @param {number} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateLeft = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.shift(); - array.push(element); - } - - return element; -}; - -module.exports = RotateLeft; - - -/***/ }), -/* 63 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the end of the array to the start, shifting all items in the process. - * The "rotation" happens to the right. - * - * @function Phaser.Utils.Array.RotateRight - * @since 3.0.0 - * - * @param {array} array - The array to shift to the right. This array is modified in place. - * @param {number} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateRight = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.pop(); - array.unshift(element); - } - - return element; -}; - -module.exports = RotateRight; - - -/***/ }), -/* 64 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Shuffles the contents of the given array using the Fisher-Yates implementation. - * - * The original array is modified directly and returned. - * - * @function Phaser.Utils.Array.Shuffle - * @since 3.0.0 - * - * @generic T - * @genericUse {T[]} - [array,$return] - * - * @param {T[]} array - The array to shuffle. This array is modified in place. - * - * @return {T[]} The shuffled array. - */ -var Shuffle = function (array) -{ - for (var i = array.length - 1; i > 0; i--) - { - var j = Math.floor(Math.random() * (i + 1)); - var temp = array[i]; - array[i] = array[j]; - array[j] = temp; - } - - return array; -}; - -module.exports = Shuffle; - - -/***/ }), -/* 65 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(300); -var Smoothing = __webpack_require__(302); - -// The pool into which the canvas elements are placed. -var pool = []; - -// Automatically apply smoothing(false) to created Canvas elements -var _disableContextSmoothing = false; - -/** - * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. - * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, - * which is useless for some of the Phaser pipelines / renderer. - * - * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. - * Which means all instances of Phaser Games on the same page can share the one single pool. - * - * @namespace Phaser.Display.Canvas.CanvasPool - * @since 3.0.0 - */ -var CanvasPool = function () -{ - /** - * Creates a new Canvas DOM element, or pulls one from the pool if free. - * - * @function Phaser.Display.Canvas.CanvasPool.create - * @since 3.0.0 - * - * @param {*} parent - The parent of the Canvas object. - * @param {number} [width=1] - The width of the Canvas. - * @param {number} [height=1] - The height of the Canvas. - * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. - * @param {boolean} [selfParent=false] - Use the generated Canvas element as the parent? - * - * @return {HTMLCanvasElement} The canvas element that was created or pulled from the pool - */ - var create = function (parent, width, height, canvasType, selfParent) - { - if (width === undefined) { width = 1; } - if (height === undefined) { height = 1; } - if (canvasType === undefined) { canvasType = CONST.CANVAS; } - if (selfParent === undefined) { selfParent = false; } - - var canvas; - var container = first(canvasType); - - if (container === null) - { - container = { - parent: parent, - canvas: document.createElement('canvas'), - type: canvasType - }; - - if (canvasType === CONST.CANVAS) - { - pool.push(container); - } - - canvas = container.canvas; - } - else - { - container.parent = parent; - - canvas = container.canvas; - } - - if (selfParent) - { - container.parent = canvas; - } - - canvas.width = width; - canvas.height = height; - - if (_disableContextSmoothing && canvasType === CONST.CANVAS) - { - Smoothing.disable(canvas.getContext('2d')); - } - - return canvas; - }; - - /** - * Creates a new Canvas DOM element, or pulls one from the pool if free. - * - * @function Phaser.Display.Canvas.CanvasPool.create2D - * @since 3.0.0 - * - * @param {*} parent - The parent of the Canvas object. - * @param {number} [width=1] - The width of the Canvas. - * @param {number} [height=1] - The height of the Canvas. - * - * @return {HTMLCanvasElement} The created canvas. - */ - var create2D = function (parent, width, height) - { - return create(parent, width, height, CONST.CANVAS); - }; - - /** - * Creates a new Canvas DOM element, or pulls one from the pool if free. - * - * @function Phaser.Display.Canvas.CanvasPool.createWebGL - * @since 3.0.0 - * - * @param {*} parent - The parent of the Canvas object. - * @param {number} [width=1] - The width of the Canvas. - * @param {number} [height=1] - The height of the Canvas. - * - * @return {HTMLCanvasElement} The created WebGL canvas. - */ - var createWebGL = function (parent, width, height) - { - return create(parent, width, height, CONST.WEBGL); - }; - - /** - * Gets the first free canvas index from the pool. - * - * @function Phaser.Display.Canvas.CanvasPool.first - * @since 3.0.0 - * - * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. - * - * @return {HTMLCanvasElement} The first free canvas, or `null` if a WebGL canvas was requested or if the pool doesn't have free canvases. - */ - var first = function (canvasType) - { - if (canvasType === undefined) { canvasType = CONST.CANVAS; } - - if (canvasType === CONST.WEBGL) - { - return null; - } - - for (var i = 0; i < pool.length; i++) - { - var container = pool[i]; - - if (!container.parent && container.type === canvasType) - { - return container; - } - } - - return null; - }; - - /** - * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use. - * The canvas has its width and height set to 1, and its parent attribute nulled. - * - * @function Phaser.Display.Canvas.CanvasPool.remove - * @since 3.0.0 - * - * @param {*} parent - The canvas or the parent of the canvas to free. - */ - var remove = function (parent) - { - // Check to see if the parent is a canvas object - var isCanvas = parent instanceof HTMLCanvasElement; - - pool.forEach(function (container) - { - if ((isCanvas && container.canvas === parent) || (!isCanvas && container.parent === parent)) - { - container.parent = null; - container.canvas.width = 1; - container.canvas.height = 1; - } - }); - }; - - /** - * Gets the total number of used canvas elements in the pool. - * - * @function Phaser.Display.Canvas.CanvasPool.total - * @since 3.0.0 - * - * @return {number} The number of used canvases. - */ - var total = function () - { - var c = 0; - - pool.forEach(function (container) - { - if (container.parent) - { - c++; - } - }); - - return c; - }; - - /** - * Gets the total number of free canvas elements in the pool. - * - * @function Phaser.Display.Canvas.CanvasPool.free - * @since 3.0.0 - * - * @return {number} The number of free canvases. - */ - var free = function () - { - return pool.length - total(); - }; - - /** - * Disable context smoothing on any new Canvas element created. - * - * @function Phaser.Display.Canvas.CanvasPool.disableSmoothing - * @since 3.0.0 - */ - var disableSmoothing = function () - { - _disableContextSmoothing = true; - }; - - /** - * Enable context smoothing on any new Canvas element created. - * - * @function Phaser.Display.Canvas.CanvasPool.enableSmoothing - * @since 3.0.0 - */ - var enableSmoothing = function () - { - _disableContextSmoothing = false; - }; - - return { - create2D: create2D, - create: create, - createWebGL: createWebGL, - disableSmoothing: disableSmoothing, - enableSmoothing: enableSmoothing, - first: first, - free: free, - pool: pool, - remove: remove, - total: total - }; -}; - -// If we export the called function here, it'll only be invoked once (not every time it's required). -module.exports = CanvasPool(); - - -/***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Perimeter = __webpack_require__(67); -var Point = __webpack_require__(11); - -/** - * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * - * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * - * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. - * - * @function Phaser.Geom.Rectangle.GetPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [out,$return] - * - * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle to get the perimeter point from. - * @param {number} position - The normalized distance into the Rectangle's perimeter to return. - * @param {(Phaser.Geom.Point|object)} [out] - An object to update with the `x` and `y` coordinates of the point. - * - * @return {Phaser.Geom.Point} The updated `output` object, or a new Point if no `output` object was given. - */ -var GetPoint = function (rectangle, position, out) -{ - if (out === undefined) { out = new Point(); } - - if (position <= 0 || position >= 1) - { - out.x = rectangle.x; - out.y = rectangle.y; - - return out; - } - - var p = Perimeter(rectangle) * position; - - if (position > 0.5) - { - p -= (rectangle.width + rectangle.height); - - if (p <= rectangle.width) - { - // Face 3 - out.x = rectangle.right - p; - out.y = rectangle.bottom; - } - else - { - // Face 4 - out.x = rectangle.x; - out.y = rectangle.bottom - (p - rectangle.width); - } - } - else if (p <= rectangle.width) - { - // Face 1 - out.x = rectangle.x + p; - out.y = rectangle.y; - } - else - { - // Face 2 - out.x = rectangle.right; - out.y = rectangle.y + (p - rectangle.width); - } - - return out; -}; - -module.exports = GetPoint; - - -/***/ }), -/* 67 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates the perimeter of a Rectangle. - * - * @function Phaser.Geom.Rectangle.Perimeter - * @since 3.0.0 - * - * @param {Phaser.Geom.Rectangle} rect - The Rectangle to use. - * - * @return {number} The perimeter of the Rectangle, equal to `(width * 2) + (height * 2)`. - */ -var Perimeter = function (rect) -{ - return 2 * (rect.width + rect.height); -}; - -module.exports = Perimeter; - - -/***/ }), -/* 68 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Clamp = __webpack_require__(4); -var Extend = __webpack_require__(17); - -/** - * @classdesc - * A Frame is a section of a Texture. - * - * @class Frame - * @memberof Phaser.Textures - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Textures.Texture} texture - The Texture this Frame is a part of. - * @param {(number|string)} name - The name of this Frame. The name is unique within the Texture. - * @param {number} sourceIndex - The index of the TextureSource that this Frame is a part of. - * @param {number} x - The x coordinate of the top-left of this Frame. - * @param {number} y - The y coordinate of the top-left of this Frame. - * @param {number} width - The width of this Frame. - * @param {number} height - The height of this Frame. - */ -var Frame = new Class({ - - initialize: - - function Frame (texture, name, sourceIndex, x, y, width, height) - { - /** - * The Texture this Frame is a part of. - * - * @name Phaser.Textures.Frame#texture - * @type {Phaser.Textures.Texture} - * @since 3.0.0 - */ - this.texture = texture; - - /** - * The name of this Frame. - * The name is unique within the Texture. - * - * @name Phaser.Textures.Frame#name - * @type {string} - * @since 3.0.0 - */ - this.name = name; - - /** - * The TextureSource this Frame is part of. - * - * @name Phaser.Textures.Frame#source - * @type {Phaser.Textures.TextureSource} - * @since 3.0.0 - */ - this.source = texture.source[sourceIndex]; - - /** - * The index of the TextureSource in the Texture sources array. - * - * @name Phaser.Textures.Frame#sourceIndex - * @type {number} - * @since 3.0.0 - */ - this.sourceIndex = sourceIndex; - - /** - * A reference to the Texture Source WebGL Texture that this Frame is using. - * - * @name Phaser.Textures.Frame#glTexture - * @type {?WebGLTexture} - * @default null - * @since 3.11.0 - */ - this.glTexture = this.source.glTexture; - - /** - * X position within the source image to cut from. - * - * @name Phaser.Textures.Frame#cutX - * @type {number} - * @since 3.0.0 - */ - this.cutX; - - /** - * Y position within the source image to cut from. - * - * @name Phaser.Textures.Frame#cutY - * @type {number} - * @since 3.0.0 - */ - this.cutY; - - /** - * The width of the area in the source image to cut. - * - * @name Phaser.Textures.Frame#cutWidth - * @type {number} - * @since 3.0.0 - */ - this.cutWidth; - - /** - * The height of the area in the source image to cut. - * - * @name Phaser.Textures.Frame#cutHeight - * @type {number} - * @since 3.0.0 - */ - this.cutHeight; - - /** - * The X rendering offset of this Frame, taking trim into account. - * - * @name Phaser.Textures.Frame#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The Y rendering offset of this Frame, taking trim into account. - * - * @name Phaser.Textures.Frame#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - /** - * The rendering width of this Frame, taking trim into account. - * - * @name Phaser.Textures.Frame#width - * @type {number} - * @since 3.0.0 - */ - this.width; - - /** - * The rendering height of this Frame, taking trim into account. - * - * @name Phaser.Textures.Frame#height - * @type {number} - * @since 3.0.0 - */ - this.height; - - /** - * Half the width, floored. - * Precalculated for the renderer. - * - * @name Phaser.Textures.Frame#halfWidth - * @type {number} - * @since 3.0.0 - */ - this.halfWidth; - - /** - * Half the height, floored. - * Precalculated for the renderer. - * - * @name Phaser.Textures.Frame#halfHeight - * @type {number} - * @since 3.0.0 - */ - this.halfHeight; - - /** - * The x center of this frame, floored. - * - * @name Phaser.Textures.Frame#centerX - * @type {number} - * @since 3.0.0 - */ - this.centerX; - - /** - * The y center of this frame, floored. - * - * @name Phaser.Textures.Frame#centerY - * @type {number} - * @since 3.0.0 - */ - this.centerY; - - /** - * The horizontal pivot point of this Frame. - * - * @name Phaser.Textures.Frame#pivotX - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.pivotX = 0; - - /** - * The vertical pivot point of this Frame. - * - * @name Phaser.Textures.Frame#pivotY - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.pivotY = 0; - - /** - * Does this Frame have a custom pivot point? - * - * @name Phaser.Textures.Frame#customPivot - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.customPivot = false; - - /** - * **CURRENTLY UNSUPPORTED** - * - * Is this frame is rotated or not in the Texture? - * Rotation allows you to use rotated frames in texture atlas packing. - * It has nothing to do with Sprite rotation. - * - * @name Phaser.Textures.Frame#rotated - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.rotated = false; - - /** - * Over-rides the Renderer setting. - * -1 = use Renderer Setting - * 0 = No rounding - * 1 = Round - * - * @name Phaser.Textures.Frame#autoRound - * @type {number} - * @default -1 - * @since 3.0.0 - */ - this.autoRound = -1; - - /** - * Any Frame specific custom data can be stored here. - * - * @name Phaser.Textures.Frame#customData - * @type {object} - * @since 3.0.0 - */ - this.customData = {}; - - /** - * WebGL UV u0 value. - * - * @name Phaser.Textures.Frame#u0 - * @type {number} - * @default 0 - * @since 3.11.0 - */ - this.u0 = 0; - - /** - * WebGL UV v0 value. - * - * @name Phaser.Textures.Frame#v0 - * @type {number} - * @default 0 - * @since 3.11.0 - */ - this.v0 = 0; - - /** - * WebGL UV u1 value. - * - * @name Phaser.Textures.Frame#u1 - * @type {number} - * @default 0 - * @since 3.11.0 - */ - this.u1 = 0; - - /** - * WebGL UV v1 value. - * - * @name Phaser.Textures.Frame#v1 - * @type {number} - * @default 0 - * @since 3.11.0 - */ - this.v1 = 0; - - /** - * The un-modified source frame, trim and UV data. - * - * @name Phaser.Textures.Frame#data - * @type {object} - * @private - * @since 3.0.0 - */ - this.data = { - cut: { - x: 0, - y: 0, - w: 0, - h: 0, - r: 0, - b: 0 - }, - trim: false, - sourceSize: { - w: 0, - h: 0 - }, - spriteSourceSize: { - x: 0, - y: 0, - w: 0, - h: 0, - r: 0, - b: 0 - }, - radius: 0, - drawImage: { - x: 0, - y: 0, - width: 0, - height: 0 - } - }; - - this.setSize(width, height, x, y); - }, - - /** - * Sets the width, height, x and y of this Frame. - * - * This is called automatically by the constructor - * and should rarely be changed on-the-fly. - * - * @method Phaser.Textures.Frame#setSize - * @since 3.7.0 - * - * @param {number} width - The width of the frame before being trimmed. - * @param {number} height - The height of the frame before being trimmed. - * @param {number} [x=0] - The x coordinate of the top-left of this Frame. - * @param {number} [y=0] - The y coordinate of the top-left of this Frame. - * - * @return {this} This Frame object. - */ - setSize: function (width, height, x, y) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - - this.cutX = x; - this.cutY = y; - this.cutWidth = width; - this.cutHeight = height; - - this.width = width; - this.height = height; - - this.halfWidth = Math.floor(width * 0.5); - this.halfHeight = Math.floor(height * 0.5); - - this.centerX = Math.floor(width / 2); - this.centerY = Math.floor(height / 2); - - var data = this.data; - var cut = data.cut; - - cut.x = x; - cut.y = y; - cut.w = width; - cut.h = height; - cut.r = x + width; - cut.b = y + height; - - data.sourceSize.w = width; - data.sourceSize.h = height; - - data.spriteSourceSize.w = width; - data.spriteSourceSize.h = height; - - data.radius = 0.5 * Math.sqrt(width * width + height * height); - - var drawImage = data.drawImage; - - drawImage.x = x; - drawImage.y = y; - drawImage.width = width; - drawImage.height = height; - - return this.updateUVs(); - }, - - /** - * If the frame was trimmed when added to the Texture Atlas, this records the trim and source data. - * - * @method Phaser.Textures.Frame#setTrim - * @since 3.0.0 - * - * @param {number} actualWidth - The width of the frame before being trimmed. - * @param {number} actualHeight - The height of the frame before being trimmed. - * @param {number} destX - The destination X position of the trimmed frame for display. - * @param {number} destY - The destination Y position of the trimmed frame for display. - * @param {number} destWidth - The destination width of the trimmed frame for display. - * @param {number} destHeight - The destination height of the trimmed frame for display. - * - * @return {this} This Frame object. - */ - setTrim: function (actualWidth, actualHeight, destX, destY, destWidth, destHeight) - { - var data = this.data; - var ss = data.spriteSourceSize; - - // Store actual values - - data.trim = true; - - data.sourceSize.w = actualWidth; - data.sourceSize.h = actualHeight; - - ss.x = destX; - ss.y = destY; - ss.w = destWidth; - ss.h = destHeight; - ss.r = destX + destWidth; - ss.b = destY + destHeight; - - // Adjust properties - this.x = destX; - this.y = destY; - - this.width = destWidth; - this.height = destHeight; - - this.halfWidth = destWidth * 0.5; - this.halfHeight = destHeight * 0.5; - - this.centerX = Math.floor(destWidth / 2); - this.centerY = Math.floor(destHeight / 2); - - return this.updateUVs(); - }, - - /** - * Takes a crop data object and, based on the rectangular region given, calculates the - * required UV coordinates in order to crop this Frame for WebGL and Canvas rendering. - * - * This is called directly by the Game Object Texture Components `setCrop` method. - * Please use that method to crop a Game Object. - * - * @method Phaser.Textures.Frame#setCropUVs - * @since 3.11.0 - * - * @param {object} crop - The crop data object. This is the `GameObject._crop` property. - * @param {number} x - The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. - * @param {number} y - The y coordinate to start the crop from. Cannot be negative or exceed the Frame height. - * @param {number} width - The width of the crop rectangle. Cannot exceed the Frame width. - * @param {number} height - The height of the crop rectangle. Cannot exceed the Frame height. - * @param {boolean} flipX - Does the parent Game Object have flipX set? - * @param {boolean} flipY - Does the parent Game Object have flipY set? - * - * @return {object} The updated crop data object. - */ - setCropUVs: function (crop, x, y, width, height, flipX, flipY) - { - // Clamp the input values - - var cx = this.cutX; - var cy = this.cutY; - var cw = this.cutWidth; - var ch = this.cutHeight; - var rw = this.realWidth; - var rh = this.realHeight; - - x = Clamp(x, 0, rw); - y = Clamp(y, 0, rh); - - width = Clamp(width, 0, rw - x); - height = Clamp(height, 0, rh - y); - - var ox = cx + x; - var oy = cy + y; - var ow = width; - var oh = height; - - var data = this.data; - - if (data.trim) - { - var ss = data.spriteSourceSize; - - // Need to check for intersection between the cut area and the crop area - // If there is none, we set UV to be empty, otherwise set it to be the intersection area - - width = Clamp(width, 0, cw - x); - height = Clamp(height, 0, ch - y); - - var cropRight = x + width; - var cropBottom = y + height; - - var intersects = !(ss.r < x || ss.b < y || ss.x > cropRight || ss.y > cropBottom); - - if (intersects) - { - var ix = Math.max(ss.x, x); - var iy = Math.max(ss.y, y); - var iw = Math.min(ss.r, cropRight) - ix; - var ih = Math.min(ss.b, cropBottom) - iy; - - ow = iw; - oh = ih; - - if (flipX) - { - ox = cx + (cw - (ix - ss.x) - iw); - } - else - { - ox = cx + (ix - ss.x); - } - - if (flipY) - { - oy = cy + (ch - (iy - ss.y) - ih); - } - else - { - oy = cy + (iy - ss.y); - } - - x = ix; - y = iy; - - width = iw; - height = ih; - } - else - { - ox = 0; - oy = 0; - ow = 0; - oh = 0; - } - } - else - { - if (flipX) - { - ox = cx + (cw - x - width); - } - - if (flipY) - { - oy = cy + (ch - y - height); - } - } - - var tw = this.source.width; - var th = this.source.height; - - // Map the given coordinates into UV space, clamping to the 0-1 range. - - crop.u0 = Math.max(0, ox / tw); - crop.v0 = Math.max(0, oy / th); - crop.u1 = Math.min(1, (ox + ow) / tw); - crop.v1 = Math.min(1, (oy + oh) / th); - - crop.x = x; - crop.y = y; - - crop.cx = ox; - crop.cy = oy; - crop.cw = ow; - crop.ch = oh; - - crop.width = width; - crop.height = height; - - crop.flipX = flipX; - crop.flipY = flipY; - - return crop; - }, - - /** - * Takes a crop data object and recalculates the UVs based on the dimensions inside the crop object. - * Called automatically by `setFrame`. - * - * @method Phaser.Textures.Frame#updateCropUVs - * @since 3.11.0 - * - * @param {object} crop - The crop data object. This is the `GameObject._crop` property. - * @param {boolean} flipX - Does the parent Game Object have flipX set? - * @param {boolean} flipY - Does the parent Game Object have flipY set? - * - * @return {object} The updated crop data object. - */ - updateCropUVs: function (crop, flipX, flipY) - { - return this.setCropUVs(crop, crop.x, crop.y, crop.width, crop.height, flipX, flipY); - }, - - /** - * Directly sets the canvas and WebGL UV data for this frame. - * - * Use this if you need to override the values that are generated automatically - * when the Frame is created. - * - * @method Phaser.Textures.Frame#setUVs - * @since 3.50.0 - * - * @param {number} width - Width of this frame for the Canvas data. - * @param {number} height - Height of this frame for the Canvas data. - * @param {number} u0 - UV u0 value. - * @param {number} v0 - UV v0 value. - * @param {number} u1 - UV u1 value. - * @param {number} v1 - UV v1 value. - * - * @return {this} This Frame object. - */ - setUVs: function (width, height, u0, v0, u1, v1) - { - // Canvas data - - var cd = this.data.drawImage; - - cd.width = width; - cd.height = height; - - // WebGL data - - this.u0 = u0; - this.v0 = v0; - - this.u1 = u1; - this.v1 = v1; - - return this; - }, - - /** - * Updates the internal WebGL UV cache and the drawImage cache. - * - * @method Phaser.Textures.Frame#updateUVs - * @since 3.0.0 - * - * @return {this} This Frame object. - */ - updateUVs: function () - { - var cx = this.cutX; - var cy = this.cutY; - var cw = this.cutWidth; - var ch = this.cutHeight; - - // Canvas data - - var cd = this.data.drawImage; - - cd.width = cw; - cd.height = ch; - - // WebGL data - - var tw = this.source.width; - var th = this.source.height; - - this.u0 = cx / tw; - this.v0 = cy / th; - - this.u1 = (cx + cw) / tw; - this.v1 = (cy + ch) / th; - - return this; - }, - - /** - * Updates the internal WebGL UV cache. - * - * @method Phaser.Textures.Frame#updateUVsInverted - * @since 3.0.0 - * - * @return {this} This Frame object. - */ - updateUVsInverted: function () - { - var tw = this.source.width; - var th = this.source.height; - - this.u0 = (this.cutX + this.cutHeight) / tw; - this.v0 = this.cutY / th; - - this.u1 = this.cutX / tw; - this.v1 = (this.cutY + this.cutWidth) / th; - - return this; - }, - - /** - * Clones this Frame into a new Frame object. - * - * @method Phaser.Textures.Frame#clone - * @since 3.0.0 - * - * @return {Phaser.Textures.Frame} A clone of this Frame. - */ - clone: function () - { - var clone = new Frame(this.texture, this.name, this.sourceIndex); - - clone.cutX = this.cutX; - clone.cutY = this.cutY; - clone.cutWidth = this.cutWidth; - clone.cutHeight = this.cutHeight; - - clone.x = this.x; - clone.y = this.y; - - clone.width = this.width; - clone.height = this.height; - - clone.halfWidth = this.halfWidth; - clone.halfHeight = this.halfHeight; - - clone.centerX = this.centerX; - clone.centerY = this.centerY; - - clone.rotated = this.rotated; - - clone.data = Extend(true, clone.data, this.data); - - clone.updateUVs(); - - return clone; - }, - - /** - * Destroys this Frame by nulling its reference to the parent Texture and and data objects. - * - * @method Phaser.Textures.Frame#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.source = null; - this.texture = null; - this.glTexture = null; - this.customData = null; - this.data = null; - }, - - /** - * The width of the Frame in its un-trimmed, un-padded state, as prepared in the art package, - * before being packed. - * - * @name Phaser.Textures.Frame#realWidth - * @type {number} - * @readonly - * @since 3.0.0 - */ - realWidth: { - - get: function () - { - return this.data.sourceSize.w; - } - - }, - - /** - * The height of the Frame in its un-trimmed, un-padded state, as prepared in the art package, - * before being packed. - * - * @name Phaser.Textures.Frame#realHeight - * @type {number} - * @readonly - * @since 3.0.0 - */ - realHeight: { - - get: function () - { - return this.data.sourceSize.h; - } - - }, - - /** - * The radius of the Frame (derived from sqrt(w * w + h * h) / 2) - * - * @name Phaser.Textures.Frame#radius - * @type {number} - * @readonly - * @since 3.0.0 - */ - radius: { - - get: function () - { - return this.data.radius; - } - - }, - - /** - * Is the Frame trimmed or not? - * - * @name Phaser.Textures.Frame#trimmed - * @type {boolean} - * @readonly - * @since 3.0.0 - */ - trimmed: { - - get: function () - { - return this.data.trim; - } - - }, - - /** - * The Canvas drawImage data object. - * - * @name Phaser.Textures.Frame#canvasData - * @type {object} - * @readonly - * @since 3.0.0 - */ - canvasData: { - - get: function () - { - return this.data.drawImage; - } - - } - -}); - -module.exports = Frame; - - -/***/ }), -/* 69 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 3524: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -23653,21 +9905,282 @@ module.exports = Frame; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var BuildGameObject = __webpack_require__(70); -var Class = __webpack_require__(0); -var GetValue = __webpack_require__(7); -var ResizeEvent = __webpack_require__(184); -var ScenePlugin = __webpack_require__(185); -var SpineCanvas = __webpack_require__(46); -var SpineWebgl = __webpack_require__(46); +var Class = __webpack_require__(7473); +var GetFastValue = __webpack_require__(4597); +var ImageFile = __webpack_require__(6732); +var IsPlainObject = __webpack_require__(2482); +var JSONFile = __webpack_require__(704); +var MultiFile = __webpack_require__(3137); +var TextFile = __webpack_require__(1192); + +/** + * @typedef {object} Phaser.Loader.FileTypes.SpineFileConfig + * + * @property {string} key - The key of the file. Must be unique within both the Loader and the Texture Manager. + * @property {string|string[]} [jsonURL] - The absolute or relative URL to load the JSON file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @property {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @property {boolean} [preMultipliedAlpha=false] - Do the textures contain pre-multiplied alpha or not? + * @property {XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. + * @property {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. + */ + +/** + * @classdesc + * A Spine File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#spine method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spine. + * + * @class SpineFile + * @extends Phaser.Loader.MultiFile + * @memberof Phaser.Loader.FileTypes + * @constructor + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Loader.FileTypes.SpineFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [jsonURL] - The absolute or relative URL to load the JSON file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {boolean} [preMultipliedAlpha=false] - Do the textures contain pre-multiplied alpha or not? + * @param {XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. + * @param {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. + */ +var SpineFile = new Class({ + + Extends: MultiFile, + + initialize: + + function SpineFile (loader, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings) + { + var i; + var json; + var atlas; + var files = []; + var cache = loader.cacheManager.custom.spine; + + // atlas can be an array of atlas files, not just a single one + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + + json = new JSONFile(loader, { + key: key, + url: GetFastValue(config, 'jsonURL'), + extension: GetFastValue(config, 'jsonExtension', 'json'), + xhrSettings: GetFastValue(config, 'jsonXhrSettings') + }); + + atlasURL = GetFastValue(config, 'atlasURL'); + preMultipliedAlpha = GetFastValue(config, 'preMultipliedAlpha'); + + if (!Array.isArray(atlasURL)) + { + atlasURL = [ atlasURL ]; + } + + for (i = 0; i < atlasURL.length; i++) + { + atlas = new TextFile(loader, { + key: key + '!' + i, + url: atlasURL[i], + extension: GetFastValue(config, 'atlasExtension', 'atlas'), + xhrSettings: GetFastValue(config, 'atlasXhrSettings') + }); + + atlas.cache = cache; + + files.push(atlas); + } + } + else + { + json = new JSONFile(loader, key, jsonURL, jsonXhrSettings); + + if (!Array.isArray(atlasURL)) + { + atlasURL = [ atlasURL ]; + } + + for (i = 0; i < atlasURL.length; i++) + { + atlas = new TextFile(loader, key + '!' + i, atlasURL[i], atlasXhrSettings); + atlas.cache = cache; + + files.push(atlas); + } + } + + files.unshift(json); + + MultiFile.call(this, loader, 'spine', key, files); + + this.config.preMultipliedAlpha = preMultipliedAlpha; + }, + + /** + * Called by each File when it finishes loading. + * + * @method Phaser.Loader.FileTypes.SpineFile#onFileComplete + * @since 3.19.0 + * + * @param {Phaser.Loader.File} file - The File that has completed processing. + */ + onFileComplete: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.pending--; + + if (file.type === 'text') + { + // Inspect the data for the files to now load + var content = file.data.split('\n'); + + // Extract the textures + var textures = [ content[0] ]; + + for (var t = 0; t < content.length; t++) + { + var line = content[t]; + + if (line.trim() === '' && t < content.length - 1) + { + line = content[t + 1]; + + textures.push(line); + } + } + + var config = this.config; + var loader = this.loader; + + var currentBaseURL = loader.baseURL; + var currentPath = loader.path; + var currentPrefix = loader.prefix; + + var baseURL = GetFastValue(config, 'baseURL', this.baseURL); + var path = GetFastValue(config, 'path', file.src.match(/^.*\//))[0]; + var prefix = GetFastValue(config, 'prefix', this.prefix); + var textureXhrSettings = GetFastValue(config, 'textureXhrSettings'); + + loader.setBaseURL(baseURL); + loader.setPath(path); + loader.setPrefix(prefix); + + for (var i = 0; i < textures.length; i++) + { + var textureURL = textures[i]; + + var key = textureURL; + + var image = new ImageFile(loader, key, textureURL, textureXhrSettings); + + if (!loader.keyExists(image)) + { + this.addToMultiFile(image); + + loader.addFile(image); + } + } + + // Reset the loader settings + loader.setBaseURL(currentBaseURL); + loader.setPath(currentPath); + loader.setPrefix(currentPrefix); + } + } + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.SpineFile#addToCache + * @since 3.19.0 + */ + addToCache: function () + { + if (this.isReadyToProcess()) + { + var fileJSON = this.files[0]; + + fileJSON.addToCache(); + + var atlasCache; + var atlasKey = ''; + var combinedAtlasData = ''; + var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false; + var textureManager = this.loader.textureManager; + + for (var i = 1; i < this.files.length; i++) + { + var file = this.files[i]; + + if (file.type === 'text') + { + atlasKey = file.key.replace(/![\d]$/, ''); + + atlasCache = file.cache; + + combinedAtlasData = combinedAtlasData.concat(file.data); + } + else + { + var src = file.key.trim(); + var pos = src.indexOf('!'); + var key = src.substr(pos + 1); + + if (!textureManager.exists(key)) + { + textureManager.addImage(key, file.data); + } + } + + file.pendingDestroy(); + } + + atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlasData, prefix: this.prefix }); + + this.complete = true; + } + } + +}); + +module.exports = SpineFile; + + +/***/ }), + +/***/ 4513: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var BuildGameObject = __webpack_require__(2494); +var Class = __webpack_require__(7473); +var GetValue = __webpack_require__(5851); +var ResizeEvent = __webpack_require__(3527); +var ScenePlugin = __webpack_require__(5722); +var SpineCanvas = __webpack_require__(5159); +var SpineWebgl = __webpack_require__(5159); var Spine = { canvas: SpineCanvas, webgl: SpineWebgl }; -var SpineFile = __webpack_require__(209); -var SpineGameObject = __webpack_require__(225); -var SpineContainer = __webpack_require__(256); -var NOOP = __webpack_require__(1); +var SpineFile = __webpack_require__(3524); +var SpineGameObject = __webpack_require__(8332); +var SpineContainer = __webpack_require__(5782); +var NOOP = __webpack_require__(1984); /** * @classdesc @@ -24287,6 +10800,7 @@ var SpinePlugin = new Class({ * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the Spine json file. Used in replacement of the Loaders default XHR Settings. * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the Spine atlas file. Used in replacement of the Loaders default XHR Settings. * @param {object} [settings] - An external Settings configuration object { prefix: '' } + * * @return {Phaser.Loader.LoaderPlugin} The Loader instance. */ spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings, settings) @@ -24898,6454 +11412,9 @@ module.exports = SpinePlugin; /***/ }), -/* 70 */ -/***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BlendModes = __webpack_require__(12); -var GetAdvancedValue = __webpack_require__(71); - -/** - * Builds a Game Object using the provided configuration object. - * - * @function Phaser.GameObjects.BuildGameObject - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene. - * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject. - * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with. - * - * @return {Phaser.GameObjects.GameObject} The built Game Object. - */ -var BuildGameObject = function (scene, gameObject, config) -{ - // Position - - gameObject.x = GetAdvancedValue(config, 'x', 0); - gameObject.y = GetAdvancedValue(config, 'y', 0); - gameObject.depth = GetAdvancedValue(config, 'depth', 0); - - // Flip - - gameObject.flipX = GetAdvancedValue(config, 'flipX', false); - gameObject.flipY = GetAdvancedValue(config, 'flipY', false); - - // Scale - // Either: { scale: 2 } or { scale: { x: 2, y: 2 }} - - var scale = GetAdvancedValue(config, 'scale', null); - - if (typeof scale === 'number') - { - gameObject.setScale(scale); - } - else if (scale !== null) - { - gameObject.scaleX = GetAdvancedValue(scale, 'x', 1); - gameObject.scaleY = GetAdvancedValue(scale, 'y', 1); - } - - // ScrollFactor - // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }} - - var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null); - - if (typeof scrollFactor === 'number') - { - gameObject.setScrollFactor(scrollFactor); - } - else if (scrollFactor !== null) - { - gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1); - gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1); - } - - // Rotation - - gameObject.rotation = GetAdvancedValue(config, 'rotation', 0); - - var angle = GetAdvancedValue(config, 'angle', null); - - if (angle !== null) - { - gameObject.angle = angle; - } - - // Alpha - - gameObject.alpha = GetAdvancedValue(config, 'alpha', 1); - - // Origin - // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }} - - var origin = GetAdvancedValue(config, 'origin', null); - - if (typeof origin === 'number') - { - gameObject.setOrigin(origin); - } - else if (origin !== null) - { - var ox = GetAdvancedValue(origin, 'x', 0.5); - var oy = GetAdvancedValue(origin, 'y', 0.5); - - gameObject.setOrigin(ox, oy); - } - - // BlendMode - - gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL); - - // Visible - - gameObject.visible = GetAdvancedValue(config, 'visible', true); - - // Add to Scene - - var add = GetAdvancedValue(config, 'add', true); - - if (add) - { - scene.sys.displayList.add(gameObject); - } - - if (gameObject.preUpdate) - { - scene.sys.updateList.add(gameObject); - } - - return gameObject; -}; - -module.exports = BuildGameObject; - - -/***/ }), -/* 71 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MATH = __webpack_require__(72); -var GetValue = __webpack_require__(7); - -/** - * Retrieves a value from an object. Allows for more advanced selection options, including: - * - * Allowed types: - * - * Implicit - * { - * x: 4 - * } - * - * From function - * { - * x: function () - * } - * - * Randomly pick one element from the array - * { - * x: [a, b, c, d, e, f] - * } - * - * Random integer between min and max: - * { - * x: { randInt: [min, max] } - * } - * - * Random float between min and max: - * { - * x: { randFloat: [min, max] } - * } - * - * - * @function Phaser.Utils.Objects.GetAdvancedValue - * @since 3.0.0 - * - * @param {object} source - The object to retrieve the value from. - * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. - * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. - * - * @return {*} The value of the requested key. - */ -var GetAdvancedValue = function (source, key, defaultValue) -{ - var value = GetValue(source, key, null); - - if (value === null) - { - return defaultValue; - } - else if (Array.isArray(value)) - { - return MATH.RND.pick(value); - } - else if (typeof value === 'object') - { - if (value.hasOwnProperty('randInt')) - { - return MATH.RND.integerInRange(value.randInt[0], value.randInt[1]); - } - else if (value.hasOwnProperty('randFloat')) - { - return MATH.RND.realInRange(value.randFloat[0], value.randFloat[1]); - } - } - else if (typeof value === 'function') - { - return value(key); - } - - return value; -}; - -module.exports = GetAdvancedValue; - - -/***/ }), -/* 72 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(3); -var Extend = __webpack_require__(17); - -/** - * @namespace Phaser.Math - */ - -var PhaserMath = { - - // Collections of functions - Angle: __webpack_require__(73), - Distance: __webpack_require__(82), - Easing: __webpack_require__(90), - Fuzzy: __webpack_require__(135), - Interpolation: __webpack_require__(140), - Pow2: __webpack_require__(148), - Snap: __webpack_require__(152), - - // Expose the RNG Class - RandomDataGenerator: __webpack_require__(156), - - // Single functions - Average: __webpack_require__(157), - Bernstein: __webpack_require__(35), - Between: __webpack_require__(158), - CatmullRom: __webpack_require__(37), - CeilTo: __webpack_require__(159), - Clamp: __webpack_require__(4), - DegToRad: __webpack_require__(20), - Difference: __webpack_require__(160), - Euler: __webpack_require__(161), - Factorial: __webpack_require__(36), - FloatBetween: __webpack_require__(19), - FloorTo: __webpack_require__(162), - FromPercent: __webpack_require__(163), - GetSpeed: __webpack_require__(164), - IsEven: __webpack_require__(165), - IsEvenStrict: __webpack_require__(166), - Linear: __webpack_require__(38), - LinearXY: __webpack_require__(167), - MaxAdd: __webpack_require__(168), - Median: __webpack_require__(169), - MinSub: __webpack_require__(170), - Percent: __webpack_require__(171), - RadToDeg: __webpack_require__(22), - RandomXY: __webpack_require__(172), - RandomXYZ: __webpack_require__(173), - RandomXYZW: __webpack_require__(174), - Rotate: __webpack_require__(175), - RotateAround: __webpack_require__(41), - RotateAroundDistance: __webpack_require__(176), - RotateTo: __webpack_require__(177), - RoundAwayFromZero: __webpack_require__(42), - RoundTo: __webpack_require__(178), - SinCosTableGenerator: __webpack_require__(179), - SmootherStep: __webpack_require__(40), - SmoothStep: __webpack_require__(39), - ToXY: __webpack_require__(180), - TransformXY: __webpack_require__(43), - Within: __webpack_require__(181), - Wrap: __webpack_require__(13), - - // Vector classes - Vector2: __webpack_require__(2), - Vector3: __webpack_require__(14), - Vector4: __webpack_require__(182), - Matrix3: __webpack_require__(44), - Matrix4: __webpack_require__(21), - Quaternion: __webpack_require__(45), - RotateVec3: __webpack_require__(183) - -}; - -// Merge in the consts - -PhaserMath = Extend(false, PhaserMath, CONST); - -// Export it - -module.exports = PhaserMath; - - -/***/ }), -/* 73 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Angle - */ - -module.exports = { - - Between: __webpack_require__(30), - BetweenPoints: __webpack_require__(74), - BetweenPointsY: __webpack_require__(75), - BetweenY: __webpack_require__(76), - CounterClockwise: __webpack_require__(18), - Normalize: __webpack_require__(31), - Random: __webpack_require__(77), - RandomDegrees: __webpack_require__(78), - Reverse: __webpack_require__(79), - RotateTo: __webpack_require__(80), - ShortestBetween: __webpack_require__(81), - Wrap: __webpack_require__(32), - WrapDegrees: __webpack_require__(33) - -}; - - -/***/ }), -/* 74 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). - * - * Calculates the angle of the vector from the first point to the second point. - * - * @function Phaser.Math.Angle.BetweenPoints - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} point1 - The first point. - * @param {Phaser.Types.Math.Vector2Like} point2 - The second point. - * - * @return {number} The angle in radians. - */ -var BetweenPoints = function (point1, point2) -{ - return Math.atan2(point2.y - point1.y, point2.x - point1.x); -}; - -module.exports = BetweenPoints; - - -/***/ }), -/* 75 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). - * - * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate - * travels down the screen. - * - * @function Phaser.Math.Angle.BetweenPointsY - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} point1 - The first point. - * @param {Phaser.Types.Math.Vector2Like} point2 - The second point. - * - * @return {number} The angle in radians. - */ -var BetweenPointsY = function (point1, point2) -{ - return Math.atan2(point2.x - point1.x, point2.y - point1.y); -}; - -module.exports = BetweenPointsY; - - -/***/ }), -/* 76 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Find the angle of a segment from (x1, y1) -> (x2, y2). - * - * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate - * travels down the screen. - * - * @function Phaser.Math.Angle.BetweenY - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The angle in radians. - */ -var BetweenY = function (x1, y1, x2, y2) -{ - return Math.atan2(x2 - x1, y2 - y1); -}; - -module.exports = BetweenY; - - -/***/ }), -/* 77 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var FloatBetween = __webpack_require__(19); - -/** - * Returns a random angle in the range [-pi, pi]. - * - * @function Phaser.Math.Angle.Random - * @since 3.23.0 - * - * @return {number} The angle, in radians. - */ -var Random = function () -{ - return FloatBetween(-Math.PI, Math.PI); -}; - -module.exports = Random; - - -/***/ }), -/* 78 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var FloatBetween = __webpack_require__(19); - -/** - * Returns a random angle in the range [-180, 180]. - * - * @function Phaser.Math.Angle.RandomDegrees - * @since 3.23.0 - * - * @return {number} The angle, in degrees. - */ -var RandomDegrees = function () -{ - return FloatBetween(-180, 180); -}; - -module.exports = RandomDegrees; - - -/***/ }), -/* 79 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Normalize = __webpack_require__(31); - -/** - * Reverse the given angle. - * - * @function Phaser.Math.Angle.Reverse - * @since 3.0.0 - * - * @param {number} angle - The angle to reverse, in radians. - * - * @return {number} The reversed angle, in radians. - */ -var Reverse = function (angle) -{ - return Normalize(angle + Math.PI); -}; - -module.exports = Reverse; - - -/***/ }), -/* 80 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MATH_CONST = __webpack_require__(3); - -/** - * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. - * - * @function Phaser.Math.Angle.RotateTo - * @since 3.0.0 - * - * @param {number} currentAngle - The current angle, in radians. - * @param {number} targetAngle - The target angle to rotate to, in radians. - * @param {number} [lerp=0.05] - The lerp value to add to the current angle. - * - * @return {number} The adjusted angle. - */ -var RotateTo = function (currentAngle, targetAngle, lerp) -{ - if (lerp === undefined) { lerp = 0.05; } - - if (currentAngle === targetAngle) - { - return currentAngle; - } - - if (Math.abs(targetAngle - currentAngle) <= lerp || Math.abs(targetAngle - currentAngle) >= (MATH_CONST.PI2 - lerp)) - { - currentAngle = targetAngle; - } - else - { - if (Math.abs(targetAngle - currentAngle) > Math.PI) - { - if (targetAngle < currentAngle) - { - targetAngle += MATH_CONST.PI2; - } - else - { - targetAngle -= MATH_CONST.PI2; - } - } - - if (targetAngle > currentAngle) - { - currentAngle += lerp; - } - else if (targetAngle < currentAngle) - { - currentAngle -= lerp; - } - } - - return currentAngle; -}; - -module.exports = RotateTo; - - -/***/ }), -/* 81 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Gets the shortest angle between `angle1` and `angle2`. - * - * Both angles must be in the range -180 to 180, which is the same clamped - * range that `sprite.angle` uses, so you can pass in two sprite angles to - * this method and get the shortest angle back between the two of them. - * - * The angle returned will be in the same range. If the returned angle is - * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's - * a clockwise rotation. - * - * @function Phaser.Math.Angle.ShortestBetween - * @since 3.0.0 - * - * @param {number} angle1 - The first angle in the range -180 to 180. - * @param {number} angle2 - The second angle in the range -180 to 180. - * - * @return {number} The shortest angle, in degrees. If greater than zero it's a counter-clockwise rotation. - */ -var ShortestBetween = function (angle1, angle2) -{ - var difference = angle2 - angle1; - - if (difference === 0) - { - return 0; - } - - var times = Math.floor((difference - (-180)) / 360); - - return difference - (times * 360); - -}; - -module.exports = ShortestBetween; - - -/***/ }), -/* 82 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Distance - */ - -module.exports = { - - Between: __webpack_require__(83), - BetweenPoints: __webpack_require__(84), - BetweenPointsSquared: __webpack_require__(85), - Chebyshev: __webpack_require__(86), - Power: __webpack_require__(87), - Snake: __webpack_require__(88), - Squared: __webpack_require__(89) - -}; - - -/***/ }), -/* 83 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the distance between two sets of coordinates (points). - * - * @function Phaser.Math.Distance.Between - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The distance between each point. - */ -var DistanceBetween = function (x1, y1, x2, y2) -{ - var dx = x1 - x2; - var dy = y1 - y2; - - return Math.sqrt(dx * dx + dy * dy); -}; - -module.exports = DistanceBetween; - - -/***/ }), -/* 84 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the distance between two points. - * - * @function Phaser.Math.Distance.BetweenPoints - * @since 3.22.0 - * - * @param {Phaser.Types.Math.Vector2Like} a - The first point. - * @param {Phaser.Types.Math.Vector2Like} b - The second point. - * - * @return {number} The distance between the points. - */ -var DistanceBetweenPoints = function (a, b) -{ - var dx = a.x - b.x; - var dy = a.y - b.y; - - return Math.sqrt(dx * dx + dy * dy); -}; - -module.exports = DistanceBetweenPoints; - - -/***/ }), -/* 85 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the squared distance between two points. - * - * @function Phaser.Math.Distance.BetweenPointsSquared - * @since 3.22.0 - * - * @param {Phaser.Types.Math.Vector2Like} a - The first point. - * @param {Phaser.Types.Math.Vector2Like} b - The second point. - * - * @return {number} The squared distance between the points. - */ -var DistanceBetweenPointsSquared = function (a, b) -{ - var dx = a.x - b.x; - var dy = a.y - b.y; - - return dx * dx + dy * dy; -}; - -module.exports = DistanceBetweenPointsSquared; - - -/***/ }), -/* 86 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the Chebyshev distance between two sets of coordinates (points). - * - * Chebyshev distance (or chessboard distance) is the maximum of the horizontal and vertical distances. - * It's the effective distance when movement can be horizontal, vertical, or diagonal. - * - * @function Phaser.Math.Distance.Chebyshev - * @since 3.22.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The distance between each point. - */ -var ChebyshevDistance = function (x1, y1, x2, y2) -{ - return Math.max(Math.abs(x1 - x2), Math.abs(y1 - y2)); -}; - -module.exports = ChebyshevDistance; - - -/***/ }), -/* 87 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the distance between two sets of coordinates (points) to the power of `pow`. - * - * @function Phaser.Math.Distance.Power - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * @param {number} pow - The exponent. - * - * @return {number} The distance between each point. - */ -var DistancePower = function (x1, y1, x2, y2, pow) -{ - if (pow === undefined) { pow = 2; } - - return Math.sqrt(Math.pow(x2 - x1, pow) + Math.pow(y2 - y1, pow)); -}; - -module.exports = DistancePower; - - -/***/ }), -/* 88 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the snake distance between two sets of coordinates (points). - * - * Snake distance (rectilinear distance, Manhattan distance) is the sum of the horizontal and vertical distances. - * It's the effective distance when movement is allowed only horizontally or vertically (but not both). - * - * @function Phaser.Math.Distance.Snake - * @since 3.22.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The distance between each point. - */ -var SnakeDistance = function (x1, y1, x2, y2) -{ - return Math.abs(x1 - x2) + Math.abs(y1 - y2); -}; - -module.exports = SnakeDistance; - - -/***/ }), -/* 89 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the distance between two sets of coordinates (points), squared. - * - * @function Phaser.Math.Distance.Squared - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The distance between each point, squared. - */ -var DistanceSquared = function (x1, y1, x2, y2) -{ - var dx = x1 - x2; - var dy = y1 - y2; - - return dx * dx + dy * dy; -}; - -module.exports = DistanceSquared; - - -/***/ }), -/* 90 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing - */ - -module.exports = { - - Back: __webpack_require__(91), - Bounce: __webpack_require__(95), - Circular: __webpack_require__(99), - Cubic: __webpack_require__(103), - Elastic: __webpack_require__(107), - Expo: __webpack_require__(111), - Linear: __webpack_require__(115), - Quadratic: __webpack_require__(117), - Quartic: __webpack_require__(121), - Quintic: __webpack_require__(125), - Sine: __webpack_require__(129), - Stepped: __webpack_require__(133) - -}; - - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Back - */ - -module.exports = { - - In: __webpack_require__(92), - Out: __webpack_require__(93), - InOut: __webpack_require__(94) - -}; - - -/***/ }), -/* 92 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Back ease-in. - * - * @function Phaser.Math.Easing.Back.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [overshoot=1.70158] - The overshoot amount. - * - * @return {number} The tweened value. - */ -var In = function (v, overshoot) -{ - if (overshoot === undefined) { overshoot = 1.70158; } - - return v * v * ((overshoot + 1) * v - overshoot); -}; - -module.exports = In; - - -/***/ }), -/* 93 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Back ease-out. - * - * @function Phaser.Math.Easing.Back.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [overshoot=1.70158] - The overshoot amount. - * - * @return {number} The tweened value. - */ -var Out = function (v, overshoot) -{ - if (overshoot === undefined) { overshoot = 1.70158; } - - return --v * v * ((overshoot + 1) * v + overshoot) + 1; -}; - -module.exports = Out; - - -/***/ }), -/* 94 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Back ease-in/out. - * - * @function Phaser.Math.Easing.Back.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [overshoot=1.70158] - The overshoot amount. - * - * @return {number} The tweened value. - */ -var InOut = function (v, overshoot) -{ - if (overshoot === undefined) { overshoot = 1.70158; } - - var s = overshoot * 1.525; - - if ((v *= 2) < 1) - { - return 0.5 * (v * v * ((s + 1) * v - s)); - } - else - { - return 0.5 * ((v -= 2) * v * ((s + 1) * v + s) + 2); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 95 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Bounce - */ - -module.exports = { - - In: __webpack_require__(96), - Out: __webpack_require__(97), - InOut: __webpack_require__(98) - -}; - - -/***/ }), -/* 96 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Bounce ease-in. - * - * @function Phaser.Math.Easing.Bounce.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - v = 1 - v; - - if (v < 1 / 2.75) - { - return 1 - (7.5625 * v * v); - } - else if (v < 2 / 2.75) - { - return 1 - (7.5625 * (v -= 1.5 / 2.75) * v + 0.75); - } - else if (v < 2.5 / 2.75) - { - return 1 - (7.5625 * (v -= 2.25 / 2.75) * v + 0.9375); - } - else - { - return 1 - (7.5625 * (v -= 2.625 / 2.75) * v + 0.984375); - } -}; - -module.exports = In; - - -/***/ }), -/* 97 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Bounce ease-out. - * - * @function Phaser.Math.Easing.Bounce.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - if (v < 1 / 2.75) - { - return 7.5625 * v * v; - } - else if (v < 2 / 2.75) - { - return 7.5625 * (v -= 1.5 / 2.75) * v + 0.75; - } - else if (v < 2.5 / 2.75) - { - return 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375; - } - else - { - return 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375; - } -}; - -module.exports = Out; - - -/***/ }), -/* 98 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Bounce ease-in/out. - * - * @function Phaser.Math.Easing.Bounce.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - var reverse = false; - - if (v < 0.5) - { - v = 1 - (v * 2); - reverse = true; - } - else - { - v = (v * 2) - 1; - } - - if (v < 1 / 2.75) - { - v = 7.5625 * v * v; - } - else if (v < 2 / 2.75) - { - v = 7.5625 * (v -= 1.5 / 2.75) * v + 0.75; - } - else if (v < 2.5 / 2.75) - { - v = 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375; - } - else - { - v = 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375; - } - - if (reverse) - { - return (1 - v) * 0.5; - } - else - { - return v * 0.5 + 0.5; - } -}; - -module.exports = InOut; - - -/***/ }), -/* 99 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Circular - */ - -module.exports = { - - In: __webpack_require__(100), - Out: __webpack_require__(101), - InOut: __webpack_require__(102) - -}; - - -/***/ }), -/* 100 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Circular ease-in. - * - * @function Phaser.Math.Easing.Circular.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return 1 - Math.sqrt(1 - v * v); -}; - -module.exports = In; - - -/***/ }), -/* 101 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Circular ease-out. - * - * @function Phaser.Math.Easing.Circular.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return Math.sqrt(1 - (--v * v)); -}; - -module.exports = Out; - - -/***/ }), -/* 102 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Circular ease-in/out. - * - * @function Phaser.Math.Easing.Circular.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return -0.5 * (Math.sqrt(1 - v * v) - 1); - } - else - { - return 0.5 * (Math.sqrt(1 - (v -= 2) * v) + 1); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 103 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Cubic - */ - -module.exports = { - - In: __webpack_require__(104), - Out: __webpack_require__(105), - InOut: __webpack_require__(106) - -}; - - -/***/ }), -/* 104 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Cubic ease-in. - * - * @function Phaser.Math.Easing.Cubic.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return v * v * v; -}; - -module.exports = In; - - -/***/ }), -/* 105 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Cubic ease-out. - * - * @function Phaser.Math.Easing.Cubic.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return --v * v * v + 1; -}; - -module.exports = Out; - - -/***/ }), -/* 106 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Cubic ease-in/out. - * - * @function Phaser.Math.Easing.Cubic.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return 0.5 * v * v * v; - } - else - { - return 0.5 * ((v -= 2) * v * v + 2); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 107 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Elastic - */ - -module.exports = { - - In: __webpack_require__(108), - Out: __webpack_require__(109), - InOut: __webpack_require__(110) - -}; - - -/***/ }), -/* 108 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Elastic ease-in. - * - * @function Phaser.Math.Easing.Elastic.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. - * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. - * - * @return {number} The tweened value. - */ -var In = function (v, amplitude, period) -{ - if (amplitude === undefined) { amplitude = 0.1; } - if (period === undefined) { period = 0.1; } - - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - var s = period / 4; - - if (amplitude < 1) - { - amplitude = 1; - } - else - { - s = period * Math.asin(1 / amplitude) / (2 * Math.PI); - } - - return -(amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period)); - } -}; - -module.exports = In; - - -/***/ }), -/* 109 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Elastic ease-out. - * - * @function Phaser.Math.Easing.Elastic.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. - * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. - * - * @return {number} The tweened value. - */ -var Out = function (v, amplitude, period) -{ - if (amplitude === undefined) { amplitude = 0.1; } - if (period === undefined) { period = 0.1; } - - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - var s = period / 4; - - if (amplitude < 1) - { - amplitude = 1; - } - else - { - s = period * Math.asin(1 / amplitude) / (2 * Math.PI); - } - - return (amplitude * Math.pow(2, -10 * v) * Math.sin((v - s) * (2 * Math.PI) / period) + 1); - } -}; - -module.exports = Out; - - -/***/ }), -/* 110 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Elastic ease-in/out. - * - * @function Phaser.Math.Easing.Elastic.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. - * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. - * - * @return {number} The tweened value. - */ -var InOut = function (v, amplitude, period) -{ - if (amplitude === undefined) { amplitude = 0.1; } - if (period === undefined) { period = 0.1; } - - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - var s = period / 4; - - if (amplitude < 1) - { - amplitude = 1; - } - else - { - s = period * Math.asin(1 / amplitude) / (2 * Math.PI); - } - - if ((v *= 2) < 1) - { - return -0.5 * (amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period)); - } - else - { - return amplitude * Math.pow(2, -10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period) * 0.5 + 1; - } - } -}; - -module.exports = InOut; - - -/***/ }), -/* 111 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Expo - */ - -module.exports = { - - In: __webpack_require__(112), - Out: __webpack_require__(113), - InOut: __webpack_require__(114) - -}; - - -/***/ }), -/* 112 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Exponential ease-in. - * - * @function Phaser.Math.Easing.Expo.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return Math.pow(2, 10 * (v - 1)) - 0.001; -}; - -module.exports = In; - - -/***/ }), -/* 113 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Exponential ease-out. - * - * @function Phaser.Math.Easing.Expo.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return 1 - Math.pow(2, -10 * v); -}; - -module.exports = Out; - - -/***/ }), -/* 114 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Exponential ease-in/out. - * - * @function Phaser.Math.Easing.Expo.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return 0.5 * Math.pow(2, 10 * (v - 1)); - } - else - { - return 0.5 * (2 - Math.pow(2, -10 * (v - 1))); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -module.exports = __webpack_require__(116); - - -/***/ }), -/* 116 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Linear easing (no variation). - * - * @function Phaser.Math.Easing.Linear - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Linear = function (v) -{ - return v; -}; - -module.exports = Linear; - - -/***/ }), -/* 117 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Quadratic - */ - -module.exports = { - - In: __webpack_require__(118), - Out: __webpack_require__(119), - InOut: __webpack_require__(120) - -}; - - -/***/ }), -/* 118 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quadratic ease-in. - * - * @function Phaser.Math.Easing.Quadratic.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return v * v; -}; - -module.exports = In; - - -/***/ }), -/* 119 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quadratic ease-out. - * - * @function Phaser.Math.Easing.Quadratic.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return v * (2 - v); -}; - -module.exports = Out; - - -/***/ }), -/* 120 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quadratic ease-in/out. - * - * @function Phaser.Math.Easing.Quadratic.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return 0.5 * v * v; - } - else - { - return -0.5 * (--v * (v - 2) - 1); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 121 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Quartic - */ - -module.exports = { - - In: __webpack_require__(122), - Out: __webpack_require__(123), - InOut: __webpack_require__(124) - -}; - - -/***/ }), -/* 122 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quartic ease-in. - * - * @function Phaser.Math.Easing.Quartic.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return v * v * v * v; -}; - -module.exports = In; - - -/***/ }), -/* 123 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quartic ease-out. - * - * @function Phaser.Math.Easing.Quartic.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return 1 - (--v * v * v * v); -}; - -module.exports = Out; - - -/***/ }), -/* 124 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quartic ease-in/out. - * - * @function Phaser.Math.Easing.Quartic.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return 0.5 * v * v * v * v; - } - else - { - return -0.5 * ((v -= 2) * v * v * v - 2); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Quintic - */ - -module.exports = { - - In: __webpack_require__(126), - Out: __webpack_require__(127), - InOut: __webpack_require__(128) - -}; - - -/***/ }), -/* 126 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quintic ease-in. - * - * @function Phaser.Math.Easing.Quintic.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return v * v * v * v * v; -}; - -module.exports = In; - - -/***/ }), -/* 127 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quintic ease-out. - * - * @function Phaser.Math.Easing.Quintic.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return --v * v * v * v * v + 1; -}; - -module.exports = Out; - - -/***/ }), -/* 128 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quintic ease-in/out. - * - * @function Phaser.Math.Easing.Quintic.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return 0.5 * v * v * v * v * v; - } - else - { - return 0.5 * ((v -= 2) * v * v * v * v + 2); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 129 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Sine - */ - -module.exports = { - - In: __webpack_require__(130), - Out: __webpack_require__(131), - InOut: __webpack_require__(132) - -}; - - -/***/ }), -/* 130 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Sinusoidal ease-in. - * - * @function Phaser.Math.Easing.Sine.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - return 1 - Math.cos(v * Math.PI / 2); - } -}; - -module.exports = In; - - -/***/ }), -/* 131 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Sinusoidal ease-out. - * - * @function Phaser.Math.Easing.Sine.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - return Math.sin(v * Math.PI / 2); - } -}; - -module.exports = Out; - - -/***/ }), -/* 132 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Sinusoidal ease-in/out. - * - * @function Phaser.Math.Easing.Sine.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - return 0.5 * (1 - Math.cos(Math.PI * v)); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 133 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Stepped - */ - -module.exports = __webpack_require__(134); - - -/***/ }), -/* 134 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Stepped easing. - * - * @function Phaser.Math.Easing.Stepped - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [steps=1] - The number of steps in the ease. - * - * @return {number} The tweened value. - */ -var Stepped = function (v, steps) -{ - if (steps === undefined) { steps = 1; } - - if (v <= 0) - { - return 0; - } - else if (v >= 1) - { - return 1; - } - else - { - return (((steps * v) | 0) + 1) * (1 / steps); - } -}; - -module.exports = Stepped; - - -/***/ }), -/* 135 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Fuzzy - */ - -module.exports = { - - Ceil: __webpack_require__(136), - Equal: __webpack_require__(34), - Floor: __webpack_require__(137), - GreaterThan: __webpack_require__(138), - LessThan: __webpack_require__(139) - -}; - - -/***/ }), -/* 136 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the fuzzy ceiling of the given value. - * - * @function Phaser.Math.Fuzzy.Ceil - * @since 3.0.0 - * - * @param {number} value - The value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {number} The fuzzy ceiling of the value. - */ -var Ceil = function (value, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return Math.ceil(value - epsilon); -}; - -module.exports = Ceil; - - -/***/ }), -/* 137 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the fuzzy floor of the given value. - * - * @function Phaser.Math.Fuzzy.Floor - * @since 3.0.0 - * - * @param {number} value - The value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {number} The floor of the value. - */ -var Floor = function (value, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return Math.floor(value + epsilon); -}; - -module.exports = Floor; - - -/***/ }), -/* 138 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check whether `a` is fuzzily greater than `b`. - * - * `a` is fuzzily greater than `b` if it is more than `b - epsilon`. - * - * @function Phaser.Math.Fuzzy.GreaterThan - * @since 3.0.0 - * - * @param {number} a - The first value. - * @param {number} b - The second value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {boolean} `true` if `a` is fuzzily greater than than `b`, otherwise `false`. - */ -var GreaterThan = function (a, b, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return a > b - epsilon; -}; - -module.exports = GreaterThan; - - -/***/ }), -/* 139 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check whether `a` is fuzzily less than `b`. - * - * `a` is fuzzily less than `b` if it is less than `b + epsilon`. - * - * @function Phaser.Math.Fuzzy.LessThan - * @since 3.0.0 - * - * @param {number} a - The first value. - * @param {number} b - The second value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {boolean} `true` if `a` is fuzzily less than `b`, otherwise `false`. - */ -var LessThan = function (a, b, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return a < b + epsilon; -}; - -module.exports = LessThan; - - -/***/ }), -/* 140 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Interpolation - */ - -module.exports = { - - Bezier: __webpack_require__(141), - CatmullRom: __webpack_require__(142), - CubicBezier: __webpack_require__(143), - Linear: __webpack_require__(144), - QuadraticBezier: __webpack_require__(145), - SmoothStep: __webpack_require__(146), - SmootherStep: __webpack_require__(147) - -}; - - -/***/ }), -/* 141 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Bernstein = __webpack_require__(35); - -/** - * A bezier interpolation method. - * - * @function Phaser.Math.Interpolation.Bezier - * @since 3.0.0 - * - * @param {number[]} v - The input array of values to interpolate between. - * @param {number} k - The percentage of interpolation, between 0 and 1. - * - * @return {number} The interpolated value. - */ -var BezierInterpolation = function (v, k) -{ - var b = 0; - var n = v.length - 1; - - for (var i = 0; i <= n; i++) - { - b += Math.pow(1 - k, n - i) * Math.pow(k, i) * v[i] * Bernstein(n, i); - } - - return b; -}; - -module.exports = BezierInterpolation; - - -/***/ }), -/* 142 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CatmullRom = __webpack_require__(37); - -/** - * A Catmull-Rom interpolation method. - * - * @function Phaser.Math.Interpolation.CatmullRom - * @since 3.0.0 - * - * @param {number[]} v - The input array of values to interpolate between. - * @param {number} k - The percentage of interpolation, between 0 and 1. - * - * @return {number} The interpolated value. - */ -var CatmullRomInterpolation = function (v, k) -{ - var m = v.length - 1; - var f = m * k; - var i = Math.floor(f); - - if (v[0] === v[m]) - { - if (k < 0) - { - i = Math.floor(f = m * (1 + k)); - } - - return CatmullRom(f - i, v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m]); - } - else - { - if (k < 0) - { - return v[0] - (CatmullRom(-f, v[0], v[0], v[1], v[1]) - v[0]); - } - - if (k > 1) - { - return v[m] - (CatmullRom(f - m, v[m], v[m], v[m - 1], v[m - 1]) - v[m]); - } - - return CatmullRom(f - i, v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2]); - } -}; - -module.exports = CatmullRomInterpolation; - - -/***/ }), -/* 143 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @ignore - */ -function P0 (t, p) -{ - var k = 1 - t; - - return k * k * k * p; -} - -/** - * @ignore - */ -function P1 (t, p) -{ - var k = 1 - t; - - return 3 * k * k * t * p; -} - -/** - * @ignore - */ -function P2 (t, p) -{ - return 3 * (1 - t) * t * t * p; -} - -/** - * @ignore - */ -function P3 (t, p) -{ - return t * t * t * p; -} - -/** - * A cubic bezier interpolation method. - * - * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a - * - * @function Phaser.Math.Interpolation.CubicBezier - * @since 3.0.0 - * - * @param {number} t - The percentage of interpolation, between 0 and 1. - * @param {number} p0 - The start point. - * @param {number} p1 - The first control point. - * @param {number} p2 - The second control point. - * @param {number} p3 - The end point. - * - * @return {number} The interpolated value. - */ -var CubicBezierInterpolation = function (t, p0, p1, p2, p3) -{ - return P0(t, p0) + P1(t, p1) + P2(t, p2) + P3(t, p3); -}; - -module.exports = CubicBezierInterpolation; - - -/***/ }), -/* 144 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Linear = __webpack_require__(38); - -/** - * A linear interpolation method. - * - * @function Phaser.Math.Interpolation.Linear - * @since 3.0.0 - * @see {@link https://en.wikipedia.org/wiki/Linear_interpolation} - * - * @param {number[]} v - The input array of values to interpolate between. - * @param {!number} k - The percentage of interpolation, between 0 and 1. - * - * @return {!number} The interpolated value. - */ -var LinearInterpolation = function (v, k) -{ - var m = v.length - 1; - var f = m * k; - var i = Math.floor(f); - - if (k < 0) - { - return Linear(v[0], v[1], f); - } - else if (k > 1) - { - return Linear(v[m], v[m - 1], m - f); - } - else - { - return Linear(v[i], v[(i + 1 > m) ? m : i + 1], f - i); - } -}; - -module.exports = LinearInterpolation; - - -/***/ }), -/* 145 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @ignore - */ -function P0 (t, p) -{ - var k = 1 - t; - - return k * k * p; -} - -/** - * @ignore - */ -function P1 (t, p) -{ - return 2 * (1 - t) * t * p; -} - -/** - * @ignore - */ -function P2 (t, p) -{ - return t * t * p; -} - -// https://github.com/mrdoob/three.js/blob/master/src/extras/core/Interpolations.js - -/** - * A quadratic bezier interpolation method. - * - * @function Phaser.Math.Interpolation.QuadraticBezier - * @since 3.2.0 - * - * @param {number} t - The percentage of interpolation, between 0 and 1. - * @param {number} p0 - The start point. - * @param {number} p1 - The control point. - * @param {number} p2 - The end point. - * - * @return {number} The interpolated value. - */ -var QuadraticBezierInterpolation = function (t, p0, p1, p2) -{ - return P0(t, p0) + P1(t, p1) + P2(t, p2); -}; - -module.exports = QuadraticBezierInterpolation; - - -/***/ }), -/* 146 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SmoothStep = __webpack_require__(39); - -/** - * A Smooth Step interpolation method. - * - * @function Phaser.Math.Interpolation.SmoothStep - * @since 3.9.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep} - * - * @param {number} t - The percentage of interpolation, between 0 and 1. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The interpolated value. - */ -var SmoothStepInterpolation = function (t, min, max) -{ - return min + (max - min) * SmoothStep(t, 0, 1); -}; - -module.exports = SmoothStepInterpolation; - - -/***/ }), -/* 147 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SmootherStep = __webpack_require__(40); - -/** - * A Smoother Step interpolation method. - * - * @function Phaser.Math.Interpolation.SmootherStep - * @since 3.9.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} - * - * @param {number} t - The percentage of interpolation, between 0 and 1. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The interpolated value. - */ -var SmootherStepInterpolation = function (t, min, max) -{ - return min + (max - min) * SmootherStep(t, 0, 1); -}; - -module.exports = SmootherStepInterpolation; - - -/***/ }), -/* 148 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Pow2 - */ - -module.exports = { - - GetNext: __webpack_require__(149), - IsSize: __webpack_require__(150), - IsValue: __webpack_require__(151) - -}; - - -/***/ }), -/* 149 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Returns the nearest power of 2 to the given `value`. - * - * @function Phaser.Math.Pow2.GetNext - * @since 3.0.0 - * - * @param {number} value - The value. - * - * @return {number} The nearest power of 2 to `value`. - */ -var GetPowerOfTwo = function (value) -{ - var index = Math.log(value) / 0.6931471805599453; - - return (1 << Math.ceil(index)); -}; - -module.exports = GetPowerOfTwo; - - -/***/ }), -/* 150 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if the given `width` and `height` are a power of two. - * Useful for checking texture dimensions. - * - * @function Phaser.Math.Pow2.IsSize - * @since 3.0.0 - * - * @param {number} width - The width. - * @param {number} height - The height. - * - * @return {boolean} `true` if `width` and `height` are a power of two, otherwise `false`. - */ -var IsSizePowerOfTwo = function (width, height) -{ - return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0); -}; - -module.exports = IsSizePowerOfTwo; - - -/***/ }), -/* 151 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Tests the value and returns `true` if it is a power of two. - * - * @function Phaser.Math.Pow2.IsValue - * @since 3.0.0 - * - * @param {number} value - The value to check if it's a power of two. - * - * @return {boolean} Returns `true` if `value` is a power of two, otherwise `false`. - */ -var IsValuePowerOfTwo = function (value) -{ - return (value > 0 && (value & (value - 1)) === 0); -}; - -module.exports = IsValuePowerOfTwo; - - -/***/ }), -/* 152 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Snap - */ - -module.exports = { - - Ceil: __webpack_require__(153), - Floor: __webpack_require__(154), - To: __webpack_require__(155) - -}; - - -/***/ }), -/* 153 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Snap a value to nearest grid slice, using ceil. - * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`. - * As will `14` snap to `15`... but `16` will snap to `20`. - * - * @function Phaser.Math.Snap.Ceil - * @since 3.0.0 - * - * @param {number} value - The value to snap. - * @param {number} gap - The interval gap of the grid. - * @param {number} [start=0] - Optional starting offset for gap. - * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. - * - * @return {number} The snapped value. - */ -var SnapCeil = function (value, gap, start, divide) -{ - if (start === undefined) { start = 0; } - - if (gap === 0) - { - return value; - } - - value -= start; - value = gap * Math.ceil(value / gap); - - return (divide) ? (start + value) / gap : start + value; -}; - -module.exports = SnapCeil; - - -/***/ }), -/* 154 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Snap a value to nearest grid slice, using floor. - * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`. - * As will `14` snap to `10`... but `16` will snap to `15`. - * - * @function Phaser.Math.Snap.Floor - * @since 3.0.0 - * - * @param {number} value - The value to snap. - * @param {number} gap - The interval gap of the grid. - * @param {number} [start=0] - Optional starting offset for gap. - * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. - * - * @return {number} The snapped value. - */ -var SnapFloor = function (value, gap, start, divide) -{ - if (start === undefined) { start = 0; } - - if (gap === 0) - { - return value; - } - - value -= start; - value = gap * Math.floor(value / gap); - - return (divide) ? (start + value) / gap : start + value; -}; - -module.exports = SnapFloor; - - -/***/ }), -/* 155 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Snap a value to nearest grid slice, using rounding. - * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10` whereas `14` will snap to `15`. - * - * @function Phaser.Math.Snap.To - * @since 3.0.0 - * - * @param {number} value - The value to snap. - * @param {number} gap - The interval gap of the grid. - * @param {number} [start=0] - Optional starting offset for gap. - * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. - * - * @return {number} The snapped value. - */ -var SnapTo = function (value, gap, start, divide) -{ - if (start === undefined) { start = 0; } - - if (gap === 0) - { - return value; - } - - value -= start; - value = gap * Math.round(value / gap); - - return (divide) ? (start + value) / gap : start + value; -}; - -module.exports = SnapTo; - - -/***/ }), -/* 156 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A seeded Random Data Generator. - * - * Access via `Phaser.Math.RND` which is an instance of this class pre-defined - * by Phaser. Or, create your own instance to use as you require. - * - * The `Math.RND` generator is seeded by the Game Config property value `seed`. - * If no such config property exists, a random number is used. - * - * If you create your own instance of this class you should provide a seed for it. - * If no seed is given it will use a 'random' one based on Date.now. - * - * @class RandomDataGenerator - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {(string|string[])} [seeds] - The seeds to use for the random number generator. - */ -var RandomDataGenerator = new Class({ - - initialize: - - function RandomDataGenerator (seeds) - { - if (seeds === undefined) { seeds = [ (Date.now() * Math.random()).toString() ]; } - - /** - * Internal var. - * - * @name Phaser.Math.RandomDataGenerator#c - * @type {number} - * @default 1 - * @private - * @since 3.0.0 - */ - this.c = 1; - - /** - * Internal var. - * - * @name Phaser.Math.RandomDataGenerator#s0 - * @type {number} - * @default 0 - * @private - * @since 3.0.0 - */ - this.s0 = 0; - - /** - * Internal var. - * - * @name Phaser.Math.RandomDataGenerator#s1 - * @type {number} - * @default 0 - * @private - * @since 3.0.0 - */ - this.s1 = 0; - - /** - * Internal var. - * - * @name Phaser.Math.RandomDataGenerator#s2 - * @type {number} - * @default 0 - * @private - * @since 3.0.0 - */ - this.s2 = 0; - - /** - * Internal var. - * - * @name Phaser.Math.RandomDataGenerator#n - * @type {number} - * @default 0 - * @private - * @since 3.2.0 - */ - this.n = 0; - - /** - * Signs to choose from. - * - * @name Phaser.Math.RandomDataGenerator#signs - * @type {number[]} - * @since 3.0.0 - */ - this.signs = [ -1, 1 ]; - - if (seeds) - { - this.init(seeds); - } - }, - - /** - * Private random helper. - * - * @method Phaser.Math.RandomDataGenerator#rnd - * @since 3.0.0 - * @private - * - * @return {number} A random number. - */ - rnd: function () - { - var t = 2091639 * this.s0 + this.c * 2.3283064365386963e-10; // 2^-32 - - this.c = t | 0; - this.s0 = this.s1; - this.s1 = this.s2; - this.s2 = t - this.c; - - return this.s2; - }, - - /** - * Internal method that creates a seed hash. - * - * @method Phaser.Math.RandomDataGenerator#hash - * @since 3.0.0 - * @private - * - * @param {string} data - The value to hash. - * - * @return {number} The hashed value. - */ - hash: function (data) - { - var h; - var n = this.n; - - data = data.toString(); - - for (var i = 0; i < data.length; i++) - { - n += data.charCodeAt(i); - h = 0.02519603282416938 * n; - n = h >>> 0; - h -= n; - h *= n; - n = h >>> 0; - h -= n; - n += h * 0x100000000;// 2^32 - } - - this.n = n; - - return (n >>> 0) * 2.3283064365386963e-10;// 2^-32 - }, - - /** - * Initialize the state of the random data generator. - * - * @method Phaser.Math.RandomDataGenerator#init - * @since 3.0.0 - * - * @param {(string|string[])} seeds - The seeds to initialize the random data generator with. - */ - init: function (seeds) - { - if (typeof seeds === 'string') - { - this.state(seeds); - } - else - { - this.sow(seeds); - } - }, - - /** - * Reset the seed of the random data generator. - * - * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present. - * - * @method Phaser.Math.RandomDataGenerator#sow - * @since 3.0.0 - * - * @param {string[]} seeds - The array of seeds: the `toString()` of each value is used. - */ - sow: function (seeds) - { - // Always reset to default seed - this.n = 0xefc8249d; - this.s0 = this.hash(' '); - this.s1 = this.hash(' '); - this.s2 = this.hash(' '); - this.c = 1; - - if (!seeds) - { - return; - } - - // Apply any seeds - for (var i = 0; i < seeds.length && (seeds[i] != null); i++) - { - var seed = seeds[i]; - - this.s0 -= this.hash(seed); - this.s0 += ~~(this.s0 < 0); - this.s1 -= this.hash(seed); - this.s1 += ~~(this.s1 < 0); - this.s2 -= this.hash(seed); - this.s2 += ~~(this.s2 < 0); - } - }, - - /** - * Returns a random integer between 0 and 2^32. - * - * @method Phaser.Math.RandomDataGenerator#integer - * @since 3.0.0 - * - * @return {number} A random integer between 0 and 2^32. - */ - integer: function () - { - // 2^32 - return this.rnd() * 0x100000000; - }, - - /** - * Returns a random real number between 0 and 1. - * - * @method Phaser.Math.RandomDataGenerator#frac - * @since 3.0.0 - * - * @return {number} A random real number between 0 and 1. - */ - frac: function () - { - // 2^-53 - return this.rnd() + (this.rnd() * 0x200000 | 0) * 1.1102230246251565e-16; - }, - - /** - * Returns a random real number between 0 and 2^32. - * - * @method Phaser.Math.RandomDataGenerator#real - * @since 3.0.0 - * - * @return {number} A random real number between 0 and 2^32. - */ - real: function () - { - return this.integer() + this.frac(); - }, - - /** - * Returns a random integer between and including min and max. - * - * @method Phaser.Math.RandomDataGenerator#integerInRange - * @since 3.0.0 - * - * @param {number} min - The minimum value in the range. - * @param {number} max - The maximum value in the range. - * - * @return {number} A random number between min and max. - */ - integerInRange: function (min, max) - { - return Math.floor(this.realInRange(0, max - min + 1) + min); - }, - - /** - * Returns a random integer between and including min and max. - * This method is an alias for RandomDataGenerator.integerInRange. - * - * @method Phaser.Math.RandomDataGenerator#between - * @since 3.0.0 - * - * @param {number} min - The minimum value in the range. - * @param {number} max - The maximum value in the range. - * - * @return {number} A random number between min and max. - */ - between: function (min, max) - { - return Math.floor(this.realInRange(0, max - min + 1) + min); - }, - - /** - * Returns a random real number between min and max. - * - * @method Phaser.Math.RandomDataGenerator#realInRange - * @since 3.0.0 - * - * @param {number} min - The minimum value in the range. - * @param {number} max - The maximum value in the range. - * - * @return {number} A random number between min and max. - */ - realInRange: function (min, max) - { - return this.frac() * (max - min) + min; - }, - - /** - * Returns a random real number between -1 and 1. - * - * @method Phaser.Math.RandomDataGenerator#normal - * @since 3.0.0 - * - * @return {number} A random real number between -1 and 1. - */ - normal: function () - { - return 1 - (2 * this.frac()); - }, - - /** - * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368 - * - * @method Phaser.Math.RandomDataGenerator#uuid - * @since 3.0.0 - * - * @return {string} A valid RFC4122 version4 ID hex string - */ - uuid: function () - { - var a = ''; - var b = ''; - - for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-') - { - // eslint-disable-next-line no-empty - } - - return b; - }, - - /** - * Returns a random element from within the given array. - * - * @method Phaser.Math.RandomDataGenerator#pick - * @since 3.0.0 - * - * @generic T - * @genericUse {T[]} - [array] - * @genericUse {T} - [$return] - * - * @param {T[]} array - The array to pick a random element from. - * - * @return {T} A random member of the array. - */ - pick: function (array) - { - return array[this.integerInRange(0, array.length - 1)]; - }, - - /** - * Returns a sign to be used with multiplication operator. - * - * @method Phaser.Math.RandomDataGenerator#sign - * @since 3.0.0 - * - * @return {number} -1 or +1. - */ - sign: function () - { - return this.pick(this.signs); - }, - - /** - * Returns a random element from within the given array, favoring the earlier entries. - * - * @method Phaser.Math.RandomDataGenerator#weightedPick - * @since 3.0.0 - * - * @generic T - * @genericUse {T[]} - [array] - * @genericUse {T} - [$return] - * - * @param {T[]} array - The array to pick a random element from. - * - * @return {T} A random member of the array. - */ - weightedPick: function (array) - { - return array[~~(Math.pow(this.frac(), 2) * (array.length - 1) + 0.5)]; - }, - - /** - * Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified. - * - * @method Phaser.Math.RandomDataGenerator#timestamp - * @since 3.0.0 - * - * @param {number} min - The minimum value in the range. - * @param {number} max - The maximum value in the range. - * - * @return {number} A random timestamp between min and max. - */ - timestamp: function (min, max) - { - return this.realInRange(min || 946684800000, max || 1577862000000); - }, - - /** - * Returns a random angle between -180 and 180. - * - * @method Phaser.Math.RandomDataGenerator#angle - * @since 3.0.0 - * - * @return {number} A random number between -180 and 180. - */ - angle: function () - { - return this.integerInRange(-180, 180); - }, - - /** - * Returns a random rotation in radians, between -3.141 and 3.141 - * - * @method Phaser.Math.RandomDataGenerator#rotation - * @since 3.0.0 - * - * @return {number} A random number between -3.141 and 3.141 - */ - rotation: function () - { - return this.realInRange(-3.1415926, 3.1415926); - }, - - /** - * Gets or Sets the state of the generator. This allows you to retain the values - * that the generator is using between games, i.e. in a game save file. - * - * To seed this generator with a previously saved state you can pass it as the - * `seed` value in your game config, or call this method directly after Phaser has booted. - * - * Call this method with no parameters to return the current state. - * - * If providing a state it should match the same format that this method - * returns, which is a string with a header `!rnd` followed by the `c`, - * `s0`, `s1` and `s2` values respectively, each comma-delimited. - * - * @method Phaser.Math.RandomDataGenerator#state - * @since 3.0.0 - * - * @param {string} [state] - Generator state to be set. - * - * @return {string} The current state of the generator. - */ - state: function (state) - { - if (typeof state === 'string' && state.match(/^!rnd/)) - { - state = state.split(','); - - this.c = parseFloat(state[1]); - this.s0 = parseFloat(state[2]); - this.s1 = parseFloat(state[3]); - this.s2 = parseFloat(state[4]); - } - - return [ '!rnd', this.c, this.s0, this.s1, this.s2 ].join(','); - }, - - /** - * Shuffles the given array, using the current seed. - * - * @method Phaser.Math.RandomDataGenerator#shuffle - * @since 3.7.0 - * - * @generic T - * @genericUse {T[]} - [array,$return] - * - * @param {T[]} [array] - The array to be shuffled. - * - * @return {T[]} The shuffled array. - */ - shuffle: function (array) - { - var len = array.length - 1; - - for (var i = len; i > 0; i--) - { - var randomIndex = Math.floor(this.frac() * (i + 1)); - var itemAtIndex = array[randomIndex]; - - array[randomIndex] = array[i]; - array[i] = itemAtIndex; - } - - return array; - } - -}); - -module.exports = RandomDataGenerator; - - -/***/ }), -/* 157 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the mean average of the given values. - * - * @function Phaser.Math.Average - * @since 3.0.0 - * - * @param {number[]} values - The values to average. - * - * @return {number} The average value. - */ -var Average = function (values) -{ - var sum = 0; - - for (var i = 0; i < values.length; i++) - { - sum += (+values[i]); - } - - return sum / values.length; -}; - -module.exports = Average; - - -/***/ }), -/* 158 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Compute a random integer between the `min` and `max` values, inclusive. - * - * @function Phaser.Math.Between - * @since 3.0.0 - * - * @param {number} min - The minimum value. - * @param {number} max - The maximum value. - * - * @return {number} The random integer. - */ -var Between = function (min, max) -{ - return Math.floor(Math.random() * (max - min + 1) + min); -}; - -module.exports = Between; - - -/***/ }), -/* 159 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Ceils to some place comparative to a `base`, default is 10 for decimal place. - * - * The `place` is represented by the power applied to `base` to get that place. - * - * @function Phaser.Math.CeilTo - * @since 3.0.0 - * - * @param {number} value - The value to round. - * @param {number} [place=0] - The place to round to. - * @param {number} [base=10] - The base to round in. Default is 10 for decimal. - * - * @return {number} The rounded value. - */ -var CeilTo = function (value, place, base) -{ - if (place === undefined) { place = 0; } - if (base === undefined) { base = 10; } - - var p = Math.pow(base, -place); - - return Math.ceil(value * p) / p; -}; - -module.exports = CeilTo; - - -/***/ }), -/* 160 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates the positive difference of two given numbers. - * - * @function Phaser.Math.Difference - * @since 3.0.0 - * - * @param {number} a - The first number in the calculation. - * @param {number} b - The second number in the calculation. - * - * @return {number} The positive difference of the two given numbers. - */ -var Difference = function (a, b) -{ - return Math.abs(a - b); -}; - -module.exports = Difference; - - -/***/ }), -/* 161 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(4); -var Class = __webpack_require__(0); -var Matrix4 = __webpack_require__(21); -var NOOP = __webpack_require__(1); - -var tempMatrix = new Matrix4(); - -/** - * @classdesc - * - * @class Euler - * @memberof Phaser.Math - * @constructor - * @since 3.50.0 - * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - */ -var Euler = new Class({ - - initialize: - - function Euler (x, y, z, order) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (z === undefined) { z = 0; } - if (order === undefined) { order = Euler.DefaultOrder; } - - this._x = x; - this._y = y; - this._z = z; - this._order = order; - - this.onChangeCallback = NOOP; - }, - - x: { - get: function () - { - return this._x; - }, - - set: function (value) - { - this._x = value; - - this.onChangeCallback(this); - } - }, - - y: { - get: function () - { - return this._y; - }, - - set: function (value) - { - this._y = value; - - this.onChangeCallback(this); - } - }, - - z: { - get: function () - { - return this._z; - }, - - set: function (value) - { - this._z = value; - - this.onChangeCallback(this); - } - }, - - order: { - get: function () - { - return this._order; - }, - - set: function (value) - { - this._order = value; - - this.onChangeCallback(this); - } - }, - - set: function (x, y, z, order) - { - if (order === undefined) { order = this._order; } - - this._x = x; - this._y = y; - this._z = z; - this._order = order; - - this.onChangeCallback(this); - - return this; - }, - - copy: function (euler) - { - return this.set(euler.x, euler.y, euler.z, euler.order); - }, - - setFromQuaternion: function (quaternion, order, update) - { - if (order === undefined) { order = this._order; } - if (update === undefined) { update = false; } - - tempMatrix.fromQuat(quaternion); - - return this.setFromRotationMatrix(tempMatrix, order, update); - }, - - setFromRotationMatrix: function (matrix, order, update) - { - if (order === undefined) { order = this._order; } - if (update === undefined) { update = false; } - - var elements = matrix.val; - - // Upper 3x3 of matrix is un-scaled rotation matrix - var m11 = elements[0]; - var m12 = elements[4]; - var m13 = elements[8]; - var m21 = elements[1]; - var m22 = elements[5]; - var m23 = elements[9]; - var m31 = elements[2]; - var m32 = elements[6]; - var m33 = elements[10]; - - var x = 0; - var y = 0; - var z = 0; - var epsilon = 0.99999; - - switch (order) - { - case 'XYZ': - { - y = Math.asin(Clamp(m13, -1, 1)); - - if (Math.abs(m13) < epsilon) - { - x = Math.atan2(-m23, m33); - z = Math.atan2(-m12, m11); - } - else - { - x = Math.atan2(m32, m22); - } - - break; - } - - case 'YXZ': - { - x = Math.asin(-Clamp(m23, -1, 1)); - - if (Math.abs(m23) < epsilon) - { - y = Math.atan2(m13, m33); - z = Math.atan2(m21, m22); - } - else - { - y = Math.atan2(-m31, m11); - } - - break; - } - - case 'ZXY': - { - x = Math.asin(Clamp(m32, -1, 1)); - - if (Math.abs(m32) < epsilon) - { - y = Math.atan2(-m31, m33); - z = Math.atan2(-m12, m22); - } - else - { - z = Math.atan2(m21, m11); - } - - break; - } - - case 'ZYX': - { - y = Math.asin(-Clamp(m31, -1, 1)); - - if (Math.abs(m31) < epsilon) - { - x = Math.atan2(m32, m33); - z = Math.atan2(m21, m11); - } - else - { - z = Math.atan2(-m12, m22); - } - - break; - } - - case 'YZX': - { - z = Math.asin(Clamp(m21, -1, 1)); - - if (Math.abs(m21) < epsilon) - { - x = Math.atan2(-m23, m22); - y = Math.atan2(-m31, m11); - } - else - { - y = Math.atan2(m13, m33); - } - - break; - } - - case 'XZY': - { - z = Math.asin(-Clamp(m12, -1, 1)); - - if (Math.abs(m12) < epsilon) - { - x = Math.atan2(m32, m22); - y = Math.atan2(m13, m11); - } - else - { - x = Math.atan2(-m23, m33); - } - - break; - } - } - - this._x = x; - this._y = y; - this._z = z; - this._order = order; - - if (update) - { - this.onChangeCallback(this); - } - - return this; - } - -}); - -Euler.RotationOrders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ]; - -Euler.DefaultOrder = 'XYZ'; - -module.exports = Euler; - - -/***/ }), -/* 162 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Floors to some place comparative to a `base`, default is 10 for decimal place. - * - * The `place` is represented by the power applied to `base` to get that place. - * - * @function Phaser.Math.FloorTo - * @since 3.0.0 - * - * @param {number} value - The value to round. - * @param {number} [place=0] - The place to round to. - * @param {number} [base=10] - The base to round in. Default is 10 for decimal. - * - * @return {number} The rounded value. - */ -var FloorTo = function (value, place, base) -{ - if (place === undefined) { place = 0; } - if (base === undefined) { base = 10; } - - var p = Math.pow(base, -place); - - return Math.floor(value * p) / p; -}; - -module.exports = FloorTo; - - -/***/ }), -/* 163 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(4); - -/** - * Return a value based on the range between `min` and `max` and the percentage given. - * - * @function Phaser.Math.FromPercent - * @since 3.0.0 - * - * @param {number} percent - A value between 0 and 1 representing the percentage. - * @param {number} min - The minimum value. - * @param {number} [max] - The maximum value. - * - * @return {number} The value that is `percent` percent between `min` and `max`. - */ -var FromPercent = function (percent, min, max) -{ - percent = Clamp(percent, 0, 1); - - return (max - min) * percent + min; -}; - -module.exports = FromPercent; - - -/***/ }), -/* 164 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate a per-ms speed from a distance and time (given in seconds). - * - * @function Phaser.Math.GetSpeed - * @since 3.0.0 - * - * @param {number} distance - The distance. - * @param {number} time - The time, in seconds. - * - * @return {number} The speed, in distance per ms. - * - * @example - * // 400px over 1 second is 0.4 px/ms - * Phaser.Math.GetSpeed(400, 1) // -> 0.4 - */ -var GetSpeed = function (distance, time) -{ - return (distance / time) / 1000; -}; - -module.exports = GetSpeed; - - -/***/ }), -/* 165 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check if a given value is an even number. - * - * @function Phaser.Math.IsEven - * @since 3.0.0 - * - * @param {number} value - The number to perform the check with. - * - * @return {boolean} Whether the number is even or not. - */ -var IsEven = function (value) -{ - // Use abstract equality == for "is number" test - - // eslint-disable-next-line eqeqeq - return (value == parseFloat(value)) ? !(value % 2) : void 0; -}; - -module.exports = IsEven; - - -/***/ }), -/* 166 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check if a given value is an even number using a strict type check. - * - * @function Phaser.Math.IsEvenStrict - * @since 3.0.0 - * - * @param {number} value - The number to perform the check with. - * - * @return {boolean} Whether the number is even or not. - */ -var IsEvenStrict = function (value) -{ - // Use strict equality === for "is number" test - return (value === parseFloat(value)) ? !(value % 2) : void 0; -}; - -module.exports = IsEvenStrict; - - -/***/ }), -/* 167 */ -/***/ (function(module, exports) { - -/** - * @author Greg McLean - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Interpolates two given Vectors and returns a new Vector between them. - * - * Does not modify either of the passed Vectors. - * - * @function Phaser.Math.LinearXY - * @since 3.60.0 - * - * @param {Phaser.Math.Vector2} vector1 - Starting vector - * @param {Phaser.Math.Vector2} vector2 - Ending vector - * @param {number} [t=0] - The percentage between vector1 and vector2 to return, represented as a number between 0 and 1. - * - * @return {Phaser.Math.Vector2} The step t% of the way between vector1 and vector2. - */ -var LinearXY = function (vector1, vector2, t) -{ - if (t === undefined) { t = 0; } - - return vector1.clone().lerp(vector2, t); -}; - -module.exports = LinearXY; - - -/***/ }), -/* 168 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Add an `amount` to a `value`, limiting the maximum result to `max`. - * - * @function Phaser.Math.MaxAdd - * @since 3.0.0 - * - * @param {number} value - The value to add to. - * @param {number} amount - The amount to add. - * @param {number} max - The maximum value to return. - * - * @return {number} The resulting value. - */ -var MaxAdd = function (value, amount, max) -{ - return Math.min(value + amount, max); -}; - -module.exports = MaxAdd; - - -/***/ }), -/* 169 */ -/***/ (function(module, exports) { - -/** - * @author Vladislav Forsh - * @copyright 2021 RoboWhale - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the median of the given values. The values are sorted and the middle value is returned. - * In case of an even number of values, the average of the two middle values is returned. - * - * @function Phaser.Math.Median - * @since 3.54.0 - * - * @param {number[]} values - The values to average. - * - * @return {number} The median value. - */ -var Median = function (values) -{ - var valuesNum = values.length; - if (valuesNum === 0) - { - return 0; - } - - values.sort(function (a, b) { return a - b; }); - - var halfIndex = Math.floor(valuesNum / 2); - - return valuesNum % 2 === 0 - ? (values[halfIndex] + values[halfIndex - 1]) / 2 - : values[halfIndex]; -}; - -module.exports = Median; - - -/***/ }), -/* 170 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Subtract an `amount` from `value`, limiting the minimum result to `min`. - * - * @function Phaser.Math.MinSub - * @since 3.0.0 - * - * @param {number} value - The value to subtract from. - * @param {number} amount - The amount to subtract. - * @param {number} min - The minimum value to return. - * - * @return {number} The resulting value. - */ -var MinSub = function (value, amount, min) -{ - return Math.max(value - amount, min); -}; - -module.exports = MinSub; - - -/***/ }), -/* 171 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Work out what percentage `value` is of the range between `min` and `max`. - * If `max` isn't given then it will return the percentage of `value` to `min`. - * - * You can optionally specify an `upperMax` value, which is a mid-way point in the range that represents 100%, after which the % starts to go down to zero again. - * - * @function Phaser.Math.Percent - * @since 3.0.0 - * - * @param {number} value - The value to determine the percentage of. - * @param {number} min - The minimum value. - * @param {number} [max] - The maximum value. - * @param {number} [upperMax] - The mid-way point in the range that represents 100%. - * - * @return {number} A value between 0 and 1 representing the percentage. - */ -var Percent = function (value, min, max, upperMax) -{ - if (max === undefined) { max = min + 1; } - - var percentage = (value - min) / (max - min); - - if (percentage > 1) - { - if (upperMax !== undefined) - { - percentage = ((upperMax - value)) / (upperMax - max); - - if (percentage < 0) - { - percentage = 0; - } - } - else - { - percentage = 1; - } - } - else if (percentage < 0) - { - percentage = 0; - } - - return percentage; -}; - -module.exports = Percent; - - -/***/ }), -/* 172 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Compute a random unit vector. - * - * Computes random values for the given vector between -1 and 1 that can be used to represent a direction. - * - * Optionally accepts a scale value to scale the resulting vector by. - * - * @function Phaser.Math.RandomXY - * @since 3.0.0 - * - * @param {Phaser.Math.Vector2} vector - The Vector to compute random values for. - * @param {number} [scale=1] - The scale of the random values. - * - * @return {Phaser.Math.Vector2} The given Vector. - */ -var RandomXY = function (vector, scale) -{ - if (scale === undefined) { scale = 1; } - - var r = Math.random() * 2 * Math.PI; - - vector.x = Math.cos(r) * scale; - vector.y = Math.sin(r) * scale; - - return vector; -}; - -module.exports = RandomXY; - - -/***/ }), -/* 173 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Compute a random position vector in a spherical area, optionally defined by the given radius. - * - * @function Phaser.Math.RandomXYZ - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} vec3 - The Vector to compute random values for. - * @param {number} [radius=1] - The radius. - * - * @return {Phaser.Math.Vector3} The given Vector. - */ -var RandomXYZ = function (vec3, radius) -{ - if (radius === undefined) { radius = 1; } - - var r = Math.random() * 2 * Math.PI; - var z = (Math.random() * 2) - 1; - var zScale = Math.sqrt(1 - z * z) * radius; - - vec3.x = Math.cos(r) * zScale; - vec3.y = Math.sin(r) * zScale; - vec3.z = z * radius; - - return vec3; -}; - -module.exports = RandomXYZ; - - -/***/ }), -/* 174 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Compute a random four-dimensional vector. - * - * @function Phaser.Math.RandomXYZW - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} vec4 - The Vector to compute random values for. - * @param {number} [scale=1] - The scale of the random values. - * - * @return {Phaser.Math.Vector4} The given Vector. - */ -var RandomXYZW = function (vec4, scale) -{ - if (scale === undefined) { scale = 1; } - - vec4.x = (Math.random() * 2 - 1) * scale; - vec4.y = (Math.random() * 2 - 1) * scale; - vec4.z = (Math.random() * 2 - 1) * scale; - vec4.w = (Math.random() * 2 - 1) * scale; - - return vec4; -}; - -module.exports = RandomXYZW; - - -/***/ }), -/* 175 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotate a given point by a given angle around the origin (0, 0), in an anti-clockwise direction. - * - * @function Phaser.Math.Rotate - * @since 3.0.0 - * - * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. - * @param {number} angle - The angle to be rotated by in an anticlockwise direction. - * - * @return {Phaser.Geom.Point} The given point, rotated by the given angle in an anticlockwise direction. - */ -var Rotate = function (point, angle) -{ - var x = point.x; - var y = point.y; - - point.x = (x * Math.cos(angle)) - (y * Math.sin(angle)); - point.y = (x * Math.sin(angle)) + (y * Math.cos(angle)); - - return point; -}; - -module.exports = Rotate; - - -/***/ }), -/* 176 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotate a `point` around `x` and `y` by the given `angle` and `distance`. - * - * In polar notation, this maps a point from (r, t) to (distance, t + angle), vs. the origin (x, y). - * - * @function Phaser.Math.RotateAroundDistance - * @since 3.0.0 - * - * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] - * - * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. - * @param {number} x - The horizontal coordinate to rotate around. - * @param {number} y - The vertical coordinate to rotate around. - * @param {number} angle - The angle of rotation in radians. - * @param {number} distance - The distance from (x, y) to place the point at. - * - * @return {Phaser.Types.Math.Vector2Like} The given point. - */ -var RotateAroundDistance = function (point, x, y, angle, distance) -{ - var t = angle + Math.atan2(point.y - y, point.x - x); - - point.x = x + (distance * Math.cos(t)); - point.y = y + (distance * Math.sin(t)); - - return point; -}; - -module.exports = RotateAroundDistance; - - -/***/ }), -/* 177 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Position a `point` at the given `angle` and `distance` to (`x`, `y`). - * - * @function Phaser.Math.RotateTo - * @since 3.24.0 - * - * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] - * - * @param {Phaser.Types.Math.Vector2Like} point - The point to be positioned. - * @param {number} x - The horizontal coordinate to position from. - * @param {number} y - The vertical coordinate to position from. - * @param {number} angle - The angle of rotation in radians. - * @param {number} distance - The distance from (x, y) to place the point at. - * - * @return {Phaser.Types.Math.Vector2Like} The given point. - */ -var RotateTo = function (point, x, y, angle, distance) -{ - point.x = x + (distance * Math.cos(angle)); - point.y = y + (distance * Math.sin(angle)); - - return point; -}; - -module.exports = RotateTo; - - -/***/ }), -/* 178 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Round a value to the given precision. - * - * For example: - * - * ```javascript - * RoundTo(123.456, 0) = 123 - * RoundTo(123.456, 1) = 120 - * RoundTo(123.456, 2) = 100 - * ``` - * - * To round the decimal, i.e. to round to precision, pass in a negative `place`: - * - * ```javascript - * RoundTo(123.456789, 0) = 123 - * RoundTo(123.456789, -1) = 123.5 - * RoundTo(123.456789, -2) = 123.46 - * RoundTo(123.456789, -3) = 123.457 - * ``` - * - * @function Phaser.Math.RoundTo - * @since 3.0.0 - * - * @param {number} value - The value to round. - * @param {number} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. - * @param {number} [base=10] - The base to round in. Default is 10 for decimal. - * - * @return {number} The rounded value. - */ -var RoundTo = function (value, place, base) -{ - if (place === undefined) { place = 0; } - if (base === undefined) { base = 10; } - - var p = Math.pow(base, -place); - - return Math.round(value * p) / p; -}; - -module.exports = RoundTo; - - -/***/ }), -/* 179 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Generate a series of sine and cosine values. - * - * @function Phaser.Math.SinCosTableGenerator - * @since 3.0.0 - * - * @param {number} length - The number of values to generate. - * @param {number} [sinAmp=1] - The sine value amplitude. - * @param {number} [cosAmp=1] - The cosine value amplitude. - * @param {number} [frequency=1] - The frequency of the values. - * - * @return {Phaser.Types.Math.SinCosTable} The generated values. - */ -var SinCosTableGenerator = function (length, sinAmp, cosAmp, frequency) -{ - if (sinAmp === undefined) { sinAmp = 1; } - if (cosAmp === undefined) { cosAmp = 1; } - if (frequency === undefined) { frequency = 1; } - - frequency *= Math.PI / length; - - var cos = []; - var sin = []; - - for (var c = 0; c < length; c++) - { - cosAmp -= sinAmp * frequency; - sinAmp += cosAmp * frequency; - - cos[c] = cosAmp; - sin[c] = sinAmp; - } - - return { - sin: sin, - cos: cos, - length: length - }; -}; - -module.exports = SinCosTableGenerator; - - -/***/ }), -/* 180 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Vector2 = __webpack_require__(2); - -/** - * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid. - * - * For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2. - * - * If the given index is out of range an empty Vector2 is returned. - * - * @function Phaser.Math.ToXY - * @since 3.19.0 - * - * @param {number} index - The position within the grid to get the x/y value for. - * @param {number} width - The width of the grid. - * @param {number} height - The height of the grid. - * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created. - * - * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index. - */ -var ToXY = function (index, width, height, out) -{ - if (out === undefined) { out = new Vector2(); } - - var x = 0; - var y = 0; - var total = width * height; - - if (index > 0 && index <= total) - { - if (index > width - 1) - { - y = Math.floor(index / width); - x = index - (y * width); - } - else - { - x = index; - } - } - - return out.set(x, y); -}; - -module.exports = ToXY; - - -/***/ }), -/* 181 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if the two values are within the given `tolerance` of each other. - * - * @function Phaser.Math.Within - * @since 3.0.0 - * - * @param {number} a - The first value to use in the calculation. - * @param {number} b - The second value to use in the calculation. - * @param {number} tolerance - The tolerance. Anything equal to or less than this value is considered as being within range. - * - * @return {boolean} Returns `true` if `a` is less than or equal to the tolerance of `b`. - */ -var Within = function (a, b, tolerance) -{ - return (Math.abs(a - b) <= tolerance); -}; - -module.exports = Within; - - -/***/ }), -/* 182 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A representation of a vector in 4D space. - * - * A four-component vector. - * - * @class Vector4 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - * @param {number} [w] - The w component. - */ -var Vector4 = new Class({ - - initialize: - - function Vector4 (x, y, z, w) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector4#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector4#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - /** - * The z component of this Vector. - * - * @name Phaser.Math.Vector4#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.z = 0; - - /** - * The w component of this Vector. - * - * @name Phaser.Math.Vector4#w - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.w = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; - } - }, - - /** - * Make a clone of this Vector4. - * - * @method Phaser.Math.Vector4#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector4} A clone of this Vector4. - */ - clone: function () - { - return new Vector4(this.x, this.y, this.z, this.w); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector4#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - copy: function (src) - { - this.x = src.x; - this.y = src.y; - this.z = src.z || 0; - this.w = src.w || 0; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict quality check against each Vector's components. - * - * @method Phaser.Math.Vector4#equals - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} v - The vector to check equality with. - * - * @return {boolean} A boolean indicating whether the two Vectors are equal or not. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z) && (this.w === v.w)); - }, - - /** - * Set the `x`, `y`, `z` and `w` components of the this Vector to the given `x`, `y`, `z` and `w` values. - * - * @method Phaser.Math.Vector4#set - * @since 3.0.0 - * - * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y, z and w components. - * @param {number} y - The y value to set for this Vector. - * @param {number} z - The z value to set for this Vector. - * @param {number} w - The z value to set for this Vector. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - set: function (x, y, z, w) - { - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; - } - - return this; - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector4#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - add: function (v) - { - this.x += v.x; - this.y += v.y; - this.z += v.z || 0; - this.w += v.w || 0; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector4#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - subtract: function (v) - { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z || 0; - this.w -= v.w || 0; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector4#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - scale: function (scale) - { - this.x *= scale; - this.y *= scale; - this.z *= scale; - this.w *= scale; - - return this; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector4#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return Math.sqrt(x * x + y * y + z * z + w * w); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector4#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return x * x + y * y + z * z + w * w; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector4#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - var len = x * x + y * y + z * z + w * w; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - this.z = z * len; - this.w = w * len; - } - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector4#dot - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} v - The Vector4 to dot product with this Vector4. - * - * @return {number} The dot product of this Vector and the given Vector. - */ - dot: function (v) - { - return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector4#lerp - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} v - The Vector4 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - lerp: function (v, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - this.w = aw + t * (v.w - aw); - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector4#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - multiply: function (v) - { - this.x *= v.x; - this.y *= v.y; - this.z *= v.z || 1; - this.w *= v.w || 1; - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector4#divide - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - divide: function (v) - { - this.x /= v.x; - this.y /= v.y; - this.z /= v.z || 1; - this.w /= v.w || 1; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector4#distance - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - var dw = v.w - this.w || 0; - - return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector4#distanceSq - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - var dw = v.w - this.w || 0; - - return dx * dx + dy * dy + dz * dz + dw * dw; - }, - - /** - * Negate the `x`, `y`, `z` and `w` components of this Vector. - * - * @method Phaser.Math.Vector4#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; - this.w = -this.w; - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector4#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector4 with. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[8] * z + m[12] * w; - this.y = m[1] * x + m[5] * y + m[9] * z + m[13] * w; - this.z = m[2] * x + m[6] * y + m[10] * z + m[14] * w; - this.w = m[3] * x + m[7] * y + m[11] * z + m[15] * w; - - return this; - }, - - /** - * Transform this Vector with the given Quaternion. - * - * @method Phaser.Math.Vector4#transformQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - transformQuat: function (q) - { - var x = this.x; - var y = this.y; - var z = this.z; - var qx = q.x; - var qy = q.y; - var qz = q.z; - var qw = q.w; - - // calculate quat * vec - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = -qx * x - qy * y - qz * z; - - // calculate result * inverse quat - this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; - this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; - this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; - - return this; - }, - - /** - * Make this Vector the zero vector (0, 0, 0, 0). - * - * @method Phaser.Math.Vector4#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - reset: function () - { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 0; - - return this; - } - -}); - -Vector4.prototype.sub = Vector4.prototype.subtract; -Vector4.prototype.mul = Vector4.prototype.multiply; -Vector4.prototype.div = Vector4.prototype.divide; -Vector4.prototype.dist = Vector4.prototype.distance; -Vector4.prototype.distSq = Vector4.prototype.distanceSq; -Vector4.prototype.len = Vector4.prototype.length; -Vector4.prototype.lenSq = Vector4.prototype.lengthSq; - -module.exports = Vector4; - - -/***/ }), -/* 183 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Vector3 = __webpack_require__(14); -var Matrix4 = __webpack_require__(21); -var Quaternion = __webpack_require__(45); - -var tmpMat4 = new Matrix4(); -var tmpQuat = new Quaternion(); -var tmpVec3 = new Vector3(); - -/** - * Rotates a vector in place by axis angle. - * - * This is the same as transforming a point by an - * axis-angle quaternion, but it has higher precision. - * - * @function Phaser.Math.RotateVec3 - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} vec - The vector to be rotated. - * @param {Phaser.Math.Vector3} axis - The axis to rotate around. - * @param {number} radians - The angle of rotation in radians. - * - * @return {Phaser.Math.Vector3} The given vector. - */ -var RotateVec3 = function (vec, axis, radians) -{ - // Set the quaternion to our axis angle - tmpQuat.setAxisAngle(axis, radians); - - // Create a rotation matrix from the axis angle - tmpMat4.fromRotationTranslation(tmpQuat, tmpVec3.set(0, 0, 0)); - - // Multiply our vector by the rotation matrix - return vec.transformMat4(tmpMat4); -}; - -module.exports = RotateVec3; - - -/***/ }), -/* 184 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scale Manager Resize Event. - * - * This event is dispatched whenever the Scale Manager detects a resize event from the browser. - * It sends three parameters to the callback, each of them being Size components. You can read - * the `width`, `height`, `aspectRatio` and other properties of these components to help with - * scaling your own game content. - * - * @event Phaser.Scale.Events#RESIZE - * @type {string} - * @since 3.16.1 - * - * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas. - * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size. - * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode. - * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width. - * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height. - */ -module.exports = 'resize'; - - -/***/ }), -/* 185 */ -/***/ (function(module, exports, __webpack_require__) { - -/** -* @author Richard Davey -* @copyright 2013-2023 Photon Storm Ltd. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/ - -var BasePlugin = __webpack_require__(186); -var Class = __webpack_require__(0); -var SceneEvents = __webpack_require__(23); - -/** - * @classdesc - * A Scene Level Plugin is installed into every Scene and belongs to that Scene. - * It can listen for Scene events and respond to them. - * It can map itself to a Scene property, or into the Scene Systems, or both. - * - * @class ScenePlugin - * @memberof Phaser.Plugins - * @extends Phaser.Plugins.BasePlugin - * @constructor - * @since 3.8.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin. - * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager. - * @param {string} pluginKey - The key under which this plugin has been installed into the Scene Systems. - */ -var ScenePlugin = new Class({ - - Extends: BasePlugin, - - initialize: - - function ScenePlugin (scene, pluginManager, pluginKey) - { - BasePlugin.call(this, pluginManager); - - /** - * A reference to the Scene that has installed this plugin. - * Only set if it's a Scene Plugin, otherwise `null`. - * This property is only set when the plugin is instantiated and added to the Scene, not before. - * You can use it during the `boot` method. - * - * @name Phaser.Plugins.ScenePlugin#scene - * @type {?Phaser.Scene} - * @protected - * @since 3.8.0 - */ - this.scene = scene; - - /** - * A reference to the Scene Systems of the Scene that has installed this plugin. - * Only set if it's a Scene Plugin, otherwise `null`. - * This property is only set when the plugin is instantiated and added to the Scene, not before. - * You can use it during the `boot` method. - * - * @name Phaser.Plugins.ScenePlugin#systems - * @type {?Phaser.Scenes.Systems} - * @protected - * @since 3.8.0 - */ - this.systems = scene.sys; - - /** - * The key under which this plugin was installed into the Scene Systems. - * - * This property is only set when the plugin is instantiated and added to the Scene, not before. - * You can use it during the `boot` method. - * - * @name Phaser.Plugins.ScenePlugin#pluginKey - * @type {string} - * @readonly - * @since 3.54.0 - */ - this.pluginKey = pluginKey; - - scene.sys.events.once(SceneEvents.BOOT, this.boot, this); - }, - - /** - * This method is called when the Scene boots. It is only ever called once. - * - * By this point the plugin properties `scene` and `systems` will have already been set. - * - * In here you can listen for {@link Phaser.Scenes.Events Scene events} and set-up whatever you need for this plugin to run. - * Here are the Scene events you can listen to: - * - * - start - * - ready - * - preupdate - * - update - * - postupdate - * - resize - * - pause - * - resume - * - sleep - * - wake - * - transitioninit - * - transitionstart - * - transitioncomplete - * - transitionout - * - shutdown - * - destroy - * - * At the very least you should offer a destroy handler for when the Scene closes down, i.e: - * - * ```javascript - * var eventEmitter = this.systems.events; - * eventEmitter.once('destroy', this.sceneDestroy, this); - * ``` - * - * @method Phaser.Plugins.ScenePlugin#boot - * @since 3.8.0 - */ - boot: function () - { - }, - - /** - * Game instance has been destroyed. - * - * You must release everything in here, all references, all objects, free it all up. - * - * @method Phaser.Plugins.ScenePlugin#destroy - * @since 3.8.0 - */ - destroy: function () - { - this.pluginManager = null; - this.game = null; - this.scene = null; - this.systems = null; - } - -}); - -module.exports = ScenePlugin; - - -/***/ }), -/* 186 */ -/***/ (function(module, exports, __webpack_require__) { - -/** -* @author Richard Davey -* @copyright 2013-2023 Photon Storm Ltd. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/ - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A Global Plugin is installed just once into the Game owned Plugin Manager. - * It can listen for Game events and respond to them. - * - * @class BasePlugin - * @memberof Phaser.Plugins - * @constructor - * @since 3.8.0 - * - * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager. - */ -var BasePlugin = new Class({ - - initialize: - - function BasePlugin (pluginManager) - { - /** - * A handy reference to the Plugin Manager that is responsible for this plugin. - * Can be used as a route to gain access to game systems and events. - * - * @name Phaser.Plugins.BasePlugin#pluginManager - * @type {Phaser.Plugins.PluginManager} - * @protected - * @since 3.8.0 - */ - this.pluginManager = pluginManager; - - /** - * A reference to the Game instance this plugin is running under. - * - * @name Phaser.Plugins.BasePlugin#game - * @type {Phaser.Game} - * @protected - * @since 3.8.0 - */ - this.game = pluginManager.game; - }, - - /** - * The PluginManager calls this method on a Global Plugin when the plugin is first instantiated. - * It will never be called again on this instance. - * In here you can set-up whatever you need for this plugin to run. - * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this. - * On a Scene Plugin, this method is never called. Use {@link Phaser.Plugins.ScenePlugin#boot} instead. - * - * @method Phaser.Plugins.BasePlugin#init - * @since 3.8.0 - * - * @param {?any} [data] - A value specified by the user, if any, from the `data` property of the plugin's configuration object (if started at game boot) or passed in the PluginManager's `install` method (if started manually). - */ - init: function () - { - }, - - /** - * The PluginManager calls this method on a Global Plugin when the plugin is started. - * If a plugin is stopped, and then started again, this will get called again. - * Typically called immediately after `BasePlugin.init`. - * On a Scene Plugin, this method is never called. - * - * @method Phaser.Plugins.BasePlugin#start - * @since 3.8.0 - */ - start: function () - { - // Here are the game-level events you can listen to. - // At the very least you should offer a destroy handler for when the game closes down. - - // var eventEmitter = this.game.events; - - // eventEmitter.once('destroy', this.gameDestroy, this); - // eventEmitter.on('pause', this.gamePause, this); - // eventEmitter.on('resume', this.gameResume, this); - // eventEmitter.on('resize', this.gameResize, this); - // eventEmitter.on('prestep', this.gamePreStep, this); - // eventEmitter.on('step', this.gameStep, this); - // eventEmitter.on('poststep', this.gamePostStep, this); - // eventEmitter.on('prerender', this.gamePreRender, this); - // eventEmitter.on('postrender', this.gamePostRender, this); - }, - - /** - * The PluginManager calls this method on a Global Plugin when the plugin is stopped. - * The game code has requested that your plugin stop doing whatever it does. - * It is now considered as 'inactive' by the PluginManager. - * Handle that process here (i.e. stop listening for events, etc) - * If the plugin is started again then `BasePlugin.start` will be called again. - * On a Scene Plugin, this method is never called. - * - * @method Phaser.Plugins.BasePlugin#stop - * @since 3.8.0 - */ - stop: function () - { - }, - - /** - * Game instance has been destroyed. - * You must release everything in here, all references, all objects, free it all up. - * - * @method Phaser.Plugins.BasePlugin#destroy - * @since 3.8.0 - */ - destroy: function () - { - this.pluginManager = null; - this.game = null; - this.scene = null; - this.systems = null; - } - -}); - -module.exports = BasePlugin; - - -/***/ }), -/* 187 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Object Added to Scene Event. - * - * This event is dispatched when a Game Object is added to a Scene. - * - * Listen for it from a Scene using `this.events.on('addedtoscene', listener)`. - * - * @event Phaser.Scenes.Events#ADDED_TO_SCENE - * @type {string} - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene. - * @param {Phaser.Scene} scene - The Scene to which the Game Object was added. - */ -module.exports = 'addedtoscene'; - - -/***/ }), -/* 188 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Boot Event. - * - * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins. - * - * Listen to it from a Scene using `this.events.on('boot', listener)`. - * - * @event Phaser.Scenes.Events#BOOT - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - */ -module.exports = 'boot'; - - -/***/ }), -/* 189 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Create Event. - * - * This event is dispatched by a Scene after it has been created by the Scene Manager. - * - * If a Scene has a `create` method then this event is emitted _after_ that has run. - * - * If there is a transition, this event will be fired after the `TRANSITION_START` event. - * - * Listen to it from a Scene using `this.events.on('create', listener)`. - * - * @event Phaser.Scenes.Events#CREATE - * @type {string} - * @since 3.17.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event. - */ -module.exports = 'create'; - - -/***/ }), -/* 190 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Destroy Event. - * - * This event is dispatched by a Scene during the Scene Systems destroy process. - * - * Listen to it from a Scene using `this.events.on('destroy', listener)`. - * - * You should destroy any resources that may be in use by your Scene in this event handler. - * - * @event Phaser.Scenes.Events#DESTROY - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - */ -module.exports = 'destroy'; - - -/***/ }), -/* 191 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Pause Event. - * - * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an - * action from another Scene. - * - * Listen to it from a Scene using `this.events.on('pause', listener)`. - * - * @event Phaser.Scenes.Events#PAUSE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was paused. - */ -module.exports = 'pause'; - - -/***/ }), -/* 192 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Post Update Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('postupdate', listener)`. - * - * A Scene will only run its step if it is active. - * - * @event Phaser.Scenes.Events#POST_UPDATE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. - * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. - */ -module.exports = 'postupdate'; - - -/***/ }), -/* 193 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Pre-Render Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to this event from a Scene using `this.events.on('prerender', listener)`. - * - * A Scene will only render if it is visible. - * - * This event is dispatched after the Scene Display List is sorted and before the Scene is rendered. - * - * @event Phaser.Scenes.Events#PRE_RENDER - * @type {string} - * @since 3.53.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. - */ -module.exports = 'prerender'; - - -/***/ }), -/* 194 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Pre Update Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('preupdate', listener)`. - * - * A Scene will only run its step if it is active. - * - * @event Phaser.Scenes.Events#PRE_UPDATE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. - * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. - */ -module.exports = 'preupdate'; - - -/***/ }), -/* 195 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Ready Event. - * - * This event is dispatched by a Scene during the Scene Systems start process. - * By this point in the process the Scene is now fully active and rendering. - * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event. - * - * Listen to it from a Scene using `this.events.on('ready', listener)`. - * - * @event Phaser.Scenes.Events#READY - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was started. - */ -module.exports = 'ready'; - - -/***/ }), -/* 196 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Object Removed from Scene Event. - * - * This event is dispatched when a Game Object is removed from a Scene. - * - * Listen for it from a Scene using `this.events.on('removedfromscene', listener)`. - * - * @event Phaser.Scenes.Events#REMOVED_FROM_SCENE - * @type {string} - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene. - * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed. - */ -module.exports = 'removedfromscene'; - - -/***/ }), -/* 197 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Render Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('render', listener)`. - * - * A Scene will only render if it is visible. - * - * By the time this event is dispatched, the Scene will have already been rendered. - * - * @event Phaser.Scenes.Events#RENDER - * @type {string} - * @since 3.0.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. - */ -module.exports = 'render'; - - -/***/ }), -/* 198 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Resume Event. - * - * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method, - * or as an action from another Scene. - * - * Listen to it from a Scene using `this.events.on('resume', listener)`. - * - * @event Phaser.Scenes.Events#RESUME - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was resumed. - */ -module.exports = 'resume'; - - -/***/ }), -/* 199 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Shutdown Event. - * - * This event is dispatched by a Scene during the Scene Systems shutdown process. - * - * Listen to it from a Scene using `this.events.on('shutdown', listener)`. - * - * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding - * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not - * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources. - * - * @event Phaser.Scenes.Events#SHUTDOWN - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was shutdown. - */ -module.exports = 'shutdown'; - - -/***/ }), -/* 200 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Sleep Event. - * - * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method, - * or as an action from another Scene. - * - * Listen to it from a Scene using `this.events.on('sleep', listener)`. - * - * @event Phaser.Scenes.Events#SLEEP - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was sent to sleep. - */ -module.exports = 'sleep'; - - -/***/ }), -/* 201 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Start Event. - * - * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins. - * - * Listen to it from a Scene using `this.events.on('start', listener)`. - * - * @event Phaser.Scenes.Events#START - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - */ -module.exports = 'start'; - - -/***/ }), -/* 202 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Transition Complete Event. - * - * This event is dispatched by the Target Scene of a transition. - * - * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration - * of the transition. - * - * Listen to it from a Scene using `this.events.on('transitioncomplete', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - * - * @event Phaser.Scenes.Events#TRANSITION_COMPLETE - * @type {string} - * @since 3.5.0 - * - * @param {Phaser.Scene} scene -The Scene on which the transitioned completed. - */ -module.exports = 'transitioncomplete'; - - -/***/ }), -/* 203 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Transition Init Event. - * - * This event is dispatched by the Target Scene of a transition. - * - * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method, - * this event is not dispatched. - * - * Listen to it from a Scene using `this.events.on('transitioninit', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - * - * @event Phaser.Scenes.Events#TRANSITION_INIT - * @type {string} - * @since 3.5.0 - * - * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. - * @param {number} duration - The duration of the transition in ms. - */ -module.exports = 'transitioninit'; - - -/***/ }), -/* 204 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Transition Out Event. - * - * This event is dispatched by a Scene when it initiates a transition to another Scene. - * - * Listen to it from a Scene using `this.events.on('transitionout', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - * - * @event Phaser.Scenes.Events#TRANSITION_OUT - * @type {string} - * @since 3.5.0 - * - * @param {Phaser.Scene} target - A reference to the Scene that is being transitioned to. - * @param {number} duration - The duration of the transition in ms. - */ -module.exports = 'transitionout'; - - -/***/ }), -/* 205 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Transition Start Event. - * - * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep. - * - * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method, - * this event is dispatched anyway. - * - * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is - * dispatched instead of this event. - * - * Listen to it from a Scene using `this.events.on('transitionstart', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - * - * @event Phaser.Scenes.Events#TRANSITION_START - * @type {string} - * @since 3.5.0 - * - * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. - * @param {number} duration - The duration of the transition in ms. - */ -module.exports = 'transitionstart'; - - -/***/ }), -/* 206 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Transition Wake Event. - * - * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before - * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead. - * - * Listen to it from a Scene using `this.events.on('transitionwake', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - * - * @event Phaser.Scenes.Events#TRANSITION_WAKE - * @type {string} - * @since 3.5.0 - * - * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. - * @param {number} duration - The duration of the transition in ms. - */ -module.exports = 'transitionwake'; - - -/***/ }), -/* 207 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Update Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists and the Scene is in a Running state, otherwise this is skipped. - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('update', listener)`. - * - * A Scene will only run its step if it is active. - * - * @event Phaser.Scenes.Events#UPDATE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. - * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. - */ -module.exports = 'update'; - - -/***/ }), -/* 208 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Wake Event. - * - * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method, - * or as an action from another Scene. - * - * Listen to it from a Scene using `this.events.on('wake', listener)`. - * - * @event Phaser.Scenes.Events#WAKE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was woken up. - */ -module.exports = 'wake'; - - -/***/ }), -/* 209 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 5782: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -31353,1735 +11422,387 @@ module.exports = 'wake'; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Class = __webpack_require__(0); -var GetFastValue = __webpack_require__(8); -var ImageFile = __webpack_require__(210); -var IsPlainObject = __webpack_require__(6); -var JSONFile = __webpack_require__(222); -var MultiFile = __webpack_require__(223); -var TextFile = __webpack_require__(224); - -/** - * @typedef {object} Phaser.Loader.FileTypes.SpineFileConfig - * - * @property {string} key - The key of the file. Must be unique within both the Loader and the Texture Manager. - * @property {string|string[]} [jsonURL] - The absolute or relative URL to load the JSON file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". - * @property {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @property {boolean} [preMultipliedAlpha=false] - Do the textures contain pre-multiplied alpha or not? - * @property {XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. - * @property {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. - */ +var Class = __webpack_require__(7473); +var Container = __webpack_require__(7361); +var SpineContainerRender = __webpack_require__(7738); /** * @classdesc - * A Spine File suitable for loading by the Loader. + * A Spine Container is a special kind of Container created specifically for Spine Game Objects. * - * These are created when you use the Phaser.Loader.LoaderPlugin#spine method and are not typically created directly. + * You have all of the same features of a standard Container, but the rendering functions are optimized specifically + * for Spine Game Objects. You must only add ever Spine Game Objects, or other Spine Containers, to this type of Container. + * Although Phaser will not prevent you from adding other types, they will not render and are likely to throw runtime errors. * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spine. + * To create one in a Scene, use the factory methods: * - * @class SpineFile - * @extends Phaser.Loader.MultiFile - * @memberof Phaser.Loader.FileTypes + * ```javascript + * this.add.spineContainer(); + * ``` + * + * or + * + * ```javascript + * this.make.spineContainer(); + * ``` + * + * Note that you should not nest Spine Containers inside regular Containers if you wish to use masks on the + * container children. You can, however, mask children of Spine Containers if they are embedded within other + * Spine Containers. In short, if you need masking, don't mix and match the types. + * + * See the Container documentation for further details about what Containers can do. + * + * @class SpineContainer + * @extends Phaser.GameObjects.Container * @constructor + * @since 3.50.0 * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Loader.FileTypes.SpineFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string|string[]} [jsonURL] - The absolute or relative URL to load the JSON file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". - * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @param {boolean} [preMultipliedAlpha=false] - Do the textures contain pre-multiplied alpha or not? - * @param {XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. - * @param {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Scene} scene - A reference to the Scene that this Game Object belongs to. + * @param {SpinePlugin} pluginManager - A reference to the Phaser Spine Plugin. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {SpineGameObject[]} [children] - An optional array of Spine Game Objects to add to this Container. */ -var SpineFile = new Class({ +var SpineContainer = new Class({ - Extends: MultiFile, + Extends: Container, + + Mixins: [ + SpineContainerRender + ], initialize: - function SpineFile (loader, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings) + function SpineContainer (scene, plugin, x, y, children) { - var i; - var json; - var atlas; - var files = []; - var cache = loader.cacheManager.custom.spine; + Container.call(this, scene, x, y, children); - // atlas can be an array of atlas files, not just a single one + // Same as SpineGameObject, to prevent the renderer from mis-typing it when batching + this.type = 'Spine'; - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - - json = new JSONFile(loader, { - key: key, - url: GetFastValue(config, 'jsonURL'), - extension: GetFastValue(config, 'jsonExtension', 'json'), - xhrSettings: GetFastValue(config, 'jsonXhrSettings') - }); - - atlasURL = GetFastValue(config, 'atlasURL'); - preMultipliedAlpha = GetFastValue(config, 'preMultipliedAlpha'); - - if (!Array.isArray(atlasURL)) - { - atlasURL = [ atlasURL ]; - } - - for (i = 0; i < atlasURL.length; i++) - { - atlas = new TextFile(loader, { - key: key + '!' + i, - url: atlasURL[i], - extension: GetFastValue(config, 'atlasExtension', 'atlas'), - xhrSettings: GetFastValue(config, 'atlasXhrSettings') - }); - - atlas.cache = cache; - - files.push(atlas); - } - } - else - { - json = new JSONFile(loader, key, jsonURL, jsonXhrSettings); - - if (!Array.isArray(atlasURL)) - { - atlasURL = [ atlasURL ]; - } - - for (i = 0; i < atlasURL.length; i++) - { - atlas = new TextFile(loader, key + '!' + i, atlasURL[i], atlasXhrSettings); - atlas.cache = cache; - - files.push(atlas); - } - } - - files.unshift(json); - - MultiFile.call(this, loader, 'spine', key, files); - - this.config.preMultipliedAlpha = preMultipliedAlpha; + /** + * A reference to the Spine Plugin. + * + * @name SpineContainer#plugin + * @type {SpinePlugin} + * @since 3.50.0 + */ + this.plugin = plugin; }, /** - * Called by each File when it finishes loading. + * Internal destroy handler, called as part of the destroy process. * - * @method Phaser.Loader.FileTypes.SpineFile#onFileComplete - * @since 3.19.0 - * - * @param {Phaser.Loader.File} file - The File that has completed processing. + * @method SpineContainer#preDestroy + * @protected + * @since 3.50.0 */ - onFileComplete: function (file) + preDestroy: function () { - var index = this.files.indexOf(file); + this.removeAll(!!this.exclusive); - if (index !== -1) - { - this.pending--; + this.localTransform.destroy(); + this.tempTransformMatrix.destroy(); - if (file.type === 'text') - { - // Inspect the data for the files to now load - var content = file.data.split('\n'); - - // Extract the textures - var textures = [ content[0] ]; - - for (var t = 0; t < content.length; t++) - { - var line = content[t]; - - if (line.trim() === '' && t < content.length - 1) - { - line = content[t + 1]; - - textures.push(line); - } - } - - var config = this.config; - var loader = this.loader; - - var currentBaseURL = loader.baseURL; - var currentPath = loader.path; - var currentPrefix = loader.prefix; - - var baseURL = GetFastValue(config, 'baseURL', this.baseURL); - var path = GetFastValue(config, 'path', file.src.match(/^.*\//))[0]; - var prefix = GetFastValue(config, 'prefix', this.prefix); - var textureXhrSettings = GetFastValue(config, 'textureXhrSettings'); - - loader.setBaseURL(baseURL); - loader.setPath(path); - loader.setPrefix(prefix); - - for (var i = 0; i < textures.length; i++) - { - var textureURL = textures[i]; - - var key = textureURL; - - var image = new ImageFile(loader, key, textureURL, textureXhrSettings); - - if (!loader.keyExists(image)) - { - this.addToMultiFile(image); - - loader.addFile(image); - } - } - - // Reset the loader settings - loader.setBaseURL(currentBaseURL); - loader.setPath(currentPath); - loader.setPrefix(currentPrefix); - } - } - }, - - /** - * Adds this file to its target cache upon successful loading and processing. - * - * @method Phaser.Loader.FileTypes.SpineFile#addToCache - * @since 3.19.0 - */ - addToCache: function () - { - if (this.isReadyToProcess()) - { - var fileJSON = this.files[0]; - - fileJSON.addToCache(); - - var atlasCache; - var atlasKey = ''; - var combinedAtlasData = ''; - var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false; - var textureManager = this.loader.textureManager; - - for (var i = 1; i < this.files.length; i++) - { - var file = this.files[i]; - - if (file.type === 'text') - { - atlasKey = file.key.replace(/![\d]$/, ''); - - atlasCache = file.cache; - - combinedAtlasData = combinedAtlasData.concat(file.data); - } - else - { - var src = file.key.trim(); - var pos = src.indexOf('!'); - var key = src.substr(pos + 1); - - if (!textureManager.exists(key)) - { - textureManager.addImage(key, file.data); - } - } - - file.pendingDestroy(); - } - - atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlasData, prefix: this.prefix }); - - this.complete = true; - } + this.list = []; + this._displayList = null; + this.plugin = null; } }); -module.exports = SpineFile; +module.exports = SpineContainer; /***/ }), -/* 210 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8064: +/***/ ((module) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); -var CONST = __webpack_require__(9); -var File = __webpack_require__(24); -var FileTypesManager = __webpack_require__(25); -var GetFastValue = __webpack_require__(8); -var IsPlainObject = __webpack_require__(6); -var GetURL = __webpack_require__(48); - /** - * @classdesc - * A single Image File suitable for loading by the Loader. + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. * - * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly. + * @method Phaser.GameObjects.Container#renderCanvas + * @since 3.4.0 + * @private * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image. - * - * @class ImageFile - * @extends Phaser.Loader.File - * @memberof Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets. + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ImageFile = new Class({ +var SpineContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) +{ + var children = container.list; - Extends: File, - - initialize: - - function ImageFile (loader, key, url, xhrSettings, frameConfig) + if (children.length === 0) { - var extension = 'png'; - var normalMapURL; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - normalMapURL = GetFastValue(config, 'normalMap'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - frameConfig = GetFastValue(config, 'frameConfig'); - } - - if (Array.isArray(url)) - { - normalMapURL = url[1]; - url = url[0]; - } - - var fileConfig = { - type: 'image', - cache: loader.textureManager, - extension: extension, - responseType: 'blob', - key: key, - url: url, - xhrSettings: xhrSettings, - config: frameConfig - }; - - File.call(this, loader, fileConfig); - - // Do we have a normal map to load as well? - if (normalMapURL) - { - var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig); - - normalMap.type = 'normalMap'; - - this.setLink(normalMap); - - loader.addFile(normalMap); - } - - this.useImageElementLoad = loader.imageLoadType === 'HTMLImageElement'; - - if (this.useImageElementLoad) - { - this.load = this.loadImage; - this.onProcess = this.onProcessImage; - } - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.ImageFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - this.state = CONST.FILE_PROCESSING; - - this.data = new Image(); - - this.data.crossOrigin = this.crossOrigin; - - var _this = this; - - this.data.onload = function () - { - File.revokeObjectURL(_this.data); - - _this.onProcessComplete(); - }; - - this.data.onerror = function () - { - File.revokeObjectURL(_this.data); - - _this.onProcessError(); - }; - - File.createObjectURL(this.data, this.xhrLoader.response, 'image/png'); - }, - - /** - * Handles image load processing. - * - * @method Phaser.Loader.FileTypes.ImageFile#onProcessImage - * @private - * @since 3.60.0 - */ - onProcessImage: function () - { - var result = this.state; - - this.state = CONST.FILE_PROCESSING; - - if (result === CONST.FILE_LOADED) - { - this.onProcessComplete(); - } - else - { - this.onProcessError(); - } - }, - - /** - * Loads the image using either XHR or an Image tag. - * - * @method Phaser.Loader.FileTypes.ImageFile#loadImage - * @private - * @since 3.60.0 - */ - loadImage: function () - { - this.state = CONST.FILE_LOADING; - - this.src = GetURL(this, this.loader.baseURL); - - if (this.src.indexOf('data:') === 0) - { - console.warn('Local data URIs are not supported: ' + this.key); - } - else - { - this.data = new Image(); - - this.data.crossOrigin = this.crossOrigin; - - var _this = this; - - this.data.onload = function () - { - _this.state = CONST.FILE_LOADED; - - _this.loader.nextFile(_this, true); - }; - - this.data.onerror = function () - { - _this.loader.nextFile(_this, false); - }; - - this.data.src = this.src; - } - }, - - /** - * Adds this file to its target cache upon successful loading and processing. - * - * @method Phaser.Loader.FileTypes.ImageFile#addToCache - * @since 3.7.0 - */ - addToCache: function () - { - // Check if we have a linked normal map - var linkFile = this.linkFile; - - if (linkFile) - { - // We do, but has it loaded? - if (linkFile.state >= CONST.FILE_COMPLETE) - { - // Both files have loaded - if (this.type === 'normalMap') - { - // linkFile.data = Image - // this.data = Normal Map - this.cache.addImage(this.key, linkFile.data, this.data); - } - else - { - // linkFile.data = Normal Map - // this.data = Image - this.cache.addImage(this.key, this.data, linkFile.data); - } - } - - // Nothing to do here, we'll use the linkFile `addToCache` call - // to process this pair - } - else - { - this.cache.addImage(this.key, this.data); - } + return; } -}); + camera.addToRenderList(container); -/** - * Adds an Image, or array of Images, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.image('logo', 'images/phaserLogo.png'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. - * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback - * of animated gifs to Canvas elements. - * - * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the Texture Manager first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.image({ - * key: 'logo', - * url: 'images/AtariLogo.png' - * }); - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details. - * - * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: - * - * ```javascript - * this.load.image('logo', 'images/AtariLogo.png'); - * // and later in your game ... - * this.add.image(x, y, 'logo'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and - * this is what you would use to retrieve the image from the Texture Manager. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" - * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, - * then you can specify it by providing an array as the `url` where the second element is the normal map: - * - * ```javascript - * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]); - * ``` - * - * Or, if you are using a config object use the `normalMap` property: - * - * ```javascript - * this.load.image({ - * key: 'logo', - * url: 'images/AtariLogo.png', - * normalMap: 'images/AtariLogo-n.png' - * }); - * ``` - * - * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. - * Normal maps are a WebGL only feature. - * - * In Phaser 3.60 a new property was added that allows you to control how images are loaded. By default, images are loaded via XHR as Blobs. - * However, you can set `loader.imageLoadType: "HTMLImageElement"` in the Game Configuration and instead, the Loader will load all images - * via the Image tag instead. - * - * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#image - * @fires Phaser.Loader.LoaderPlugin#ADD - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig|Phaser.Types.Loader.FileTypes.ImageFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {this} The Loader instance. - */ -FileTypesManager.register('image', function (key, url, xhrSettings) -{ - if (Array.isArray(key)) + var transformMatrix = container.localTransform; + + if (parentMatrix) { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new ImageFile(this, key[i])); - } + transformMatrix.loadIdentity(); + transformMatrix.multiply(parentMatrix); + transformMatrix.translate(container.x, container.y); + transformMatrix.rotate(container.rotation); + transformMatrix.scale(container.scaleX, container.scaleY); } else { - this.addFile(new ImageFile(this, key, url, xhrSettings)); + transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); } - return this; -}); + var containerHasBlendMode = (container.blendMode !== -1); -module.exports = ImageFile; + if (!containerHasBlendMode) + { + // If Container is SKIP_TEST then set blend mode to be Normal + renderer.setBlendMode(0); + } + + var alpha = container._alpha; + var scrollFactorX = container.scrollFactorX; + var scrollFactorY = container.scrollFactorY; + + if (container.mask) + { + container.mask.preRenderCanvas(renderer, null, camera); + } + + for (var i = 0; i < children.length; i++) + { + var child = children[i]; + + if (!child.willRender(camera)) + { + continue; + } + + var childAlpha = child.alpha; + var childScrollFactorX = child.scrollFactorX; + var childScrollFactorY = child.scrollFactorY; + + if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode) + { + // If Container doesn't have its own blend mode, then a child can have one + renderer.setBlendMode(child.blendMode); + } + + // Set parent values + child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); + child.setAlpha(childAlpha * alpha); + + // Render + child.renderCanvas(renderer, child, camera, transformMatrix); + + // Restore original values + child.setAlpha(childAlpha); + child.setScrollFactor(childScrollFactorX, childScrollFactorY); + } + + if (container.mask) + { + container.mask.postRenderCanvas(renderer); + } +}; + +module.exports = SpineContainerCanvasRenderer; /***/ }), -/* 211 */ -/***/ (function(module, exports) { + +/***/ 7738: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1984); +var renderCanvas = __webpack_require__(1984); + +if (false) +{} + +if (true) +{ + renderCanvas = __webpack_require__(8064); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), + +/***/ 6576: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * The Loader Plugin Add File Event. + * The Complete Event. * - * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue. - * - * Listen to it from a Scene using: `this.load.on('addfile', listener)`. - * - * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them. - * - * @event Phaser.Loader.Events#ADD - * @type {string} - * @since 3.0.0 - * - * @param {string} key - The unique key of the file that was added to the Loader. - * @param {string} type - The [file type]{@link Phaser.Loader.File#type} string of the file that was added to the Loader, i.e. `image`. - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - * @param {Phaser.Loader.File} file - A reference to the File which was added to the Loader. - */ -module.exports = 'addfile'; - - -/***/ }), -/* 212 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Loader Plugin Complete Event. - * - * This event is dispatched when the Loader has fully processed everything in the load queue. - * By this point every loaded file will now be in its associated cache and ready for use. - * - * Listen to it from a Scene using: `this.load.on('complete', listener)`. - * - * @event Phaser.Loader.Events#COMPLETE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - * @param {number} totalComplete - The total number of files that successfully loaded. - * @param {number} totalFailed - The total number of files that failed to load. + * @event SpinePluginEvents#COMPLETE + * @since 3.19.0 */ module.exports = 'complete'; /***/ }), -/* 213 */ -/***/ (function(module, exports) { + +/***/ 8621: +/***/ ((module) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * The File Load Complete Event. + * The Dispose Event. * - * This event is dispatched by the Loader Plugin when _any_ file in the queue finishes loading. - * - * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`. - * - * Make sure you remove this listener when you have finished, or it will continue to fire if the Scene reloads. - * - * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. - * - * @event Phaser.Loader.Events#FILE_COMPLETE - * @type {string} - * @since 3.0.0 - * - * @param {string} key - The key of the file that just loaded and finished processing. - * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. - * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. + * @event SpinePluginEvents#DISPOSE + * @since 3.19.0 */ -module.exports = 'filecomplete'; +module.exports = 'dispose'; /***/ }), -/* 214 */ -/***/ (function(module, exports) { + +/***/ 8944: +/***/ ((module) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * The File Load Complete Event. + * The End Event. * - * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. - * - * It uses a special dynamic event name constructed from the key and type of the file. - * - * For example, if you have loaded an `image` with a key of `monster`, you can listen for it - * using the following: - * - * ```javascript - * this.load.on('filecomplete-image-monster', function (key, type, data) { - * // Your handler code - * }); - * ``` - * - * Or, if you have loaded a texture `atlas` with a key of `Level1`: - * - * ```javascript - * this.load.on('filecomplete-atlasjson-Level1', function (key, type, data) { - * // Your handler code - * }); - * ``` - * - * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`: - * - * ```javascript - * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) { - * // Your handler code - * }); - * ``` - * - * Make sure you remove your listeners when you have finished, or they will continue to fire if the Scene reloads. - * - * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event. - * - * @event Phaser.Loader.Events#FILE_KEY_COMPLETE - * @type {string} - * @since 3.0.0 - * - * @param {string} key - The key of the file that just loaded and finished processing. - * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. - * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. + * @event SpinePluginEvents#END + * @since 3.19.0 */ -module.exports = 'filecomplete-'; +module.exports = 'end'; /***/ }), -/* 215 */ -/***/ (function(module, exports) { + +/***/ 7494: +/***/ ((module) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * The File Load Error Event. + * The Custom Event Event. * - * This event is dispatched by the Loader Plugin when a file fails to load. - * - * Listen to it from a Scene using: `this.load.on('loaderror', listener)`. - * - * @event Phaser.Loader.Events#FILE_LOAD_ERROR - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + * @event SpinePluginEvents#EVENT + * @since 3.19.0 */ -module.exports = 'loaderror'; +module.exports = 'event'; /***/ }), -/* 216 */ -/***/ (function(module, exports) { + +/***/ 1908: +/***/ ((module) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * The File Load Event. + * The Interrupted Event. * - * This event is dispatched by the Loader Plugin when a file finishes loading, - * but _before_ it is processed and added to the internal Phaser caches. - * - * Listen to it from a Scene using: `this.load.on('load', listener)`. - * - * @event Phaser.Loader.Events#FILE_LOAD - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - A reference to the File which just finished loading. + * @event SpinePluginEvents#INTERRUPTED + * @since 3.19.0 */ -module.exports = 'load'; +module.exports = 'interrupted'; /***/ }), -/* 217 */ -/***/ (function(module, exports) { + +/***/ 5591: +/***/ ((module) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * The File Load Progress Event. + * The Start Event. * - * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and - * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen. - * - * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`. - * - * @event Phaser.Loader.Events#FILE_PROGRESS - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - A reference to the File which errored during load. - * @param {number} percentComplete - A value between 0 and 1 indicating how 'complete' this file is. - */ -module.exports = 'fileprogress'; - - -/***/ }), -/* 218 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Loader Plugin Post Process Event. - * - * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue. - * It is dispatched before the internal lists are cleared and each File is destroyed. - * - * Use this hook to perform any last minute processing of files that can only happen once the - * Loader has completed, but prior to it emitting the `complete` event. - * - * Listen to it from a Scene using: `this.load.on('postprocess', listener)`. - * - * @event Phaser.Loader.Events#POST_PROCESS - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - */ -module.exports = 'postprocess'; - - -/***/ }), -/* 219 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Loader Plugin Progress Event. - * - * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading. - * - * Listen to it from a Scene using: `this.load.on('progress', listener)`. - * - * @event Phaser.Loader.Events#PROGRESS - * @type {string} - * @since 3.0.0 - * - * @param {number} progress - The current progress of the load. A value between 0 and 1. - */ -module.exports = 'progress'; - - -/***/ }), -/* 220 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Loader Plugin Start Event. - * - * This event is dispatched when the Loader starts running. At this point load progress is zero. - * - * This event is dispatched even if there aren't any files in the load queue. - * - * Listen to it from a Scene using: `this.load.on('start', listener)`. - * - * @event Phaser.Loader.Events#START - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @event SpinePluginEvents#START + * @since 3.19.0 */ module.exports = 'start'; /***/ }), -/* 221 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 5146: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MergeXHRSettings = __webpack_require__(49); - /** - * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings - * and starts the download of it. It uses the Files own XHRSettings and merges them - * with the global XHRSettings object to set the xhr values before download. - * - * @function Phaser.Loader.XHRLoader - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - The File to download. - * @param {Phaser.Types.Loader.XHRSettingsObject} globalXHRSettings - The global XHRSettings object. - * - * @return {XMLHttpRequest} The XHR object. + * @namespace SpinePluginEvents */ -var XHRLoader = function (file, globalXHRSettings) -{ - var config = MergeXHRSettings(globalXHRSettings, file.xhrSettings); - var xhr = new XMLHttpRequest(); +module.exports = { - xhr.open('GET', file.src, config.async, config.user, config.password); + COMPLETE: __webpack_require__(6576), + DISPOSE: __webpack_require__(8621), + END: __webpack_require__(8944), + EVENT: __webpack_require__(7494), + INTERRUPTED: __webpack_require__(1908), + START: __webpack_require__(5591) - xhr.responseType = file.xhrSettings.responseType; - xhr.timeout = config.timeout; - - if (config.headers) - { - for (var key in config.headers) - { - xhr.setRequestHeader(key, config.headers[key]); - } - } - - if (config.header && config.headerValue) - { - xhr.setRequestHeader(config.header, config.headerValue); - } - - if (config.requestedWith) - { - xhr.setRequestHeader('X-Requested-With', config.requestedWith); - } - - if (config.overrideMimeType) - { - xhr.overrideMimeType(config.overrideMimeType); - } - - if (config.withCredentials) - { - xhr.withCredentials = true; - } - - // After a successful request, the xhr.response property will contain the requested data as a DOMString, ArrayBuffer, Blob, or Document (depending on what was set for responseType.) - - xhr.onload = file.onLoad.bind(file, xhr); - xhr.onerror = file.onError.bind(file, xhr); - xhr.onprogress = file.onProgress.bind(file); - - // This is the only standard method, the ones above are browser additions (maybe not universal?) - // xhr.onreadystatechange - - xhr.send(); - - return xhr; }; -module.exports = XHRLoader; - /***/ }), -/* 222 */ -/***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(9); -var File = __webpack_require__(24); -var FileTypesManager = __webpack_require__(25); -var GetFastValue = __webpack_require__(8); -var GetValue = __webpack_require__(7); -var IsPlainObject = __webpack_require__(6); - -/** - * @classdesc - * A single JSON File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. - * - * @class JSONFile - * @extends Phaser.Loader.File - * @memberof Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. - */ -var JSONFile = new Class({ - - Extends: File, - - initialize: - - // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object - // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing - - function JSONFile (loader, key, url, xhrSettings, dataKey) - { - var extension = 'json'; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - dataKey = GetFastValue(config, 'dataKey', dataKey); - } - - var fileConfig = { - type: 'json', - cache: loader.cacheManager.json, - extension: extension, - responseType: 'text', - key: key, - url: url, - xhrSettings: xhrSettings, - config: dataKey - }; - - File.call(this, loader, fileConfig); - - // A JSON object has been provided (instead of a URL), so we'll use it directly as the File.data. No need to load it. - if (IsPlainObject(url)) - { - if (dataKey) - { - this.data = GetValue(url, dataKey); - } - else - { - this.data = url; - } - - this.state = CONST.FILE_POPULATED; - } - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.JSONFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - if (this.state !== CONST.FILE_POPULATED) - { - this.state = CONST.FILE_PROCESSING; - - try - { - var json = JSON.parse(this.xhrLoader.responseText); - } - catch (e) - { - this.onProcessError(); - - throw e; - } - - var key = this.config; - - if (typeof key === 'string') - { - this.data = GetValue(json, key, json); - } - else - { - this.data = json; - } - } - - this.onProcessComplete(); - } - -}); - -/** - * Adds a JSON file, or array of JSON files, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.json('wavedata', 'files/AlienWaveData.json'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the JSON Cache first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.json({ - * key: 'wavedata', - * url: 'files/AlienWaveData.json' - * }); - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. - * - * Once the file has finished loading you can access it from its Cache using its key: - * - * ```javascript - * this.load.json('wavedata', 'files/AlienWaveData.json'); - * // and later in your game ... - * var data = this.cache.json.get('wavedata'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and - * this is what you would use to retrieve the text from the JSON Cache. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" - * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, - * rather than the whole file. For example, if your JSON data had a structure like this: - * - * ```json - * { - * "level1": { - * "baddies": { - * "aliens": {}, - * "boss": {} - * } - * }, - * "level2": {}, - * "level3": {} - * } - * ``` - * - * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. - * - * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#json - * @fires Phaser.Loader.LoaderPlugin#ADD - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {this} The Loader instance. - */ -FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) -{ - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new JSONFile(this, key[i])); - } - } - else - { - this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); - } - - return this; -}); - -module.exports = JSONFile; - - -/***/ }), -/* 223 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(9); -var Events = __webpack_require__(47); - -/** - * @classdesc - * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after - * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. - * - * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. - * - * @class MultiFile - * @memberof Phaser.Loader - * @constructor - * @since 3.7.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. - * @param {string} type - The file type string for sorting within the Loader. - * @param {string} key - The key of the file within the loader. - * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile. - */ -var MultiFile = new Class({ - - initialize: - - function MultiFile (loader, type, key, files) - { - var finalFiles = []; - - // Clean out any potential 'null' or 'undefined' file entries - files.forEach(function (file) - { - if (file) - { - finalFiles.push(file); - } - }); - - /** - * A reference to the Loader that is going to load this file. - * - * @name Phaser.Loader.MultiFile#loader - * @type {Phaser.Loader.LoaderPlugin} - * @since 3.7.0 - */ - this.loader = loader; - - /** - * The file type string for sorting within the Loader. - * - * @name Phaser.Loader.MultiFile#type - * @type {string} - * @since 3.7.0 - */ - this.type = type; - - /** - * Unique cache key (unique within its file type) - * - * @name Phaser.Loader.MultiFile#key - * @type {string} - * @since 3.7.0 - */ - this.key = key; - - /** - * The current index being used by multi-file loaders to avoid key clashes. - * - * @name Phaser.Loader.MultiFile#multiKeyIndex - * @type {number} - * @private - * @since 3.20.0 - */ - this.multiKeyIndex = loader.multiKeyIndex++; - - /** - * Array of files that make up this MultiFile. - * - * @name Phaser.Loader.MultiFile#files - * @type {Phaser.Loader.File[]} - * @since 3.7.0 - */ - this.files = finalFiles; - - /** - * The current state of the file. One of the FILE_CONST values. - * - * @name Phaser.Loader.MultiFile#state - * @type {number} - * @since 3.60.0 - */ - this.state = CONST.FILE_PENDING; - - /** - * The completion status of this MultiFile. - * - * @name Phaser.Loader.MultiFile#complete - * @type {boolean} - * @default false - * @since 3.7.0 - */ - this.complete = false; - - /** - * The number of files to load. - * - * @name Phaser.Loader.MultiFile#pending - * @type {number} - * @since 3.7.0 - */ - - this.pending = finalFiles.length; - - /** - * The number of files that failed to load. - * - * @name Phaser.Loader.MultiFile#failed - * @type {number} - * @default 0 - * @since 3.7.0 - */ - this.failed = 0; - - /** - * A storage container for transient data that the loading files need. - * - * @name Phaser.Loader.MultiFile#config - * @type {any} - * @since 3.7.0 - */ - this.config = {}; - - /** - * A reference to the Loaders baseURL at the time this MultiFile was created. - * Used to populate child-files. - * - * @name Phaser.Loader.MultiFile#baseURL - * @type {string} - * @since 3.20.0 - */ - this.baseURL = loader.baseURL; - - /** - * A reference to the Loaders path at the time this MultiFile was created. - * Used to populate child-files. - * - * @name Phaser.Loader.MultiFile#path - * @type {string} - * @since 3.20.0 - */ - this.path = loader.path; - - /** - * A reference to the Loaders prefix at the time this MultiFile was created. - * Used to populate child-files. - * - * @name Phaser.Loader.MultiFile#prefix - * @type {string} - * @since 3.20.0 - */ - this.prefix = loader.prefix; - - // Link the files - for (var i = 0; i < finalFiles.length; i++) - { - finalFiles[i].multiFile = this; - } - }, - - /** - * Checks if this MultiFile is ready to process its children or not. - * - * @method Phaser.Loader.MultiFile#isReadyToProcess - * @since 3.7.0 - * - * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`. - */ - isReadyToProcess: function () - { - return (this.pending === 0 && this.failed === 0 && !this.complete); - }, - - /** - * Adds another child to this MultiFile, increases the pending count and resets the completion status. - * - * @method Phaser.Loader.MultiFile#addToMultiFile - * @since 3.7.0 - * - * @param {Phaser.Loader.File} files - The File to add to this MultiFile. - * - * @return {Phaser.Loader.MultiFile} This MultiFile instance. - */ - addToMultiFile: function (file) - { - this.files.push(file); - - file.multiFile = this; - - this.pending++; - - this.complete = false; - - return this; - }, - - /** - * Called by each File when it finishes loading. - * - * @method Phaser.Loader.MultiFile#onFileComplete - * @since 3.7.0 - * - * @param {Phaser.Loader.File} file - The File that has completed processing. - */ - onFileComplete: function (file) - { - var index = this.files.indexOf(file); - - if (index !== -1) - { - this.pending--; - } - }, - - /** - * Called by each File that fails to load. - * - * @method Phaser.Loader.MultiFile#onFileFailed - * @since 3.7.0 - * - * @param {Phaser.Loader.File} file - The File that has failed to load. - */ - onFileFailed: function (file) - { - var index = this.files.indexOf(file); - - if (index !== -1) - { - this.failed++; - - // eslint-disable-next-line no-console - console.error('File failed: %s "%s" (via %s "%s")', this.type, this.key, file.type, file.key); - } - }, - - /** - * Called once all children of this multi file have been added to their caches and is now - * ready for deletion from the Loader. - * - * It will emit a `filecomplete` event from the LoaderPlugin. - * - * @method Phaser.Loader.MultiFile#pendingDestroy - * @fires Phaser.Loader.Events#FILE_COMPLETE - * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE - * @since 3.60.0 - */ - pendingDestroy: function () - { - if (this.state === CONST.FILE_PENDING_DESTROY) - { - return; - } - - var key = this.key; - var type = this.type; - - this.loader.emit(Events.FILE_COMPLETE, key, type); - this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type); - - this.loader.flagForRemoval(this); - - for (var i = 0; i < this.files.length; i++) - { - this.files[i].pendingDestroy(); - } - - this.state = CONST.FILE_PENDING_DESTROY; - }, - - /** - * Destroy this Multi File and any references it holds. - * - * @method Phaser.Loader.MultiFile#destroy - * @since 3.60.0 - */ - destroy: function () - { - this.loader = null; - this.files = null; - this.config = null; - } - -}); - -module.exports = MultiFile; - - -/***/ }), -/* 224 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(9); -var File = __webpack_require__(24); -var FileTypesManager = __webpack_require__(25); -var GetFastValue = __webpack_require__(8); -var IsPlainObject = __webpack_require__(6); - -/** - * @classdesc - * A single Text File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text. - * - * @class TextFile - * @extends Phaser.Loader.File - * @memberof Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - */ -var TextFile = new Class({ - - Extends: File, - - initialize: - - function TextFile (loader, key, url, xhrSettings) - { - var type = 'text'; - var extension = 'txt'; - var cache = loader.cacheManager.text; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - type = GetFastValue(config, 'type', type); - cache = GetFastValue(config, 'cache', cache); - } - - var fileConfig = { - type: type, - cache: cache, - extension: extension, - responseType: 'text', - key: key, - url: url, - xhrSettings: xhrSettings - }; - - File.call(this, loader, fileConfig); - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.TextFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - this.state = CONST.FILE_PROCESSING; - - this.data = this.xhrLoader.responseText; - - this.onProcessComplete(); - } - -}); - -/** - * Adds a Text file, or array of Text files, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.text('story', 'files/IntroStory.txt'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the Text Cache. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the Text Cache first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.text({ - * key: 'story', - * url: 'files/IntroStory.txt' - * }); - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details. - * - * Once the file has finished loading you can access it from its Cache using its key: - * - * ```javascript - * this.load.text('story', 'files/IntroStory.txt'); - * // and later in your game ... - * var data = this.cache.text.get('story'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and - * this is what you would use to retrieve the text from the Text Cache. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" - * and no URL is given then the Loader will set the URL to be "story.txt". It will always add `.txt` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#text - * @fires Phaser.Loader.LoaderPlugin#ADD - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig|Phaser.Types.Loader.FileTypes.TextFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {this} The Loader instance. - */ -FileTypesManager.register('text', function (key, url, xhrSettings) -{ - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new TextFile(this, key[i])); - } - } - else - { - this.addFile(new TextFile(this, key, url, xhrSettings)); - } - - return this; -}); - -module.exports = TextFile; - - -/***/ }), -/* 225 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 8332: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -33089,21 +11810,21 @@ module.exports = TextFile; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var AngleBetween = __webpack_require__(30); -var Clamp = __webpack_require__(4); -var Class = __webpack_require__(0); -var ComponentsComputedSize = __webpack_require__(51); -var ComponentsDepth = __webpack_require__(52); -var ComponentsFlip = __webpack_require__(53); -var ComponentsScrollFactor = __webpack_require__(54); -var ComponentsTransform = __webpack_require__(55); -var ComponentsVisible = __webpack_require__(57); -var CounterClockwise = __webpack_require__(18); -var DegToRad = __webpack_require__(20); -var GameObject = __webpack_require__(58); -var RadToDeg = __webpack_require__(22); -var SpineEvents = __webpack_require__(247); -var SpineGameObjectRender = __webpack_require__(254); +var AngleBetween = __webpack_require__(6412); +var Clamp = __webpack_require__(2915); +var Class = __webpack_require__(7473); +var ComponentsComputedSize = __webpack_require__(1991); +var ComponentsDepth = __webpack_require__(3131); +var ComponentsFlip = __webpack_require__(9660); +var ComponentsScrollFactor = __webpack_require__(4627); +var ComponentsTransform = __webpack_require__(3212); +var ComponentsVisible = __webpack_require__(8414); +var CounterClockwise = __webpack_require__(3426); +var DegToRad = __webpack_require__(7149); +var GameObject = __webpack_require__(2273); +var RadToDeg = __webpack_require__(4208); +var SpineEvents = __webpack_require__(5146); +var SpineGameObjectRender = __webpack_require__(2762); /** * @classdesc @@ -34697,8 +13418,164 @@ module.exports = SpineGameObject; /***/ }), -/* 226 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 2753: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var CounterClockwise = __webpack_require__(3426); +var RadToDeg = __webpack_require__(4208); +var Wrap = __webpack_require__(8445); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method SpineGameObject#renderCanvas + * @since 3.19.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {SpineGameObject} src - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var SpineGameObjectCanvasRenderer = function (renderer, src, camera, parentMatrix) +{ + var context = renderer.currentContext; + + var plugin = src.plugin; + var skeleton = src.skeleton; + var skeletonRenderer = plugin.skeletonRenderer; + + var camMatrix = renderer._tempMatrix1; + var spriteMatrix = renderer._tempMatrix2; + var calcMatrix = renderer._tempMatrix3; + + camera.addToRenderList(src); + + spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY)); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = src.x; + spriteMatrix.f = src.y; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + else + { + spriteMatrix.e -= camera.scrollX * src.scrollFactorX; + spriteMatrix.f -= camera.scrollY * src.scrollFactorY; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + + skeleton.x = calcMatrix.tx; + skeleton.y = calcMatrix.ty; + + skeleton.scaleX = calcMatrix.scaleX; + + // Inverse or we get upside-down skeletons + skeleton.scaleY = calcMatrix.scaleY * -1; + + if (src.scaleX < 0) + { + skeleton.scaleX *= -1; + + src.root.rotation = RadToDeg(calcMatrix.rotationNormalized); + } + else + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360); + } + + if (src.scaleY < 0) + { + skeleton.scaleY *= -1; + + if (src.scaleX < 0) + { + src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2); + } + else + { + src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2); + } + } + + if (camera.renderToTexture) + { + skeleton.y = calcMatrix.ty; + skeleton.scaleY *= -1; + } + + skeleton.updateWorldTransform(); + + skeletonRenderer.ctx = context; + skeletonRenderer.debugRendering = (plugin.drawDebug || src.drawDebug); + + context.save(); + + skeletonRenderer.draw(skeleton); + + context.restore(); +}; + +module.exports = SpineGameObjectCanvasRenderer; + + +/***/ }), + +/***/ 2762: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var renderWebGL = __webpack_require__(1984); +var renderCanvas = __webpack_require__(1984); +var renderDirect = __webpack_require__(1984); + +if (false) +{} + +if (true) +{ + renderCanvas = __webpack_require__(2753); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas, + renderDirect: renderDirect + +}; + + +/***/ }), + +/***/ 9454: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -34706,8 +13583,153 @@ module.exports = SpineGameObject; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); -var Events = __webpack_require__(227); +/** + * Global constants. + * + * @ignore + */ + +var CONST = { + + /** + * Phaser Release Version + * + * @name Phaser.VERSION + * @const + * @type {string} + * @since 3.0.0 + */ + VERSION: '3.60.0', + + BlendModes: __webpack_require__(8351), + + ScaleModes: __webpack_require__(8196), + + /** + * This setting will auto-detect if the browser is capable of suppporting WebGL. + * If it is, it will use the WebGL Renderer. If not, it will fall back to the Canvas Renderer. + * + * @name Phaser.AUTO + * @const + * @type {number} + * @since 3.0.0 + */ + AUTO: 0, + + /** + * Forces Phaser to only use the Canvas Renderer, regardless if the browser supports + * WebGL or not. + * + * @name Phaser.CANVAS + * @const + * @type {number} + * @since 3.0.0 + */ + CANVAS: 1, + + /** + * Forces Phaser to use the WebGL Renderer. If the browser does not support it, there is + * no fallback to Canvas with this setting, so you should trap it and display a suitable + * message to the user. + * + * @name Phaser.WEBGL + * @const + * @type {number} + * @since 3.0.0 + */ + WEBGL: 2, + + /** + * A Headless Renderer doesn't create either a Canvas or WebGL Renderer. However, it still + * absolutely relies on the DOM being present and available. This mode is meant for unit testing, + * not for running Phaser on the server, which is something you really shouldn't do. + * + * @name Phaser.HEADLESS + * @const + * @type {number} + * @since 3.0.0 + */ + HEADLESS: 3, + + /** + * In Phaser the value -1 means 'forever' in lots of cases, this const allows you to use it instead + * to help you remember what the value is doing in your code. + * + * @name Phaser.FOREVER + * @const + * @type {number} + * @since 3.0.0 + */ + FOREVER: -1, + + /** + * Direction constant. + * + * @name Phaser.NONE + * @const + * @type {number} + * @since 3.0.0 + */ + NONE: 4, + + /** + * Direction constant. + * + * @name Phaser.UP + * @const + * @type {number} + * @since 3.0.0 + */ + UP: 5, + + /** + * Direction constant. + * + * @name Phaser.DOWN + * @const + * @type {number} + * @since 3.0.0 + */ + DOWN: 6, + + /** + * Direction constant. + * + * @name Phaser.LEFT + * @const + * @type {number} + * @since 3.0.0 + */ + LEFT: 7, + + /** + * Direction constant. + * + * @name Phaser.RIGHT + * @const + * @type {number} + * @since 3.0.0 + */ + RIGHT: 8 + +}; + +module.exports = CONST; + + +/***/ }), + +/***/ 1081: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Events = __webpack_require__(6748); /** * @callback DataEachCallback @@ -34957,10 +13979,10 @@ var DataManager = new Class({ * @generic {any} T * @genericUse {(string|T)} - [key] * - * @param {(string|object)} key - The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored. - * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored. + * @param {(string|object)} key - The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. + * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ set: function (key, data) { @@ -34999,9 +14021,9 @@ var DataManager = new Class({ * @genericUse {(string|T)} - [key] * * @param {(string|object)} key - The key to increase the value for. - * @param {*} [data] - The value to increase for the given key. + * @param {number} [data=1] - The amount to increase the given key by. Pass a negative value to decrease the key. * - * @return {Phaser.Data.DataManager} This DataManager object. + * @return {this} This Data Manager instance. */ inc: function (key, data) { @@ -35016,6 +14038,7 @@ var DataManager = new Class({ } var value = this.get(key); + if (value === undefined) { value = 0; @@ -35042,7 +14065,7 @@ var DataManager = new Class({ * * @param {(string|object)} key - The key to toggle the value for. * - * @return {Phaser.Data.DataManager} This DataManager object. + * @return {this} This Data Manager instance. */ toggle: function (key) { @@ -35069,7 +14092,7 @@ var DataManager = new Class({ * @param {string} key - The key to set the value for. * @param {*} data - The value to set. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ setValue: function (key, data) { @@ -35133,7 +14156,7 @@ var DataManager = new Class({ * @param {*} [context] - Value to use as `this` when executing callback. * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ each: function (callback, context) { @@ -35170,7 +14193,7 @@ var DataManager = new Class({ * @param {Object.} data - The data to merge. * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ merge: function (data, overwrite) { @@ -35206,7 +14229,7 @@ var DataManager = new Class({ * * @param {(string|string[])} key - The key to remove, or an array of keys to remove. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ remove: function (key) { @@ -35240,7 +14263,7 @@ var DataManager = new Class({ * * @param {string} key - The key to set the value for. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ removeValue: function (key) { @@ -35312,7 +14335,7 @@ var DataManager = new Class({ * * @param {boolean} value - Whether to freeze or unfreeze the Data Manager. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ setFreeze: function (value) { @@ -35327,7 +14350,7 @@ var DataManager = new Class({ * @method Phaser.Data.DataManager#reset * @since 3.0.0 * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ reset: function () { @@ -35413,33 +14436,9 @@ module.exports = DataManager; /***/ }), -/* 227 */ -/***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Data.Events - */ - -module.exports = { - - CHANGE_DATA: __webpack_require__(228), - CHANGE_DATA_KEY: __webpack_require__(229), - DESTROY: __webpack_require__(230), - REMOVE_DATA: __webpack_require__(231), - SET_DATA: __webpack_require__(232) - -}; - - -/***/ }), -/* 228 */ -/***/ (function(module, exports) { +/***/ 9044: +/***/ ((module) => { /** * @author Richard Davey @@ -35471,8 +14470,9 @@ module.exports = 'changedata'; /***/ }), -/* 229 */ -/***/ (function(module, exports) { + +/***/ 7801: +/***/ ((module) => { /** * @author Richard Davey @@ -35502,8 +14502,9 @@ module.exports = 'changedata-'; /***/ }), -/* 230 */ -/***/ (function(module, exports) { + +/***/ 4873: +/***/ ((module) => { /** * @author Richard Davey @@ -35524,8 +14525,9 @@ module.exports = 'destroy'; /***/ }), -/* 231 */ -/***/ (function(module, exports) { + +/***/ 9966: +/***/ ((module) => { /** * @author Richard Davey @@ -35553,8 +14555,9 @@ module.exports = 'removedata'; /***/ }), -/* 232 */ -/***/ (function(module, exports) { + +/***/ 4586: +/***/ ((module) => { /** * @author Richard Davey @@ -35582,351 +14585,9 @@ module.exports = 'setdata'; /***/ }), -/* 233 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -var has = Object.prototype.hasOwnProperty - , prefix = '~'; - -/** - * Constructor to create a storage for our `EE` objects. - * An `Events` instance is a plain object whose properties are event names. - * - * @constructor - * @private - */ -function Events() {} - -// -// We try to not inherit from `Object.prototype`. In some engines creating an -// instance in this way is faster than calling `Object.create(null)` directly. -// If `Object.create(null)` is not supported we prefix the event names with a -// character to make sure that the built-in object properties are not -// overridden or used as an attack vector. -// -if (Object.create) { - Events.prototype = Object.create(null); - - // - // This hack is needed because the `__proto__` property is still inherited in - // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. - // - if (!new Events().__proto__) prefix = false; -} - -/** - * Representation of a single event listener. - * - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} [once=false] Specify if the listener is a one-time listener. - * @constructor - * @private - */ -function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; -} - -/** - * Add a listener for a given event. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} once Specify if the listener is a one-time listener. - * @returns {EventEmitter} - * @private - */ -function addListener(emitter, event, fn, context, once) { - if (typeof fn !== 'function') { - throw new TypeError('The listener must be a function'); - } - - var listener = new EE(fn, context || emitter, once) - , evt = prefix ? prefix + event : event; - - if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; - else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); - else emitter._events[evt] = [emitter._events[evt], listener]; - - return emitter; -} - -/** - * Clear event by name. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} evt The Event name. - * @private - */ -function clearEvent(emitter, evt) { - if (--emitter._eventsCount === 0) emitter._events = new Events(); - else delete emitter._events[evt]; -} - -/** - * Minimal `EventEmitter` interface that is molded against the Node.js - * `EventEmitter` interface. - * - * @constructor - * @public - */ -function EventEmitter() { - this._events = new Events(); - this._eventsCount = 0; -} - -/** - * Return an array listing the events for which the emitter has registered - * listeners. - * - * @returns {Array} - * @public - */ -EventEmitter.prototype.eventNames = function eventNames() { - var names = [] - , events - , name; - - if (this._eventsCount === 0) return names; - - for (name in (events = this._events)) { - if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); - } - - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events)); - } - - return names; -}; - -/** - * Return the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Array} The registered listeners. - * @public - */ -EventEmitter.prototype.listeners = function listeners(event) { - var evt = prefix ? prefix + event : event - , handlers = this._events[evt]; - - if (!handlers) return []; - if (handlers.fn) return [handlers.fn]; - - for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { - ee[i] = handlers[i].fn; - } - - return ee; -}; - -/** - * Return the number of listeners listening to a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Number} The number of listeners. - * @public - */ -EventEmitter.prototype.listenerCount = function listenerCount(event) { - var evt = prefix ? prefix + event : event - , listeners = this._events[evt]; - - if (!listeners) return 0; - if (listeners.fn) return 1; - return listeners.length; -}; - -/** - * Calls each of the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Boolean} `true` if the event had listeners, else `false`. - * @public - */ -EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return false; - - var listeners = this._events[evt] - , len = arguments.length - , args - , i; - - if (listeners.fn) { - if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); - - switch (len) { - case 1: return listeners.fn.call(listeners.context), true; - case 2: return listeners.fn.call(listeners.context, a1), true; - case 3: return listeners.fn.call(listeners.context, a1, a2), true; - case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } - - for (i = 1, args = new Array(len -1); i < len; i++) { - args[i - 1] = arguments[i]; - } - - listeners.fn.apply(listeners.context, args); - } else { - var length = listeners.length - , j; - - for (i = 0; i < length; i++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); - - switch (len) { - case 1: listeners[i].fn.call(listeners[i].context); break; - case 2: listeners[i].fn.call(listeners[i].context, a1); break; - case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; - case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; - default: - if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { - args[j - 1] = arguments[j]; - } - - listeners[i].fn.apply(listeners[i].context, args); - } - } - } - - return true; -}; - -/** - * Add a listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.on = function on(event, fn, context) { - return addListener(this, event, fn, context, false); -}; - -/** - * Add a one-time listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.once = function once(event, fn, context) { - return addListener(this, event, fn, context, true); -}; - -/** - * Remove the listeners of a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn Only remove the listeners that match this function. - * @param {*} context Only remove the listeners that have this context. - * @param {Boolean} once Only remove one-time listeners. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return this; - if (!fn) { - clearEvent(this, evt); - return this; - } - - var listeners = this._events[evt]; - - if (listeners.fn) { - if ( - listeners.fn === fn && - (!once || listeners.once) && - (!context || listeners.context === context) - ) { - clearEvent(this, evt); - } - } else { - for (var i = 0, events = [], length = listeners.length; i < length; i++) { - if ( - listeners[i].fn !== fn || - (once && !listeners[i].once) || - (context && listeners[i].context !== context) - ) { - events.push(listeners[i]); - } - } - - // - // Reset the array, or remove it completely if we have no more listeners. - // - if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; - else clearEvent(this, evt); - } - - return this; -}; - -/** - * Remove all listeners, or those of the specified event. - * - * @param {(String|Symbol)} [event] The event name. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { - var evt; - - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) clearEvent(this, evt); - } else { - this._events = new Events(); - this._eventsCount = 0; - } - - return this; -}; - -// -// Alias methods names because people roll like that. -// -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; -EventEmitter.prototype.addListener = EventEmitter.prototype.on; - -// -// Expose the prefix. -// -EventEmitter.prefixed = prefix; - -// -// Allow `EventEmitter` to be imported as module namespace. -// -EventEmitter.EventEmitter = EventEmitter; - -// -// Expose the module. -// -if (true) { - module.exports = EventEmitter; -} - - -/***/ }), -/* 234 */ -/***/ (function(module, exports) { +/***/ 6748: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -35935,25 +14596,24 @@ if (true) { */ /** - * The Game Object Added to Scene Event. - * - * This event is dispatched when a Game Object is added to a Scene. - * - * Listen for it on a Game Object instance using `GameObject.on('addedtoscene', listener)`. - * - * @event Phaser.GameObjects.Events#ADDED_TO_SCENE - * @type {string} - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene. - * @param {Phaser.Scene} scene - The Scene to which the Game Object was added. + * @namespace Phaser.Data.Events */ -module.exports = 'addedtoscene'; + +module.exports = { + + CHANGE_DATA: __webpack_require__(9044), + CHANGE_DATA_KEY: __webpack_require__(7801), + DESTROY: __webpack_require__(4873), + REMOVE_DATA: __webpack_require__(9966), + SET_DATA: __webpack_require__(4586) + +}; /***/ }), -/* 235 */ -/***/ (function(module, exports) { + +/***/ 3004: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -35961,734 +14621,12787 @@ module.exports = 'addedtoscene'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var Browser = __webpack_require__(2776); + /** - * The Game Object Destroy Event. + * Determines the audio playback capabilities of the device running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.audio` from within any Scene. * - * This event is dispatched when a Game Object instance is being destroyed. - * - * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`. - * - * @event Phaser.GameObjects.Events#DESTROY - * @type {string} + * @typedef {object} Phaser.Device.Audio * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed. - * @param {boolean} fromScene - `True` if this Game Object is being destroyed by the Scene, `false` if not. + * @property {boolean} audioData - Can this device play HTML Audio tags? + * @property {boolean} dolby - Can this device play EC-3 Dolby Digital Plus files? + * @property {boolean} m4a - Can this device can play m4a files. + * @property {boolean} aac - Can this device can play aac files. + * @property {boolean} flac - Can this device can play flac files. + * @property {boolean} mp3 - Can this device play mp3 files? + * @property {boolean} ogg - Can this device play ogg files? + * @property {boolean} opus - Can this device play opus files? + * @property {boolean} wav - Can this device play wav files? + * @property {boolean} webAudio - Does this device have the Web Audio API? + * @property {boolean} webm - Can this device play webm files? */ -module.exports = 'destroy'; +var Audio = { - -/***/ }), -/* 236 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Object Removed from Scene Event. - * - * This event is dispatched when a Game Object is removed from a Scene. - * - * Listen for it on a Game Object instance using `GameObject.on('removedfromscene', listener)`. - * - * @event Phaser.GameObjects.Events#REMOVED_FROM_SCENE - * @type {string} - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene. - * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed. - */ -module.exports = 'removedfromscene'; - - -/***/ }), -/* 237 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Complete Event. - * - * This event is dispatched when a Video finishes playback by reaching the end of its duration. It - * is also dispatched if a video marker sequence is being played and reaches the end. - * - * Note that not all videos can fire this event. Live streams, for example, have no fixed duration, - * so never technically 'complete'. - * - * If a video is stopped from playback, via the `Video.stop` method, it will emit the - * `VIDEO_STOP` event instead of this one. - * - * Listen for it from a Video Game Object instance using `Video.on('complete', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_COMPLETE - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed playback. - */ -module.exports = 'complete'; - - -/***/ }), -/* 238 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Created Event. - * - * This event is dispatched when the texture for a Video has been created. This happens - * when enough of the video source has been loaded that the browser is able to render a - * frame from it. - * - * Listen for it from a Video Game Object instance using `Video.on('created', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_CREATED - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. - * @param {number} width - The width of the video. - * @param {number} height - The height of the video. - */ -module.exports = 'created'; - - -/***/ }), -/* 239 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Error Event. - * - * This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type. - * - * Listen for it from a Video Game Object instance using `Video.on('error', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_ERROR - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. - * @param {Event} event - The native DOM event the browser raised during playback. - */ -module.exports = 'error'; - - -/***/ }), -/* 240 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Loop Event. - * - * This event is dispatched when a Video that is currently playing has looped. This only - * happens if the `loop` parameter was specified, or the `setLoop` method was called, - * and if the video has a fixed duration. Video streams, for example, cannot loop, as - * they have no duration. - * - * Looping is based on the result of the Video `timeupdate` event. This event is not - * frame-accurate, due to the way browsers work, so please do not rely on this loop - * event to be time or frame precise. - * - * Listen for it from a Video Game Object instance using `Video.on('loop', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_LOOP - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which has looped. - */ -module.exports = 'loop'; - - -/***/ }), -/* 241 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Play Event. - * - * This event is dispatched when a Video begins playback. For videos that do not require - * interaction unlocking, this is usually as soon as the `Video.play` method is called. - * However, for videos that require unlocking, it is fired once playback begins after - * they've been unlocked. - * - * Listen for it from a Video Game Object instance using `Video.on('play', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_PLAY - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. - */ -module.exports = 'play'; - - -/***/ }), -/* 242 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Seeked Event. - * - * This event is dispatched when a Video completes seeking to a new point in its timeline. - * - * Listen for it from a Video Game Object instance using `Video.on('seeked', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_SEEKED - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed seeking. - */ -module.exports = 'seeked'; - - -/***/ }), -/* 243 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Seeking Event. - * - * This event is dispatched when a Video _begins_ seeking to a new point in its timeline. - * When the seek is complete, it will dispatch the `VIDEO_SEEKED` event to conclude. - * - * Listen for it from a Video Game Object instance using `Video.on('seeking', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_SEEKING - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which started seeking. - */ -module.exports = 'seeking'; - - -/***/ }), -/* 244 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Stopped Event. - * - * This event is dispatched when a Video is stopped from playback via a call to the `Video.stop` method, - * either directly via game code, or indirectly as the result of changing a video source or destroying it. - * - * Listen for it from a Video Game Object instance using `Video.on('stop', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_STOP - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which stopped playback. - */ -module.exports = 'stop'; - - -/***/ }), -/* 245 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Timeout Event. - * - * This event is dispatched when a Video has exhausted its allocated time while trying to connect to a video - * source to start playback. - * - * Listen for it from a Video Game Object instance using `Video.on('timeout', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_TIMEOUT - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which timed out. - */ -module.exports = 'timeout'; - - -/***/ }), -/* 246 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Unlocked Event. - * - * This event is dispatched when a Video that was prevented from playback due to the browsers - * Media Engagement Interaction policy, is unlocked by a user gesture. - * - * Listen for it from a Video Game Object instance using `Video.on('unlocked', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_UNLOCKED - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. - */ -module.exports = 'unlocked'; - - -/***/ }), -/* 247 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace SpinePluginEvents - */ - -module.exports = { - - COMPLETE: __webpack_require__(248), - DISPOSE: __webpack_require__(249), - END: __webpack_require__(250), - EVENT: __webpack_require__(251), - INTERRUPTED: __webpack_require__(252), - START: __webpack_require__(253) + flac: false, + aac: false, + audioData: false, + dolby: false, + m4a: false, + mp3: false, + ogg: false, + opus: false, + wav: false, + webAudio: false, + webm: false }; - -/***/ }), -/* 248 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Complete Event. - * - * @event SpinePluginEvents#COMPLETE - * @since 3.19.0 - */ -module.exports = 'complete'; - - -/***/ }), -/* 249 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Dispose Event. - * - * @event SpinePluginEvents#DISPOSE - * @since 3.19.0 - */ -module.exports = 'dispose'; - - -/***/ }), -/* 250 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The End Event. - * - * @event SpinePluginEvents#END - * @since 3.19.0 - */ -module.exports = 'end'; - - -/***/ }), -/* 251 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Custom Event Event. - * - * @event SpinePluginEvents#EVENT - * @since 3.19.0 - */ -module.exports = 'event'; - - -/***/ }), -/* 252 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Interrupted Event. - * - * @event SpinePluginEvents#INTERRUPTED - * @since 3.19.0 - */ -module.exports = 'interrupted'; - - -/***/ }), -/* 253 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Start Event. - * - * @event SpinePluginEvents#START - * @since 3.19.0 - */ -module.exports = 'start'; - - -/***/ }), -/* 254 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var renderWebGL = __webpack_require__(1); -var renderCanvas = __webpack_require__(1); -var renderDirect = __webpack_require__(1); - -if (false) -{} - -if (true) +function init () { - renderCanvas = __webpack_require__(255); + if (typeof importScripts === 'function') + { + return Audio; + } + + Audio.audioData = !!(window['Audio']); + + Audio.webAudio = !!(window['AudioContext'] || window['webkitAudioContext']); + + var audioElement = document.createElement('audio'); + var result = !!audioElement.canPlayType; + + try + { + if (result) + { + var CanPlay = function (type1, type2) + { + var canPlayType1 = audioElement.canPlayType('audio/' + type1).replace(/^no$/, ''); + + if (type2) + { + return Boolean(canPlayType1 || audioElement.canPlayType('audio/' + type2).replace(/^no$/, '')); + } + else + { + return Boolean(canPlayType1); + } + }; + + // wav Mimetypes accepted: + // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements + + Audio.ogg = CanPlay('ogg; codecs="vorbis"'); + Audio.opus = CanPlay('ogg; codecs="opus"', 'opus'); + Audio.mp3 = CanPlay('mpeg'); + Audio.wav = CanPlay('wav'); + Audio.m4a = CanPlay('x-m4a'); + Audio.aac = CanPlay('aac'); + Audio.flac = CanPlay('flac', 'x-flac'); + Audio.webm = CanPlay('webm; codecs="vorbis"'); + + if (audioElement.canPlayType('audio/mp4; codecs="ec-3"') !== '') + { + if (Browser.edge) + { + Audio.dolby = true; + } + else if (Browser.safari && Browser.safariVersion >= 9) + { + if ((/Mac OS X (\d+)_(\d+)/).test(navigator.userAgent)) + { + var major = parseInt(RegExp.$1, 10); + var minor = parseInt(RegExp.$2, 10); + + if ((major === 10 && minor >= 11) || major > 10) + { + Audio.dolby = true; + } + } + } + } + } + } + catch (e) + { + // Nothing to do here + } + + return Audio; } -module.exports = { - - renderWebGL: renderWebGL, - renderCanvas: renderCanvas, - renderDirect: renderDirect - -}; +module.exports = init(); /***/ }), -/* 255 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 2776: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CounterClockwise = __webpack_require__(18); -var RadToDeg = __webpack_require__(22); -var Wrap = __webpack_require__(13); +var OS = __webpack_require__(5203); /** - * Renders this Game Object with the Canvas Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. + * Determines the browser type and version running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.browser` from within any Scene. * - * @method SpineGameObject#renderCanvas - * @since 3.19.0 - * @private + * @typedef {object} Phaser.Device.Browser + * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {SpineGameObject} src - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + * @property {boolean} chrome - Set to true if running in Chrome. + * @property {boolean} edge - Set to true if running in Microsoft Edge browser. + * @property {boolean} firefox - Set to true if running in Firefox. + * @property {boolean} ie - Set to true if running in Internet Explorer 11 or less (not Edge). + * @property {boolean} mobileSafari - Set to true if running in Mobile Safari. + * @property {boolean} opera - Set to true if running in Opera. + * @property {boolean} safari - Set to true if running in Safari. + * @property {boolean} silk - Set to true if running in the Silk browser (as used on the Amazon Kindle) + * @property {boolean} trident - Set to true if running a Trident version of Internet Explorer (IE11+) + * @property {number} chromeVersion - If running in Chrome this will contain the major version number. + * @property {number} firefoxVersion - If running in Firefox this will contain the major version number. + * @property {number} ieVersion - If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Browser.trident and Browser.tridentVersion. + * @property {number} safariVersion - If running in Safari this will contain the major version number. + * @property {number} tridentVersion - If running in Internet Explorer 11 this will contain the major version number. See {@link http://msdn.microsoft.com/en-us/library/ie/ms537503(v=vs.85).aspx} */ -var SpineGameObjectCanvasRenderer = function (renderer, src, camera, parentMatrix) +var Browser = { + + chrome: false, + chromeVersion: 0, + edge: false, + firefox: false, + firefoxVersion: 0, + ie: false, + ieVersion: 0, + mobileSafari: false, + opera: false, + safari: false, + safariVersion: 0, + silk: false, + trident: false, + tridentVersion: 0, + es2019: false + +}; + +function init () { - var context = renderer.currentContext; + var ua = navigator.userAgent; - var plugin = src.plugin; - var skeleton = src.skeleton; - var skeletonRenderer = plugin.skeletonRenderer; - - var camMatrix = renderer._tempMatrix1; - var spriteMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; - - camera.addToRenderList(src); - - spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY)); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) + if ((/Edg\/\d+/).test(ua)) { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); + Browser.edge = true; + Browser.es2019 = true; } - else + else if ((/OPR/).test(ua)) { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); + Browser.opera = true; + Browser.es2019 = true; + } + else if ((/Chrome\/(\d+)/).test(ua) && !OS.windowsPhone) + { + Browser.chrome = true; + Browser.chromeVersion = parseInt(RegExp.$1, 10); + Browser.es2019 = (Browser.chromeVersion > 69); + } + else if ((/Firefox\D+(\d+)/).test(ua)) + { + Browser.firefox = true; + Browser.firefoxVersion = parseInt(RegExp.$1, 10); + Browser.es2019 = (Browser.firefoxVersion > 10); + } + else if ((/AppleWebKit/).test(ua) && OS.iOS) + { + Browser.mobileSafari = true; + } + else if ((/MSIE (\d+\.\d+);/).test(ua)) + { + Browser.ie = true; + Browser.ieVersion = parseInt(RegExp.$1, 10); + } + else if ((/Version\/(\d+\.\d+) Safari/).test(ua) && !OS.windowsPhone) + { + Browser.safari = true; + Browser.safariVersion = parseInt(RegExp.$1, 10); + Browser.es2019 = (Browser.safariVersion > 10); + } + else if ((/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/).test(ua)) + { + Browser.ie = true; + Browser.trident = true; + Browser.tridentVersion = parseInt(RegExp.$1, 10); + Browser.ieVersion = parseInt(RegExp.$3, 10); } - skeleton.x = calcMatrix.tx; - skeleton.y = calcMatrix.ty; - - skeleton.scaleX = calcMatrix.scaleX; - - // Inverse or we get upside-down skeletons - skeleton.scaleY = calcMatrix.scaleY * -1; - - if (src.scaleX < 0) + // Silk gets its own if clause because its ua also contains 'Safari' + if ((/Silk/).test(ua)) { - skeleton.scaleX *= -1; - - src.root.rotation = RadToDeg(calcMatrix.rotationNormalized); - } - else - { - // +90 degrees to account for the difference in Spine vs. Phaser rotation - src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360); + Browser.silk = true; } - if (src.scaleY < 0) - { - skeleton.scaleY *= -1; + return Browser; +} - if (src.scaleX < 0) +module.exports = init(); + + +/***/ }), + +/***/ 6505: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CanvasPool = __webpack_require__(8073); + +/** + * Determines the canvas features of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.canvasFeatures` from within any Scene. + * + * @typedef {object} Phaser.Device.CanvasFeatures + * @since 3.0.0 + * + * @property {boolean} supportInverseAlpha - Set to true if the browser supports inversed alpha. + * @property {boolean} supportNewBlendModes - Set to true if the browser supports new canvas blend modes. + */ +var CanvasFeatures = { + + supportInverseAlpha: false, + supportNewBlendModes: false + +}; + +function checkBlendMode () +{ + var pngHead = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/'; + var pngEnd = 'AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg=='; + + var magenta = new Image(); + + magenta.onload = function () + { + var yellow = new Image(); + + yellow.onload = function () { - src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2); + var canvas = CanvasPool.create2D(yellow, 6); + var context = canvas.getContext('2d', { willReadFrequently: true }); + + context.globalCompositeOperation = 'multiply'; + + context.drawImage(magenta, 0, 0); + context.drawImage(yellow, 2, 0); + + if (!context.getImageData(2, 0, 1, 1)) + { + return false; + } + + var data = context.getImageData(2, 0, 1, 1).data; + + CanvasPool.remove(yellow); + + CanvasFeatures.supportNewBlendModes = (data[0] === 255 && data[1] === 0 && data[2] === 0); + }; + + yellow.src = pngHead + '/wCKxvRF' + pngEnd; + }; + + magenta.src = pngHead + 'AP804Oa6' + pngEnd; + + return false; +} + +function checkInverseAlpha () +{ + var canvas = CanvasPool.create2D(this, 2); + var context = canvas.getContext('2d', { willReadFrequently: true }); + + context.fillStyle = 'rgba(10, 20, 30, 0.5)'; + + // Draw a single pixel + context.fillRect(0, 0, 1, 1); + + // Get the color values + var s1 = context.getImageData(0, 0, 1, 1); + + if (s1 === null) + { + return false; + } + + // Plot them to x2 + context.putImageData(s1, 1, 0); + + // Get those values + var s2 = context.getImageData(1, 0, 1, 1); + + var result = (s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]); + + CanvasPool.remove(this); + + // Compare and return + return result; +} + +function init () +{ + if (typeof importScripts !== 'function' && document !== undefined) + { + CanvasFeatures.supportNewBlendModes = checkBlendMode(); + CanvasFeatures.supportInverseAlpha = checkInverseAlpha(); + } + + return CanvasFeatures; +} + +module.exports = init(); + + +/***/ }), + +/***/ 6543: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var OS = __webpack_require__(5203); +var Browser = __webpack_require__(2776); +var CanvasPool = __webpack_require__(8073); + +/** + * Determines the features of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.features` from within any Scene. + * + * @typedef {object} Phaser.Device.Features + * @since 3.0.0 + * + * @property {boolean} canvas - Is canvas available? + * @property {?boolean} canvasBitBltShift - True if canvas supports a 'copy' bitblt onto itself when the source and destination regions overlap. + * @property {boolean} file - Is file available? + * @property {boolean} fileSystem - Is fileSystem available? + * @property {boolean} getUserMedia - Does the device support the getUserMedia API? + * @property {boolean} littleEndian - Is the device big or little endian? (only detected if the browser supports TypedArrays) + * @property {boolean} localStorage - Is localStorage available? + * @property {boolean} pointerLock - Is Pointer Lock available? + * @property {boolean} stableSort - Is Array.sort stable? + * @property {boolean} support32bit - Does the device context support 32bit pixel manipulation using array buffer views? + * @property {boolean} vibration - Does the device support the Vibration API? + * @property {boolean} webGL - Is webGL available? + * @property {boolean} worker - Is worker available? + */ +var Features = { + + canvas: false, + canvasBitBltShift: null, + file: false, + fileSystem: false, + getUserMedia: true, + littleEndian: false, + localStorage: false, + pointerLock: false, + stableSort: false, + support32bit: false, + vibration: false, + webGL: false, + worker: false + +}; + +// Check Little or Big Endian system. +// @author Matt DesLauriers (@mattdesl) +function checkIsLittleEndian () +{ + var a = new ArrayBuffer(4); + var b = new Uint8Array(a); + var c = new Uint32Array(a); + + b[0] = 0xa1; + b[1] = 0xb2; + b[2] = 0xc3; + b[3] = 0xd4; + + if (c[0] === 0xd4c3b2a1) + { + return true; + } + + if (c[0] === 0xa1b2c3d4) + { + return false; + } + else + { + // Could not determine endianness + return null; + } +} + +function init () +{ + if (typeof importScripts === 'function') + { + return Features; + } + + Features.canvas = !!window['CanvasRenderingContext2D']; + + try + { + Features.localStorage = !!localStorage.getItem; + } + catch (error) + { + Features.localStorage = false; + } + + Features.file = !!window['File'] && !!window['FileReader'] && !!window['FileList'] && !!window['Blob']; + Features.fileSystem = !!window['requestFileSystem']; + + var isUint8 = false; + + var testWebGL = function () + { + if (window['WebGLRenderingContext']) + { + try + { + var canvas = CanvasPool.createWebGL(this); + + var ctx = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); + + var canvas2D = CanvasPool.create2D(this); + + var ctx2D = canvas2D.getContext('2d', { willReadFrequently: true }); + + // Can't be done on a webgl context + var image = ctx2D.createImageData(1, 1); + + // Test to see if ImageData uses CanvasPixelArray or Uint8ClampedArray. + // @author Matt DesLauriers (@mattdesl) + isUint8 = image.data instanceof Uint8ClampedArray; + + CanvasPool.remove(canvas); + CanvasPool.remove(canvas2D); + + return !!ctx; + } + catch (e) + { + return false; + } + } + + return false; + }; + + Features.webGL = testWebGL(); + + Features.worker = !!window['Worker']; + + Features.pointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document; + + navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia; + + window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL; + + Features.getUserMedia = Features.getUserMedia && !!navigator.getUserMedia && !!window.URL; + + // Older versions of firefox (< 21) apparently claim support but user media does not actually work + if (Browser.firefox && Browser.firefoxVersion < 21) + { + Features.getUserMedia = false; + } + + // Excludes iOS versions as they generally wrap UIWebView (eg. Safari WebKit) and it + // is safer to not try and use the fast copy-over method. + if (!OS.iOS && (Browser.ie || Browser.firefox || Browser.chrome)) + { + Features.canvasBitBltShift = true; + } + + // Known not to work + if (Browser.safari || Browser.mobileSafari) + { + Features.canvasBitBltShift = false; + } + + navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate; + + if (navigator.vibrate) + { + Features.vibration = true; + } + + if (typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint32Array !== 'undefined') + { + Features.littleEndian = checkIsLittleEndian(); + } + + Features.support32bit = ( + typeof ArrayBuffer !== 'undefined' && + typeof Uint8ClampedArray !== 'undefined' && + typeof Int32Array !== 'undefined' && + Features.littleEndian !== null && + isUint8 + ); + + return Features; +} + +module.exports = init(); + + +/***/ }), + +/***/ 3922: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Determines the full screen support of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.fullscreen` from within any Scene. + * + * @typedef {object} Phaser.Device.Fullscreen + * @since 3.0.0 + * + * @property {boolean} available - Does the browser support the Full Screen API? + * @property {boolean} keyboard - Does the browser support access to the Keyboard during Full Screen mode? + * @property {string} cancel - If the browser supports the Full Screen API this holds the call you need to use to cancel it. + * @property {string} request - If the browser supports the Full Screen API this holds the call you need to use to activate it. + */ +var Fullscreen = { + + available: false, + cancel: '', + keyboard: false, + request: '' + +}; + +/** +* Checks for support of the Full Screen API. +* +* @ignore +*/ +function init () +{ + if (typeof importScripts === 'function') + { + return Fullscreen; + } + + var i; + + var suffix1 = 'Fullscreen'; + var suffix2 = 'FullScreen'; + + var fs = [ + 'request' + suffix1, + 'request' + suffix2, + 'webkitRequest' + suffix1, + 'webkitRequest' + suffix2, + 'msRequest' + suffix1, + 'msRequest' + suffix2, + 'mozRequest' + suffix2, + 'mozRequest' + suffix1 + ]; + + for (i = 0; i < fs.length; i++) + { + if (document.documentElement[fs[i]]) + { + Fullscreen.available = true; + Fullscreen.request = fs[i]; + break; + } + } + + var cfs = [ + 'cancel' + suffix2, + 'exit' + suffix1, + 'webkitCancel' + suffix2, + 'webkitExit' + suffix1, + 'msCancel' + suffix2, + 'msExit' + suffix1, + 'mozCancel' + suffix2, + 'mozExit' + suffix1 + ]; + + if (Fullscreen.available) + { + for (i = 0; i < cfs.length; i++) + { + if (document[cfs[i]]) + { + Fullscreen.cancel = cfs[i]; + break; + } + } + } + + // Keyboard Input? + // Safari 5.1 says it supports fullscreen keyboard, but is lying. + if (window['Element'] && Element['ALLOW_KEYBOARD_INPUT'] && !(/ Version\/5\.1(?:\.\d+)? Safari\//).test(navigator.userAgent)) + { + Fullscreen.keyboard = true; + } + + Object.defineProperty(Fullscreen, 'active', { get: function () { return !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement); } }); + + return Fullscreen; +} + +module.exports = init(); + + +/***/ }), + +/***/ 1454: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Browser = __webpack_require__(2776); + +/** + * Determines the input support of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.input` from within any Scene. + * + * @typedef {object} Phaser.Device.Input + * @since 3.0.0 + * + * @property {?string} wheelType - The newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll' + * @property {boolean} gamepads - Is navigator.getGamepads available? + * @property {boolean} mspointer - Is mspointer available? + * @property {boolean} touch - Is touch available? + */ +var Input = { + + gamepads: false, + mspointer: false, + touch: false, + wheelEvent: null + +}; + +function init () +{ + if (typeof importScripts === 'function') + { + return Input; + } + + if ('ontouchstart' in document.documentElement || (navigator.maxTouchPoints && navigator.maxTouchPoints >= 1)) + { + Input.touch = true; + } + + if (navigator.msPointerEnabled || navigator.pointerEnabled) + { + Input.mspointer = true; + } + + if (navigator.getGamepads) + { + Input.gamepads = true; + } + + // See https://developer.mozilla.org/en-US/docs/Web/Events/wheel + if ('onwheel' in window || (Browser.ie && 'WheelEvent' in window)) + { + // DOM3 Wheel Event: FF 17+, IE 9+, Chrome 31+, Safari 7+ + Input.wheelEvent = 'wheel'; + } + else if ('onmousewheel' in window) + { + // Non-FF legacy: IE 6-9, Chrome 1-31, Safari 5-7. + Input.wheelEvent = 'mousewheel'; + } + else if (Browser.firefox && 'MouseScrollEvent' in window) + { + // FF prior to 17. This should probably be scrubbed. + Input.wheelEvent = 'DOMMouseScroll'; + } + + return Input; +} + +module.exports = init(); + + +/***/ }), + +/***/ 5203: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Determines the operating system of the device running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.os` from within any Scene. + * + * @typedef {object} Phaser.Device.OS + * @since 3.0.0 + * + * @property {boolean} android - Is running on android? + * @property {boolean} chromeOS - Is running on chromeOS? + * @property {boolean} cordova - Is the game running under Apache Cordova? + * @property {boolean} crosswalk - Is the game running under the Intel Crosswalk XDK? + * @property {boolean} desktop - Is running on a desktop? + * @property {boolean} ejecta - Is the game running under Ejecta? + * @property {boolean} electron - Is the game running under GitHub Electron? + * @property {boolean} iOS - Is running on iOS? + * @property {boolean} iPad - Is running on iPad? + * @property {boolean} iPhone - Is running on iPhone? + * @property {boolean} kindle - Is running on an Amazon Kindle? + * @property {boolean} linux - Is running on linux? + * @property {boolean} macOS - Is running on macOS? + * @property {boolean} node - Is the game running under Node.js? + * @property {boolean} nodeWebkit - Is the game running under Node-Webkit? + * @property {boolean} webApp - Set to true if running as a WebApp, i.e. within a WebView + * @property {boolean} windows - Is running on windows? + * @property {boolean} windowsPhone - Is running on a Windows Phone? + * @property {number} iOSVersion - If running in iOS this will contain the major version number. + * @property {number} pixelRatio - PixelRatio of the host device? + */ +var OS = { + + android: false, + chromeOS: false, + cordova: false, + crosswalk: false, + desktop: false, + ejecta: false, + electron: false, + iOS: false, + iOSVersion: 0, + iPad: false, + iPhone: false, + kindle: false, + linux: false, + macOS: false, + node: false, + nodeWebkit: false, + pixelRatio: 1, + webApp: false, + windows: false, + windowsPhone: false + +}; + +function init () +{ + if (typeof importScripts === 'function') + { + return OS; + } + + var ua = navigator.userAgent; + + if ((/Windows/).test(ua)) + { + OS.windows = true; + } + else if ((/Mac OS/).test(ua) && !((/like Mac OS/).test(ua))) + { + // Because iOS 13 identifies as Mac OS: + if (navigator.maxTouchPoints && navigator.maxTouchPoints > 2) + { + OS.iOS = true; + OS.iPad = true; + + (navigator.appVersion).match(/Version\/(\d+)/); + + OS.iOSVersion = parseInt(RegExp.$1, 10); } else { - src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2); + OS.macOS = true; + } + } + else if ((/Android/).test(ua)) + { + OS.android = true; + } + else if ((/Linux/).test(ua)) + { + OS.linux = true; + } + else if ((/iP[ao]d|iPhone/i).test(ua)) + { + OS.iOS = true; + + (navigator.appVersion).match(/OS (\d+)/); + + OS.iOSVersion = parseInt(RegExp.$1, 10); + + OS.iPhone = ua.toLowerCase().indexOf('iphone') !== -1; + OS.iPad = ua.toLowerCase().indexOf('ipad') !== -1; + } + else if ((/Kindle/).test(ua) || (/\bKF[A-Z][A-Z]+/).test(ua) || (/Silk.*Mobile Safari/).test(ua)) + { + OS.kindle = true; + + // This will NOT detect early generations of Kindle Fire, I think there is no reliable way... + // E.g. "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true" + } + else if ((/CrOS/).test(ua)) + { + OS.chromeOS = true; + } + + if ((/Windows Phone/i).test(ua) || (/IEMobile/i).test(ua)) + { + OS.android = false; + OS.iOS = false; + OS.macOS = false; + OS.windows = true; + OS.windowsPhone = true; + } + + var silk = (/Silk/).test(ua); + + if (OS.windows || OS.macOS || (OS.linux && !silk) || OS.chromeOS) + { + OS.desktop = true; + } + + // Windows Phone / Table reset + if (OS.windowsPhone || (((/Windows NT/i).test(ua)) && ((/Touch/i).test(ua)))) + { + OS.desktop = false; + } + + // WebApp mode in iOS + if (navigator.standalone) + { + OS.webApp = true; + } + + if (typeof importScripts !== 'function') + { + if (window.cordova !== undefined) + { + OS.cordova = true; + } + + if (window.ejecta !== undefined) + { + OS.ejecta = true; } } - if (camera.renderToTexture) + if (typeof process !== 'undefined' && process.versions && process.versions.node) { - skeleton.y = calcMatrix.ty; - skeleton.scaleY *= -1; + OS.node = true; } - skeleton.updateWorldTransform(); + if (OS.node && typeof process.versions === 'object') + { + OS.nodeWebkit = !!process.versions['node-webkit']; - skeletonRenderer.ctx = context; - skeletonRenderer.debugRendering = (plugin.drawDebug || src.drawDebug); + OS.electron = !!process.versions.electron; + } - context.save(); + if ((/Crosswalk/).test(ua)) + { + OS.crosswalk = true; + } - skeletonRenderer.draw(skeleton); + OS.pixelRatio = window['devicePixelRatio'] || 1; - context.restore(); -}; + return OS; +} -module.exports = SpineGameObjectCanvasRenderer; +module.exports = init(); /***/ }), -/* 256 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 2131: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); -var Container = __webpack_require__(257); -var SpineContainerRender = __webpack_require__(342); +var GetFastValue = __webpack_require__(4597); + +/** + * Determines the video support of the browser running this Phaser Game instance. + * + * These values are read-only and populated during the boot sequence of the game. + * + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.video` from within any Scene. + * + * In Phaser 3.20 the properties were renamed to drop the 'Video' suffix. + * + * @typedef {object} Phaser.Device.Video + * @since 3.0.0 + * + * @property {boolean} h264 - Can this device play h264 mp4 video files? + * @property {boolean} hls - Can this device play hls video files? + * @property {boolean} mp4 - Can this device play h264 mp4 video files? + * @property {boolean} m4v - Can this device play m4v (typically mp4) video files? + * @property {boolean} ogg - Can this device play ogg video files? + * @property {boolean} vp9 - Can this device play vp9 video files? + * @property {boolean} webm - Can this device play webm video files? + * @property {function} getVideoURL - Returns the first video URL that can be played by this browser. + */ +var Video = { + + h264: false, + hls: false, + mp4: false, + m4v: false, + ogg: false, + vp9: false, + webm: false, + hasRequestVideoFrame: false + +}; + +function init () +{ + if (typeof importScripts === 'function') + { + return Video; + } + + var videoElement = document.createElement('video'); + var result = !!videoElement.canPlayType; + var no = /^no$/; + + try + { + if (result) + { + if (videoElement.canPlayType('video/ogg; codecs="theora"').replace(no, '')) + { + Video.ogg = true; + } + + if (videoElement.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(no, '')) + { + // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546 + Video.h264 = true; + Video.mp4 = true; + } + + if (videoElement.canPlayType('video/x-m4v').replace(no, '')) + { + Video.m4v = true; + } + + if (videoElement.canPlayType('video/webm; codecs="vp8, vorbis"').replace(no, '')) + { + Video.webm = true; + } + + if (videoElement.canPlayType('video/webm; codecs="vp9"').replace(no, '')) + { + Video.vp9 = true; + } + + if (videoElement.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(no, '')) + { + Video.hls = true; + } + } + } + catch (e) + { + // Nothing to do + } + + if (videoElement.parentNode) + { + videoElement.parentNode.removeChild(videoElement); + } + + Video.getVideoURL = function (urls) + { + if (!Array.isArray(urls)) + { + urls = [ urls ]; + } + + for (var i = 0; i < urls.length; i++) + { + var url = GetFastValue(urls[i], 'url', urls[i]); + + if (url.indexOf('blob:') === 0) + { + return { + url: url, + type: '' + }; + } + + var videoType; + + if (url.indexOf('data:') === 0) + { + videoType = url.split(',')[0].match(/\/(.*?);/); + } + else + { + videoType = url.match(/\.([a-zA-Z0-9]+)($|\?)/); + } + + videoType = GetFastValue(urls[i], 'type', (videoType) ? videoType[1] : '').toLowerCase(); + + if (Video[videoType]) + { + return { + url: url, + type: videoType + }; + } + } + + return null; + }; + + return Video; +} + +module.exports = init(); + + +/***/ }), + +/***/ 9356: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// This singleton is instantiated as soon as Phaser loads, +// before a Phaser.Game instance has even been created. +// Which means all instances of Phaser Games can share it, +// without having to re-poll the device all over again + +/** + * @namespace Phaser.Device + * @since 3.0.0 + */ + +/** + * @typedef {object} Phaser.DeviceConf + * + * @property {Phaser.Device.OS} os - The OS Device functions. + * @property {Phaser.Device.Browser} browser - The Browser Device functions. + * @property {Phaser.Device.Features} features - The Features Device functions. + * @property {Phaser.Device.Input} input - The Input Device functions. + * @property {Phaser.Device.Audio} audio - The Audio Device functions. + * @property {Phaser.Device.Video} video - The Video Device functions. + * @property {Phaser.Device.Fullscreen} fullscreen - The Fullscreen Device functions. + * @property {Phaser.Device.CanvasFeatures} canvasFeatures - The Canvas Device functions. + */ + +module.exports = { + + os: __webpack_require__(5203), + browser: __webpack_require__(2776), + features: __webpack_require__(6543), + input: __webpack_require__(1454), + audio: __webpack_require__(3004), + video: __webpack_require__(2131), + fullscreen: __webpack_require__(3922), + canvasFeatures: __webpack_require__(6505) + +}; + + +/***/ }), + +/***/ 5686: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); + +var tempMatrix = new Float32Array(20); /** * @classdesc - * A Spine Container is a special kind of Container created specifically for Spine Game Objects. + * The ColorMatrix class creates a 5x4 matrix that can be used in shaders and graphics + * operations. It provides methods required to modify the color values, such as adjusting + * the brightness, setting a sepia tone, hue rotation and more. * - * You have all of the same features of a standard Container, but the rendering functions are optimized specifically - * for Spine Game Objects. You must only add ever Spine Game Objects, or other Spine Containers, to this type of Container. - * Although Phaser will not prevent you from adding other types, they will not render and are likely to throw runtime errors. + * Use the method `getData` to return a Float32Array containing the current color values. * - * To create one in a Scene, use the factory methods: - * - * ```javascript - * this.add.spineContainer(); - * ``` - * - * or - * - * ```javascript - * this.make.spineContainer(); - * ``` - * - * Note that you should not nest Spine Containers inside regular Containers if you wish to use masks on the - * container children. You can, however, mask children of Spine Containers if they are embedded within other - * Spine Containers. In short, if you need masking, don't mix and match the types. - * - * See the Container documentation for further details about what Containers can do. - * - * @class SpineContainer - * @extends Phaser.GameObjects.Container + * @class ColorMatrix + * @memberof Phaser.Display * @constructor * @since 3.50.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene that this Game Object belongs to. - * @param {SpinePlugin} pluginManager - A reference to the Phaser Spine Plugin. - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {SpineGameObject[]} [children] - An optional array of Spine Game Objects to add to this Container. */ -var SpineContainer = new Class({ - - Extends: Container, - - Mixins: [ - SpineContainerRender - ], +var ColorMatrix = new Class({ initialize: - function SpineContainer (scene, plugin, x, y, children) + function ColorMatrix () { - Container.call(this, scene, x, y, children); - - // Same as SpineGameObject, to prevent the renderer from mis-typing it when batching - this.type = 'Spine'; - /** - * A reference to the Spine Plugin. + * Internal ColorMatrix array. * - * @name SpineContainer#plugin - * @type {SpinePlugin} + * @name Phaser.Display.ColorMatrix#_matrix + * @type {Float32Array} + * @private * @since 3.50.0 */ - this.plugin = plugin; + this._matrix = new Float32Array(20); + + /** + * The value that determines how much of the original color is used + * when mixing the colors. A value between 0 (all original) and 1 (all final) + * + * @name Phaser.Display.ColorMatrix#alpha + * @type {number} + * @since 3.50.0 + */ + this.alpha = 1; + + /** + * Is the ColorMatrix array dirty? + * + * @name Phaser.Display.ColorMatrix#_dirty + * @type {boolean} + * @private + * @since 3.50.0 + */ + this._dirty = true; + + /** + * The matrix data as a Float32Array. + * + * Returned by the `getData` method. + * + * @name Phaser.Display.ColorMatrix#data + * @type {Float32Array} + * @private + * @since 3.50.0 + */ + this._data = new Float32Array(20); + + this.reset(); }, /** - * Internal destroy handler, called as part of the destroy process. + * Sets this ColorMatrix from the given array of color values. * - * @method SpineContainer#preDestroy - * @protected + * @method Phaser.Display.ColorMatrix#set * @since 3.50.0 + * + * @param {(number[]|Float32Array)} value - The ColorMatrix values to set. Must have 20 elements. + * + * @return {this} This ColorMatrix instance. */ - preDestroy: function () + set: function (value) { - this.removeAll(!!this.exclusive); + this._matrix.set(value); - this.localTransform.destroy(); - this.tempTransformMatrix.destroy(); + this._dirty = true; - this.list = []; - this._displayList = null; - this.plugin = null; + return this; + }, + + /** + * Resets the ColorMatrix to default values and also resets + * the `alpha` property back to 1. + * + * @method Phaser.Display.ColorMatrix#reset + * @since 3.50.0 + * + * @return {this} This ColorMatrix instance. + */ + reset: function () + { + var m = this._matrix; + + m.fill(0); + + m[0] = 1; + m[6] = 1; + m[12] = 1; + m[18] = 1; + + this.alpha = 1; + + this._dirty = true; + + return this; + }, + + /** + * Gets the ColorMatrix as a Float32Array. + * + * Can be used directly as a 1fv shader uniform value. + * + * @method Phaser.Display.ColorMatrix#getData + * @since 3.50.0 + * + * @return {Float32Array} The ColorMatrix as a Float32Array. + */ + getData: function () + { + var data = this._data; + + if (this._dirty) + { + data.set(this._matrix); + + data[4] /= 255; + data[9] /= 255; + data[14] /= 255; + data[19] /= 255; + + this._dirty = false; + } + + return data; + }, + + /** + * Changes the brightness of this ColorMatrix by the given amount. + * + * @method Phaser.Display.ColorMatrix#brightness + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of brightness to apply to this ColorMatrix. Between 0 (black) and 1. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + brightness: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var b = value; + + return this.multiply([ + b, 0, 0, 0, 0, + 0, b, 0, 0, 0, + 0, 0, b, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Changes the saturation of this ColorMatrix by the given amount. + * + * @method Phaser.Display.ColorMatrix#saturate + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of saturation to apply to this ColorMatrix. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + saturate: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var x = (value * 2 / 3) + 1; + var y = ((x - 1) * -0.5); + + return this.multiply([ + x, y, y, 0, 0, + y, x, y, 0, 0, + y, y, x, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Desaturates this ColorMatrix (removes color from it). + * + * @method Phaser.Display.ColorMatrix#saturation + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + desaturate: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.saturate(-1, multiply); + }, + + /** + * Rotates the hues of this ColorMatrix by the value given. + * + * @method Phaser.Display.ColorMatrix#hue + * @since 3.50.0 + * + * @param {number} [rotation=0] - The amount of hue rotation to apply to this ColorMatrix, in degrees. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + hue: function (rotation, multiply) + { + if (rotation === undefined) { rotation = 0; } + if (multiply === undefined) { multiply = false; } + + rotation = rotation / 180 * Math.PI; + + var cos = Math.cos(rotation); + var sin = Math.sin(rotation); + var lumR = 0.213; + var lumG = 0.715; + var lumB = 0.072; + + return this.multiply([ + lumR + cos * (1 - lumR) + sin * (-lumR),lumG + cos * (-lumG) + sin * (-lumG),lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0, + lumR + cos * (-lumR) + sin * (0.143),lumG + cos * (1 - lumG) + sin * (0.140),lumB + cos * (-lumB) + sin * (-0.283), 0, 0, + lumR + cos * (-lumR) + sin * (-(1 - lumR)),lumG + cos * (-lumG) + sin * (lumG),lumB + cos * (1 - lumB) + sin * (lumB), 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Sets this ColorMatrix to be grayscale. + * + * @method Phaser.Display.ColorMatrix#grayscale + * @since 3.50.0 + * + * @param {number} [value=1] - The grayscale scale (0 is black). + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + grayscale: function (value, multiply) + { + if (value === undefined) { value = 1; } + if (multiply === undefined) { multiply = false; } + + return this.saturate(-value, multiply); + }, + + /** + * Sets this ColorMatrix to be black and white. + * + * @method Phaser.Display.ColorMatrix#blackWhite + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + blackWhite: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.BLACK_WHITE, multiply); + }, + + /** + * Change the contrast of this ColorMatrix by the amount given. + * + * @method Phaser.Display.ColorMatrix#contrast + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of contrast to apply to this ColorMatrix. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + contrast: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var v = value + 1; + var o = -0.5 * (v - 1); + + return this.multiply([ + v, 0, 0, 0, o, + 0, v, 0, 0, o, + 0, 0, v, 0, o, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Converts this ColorMatrix to have negative values. + * + * @method Phaser.Display.ColorMatrix#negative + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + negative: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.NEGATIVE, multiply); + }, + + /** + * Apply a desaturated luminance to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#desaturateLuminance + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + desaturateLuminance: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.DESATURATE_LUMINANCE, multiply); + }, + + /** + * Applies a sepia tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#sepia + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + sepia: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.SEPIA, multiply); + }, + + /** + * Applies a night vision tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#night + * @since 3.50.0 + * + * @param {number} [intensity=0.1] - The intensity of this effect. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + night: function (intensity, multiply) + { + if (intensity === undefined) { intensity = 0.1; } + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + intensity * (-2.0), -intensity, 0, 0, 0, + -intensity, 0, intensity, 0, 0, + 0, intensity, intensity * 2.0, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a trippy color tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#lsd + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + lsd: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.LSD, multiply); + }, + + /** + * Applies a brown tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#brown + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + brown: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.BROWN, multiply); + }, + + /** + * Applies a vintage pinhole color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#vintagePinhole + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + vintagePinhole: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.VINTAGE, multiply); + }, + + /** + * Applies a kodachrome color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#kodachrome + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + kodachrome: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.KODACHROME, multiply); + }, + + /** + * Applies a technicolor color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#technicolor + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + technicolor: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.TECHNICOLOR, multiply); + }, + + /** + * Applies a polaroid color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#polaroid + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + polaroid: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.POLAROID, multiply); + }, + + /** + * Shifts the values of this ColorMatrix into BGR order. + * + * @method Phaser.Display.ColorMatrix#shiftToBGR + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + shiftToBGR: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.SHIFT_BGR, multiply); + }, + + /** + * Multiplies the two given matrices. + * + * @method Phaser.Display.ColorMatrix#multiply + * @since 3.50.0 + * + * @param {number[]} a - The 5x4 array to multiply with ColorMatrix._matrix. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + multiply: function (a, multiply) + { + if (multiply === undefined) { multiply = false; } + + // Duplicate _matrix into c + + if (!multiply) + { + this.reset(); + } + + var m = this._matrix; + var c = tempMatrix; + + // copy _matrix to tempMatrox + c.set(m); + + m.set([ + // R + (c[0] * a[0]) + (c[1] * a[5]) + (c[2] * a[10]) + (c[3] * a[15]), + (c[0] * a[1]) + (c[1] * a[6]) + (c[2] * a[11]) + (c[3] * a[16]), + (c[0] * a[2]) + (c[1] * a[7]) + (c[2] * a[12]) + (c[3] * a[17]), + (c[0] * a[3]) + (c[1] * a[8]) + (c[2] * a[13]) + (c[3] * a[18]), + (c[0] * a[4]) + (c[1] * a[9]) + (c[2] * a[14]) + (c[3] * a[19]) + c[4], + + // G + (c[5] * a[0]) + (c[6] * a[5]) + (c[7] * a[10]) + (c[8] * a[15]), + (c[5] * a[1]) + (c[6] * a[6]) + (c[7] * a[11]) + (c[8] * a[16]), + (c[5] * a[2]) + (c[6] * a[7]) + (c[7] * a[12]) + (c[8] * a[17]), + (c[5] * a[3]) + (c[6] * a[8]) + (c[7] * a[13]) + (c[8] * a[18]), + (c[5] * a[4]) + (c[6] * a[9]) + (c[7] * a[14]) + (c[8] * a[19]) + c[9], + + // B + (c[10] * a[0]) + (c[11] * a[5]) + (c[12] * a[10]) + (c[13] * a[15]), + (c[10] * a[1]) + (c[11] * a[6]) + (c[12] * a[11]) + (c[13] * a[16]), + (c[10] * a[2]) + (c[11] * a[7]) + (c[12] * a[12]) + (c[13] * a[17]), + (c[10] * a[3]) + (c[11] * a[8]) + (c[12] * a[13]) + (c[13] * a[18]), + (c[10] * a[4]) + (c[11] * a[9]) + (c[12] * a[14]) + (c[13] * a[19]) + c[14], + + // A + (c[15] * a[0]) + (c[16] * a[5]) + (c[17] * a[10]) + (c[18] * a[15]), + (c[15] * a[1]) + (c[16] * a[6]) + (c[17] * a[11]) + (c[18] * a[16]), + (c[15] * a[2]) + (c[16] * a[7]) + (c[17] * a[12]) + (c[18] * a[17]), + (c[15] * a[3]) + (c[16] * a[8]) + (c[17] * a[13]) + (c[18] * a[18]), + (c[15] * a[4]) + (c[16] * a[9]) + (c[17] * a[14]) + (c[18] * a[19]) + c[19] + + ]); + + this._dirty = true; + + return this; } }); -module.exports = SpineContainer; +/** + * A constant array used by the ColorMatrix class for black_white operations. + * + * @name Phaser.Display.ColorMatrix.BLACK_WHITE + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.BLACK_WHITE = [ 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for negative operations. + * + * @name Phaser.Display.ColorMatrix.NEGATIVE + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.NEGATIVE = [ -1, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for desatured luminance operations. + * + * @name Phaser.Display.ColorMatrix.DESATURATE_LUMINANCE + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.DESATURATE_LUMINANCE = [ 0.2764723, 0.9297080, 0.0938197, 0, -37.1, 0.2764723, 0.9297080, 0.0938197, 0, -37.1, 0.2764723, 0.9297080, 0.0938197, 0, -37.1, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for sepia operations. + * + * @name Phaser.Display.ColorMatrix.SEPIA + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.SEPIA = [ 0.393, 0.7689999, 0.18899999, 0, 0, 0.349, 0.6859999, 0.16799999, 0, 0, 0.272, 0.5339999, 0.13099999, 0, 0, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for lsd operations. + * + * @name Phaser.Display.ColorMatrix.LSD + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.LSD = [ 2, -0.4, 0.5, 0, 0, -0.5, 2, -0.4, 0, 0, -0.4, -0.5, 3, 0, 0, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for brown operations. + * + * @name Phaser.Display.ColorMatrix.BROWN + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.BROWN = [ 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873, -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127, 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for vintage pinhole operations. + * + * @name Phaser.Display.ColorMatrix.VINTAGE + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.VINTAGE = [ 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123, 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591, 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for kodachrome operations. + * + * @name Phaser.Display.ColorMatrix.KODACHROME + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.KODACHROME = [ 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502, -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203, -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for technicolor operations. + * + * @name Phaser.Display.ColorMatrix.TECHNICOLOR + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.TECHNICOLOR = [ 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337, -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398, -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for polaroid shift operations. + * + * @name Phaser.Display.ColorMatrix.POLAROID + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.POLAROID = [ 1.438, -0.062, -0.062, 0, 0, -0.122, 1.378, -0.122, 0, 0, -0.016, -0.016, 1.483, 0, 0, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for shift BGR operations. + * + * @name Phaser.Display.ColorMatrix.SHIFT_BGR + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.SHIFT_BGR = [ 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 ]; + +module.exports = ColorMatrix; /***/ }), -/* 257 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8073: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(9454); +var Smoothing = __webpack_require__(2150); + +// The pool into which the canvas elements are placed. +var pool = []; + +// Automatically apply smoothing(false) to created Canvas elements +var _disableContextSmoothing = false; + +/** + * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. + * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, + * which is useless for some of the Phaser pipelines / renderer. + * + * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. + * Which means all instances of Phaser Games on the same page can share the one single pool. + * + * @namespace Phaser.Display.Canvas.CanvasPool + * @since 3.0.0 + */ +var CanvasPool = function () +{ + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.create + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. + * @param {boolean} [selfParent=false] - Use the generated Canvas element as the parent? + * + * @return {HTMLCanvasElement} The canvas element that was created or pulled from the pool + */ + var create = function (parent, width, height, canvasType, selfParent) + { + if (width === undefined) { width = 1; } + if (height === undefined) { height = 1; } + if (canvasType === undefined) { canvasType = CONST.CANVAS; } + if (selfParent === undefined) { selfParent = false; } + + var canvas; + var container = first(canvasType); + + if (container === null) + { + container = { + parent: parent, + canvas: document.createElement('canvas'), + type: canvasType + }; + + if (canvasType === CONST.CANVAS) + { + pool.push(container); + } + + canvas = container.canvas; + } + else + { + container.parent = parent; + + canvas = container.canvas; + } + + if (selfParent) + { + container.parent = canvas; + } + + canvas.width = width; + canvas.height = height; + + if (_disableContextSmoothing && canvasType === CONST.CANVAS) + { + Smoothing.disable(canvas.getContext('2d', { willReadFrequently: false })); + } + + return canvas; + }; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.create2D + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * + * @return {HTMLCanvasElement} The created canvas. + */ + var create2D = function (parent, width, height) + { + return create(parent, width, height, CONST.CANVAS); + }; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.createWebGL + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * + * @return {HTMLCanvasElement} The created WebGL canvas. + */ + var createWebGL = function (parent, width, height) + { + return create(parent, width, height, CONST.WEBGL); + }; + + /** + * Gets the first free canvas index from the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.first + * @since 3.0.0 + * + * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. + * + * @return {HTMLCanvasElement} The first free canvas, or `null` if a WebGL canvas was requested or if the pool doesn't have free canvases. + */ + var first = function (canvasType) + { + if (canvasType === undefined) { canvasType = CONST.CANVAS; } + + if (canvasType === CONST.WEBGL) + { + return null; + } + + for (var i = 0; i < pool.length; i++) + { + var container = pool[i]; + + if (!container.parent && container.type === canvasType) + { + return container; + } + } + + return null; + }; + + /** + * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use. + * The canvas has its width and height set to 1, and its parent attribute nulled. + * + * @function Phaser.Display.Canvas.CanvasPool.remove + * @since 3.0.0 + * + * @param {*} parent - The canvas or the parent of the canvas to free. + */ + var remove = function (parent) + { + // Check to see if the parent is a canvas object + var isCanvas = parent instanceof HTMLCanvasElement; + + pool.forEach(function (container) + { + if ((isCanvas && container.canvas === parent) || (!isCanvas && container.parent === parent)) + { + container.parent = null; + container.canvas.width = 1; + container.canvas.height = 1; + } + }); + }; + + /** + * Gets the total number of used canvas elements in the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.total + * @since 3.0.0 + * + * @return {number} The number of used canvases. + */ + var total = function () + { + var c = 0; + + pool.forEach(function (container) + { + if (container.parent) + { + c++; + } + }); + + return c; + }; + + /** + * Gets the total number of free canvas elements in the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.free + * @since 3.0.0 + * + * @return {number} The number of free canvases. + */ + var free = function () + { + return pool.length - total(); + }; + + /** + * Disable context smoothing on any new Canvas element created. + * + * @function Phaser.Display.Canvas.CanvasPool.disableSmoothing + * @since 3.0.0 + */ + var disableSmoothing = function () + { + _disableContextSmoothing = true; + }; + + /** + * Enable context smoothing on any new Canvas element created. + * + * @function Phaser.Display.Canvas.CanvasPool.enableSmoothing + * @since 3.0.0 + */ + var enableSmoothing = function () + { + _disableContextSmoothing = false; + }; + + return { + create2D: create2D, + create: create, + createWebGL: createWebGL, + disableSmoothing: disableSmoothing, + enableSmoothing: enableSmoothing, + first: first, + free: free, + pool: pool, + remove: remove, + total: total + }; +}; + +// If we export the called function here, it'll only be invoked once (not every time it's required). +module.exports = CanvasPool(); + + +/***/ }), + +/***/ 2150: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Browser specific prefix, so not going to change between contexts, only between browsers +var prefix = ''; + +/** + * @namespace Phaser.Display.Canvas.Smoothing + * @since 3.0.0 + */ +var Smoothing = function () +{ + /** + * Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set. + * + * @function Phaser.Display.Canvas.Smoothing.getPrefix + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The canvas context to check. + * + * @return {string} The name of the property on the context which controls image smoothing (either `imageSmoothingEnabled` or a vendor-prefixed version thereof), or `null` if not supported. + */ + var getPrefix = function (context) + { + var vendors = [ 'i', 'webkitI', 'msI', 'mozI', 'oI' ]; + + for (var i = 0; i < vendors.length; i++) + { + var s = vendors[i] + 'mageSmoothingEnabled'; + + if (s in context) + { + return s; + } + } + + return null; + }; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * + * @function Phaser.Display.Canvas.Smoothing.enable + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to enable smoothing. + * + * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. + */ + var enable = function (context) + { + if (prefix === '') + { + prefix = getPrefix(context); + } + + if (prefix) + { + context[prefix] = true; + } + + return context; + }; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * + * @function Phaser.Display.Canvas.Smoothing.disable + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to disable smoothing. + * + * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. + */ + var disable = function (context) + { + if (prefix === '') + { + prefix = getPrefix(context); + } + + if (prefix) + { + context[prefix] = false; + } + + return context; + }; + + /** + * Returns `true` if the given context has image smoothing enabled, otherwise returns `false`. + * Returns null if no smoothing prefix is available. + * + * @function Phaser.Display.Canvas.Smoothing.isEnabled + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context to check. + * + * @return {?boolean} `true` if smoothing is enabled on the context, otherwise `false`. `null` if not supported. + */ + var isEnabled = function (context) + { + return (prefix !== null) ? context[prefix] : null; + }; + + return { + disable: disable, + enable: enable, + getPrefix: getPrefix, + isEnabled: isEnabled + }; + +}; + +module.exports = Smoothing(); + + +/***/ }), + +/***/ 7499: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var GameObjectFactory = __webpack_require__(3649); + +/** + * @classdesc + * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. + * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask, + * not a clipping path. It is only available when using the WebGL Renderer. + * + * A Bitmap Mask can use any Game Object or Dynamic Texture to determine the alpha of each pixel of the masked Game Object(s). + * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha + * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the + * Bitmap Mask doesn't matter. + * + * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an + * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means + * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects. + * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the + * corresponding pixel in the mask. + * + * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, + * combine Geometry Masks and Blend Modes together. + * + * The Bitmap Mask's location matches the location of its Game Object, not the location of the + * masked objects. Moving or transforming the underlying Game Object will change the mask + * (and affect the visibility of any masked objects), whereas moving or transforming a masked object + * will not affect the mask. + * + * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a + * Scene's display list, it will only be used for the mask and its full texture will not be directly + * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will + * render as a normal Game Object and will also serve as a mask. + * + * @class BitmapMask + * @memberof Phaser.Display.Masks + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this mask is being added. + * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Dynamic Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. + * @param {number} [x] - If creating a Game Object, the horizontal position in the world. + * @param {number} [y] - If creating a Game Object, the vertical position in the world. + * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. + */ +var BitmapMask = new Class({ + + initialize: + + function BitmapMask (scene, maskObject, x, y, texture, frame) + { + if (!maskObject) + { + maskObject = scene.sys.make.image({ x: x, y: y, key: texture, frame: frame, add: false }); + } + + /** + * The Game Object that is used as the mask. Must use a texture, such as a Sprite. + * + * @name Phaser.Display.Masks.BitmapMask#bitmapMask + * @type {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} + * @since 3.0.0 + */ + this.bitmapMask = maskObject; + + /** + * Whether to invert the masks alpha. + * + * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. + * + * Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. + * + * @name Phaser.Display.Masks.BitmapMask#invertAlpha + * @type {boolean} + * @since 3.1.2 + */ + this.invertAlpha = false; + + /** + * Is this mask a stencil mask? This is false by default and should not be changed. + * + * @name Phaser.Display.Masks.BitmapMask#isStencil + * @type {boolean} + * @readonly + * @since 3.17.0 + */ + this.isStencil = false; + }, + + /** + * Sets a new Game Object or Dynamic Texture for this Bitmap Mask to use. + * + * If a Game Object it must have a texture, such as a Sprite. + * + * You can update the source of the mask as often as you like. + * + * @method Phaser.Display.Masks.BitmapMask#setBitmap + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} maskObject - The Game Object or Dynamic Texture that will be used as the mask. If a Game Object, it must have a texture, such as a Sprite. + */ + setBitmap: function (maskObject) + { + this.bitmapMask = maskObject; + }, + + /** + * Prepares the WebGL Renderer to render a Game Object with this mask applied. + * + * This renders the masking Game Object to the mask framebuffer and switches to the main framebuffer so that the masked Game Object will be rendered to it instead of being rendered directly to the frame. + * + * @method Phaser.Display.Masks.BitmapMask#preRenderWebGL + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to prepare. + * @param {Phaser.GameObjects.GameObject} maskedObject - The masked Game Object which will be drawn. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. + */ + preRenderWebGL: function (renderer, maskedObject, camera) + { + renderer.pipelines.BITMAPMASK_PIPELINE.beginMask(this, maskedObject, camera); + }, + + /** + * Finalizes rendering of a masked Game Object. + * + * This resets the previously bound framebuffer and switches the WebGL Renderer to the Bitmap Mask Pipeline, which uses a special fragment shader to apply the masking effect. + * + * @method Phaser.Display.Masks.BitmapMask#postRenderWebGL + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to clean up. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. + * @param {Phaser.Renderer.WebGL.RenderTarget} [renderTarget] - Optional WebGL RenderTarget. + */ + postRenderWebGL: function (renderer, camera, renderTarget) + { + renderer.pipelines.BITMAPMASK_PIPELINE.endMask(this, camera, renderTarget); + }, + + /** + * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * + * @method Phaser.Display.Masks.BitmapMask#preRenderCanvas + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to. + * @param {Phaser.GameObjects.GameObject} mask - The masked Game Object which would be rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. + */ + preRenderCanvas: function () + { + // NOOP + }, + + /** + * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * + * @method Phaser.Display.Masks.BitmapMask#postRenderCanvas + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to. + */ + postRenderCanvas: function () + { + // NOOP + }, + + /** + * Destroys this BitmapMask and nulls any references it holds. + * + * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, + * so be sure to call `clearMask` on any Game Object using it, before destroying it. + * + * @method Phaser.Display.Masks.BitmapMask#destroy + * @since 3.7.0 + */ + destroy: function () + { + this.bitmapMask = null; + } + +}); + +/** + * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. + * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask, + * not a clipping path. It is only available when using the WebGL Renderer. + * + * A Bitmap Mask can use any Game Object, or Dynamic Texture, to determine the alpha of each pixel of the masked Game Object(s). + * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha + * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the + * Bitmap Mask doesn't matter. + * + * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an + * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means + * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects + * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the + * corresponding pixel in the mask. + * + * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, + * combine Geometry Masks and Blend Modes together. + * + * The Bitmap Mask's location matches the location of its Game Object, not the location of the + * masked objects. Moving or transforming the underlying Game Object will change the mask + * (and affect the visibility of any masked objects), whereas moving or transforming a masked object + * will not affect the mask. + * + * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a + * Scene's display list, it will only be used for the mask and its full texture will not be directly + * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will + * render as a normal Game Object and will also serve as a mask. + * + * @method Phaser.GameObjects.GameObjectFactory#bitmapMask + * @since 3.60.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. + * @param {number} [x] - If creating a Game Object, the horizontal position in the world. + * @param {number} [y] - If creating a Game Object, the vertical position in the world. + * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.Display.Masks.BitmapMask} The Bitmap Mask that was created. + */ +GameObjectFactory.register('bitmapMask', function (maskObject, x, y, key, frame) +{ + return new BitmapMask(this.scene, maskObject, x, y, key, frame); +}); + +module.exports = BitmapMask; + + +/***/ }), + +/***/ 6726: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect + * a visible pixel from the geometry mask. The mask is essentially a clipping path which can only + * make a masked pixel fully visible or fully invisible without changing its alpha (opacity). + * + * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) + * should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed + * if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and + * alpha of the pixel from the Geometry Mask do not matter. + * + * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. + * Moving or transforming the underlying Graphics object will change the mask (and affect the visibility + * of any masked objects), whereas moving or transforming a masked object will not affect the mask. + * You can think of the Geometry Mask (or rather, of its Graphics object) as an invisible curtain placed + * in front of all masked objects which has its own visual properties and, naturally, respects the camera's + * visual properties, but isn't affected by and doesn't follow the masked objects by itself. + * + * @class GeometryMask + * @memberof Phaser.Display.Masks + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - This parameter is not used. + * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List. + */ +var GeometryMask = new Class({ + + initialize: + + function GeometryMask (scene, graphicsGeometry) + { + /** + * The Graphics object which describes the Geometry Mask. + * + * @name Phaser.Display.Masks.GeometryMask#geometryMask + * @type {Phaser.GameObjects.Graphics} + * @since 3.0.0 + */ + this.geometryMask = graphicsGeometry; + + /** + * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels + * drawn to the Geometry Mask. + * + * This is a WebGL only feature. + * + * @name Phaser.Display.Masks.GeometryMask#invertAlpha + * @type {boolean} + * @since 3.16.0 + */ + this.invertAlpha = false; + + /** + * Is this mask a stencil mask? + * + * @name Phaser.Display.Masks.GeometryMask#isStencil + * @type {boolean} + * @readonly + * @since 3.17.0 + */ + this.isStencil = true; + + /** + * The current stencil level. This can change dynamically at runtime + * and is set in the applyStencil method. + * + * @name Phaser.Display.Masks.GeometryMask#level + * @type {boolean} + * @since 3.17.0 + */ + this.level = 0; + }, + + /** + * Sets a new Graphics object for the Geometry Mask. + * + * @method Phaser.Display.Masks.GeometryMask#setShape + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. + * + * @return {this} This Geometry Mask + */ + setShape: function (graphicsGeometry) + { + this.geometryMask = graphicsGeometry; + + return this; + }, + + /** + * Sets the `invertAlpha` property of this Geometry Mask. + * + * Inverting the alpha essentially flips the way the mask works. + * + * This is a WebGL only feature. + * + * @method Phaser.Display.Masks.GeometryMask#setInvertAlpha + * @since 3.17.0 + * + * @param {boolean} [value=true] - Invert the alpha of this mask? + * + * @return {this} This Geometry Mask + */ + setInvertAlpha: function (value) + { + if (value === undefined) { value = true; } + + this.invertAlpha = value; + + return this; + }, + + /** + * Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask. + * + * @method Phaser.Display.Masks.GeometryMask#preRenderWebGL + * @since 3.0.0 + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. + * @param {Phaser.GameObjects.GameObject} child - The Game Object being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. + */ + preRenderWebGL: function (renderer, child, camera) + { + var gl = renderer.gl; + + // Force flushing before drawing to stencil buffer + renderer.flush(); + + if (renderer.maskStack.length === 0) + { + gl.enable(gl.STENCIL_TEST); + gl.clear(gl.STENCIL_BUFFER_BIT); + + renderer.maskCount = 0; + } + + if (renderer.currentCameraMask.mask !== this) + { + renderer.currentMask.mask = this; + } + + renderer.maskStack.push({ mask: this, camera: camera }); + + this.applyStencil(renderer, camera, true); + + renderer.maskCount++; + }, + + /** + * Applies the current stencil mask to the renderer. + * + * @method Phaser.Display.Masks.GeometryMask#applyStencil + * @since 3.17.0 + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. + * @param {boolean} inc - Is this an INCR stencil or a DECR stencil? + */ + applyStencil: function (renderer, camera, inc) + { + var gl = renderer.gl; + var geometryMask = this.geometryMask; + var level = renderer.maskCount; + var mask = 0xff; + + gl.colorMask(false, false, false, false); + + if (inc) + { + gl.stencilFunc(gl.EQUAL, level, mask); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR); + + // Do this _after_ we set the stencilFunc + level++; + } + else + { + gl.stencilFunc(gl.EQUAL, level + 1, mask); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR); + } + + this.level = level; + + // Write stencil buffer + geometryMask.renderWebGL(renderer, geometryMask, camera); + + renderer.flush(); + + gl.colorMask(true, true, true, true); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + + if (this.invertAlpha) + { + gl.stencilFunc(gl.NOTEQUAL, level, mask); + } + else + { + gl.stencilFunc(gl.EQUAL, level, mask); + } + }, + + /** + * Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it. + * + * @method Phaser.Display.Masks.GeometryMask#postRenderWebGL + * @since 3.0.0 + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw flush. + */ + postRenderWebGL: function (renderer) + { + var gl = renderer.gl; + + renderer.maskStack.pop(); + + renderer.maskCount--; + + // Force flush before disabling stencil test + renderer.flush(); + + var current = renderer.currentMask; + + if (renderer.maskStack.length === 0) + { + // If this is the only mask in the stack, flush and disable + current.mask = null; + + gl.disable(gl.STENCIL_TEST); + } + else + { + var prev = renderer.maskStack[renderer.maskStack.length - 1]; + + prev.mask.applyStencil(renderer, prev.camera, false); + + if (renderer.currentCameraMask.mask !== prev.mask) + { + current.mask = prev.mask; + current.camera = prev.camera; + } + else + { + current.mask = null; + } + } + }, + + /** + * Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object. + * + * @method Phaser.Display.Masks.GeometryMask#preRenderCanvas + * @since 3.0.0 + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance to set the clipping path on. + * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. + */ + preRenderCanvas: function (renderer, mask, camera) + { + var geometryMask = this.geometryMask; + + renderer.currentContext.save(); + + geometryMask.renderCanvas(renderer, geometryMask, camera, null, null, true); + + renderer.currentContext.clip(); + }, + + /** + * Restore the canvas context's previous clipping path, thus turning off the mask for it. + * + * @method Phaser.Display.Masks.GeometryMask#postRenderCanvas + * @since 3.0.0 + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance being restored. + */ + postRenderCanvas: function (renderer) + { + renderer.currentContext.restore(); + }, + + /** + * Destroys this GeometryMask and nulls any references it holds. + * + * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, + * so be sure to call `clearMask` on any Game Object using it, before destroying it. + * + * @method Phaser.Display.Masks.GeometryMask#destroy + * @since 3.7.0 + */ + destroy: function () + { + this.geometryMask = null; + } + +}); + +module.exports = GeometryMask; + + +/***/ }), + +/***/ 7340: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Barrel FX Controller. + * + * This FX controller manages the barrel distortion effect for a Game Object. + * + * A barrel effect allows you to apply either a 'pinch' or 'expand' distortion to + * a Game Object. The amount of the effect can be modified in real-time. + * + * A Barrel effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBarrel(); + * sprite.postFX.addBarrel(); + * ``` + * + * @class Barrel + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [amount=1] - The amount of distortion applied to the barrel effect. A value of 1 is no distortion. Typically keep this within +- 1. + */ +var Barrel = new Class({ + + Extends: Controller, + + initialize: + + function Barrel (gameObject, amount) + { + if (amount === undefined) { amount = 1; } + + Controller.call(this, FX_CONST.BARREL, gameObject); + + /** + * The amount of distortion applied to the barrel effect. + * + * Typically keep this within the range 1 (no distortion) to +- 1. + * + * @name Phaser.FX.Barrel#amount + * @type {number} + * @since 3.60.0 + */ + this.amount = amount; + } + +}); + +module.exports = Barrel; + + +/***/ }), + +/***/ 5170: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Bloom FX Controller. + * + * This FX controller manages the bloom effect for a Game Object. + * + * Bloom is an effect used to reproduce an imaging artifact of real-world cameras. + * The effect produces fringes of light extending from the borders of bright areas in an image, + * contributing to the illusion of an extremely bright light overwhelming the + * camera or eye capturing the scene. + * + * A Bloom effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBloom(); + * sprite.postFX.addBloom(); + * ``` + * + * @class Bloom + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [color=0xffffff] - The color of the Bloom, as a hex value. + * @param {number} [offsetX=1] - The horizontal offset of the bloom effect. + * @param {number} [offsetY=1] - The vertical offset of the bloom effect. + * @param {number} [blurStrength=1] - The strength of the blur process of the bloom effect. + * @param {number} [strength=1] - The strength of the blend process of the bloom effect. + * @param {number} [steps=4] - The number of steps to run the Bloom effect for. This value should always be an integer. + */ +var Bloom = new Class({ + + Extends: Controller, + + initialize: + + function Bloom (gameObject, color, offsetX, offsetY, blurStrength, strength, steps) + { + if (offsetX === undefined) { offsetX = 1; } + if (offsetY === undefined) { offsetY = 1; } + if (blurStrength === undefined) { blurStrength = 1; } + if (strength === undefined) { strength = 1; } + if (steps === undefined) { steps = 4; } + + Controller.call(this, FX_CONST.BLOOM, gameObject); + + /** + * The number of steps to run the Bloom effect for. + * + * This value should always be an integer. + * + * It defaults to 4. The higher the value, the smoother the Bloom, + * but at the cost of exponentially more gl operations. + * + * Keep this to the lowest possible number you can have it, while + * still looking correct for your game. + * + * @name Phaser.FX.Bloom#steps + * @type {number} + * @since 3.60.0 + */ + this.steps = steps; + + /** + * The horizontal offset of the bloom effect. + * + * @name Phaser.FX.Bloom#offsetX + * @type {number} + * @since 3.60.0 + */ + this.offsetX = offsetX; + + /** + * The vertical offset of the bloom effect. + * + * @name Phaser.FX.Bloom#offsetY + * @type {number} + * @since 3.60.0 + */ + this.offsetY = offsetY; + + /** + * The strength of the blur process of the bloom effect. + * + * @name Phaser.FX.Bloom#blurStrength + * @type {number} + * @since 3.60.0 + */ + this.blurStrength = blurStrength; + + /** + * The strength of the blend process of the bloom effect. + * + * @name Phaser.FX.Bloom#strength + * @type {number} + * @since 3.60.0 + */ + this.strength = strength; + + /** + * The internal gl color array. + * + * @name Phaser.FX.Bloom#glcolor + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor = [ 1, 1, 1 ]; + + if (color !== undefined && color !== null) + { + this.color = color; + } + }, + + /** + * The color of the bloom as a number value. + * + * @name Phaser.FX.Bloom#color + * @type {number} + * @since 3.60.0 + */ + color: { + + get: function () + { + var color = this.glcolor; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + } + +}); + +module.exports = Bloom; + + +/***/ }), + +/***/ 4199: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Blur FX Controller. + * + * This FX controller manages the blur effect for a Game Object. + * + * A Gaussian blur is the result of blurring an image by a Gaussian function. It is a widely used effect, + * typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a + * smooth blur resembling that of viewing the image through a translucent screen, distinctly different + * from the bokeh effect produced by an out-of-focus lens or the shadow of an object under usual illumination. + * + * A Blur effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBlur(); + * sprite.postFX.addBlur(); + * ``` + * + * @class Blur + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [quality=0] - The quality of the blur effect. Can be either 0 for Low Quality, 1 for Medium Quality or 2 for High Quality. + * @param {number} [x=2] - The horizontal offset of the blur effect. + * @param {number} [y=2] - The vertical offset of the blur effect. + * @param {number} [strength=1] - The strength of the blur effect. + * @param {number} [color=0xffffff] - The color of the blur, as a hex value. + * @param {number} [steps=4] - The number of steps to run the blur effect for. This value should always be an integer. + */ +var Blur = new Class({ + + Extends: Controller, + + initialize: + + function Blur (gameObject, quality, x, y, strength, color, steps) + { + if (quality === undefined) { quality = 0; } + if (x === undefined) { x = 2; } + if (y === undefined) { y = 2; } + if (strength === undefined) { strength = 1; } + if (steps === undefined) { steps = 4; } + + Controller.call(this, FX_CONST.BLUR, gameObject); + + /** + * The quality of the blur effect. + * + * This can be: + * + * 0 for Low Quality + * 1 for Medium Quality + * 2 for High Quality + * + * The higher the quality, the more complex shader is used + * and the more processing time is spent on the GPU calculating + * the final blur. This value is used in conjunction with the + * `steps` value, as one has a direct impact on the other. + * + * Keep this value as low as you can, while still achieving the + * desired effect you need for your game. + * + * @name Phaser.FX.Blur#quality + * @type {number} + * @since 3.60.0 + */ + this.quality = 0; + + /** + * The horizontal offset of the blur effect. + * + * @name Phaser.FX.Blur#x + * @type {number} + * @since 3.60.0 + */ + this.x = x; + + /** + * The vertical offset of the blur effect. + * + * @name Phaser.FX.Blur#y + * @type {number} + * @since 3.60.0 + */ + this.y = y; + + /** + * The number of steps to run the Blur effect for. + * + * This value should always be an integer. + * + * It defaults to 4. The higher the value, the smoother the blur, + * but at the cost of exponentially more gl operations. + * + * Keep this to the lowest possible number you can have it, while + * still looking correct for your game. + * + * @name Phaser.FX.Blur#steps + * @type {number} + * @since 3.60.0 + */ + this.steps = steps; + + /** + * The strength of the blur effect. + * + * @name Phaser.FX.Blur#strength + * @type {number} + * @since 3.60.0 + */ + this.strength = strength; + + /** + * The internal gl color array. + * + * @name Phaser.FX.Blur#glcolor + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor = [ 1, 1, 1 ]; + + if (color !== undefined && color !== null) + { + this.color = color; + } + }, + + /** + * The color of the blur as a number value. + * + * @name Phaser.FX.Blur#color + * @type {number} + * @since 3.60.0 + */ + color: { + + get: function () + { + var color = this.glcolor; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + } + +}); + +module.exports = Blur; + + +/***/ }), + +/***/ 3132: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Bokeh FX Controller. + * + * This FX controller manages the bokeh effect for a Game Object. + * + * Bokeh refers to a visual effect that mimics the photographic technique of creating a shallow depth of field. + * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground + * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering + * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. + * + * This effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature + * effect by blurring everything except a small area of the image. This effect is achieved by blurring the + * top and bottom elements, while keeping the center area in focus. + * + * A Bokeh effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBokeh(); + * sprite.postFX.addBokeh(); + * ``` + * + * @class Bokeh + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [radius=0.5] - The radius of the bokeh effect. + * @param {number} [amount=1] - The amount of the bokeh effect. + * @param {number} [contrast=0.2] - The color contrast of the bokeh effect. + * @param {boolean} [isTiltShift=false] - Is this a bokeh or Tile Shift effect? + * @param {number} [blurX=1] - If Tilt Shift, the amount of horizontal blur. + * @param {number} [blurY=1] - If Tilt Shift, the amount of vertical blur. + * @param {number} [strength=1] - If Tilt Shift, the strength of the blur. + */ +var Bokeh = new Class({ + + Extends: Controller, + + initialize: + + function Bokeh (gameObject, radius, amount, contrast, isTiltShift, blurX, blurY, strength) + { + if (radius === undefined) { radius = 0.5; } + if (amount === undefined) { amount = 1; } + if (contrast === undefined) { contrast = 0.2; } + if (isTiltShift === undefined) { isTiltShift = false; } + if (blurX === undefined) { blurX = 1; } + if (blurY === undefined) { blurY = 1; } + if (strength === undefined) { strength = 1; } + + Controller.call(this, FX_CONST.BOKEH, gameObject); + + /** + * The radius of the bokeh effect. + * + * This is a float value, where a radius of 0 will result in no effect being applied, + * and a radius of 1 will result in a strong bokeh. However, you can exceed this value + * for even stronger effects. + * + * @name Phaser.FX.Bokeh#radius + * @type {number} + * @since 3.60.0 + */ + this.radius = radius; + + /** + * The amount, or strength, of the bokeh effect. Defaults to 1. + * + * @name Phaser.FX.Bokeh#amount + * @type {number} + * @since 3.60.0 + */ + this.amount = amount; + + /** + * The color contrast, or brightness, of the bokeh effect. Defaults to 0.2. + * + * @name Phaser.FX.Bokeh#contrast + * @type {number} + * @since 3.60.0 + */ + this.contrast = contrast; + + /** + * Is this a Tilt Shift effect or a standard bokeh effect? + * + * @name Phaser.FX.Bokeh#isTiltShift + * @type {boolean} + * @since 3.60.0 + */ + this.isTiltShift = isTiltShift; + + /** + * If a Tilt Shift effect this controls the strength of the blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#strength + * @type {number} + * @since 3.60.0 + */ + this.strength = strength; + + /** + * If a Tilt Shift effect this controls the amount of horizontal blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#blurX + * @type {number} + * @since 3.60.0 + */ + this.blurX = blurX; + + /** + * If a Tilt Shift effect this controls the amount of vertical blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#blurY + * @type {number} + * @since 3.60.0 + */ + this.blurY = blurY; + } + +}); + +module.exports = Bokeh; + + +/***/ }), + +/***/ 6610: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Circle FX Controller. + * + * This FX controller manages the circle effect for a Game Object. + * + * This effect will draw a circle around the texture of the Game Object, effectively masking off + * any area outside of the circle without the need for an actual mask. You can control the thickness + * of the circle, the color of the circle and the color of the background, should the texture be + * transparent. You can also control the feathering applied to the circle, allowing for a harsh or soft edge. + * + * Please note that adding this effect to a Game Object will not change the input area or physics body of + * the Game Object, should it have one. + * + * A Circle effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addCircle(); + * sprite.postFX.addCircle(); + * ``` + * + * @class Circle + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [thickness=8] - The width of the circle around the texture, in pixels. + * @param {number} [color=0xfeedb6] - The color of the circular ring, given as a number value. + * @param {number} [backgroundColor=0xff0000] - The color of the background, behind the texture, given as a number value. + * @param {number} [scale=1] - The scale of the circle. The default scale is 1, which is a circle the full size of the underlying texture. + * @param {number} [feather=0.005] - The amount of feathering to apply to the circle from the ring. + */ +var Circle = new Class({ + + Extends: Controller, + + initialize: + + function Circle (gameObject, thickness, color, backgroundColor, scale, feather) + { + if (thickness === undefined) { thickness = 8; } + if (scale === undefined) { scale = 1; } + if (feather === undefined) { feather = 0.005; } + + Controller.call(this, FX_CONST.CIRCLE, gameObject); + + /** + * The scale of the circle. The default scale is 1, which is a circle + * the full size of the underlying texture. Reduce this value to create + * a smaller circle, or increase it to create a circle that extends off + * the edges of the texture. + * + * @name Phaser.FX.Circle#scale + * @type {number} + * @since 3.60.0 + */ + this.scale = scale; + + /** + * The amount of feathering to apply to the circle from the ring, + * extending into the middle of the circle. The default is 0.005, + * which is a very low amount of feathering just making sure the ring + * has a smooth edge. Increase this amount to a value such as 0.5 + * or 0.025 for larger amounts of feathering. + * + * @name Phaser.FX.Circle#feather + * @type {number} + * @since 3.60.0 + */ + this.feather = feather; + + /** + * The width of the circle around the texture, in pixels. This value + * doesn't factor in the feather, which can extend the thickness + * internally depending on its value. + * + * @name Phaser.FX.Circle#thickness + * @type {number} + * @since 3.60.0 + */ + this.thickness = thickness; + + /** + * The internal gl color array for the ring color. + * + * @name Phaser.FX.Circle#glcolor + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor = [ 1, 0.2, 0.7 ]; + + /** + * The internal gl color array for the background color. + * + * @name Phaser.FX.Circle#glcolor2 + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor2 = [ 1, 0, 0, 0.4 ]; + + if (color !== undefined && color !== null) + { + this.color = color; + } + + if (backgroundColor !== undefined && backgroundColor !== null) + { + this.backgroundColor = backgroundColor; + } + }, + + /** + * The color of the circular ring, given as a number value. + * + * @name Phaser.FX.Circle#color + * @type {number} + * @since 3.60.0 + */ + color: { + + get: function () + { + var color = this.glcolor; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + }, + + /** + * The color of the background, behind the texture, given as a number value. + * + * @name Phaser.FX.Circle#backgroundColor + * @type {number} + * @since 3.60.0 + */ + backgroundColor: { + + get: function () + { + var color = this.glcolor2; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor2; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + } + +}); + +module.exports = Circle; + + +/***/ }), + +/***/ 4931: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var BaseColorMatrix = __webpack_require__(5686); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The ColorMatrix FX Controller. + * + * This FX controller manages the color matrix effect for a Game Object. + * + * The color matrix effect is a visual technique that involves manipulating the colors of an image + * or scene using a mathematical matrix. This process can adjust hue, saturation, brightness, and contrast, + * allowing developers to create various stylistic appearances or mood settings within the game. + * Common applications include simulating different lighting conditions, applying color filters, + * or achieving a specific visual style. + * + * A ColorMatrix effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addColorMatrix(); + * sprite.postFX.addColorMatrix(); + * ``` + * + * @class ColorMatrix + * @extends Phaser.Display.ColorMatrix + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + */ +var ColorMatrix = new Class({ + + Extends: BaseColorMatrix, + + initialize: + + function ColorMatrix (gameObject) + { + BaseColorMatrix.call(this); + + /** + * The FX_CONST type of this effect. + * + * @name Phaser.FX.ColorMatrix#type + * @type {number} + * @since 3.60.0 + */ + this.type = FX_CONST.COLOR_MATRIX; + + /** + * A reference to the Game Object that owns this effect. + * + * @name Phaser.FX.ColorMatrix#gameObject + * @type {Phaser.GameObjects.GameObject} + * @since 3.60.0 + */ + this.gameObject = gameObject; + + /** + * Toggle this boolean to enable or disable this effect, + * without removing and adding it from the Game Object. + * + * @name Phaser.FX.ColorMatrix#active + * @type {boolean} + * @since 3.60.0 + */ + this.active = true; + }, + + destroy: function () + { + this.gameObject = null; + this._matrix = null; + this._data = null; + } + +}); + +module.exports = ColorMatrix; + + +/***/ }), + +/***/ 6128: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * FX Controller is the base class that all built-in FX use. + * + * You should not normally create an instance of this class directly, but instead use one of the built-in FX that extend it. + * + * @class Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {number} type - The FX Type constant. + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + */ +var Controller = new Class({ + + initialize: + + function Controller (type, gameObject) + { + /** + * The FX_CONST type of this effect. + * + * @name Phaser.FX.Controller#type + * @type {number} + * @since 3.60.0 + */ + this.type = type; + + /** + * A reference to the Game Object that owns this effect. + * + * @name Phaser.FX.Controller#gameObject + * @type {Phaser.GameObjects.GameObject} + * @since 3.60.0 + */ + this.gameObject = gameObject; + + /** + * Toggle this boolean to enable or disable this effect, + * without removing and adding it from the Game Object. + * + * Only works for Pre FX. + * + * Post FX are always active. + * + * @name Phaser.FX.Controller#active + * @type {boolean} + * @since 3.60.0 + */ + this.active = true; + }, + + /** + * Sets the active state of this FX Controller. + * + * A disabled FX Controller will not be updated. + * + * @method Phaser.FX.Controller#setActive + * @since 3.60.0 + * + * @param {boolean} value - `true` to enable this FX Controller, or `false` to disable it. + * + * @return {this} This FX Controller instance. + */ + setActive: function (value) + { + this.active = value; + + return this; + }, + + /** + * Destroys this FX Controller. + * + * @method Phaser.FX.Controller#destroy + * @since 3.60.0 + */ + destroy: function () + { + this.gameObject = null; + this.active = false; + } + +}); + +module.exports = Controller; + + +/***/ }), + +/***/ 9195: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Displacement FX Controller. + * + * This FX controller manages the displacement effect for a Game Object. + * + * The displacement effect is a visual technique that alters the position of pixels in an image + * or texture based on the values of a displacement map. This effect is used to create the illusion + * of depth, surface irregularities, or distortion in otherwise flat elements. It can be applied to + * characters, objects, or backgrounds to enhance realism, convey movement, or achieve various + * stylistic appearances. + * + * A Displacement effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addDisplacement(); + * sprite.postFX.addDisplacement(); + * ``` + * + * @class Displacement + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * @param {number} [x=0.005] - The amount of horizontal displacement to apply. A very small float number, such as 0.005. + * @param {number} [y=0.005] - The amount of vertical displacement to apply. A very small float number, such as 0.005. + */ +var Displacement = new Class({ + + Extends: Controller, + + initialize: + + function Displacement (gameObject, texture, x, y) + { + if (texture === undefined) { texture = '__WHITE'; } + if (x === undefined) { x = 0.005; } + if (y === undefined) { y = 0.005; } + + Controller.call(this, FX_CONST.DISPLACEMENT, gameObject); + + /** + * The amount of horizontal displacement to apply. + * + * @name Phaser.FX.Displacement#x + * @type {number} + * @since 3.60.0 + */ + this.x = x; + + /** + * The amount of vertical displacement to apply. + * + * @name Phaser.FX.Displacement#y + * @type {number} + * @since 3.60.0 + */ + this.y = y; + + /** + * The underlying WebGLTexture used for displacement. + * + * @name Phaser.FX.Displacement#glTexture + * @type {WebGLTexture} + * @since 3.60.0 + */ + this.glTexture; + + this.setTexture(texture); + }, + + /** + * Sets the Texture to be used for the displacement effect. + * + * You can only use a whole texture, not a frame from a texture atlas or sprite sheet. + * + * @method Phaser.GameObjects.Components.FX#setTexture + * @since 3.60.0 + * + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * + * @return {this} This FX Controller. + */ + setTexture: function (texture) + { + var phaserTexture = this.gameObject.scene.sys.textures.getFrame(texture); + + if (phaserTexture) + { + this.glTexture = phaserTexture.glTexture; + } + + return this; + } + +}); + +module.exports = Displacement; + + +/***/ }), + +/***/ 445: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Glow FX Controller. + * + * This FX controller manages the glow effect for a Game Object. + * + * The glow effect is a visual technique that creates a soft, luminous halo around game objects, + * characters, or UI elements. This effect is used to emphasize importance, enhance visual appeal, + * or convey a sense of energy, magic, or otherworldly presence. The effect can also be set on + * the inside of the Game Object. The color and strength of the glow can be modified. + * + * A Glow effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addGlow(); + * sprite.postFX.addGlow(); + * ``` + * + * @class Glow + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [color=0xffffff] - The color of the glow effect as a number value. + * @param {number} [outerStrength=4] - The strength of the glow outward from the edge of the Sprite. + * @param {number} [innerStrength=0] - The strength of the glow inward from the edge of the Sprite. + * @param {boolean} [knockout=false] - If `true` only the glow is drawn, not the texture itself. + */ +var Glow = new Class({ + + Extends: Controller, + + initialize: + + function Glow (gameObject, color, outerStrength, innerStrength, knockout) + { + if (outerStrength === undefined) { outerStrength = 4; } + if (innerStrength === undefined) { innerStrength = 0; } + if (knockout === undefined) { knockout = false; } + + Controller.call(this, FX_CONST.GLOW, gameObject); + + /** + * The strength of the glow outward from the edge of the Sprite. + * + * @name Phaser.FX.Glow#outerStrength + * @type {number} + * @since 3.60.0 + */ + this.outerStrength = outerStrength; + + /** + * The strength of the glow inward from the edge of the Sprite. + * + * @name Phaser.FX.Glow#innerStrength + * @type {number} + * @since 3.60.0 + */ + this.innerStrength = innerStrength; + + /** + * If `true` only the glow is drawn, not the texture itself. + * + * @name Phaser.FX.Glow#knockout + * @type {number} + * @since 3.60.0 + */ + this.knockout = knockout; + + /** + * A 4 element array of gl color values. + * + * @name Phaser.FX.Glow#glcolor + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor = [ 1, 1, 1, 1 ]; + + if (color !== undefined) + { + this.color = color; + } + }, + + /** + * The color of the glow as a number value. + * + * @name Phaser.FX.Glow#color + * @type {number} + * @since 3.60.0 + */ + color: { + + get: function () + { + var color = this.glcolor; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + } + +}); + +module.exports = Glow; + + +/***/ }), + +/***/ 7724: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Gradient FX Controller. + * + * This FX controller manages the gradient effect for a Game Object. + * + * The gradient overlay effect is a visual technique where a smooth color transition is applied over Game Objects, + * such as sprites or UI components. This effect is used to enhance visual appeal, emphasize depth, or create + * stylistic and atmospheric variations. It can also be utilized to convey information, such as representing + * progress or health status through color changes. + * + * A Gradient effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addGradient(); + * sprite.postFX.addGradient(); + * ``` + * + * @class Gradient + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [color1=0xff0000] - The first gradient color, given as a number value. + * @param {number} [color2=0x00ff00] - The second gradient color, given as a number value. + * @param {number} [alpha=0.2] - The alpha value of the gradient effect. + * @param {number} [fromX=0] - The horizontal position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [fromY=0] - The vertical position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [toX=0] - The horizontal position the gradient will end at. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [toY=1] - The vertical position the gradient will end at. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [size=0] - How many 'chunks' the gradient is divided in to, as spread over the entire height of the texture. Leave this at zero for a smooth gradient, or set higher for a more retro chunky effect. + */ +var Gradient = new Class({ + + Extends: Controller, + + initialize: + + function Gradient (gameObject, color1, color2, alpha, fromX, fromY, toX, toY, size) + { + if (alpha === undefined) { alpha = 0.2; } + if (fromX === undefined) { fromX = 0; } + if (fromY === undefined) { fromY = 0; } + if (toX === undefined) { toX = 0; } + if (toY === undefined) { toY = 1; } + if (size === undefined) { size = 0; } + + Controller.call(this, FX_CONST.GRADIENT, gameObject); + + /** + * The alpha value of the gradient effect. + * + * @name Phaser.FX.Gradient#alpha + * @type {number} + * @since 3.60.0 + */ + this.alpha = alpha; + + /** + * Sets how many 'chunks' the gradient is divided in to, as spread over the + * entire height of the texture. Leave this at zero for a smooth gradient, + * or set to a higher number to split the gradient into that many sections, giving + * a more banded 'retro' effect. + * + * @name Phaser.FX.Gradient#size + * @type {number} + * @since 3.60.0 + */ + this.size = size; + + /** + * The horizontal position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * + * @name Phaser.FX.Gradient#fromX + * @type {number} + * @since 3.60.0 + */ + this.fromX = fromX; + + /** + * The vertical position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * + * @name Phaser.FX.Gradient#fromY + * @type {number} + * @since 3.60.0 + */ + this.fromY = fromY; + + /** + * The horizontal position the gradient will end. This value is noralized, between 0 and 1 and is not in pixels. + * + * @name Phaser.FX.Gradient#toX + * @type {number} + * @since 3.60.0 + */ + this.toX = toX; + + /** + * The vertical position the gradient will end. This value is noralized, between 0 and 1 and is not in pixels. + * + * @name Phaser.FX.Gradient#toY + * @type {number} + * @since 3.60.0 + */ + this.toY = toY; + + /** + * The internal gl color array for the starting color. + * + * @name Phaser.FX.Gradient#glcolor1 + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor1 = [ 255, 0, 0 ]; + + /** + * The internal gl color array for the ending color. + * + * @name Phaser.FX.Gradient#glcolor2 + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor2 = [ 0, 255, 0 ]; + + if (color1 !== undefined && color1 !== null) + { + this.color1 = color1; + } + + if (color2 !== undefined && color2 !== null) + { + this.color2 = color2; + } + }, + + /** + * The first gradient color, given as a number value. + * + * @name Phaser.FX.Gradient#color1 + * @type {number} + * @since 3.60.0 + */ + color1: { + + get: function () + { + var color = this.glcolor1; + + return (((color[0]) << 16) + ((color[1]) << 8) + (color[2] | 0)); + }, + + set: function (value) + { + var color = this.glcolor1; + + color[0] = ((value >> 16) & 0xFF); + color[1] = ((value >> 8) & 0xFF); + color[2] = (value & 0xFF); + } + + }, + + /** + * The second gradient color, given as a number value. + * + * @name Phaser.FX.Gradient#color2 + * @type {number} + * @since 3.60.0 + */ + color2: { + + get: function () + { + var color = this.glcolor2; + + return (((color[0]) << 16) + ((color[1]) << 8) + (color[2] | 0)); + }, + + set: function (value) + { + var color = this.glcolor2; + + color[0] = ((value >> 16) & 0xFF); + color[1] = ((value >> 8) & 0xFF); + color[2] = (value & 0xFF); + } + + } + +}); + +module.exports = Gradient; + + +/***/ }), + +/***/ 4412: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Pixelate FX Controller. + * + * This FX controller manages the pixelate effect for a Game Object. + * + * The pixelate effect is a visual technique that deliberately reduces the resolution or detail of an image, + * creating a blocky or mosaic appearance composed of large, visible pixels. This effect can be used for stylistic + * purposes, as a homage to retro gaming, or as a means to obscure certain elements within the game, such as + * during a transition or to censor specific content. + * + * A Pixelate effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addPixelate(); + * sprite.postFX.addPixelate(); + * ``` + * + * @class Pixelate + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [amount=1] - The amount of pixelation to apply. + */ +var Pixelate = new Class({ + + Extends: Controller, + + initialize: + + function Pixelate (gameObject, amount) + { + if (amount === undefined) { amount = 1; } + + Controller.call(this, FX_CONST.PIXELATE, gameObject); + + /** + * The amount of pixelation to apply. + * + * @name Phaser.FX.Pixelate#amount + * @type {number} + * @since 3.60.0 + */ + this.amount = amount; + } + +}); + +module.exports = Pixelate; + + +/***/ }), + +/***/ 75: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Shadow FX Controller. + * + * This FX controller manages the shadow effect for a Game Object. + * + * The shadow effect is a visual technique used to create the illusion of depth and realism by adding darker, + * offset silhouettes or shapes beneath game objects, characters, or environments. These simulated shadows + * help to enhance the visual appeal and immersion, making the 2D game world appear more dynamic and three-dimensional. + * + * A Shadow effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addShadow(); + * sprite.postFX.addShadow(); + * ``` + * + * @class Shadow + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [x=0] - The horizontal offset of the shadow effect. + * @param {number} [y=0] - The vertical offset of the shadow effect. + * @param {number} [decay=0.1] - The amount of decay for shadow effect. + * @param {number} [power=1] - The power of the shadow effect. + * @param {number} [color=0x000000] - The color of the shadow. + * @param {number} [samples=6] - The number of samples that the shadow effect will run for. An integer between 1 and 12. + * @param {number} [intensity=1] - The intensity of the shadow effect. + */ +var Shadow = new Class({ + + Extends: Controller, + + initialize: + + function Shadow (gameObject, x, y, decay, power, color, samples, intensity) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (decay === undefined) { decay = 0.1; } + if (power === undefined) { power = 1; } + if (samples === undefined) { samples = 6; } + if (intensity === undefined) { intensity = 1; } + + Controller.call(this, FX_CONST.SHADOW, gameObject); + + /** + * The horizontal offset of the shadow effect. + * + * @name Phaser.FX.Shadow#x + * @type {number} + * @since 3.60.0 + */ + this.x = x; + + /** + * The vertical offset of the shadow effect. + * + * @name Phaser.FX.Shadow#y + * @type {number} + * @since 3.60.0 + */ + this.y = y; + + /** + * The amount of decay for the shadow effect. + * + * @name Phaser.FX.Shadow#decay + * @type {number} + * @since 3.60.0 + */ + this.decay = decay; + + /** + * The power of the shadow effect. + * + * @name Phaser.FX.Shadow#power + * @type {number} + * @since 3.60.0 + */ + this.power = power; + + /** + * The internal gl color array. + * + * @name Phaser.FX.Shadow#glcolor + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor = [ 0, 0, 0, 1 ]; + + /** + * The number of samples that the shadow effect will run for. + * + * This should be an integer with a minimum value of 1 and a maximum of 12. + * + * @name Phaser.FX.Shadow#samples + * @type {number} + * @since 3.60.0 + */ + this.samples = samples; + + /** + * The intensity of the shadow effect. + * + * @name Phaser.FX.Shadow#intensity + * @type {number} + * @since 3.60.0 + */ + this.intensity = intensity; + + if (color !== undefined) + { + this.color = color; + } + }, + + /** + * The color of the shadow. + * + * @name Phaser.FX.Shadow#color + * @type {number} + * @since 3.60.0 + */ + color: { + + get: function () + { + var color = this.glcolor; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + } + +}); + +module.exports = Shadow; + + +/***/ }), + +/***/ 8734: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Shine FX Controller. + * + * This FX controller manages the shift effect for a Game Object. + * + * The shine effect is a visual technique that simulates the appearance of reflective + * or glossy surfaces by passing a light beam across a Game Object. This effect is used to + * enhance visual appeal, emphasize certain features, and create a sense of depth or + * material properties. + * + * A Shine effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addShine(); + * sprite.postFX.addShine(); + * ``` + * + * @class Shine + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [speed=0.5] - The speed of the Shine effect. + * @param {number} [lineWidth=0.5] - The line width of the Shine effect. + * @param {number} [gradient=3] - The gradient of the Shine effect. + * @param {boolean} [reveal=false] - Does this Shine effect reveal or get added to its target? + */ +var Shine = new Class({ + + Extends: Controller, + + initialize: + + function Shine (gameObject, speed, lineWidth, gradient, reveal) + { + if (speed === undefined) { speed = 0.5; } + if (lineWidth === undefined) { lineWidth = 0.5; } + if (gradient === undefined) { gradient = 3; } + if (reveal === undefined) { reveal = false; } + + Controller.call(this, FX_CONST.SHINE, gameObject); + + /** + * The speed of the Shine effect. + * + * @name Phaser.FX.Shine#speed + * @type {number} + * @since 3.60.0 + */ + this.speed = speed; + + /** + * The line width of the Shine effect. + * + * @name Phaser.FX.Shine#lineWidth + * @type {number} + * @since 3.60.0 + */ + this.lineWidth = lineWidth; + + /** + * The gradient of the Shine effect. + * + * @name Phaser.FX.Shine#gradient + * @type {number} + * @since 3.60.0 + */ + this.gradient = gradient; + + /** + * Does this Shine effect reveal or get added to its target? + * + * @name Phaser.FX.Shine#reveal + * @type {boolean} + * @since 3.60.0 + */ + this.reveal = reveal; + } + +}); + +module.exports = Shine; + + +/***/ }), + +/***/ 2437: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Vignette FX Controller. + * + * This FX controller manages the vignette effect for a Game Object. + * + * The vignette effect is a visual technique where the edges of the screen, or a Game Object, gradually darken or blur, + * creating a frame-like appearance. This effect is used to draw the player's focus towards the central action or subject, + * enhance immersion, and provide a cinematic or artistic quality to the game's visuals. + * + * A Vignette effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addVignette(); + * sprite.postFX.addVignette(); + * ``` + * + * @class Vignette + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [x=0.5] - The horizontal offset of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [y=0.5] - The vertical offset of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [radius=0.5] - The radius of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [strength=0.5] - The strength of the vignette effect. + */ +var Vignette = new Class({ + + Extends: Controller, + + initialize: + + function Vignette (gameObject, x, y, radius, strength) + { + if (x === undefined) { x = 0.5; } + if (y === undefined) { y = 0.5; } + if (radius === undefined) { radius = 0.5; } + if (strength === undefined) { strength = 0.5; } + + Controller.call(this, FX_CONST.VIGNETTE, gameObject); + + /** + * The horizontal offset of the vignette effect. This value is normalized to the range 0 to 1. + * + * @name Phaser.FX.Vignette#x + * @type {number} + * @since 3.60.0 + */ + this.x = x; + + /** + * The vertical offset of the vignette effect. This value is normalized to the range 0 to 1. + * + * @name Phaser.FX.Vignette#y + * @type {number} + * @since 3.60.0 + */ + this.y = y; + + /** + * The radius of the vignette effect. This value is normalized to the range 0 to 1. + * + * @name Phaser.FX.Vignette#radius + * @type {number} + * @since 3.60.0 + */ + this.radius = radius; + + /** + * The strength of the vignette effect. + * + * @name Phaser.FX.Vignette#strength + * @type {number} + * @since 3.60.0 + */ + this.strength = strength; + } + +}); + +module.exports = Vignette; + + +/***/ }), + +/***/ 5984: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Wipe FX Controller. + * + * This FX controller manages the wipe effect for a Game Object. + * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * + * A Wipe effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addWipe(); + * sprite.postFX.addWipe(); + * sprite.preFX.addReveal(); + * sprite.postFX.addReveal(); + * ``` + * + * @class Wipe + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [wipeWidth=0.1] - The width of the wipe effect. This value is normalized in the range 0 to 1. + * @param {number} [direction=0] - The direction of the wipe effect. Either 0 or 1. Set in conjunction with the axis property. + * @param {number} [axis=0] - The axis of the wipe effect. Either 0 or 1. Set in conjunction with the direction property. + * @param {boolean} [reveal=false] - Is this a reveal (true) or a fade (false) effect? + */ +var Wipe = new Class({ + + Extends: Controller, + + initialize: + + function Wipe (gameObject, wipeWidth, direction, axis, reveal) + { + if (wipeWidth === undefined) { wipeWidth = 0.1; } + if (direction === undefined) { direction = 0; } + if (axis === undefined) { axis = 0; } + if (reveal === undefined) { reveal = false; } + + Controller.call(this, FX_CONST.WIPE, gameObject); + + /** + * The progress of the Wipe effect. This value is normalized to the range 0 to 1. + * + * Adjust this value to make the wipe transition (i.e. via a Tween) + * + * @name Phaser.FX.Wipe#progress + * @type {number} + * @since 3.60.0 + */ + this.progress = 0; + + /** + * The width of the wipe effect. This value is normalized in the range 0 to 1. + * + * @name Phaser.FX.Wipe#wipeWidth + * @type {number} + * @since 3.60.0 + */ + this.wipeWidth = wipeWidth; + + /** + * The direction of the wipe effect. Either 0 or 1. Set in conjunction with the axis property. + * + * @name Phaser.FX.Wipe#direction + * @type {number} + * @since 3.60.0 + */ + this.direction = direction; + + /** + * The axis of the wipe effect. Either 0 or 1. Set in conjunction with the direction property. + * + * @name Phaser.FX.Wipe#axis + * @type {number} + * @since 3.60.0 + */ + this.axis = axis; + + /** + * Is this a reveal (true) or a fade (false) effect? + * + * @name Phaser.FX.Wipe#reveal + * @type {boolean} + * @since 3.60.0 + */ + this.reveal = reveal; + } + +}); + +module.exports = Wipe; + + +/***/ }), + +/***/ 1571: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FX_CONST = { + + /** + * The Glow FX. + * + * @name Phaser.FX.GLOW + * @type {number} + * @const + * @since 3.60.0 + */ + GLOW: 4, + + /** + * The Shadow FX. + * + * @name Phaser.FX.SHADOW + * @type {number} + * @const + * @since 3.60.0 + */ + SHADOW: 5, + + /** + * The Pixelate FX. + * + * @name Phaser.FX.PIXELATE + * @type {number} + * @const + * @since 3.60.0 + */ + PIXELATE: 6, + + /** + * The Vignette FX. + * + * @name Phaser.FX.VIGNETTE + * @type {number} + * @const + * @since 3.60.0 + */ + VIGNETTE: 7, + + /** + * The Shine FX. + * + * @name Phaser.FX.SHINE + * @type {number} + * @const + * @since 3.60.0 + */ + SHINE: 8, + + /** + * The Blur FX. + * + * @name Phaser.FX.BLUR + * @type {number} + * @const + * @since 3.60.0 + */ + BLUR: 9, // uses 3 shaders, slots 9, 10 and 11 + + /** + * The Gradient FX. + * + * @name Phaser.FX.GRADIENT + * @type {number} + * @const + * @since 3.60.0 + */ + GRADIENT: 12, + + /** + * The Bloom FX. + * + * @name Phaser.FX.BLOOM + * @type {number} + * @const + * @since 3.60.0 + */ + BLOOM: 13, + + /** + * The Color Matrix FX. + * + * @name Phaser.FX.COLOR_MATRIX + * @type {number} + * @const + * @since 3.60.0 + */ + COLOR_MATRIX: 14, + + /** + * The Circle FX. + * + * @name Phaser.FX.CIRCLE + * @type {number} + * @const + * @since 3.60.0 + */ + CIRCLE: 15, + + /** + * The Barrel FX. + * + * @name Phaser.FX.BARREL + * @type {number} + * @const + * @since 3.60.0 + */ + BARREL: 16, + + /** + * The Displacement FX. + * + * @name Phaser.FX.DISPLACEMENT + * @type {number} + * @const + * @since 3.60.0 + */ + DISPLACEMENT: 17, + + /** + * The Wipe FX. + * + * @name Phaser.FX.WIPE + * @type {number} + * @const + * @since 3.60.0 + */ + WIPE: 18, + + /** + * The Bokeh and Tilt Shift FX. + * + * @name Phaser.FX.BOKEH + * @type {number} + * @const + * @since 3.60.0 + */ + BOKEH: 19 + +}; + +module.exports = FX_CONST; + + +/***/ }), + +/***/ 7347: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(1030); +var FX_CONST = __webpack_require__(1571); + +/** + * @namespace Phaser.FX + */ + +var FX = { + + Barrel: __webpack_require__(7340), + Controller: __webpack_require__(6128), + Bloom: __webpack_require__(5170), + Blur: __webpack_require__(4199), + Bokeh: __webpack_require__(3132), + Circle: __webpack_require__(6610), + ColorMatrix: __webpack_require__(4931), + Displacement: __webpack_require__(9195), + Glow: __webpack_require__(445), + Gradient: __webpack_require__(7724), + Pixelate: __webpack_require__(4412), + Shadow: __webpack_require__(75), + Shine: __webpack_require__(8734), + Vignette: __webpack_require__(2437), + Wipe: __webpack_require__(5984) + +}; + +FX = Extend(false, FX, FX_CONST); + +module.exports = FX; + + +/***/ }), + +/***/ 2494: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(8351); +var GetAdvancedValue = __webpack_require__(8361); + +/** + * Builds a Game Object using the provided configuration object. + * + * @function Phaser.GameObjects.BuildGameObject + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene. + * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject. + * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with. + * + * @return {Phaser.GameObjects.GameObject} The built Game Object. + */ +var BuildGameObject = function (scene, gameObject, config) +{ + // Position + + gameObject.x = GetAdvancedValue(config, 'x', 0); + gameObject.y = GetAdvancedValue(config, 'y', 0); + gameObject.depth = GetAdvancedValue(config, 'depth', 0); + + // Flip + + gameObject.flipX = GetAdvancedValue(config, 'flipX', false); + gameObject.flipY = GetAdvancedValue(config, 'flipY', false); + + // Scale + // Either: { scale: 2 } or { scale: { x: 2, y: 2 }} + + var scale = GetAdvancedValue(config, 'scale', null); + + if (typeof scale === 'number') + { + gameObject.setScale(scale); + } + else if (scale !== null) + { + gameObject.scaleX = GetAdvancedValue(scale, 'x', 1); + gameObject.scaleY = GetAdvancedValue(scale, 'y', 1); + } + + // ScrollFactor + // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }} + + var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null); + + if (typeof scrollFactor === 'number') + { + gameObject.setScrollFactor(scrollFactor); + } + else if (scrollFactor !== null) + { + gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1); + gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1); + } + + // Rotation + + gameObject.rotation = GetAdvancedValue(config, 'rotation', 0); + + var angle = GetAdvancedValue(config, 'angle', null); + + if (angle !== null) + { + gameObject.angle = angle; + } + + // Alpha + + gameObject.alpha = GetAdvancedValue(config, 'alpha', 1); + + // Origin + // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }} + + var origin = GetAdvancedValue(config, 'origin', null); + + if (typeof origin === 'number') + { + gameObject.setOrigin(origin); + } + else if (origin !== null) + { + var ox = GetAdvancedValue(origin, 'x', 0.5); + var oy = GetAdvancedValue(origin, 'y', 0.5); + + gameObject.setOrigin(ox, oy); + } + + // BlendMode + + gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL); + + // Visible + + gameObject.visible = GetAdvancedValue(config, 'visible', true); + + // Add to Scene + + var add = GetAdvancedValue(config, 'add', true); + + if (add) + { + scene.sys.displayList.add(gameObject); + } + + if (gameObject.preUpdate) + { + scene.sys.updateList.add(gameObject); + } + + return gameObject; +}; + +module.exports = BuildGameObject; + + +/***/ }), + +/***/ 2273: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var ComponentsToJSON = __webpack_require__(6125); +var DataManager = __webpack_require__(1081); +var EventEmitter = __webpack_require__(4399); +var Events = __webpack_require__(3389); +var SceneEvents = __webpack_require__(204); + +/** + * @classdesc + * The base class that all Game Objects extend. + * You don't create GameObjects directly and they cannot be added to the display list. + * Instead, use them as the base for your own custom classes. + * + * @class GameObject + * @memberof Phaser.GameObjects + * @extends Phaser.Events.EventEmitter + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. + * @param {string} type - A textual representation of the type of Game Object, i.e. `sprite`. + */ +var GameObject = new Class({ + + Extends: EventEmitter, + + initialize: + + function GameObject (scene, type) + { + EventEmitter.call(this); + + /** + * A reference to the Scene to which this Game Object belongs. + * + * Game Objects can only belong to one Scene. + * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. + * + * @name Phaser.GameObjects.GameObject#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * Holds a reference to the Display List that contains this Game Object. + * + * This is set automatically when this Game Object is added to a Scene or Layer. + * + * You should treat this property as being read-only. + * + * @name Phaser.GameObjects.GameObject#displayList + * @type {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} + * @default null + * @since 3.50.0 + */ + this.displayList = null; + + /** + * A textual representation of this Game Object, i.e. `sprite`. + * Used internally by Phaser but is available for your own custom classes to populate. + * + * @name Phaser.GameObjects.GameObject#type + * @type {string} + * @since 3.0.0 + */ + this.type = type; + + /** + * The current state of this Game Object. + * + * Phaser itself will never modify this value, although plugins may do so. + * + * Use this property to track the state of a Game Object during its lifetime. For example, it could change from + * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant + * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * + * @name Phaser.GameObjects.GameObject#state + * @type {(number|string)} + * @since 3.16.0 + */ + this.state = 0; + + /** + * The parent Container of this Game Object, if it has one. + * + * @name Phaser.GameObjects.GameObject#parentContainer + * @type {Phaser.GameObjects.Container} + * @since 3.4.0 + */ + this.parentContainer = null; + + /** + * The name of this Game Object. + * Empty by default and never populated by Phaser, this is left for developers to use. + * + * @name Phaser.GameObjects.GameObject#name + * @type {string} + * @default '' + * @since 3.0.0 + */ + this.name = ''; + + /** + * The active state of this Game Object. + * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. + * An active object is one which is having its logic and internal systems updated. + * + * @name Phaser.GameObjects.GameObject#active + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.active = true; + + /** + * The Tab Index of the Game Object. + * Reserved for future use by plugins and the Input Manager. + * + * @name Phaser.GameObjects.GameObject#tabIndex + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.tabIndex = -1; + + /** + * A Data Manager. + * It allows you to store, query and get key/value paired information specific to this Game Object. + * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. + * + * @name Phaser.GameObjects.GameObject#data + * @type {Phaser.Data.DataManager} + * @default null + * @since 3.0.0 + */ + this.data = null; + + /** + * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. + * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. + * If those components are not used by your custom class then you can use this bitmask as you wish. + * + * @name Phaser.GameObjects.GameObject#renderFlags + * @type {number} + * @default 15 + * @since 3.0.0 + */ + this.renderFlags = 15; + + /** + * A bitmask that controls if this Game Object is drawn by a Camera or not. + * Not usually set directly, instead call `Camera.ignore`, however you can + * set this property directly using the Camera.id property: + * + * @example + * this.cameraFilter |= camera.id + * + * @name Phaser.GameObjects.GameObject#cameraFilter + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.cameraFilter = 0; + + /** + * If this Game Object is enabled for input then this property will contain an InteractiveObject instance. + * Not usually set directly. Instead call `GameObject.setInteractive()`. + * + * @name Phaser.GameObjects.GameObject#input + * @type {?Phaser.Types.Input.InteractiveObject} + * @default null + * @since 3.0.0 + */ + this.input = null; + + /** + * If this Game Object is enabled for Arcade or Matter Physics then this property will contain a reference to a Physics Body. + * + * @name Phaser.GameObjects.GameObject#body + * @type {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|MatterJS.BodyType)} + * @default null + * @since 3.0.0 + */ + this.body = null; + + /** + * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`. + * This includes calls that may come from a Group, Container or the Scene itself. + * While it allows you to persist a Game Object across Scenes, please understand you are entirely + * responsible for managing references to and from this Game Object. + * + * @name Phaser.GameObjects.GameObject#ignoreDestroy + * @type {boolean} + * @default false + * @since 3.5.0 + */ + this.ignoreDestroy = false; + + this.on(Events.ADDED_TO_SCENE, this.addedToScene, this); + this.on(Events.REMOVED_FROM_SCENE, this.removedFromScene, this); + + // Tell the Scene to re-sort the children + scene.sys.queueDepthSort(); + }, + + /** + * Sets the `active` property of this Game Object and returns this Game Object for further chaining. + * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList. + * + * @method Phaser.GameObjects.GameObject#setActive + * @since 3.0.0 + * + * @param {boolean} value - True if this Game Object should be set as active, false if not. + * + * @return {this} This GameObject. + */ + setActive: function (value) + { + this.active = value; + + return this; + }, + + /** + * Sets the `name` property of this Game Object and returns this Game Object for further chaining. + * The `name` property is not populated by Phaser and is presented for your own use. + * + * @method Phaser.GameObjects.GameObject#setName + * @since 3.0.0 + * + * @param {string} value - The name to be given to this Game Object. + * + * @return {this} This GameObject. + */ + setName: function (value) + { + this.name = value; + + return this; + }, + + /** + * Sets the current state of this Game Object. + * + * Phaser itself will never modify the State of a Game Object, although plugins may do so. + * + * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. + * The state value should typically be an integer (ideally mapped to a constant + * in your game code), but could also be a string. It is recommended to keep it light and simple. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * + * @method Phaser.GameObjects.GameObject#setState + * @since 3.16.0 + * + * @param {(number|string)} value - The state of the Game Object. + * + * @return {this} This GameObject. + */ + setState: function (value) + { + this.state = value; + + return this; + }, + + /** + * Adds a Data Manager component to this Game Object. + * + * @method Phaser.GameObjects.GameObject#setDataEnabled + * @since 3.0.0 + * @see Phaser.Data.DataManager + * + * @return {this} This GameObject. + */ + setDataEnabled: function () + { + if (!this.data) + { + this.data = new DataManager(this); + } + + return this; + }, + + /** + * Allows you to store a key value pair within this Game Objects Data Manager. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * sprite.setData('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `getData`: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * sprite.data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * + * @method Phaser.GameObjects.GameObject#setData + * @since 3.0.0 + * + * @generic {any} T + * @genericUse {(string|T)} - [key] + * + * @param {(string|object)} key - The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. + * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored. + * + * @return {this} This GameObject. + */ + setData: function (key, value) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.set(key, value); + + return this; + }, + + /** + * Increase a value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is increased from 0. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * @method Phaser.GameObjects.GameObject#incData + * @since 3.23.0 + * + * @generic {any} T + * @genericUse {(string|T)} - [key] + * + * @param {(string|object)} key - The key to increase the value for. + * @param {*} [data] - The value to increase for the given key. + * + * @return {this} This GameObject. + */ + incData: function (key, value) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.inc(key, value); + + return this; + }, + + /** + * Toggle a boolean value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is toggled from false. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * @method Phaser.GameObjects.GameObject#toggleData + * @since 3.23.0 + * + * @generic {any} T + * @genericUse {(string|T)} - [key] + * + * @param {(string|object)} key - The key to toggle the value for. + * + * @return {this} This GameObject. + */ + toggleData: function (key) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.toggle(key); + + return this; + }, + + /** + * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * sprite.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * sprite.getData([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.GameObjects.GameObject#getData + * @since 3.0.0 + * + * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys. + * + * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array. + */ + getData: function (key) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + return this.data.get(key); + }, + + /** + * Pass this Game Object to the Input Manager to enable it for Input. + * + * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area + * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced + * input detection. + * + * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If + * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific + * shape for it to use. + * + * You can also provide an Input Configuration Object as the only argument to this method. + * + * @example + * sprite.setInteractive(); + * + * @example + * sprite.setInteractive(new Phaser.Geom.Circle(45, 46, 45), Phaser.Geom.Circle.Contains); + * + * @example + * graphics.setInteractive(new Phaser.Geom.Rectangle(0, 0, 128, 128), Phaser.Geom.Rectangle.Contains); + * + * @method Phaser.GameObjects.GameObject#setInteractive + * @since 3.0.0 + * + * @param {(Phaser.Types.Input.InputConfiguration|any)} [hitArea] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not given it will try to create a Rectangle based on the texture frame. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The callback that determines if the pointer is within the Hit Area shape or not. If you provide a shape you must also provide a callback. + * @param {boolean} [dropZone=false] - Should this Game Object be treated as a drop zone target? + * + * @return {this} This GameObject. + */ + setInteractive: function (hitArea, hitAreaCallback, dropZone) + { + this.scene.sys.input.enable(this, hitArea, hitAreaCallback, dropZone); + + return this; + }, + + /** + * If this Game Object has previously been enabled for input, this will disable it. + * + * An object that is disabled for input stops processing or being considered for + * input events, but can be turned back on again at any time by simply calling + * `setInteractive()` with no arguments provided. + * + * If want to completely remove interaction from this Game Object then use `removeInteractive` instead. + * + * @method Phaser.GameObjects.GameObject#disableInteractive + * @since 3.7.0 + * + * @return {this} This GameObject. + */ + disableInteractive: function () + { + this.scene.sys.input.disable(this); + + return this; + }, + + /** + * If this Game Object has previously been enabled for input, this will queue it + * for removal, causing it to no longer be interactive. The removal happens on + * the next game step, it is not immediate. + * + * The Interactive Object that was assigned to this Game Object will be destroyed, + * removed from the Input Manager and cleared from this Game Object. + * + * If you wish to re-enable this Game Object at a later date you will need to + * re-create its InteractiveObject by calling `setInteractive` again. + * + * If you wish to only temporarily stop an object from receiving input then use + * `disableInteractive` instead, as that toggles the interactive state, where-as + * this erases it completely. + * + * If you wish to resize a hit area, don't remove and then set it as being + * interactive. Instead, access the hitarea object directly and resize the shape + * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the + * shape is a Rectangle, which it is by default.) + * + * @method Phaser.GameObjects.GameObject#removeInteractive + * @since 3.7.0 + * + * @return {this} This GameObject. + */ + removeInteractive: function () + { + this.scene.sys.input.clear(this); + + this.input = undefined; + + return this; + }, + + /** + * This callback is invoked when this Game Object is added to a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to add themselves into the Update List. + * + * You can also listen for the `ADDED_TO_SCENE` event from this Game Object. + * + * @method Phaser.GameObjects.GameObject#addedToScene + * @since 3.50.0 + */ + addedToScene: function () + { + }, + + /** + * This callback is invoked when this Game Object is removed from a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to removed themselves from the Update List. + * + * You can also listen for the `REMOVED_FROM_SCENE` event from this Game Object. + * + * @method Phaser.GameObjects.GameObject#removedFromScene + * @since 3.50.0 + */ + removedFromScene: function () + { + }, + + /** + * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. + * + * @method Phaser.GameObjects.GameObject#update + * @since 3.0.0 + * + * @param {...*} [args] - args + */ + update: function () + { + }, + + /** + * Returns a JSON representation of the Game Object. + * + * @method Phaser.GameObjects.GameObject#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ + toJSON: function () + { + return ComponentsToJSON(this); + }, + + /** + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * Also checks the Game Object against the given Cameras exclusion list. + * + * @method Phaser.GameObjects.GameObject#willRender + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object. + * + * @return {boolean} True if the Game Object should be rendered, otherwise false. + */ + willRender: function (camera) + { + var listWillRender = (this.displayList && this.displayList.active) ? this.displayList.willRender(camera) : true; + + return !(!listWillRender || GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); + }, + + /** + * Returns an array containing the display list index of either this Game Object, or if it has one, + * its parent Container. It then iterates up through all of the parent containers until it hits the + * root of the display list (which is index 0 in the returned array). + * + * Used internally by the InputPlugin but also useful if you wish to find out the display depth of + * this Game Object and all of its ancestors. + * + * @method Phaser.GameObjects.GameObject#getIndexList + * @since 3.4.0 + * + * @return {number[]} An array of display list position indexes. + */ + getIndexList: function () + { + // eslint-disable-next-line consistent-this + var child = this; + var parent = this.parentContainer; + + var indexes = []; + + while (parent) + { + indexes.unshift(parent.getIndex(child)); + + child = parent; + + if (!parent.parentContainer) + { + break; + } + else + { + parent = parent.parentContainer; + } + } + + if (this.displayList) + { + indexes.unshift(this.displayList.getIndex(child)); + } + else + { + indexes.unshift(this.scene.sys.displayList.getIndex(child)); + } + + return indexes; + }, + + /** + * Adds this Game Object to the given Display List. + * + * If no Display List is specified, it will default to the Display List owned by the Scene to which + * this Game Object belongs. + * + * A Game Object can only exist on one Display List at any given time, but may move freely between them. + * + * If this Game Object is already on another Display List when this method is called, it will first + * be removed from it, before being added to the new list. + * + * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. + * + * If a Game Object isn't on any display list, it will not be rendered. If you just wish to temporarly + * disable it from rendering, consider using the `setVisible` method, instead. + * + * @method Phaser.GameObjects.GameObject#addToDisplayList + * @fires Phaser.Scenes.Events#ADDED_TO_SCENE + * @fires Phaser.GameObjects.Events#ADDED_TO_SCENE + * @since 3.53.0 + * + * @param {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} [displayList] - The Display List to add to. Defaults to the Scene Display List. + * + * @return {this} This Game Object. + */ + addToDisplayList: function (displayList) + { + if (displayList === undefined) { displayList = this.scene.sys.displayList; } + + if (this.displayList && this.displayList !== displayList) + { + this.removeFromDisplayList(); + } + + // Don't repeat if it's already on this list + if (!displayList.exists(this)) + { + this.displayList = displayList; + + displayList.add(this, true); + + displayList.queueDepthSort(); + + this.emit(Events.ADDED_TO_SCENE, this, this.scene); + + displayList.events.emit(SceneEvents.ADDED_TO_SCENE, this, this.scene); + } + + return this; + }, + + /** + * Adds this Game Object to the Update List belonging to the Scene. + * + * When a Game Object is added to the Update List it will have its `preUpdate` method called + * every game frame. This method is passed two parameters: `delta` and `time`. + * + * If you wish to run your own logic within `preUpdate` then you should always call + * `super.preUpdate(delta, time)` within it, or it may fail to process required operations, + * such as Sprite animations. + * + * @method Phaser.GameObjects.GameObject#addToUpdateList + * @since 3.53.0 + * + * @return {this} This Game Object. + */ + addToUpdateList: function () + { + if (this.scene && this.preUpdate) + { + this.scene.sys.updateList.add(this); + } + + return this; + }, + + /** + * Removes this Game Object from the Display List it is currently on. + * + * A Game Object can only exist on one Display List at any given time, but may move freely removed + * and added back at a later stage. + * + * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. + * + * If a Game Object isn't on any Display List, it will not be rendered. If you just wish to temporarly + * disable it from rendering, consider using the `setVisible` method, instead. + * + * @method Phaser.GameObjects.GameObject#removeFromDisplayList + * @fires Phaser.Scenes.Events#REMOVED_FROM_SCENE + * @fires Phaser.GameObjects.Events#REMOVED_FROM_SCENE + * @since 3.53.0 + * + * @return {this} This Game Object. + */ + removeFromDisplayList: function () + { + var displayList = this.displayList || this.scene.sys.displayList; + + if (displayList && displayList.exists(this)) + { + displayList.remove(this, true); + + displayList.queueDepthSort(); + + this.displayList = null; + + this.emit(Events.REMOVED_FROM_SCENE, this, this.scene); + + displayList.events.emit(SceneEvents.REMOVED_FROM_SCENE, this, this.scene); + } + + return this; + }, + + /** + * Removes this Game Object from the Scene's Update List. + * + * When a Game Object is on the Update List, it will have its `preUpdate` method called + * every game frame. Calling this method will remove it from the list, preventing this. + * + * Removing a Game Object from the Update List will stop most internal functions working. + * For example, removing a Sprite from the Update List will prevent it from being able to + * run animations. + * + * @method Phaser.GameObjects.GameObject#removeFromUpdateList + * @since 3.53.0 + * + * @return {this} This Game Object. + */ + removeFromUpdateList: function () + { + if (this.scene && this.preUpdate) + { + this.scene.sys.updateList.remove(this); + } + + return this; + }, + + /** + * Destroys this Game Object removing it from the Display List and Update List and + * severing all ties to parent resources. + * + * Also removes itself from the Input Manager and Physics Manager if previously enabled. + * + * Use this to remove a Game Object from your game if you don't ever plan to use it again. + * As long as no reference to it exists within your own code it should become free for + * garbage collection by the browser. + * + * If you just want to temporarily disable an object then look at using the + * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. + * + * @method Phaser.GameObjects.GameObject#destroy + * @fires Phaser.GameObjects.Events#DESTROY + * @since 3.0.0 + * + * @param {boolean} [fromScene=false] - `True` if this Game Object is being destroyed by the Scene, `false` if not. + */ + destroy: function (fromScene) + { + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) + { + return; + } + + if (fromScene === undefined) { fromScene = false; } + + if (this.preDestroy) + { + this.preDestroy.call(this); + } + + this.emit(Events.DESTROY, this, fromScene); + + this.removeAllListeners(); + + if (this.postPipelines) + { + this.resetPostPipeline(true); + } + + this.removeFromDisplayList(); + this.removeFromUpdateList(); + + if (this.input) + { + this.scene.sys.input.clear(this); + + this.input = undefined; + } + + if (this.data) + { + this.data.destroy(); + + this.data = undefined; + } + + if (this.body) + { + this.body.destroy(); + + this.body = undefined; + } + + if (this.preFX) + { + this.preFX.destroy(); + + this.preFX = undefined; + } + + if (this.postFX) + { + this.postFX.destroy(); + + this.postFX = undefined; + } + + this.active = false; + this.visible = false; + + this.scene = undefined; + this.parentContainer = undefined; + } + +}); + +/** + * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. + * + * @constant {number} RENDER_MASK + * @memberof Phaser.GameObjects.GameObject + * @default + */ +GameObject.RENDER_MASK = 15; + +module.exports = GameObject; + + +/***/ }), + +/***/ 3649: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var PluginCache = __webpack_require__(8456); +var SceneEvents = __webpack_require__(204); + +/** + * @classdesc + * The Game Object Factory is a Scene plugin that allows you to quickly create many common + * types of Game Objects and have them automatically registered with the Scene. + * + * Game Objects directly register themselves with the Factory and inject their own creation + * methods into the class. + * + * @class GameObjectFactory + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object Factory belongs. + */ +var GameObjectFactory = new Class({ + + initialize: + + function GameObjectFactory (scene) + { + /** + * The Scene to which this Game Object Factory belongs. + * + * @name Phaser.GameObjects.GameObjectFactory#scene + * @type {Phaser.Scene} + * @protected + * @since 3.0.0 + */ + this.scene = scene; + + /** + * A reference to the Scene.Systems. + * + * @name Phaser.GameObjects.GameObjectFactory#systems + * @type {Phaser.Scenes.Systems} + * @protected + * @since 3.0.0 + */ + this.systems = scene.sys; + + /** + * A reference to the Scene Event Emitter. + * + * @name Phaser.GameObjects.GameObjectFactory#events + * @type {Phaser.Events.EventEmitter} + * @protected + * @since 3.50.0 + */ + this.events = scene.sys.events; + + /** + * A reference to the Scene Display List. + * + * @name Phaser.GameObjects.GameObjectFactory#displayList + * @type {Phaser.GameObjects.DisplayList} + * @protected + * @since 3.0.0 + */ + this.displayList; + + /** + * A reference to the Scene Update List. + * + * @name Phaser.GameObjects.GameObjectFactory#updateList + * @type {Phaser.GameObjects.UpdateList} + * @protected + * @since 3.0.0 + */ + this.updateList; + + this.events.once(SceneEvents.BOOT, this.boot, this); + this.events.on(SceneEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.GameObjects.GameObjectFactory#boot + * @private + * @since 3.5.1 + */ + boot: function () + { + this.displayList = this.systems.displayList; + this.updateList = this.systems.updateList; + + this.events.once(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.GameObjects.GameObjectFactory#start + * @private + * @since 3.5.0 + */ + start: function () + { + this.events.once(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * Adds an existing Game Object to this Scene. + * + * If the Game Object renders, it will be added to the Display List. + * If it has a `preUpdate` method, it will be added to the Update List. + * + * @method Phaser.GameObjects.GameObjectFactory#existing + * @since 3.0.0 + * + * @generic {(Phaser.GameObjects.GameObject|Phaser.GameObjects.Group|Phaser.GameObjects.Layer)} G - [child,$return] + * + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.Group|Phaser.GameObjects.Layer)} child - The child to be added to this Scene. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was added. + */ + existing: function (child) + { + if (child.renderCanvas || child.renderWebGL) + { + this.displayList.add(child); + } + + // For when custom objects have overridden `preUpdate` but don't hook into the ADDED_TO_SCENE event: + // Adding to the list multiple times is safe, as it won't add duplicates into the list anyway. + if (child.preUpdate) + { + this.updateList.add(child); + } + + return child; + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.GameObjects.GameObjectFactory#shutdown + * @private + * @since 3.0.0 + */ + shutdown: function () + { + this.events.off(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.GameObjects.GameObjectFactory#destroy + * @private + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.events.off(SceneEvents.START, this.start, this); + + this.scene = null; + this.systems = null; + this.events = null; + + this.displayList = null; + this.updateList = null; + } + +}); + +/** + * Static method called directly by the Game Object factory functions. + * With this method you can register a custom GameObject factory in the GameObjectFactory, + * providing a name (`factoryType`) and the constructor (`factoryFunction`) in order + * to be called when you call to Phaser.Scene.add[ factoryType ] method. + * + * @method Phaser.GameObjects.GameObjectFactory.register + * @static + * @since 3.0.0 + * + * @param {string} factoryType - The key of the factory that you will use to call to Phaser.Scene.add[ factoryType ] method. + * @param {function} factoryFunction - The constructor function to be called when you invoke to the Phaser.Scene.add method. + */ +GameObjectFactory.register = function (factoryType, factoryFunction) +{ + if (!GameObjectFactory.prototype.hasOwnProperty(factoryType)) + { + GameObjectFactory.prototype[factoryType] = factoryFunction; + } +}; + +/** + * Static method called directly by the Game Object factory functions. + * With this method you can remove a custom GameObject factory registered in the GameObjectFactory, + * providing a its `factoryType`. + * + * @method Phaser.GameObjects.GameObjectFactory.remove + * @static + * @since 3.0.0 + * + * @param {string} factoryType - The key of the factory that you want to remove from the GameObjectFactory. + */ +GameObjectFactory.remove = function (factoryType) +{ + if (GameObjectFactory.prototype.hasOwnProperty(factoryType)) + { + delete GameObjectFactory.prototype[factoryType]; + } +}; + +PluginCache.register('GameObjectFactory', GameObjectFactory, 'add'); + +module.exports = GameObjectFactory; + + +/***/ }), + +/***/ 4344: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(2915); + +// bitmask flag for GameObject.renderMask +var _FLAG = 2; // 0010 + +/** + * Provides methods used for setting the alpha properties of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Alpha + * @since 3.0.0 + */ + +var Alpha = { + + /** + * Private internal value. Holds the global alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alpha + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alpha: 1, + + /** + * Private internal value. Holds the top-left alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaTL + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaTL: 1, + + /** + * Private internal value. Holds the top-right alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaTR + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaTR: 1, + + /** + * Private internal value. Holds the bottom-left alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaBL + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaBL: 1, + + /** + * Private internal value. Holds the bottom-right alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaBR + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaBR: 1, + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + * + * @method Phaser.GameObjects.Components.Alpha#clearAlpha + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + clearAlpha: function () + { + return this.setAlpha(1); + }, + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * + * @method Phaser.GameObjects.Components.Alpha#setAlpha + * @since 3.0.0 + * + * @param {number} [topLeft=1] - The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. + * @param {number} [topRight] - The alpha value used for the top-right of the Game Object. WebGL only. + * @param {number} [bottomLeft] - The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param {number} [bottomRight] - The alpha value used for the bottom-right of the Game Object. WebGL only. + * + * @return {this} This Game Object instance. + */ + setAlpha: function (topLeft, topRight, bottomLeft, bottomRight) + { + if (topLeft === undefined) { topLeft = 1; } + + // Treat as if there is only one alpha value for the whole Game Object + if (topRight === undefined) + { + this.alpha = topLeft; + } + else + { + this._alphaTL = Clamp(topLeft, 0, 1); + this._alphaTR = Clamp(topRight, 0, 1); + this._alphaBL = Clamp(bottomLeft, 0, 1); + this._alphaBR = Clamp(bottomRight, 0, 1); + } + + return this; + }, + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + * + * @name Phaser.GameObjects.Components.Alpha#alpha + * @type {number} + * @since 3.0.0 + */ + alpha: { + + get: function () + { + return this._alpha; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alpha = v; + this._alphaTL = v; + this._alphaTR = v; + this._alphaBL = v; + this._alphaBR = v; + + if (v === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaTopLeft + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaTopLeft: { + + get: function () + { + return this._alphaTL; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaTL = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaTopRight + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaTopRight: { + + get: function () + { + return this._alphaTR; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaTR = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaBottomLeft + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaBottomLeft: { + + get: function () + { + return this._alphaBL; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaBL = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaBottomRight + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaBottomRight: { + + get: function () + { + return this._alphaBR; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaBR = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + } + +}; + +module.exports = Alpha; + + +/***/ }), + +/***/ 4518: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(2915); + +// bitmask flag for GameObject.renderMask +var _FLAG = 2; // 0010 + +/** + * Provides methods used for setting the alpha property of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.AlphaSingle + * @since 3.22.0 + */ + +var AlphaSingle = { + + /** + * Private internal value. Holds the global alpha value. + * + * @name Phaser.GameObjects.Components.AlphaSingle#_alpha + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alpha: 1, + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + * + * @method Phaser.GameObjects.Components.AlphaSingle#clearAlpha + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + clearAlpha: function () + { + return this.setAlpha(1); + }, + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * @method Phaser.GameObjects.Components.AlphaSingle#setAlpha + * @since 3.0.0 + * + * @param {number} [value=1] - The alpha value applied across the whole Game Object. + * + * @return {this} This Game Object instance. + */ + setAlpha: function (value) + { + if (value === undefined) { value = 1; } + + this.alpha = value; + + return this; + }, + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + * + * @name Phaser.GameObjects.Components.AlphaSingle#alpha + * @type {number} + * @since 3.0.0 + */ + alpha: { + + get: function () + { + return this._alpha; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alpha = v; + + if (v === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + } + +}; + +module.exports = AlphaSingle; + + +/***/ }), + +/***/ 5173: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(8351); + +/** + * Provides methods used for setting the blend mode of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.BlendMode + * @since 3.0.0 + */ + +var BlendMode = { + + /** + * Private internal value. Holds the current blend mode. + * + * @name Phaser.GameObjects.Components.BlendMode#_blendMode + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + _blendMode: BlendModes.NORMAL, + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * NORMAL + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + * + * @name Phaser.GameObjects.Components.BlendMode#blendMode + * @type {(Phaser.BlendModes|string|number)} + * @since 3.0.0 + */ + blendMode: { + + get: function () + { + return this._blendMode; + }, + + set: function (value) + { + if (typeof value === 'string') + { + value = BlendModes[value]; + } + + value |= 0; + + if (value >= -1) + { + this._blendMode = value; + } + } + + }, + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * NORMAL + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * + * @method Phaser.GameObjects.Components.BlendMode#setBlendMode + * @since 3.0.0 + * + * @param {(string|Phaser.BlendModes|number)} value - The BlendMode value. Either a string, a CONST or a number. + * + * @return {this} This Game Object instance. + */ + setBlendMode: function (value) + { + this.blendMode = value; + + return this; + } + +}; + +module.exports = BlendMode; + + +/***/ }), + +/***/ 1991: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for calculating and setting the size of a non-Frame based Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.ComputedSize + * @since 3.0.0 + */ + +var ComputedSize = { + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + * + * @name Phaser.GameObjects.Components.ComputedSize#width + * @type {number} + * @since 3.0.0 + */ + width: 0, + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + * + * @name Phaser.GameObjects.Components.ComputedSize#height + * @type {number} + * @since 3.0.0 + */ + height: 0, + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.ComputedSize#displayWidth + * @type {number} + * @since 3.0.0 + */ + displayWidth: { + + get: function () + { + return this.scaleX * this.width; + }, + + set: function (value) + { + this.scaleX = value / this.width; + } + + }, + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.ComputedSize#displayHeight + * @type {number} + * @since 3.0.0 + */ + displayHeight: { + + get: function () + { + return this.scaleY * this.height; + }, + + set: function (value) + { + this.scaleY = value / this.height; + } + + }, + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Components.ComputedSize#setSize + * @since 3.4.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setSize: function (width, height) + { + this.width = width; + this.height = height; + + return this; + }, + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * + * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize + * @since 3.4.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDisplaySize: function (width, height) + { + this.displayWidth = width; + this.displayHeight = height; + + return this; + } + +}; + +module.exports = ComputedSize; + + +/***/ }), + +/***/ 8305: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the texture of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Crop + * @since 3.12.0 + */ + +var Crop = { + + /** + * The Texture this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Crop#texture + * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} + * @since 3.0.0 + */ + texture: null, + + /** + * The Texture Frame this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Crop#frame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + frame: null, + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + * + * @name Phaser.GameObjects.Components.Crop#isCropped + * @type {boolean} + * @since 3.11.0 + */ + isCropped: false, + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * + * @method Phaser.GameObjects.Components.Crop#setCrop + * @since 3.11.0 + * + * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param {number} [y] - The y coordinate to start the crop from. + * @param {number} [width] - The width of the crop rectangle in pixels. + * @param {number} [height] - The height of the crop rectangle in pixels. + * + * @return {this} This Game Object instance. + */ + setCrop: function (x, y, width, height) + { + if (x === undefined) + { + this.isCropped = false; + } + else if (this.frame) + { + if (typeof x === 'number') + { + this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY); + } + else + { + var rect = x; + + this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY); + } + + this.isCropped = true; + } + + return this; + }, + + /** + * Internal method that returns a blank, well-formed crop object for use by a Game Object. + * + * @method Phaser.GameObjects.Components.Crop#resetCropObject + * @private + * @since 3.12.0 + * + * @return {object} The crop object. + */ + resetCropObject: function () + { + return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 }; + } + +}; + +module.exports = Crop; + + +/***/ }), + +/***/ 3131: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the depth of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Depth + * @since 3.0.0 + */ + +var Depth = { + + /** + * Private internal value. Holds the depth of the Game Object. + * + * @name Phaser.GameObjects.Components.Depth#_depth + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + _depth: 0, + + /** + * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * + * @name Phaser.GameObjects.Components.Depth#depth + * @type {number} + * @since 3.0.0 + */ + depth: { + + get: function () + { + return this._depth; + }, + + set: function (value) + { + if (this.displayList) + { + this.displayList.queueDepthSort(); + } + + this._depth = value; + } + + }, + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * + * @method Phaser.GameObjects.Components.Depth#setDepth + * @since 3.0.0 + * + * @param {number} value - The depth of this Game Object. Ensure this value is only ever a number data-type. + * + * @return {this} This Game Object instance. + */ + setDepth: function (value) + { + if (value === undefined) { value = 0; } + + this.depth = value; + + return this; + } + +}; + +module.exports = Depth; + + +/***/ }), + +/***/ 1626: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Effects = __webpack_require__(7347); +var SpliceOne = __webpack_require__(8935); + +/** + * @classdesc + * The FX Component features a set of methods used for applying a range of special built-in effects to a Game Object. + * + * The effects include the following: + * + * * Barrel Distortion + * * Bloom + * * Blur + * * Bokeh / Tilt Shift + * * Circle Outline + * * Color Matrix + * * Glow + * * Displacement + * * Gradient + * * Pixelate + * * Shine + * * Shadow + * * Vignette + * * Wipe / Reveal + * + * All Game Objects support Post FX. These are effects applied after the Game Object has been rendered. + * + * Texture-based Game Objects also support Pre FX, including: + * + * * Image + * * Sprite + * * TileSprite + * * Text + * * RenderTexture + * * Video + * + * And any Game Object that extends the above. + * + * The difference between Pre FX and Post FX are that all Post FX take place in a canvas (renderer) sized frame buffer, + * after the Game Object has been rendered. Pre FX, however, take place in a texture sized frame buffer, which is sized + * based on the Game Object itself. The end result is then composited back to the main game canvas. For intensive effects, + * such as blur, bloom or glow, which can require many iterations, this is a much more efficient way to apply the effect, + * as only it only has to work on a Game Object sized texture and not all pixels in the canvas. + * + * In short, you should always try and use a Pre FX if you can. + * + * Due to the way that FX work they can be stacked-up. For example, you can apply a blur to a Game Object, then apply + * a bloom effect to the same Game Object. The bloom effect will be applied to the blurred texture, not the original. + * Keep the order in mind when stacking effects. + * + * All effects are WebGL only and do not have canvas counterparts. + * + * As you can appreciate, some effects are more expensive than others. For example, a bloom effect is going to be more + * expensive than a simple color matrix effect, so please consider using them wisely and performance test your target + * platforms early on in production. + * + * This component is created automatically by the `PostPipeline` class and does not need to be instantiated directly. + * + * @class FX + * @memberof Phaser.GameObjects.Components + * @constructor + * @since 3.60.0 + * @webglOnly + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that owns this FX Component. + * @param {boolean} isPost - Is this a Pre or Post FX Component? + */ +var FX = new Class({ + + initialize: + + function FX (gameObject, isPost) + { + /** + * A reference to the Game Object that owns this FX Component. + * + * @name Phaser.GameObjects.Components.FX#gameObject + * @type {Phaser.GameObjects.GameObject} + * @readonly + * @since 3.60.0 + */ + this.gameObject = gameObject; + + /** + * Is this a Post FX Controller? or a Pre FX Controller? + * + * @name Phaser.GameObjects.Components.FX#isPost + * @type {boolean} + * @readonly + * @since 3.60.0 + */ + this.isPost = isPost; + + /** + * Has this FX Component been enabled? + * + * You should treat this property as read-only, although it is toggled + * automaticaly during internal use. + * + * @name Phaser.GameObjects.Components.FX#enabled + * @type {boolean} + * @since 3.60.0 + */ + this.enabled = false; + + /** + * An array containing all of the Pre FX Controllers that + * have been added to this FX Component. They are processed in + * the order they are added. + * + * This array is empty if this is a Post FX Component. + * + * @name Phaser.GameObjects.Components.FX#list + * @type {Phaser.FX.Controller[]} + * @since 3.60.0 + */ + this.list = []; + + /** + * The amount of extra padding to be applied to this Game Object + * when it is being rendered by a PreFX Pipeline. + * + * Lots of FX require additional spacing added to the texture the + * Game Object uses, for example a glow or shadow effect, and this + * method allows you to control how much extra padding is included + * in addition to the texture size. + * + * You do not need to set this if you're only using Post FX. + * + * @name Phaser.GameObjects.Components.FX#padding + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.padding = 0; + }, + + /** + * Sets the amount of extra padding to be applied to this Game Object + * when it is being rendered by a PreFX Pipeline. + * + * Lots of FX require additional spacing added to the texture the + * Game Object uses, for example a glow or shadow effect, and this + * method allows you to control how much extra padding is included + * in addition to the texture size. + * + * You do not need to set this if you're only using Post FX. + * + * @method Phaser.GameObjects.Components.FX#setPadding + * @webglOnly + * @since 3.60.0 + * + * @param {number} [padding=0] - The amount of padding to add to this Game Object. + * + * @return {this} This Game Object instance. + */ + setPadding: function (padding) + { + if (padding === undefined) { padding = 0; } + + this.padding = padding; + + return this.gameObject; + }, + + /** + * This callback is invoked when this Game Object is copied by a PreFX Pipeline. + * + * This happens when the pipeline uses its `copySprite` method. + * + * It's invoked prior to the copy, allowing you to set shader uniforms, etc on the pipeline. + * + * @method Phaser.GameObjects.Components.FX#onFXCopy + * @since 3.60.0 + * + * @param {Phaser.Renderer.WebGL.Pipelines.PreFXPipeline} pipeline - The PreFX Pipeline that invoked this callback. + */ + onFXCopy: function () + { + }, + + /** + * This callback is invoked when this Game Object is rendered by a PreFX Pipeline. + * + * This happens when the pipeline uses its `drawSprite` method. + * + * It's invoked prior to the draw, allowing you to set shader uniforms, etc on the pipeline. + * + * @method Phaser.GameObjects.Components.FX#onFX + * @since 3.60.0 + * + * @param {Phaser.Renderer.WebGL.Pipelines.PreFXPipeline} pipeline - The PreFX Pipeline that invoked this callback. + */ + onFX: function () + { + }, + + /** + * Enables this FX Component and applies the FXPipeline to the parent Game Object. + * + * This is called automatically whenever you call a method such as `addBloom`, etc. + * + * You can check the `enabled` property to see if the Game Object is already enabled, or not. + * + * This only applies to Pre FX. Post FX are always enabled. + * + * @method Phaser.GameObjects.Components.FX#enable + * @since 3.60.0 + * + * @param {number} [padding=0] - The amount of padding to add to this Game Object. + */ + enable: function (padding) + { + if (this.isPost) + { + return; + } + + var renderer = this.gameObject.scene.sys.renderer; + + if (renderer && renderer.pipelines) + { + this.gameObject.pipeline = renderer.pipelines.FX_PIPELINE; + + if (padding !== undefined) + { + this.padding = padding; + } + + this.enabled = true; + } + else + { + this.enabled = false; + } + }, + + /** + * Destroys and removes all FX Controllers that are part of this FX Component, + * then disables it. + * + * If this is a Pre FX Component it will only remove Pre FX. + * If this is a Post FX Component it will only remove Post FX. + * + * To remove both at once use the `GameObject.clearFX` method instead. + * + * @method Phaser.GameObjects.Components.FX#clear + * @since 3.60.0 + * + * @return {this} This Game Object instance. + */ + clear: function () + { + if (this.isPost) + { + this.gameObject.resetPostPipeline(true); + } + else + { + var list = this.list; + + for (var i = 0; i < list.length; i++) + { + list[i].destroy(); + } + + this.list = []; + } + + this.enabled = false; + + return this.gameObject; + }, + + /** + * Searches for the given FX Controller within this FX Component. + * + * If found, the controller is removed from this component and then destroyed. + * + * @method Phaser.GameObjects.Components.FX#remove + * @since 3.60.0 + * + * @generic {Phaser.FX.Controller} T + * @genericUse {T} - [fx] + * + * @param {Phaser.FX.Controller} fx - The FX Controller to remove from this FX Component. + * + * @return {this} This Game Object instance. + */ + remove: function (fx) + { + var i; + + if (this.isPost) + { + var pipelines = this.gameObject.getPostPipeline(String(fx.type)); + + if (!Array.isArray(pipelines)) + { + pipelines = [ pipelines ]; + } + + for (i = 0; i < pipelines.length; i++) + { + var pipeline = pipelines[i]; + + if (pipeline.controller === fx) + { + this.gameObject.removePostPipeline(pipeline); + + fx.destroy(); + + break; + } + } + } + else + { + var list = this.list; + + for (i = 0; i < list.length; i++) + { + if (list[i] === fx) + { + SpliceOne(list, i); + + fx.destroy(); + } + } + } + + return this.gameObject; + }, + + /** + * Disables this FX Component. + * + * This will reset the pipeline on the Game Object that owns this component back to its + * default and flag this component as disabled. + * + * You can re-enable it again by calling `enable` for Pre FX or by adding an FX for Post FX. + * + * Optionally, set `clear` to destroy all current FX Controllers. + * + * @method Phaser.GameObjects.Components.FX#disable + * @since 3.60.0 + * + * @param {boolean} [clear=false] - Destroy and remove all FX Controllers that are part of this component. + * + * @return {this} This Game Object instance. + */ + disable: function (clear) + { + if (clear === undefined) { clear = false; } + + if (!this.isPost) + { + this.gameObject.resetPipeline(); + } + + this.enabled = false; + + if (clear) + { + this.clear(); + } + + return this.gameObject; + }, + + /** + * Adds the given FX Controler to this FX Component. + * + * Note that adding an FX Controller does not remove any existing FX. They all stack-up + * on-top of each other. If you don't want this, make sure to call either `remove` or + * `clear` first. + * + * @method Phaser.GameObjects.Components.FX#add + * @since 3.60.0 + * + * @generic {Phaser.FX.Controller} T + * @genericUse {T} - [fx] + * + * @param {Phaser.FX.Controller} fx - The FX Controller to add to this FX Component. + * @param {object} [config] - Optional configuration object that is passed to the pipeline during instantiation. + * + * @return {Phaser.FX.Controller} The FX Controller. + */ + add: function (fx, config) + { + if (this.isPost) + { + var type = String(fx.type); + + this.gameObject.setPostPipeline(type, config); + + var pipeline = this.gameObject.getPostPipeline(type); + + if (pipeline) + { + if (Array.isArray(pipeline)) + { + pipeline = pipeline.pop(); + } + + pipeline.controller = fx; + + return fx; + } + } + else + { + if (!this.enabled) + { + this.enable(); + } + + this.list.push(fx); + + return fx; + } + }, + + /** + * Adds a Glow effect. + * + * The glow effect is a visual technique that creates a soft, luminous halo around game objects, + * characters, or UI elements. This effect is used to emphasize importance, enhance visual appeal, + * or convey a sense of energy, magic, or otherworldly presence. The effect can also be set on + * the inside of the Game Object. The color and strength of the glow can be modified. + * + * @method Phaser.GameObjects.Components.FX#addGlow + * @since 3.60.0 + * + * @param {number} [color=0xffffff] - The color of the glow effect as a number value. + * @param {number} [outerStrength=4] - The strength of the glow outward from the edge of the Sprite. + * @param {number} [innerStrength=0] - The strength of the glow inward from the edge of the Sprite. + * @param {boolean} [knockout=false] - If `true` only the glow is drawn, not the texture itself. + * @param {number} [quality=0.1] - Only available for PostFX. Sets the quality of this Glow effect. Default is 0.1. Cannot be changed post-creation. + * @param {number} [distance=10] - Only available for PostFX. Sets the distance of this Glow effect. Default is 10. Cannot be changed post-creation. + * + * @return {Phaser.FX.Glow} The Glow FX Controller. + */ + addGlow: function (color, outerStrength, innerStrength, knockout, quality, distance) + { + return this.add(new Effects.Glow(this.gameObject, color, outerStrength, innerStrength, knockout), { quality: quality, distance: distance }); + }, + + /** + * Adds a Shadow effect. + * + * The shadow effect is a visual technique used to create the illusion of depth and realism by adding darker, + * offset silhouettes or shapes beneath game objects, characters, or environments. These simulated shadows + * help to enhance the visual appeal and immersion, making the 2D game world appear more dynamic and three-dimensional. + * + * @method Phaser.GameObjects.Components.FX#addShadow + * @since 3.60.0 + * + * @param {number} [x=0] - The horizontal offset of the shadow effect. + * @param {number} [y=0] - The vertical offset of the shadow effect. + * @param {number} [decay=0.1] - The amount of decay for shadow effect. + * @param {number} [power=1] - The power of the shadow effect. + * @param {number} [color=0x000000] - The color of the shadow. + * @param {number} [samples=6] - The number of samples that the shadow effect will run for. An integer between 1 and 12. + * @param {number} [intensity=1] - The intensity of the shadow effect. + * + * @return {Phaser.FX.Shadow} The Shadow FX Controller. + */ + addShadow: function (x, y, decay, power, color, samples, intensity) + { + return this.add(new Effects.Shadow(this.gameObject, x, y, decay, power, color, samples, intensity)); + }, + + /** + * Adds a Pixelate effect. + * + * The pixelate effect is a visual technique that deliberately reduces the resolution or detail of an image, + * creating a blocky or mosaic appearance composed of large, visible pixels. This effect can be used for stylistic + * purposes, as a homage to retro gaming, or as a means to obscure certain elements within the game, such as + * during a transition or to censor specific content. + * + * @method Phaser.GameObjects.Components.FX#addPixelate + * @since 3.60.0 + * + * @param {number} [amount=1] - The amount of pixelation to apply. + * + * @return {Phaser.FX.Pixelate} The Pixelate FX Controller. + */ + addPixelate: function (amount) + { + return this.add(new Effects.Pixelate(this.gameObject, amount)); + }, + + /** + * Adds a Vignette effect. + * + * The vignette effect is a visual technique where the edges of the screen, or a Game Object, gradually darken or blur, + * creating a frame-like appearance. This effect is used to draw the player's focus towards the central action or subject, + * enhance immersion, and provide a cinematic or artistic quality to the game's visuals. + * + * @method Phaser.GameObjects.Components.FX#addVignette + * @since 3.60.0 + * + * @param {number} [x=0.5] - The horizontal offset of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [y=0.5] - The vertical offset of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [radius=0.5] - The radius of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [strength=0.5] - The strength of the vignette effect. + * + * @return {Phaser.FX.Vignette} The Vignette FX Controller. + */ + addVignette: function (x, y, radius, strength) + { + return this.add(new Effects.Vignette(this.gameObject, x, y, radius, strength)); + }, + + /** + * Adds a Shine effect. + * + * The shine effect is a visual technique that simulates the appearance of reflective + * or glossy surfaces by passing a light beam across a Game Object. This effect is used to + * enhance visual appeal, emphasize certain features, and create a sense of depth or + * material properties. + * + * @method Phaser.GameObjects.Components.FX#addShine + * @since 3.60.0 + * + * @param {number} [speed=0.5] - The speed of the Shine effect. + * @param {number} [lineWidth=0.5] - The line width of the Shine effect. + * @param {number} [gradient=3] - The gradient of the Shine effect. + * @param {boolean} [reveal=false] - Does this Shine effect reveal or get added to its target? + * + * @return {Phaser.FX.Shine} The Shine FX Controller. + */ + addShine: function (speed, lineWidth, gradient, reveal) + { + return this.add(new Effects.Shine(this.gameObject, speed, lineWidth, gradient, reveal)); + }, + + /** + * Adds a Blur effect. + * + * A Gaussian blur is the result of blurring an image by a Gaussian function. It is a widely used effect, + * typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a + * smooth blur resembling that of viewing the image through a translucent screen, distinctly different + * from the bokeh effect produced by an out-of-focus lens or the shadow of an object under usual illumination. + * + * @method Phaser.GameObjects.Components.FX#addBlur + * @since 3.60.0 + * + * @param {number} [quality=0] - The quality of the blur effect. Can be either 0 for Low Quality, 1 for Medium Quality or 2 for High Quality. + * @param {number} [x=2] - The horizontal offset of the blur effect. + * @param {number} [y=2] - The vertical offset of the blur effect. + * @param {number} [strength=1] - The strength of the blur effect. + * @param {number} [color=0xffffff] - The color of the blur, as a hex value. + * @param {number} [steps=4] - The number of steps to run the blur effect for. This value should always be an integer. + * + * @return {Phaser.FX.Blur} The Blur FX Controller. + */ + addBlur: function (quality, x, y, strength, color, steps) + { + return this.add(new Effects.Blur(this.gameObject, quality, x, y, strength, color, steps)); + }, + + /** + * Adds a Gradient effect. + * + * The gradient overlay effect is a visual technique where a smooth color transition is applied over Game Objects, + * such as sprites or UI components. This effect is used to enhance visual appeal, emphasize depth, or create + * stylistic and atmospheric variations. It can also be utilized to convey information, such as representing + * progress or health status through color changes. + * + * @method Phaser.GameObjects.Components.FX#addGradient + * @since 3.60.0 + * + * @param {number} [color1=0xff0000] - The first gradient color, given as a number value. + * @param {number} [color2=0x00ff00] - The second gradient color, given as a number value. + * @param {number} [alpha=0.2] - The alpha value of the gradient effect. + * @param {number} [fromX=0] - The horizontal position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [fromY=0] - The vertical position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [toX=0] - The horizontal position the gradient will end at. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [toY=1] - The vertical position the gradient will end at. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [size=0] - How many 'chunks' the gradient is divided in to, as spread over the entire height of the texture. Leave this at zero for a smooth gradient, or set higher for a more retro chunky effect. + * + * @return {Phaser.FX.Gradient} The Gradient FX Controller. + */ + addGradient: function (color1, color2, alpha, fromX, fromY, toX, toY, size) + { + return this.add(new Effects.Gradient(this.gameObject, color1, color2, alpha, fromX, fromY, toX, toY, size)); + }, + + /** + * Adds a Bloom effect. + * + * Bloom is an effect used to reproduce an imaging artifact of real-world cameras. + * The effect produces fringes of light extending from the borders of bright areas in an image, + * contributing to the illusion of an extremely bright light overwhelming the + * camera or eye capturing the scene. + * + * @method Phaser.GameObjects.Components.FX#addBloom + * @since 3.60.0 + * + * @param {number} [color] - The color of the Bloom, as a hex value. + * @param {number} [offsetX=1] - The horizontal offset of the bloom effect. + * @param {number} [offsetY=1] - The vertical offset of the bloom effect. + * @param {number} [blurStrength=1] - The strength of the blur process of the bloom effect. + * @param {number} [strength=1] - The strength of the blend process of the bloom effect. + * @param {number} [steps=4] - The number of steps to run the Bloom effect for. This value should always be an integer. + * + * @return {Phaser.FX.Bloom} The Bloom FX Controller. + */ + addBloom: function (color, offsetX, offsetY, blurStrength, strength, steps) + { + return this.add(new Effects.Bloom(this.gameObject, color, offsetX, offsetY, blurStrength, strength, steps)); + }, + + /** + * Adds a ColorMatrix effect. + * + * The color matrix effect is a visual technique that involves manipulating the colors of an image + * or scene using a mathematical matrix. This process can adjust hue, saturation, brightness, and contrast, + * allowing developers to create various stylistic appearances or mood settings within the game. + * Common applications include simulating different lighting conditions, applying color filters, + * or achieving a specific visual style. + * + * @method Phaser.GameObjects.Components.FX#addColorMatrix + * @since 3.60.0 + * + * @return {Phaser.FX.ColorMatrix} The ColorMatrix FX Controller. + */ + addColorMatrix: function () + { + return this.add(new Effects.ColorMatrix(this.gameObject)); + }, + + /** + * Adds a Circle effect. + * + * This effect will draw a circle around the texture of the Game Object, effectively masking off + * any area outside of the circle without the need for an actual mask. You can control the thickness + * of the circle, the color of the circle and the color of the background, should the texture be + * transparent. You can also control the feathering applied to the circle, allowing for a harsh or soft edge. + * + * Please note that adding this effect to a Game Object will not change the input area or physics body of + * the Game Object, should it have one. + * + * @method Phaser.GameObjects.Components.FX#addCircle + * @since 3.60.0 + * + * @param {number} [thickness=8] - The width of the circle around the texture, in pixels. + * @param {number} [color=0xfeedb6] - The color of the circular ring, given as a number value. + * @param {number} [backgroundColor=0xff0000] - The color of the background, behind the texture, given as a number value. + * @param {number} [scale=1] - The scale of the circle. The default scale is 1, which is a circle the full size of the underlying texture. + * @param {number} [feather=0.005] - The amount of feathering to apply to the circle from the ring. + * + * @return {Phaser.FX.Circle} The Circle FX Controller. + */ + addCircle: function (thickness, color, backgroundColor, scale, feather) + { + return this.add(new Effects.Circle(this.gameObject, thickness, color, backgroundColor, scale, feather)); + }, + + /** + * Adds a Barrel effect. + * + * A barrel effect allows you to apply either a 'pinch' or 'expand' distortion to + * a Game Object. The amount of the effect can be modified in real-time. + * + * @method Phaser.GameObjects.Components.FX#addBarrel + * @since 3.60.0 + * + * @param {number} [amount=1] - The amount of distortion applied to the barrel effect. A value of 1 is no distortion. Typically keep this within +- 1. + * + * @return {Phaser.FX.Barrel} The Barrel FX Controller. + */ + addBarrel: function (amount) + { + return this.add(new Effects.Barrel(this.gameObject, amount)); + }, + + /** + * Adds a Displacement effect. + * + * The displacement effect is a visual technique that alters the position of pixels in an image + * or texture based on the values of a displacement map. This effect is used to create the illusion + * of depth, surface irregularities, or distortion in otherwise flat elements. It can be applied to + * characters, objects, or backgrounds to enhance realism, convey movement, or achieve various + * stylistic appearances. + * + * @method Phaser.GameObjects.Components.FX#addDisplacement + * @since 3.60.0 + * + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * @param {number} [x=0.005] - The amount of horizontal displacement to apply. A very small float number, such as 0.005. + * @param {number} [y=0.005] - The amount of vertical displacement to apply. A very small float number, such as 0.005. + * + * @return {Phaser.FX.Displacement} The Displacement FX Controller. + */ + addDisplacement: function (texture, x, y) + { + return this.add(new Effects.Displacement(this.gameObject, texture, x, y)); + }, + + /** + * Adds a Wipe effect. + * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * + * @method Phaser.GameObjects.Components.FX#addWipe + * @since 3.60.0 + * + * @param {number} [wipeWidth=0.1] - The width of the wipe effect. This value is normalized in the range 0 to 1. + * @param {number} [direction=0] - The direction of the wipe effect. Either 0 or 1. Set in conjunction with the axis property. + * @param {number} [axis=0] - The axis of the wipe effect. Either 0 or 1. Set in conjunction with the direction property. + * + * @return {Phaser.FX.Wipe} The Wipe FX Controller. + */ + addWipe: function (wipeWidth, direction, axis) + { + return this.add(new Effects.Wipe(this.gameObject, wipeWidth, direction, axis)); + }, + + /** + * Adds a Reveal Wipe effect. + * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * + * @method Phaser.GameObjects.Components.FX#addReveal + * @since 3.60.0 + * + * @param {number} [wipeWidth=0.1] - The width of the wipe effect. This value is normalized in the range 0 to 1. + * @param {number} [direction=0] - The direction of the wipe effect. Either 0 or 1. Set in conjunction with the axis property. + * @param {number} [axis=0] - The axis of the wipe effect. Either 0 or 1. Set in conjunction with the direction property. + * + * @return {Phaser.FX.Wipe} The Wipe FX Controller. + */ + addReveal: function (wipeWidth, direction, axis) + { + return this.add(new Effects.Wipe(this.gameObject, wipeWidth, direction, axis, true)); + }, + + /** + * Adds a Bokeh effect. + * + * Bokeh refers to a visual effect that mimics the photographic technique of creating a shallow depth of field. + * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground + * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering + * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. + * + * See also Tilt Shift. + * + * @method Phaser.GameObjects.Components.FX#addBokeh + * @since 3.60.0 + * + * @param {number} [radius=0.5] - The radius of the bokeh effect. + * @param {number} [amount=1] - The amount of the bokeh effect. + * @param {number} [contrast=0.2] - The color contrast of the bokeh effect. + * + * @return {Phaser.FX.Bokeh} The Bokeh FX Controller. + */ + addBokeh: function (radius, amount, contrast) + { + return this.add(new Effects.Bokeh(this.gameObject, radius, amount, contrast)); + }, + + /** + * Adds a Tilt Shift effect. + * + * This Bokeh effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature + * effect by blurring everything except a small area of the image. This effect is achieved by blurring the + * top and bottom elements, while keeping the center area in focus. + * + * See also Bokeh. + * + * @method Phaser.GameObjects.Components.FX#addTiltShift + * @since 3.60.0 + * + * @param {number} [radius=0.5] - The radius of the bokeh effect. + * @param {number} [amount=1] - The amount of the bokeh effect. + * @param {number} [contrast=0.2] - The color contrast of the bokeh effect. + * @param {number} [blurX=1] - The amount of horizontal blur. + * @param {number} [blurY=1] - The amount of vertical blur. + * @param {number} [strength=1] - The strength of the blur. + * + * @return {Phaser.FX.Bokeh} The Bokeh TiltShift FX Controller. + */ + addTiltShift: function (radius, amount, contrast, blurX, blurY, strength) + { + return this.add(new Effects.Bokeh(this.gameObject, radius, amount, contrast, true, blurX, blurY, strength)); + }, + + /** + * Destroys this FX Component. + * + * Called automatically when Game Objects are destroyed. + * + * @method Phaser.GameObjects.Components.FX#destroy + * @since 3.60.0 + */ + destroy: function () + { + this.clear(); + + this.gameObject = null; + } + +}); + +module.exports = FX; + + +/***/ }), + +/***/ 9660: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for visually flipping a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Flip + * @since 3.0.0 + */ + +var Flip = { + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @name Phaser.GameObjects.Components.Flip#flipX + * @type {boolean} + * @default false + * @since 3.0.0 + */ + flipX: false, + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @name Phaser.GameObjects.Components.Flip#flipY + * @type {boolean} + * @default false + * @since 3.0.0 + */ + flipY: false, + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#toggleFlipX + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + toggleFlipX: function () + { + this.flipX = !this.flipX; + + return this; + }, + + /** + * Toggles the vertical flipped state of this Game Object. + * + * @method Phaser.GameObjects.Components.Flip#toggleFlipY + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + toggleFlipY: function () + { + this.flipY = !this.flipY; + + return this; + }, + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#setFlipX + * @since 3.0.0 + * + * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlipX: function (value) + { + this.flipX = value; + + return this; + }, + + /** + * Sets the vertical flipped state of this Game Object. + * + * @method Phaser.GameObjects.Components.Flip#setFlipY + * @since 3.0.0 + * + * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlipY: function (value) + { + this.flipY = value; + + return this; + }, + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#setFlip + * @since 3.0.0 + * + * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlip: function (x, y) + { + this.flipX = x; + this.flipY = y; + + return this; + }, + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + * + * @method Phaser.GameObjects.Components.Flip#resetFlip + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + resetFlip: function () + { + this.flipX = false; + this.flipY = false; + + return this; + } + +}; + +module.exports = Flip; + + +/***/ }), + +/***/ 3671: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(1392); +var RotateAround = __webpack_require__(9876); +var Vector2 = __webpack_require__(2529); + +/** + * Provides methods used for obtaining the bounds of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.GetBounds + * @since 3.0.0 + */ + +var GetBounds = { + + /** + * Processes the bounds output vector before returning it. + * + * @method Phaser.GameObjects.Components.GetBounds#prepareBoundsOutput + * @private + * @since 3.18.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} output - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + prepareBoundsOutput: function (output, includeParent) + { + if (includeParent === undefined) { includeParent = false; } + + if (this.rotation !== 0) + { + RotateAround(output, this.x, this.y, this.rotation); + } + + if (includeParent && this.parentContainer) + { + var parentMatrix = this.parentContainer.getBoundsTransformMatrix(); + + parentMatrix.transformPoint(output.x, output.y, output); + } + + return output; + }, + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getCenter + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getCenter: function (output, includeParent) + { + if (output === undefined) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX) + (this.displayWidth / 2); + output.y = this.y - (this.displayHeight * this.originY) + (this.displayHeight / 2); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getTopLeft + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getTopLeft: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX); + output.y = this.y - (this.displayHeight * this.originY); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getTopCenter + * @since 3.18.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getTopCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2); + output.y = this.y - (this.displayHeight * this.originY); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getTopRight + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getTopRight: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; + output.y = this.y - (this.displayHeight * this.originY); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getLeftCenter + * @since 3.18.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getLeftCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX); + output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getRightCenter + * @since 3.18.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getRightCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; + output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getBottomLeft + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getBottomLeft: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX); + output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getBottomCenter + * @since 3.18.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getBottomCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2); + output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getBottomRight + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getBottomRight: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; + output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bounds of this Game Object, regardless of origin. + * + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * + * @method Phaser.GameObjects.Components.GetBounds#getBounds + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [output,$return] + * + * @param {(Phaser.Geom.Rectangle|object)} [output] - An object to store the values in. If not provided a new Rectangle will be created. + * + * @return {(Phaser.Geom.Rectangle|object)} The values stored in the output object. + */ + getBounds: function (output) + { + if (output === undefined) { output = new Rectangle(); } + + // We can use the output object to temporarily store the x/y coords in: + + var TLx, TLy, TRx, TRy, BLx, BLy, BRx, BRy; + + // Instead of doing a check if parent container is + // defined per corner we only do it once. + if (this.parentContainer) + { + var parentMatrix = this.parentContainer.getBoundsTransformMatrix(); + + this.getTopLeft(output); + parentMatrix.transformPoint(output.x, output.y, output); + + TLx = output.x; + TLy = output.y; + + this.getTopRight(output); + parentMatrix.transformPoint(output.x, output.y, output); + + TRx = output.x; + TRy = output.y; + + this.getBottomLeft(output); + parentMatrix.transformPoint(output.x, output.y, output); + + BLx = output.x; + BLy = output.y; + + this.getBottomRight(output); + parentMatrix.transformPoint(output.x, output.y, output); + + BRx = output.x; + BRy = output.y; + } + else + { + this.getTopLeft(output); + + TLx = output.x; + TLy = output.y; + + this.getTopRight(output); + + TRx = output.x; + TRy = output.y; + + this.getBottomLeft(output); + + BLx = output.x; + BLy = output.y; + + this.getBottomRight(output); + + BRx = output.x; + BRy = output.y; + } + + output.x = Math.min(TLx, TRx, BLx, BRx); + output.y = Math.min(TLy, TRy, BLy, BRy); + output.width = Math.max(TLx, TRx, BLx, BRx) - output.x; + output.height = Math.max(TLy, TRy, BLy, BRy) - output.y; + + return output; + } + +}; + +module.exports = GetBounds; + + +/***/ }), + +/***/ 2246: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BitmapMask = __webpack_require__(7499); +var GeometryMask = __webpack_require__(6726); + +/** + * Provides methods used for getting and setting the mask of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Mask + * @since 3.0.0 + */ + +var Mask = { + + /** + * The Mask this Game Object is using during render. + * + * @name Phaser.GameObjects.Components.Mask#mask + * @type {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} + * @since 3.0.0 + */ + mask: null, + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * + * @method Phaser.GameObjects.Components.Mask#setMask + * @since 3.6.2 + * + * @param {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} mask - The mask this Game Object will use when rendering. + * + * @return {this} This Game Object instance. + */ + setMask: function (mask) + { + this.mask = mask; + + return this; + }, + + /** + * Clears the mask that this Game Object was using. + * + * @method Phaser.GameObjects.Components.Mask#clearMask + * @since 3.6.2 + * + * @param {boolean} [destroyMask=false] - Destroy the mask before clearing it? + * + * @return {this} This Game Object instance. + */ + clearMask: function (destroyMask) + { + if (destroyMask === undefined) { destroyMask = false; } + + if (destroyMask && this.mask) + { + this.mask.destroy(); + } + + this.mask = null; + + return this; + }, + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one, or a Dynamic Texture. + * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable texture-based Game Object. + * + * @method Phaser.GameObjects.Components.Mask#createBitmapMask + * @since 3.6.2 + * + * @generic {Phaser.GameObjects.GameObject} G + * @generic {Phaser.Textures.DynamicTexture} T + * @genericUse {(G|T|null)} [maskObject] + * + * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Dynamic Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. + * @param {number} [x] - If creating a Game Object, the horizontal position in the world. + * @param {number} [y] - If creating a Game Object, the vertical position in the world. + * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created. + */ + createBitmapMask: function (maskObject, x, y, texture, frame) + { + if (maskObject === undefined && (this.texture || this.shader || this.geom)) + { + // eslint-disable-next-line consistent-this + maskObject = this; + } + + return new BitmapMask(this.scene, maskObject, x, y, texture, frame); + }, + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * + * @method Phaser.GameObjects.Components.Mask#createGeometryMask + * @since 3.6.2 + * + * @generic {Phaser.GameObjects.Graphics} G + * @generic {Phaser.GameObjects.Shape} S + * @genericUse {(G|S)} [graphics] + * + * @param {Phaser.GameObjects.Graphics|Phaser.GameObjects.Shape} [graphics] - A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask. + * + * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. + */ + createGeometryMask: function (graphics) + { + if (graphics === undefined && (this.type === 'Graphics' || this.geom)) + { + // eslint-disable-next-line consistent-this + graphics = this; + } + + return new GeometryMask(this.scene, graphics); + } + +}; + +module.exports = Mask; + + +/***/ }), + +/***/ 5085: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the origin of a Game Object. + * Values are normalized, given in the range 0 to 1. + * Display values contain the calculated pixel values. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Origin + * @since 3.0.0 + */ + +var Origin = { + + /** + * A property indicating that a Game Object has this component. + * + * @name Phaser.GameObjects.Components.Origin#_originComponent + * @type {boolean} + * @private + * @default true + * @since 3.2.0 + */ + _originComponent: true, + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + * Set this value with `setOrigin()`. + * + * @name Phaser.GameObjects.Components.Origin#originX + * @type {number} + * @readonly + * @default 0.5 + * @since 3.0.0 + */ + originX: 0.5, + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + * Set this value with `setOrigin()`. + * + * @name Phaser.GameObjects.Components.Origin#originY + * @type {number} + * @readonly + * @default 0.5 + * @since 3.0.0 + */ + originY: 0.5, + + // private + read only + _displayOriginX: 0, + _displayOriginY: 0, + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + * + * @name Phaser.GameObjects.Components.Origin#displayOriginX + * @type {number} + * @since 3.0.0 + */ + displayOriginX: { + + get: function () + { + return this._displayOriginX; + }, + + set: function (value) + { + this._displayOriginX = value; + this.originX = value / this.width; + } + + }, + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + * + * @name Phaser.GameObjects.Components.Origin#displayOriginY + * @type {number} + * @since 3.0.0 + */ + displayOriginY: { + + get: function () + { + return this._displayOriginY; + }, + + set: function (value) + { + this._displayOriginY = value; + this.originY = value / this.height; + } + + }, + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * + * @method Phaser.GameObjects.Components.Origin#setOrigin + * @since 3.0.0 + * + * @param {number} [x=0.5] - The horizontal origin value. + * @param {number} [y=x] - The vertical origin value. If not defined it will be set to the value of `x`. + * + * @return {this} This Game Object instance. + */ + setOrigin: function (x, y) + { + if (x === undefined) { x = 0.5; } + if (y === undefined) { y = x; } + + this.originX = x; + this.originY = y; + + return this.updateDisplayOrigin(); + }, + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + * + * @method Phaser.GameObjects.Components.Origin#setOriginFromFrame + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + setOriginFromFrame: function () + { + if (!this.frame || !this.frame.customPivot) + { + return this.setOrigin(); + } + else + { + this.originX = this.frame.pivotX; + this.originY = this.frame.pivotY; + } + + return this.updateDisplayOrigin(); + }, + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * + * @method Phaser.GameObjects.Components.Origin#setDisplayOrigin + * @since 3.0.0 + * + * @param {number} [x=0] - The horizontal display origin value. + * @param {number} [y=x] - The vertical display origin value. If not defined it will be set to the value of `x`. + * + * @return {this} This Game Object instance. + */ + setDisplayOrigin: function (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + + this.displayOriginX = x; + this.displayOriginY = y; + + return this; + }, + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + * + * @method Phaser.GameObjects.Components.Origin#updateDisplayOrigin + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + updateDisplayOrigin: function () + { + this._displayOriginX = this.originX * this.width; + this._displayOriginY = this.originY * this.height; + + return this; + } + +}; + +module.exports = Origin; + + +/***/ }), + +/***/ 77: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DegToRad = __webpack_require__(7149); +var GetBoolean = __webpack_require__(1864); +var GetValue = __webpack_require__(5851); +var TWEEN_CONST = __webpack_require__(3747); +var Vector2 = __webpack_require__(2529); + +/** + * Provides methods used for managing a Game Object following a Path. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.PathFollower + * @since 3.17.0 + */ + +var PathFollower = { + + /** + * The Path this PathFollower is following. It can only follow one Path at a time. + * + * @name Phaser.GameObjects.Components.PathFollower#path + * @type {Phaser.Curves.Path} + * @since 3.0.0 + */ + path: null, + + /** + * Should the PathFollower automatically rotate to point in the direction of the Path? + * + * @name Phaser.GameObjects.Components.PathFollower#rotateToPath + * @type {boolean} + * @default false + * @since 3.0.0 + */ + rotateToPath: false, + + /** + * If the PathFollower is rotating to match the Path (@see Phaser.GameObjects.PathFollower#rotateToPath) + * this value is added to the rotation value. This allows you to rotate objects to a path but control + * the angle of the rotation as well. + * + * @name Phaser.GameObjects.PathFollower#pathRotationOffset + * @type {number} + * @default 0 + * @since 3.0.0 + */ + pathRotationOffset: 0, + + /** + * An additional vector to add to the PathFollowers position, allowing you to offset it from the + * Path coordinates. + * + * @name Phaser.GameObjects.PathFollower#pathOffset + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + pathOffset: null, + + /** + * A Vector2 that stores the current point of the path the follower is on. + * + * @name Phaser.GameObjects.PathFollower#pathVector + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + pathVector: null, + + /** + * The distance the follower has traveled from the previous point to the current one, at the last update. + * + * @name Phaser.GameObjects.PathFollower#pathDelta + * @type {Phaser.Math.Vector2} + * @since 3.23.0 + */ + pathDelta: null, + + /** + * The Tween used for following the Path. + * + * @name Phaser.GameObjects.PathFollower#pathTween + * @type {Phaser.Tweens.Tween} + * @since 3.0.0 + */ + pathTween: null, + + /** + * Settings for the PathFollower. + * + * @name Phaser.GameObjects.PathFollower#pathConfig + * @type {?Phaser.Types.GameObjects.PathFollower.PathConfig} + * @default null + * @since 3.0.0 + */ + pathConfig: null, + + /** + * Records the direction of the follower so it can change direction. + * + * @name Phaser.GameObjects.PathFollower#_prevDirection + * @type {number} + * @private + * @since 3.0.0 + */ + _prevDirection: TWEEN_CONST.PLAYING_FORWARD, + + /** + * Set the Path that this PathFollower should follow. + * + * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings. + * + * @method Phaser.GameObjects.Components.PathFollower#setPath + * @since 3.0.0 + * + * @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time. + * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config] - Settings for the PathFollower. + * + * @return {this} This Game Object. + */ + setPath: function (path, config) + { + if (config === undefined) { config = this.pathConfig; } + + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.stop(); + } + + this.path = path; + + if (config) + { + this.startFollow(config); + } + + return this; + }, + + /** + * Set whether the PathFollower should automatically rotate to point in the direction of the Path. + * + * @method Phaser.GameObjects.Components.PathFollower#setRotateToPath + * @since 3.0.0 + * + * @param {boolean} value - Whether the PathFollower should automatically rotate to point in the direction of the Path. + * @param {number} [offset=0] - Rotation offset in degrees. + * + * @return {this} This Game Object. + */ + setRotateToPath: function (value, offset) + { + if (offset === undefined) { offset = 0; } + + this.rotateToPath = value; + + this.pathRotationOffset = offset; + + return this; + }, + + /** + * Is this PathFollower actively following a Path or not? + * + * To be considered as `isFollowing` it must be currently moving on a Path, and not paused. + * + * @method Phaser.GameObjects.Components.PathFollower#isFollowing + * @since 3.0.0 + * + * @return {boolean} `true` is this PathFollower is actively following a Path, otherwise `false`. + */ + isFollowing: function () + { + var tween = this.pathTween; + + return (tween && tween.isPlaying()); + }, + + /** + * Starts this PathFollower following its given Path. + * + * @method Phaser.GameObjects.Components.PathFollower#startFollow + * @since 3.3.0 + * + * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config={}] - The duration of the follow, or a PathFollower config object. + * @param {number} [startAt=0] - Optional start position of the follow, between 0 and 1. + * + * @return {this} This Game Object. + */ + startFollow: function (config, startAt) + { + if (config === undefined) { config = {}; } + if (startAt === undefined) { startAt = 0; } + + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.stop(); + } + + if (typeof config === 'number') + { + config = { duration: config }; + } + + // Override in case they've been specified in the config + config.from = GetValue(config, 'from', 0); + config.to = GetValue(config, 'to', 1); + + var positionOnPath = GetBoolean(config, 'positionOnPath', false); + + this.rotateToPath = GetBoolean(config, 'rotateToPath', false); + this.pathRotationOffset = GetValue(config, 'rotationOffset', 0); + + // This works, but it's not an ideal way of doing it as the follower jumps position + var seek = GetValue(config, 'startAt', startAt); + + if (seek) + { + config.onStart = function (tween) + { + var tweenData = tween.data[0]; + tweenData.progress = seek; + tweenData.elapsed = tweenData.duration * seek; + var v = tweenData.ease(tweenData.progress); + tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); + tweenData.setTargetValue(); + }; + } + + if (!this.pathOffset) + { + this.pathOffset = new Vector2(this.x, this.y); + } + + if (!this.pathVector) + { + this.pathVector = new Vector2(); + } + + if (!this.pathDelta) + { + this.pathDelta = new Vector2(); + } + + this.pathDelta.reset(); + + config.persist = true; + + this.pathTween = this.scene.sys.tweens.addCounter(config); + + // The starting point of the path, relative to this follower + this.path.getStartPoint(this.pathOffset); + + if (positionOnPath) + { + this.x = this.pathOffset.x; + this.y = this.pathOffset.y; + } + + this.pathOffset.x = this.x - this.pathOffset.x; + this.pathOffset.y = this.y - this.pathOffset.y; + + this._prevDirection = TWEEN_CONST.PLAYING_FORWARD; + + if (this.rotateToPath) + { + // Set the rotation now (in case the tween has a delay on it, etc) + var nextPoint = this.path.getPoint(0.1); + + this.rotation = Math.atan2(nextPoint.y - this.y, nextPoint.x - this.x) + DegToRad(this.pathRotationOffset); + } + + this.pathConfig = config; + + return this; + }, + + /** + * Pauses this PathFollower. It will still continue to render, but it will remain motionless at the + * point on the Path at which you paused it. + * + * @method Phaser.GameObjects.Components.PathFollower#pauseFollow + * @since 3.3.0 + * + * @return {this} This Game Object. + */ + pauseFollow: function () + { + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.pause(); + } + + return this; + }, + + /** + * Resumes a previously paused PathFollower. + * + * If the PathFollower was not paused this has no effect. + * + * @method Phaser.GameObjects.Components.PathFollower#resumeFollow + * @since 3.3.0 + * + * @return {this} This Game Object. + */ + resumeFollow: function () + { + var tween = this.pathTween; + + if (tween && tween.isPaused()) + { + tween.resume(); + } + + return this; + }, + + /** + * Stops this PathFollower from following the path any longer. + * + * This will invoke any 'stop' conditions that may exist on the Path, or for the follower. + * + * @method Phaser.GameObjects.Components.PathFollower#stopFollow + * @since 3.3.0 + * + * @return {this} This Game Object. + */ + stopFollow: function () + { + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.stop(); + } + + return this; + }, + + /** + * Internal update handler that advances this PathFollower along the path. + * + * Called automatically by the Scene step, should not typically be called directly. + * + * @method Phaser.GameObjects.Components.PathFollower#pathUpdate + * @since 3.17.0 + */ + pathUpdate: function () + { + var tween = this.pathTween; + + if (tween) + { + var tweenData = tween.data[0]; + var pathDelta = this.pathDelta; + var pathVector = this.pathVector; + + pathDelta.copy(pathVector).negate(); + + if (tweenData.state === TWEEN_CONST.COMPLETE) + { + this.path.getPoint(tweenData.end, pathVector); + + pathDelta.add(pathVector); + pathVector.add(this.pathOffset); + + this.setPosition(pathVector.x, pathVector.y); + + return; + } + else if (tweenData.state !== TWEEN_CONST.PLAYING_FORWARD && tweenData.state !== TWEEN_CONST.PLAYING_BACKWARD) + { + // If delayed, etc then bail out + return; + } + + this.path.getPoint(tween.getValue(), pathVector); + + pathDelta.add(pathVector); + pathVector.add(this.pathOffset); + + var oldX = this.x; + var oldY = this.y; + + this.setPosition(pathVector.x, pathVector.y); + + var speedX = this.x - oldX; + var speedY = this.y - oldY; + + if (speedX === 0 && speedY === 0) + { + // Bail out early + return; + } + + if (tweenData.state !== this._prevDirection) + { + // We've changed direction, so don't do a rotate this frame + this._prevDirection = tweenData.state; + + return; + } + + if (this.rotateToPath) + { + this.rotation = Math.atan2(speedY, speedX) + DegToRad(this.pathRotationOffset); + } + } + } + +}; + +module.exports = PathFollower; + + +/***/ }), + +/***/ 986: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DeepCopy = __webpack_require__(3911); + +/** + * Provides methods used for setting the WebGL rendering pipeline of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Pipeline + * @webglOnly + * @since 3.0.0 + */ + +var Pipeline = { + + /** + * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. + * + * @name Phaser.GameObjects.Components.Pipeline#defaultPipeline + * @type {Phaser.Renderer.WebGL.WebGLPipeline} + * @default null + * @webglOnly + * @since 3.0.0 + */ + defaultPipeline: null, + + /** + * The current WebGL pipeline of this Game Object. + * + * @name Phaser.GameObjects.Components.Pipeline#pipeline + * @type {Phaser.Renderer.WebGL.WebGLPipeline} + * @default null + * @webglOnly + * @since 3.0.0 + */ + pipeline: null, + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + * + * @name Phaser.GameObjects.Components.Pipeline#pipelineData + * @type {object} + * @webglOnly + * @since 3.50.0 + */ + pipelineData: null, + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * + * @method Phaser.GameObjects.Components.Pipeline#initPipeline + * @webglOnly + * @since 3.0.0 + * + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - Either the string-based name of the pipeline, or a pipeline instance to set. + * + * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. + */ + initPipeline: function (pipeline) + { + this.pipelineData = {}; + + var renderer = this.scene.sys.renderer; + + if (!renderer) + { + return false; + } + + var pipelines = renderer.pipelines; + + if (pipelines) + { + if (pipeline === undefined) + { + pipeline = pipelines.default; + } + + var instance = pipelines.get(pipeline); + + if (instance) + { + this.defaultPipeline = instance; + this.pipeline = instance; + + return true; + } + } + + return false; + }, + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * @method Phaser.GameObjects.Components.Pipeline#setPipeline + * @webglOnly + * @since 3.0.0 + * + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set. + * @param {object} [pipelineData] - Optional pipeline data object that is set in to the `pipelineData` property of this Game Object. + * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. + * + * @return {this} This Game Object instance. + */ + setPipeline: function (pipeline, pipelineData, copyData) + { + var renderer = this.scene.sys.renderer; + + if (!renderer) + { + return this; + } + + var pipelines = renderer.pipelines; + + if (pipelines) + { + var instance = pipelines.get(pipeline); + + if (instance) + { + this.pipeline = instance; + } + + if (pipelineData) + { + this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; + } + } + + return this; + }, + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * @method Phaser.GameObjects.Components.Pipeline#setPipelineData + * @webglOnly + * @since 3.50.0 + * + * @param {string} key - The key of the pipeline data to set, update, or delete. + * @param {any} [value] - The value to be set with the key. If `undefined` then `key` will be deleted from the object. + * + * @return {this} This Game Object instance. + */ + setPipelineData: function (key, value) + { + var data = this.pipelineData; + + if (value === undefined) + { + delete data[key]; + } + else + { + data[key] = value; + } + + return this; + }, + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * + * @method Phaser.GameObjects.Components.Pipeline#resetPipeline + * @webglOnly + * @since 3.0.0 + * + * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? + * + * @return {boolean} `true` if the pipeline was reset successfully, otherwise `false`. + */ + resetPipeline: function (resetData) + { + if (resetData === undefined) { resetData = false; } + + this.pipeline = this.defaultPipeline; + + if (resetData) + { + this.pipelineData = {}; + } + + return (this.pipeline !== null); + }, + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + * + * @method Phaser.GameObjects.Components.Pipeline#getPipelineName + * @webglOnly + * @since 3.0.0 + * + * @return {string} The string-based name of the pipeline being used by this Game Object. + */ + getPipelineName: function () + { + return this.pipeline.name; + } + +}; + +module.exports = Pipeline; + + +/***/ }), + +/***/ 4461: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DeepCopy = __webpack_require__(3911); +var FX = __webpack_require__(1626); +var SpliceOne = __webpack_require__(8935); + +/** + * Provides methods used for setting the WebGL rendering post pipeline of a Game Object. + * + * @namespace Phaser.GameObjects.Components.PostPipeline + * @webglOnly + * @since 3.60.0 + */ + +var PostPipeline = { + + /** + * Does this Game Object have any Post Pipelines set? + * + * @name Phaser.GameObjects.Components.PostPipeline#hasPostPipeline + * @type {boolean} + * @webglOnly + * @since 3.60.0 + */ + hasPostPipeline: false, + + /** + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. + * + * @name Phaser.GameObjects.Components.PostPipeline#postPipelines + * @type {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]} + * @webglOnly + * @since 3.60.0 + */ + postPipelines: null, + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + * + * @name Phaser.GameObjects.Components.PostPipeline#postPipelineData + * @type {object} + * @webglOnly + * @since 3.60.0 + */ + postPipelineData: null, + + /** + * The Pre FX component of this Game Object. + * + * This component allows you to apply a variety of built-in effects to this Game Object, such + * as glow, blur, bloom, displacements, vignettes and more. You access them via this property, + * for example: + * + * ```js + * const player = this.add.sprite(); + * player.preFX.addBloom(); + * ``` + * + * Only the following Game Objects support Pre FX: + * + * * Image + * * Sprite + * * TileSprite + * * Text + * * RenderTexture + * * Video + * + * All FX are WebGL only and do not have Canvas counterparts. + * + * Please see the FX Class for more details and available methods. + * + * @name Phaser.GameObjects.Components.PostPipeline#preFX + * @type {?Phaser.GameObjects.Components.FX} + * @webglOnly + * @since 3.60.0 + */ + preFX: null, + + /** + * The Post FX component of this Game Object. + * + * This component allows you to apply a variety of built-in effects to this Game Object, such + * as glow, blur, bloom, displacements, vignettes and more. You access them via this property, + * for example: + * + * ```js + * const player = this.add.sprite(); + * player.postFX.addBloom(); + * ``` + * + * All FX are WebGL only and do not have Canvas counterparts. + * + * Please see the FX Class for more details and available methods. + * + * This property is always `null` until the `initPostPipeline` method is called. + * + * @name Phaser.GameObjects.Components.PostPipeline#postFX + * @type {Phaser.GameObjects.Components.FX} + * @webglOnly + * @since 3.60.0 + */ + postFX: null, + + /** + * This should only be called during the instantiation of the Game Object. + * + * It is called by default by all core Game Objects and doesn't need + * calling again. + * + * After that, use `setPostPipeline`. + * + * @method Phaser.GameObjects.Components.PostPipeline#initPostPipeline + * @webglOnly + * @since 3.60.0 + * + * @param {boolean} [preFX=false] - Does this Game Object support Pre FX? + */ + initPostPipeline: function (preFX) + { + this.postPipelines = []; + this.postPipelineData = {}; + + this.postFX = new FX(this, true); + + if (preFX) + { + this.preFX = new FX(this, false); + } + }, + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also set the `postPipelineData` property, if the parameter is given. + * + * @method Phaser.GameObjects.Components.PostPipeline#setPostPipeline + * @webglOnly + * @since 3.60.0 + * + * @param {(string|string[]|function|function[]|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} pipelines - Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param {object} [pipelineData] - Optional pipeline data object that is set in to the `postPipelineData` property of this Game Object. + * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `postPipelineData` property of this Game Object? If `false` it will be set by reference instead. + * + * @return {this} This Game Object instance. + */ + setPostPipeline: function (pipelines, pipelineData, copyData) + { + var renderer = this.scene.sys.renderer; + + if (!renderer) + { + return this; + } + + var pipelineManager = renderer.pipelines; + + if (pipelineManager) + { + if (!Array.isArray(pipelines)) + { + pipelines = [ pipelines ]; + } + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelineManager.getPostPipeline(pipelines[i], this, pipelineData); + + if (instance) + { + this.postPipelines.push(instance); + } + } + + if (pipelineData) + { + this.postPipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; + } + } + + this.hasPostPipeline = (this.postPipelines.length > 0); + + return this; + }, + + /** + * Adds an entry to the `postPipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * @method Phaser.GameObjects.Components.PostPipeline#setPostPipelineData + * @webglOnly + * @since 3.60.0 + * + * @param {string} key - The key of the pipeline data to set, update, or delete. + * @param {any} [value] - The value to be set with the key. If `undefined` then `key` will be deleted from the object. + * + * @return {this} This Game Object instance. + */ + setPostPipelineData: function (key, value) + { + var data = this.postPipelineData; + + if (value === undefined) + { + delete data[key]; + } + else + { + data[key] = value; + } + + return this; + }, + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * + * @method Phaser.GameObjects.Components.PostPipeline#getPostPipeline + * @webglOnly + * @since 3.60.0 + * + * @param {(string|function|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline)} pipeline - The string-based name of the pipeline, or a pipeline class. + * + * @return {(Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} An array of all the Post Pipelines matching the name. This array will be empty if there was no match. If there was only one single match, that pipeline is returned directly, not in an array. + */ + getPostPipeline: function (pipeline) + { + var isString = (typeof pipeline === 'string'); + + var pipelines = this.postPipelines; + + var results = []; + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelines[i]; + + if ((isString && instance.name === pipeline) || (!isString && instance instanceof pipeline)) + { + results.push(instance); + } + } + + return (results.length === 1) ? results[0] : results; + }, + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * + * @method Phaser.GameObjects.Components.PostPipeline#resetPostPipeline + * @webglOnly + * @since 3.60.0 + * + * @param {boolean} [resetData=false] - Reset the `postPipelineData` object to being an empty object? + */ + resetPostPipeline: function (resetData) + { + if (resetData === undefined) { resetData = false; } + + var pipelines = this.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + pipelines[i].destroy(); + } + + this.postPipelines = []; + this.hasPostPipeline = false; + + if (resetData) + { + this.postPipelineData = {}; + } + }, + + /** + * Removes a type of Post Pipeline instances from this Game Object, based on the given name, and destroys them. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * + * @method Phaser.GameObjects.Components.PostPipeline#removePostPipeline + * @webglOnly + * @since 3.60.0 + * + * @param {string|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} pipeline - The string-based name of the pipeline, or a pipeline class. + * + * @return {this} This Game Object. + */ + removePostPipeline: function (pipeline) + { + var isString = (typeof pipeline === 'string'); + + var pipelines = this.postPipelines; + + for (var i = pipelines.length - 1; i >= 0; i--) + { + var instance = pipelines[i]; + + if ( + (isString && instance.name === pipeline) || + (!isString && instance === pipeline)) + { + instance.destroy(); + + SpliceOne(pipelines, i); + } + } + + this.hasPostPipeline = (this.postPipelines.length > 0); + + return this; + }, + + /** + * Removes all Pre and Post FX Controllers from this Game Object. + * + * If you wish to remove a single controller, use the `preFX.remove(fx)` or `postFX.remove(fx)` methods instead. + * + * If you wish to clear a single controller, use the `preFX.clear()` or `postFX.clear()` methods instead. + * + * @method Phaser.GameObjects.Components.PostPipeline#clearFX + * @webglOnly + * @since 3.60.0 + * + * @return {this} This Game Object. + */ + clearFX: function () + { + if (this.preFX) + { + this.preFX.clear(); + } + + if (this.postFX) + { + this.postFX.clear(); + } + + return this; + } + +}; + +module.exports = PostPipeline; + + +/***/ }), + +/***/ 4627: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the Scroll Factor of a Game Object. + * + * @namespace Phaser.GameObjects.Components.ScrollFactor + * @since 3.0.0 + */ + +var ScrollFactor = { + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scrollFactorX: 1, + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scrollFactorY: 1, + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor + * @since 3.0.0 + * + * @param {number} x - The horizontal scroll factor of this Game Object. + * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. + * + * @return {this} This Game Object instance. + */ + setScrollFactor: function (x, y) + { + if (y === undefined) { y = x; } + + this.scrollFactorX = x; + this.scrollFactorY = y; + + return this; + } + +}; + +module.exports = ScrollFactor; + + +/***/ }), + +/***/ 1868: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the size of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Size + * @since 3.0.0 + */ + +var Size = { + + /** + * A property indicating that a Game Object has this component. + * + * @name Phaser.GameObjects.Components.Size#_sizeComponent + * @type {boolean} + * @private + * @default true + * @since 3.2.0 + */ + _sizeComponent: true, + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + * + * @name Phaser.GameObjects.Components.Size#width + * @type {number} + * @since 3.0.0 + */ + width: 0, + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + * + * @name Phaser.GameObjects.Components.Size#height + * @type {number} + * @since 3.0.0 + */ + height: 0, + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.Size#displayWidth + * @type {number} + * @since 3.0.0 + */ + displayWidth: { + + get: function () + { + return Math.abs(this.scaleX * this.frame.realWidth); + }, + + set: function (value) + { + this.scaleX = value / this.frame.realWidth; + } + + }, + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.Size#displayHeight + * @type {number} + * @since 3.0.0 + */ + displayHeight: { + + get: function () + { + return Math.abs(this.scaleY * this.frame.realHeight); + }, + + set: function (value) + { + this.scaleY = value / this.frame.realHeight; + } + + }, + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Components.Size#setSizeToFrame + * @since 3.0.0 + * + * @param {Phaser.Textures.Frame|boolean} [frame] - The frame to base the size of this Game Object on. + * + * @return {this} This Game Object instance. + */ + setSizeToFrame: function (frame) + { + if (!frame) { frame = this.frame; } + + this.width = frame.realWidth; + this.height = frame.realHeight; + + var input = this.input; + + if (input && !input.customHitArea) + { + input.hitArea.width = this.width; + input.hitArea.height = this.height; + } + + return this; + }, + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Components.Size#setSize + * @since 3.0.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setSize: function (width, height) + { + this.width = width; + this.height = height; + + return this; + }, + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * + * @method Phaser.GameObjects.Components.Size#setDisplaySize + * @since 3.0.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDisplaySize: function (width, height) + { + this.displayWidth = width; + this.displayHeight = height; + + return this; + } + +}; + +module.exports = Size; + + +/***/ }), + +/***/ 4976: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Frame = __webpack_require__(2362); + +// bitmask flag for GameObject.renderMask +var _FLAG = 8; // 1000 + +/** + * Provides methods used for getting and setting the texture of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Texture + * @since 3.0.0 + */ + +var Texture = { + + /** + * The Texture this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Texture#texture + * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} + * @since 3.0.0 + */ + texture: null, + + /** + * The Texture Frame this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Texture#frame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + frame: null, + + /** + * Internal flag. Not to be set by this Game Object. + * + * @name Phaser.GameObjects.Components.Texture#isCropped + * @type {boolean} + * @private + * @since 3.11.0 + */ + isCropped: false, + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * @method Phaser.GameObjects.Components.Texture#setTexture + * @since 3.0.0 + * + * @param {(string|Phaser.Textures.Texture)} key - The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. + * + * @return {this} This Game Object instance. + */ + setTexture: function (key, frame) + { + this.texture = this.scene.sys.textures.get(key); + + return this.setFrame(frame); + }, + + /** + * Sets the frame this Game Object will use to render with. + * + * If you pass a string or index then the Frame has to belong to the current Texture being used + * by this Game Object. + * + * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * + * @method Phaser.GameObjects.Components.Texture#setFrame + * @since 3.0.0 + * + * @param {(string|number|Phaser.Textures.Frame)} frame - The name or index of the frame within the Texture, or a Frame instance. + * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? + * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? + * + * @return {this} This Game Object instance. + */ + setFrame: function (frame, updateSize, updateOrigin) + { + if (updateSize === undefined) { updateSize = true; } + if (updateOrigin === undefined) { updateOrigin = true; } + + if (frame instanceof Frame) + { + this.texture = this.scene.sys.textures.get(frame.texture.key); + + this.frame = frame; + } + else + { + this.frame = this.texture.get(frame); + } + + if (!this.frame.cutWidth || !this.frame.cutHeight) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + + if (this._sizeComponent && updateSize) + { + this.setSizeToFrame(); + } + + if (this._originComponent && updateOrigin) + { + if (this.frame.customPivot) + { + this.setOrigin(this.frame.pivotX, this.frame.pivotY); + } + else + { + this.updateDisplayOrigin(); + } + } + + return this; + } + +}; + +module.exports = Texture; + + +/***/ }), + +/***/ 9243: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Frame = __webpack_require__(2362); + +// bitmask flag for GameObject.renderMask +var _FLAG = 8; // 1000 + +/** + * Provides methods used for getting and setting the texture of a Game Object. + * + * @namespace Phaser.GameObjects.Components.TextureCrop + * @since 3.0.0 + */ + +var TextureCrop = { + + /** + * The Texture this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.TextureCrop#texture + * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} + * @since 3.0.0 + */ + texture: null, + + /** + * The Texture Frame this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.TextureCrop#frame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + frame: null, + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + * + * @name Phaser.GameObjects.Components.TextureCrop#isCropped + * @type {boolean} + * @since 3.11.0 + */ + isCropped: false, + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * + * @method Phaser.GameObjects.Components.TextureCrop#setCrop + * @since 3.11.0 + * + * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param {number} [y] - The y coordinate to start the crop from. + * @param {number} [width] - The width of the crop rectangle in pixels. + * @param {number} [height] - The height of the crop rectangle in pixels. + * + * @return {this} This Game Object instance. + */ + setCrop: function (x, y, width, height) + { + if (x === undefined) + { + this.isCropped = false; + } + else if (this.frame) + { + if (typeof x === 'number') + { + this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY); + } + else + { + var rect = x; + + this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY); + } + + this.isCropped = true; + } + + return this; + }, + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * @method Phaser.GameObjects.Components.TextureCrop#setTexture + * @since 3.0.0 + * + * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. + * + * @return {this} This Game Object instance. + */ + setTexture: function (key, frame) + { + this.texture = this.scene.sys.textures.get(key); + + return this.setFrame(frame); + }, + + /** + * Sets the frame this Game Object will use to render with. + * + * If you pass a string or index then the Frame has to belong to the current Texture being used + * by this Game Object. + * + * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * + * @method Phaser.GameObjects.Components.TextureCrop#setFrame + * @since 3.0.0 + * + * @param {(string|number|Phaser.Textures.Frame)} frame - The name or index of the frame within the Texture, or a Frame instance. + * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? + * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? + * + * @return {this} This Game Object instance. + */ + setFrame: function (frame, updateSize, updateOrigin) + { + if (updateSize === undefined) { updateSize = true; } + if (updateOrigin === undefined) { updateOrigin = true; } + + if (frame instanceof Frame) + { + this.texture = this.scene.sys.textures.get(frame.texture.key); + + this.frame = frame; + } + else + { + this.frame = this.texture.get(frame); + } + + if (!this.frame.cutWidth || !this.frame.cutHeight) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + + if (this._sizeComponent && updateSize) + { + this.setSizeToFrame(); + } + + if (this._originComponent && updateOrigin) + { + if (this.frame.customPivot) + { + this.setOrigin(this.frame.pivotX, this.frame.pivotY); + } + else + { + this.updateDisplayOrigin(); + } + } + + if (this.isCropped) + { + this.frame.updateCropUVs(this._crop, this.flipX, this.flipY); + } + + return this; + }, + + /** + * Internal method that returns a blank, well-formed crop object for use by a Game Object. + * + * @method Phaser.GameObjects.Components.TextureCrop#resetCropObject + * @private + * @since 3.12.0 + * + * @return {object} The crop object. + */ + resetCropObject: function () + { + return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 }; + } + +}; + +module.exports = TextureCrop; + + +/***/ }), + +/***/ 5693: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the tint of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Tint + * @webglOnly + * @since 3.0.0 + */ + +var Tint = { + + /** + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + * + * @name Phaser.GameObjects.Components.Tint#tintTopLeft + * @type {number} + * @default 0xffffff + * @since 3.0.0 + */ + tintTopLeft: 0xffffff, + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + * + * @name Phaser.GameObjects.Components.Tint#tintTopRight + * @type {number} + * @default 0xffffff + * @since 3.0.0 + */ + tintTopRight: 0xffffff, + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + * + * @name Phaser.GameObjects.Components.Tint#tintBottomLeft + * @type {number} + * @default 0xffffff + * @since 3.0.0 + */ + tintBottomLeft: 0xffffff, + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + * + * @name Phaser.GameObjects.Components.Tint#tintBottomRight + * @type {number} + * @default 0xffffff + * @since 3.0.0 + */ + tintBottomRight: 0xffffff, + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. + * + * @name Phaser.GameObjects.Components.Tint#tintFill + * @type {boolean} + * @default false + * @since 3.11.0 + */ + tintFill: false, + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + * + * @method Phaser.GameObjects.Components.Tint#clearTint + * @webglOnly + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + clearTint: function () + { + this.setTint(0xffffff); + + return this; + }, + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * + * @method Phaser.GameObjects.Components.Tint#setTint + * @webglOnly + * @since 3.0.0 + * + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. + * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * + * @return {this} This Game Object instance. + */ + setTint: function (topLeft, topRight, bottomLeft, bottomRight) + { + if (topLeft === undefined) { topLeft = 0xffffff; } + + if (topRight === undefined) + { + topRight = topLeft; + bottomLeft = topLeft; + bottomRight = topLeft; + } + + this.tintTopLeft = topLeft; + this.tintTopRight = topRight; + this.tintBottomLeft = bottomLeft; + this.tintBottomRight = bottomRight; + + this.tintFill = false; + + return this; + }, + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * + * @method Phaser.GameObjects.Components.Tint#setTintFill + * @webglOnly + * @since 3.11.0 + * + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. + * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * + * @return {this} This Game Object instance. + */ + setTintFill: function (topLeft, topRight, bottomLeft, bottomRight) + { + this.setTint(topLeft, topRight, bottomLeft, bottomRight); + + this.tintFill = true; + + return this; + }, + + /** + * The tint value being applied to the whole of the Game Object. + * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. + * + * @name Phaser.GameObjects.Components.Tint#tint + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + tint: { + + set: function (value) + { + this.setTint(value, value, value, value); + } + }, + + /** + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. + * + * @name Phaser.GameObjects.Components.Tint#isTinted + * @type {boolean} + * @webglOnly + * @readonly + * @since 3.11.0 + */ + isTinted: { + + get: function () + { + var white = 0xffffff; + + return ( + this.tintFill || + this.tintTopLeft !== white || + this.tintTopRight !== white || + this.tintBottomLeft !== white || + this.tintBottomRight !== white + ); + } + + } + +}; + +module.exports = Tint; + + +/***/ }), + +/***/ 6125: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Build a JSON representation of the given Game Object. + * + * This is typically extended further by Game Object specific implementations. + * + * @method Phaser.GameObjects.Components.ToJSON + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON. + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ +var ToJSON = function (gameObject) +{ + var out = { + name: gameObject.name, + type: gameObject.type, + x: gameObject.x, + y: gameObject.y, + depth: gameObject.depth, + scale: { + x: gameObject.scaleX, + y: gameObject.scaleY + }, + origin: { + x: gameObject.originX, + y: gameObject.originY + }, + flipX: gameObject.flipX, + flipY: gameObject.flipY, + rotation: gameObject.rotation, + alpha: gameObject.alpha, + visible: gameObject.visible, + blendMode: gameObject.blendMode, + textureKey: '', + frameKey: '', + data: {} + }; + + if (gameObject.texture) + { + out.textureKey = gameObject.texture.key; + out.frameKey = gameObject.frame.name; + } + + return out; +}; + +module.exports = ToJSON; + + +/***/ }), + +/***/ 3212: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(7425); +var TransformMatrix = __webpack_require__(4227); +var TransformXY = __webpack_require__(7556); +var WrapAngle = __webpack_require__(3692); +var WrapAngleDegrees = __webpack_require__(2820); +var Vector2 = __webpack_require__(2529); + +// global bitmask flag for GameObject.renderMask (used by Scale) +var _FLAG = 4; // 0100 + +/** + * Provides methods used for getting and setting the position, scale and rotation of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Transform + * @since 3.0.0 + */ + +var Transform = { + + /** + * A property indicating that a Game Object has this component. + * + * @name Phaser.GameObjects.Components.Transform#hasTransformComponent + * @type {boolean} + * @readonly + * @default true + * @since 3.60.0 + */ + hasTransformComponent: true, + + /** + * Private internal value. Holds the horizontal scale value. + * + * @name Phaser.GameObjects.Components.Transform#_scaleX + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _scaleX: 1, + + /** + * Private internal value. Holds the vertical scale value. + * + * @name Phaser.GameObjects.Components.Transform#_scaleY + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _scaleY: 1, + + /** + * Private internal value. Holds the rotation value in radians. + * + * @name Phaser.GameObjects.Components.Transform#_rotation + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + _rotation: 0, + + /** + * The x position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: 0, + + /** + * The y position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: 0, + + /** + * The z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#depth} instead. + * + * @name Phaser.GameObjects.Components.Transform#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: 0, + + /** + * The w position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: 0, + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + * + * @name Phaser.GameObjects.Components.Transform#scale + * @type {number} + * @default 1 + * @since 3.18.0 + */ + scale: { + + get: function () + { + return (this._scaleX + this._scaleY) / 2; + }, + + set: function (value) + { + this._scaleX = value; + this._scaleY = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The horizontal scale of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#scaleX + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scaleX: { + + get: function () + { + return this._scaleX; + }, + + set: function (value) + { + this._scaleX = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else if (this._scaleY !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The vertical scale of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#scaleY + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scaleY: { + + get: function () + { + return this._scaleY; + }, + + set: function (value) + { + this._scaleY = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else if (this._scaleX !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The angle of this Game Object as expressed in degrees. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left + * and -90 is up. + * + * If you prefer to work in radians, see the `rotation` property instead. + * + * @name Phaser.GameObjects.Components.Transform#angle + * @type {number} + * @default 0 + * @since 3.0.0 + */ + angle: { + + get: function () + { + return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG); + }, + + set: function (value) + { + // value is in degrees + this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD; + } + }, + + /** + * The angle of this Game Object in radians. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left + * and -PI/2 is up. + * + * If you prefer to work in degrees, see the `angle` property instead. + * + * @name Phaser.GameObjects.Components.Transform#rotation + * @type {number} + * @default 1 + * @since 3.0.0 + */ + rotation: { + + get: function () + { + return this._rotation; + }, + + set: function (value) + { + // value is in radians + this._rotation = WrapAngle(value); + } + }, + + /** + * Sets the position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setPosition + * @since 3.0.0 + * + * @param {number} [x=0] - The x position of this Game Object. + * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value. + * @param {number} [z=0] - The z position of this Game Object. + * @param {number} [w=0] - The w position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setPosition: function (x, y, z, w) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + if (z === undefined) { z = 0; } + if (w === undefined) { w = 0; } + + this.x = x; + this.y = y; + this.z = z; + this.w = w; + + return this; + }, + + /** + * Copies an object's coordinates to this Game Object's position. + * + * @method Phaser.GameObjects.Components.Transform#copyPosition + * @since 3.50.0 + * + * @param {(Phaser.Types.Math.Vector2Like|Phaser.Types.Math.Vector3Like|Phaser.Types.Math.Vector4Like)} source - An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + * + * @return {this} This Game Object instance. + */ + copyPosition: function (source) + { + if (source.x !== undefined) { this.x = source.x; } + if (source.y !== undefined) { this.y = source.y; } + if (source.z !== undefined) { this.z = source.z; } + if (source.w !== undefined) { this.w = source.w; } + + return this; + }, + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * + * @method Phaser.GameObjects.Components.Transform#setRandomPosition + * @since 3.8.0 + * + * @param {number} [x=0] - The x position of the top-left of the random area. + * @param {number} [y=0] - The y position of the top-left of the random area. + * @param {number} [width] - The width of the random area. + * @param {number} [height] - The height of the random area. + * + * @return {this} This Game Object instance. + */ + setRandomPosition: function (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.scene.sys.scale.width; } + if (height === undefined) { height = this.scene.sys.scale.height; } + + this.x = x + (Math.random() * width); + this.y = y + (Math.random() * height); + + return this; + }, + + /** + * Sets the rotation of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setRotation + * @since 3.0.0 + * + * @param {number} [radians=0] - The rotation of this Game Object, in radians. + * + * @return {this} This Game Object instance. + */ + setRotation: function (radians) + { + if (radians === undefined) { radians = 0; } + + this.rotation = radians; + + return this; + }, + + /** + * Sets the angle of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setAngle + * @since 3.0.0 + * + * @param {number} [degrees=0] - The rotation of this Game Object, in degrees. + * + * @return {this} This Game Object instance. + */ + setAngle: function (degrees) + { + if (degrees === undefined) { degrees = 0; } + + this.angle = degrees; + + return this; + }, + + /** + * Sets the scale of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setScale + * @since 3.0.0 + * + * @param {number} [x=1] - The horizontal scale of this Game Object. + * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value. + * + * @return {this} This Game Object instance. + */ + setScale: function (x, y) + { + if (x === undefined) { x = 1; } + if (y === undefined) { y = x; } + + this.scaleX = x; + this.scaleY = y; + + return this; + }, + + /** + * Sets the x position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setX + * @since 3.0.0 + * + * @param {number} [value=0] - The x position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setX: function (value) + { + if (value === undefined) { value = 0; } + + this.x = value; + + return this; + }, + + /** + * Sets the y position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setY + * @since 3.0.0 + * + * @param {number} [value=0] - The y position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setY: function (value) + { + if (value === undefined) { value = 0; } + + this.y = value; + + return this; + }, + + /** + * Sets the z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. + * + * @method Phaser.GameObjects.Components.Transform#setZ + * @since 3.0.0 + * + * @param {number} [value=0] - The z position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setZ: function (value) + { + if (value === undefined) { value = 0; } + + this.z = value; + + return this; + }, + + /** + * Sets the w position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setW + * @since 3.0.0 + * + * @param {number} [value=0] - The w position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setW: function (value) + { + if (value === undefined) { value = 0; } + + this.w = value; + + return this; + }, + + /** + * Gets the local transform matrix for this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix + * @since 3.4.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. + * + * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. + */ + getLocalTransformMatrix: function (tempMatrix) + { + if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } + + return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); + }, + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * + * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix + * @since 3.4.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations. + * + * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. + */ + getWorldTransformMatrix: function (tempMatrix, parentMatrix) + { + if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } + + var parent = this.parentContainer; + + if (!parent) + { + return this.getLocalTransformMatrix(tempMatrix); + } + + if (!parentMatrix) + { + parentMatrix = new TransformMatrix(); + } + + tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); + + while (parent) + { + parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY); + + parentMatrix.multiply(tempMatrix, tempMatrix); + + parent = parent.parentContainer; + } + + return tempMatrix; + }, + + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * + * @method Phaser.GameObjects.Components.Transform#getLocalPoint + * @since 3.50.0 + * + * @param {number} x - The x position to translate. + * @param {number} y - The y position to translate. + * @param {Phaser.Math.Vector2} [point] - A Vector2, or point-like object, to store the results in. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera which is being tested against. If not given will use the Scene default camera. + * + * @return {Phaser.Math.Vector2} The translated point. + */ + getLocalPoint: function (x, y, point, camera) + { + if (!point) { point = new Vector2(); } + if (!camera) { camera = this.scene.sys.cameras.main; } + + var csx = camera.scrollX; + var csy = camera.scrollY; + + var px = x + (csx * this.scrollFactorX) - csx; + var py = y + (csy * this.scrollFactorY) - csy; + + if (this.parentContainer) + { + this.getWorldTransformMatrix().applyInverse(px, py, point); + } + else + { + TransformXY(px, py, this.x, this.y, this.rotation, this.scaleX, this.scaleY, point); + } + + // Normalize origin + if (this._originComponent) + { + point.x += this._displayOriginX; + point.y += this._displayOriginY; + } + + return point; + }, + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + * + * @method Phaser.GameObjects.Components.Transform#getParentRotation + * @since 3.18.0 + * + * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object. + */ + getParentRotation: function () + { + var rotation = 0; + + var parent = this.parentContainer; + + while (parent) + { + rotation += parent.rotation; + + parent = parent.parentContainer; + } + + return rotation; + } + +}; + +module.exports = Transform; + + +/***/ }), + +/***/ 4227: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var MATH_CONST = __webpack_require__(7425); +var Vector2 = __webpack_require__(2529); + +/** + * @classdesc + * A Matrix used for display transformations for rendering. + * + * It is represented like so: + * + * ``` + * | a | c | tx | + * | b | d | ty | + * | 0 | 0 | 1 | + * ``` + * + * @class TransformMatrix + * @memberof Phaser.GameObjects.Components + * @constructor + * @since 3.0.0 + * + * @param {number} [a=1] - The Scale X value. + * @param {number} [b=0] - The Skew Y value. + * @param {number} [c=0] - The Skew X value. + * @param {number} [d=1] - The Scale Y value. + * @param {number} [tx=0] - The Translate X value. + * @param {number} [ty=0] - The Translate Y value. + */ +var TransformMatrix = new Class({ + + initialize: + + function TransformMatrix (a, b, c, d, tx, ty) + { + if (a === undefined) { a = 1; } + if (b === undefined) { b = 0; } + if (c === undefined) { c = 0; } + if (d === undefined) { d = 1; } + if (tx === undefined) { tx = 0; } + if (ty === undefined) { ty = 0; } + + /** + * The matrix values. + * + * @name Phaser.GameObjects.Components.TransformMatrix#matrix + * @type {Float32Array} + * @since 3.0.0 + */ + this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]); + + /** + * The decomposed matrix. + * + * @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix + * @type {object} + * @since 3.0.0 + */ + this.decomposedMatrix = { + translateX: 0, + translateY: 0, + scaleX: 1, + scaleY: 1, + rotation: 0 + }; + + /** + * The temporary quad value cache. + * + * @name Phaser.GameObjects.Components.TransformMatrix#quad + * @type {Float32Array} + * @since 3.60.0 + */ + this.quad = new Float32Array(8); + }, + + /** + * The Scale X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#a + * @type {number} + * @since 3.4.0 + */ + a: { + + get: function () + { + return this.matrix[0]; + }, + + set: function (value) + { + this.matrix[0] = value; + } + + }, + + /** + * The Skew Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#b + * @type {number} + * @since 3.4.0 + */ + b: { + + get: function () + { + return this.matrix[1]; + }, + + set: function (value) + { + this.matrix[1] = value; + } + + }, + + /** + * The Skew X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#c + * @type {number} + * @since 3.4.0 + */ + c: { + + get: function () + { + return this.matrix[2]; + }, + + set: function (value) + { + this.matrix[2] = value; + } + + }, + + /** + * The Scale Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#d + * @type {number} + * @since 3.4.0 + */ + d: { + + get: function () + { + return this.matrix[3]; + }, + + set: function (value) + { + this.matrix[3] = value; + } + + }, + + /** + * The Translate X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#e + * @type {number} + * @since 3.11.0 + */ + e: { + + get: function () + { + return this.matrix[4]; + }, + + set: function (value) + { + this.matrix[4] = value; + } + + }, + + /** + * The Translate Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#f + * @type {number} + * @since 3.11.0 + */ + f: { + + get: function () + { + return this.matrix[5]; + }, + + set: function (value) + { + this.matrix[5] = value; + } + + }, + + /** + * The Translate X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#tx + * @type {number} + * @since 3.4.0 + */ + tx: { + + get: function () + { + return this.matrix[4]; + }, + + set: function (value) + { + this.matrix[4] = value; + } + + }, + + /** + * The Translate Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#ty + * @type {number} + * @since 3.4.0 + */ + ty: { + + get: function () + { + return this.matrix[5]; + }, + + set: function (value) + { + this.matrix[5] = value; + } + + }, + + /** + * The rotation of the Matrix. Value is in radians. + * + * @name Phaser.GameObjects.Components.TransformMatrix#rotation + * @type {number} + * @readonly + * @since 3.4.0 + */ + rotation: { + + get: function () + { + return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1); + } + + }, + + /** + * The rotation of the Matrix, normalized to be within the Phaser right-handed + * clockwise rotation space. Value is in radians. + * + * @name Phaser.GameObjects.Components.TransformMatrix#rotationNormalized + * @type {number} + * @readonly + * @since 3.19.0 + */ + rotationNormalized: { + + get: function () + { + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + + if (a || b) + { + // var r = Math.sqrt(a * a + b * b); + + return (b > 0) ? Math.acos(a / this.scaleX) : -Math.acos(a / this.scaleX); + } + else if (c || d) + { + // var s = Math.sqrt(c * c + d * d); + + return MATH_CONST.TAU - ((d > 0) ? Math.acos(-c / this.scaleY) : -Math.acos(c / this.scaleY)); + } + else + { + return 0; + } + } + + }, + + /** + * The decomposed horizontal scale of the Matrix. This value is always positive. + * + * @name Phaser.GameObjects.Components.TransformMatrix#scaleX + * @type {number} + * @readonly + * @since 3.4.0 + */ + scaleX: { + + get: function () + { + return Math.sqrt((this.a * this.a) + (this.b * this.b)); + } + + }, + + /** + * The decomposed vertical scale of the Matrix. This value is always positive. + * + * @name Phaser.GameObjects.Components.TransformMatrix#scaleY + * @type {number} + * @readonly + * @since 3.4.0 + */ + scaleY: { + + get: function () + { + return Math.sqrt((this.c * this.c) + (this.d * this.d)); + } + + }, + + /** + * Reset the Matrix to an identity matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity + * @since 3.0.0 + * + * @return {this} This TransformMatrix. + */ + loadIdentity: function () + { + var matrix = this.matrix; + + matrix[0] = 1; + matrix[1] = 0; + matrix[2] = 0; + matrix[3] = 1; + matrix[4] = 0; + matrix[5] = 0; + + return this; + }, + + /** + * Translate the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#translate + * @since 3.0.0 + * + * @param {number} x - The horizontal translation value. + * @param {number} y - The vertical translation value. + * + * @return {this} This TransformMatrix. + */ + translate: function (x, y) + { + var matrix = this.matrix; + + matrix[4] = matrix[0] * x + matrix[2] * y + matrix[4]; + matrix[5] = matrix[1] * x + matrix[3] * y + matrix[5]; + + return this; + }, + + /** + * Scale the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#scale + * @since 3.0.0 + * + * @param {number} x - The horizontal scale value. + * @param {number} y - The vertical scale value. + * + * @return {this} This TransformMatrix. + */ + scale: function (x, y) + { + var matrix = this.matrix; + + matrix[0] *= x; + matrix[1] *= x; + matrix[2] *= y; + matrix[3] *= y; + + return this; + }, + + /** + * Rotate the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#rotate + * @since 3.0.0 + * + * @param {number} angle - The angle of rotation in radians. + * + * @return {this} This TransformMatrix. + */ + rotate: function (angle) + { + var sin = Math.sin(angle); + var cos = Math.cos(angle); + + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + + matrix[0] = a * cos + c * sin; + matrix[1] = b * cos + d * sin; + matrix[2] = a * -sin + c * cos; + matrix[3] = b * -sin + d * cos; + + return this; + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * If an `out` Matrix is given then the results will be stored in it. + * If it is not given, this matrix will be updated in place instead. + * Use an `out` Matrix if you do not wish to mutate this matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#multiply + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} rhs - The Matrix to multiply by. + * @param {Phaser.GameObjects.Components.TransformMatrix} [out] - An optional Matrix to store the results in. + * + * @return {(this|Phaser.GameObjects.Components.TransformMatrix)} Either this TransformMatrix, or the `out` Matrix, if given in the arguments. + */ + multiply: function (rhs, out) + { + var matrix = this.matrix; + var source = rhs.matrix; + + var localA = matrix[0]; + var localB = matrix[1]; + var localC = matrix[2]; + var localD = matrix[3]; + var localE = matrix[4]; + var localF = matrix[5]; + + var sourceA = source[0]; + var sourceB = source[1]; + var sourceC = source[2]; + var sourceD = source[3]; + var sourceE = source[4]; + var sourceF = source[5]; + + var destinationMatrix = (out === undefined) ? matrix : out.matrix; + + destinationMatrix[0] = (sourceA * localA) + (sourceB * localC); + destinationMatrix[1] = (sourceA * localB) + (sourceB * localD); + destinationMatrix[2] = (sourceC * localA) + (sourceD * localC); + destinationMatrix[3] = (sourceC * localB) + (sourceD * localD); + destinationMatrix[4] = (sourceE * localA) + (sourceF * localC) + localE; + destinationMatrix[5] = (sourceE * localB) + (sourceF * localD) + localF; + + return destinationMatrix; + }, + + /** + * Multiply this Matrix by the matrix given, including the offset. + * + * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`. + * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#multiplyWithOffset + * @since 3.11.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from. + * @param {number} offsetX - Horizontal offset to factor in to the multiplication. + * @param {number} offsetY - Vertical offset to factor in to the multiplication. + * + * @return {this} This TransformMatrix. + */ + multiplyWithOffset: function (src, offsetX, offsetY) + { + var matrix = this.matrix; + var otherMatrix = src.matrix; + + var a0 = matrix[0]; + var b0 = matrix[1]; + var c0 = matrix[2]; + var d0 = matrix[3]; + var tx0 = matrix[4]; + var ty0 = matrix[5]; + + var pse = offsetX * a0 + offsetY * c0 + tx0; + var psf = offsetX * b0 + offsetY * d0 + ty0; + + var a1 = otherMatrix[0]; + var b1 = otherMatrix[1]; + var c1 = otherMatrix[2]; + var d1 = otherMatrix[3]; + var tx1 = otherMatrix[4]; + var ty1 = otherMatrix[5]; + + matrix[0] = a1 * a0 + b1 * c0; + matrix[1] = a1 * b0 + b1 * d0; + matrix[2] = c1 * a0 + d1 * c0; + matrix[3] = c1 * b0 + d1 * d0; + matrix[4] = tx1 * a0 + ty1 * c0 + pse; + matrix[5] = tx1 * b0 + ty1 * d0 + psf; + + return this; + }, + + /** + * Transform the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#transform + * @since 3.0.0 + * + * @param {number} a - The Scale X value. + * @param {number} b - The Shear Y value. + * @param {number} c - The Shear X value. + * @param {number} d - The Scale Y value. + * @param {number} tx - The Translate X value. + * @param {number} ty - The Translate Y value. + * + * @return {this} This TransformMatrix. + */ + transform: function (a, b, c, d, tx, ty) + { + var matrix = this.matrix; + + var a0 = matrix[0]; + var b0 = matrix[1]; + var c0 = matrix[2]; + var d0 = matrix[3]; + var tx0 = matrix[4]; + var ty0 = matrix[5]; + + matrix[0] = a * a0 + b * c0; + matrix[1] = a * b0 + b * d0; + matrix[2] = c * a0 + d * c0; + matrix[3] = c * b0 + d * d0; + matrix[4] = tx * a0 + ty * c0 + tx0; + matrix[5] = tx * b0 + ty * d0 + ty0; + + return this; + }, + + /** + * Transform a point in to the local space of this Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint + * @since 3.0.0 + * + * @param {number} x - The x coordinate of the point to transform. + * @param {number} y - The y coordinate of the point to transform. + * @param {Phaser.Types.Math.Vector2Like} [point] - Optional Point object to store the transformed coordinates in. + * + * @return {Phaser.Types.Math.Vector2Like} The Point containing the transformed coordinates. + */ + transformPoint: function (x, y, point) + { + if (point === undefined) { point = { x: 0, y: 0 }; } + + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + var tx = matrix[4]; + var ty = matrix[5]; + + point.x = x * a + y * c + tx; + point.y = x * b + y * d + ty; + + return point; + }, + + /** + * Invert the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#invert + * @since 3.0.0 + * + * @return {this} This TransformMatrix. + */ + invert: function () + { + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + var tx = matrix[4]; + var ty = matrix[5]; + + var n = a * d - b * c; + + matrix[0] = d / n; + matrix[1] = -b / n; + matrix[2] = -c / n; + matrix[3] = a / n; + matrix[4] = (c * ty - d * tx) / n; + matrix[5] = -(a * ty - b * tx) / n; + + return this; + }, + + /** + * Set the values of this Matrix to copy those of the matrix given. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyFrom + * @since 3.11.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from. + * + * @return {this} This TransformMatrix. + */ + copyFrom: function (src) + { + var matrix = this.matrix; + + matrix[0] = src.a; + matrix[1] = src.b; + matrix[2] = src.c; + matrix[3] = src.d; + matrix[4] = src.e; + matrix[5] = src.f; + + return this; + }, + + /** + * Set the values of this Matrix to copy those of the array given. + * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyFromArray + * @since 3.11.0 + * + * @param {array} src - The array of values to set into this matrix. + * + * @return {this} This TransformMatrix. + */ + copyFromArray: function (src) + { + var matrix = this.matrix; + + matrix[0] = src[0]; + matrix[1] = src[1]; + matrix[2] = src[2]; + matrix[3] = src[3]; + matrix[4] = src[4]; + matrix[5] = src[5]; + + return this; + }, + + /** + * Copy the values from this Matrix to the given Canvas Rendering Context. + * This will use the Context.transform method. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyToContext + * @since 3.12.0 + * + * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to. + * + * @return {CanvasRenderingContext2D} The Canvas Rendering Context. + */ + copyToContext: function (ctx) + { + var matrix = this.matrix; + + ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); + + return ctx; + }, + + /** + * Copy the values from this Matrix to the given Canvas Rendering Context. + * This will use the Context.setTransform method. + * + * @method Phaser.GameObjects.Components.TransformMatrix#setToContext + * @since 3.12.0 + * + * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to. + * + * @return {CanvasRenderingContext2D} The Canvas Rendering Context. + */ + setToContext: function (ctx) + { + var matrix = this.matrix; + + ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); + + return ctx; + }, + + /** + * Copy the values in this Matrix to the array given. + * + * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray + * @since 3.12.0 + * + * @param {array} [out] - The array to copy the matrix values in to. + * + * @return {array} An array where elements 0 to 5 contain the values from this matrix. + */ + copyToArray: function (out) + { + var matrix = this.matrix; + + if (out === undefined) + { + out = [ matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] ]; + } + else + { + out[0] = matrix[0]; + out[1] = matrix[1]; + out[2] = matrix[2]; + out[3] = matrix[3]; + out[4] = matrix[4]; + out[5] = matrix[5]; + } + + return out; + }, + + /** + * Set the values of this Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#setTransform + * @since 3.0.0 + * + * @param {number} a - The Scale X value. + * @param {number} b - The Shear Y value. + * @param {number} c - The Shear X value. + * @param {number} d - The Scale Y value. + * @param {number} tx - The Translate X value. + * @param {number} ty - The Translate Y value. + * + * @return {this} This TransformMatrix. + */ + setTransform: function (a, b, c, d, tx, ty) + { + var matrix = this.matrix; + + matrix[0] = a; + matrix[1] = b; + matrix[2] = c; + matrix[3] = d; + matrix[4] = tx; + matrix[5] = ty; + + return this; + }, + + /** + * Decompose this Matrix into its translation, scale and rotation values using QR decomposition. + * + * The result must be applied in the following order to reproduce the current matrix: + * + * translate -> rotate -> scale + * + * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix + * @since 3.0.0 + * + * @return {Phaser.Types.GameObjects.DecomposeMatrixResults} The decomposed Matrix. + */ + decomposeMatrix: function () + { + var decomposedMatrix = this.decomposedMatrix; + + var matrix = this.matrix; + + // a = scale X (1) + // b = shear Y (0) + // c = shear X (0) + // d = scale Y (1) + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + + var determ = a * d - b * c; + + decomposedMatrix.translateX = matrix[4]; + decomposedMatrix.translateY = matrix[5]; + + if (a || b) + { + var r = Math.sqrt(a * a + b * b); + + decomposedMatrix.rotation = (b > 0) ? Math.acos(a / r) : -Math.acos(a / r); + decomposedMatrix.scaleX = r; + decomposedMatrix.scaleY = determ / r; + } + else if (c || d) + { + var s = Math.sqrt(c * c + d * d); + + decomposedMatrix.rotation = Math.PI * 0.5 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s)); + decomposedMatrix.scaleX = determ / s; + decomposedMatrix.scaleY = s; + } + else + { + decomposedMatrix.rotation = 0; + decomposedMatrix.scaleX = 0; + decomposedMatrix.scaleY = 0; + } + + return decomposedMatrix; + }, + + /** + * Apply the identity, translate, rotate and scale operations on the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#applyITRS + * @since 3.0.0 + * + * @param {number} x - The horizontal translation. + * @param {number} y - The vertical translation. + * @param {number} rotation - The angle of rotation in radians. + * @param {number} scaleX - The horizontal scale. + * @param {number} scaleY - The vertical scale. + * + * @return {this} This TransformMatrix. + */ + applyITRS: function (x, y, rotation, scaleX, scaleY) + { + var matrix = this.matrix; + + var radianSin = Math.sin(rotation); + var radianCos = Math.cos(rotation); + + // Translate + matrix[4] = x; + matrix[5] = y; + + // Rotate and Scale + matrix[0] = radianCos * scaleX; + matrix[1] = radianSin * scaleX; + matrix[2] = -radianSin * scaleY; + matrix[3] = radianCos * scaleY; + + return this; + }, + + /** + * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of + * the current matrix with its transformation applied. + * + * Can be used to translate points from world to local space. + * + * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse + * @since 3.12.0 + * + * @param {number} x - The x position to translate. + * @param {number} y - The y position to translate. + * @param {Phaser.Math.Vector2} [output] - A Vector2, or point-like object, to store the results in. + * + * @return {Phaser.Math.Vector2} The coordinates, inverse-transformed through this matrix. + */ + applyInverse: function (x, y, output) + { + if (output === undefined) { output = new Vector2(); } + + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + var tx = matrix[4]; + var ty = matrix[5]; + + var id = 1 / ((a * d) + (c * -b)); + + output.x = (d * id * x) + (-c * id * y) + (((ty * c) - (tx * d)) * id); + output.y = (a * id * y) + (-b * id * x) + (((-ty * a) + (tx * b)) * id); + + return output; + }, + + /** + * Performs the 8 calculations required to create the vertices of + * a quad based on this matrix and the given x/y/xw/yh values. + * + * The result is stored in `TransformMatrix.quad`, which is returned + * from this method. + * + * @method Phaser.GameObjects.Components.TransformMatrix#setQuad + * @since 3.60.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {number} xw - The xw value. + * @param {number} yh - The yh value. + * @param {boolean} roundPixels - Pass the results via Math.round? + * @param {Float32Array} [quad] - Optional Float32Array to store the results in. Otherwises uses the local quad array. + * + * @return {Float32Array} The quad Float32Array. + */ + setQuad: function (x, y, xw, yh, roundPixels, quad) + { + if (quad === undefined) { quad = this.quad; } + + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + var e = matrix[4]; + var f = matrix[5]; + + quad[0] = x * a + y * c + e; + quad[1] = x * b + y * d + f; + + quad[2] = x * a + yh * c + e; + quad[3] = x * b + yh * d + f; + + quad[4] = xw * a + yh * c + e; + quad[5] = xw * b + yh * d + f; + + quad[6] = xw * a + y * c + e; + quad[7] = xw * b + y * d + f; + + if (roundPixels) + { + quad.forEach(function (value, index) + { + quad[index] = Math.round(value); + }); + } + + return quad; + }, + + /** + * Returns the X component of this matrix multiplied by the given values. + * This is the same as `x * a + y * c + e`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getX + * @since 3.12.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * + * @return {number} The calculated x value. + */ + getX: function (x, y) + { + return x * this.a + y * this.c + this.e; + }, + + /** + * Returns the Y component of this matrix multiplied by the given values. + * This is the same as `x * b + y * d + f`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getY + * @since 3.12.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * + * @return {number} The calculated y value. + */ + getY: function (x, y) + { + return x * this.b + y * this.d + this.f; + }, + + /** + * Returns the X component of this matrix multiplied by the given values. + * + * This is the same as `x * a + y * c + e`, optionally passing via `Math.round`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getXRound + * @since 3.50.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {boolean} [round=false] - Math.round the resulting value? + * + * @return {number} The calculated x value. + */ + getXRound: function (x, y, round) + { + var v = this.getX(x, y); + + if (round) + { + v = Math.round(v); + } + + return v; + }, + + /** + * Returns the Y component of this matrix multiplied by the given values. + * + * This is the same as `x * b + y * d + f`, optionally passing via `Math.round`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getYRound + * @since 3.50.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {boolean} [round=false] - Math.round the resulting value? + * + * @return {number} The calculated y value. + */ + getYRound: function (x, y, round) + { + var v = this.getY(x, y); + + if (round) + { + v = Math.round(v); + } + + return v; + }, + + /** + * Returns a string that can be used in a CSS Transform call as a `matrix` property. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix + * @since 3.12.0 + * + * @return {string} A string containing the CSS Transform matrix values. + */ + getCSSMatrix: function () + { + var m = this.matrix; + + return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')'; + }, + + /** + * Destroys this Transform Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#destroy + * @since 3.4.0 + */ + destroy: function () + { + this.matrix = null; + this.quad = null; + this.decomposedMatrix = null; + } + +}); + +module.exports = TransformMatrix; + + +/***/ }), + +/***/ 8414: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// bitmask flag for GameObject.renderMask +var _FLAG = 1; // 0001 + +/** + * Provides methods used for setting the visibility of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Visible + * @since 3.0.0 + */ + +var Visible = { + + /** + * Private internal value. Holds the visible value. + * + * @name Phaser.GameObjects.Components.Visible#_visible + * @type {boolean} + * @private + * @default true + * @since 3.0.0 + */ + _visible: true, + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * + * @name Phaser.GameObjects.Components.Visible#visible + * @type {boolean} + * @since 3.0.0 + */ + visible: { + + get: function () + { + return this._visible; + }, + + set: function (value) + { + if (value) + { + this._visible = true; + this.renderFlags |= _FLAG; + } + else + { + this._visible = false; + this.renderFlags &= ~_FLAG; + } + } + + }, + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * + * @method Phaser.GameObjects.Components.Visible#setVisible + * @since 3.0.0 + * + * @param {boolean} value - The visible state of the Game Object. + * + * @return {this} This Game Object instance. + */ + setVisible: function (value) + { + this.visible = value; + + return this; + } +}; + +module.exports = Visible; + + +/***/ }), + +/***/ 4286: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Components + */ + +module.exports = { + + Alpha: __webpack_require__(4344), + AlphaSingle: __webpack_require__(4518), + BlendMode: __webpack_require__(5173), + ComputedSize: __webpack_require__(1991), + Crop: __webpack_require__(8305), + Depth: __webpack_require__(3131), + Flip: __webpack_require__(9660), + FX: __webpack_require__(1626), + GetBounds: __webpack_require__(3671), + Mask: __webpack_require__(2246), + Origin: __webpack_require__(5085), + PathFollower: __webpack_require__(77), + Pipeline: __webpack_require__(986), + PostPipeline: __webpack_require__(4461), + ScrollFactor: __webpack_require__(4627), + Size: __webpack_require__(1868), + Texture: __webpack_require__(4976), + TextureCrop: __webpack_require__(9243), + Tint: __webpack_require__(5693), + ToJSON: __webpack_require__(6125), + Transform: __webpack_require__(3212), + TransformMatrix: __webpack_require__(4227), + Visible: __webpack_require__(8414) + +}; + + +/***/ }), + +/***/ 7361: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -36697,16 +27410,16 @@ module.exports = SpineContainer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(258); -var BlendModes = __webpack_require__(12); -var Class = __webpack_require__(0); -var Components = __webpack_require__(309); -var Events = __webpack_require__(60); -var GameObject = __webpack_require__(58); -var Rectangle = __webpack_require__(28); -var Render = __webpack_require__(339); -var Union = __webpack_require__(341); -var Vector2 = __webpack_require__(2); +var ArrayUtils = __webpack_require__(1953); +var BlendModes = __webpack_require__(8351); +var Class = __webpack_require__(7473); +var Components = __webpack_require__(4286); +var Events = __webpack_require__(3389); +var GameObject = __webpack_require__(2273); +var Rectangle = __webpack_require__(1392); +var Render = __webpack_require__(3232); +var Union = __webpack_require__(9422); +var Vector2 = __webpack_require__(2529); /** * @classdesc @@ -36762,7 +27475,7 @@ var Vector2 = __webpack_require__(2); * @extends Phaser.GameObjects.Components.ComputedSize * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Mask - * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.PostPipeline * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible * @@ -36781,7 +27494,7 @@ var Container = new Class({ Components.ComputedSize, Components.Depth, Components.Mask, - Components.Pipeline, + Components.PostPipeline, Components.Transform, Components.Visible, Render @@ -36936,12 +27649,10 @@ var Container = new Class({ */ this.scrollFactorY = 1; - this.initPipeline(); + this.initPostPipeline(); this.setPosition(x, y); - this.clearAlpha(); - this.setBlendMode(BlendModes.SKIP_CHECK); if (children) @@ -38154,65 +28865,150 @@ module.exports = Container; /***/ }), -/* 258 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 2840: +/***/ ((module) => { /** * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> * @copyright 2013-2023 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * @namespace Phaser.Utils.Array + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Container#renderCanvas + * @since 3.4.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ +var ContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) +{ + camera.addToRenderList(container); + + var children = container.list; + + if (children.length === 0) + { + return; + } + + var transformMatrix = container.localTransform; + + if (parentMatrix) + { + transformMatrix.loadIdentity(); + transformMatrix.multiply(parentMatrix); + transformMatrix.translate(container.x, container.y); + transformMatrix.rotate(container.rotation); + transformMatrix.scale(container.scaleX, container.scaleY); + } + else + { + transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); + } + + var containerHasBlendMode = (container.blendMode !== -1); + + if (!containerHasBlendMode) + { + // If Container is SKIP_TEST then set blend mode to be Normal + renderer.setBlendMode(0); + } + + var alpha = container._alpha; + var scrollFactorX = container.scrollFactorX; + var scrollFactorY = container.scrollFactorY; + + if (container.mask) + { + container.mask.preRenderCanvas(renderer, null, camera); + } + + for (var i = 0; i < children.length; i++) + { + var child = children[i]; + + if (!child.willRender(camera)) + { + continue; + } + + var childAlpha = child.alpha; + var childScrollFactorX = child.scrollFactorX; + var childScrollFactorY = child.scrollFactorY; + + if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode) + { + // If Container doesn't have its own blend mode, then a child can have one + renderer.setBlendMode(child.blendMode); + } + + // Set parent values + child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); + child.setAlpha(childAlpha * alpha); + + // Render + child.renderCanvas(renderer, child, camera, transformMatrix); + + // Restore original values + child.setAlpha(childAlpha); + child.setScrollFactor(childScrollFactorX, childScrollFactorY); + } + + if (container.mask) + { + container.mask.postRenderCanvas(renderer); + } +}; + +module.exports = ContainerCanvasRenderer; + + +/***/ }), + +/***/ 3232: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var NOOP = __webpack_require__(1984); +var renderWebGL = NOOP; +var renderCanvas = NOOP; + +if (false) +{} + +if (true) +{ + renderCanvas = __webpack_require__(2840); +} module.exports = { - Matrix: __webpack_require__(259), - - Add: __webpack_require__(268), - AddAt: __webpack_require__(269), - BringToTop: __webpack_require__(270), - CountAllMatching: __webpack_require__(271), - Each: __webpack_require__(272), - EachInRange: __webpack_require__(273), - FindClosestInSorted: __webpack_require__(274), - Flatten: __webpack_require__(275), - GetAll: __webpack_require__(276), - GetFirst: __webpack_require__(277), - GetRandom: __webpack_require__(278), - MoveDown: __webpack_require__(279), - MoveTo: __webpack_require__(280), - MoveUp: __webpack_require__(281), - MoveAbove: __webpack_require__(282), - MoveBelow: __webpack_require__(283), - NumberArray: __webpack_require__(284), - NumberArrayStep: __webpack_require__(285), - QuickSelect: __webpack_require__(286), - Range: __webpack_require__(287), - Remove: __webpack_require__(288), - RemoveAt: __webpack_require__(289), - RemoveBetween: __webpack_require__(290), - RemoveRandomElement: __webpack_require__(291), - Replace: __webpack_require__(292), - RotateLeft: __webpack_require__(62), - RotateRight: __webpack_require__(63), - SafeRange: __webpack_require__(5), - SendToBack: __webpack_require__(293), - SetAll: __webpack_require__(294), - Shuffle: __webpack_require__(64), - SortByDigits: __webpack_require__(295), - SpliceOne: __webpack_require__(10), - StableSort: __webpack_require__(296), - Swap: __webpack_require__(308) + renderWebGL: renderWebGL, + renderCanvas: renderCanvas }; /***/ }), -/* 259 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 6608: +/***/ ((module) => { /** * @author Richard Davey @@ -38221,524 +29017,26 @@ module.exports = { */ /** - * @namespace Phaser.Utils.Array.Matrix - */ - -module.exports = { - - CheckMatrix: __webpack_require__(26), - MatrixToString: __webpack_require__(260), - ReverseColumns: __webpack_require__(262), - ReverseRows: __webpack_require__(263), - Rotate180: __webpack_require__(264), - RotateLeft: __webpack_require__(265), - RotateMatrix: __webpack_require__(15), - RotateRight: __webpack_require__(266), - Translate: __webpack_require__(267), - TransposeMatrix: __webpack_require__(61) - -}; - - -/***/ }), -/* 260 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Pad = __webpack_require__(261); -var CheckMatrix = __webpack_require__(26); - -/** - * Generates a string (which you can pass to console.log) from the given Array Matrix. + * The Game Object Added to Scene Event. * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: + * This event is dispatched when a Game Object is added to a Scene. * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` + * Listen for it on a Game Object instance using `GameObject.on('addedtoscene', listener)`. * - * @function Phaser.Utils.Array.Matrix.MatrixToString - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix] - * - * @param {T[][]} [matrix] - A 2-dimensional array. - * - * @return {string} A string representing the matrix. - */ -var MatrixToString = function (matrix) -{ - var str = ''; - - if (!CheckMatrix(matrix)) - { - return str; - } - - for (var r = 0; r < matrix.length; r++) - { - for (var c = 0; c < matrix[r].length; c++) - { - var cell = matrix[r][c].toString(); - - if (cell !== 'undefined') - { - str += Pad(cell, 2); - } - else - { - str += '?'; - } - - if (c < matrix[r].length - 1) - { - str += ' |'; - } - } - - if (r < matrix.length - 1) - { - str += '\n'; - - for (var i = 0; i < matrix[r].length; i++) - { - str += '---'; - - if (i < matrix[r].length - 1) - { - str += '+'; - } - } - - str += '\n'; - } - - } - - return str; -}; - -module.exports = MatrixToString; - - -/***/ }), -/* 261 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Takes the given string and pads it out, to the length required, using the character - * specified. For example if you need a string to be 6 characters long, you can call: - * - * `pad('bob', 6, '-', 2)` - * - * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right. - * - * You can also use it to pad numbers (they are always returned as strings): - * - * `pad(512, 6, '0', 1)` - * - * Would return: `000512` with the string padded to the left. - * - * If you don't specify a direction it'll pad to both sides: - * - * `pad('c64', 7, '*')` - * - * Would return: `**c64**` - * - * @function Phaser.Utils.String.Pad - * @since 3.0.0 - * - * @param {string|number|object} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. - * @param {number} [len=0] - The number of characters to be added. - * @param {string} [pad=" "] - The string to pad it out with (defaults to a space). - * @param {number} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). - * - * @return {string} The padded string. - */ -var Pad = function (str, len, pad, dir) -{ - if (len === undefined) { len = 0; } - if (pad === undefined) { pad = ' '; } - if (dir === undefined) { dir = 3; } - - str = str.toString(); - - var padlen = 0; - - if (len + 1 >= str.length) - { - switch (dir) - { - case 1: - str = new Array(len + 1 - str.length).join(pad) + str; - break; - - case 3: - var right = Math.ceil((padlen = len - str.length) / 2); - var left = padlen - right; - str = new Array(left + 1).join(pad) + str + new Array(right + 1).join(pad); - break; - - default: - str = str + new Array(len + 1 - str.length).join(pad); - break; - } - } - - return str; -}; - -module.exports = Pad; - - -/***/ }), -/* 262 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Reverses the columns in the given Array Matrix. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.ReverseColumns - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array matrix to reverse the columns for. - * - * @return {T[][]} The column reversed matrix. - */ -var ReverseColumns = function (matrix) -{ - return matrix.reverse(); -}; - -module.exports = ReverseColumns; - - -/***/ }), -/* 263 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Reverses the rows in the given Array Matrix. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.ReverseRows - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array matrix to reverse the rows for. - * - * @return {T[][]} The column reversed matrix. - */ -var ReverseRows = function (matrix) -{ - for (var i = 0; i < matrix.length; i++) - { - matrix[i].reverse(); - } - - return matrix; -}; - -module.exports = ReverseRows; - - -/***/ }), -/* 264 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var RotateMatrix = __webpack_require__(15); - -/** - * Rotates the array matrix 180 degrees. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.Rotate180 - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array to rotate. - * - * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. - */ -var Rotate180 = function (matrix) -{ - return RotateMatrix(matrix, 180); -}; - -module.exports = Rotate180; - - -/***/ }), -/* 265 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var RotateMatrix = __webpack_require__(15); - -/** - * Rotates the array matrix to the left (or 90 degrees) - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.RotateLeft - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array to rotate. - * - * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. - */ -var RotateLeft = function (matrix) -{ - return RotateMatrix(matrix, 90); -}; - -module.exports = RotateLeft; - - -/***/ }), -/* 266 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var RotateMatrix = __webpack_require__(15); - -/** - * Rotates the array matrix to the left (or -90 degrees) - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.RotateRight - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array to rotate. - * - * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. - */ -var RotateRight = function (matrix) -{ - return RotateMatrix(matrix, -90); -}; - -module.exports = RotateRight; - - -/***/ }), -/* 267 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var RotateLeft = __webpack_require__(62); -var RotateRight = __webpack_require__(63); - -/** - * Translates the given Array Matrix by shifting each column and row the - * amount specified. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.Translate + * @event Phaser.GameObjects.Events#ADDED_TO_SCENE + * @type {string} * @since 3.50.0 * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array matrix to translate. - * @param {number} [x=0] - The amount to horizontally translate the matrix by. - * @param {number} [y=0] - The amount to vertically translate the matrix by. - * - * @return {T[][]} The translated matrix. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene. + * @param {Phaser.Scene} scene - The Scene to which the Game Object was added. */ -var TranslateMatrix = function (matrix, x, y) -{ - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - - // Vertical translation - - if (y !== 0) - { - if (y < 0) - { - // Shift Up - RotateLeft(matrix, Math.abs(y)); - } - else - { - // Shift Down - RotateRight(matrix, y); - } - } - - // Horizontal translation - - if (x !== 0) - { - for (var i = 0; i < matrix.length; i++) - { - var row = matrix[i]; - - if (x < 0) - { - RotateLeft(row, Math.abs(x)); - } - else - { - RotateRight(row, x); - } - } - } - - return matrix; -}; - -module.exports = TranslateMatrix; +module.exports = 'addedtoscene'; /***/ }), -/* 268 */ -/***/ (function(module, exports) { + +/***/ 4265: +/***/ ((module) => { /** * @author Richard Davey @@ -38747,513 +29045,26 @@ module.exports = TranslateMatrix; */ /** - * Adds the given item, or array of items, to the array. + * The Game Object Destroy Event. * - * Each item must be unique within the array. + * This event is dispatched when a Game Object instance is being destroyed. * - * The array is modified in-place and returned. + * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`. * - * You can optionally specify a limit to the maximum size of the array. If the quantity of items being - * added will take the array length over this limit, it will stop adding once the limit is reached. - * - * You can optionally specify a callback to be invoked for each item successfully added to the array. - * - * @function Phaser.Utils.Array.Add - * @since 3.4.0 - * - * @param {array} array - The array to be added to. - * @param {any|any[]} item - The item, or array of items, to add to the array. Each item must be unique within the array. - * @param {number} [limit] - Optional limit which caps the size of the array. - * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {array} The input array. - */ -var Add = function (array, item, limit, callback, context) -{ - if (context === undefined) { context = array; } - - if (limit > 0) - { - var remaining = limit - array.length; - - // There's nothing more we can do here, the array is full - if (remaining <= 0) - { - return null; - } - } - - // Fast path to avoid array mutation and iteration - if (!Array.isArray(item)) - { - if (array.indexOf(item) === -1) - { - array.push(item); - - if (callback) - { - callback.call(context, item); - } - - return item; - } - else - { - return null; - } - } - - // If we got this far, we have an array of items to insert - - // Ensure all the items are unique - var itemLength = item.length - 1; - - while (itemLength >= 0) - { - if (array.indexOf(item[itemLength]) !== -1) - { - // Already exists in array, so remove it - item.splice(itemLength, 1); - } - - itemLength--; - } - - // Anything left? - itemLength = item.length; - - if (itemLength === 0) - { - return null; - } - - if (limit > 0 && itemLength > remaining) - { - item.splice(remaining); - - itemLength = remaining; - } - - for (var i = 0; i < itemLength; i++) - { - var entry = item[i]; - - array.push(entry); - - if (callback) - { - callback.call(context, entry); - } - } - - return item; -}; - -module.exports = Add; - - -/***/ }), -/* 269 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Adds the given item, or array of items, to the array starting at the index specified. - * - * Each item must be unique within the array. - * - * Existing elements in the array are shifted up. - * - * The array is modified in-place and returned. - * - * You can optionally specify a limit to the maximum size of the array. If the quantity of items being - * added will take the array length over this limit, it will stop adding once the limit is reached. - * - * You can optionally specify a callback to be invoked for each item successfully added to the array. - * - * @function Phaser.Utils.Array.AddAt - * @since 3.4.0 - * - * @param {array} array - The array to be added to. - * @param {any|any[]} item - The item, or array of items, to add to the array. - * @param {number} [index=0] - The index in the array where the item will be inserted. - * @param {number} [limit] - Optional limit which caps the size of the array. - * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {array} The input array. - */ -var AddAt = function (array, item, index, limit, callback, context) -{ - if (index === undefined) { index = 0; } - if (context === undefined) { context = array; } - - if (limit > 0) - { - var remaining = limit - array.length; - - // There's nothing more we can do here, the array is full - if (remaining <= 0) - { - return null; - } - } - - // Fast path to avoid array mutation and iteration - if (!Array.isArray(item)) - { - if (array.indexOf(item) === -1) - { - array.splice(index, 0, item); - - if (callback) - { - callback.call(context, item); - } - - return item; - } - else - { - return null; - } - } - - // If we got this far, we have an array of items to insert - - // Ensure all the items are unique - var itemLength = item.length - 1; - - while (itemLength >= 0) - { - if (array.indexOf(item[itemLength]) !== -1) - { - // Already exists in array, so remove it - item.pop(); - } - - itemLength--; - } - - // Anything left? - itemLength = item.length; - - if (itemLength === 0) - { - return null; - } - - // Truncate to the limit - if (limit > 0 && itemLength > remaining) - { - item.splice(remaining); - - itemLength = remaining; - } - - for (var i = itemLength - 1; i >= 0; i--) - { - var entry = item[i]; - - array.splice(index, 0, entry); - - if (callback) - { - callback.call(context, entry); - } - } - - return item; -}; - -module.exports = AddAt; - - -/***/ }), -/* 270 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given element to the top of the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.BringToTop - * @since 3.4.0 - * - * @param {array} array - The array. - * @param {*} item - The element to move. - * - * @return {*} The element that was moved. - */ -var BringToTop = function (array, item) -{ - var currentIndex = array.indexOf(item); - - if (currentIndex !== -1 && currentIndex < array.length) - { - array.splice(currentIndex, 1); - array.push(item); - } - - return item; -}; - -module.exports = BringToTop; - - -/***/ }), -/* 271 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Returns the total number of elements in the array which have a property matching the given value. - * - * @function Phaser.Utils.Array.CountAllMatching - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {string} property - The property to test on each array element. - * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {number} [startIndex] - An optional start index to search from. - * @param {number} [endIndex] - An optional end index to search to. - * - * @return {number} The total number of elements with properties matching the given value. - */ -var CountAllMatching = function (array, property, value, startIndex, endIndex) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - - var total = 0; - - if (SafeRange(array, startIndex, endIndex)) - { - for (var i = startIndex; i < endIndex; i++) - { - var child = array[i]; - - if (child[property] === value) - { - total++; - } - } - } - - return total; -}; - -module.exports = CountAllMatching; - - -/***/ }), -/* 272 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Passes each element in the array to the given callback. - * - * @function Phaser.Utils.Array.Each - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {function} callback - A callback to be invoked for each item in the array. - * @param {object} context - The context in which the callback is invoked. - * @param {...*} [args] - Additional arguments that will be passed to the callback, after the current array item. - * - * @return {array} The input array. - */ -var Each = function (array, callback, context) -{ - var i; - var args = [ null ]; - - for (i = 3; i < arguments.length; i++) - { - args.push(arguments[i]); - } - - for (i = 0; i < array.length; i++) - { - args[0] = array[i]; - - callback.apply(context, args); - } - - return array; -}; - -module.exports = Each; - - -/***/ }), -/* 273 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Passes each element in the array, between the start and end indexes, to the given callback. - * - * @function Phaser.Utils.Array.EachInRange - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {function} callback - A callback to be invoked for each item in the array. - * @param {object} context - The context in which the callback is invoked. - * @param {number} startIndex - The start index to search from. - * @param {number} endIndex - The end index to search to. - * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. - * - * @return {array} The input array. - */ -var EachInRange = function (array, callback, context, startIndex, endIndex) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - - if (SafeRange(array, startIndex, endIndex)) - { - var i; - var args = [ null ]; - - for (i = 5; i < arguments.length; i++) - { - args.push(arguments[i]); - } - - for (i = startIndex; i < endIndex; i++) - { - args[0] = array[i]; - - callback.apply(context, args); - } - } - - return array; -}; - -module.exports = EachInRange; - - -/***/ }), -/* 274 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Searches a pre-sorted array for the closet value to the given number. - * - * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, - * and will check for the closest value of those to the given number. - * - * @function Phaser.Utils.Array.FindClosestInSorted + * @event Phaser.GameObjects.Events#DESTROY + * @type {string} * @since 3.0.0 * - * @param {number} value - The value to search for in the array. - * @param {array} array - The array to search, which must be sorted. - * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. - * - * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed. + * @param {boolean} fromScene - `True` if this Game Object is being destroyed by the Scene, `false` if not. */ -var FindClosestInSorted = function (value, array, key) -{ - if (!array.length) - { - return NaN; - } - else if (array.length === 1) - { - return array[0]; - } - - var i = 1; - var low; - var high; - - if (key) - { - if (value < array[0][key]) - { - return array[0]; - } - - while (array[i][key] < value) - { - i++; - } - } - else - { - while (array[i] < value) - { - i++; - } - } - - if (i > array.length) - { - i = array.length; - } - - if (key) - { - low = array[i - 1][key]; - high = array[i][key]; - - return ((high - value) <= (value - low)) ? array[i] : array[i - 1]; - } - else - { - low = array[i - 1]; - high = array[i]; - - return ((high - value) <= (value - low)) ? high : low; - } -}; - -module.exports = FindClosestInSorted; +module.exports = 'destroy'; /***/ }), -/* 275 */ -/***/ (function(module, exports) { + +/***/ 8671: +/***/ ((module) => { /** * @author Richard Davey @@ -39262,162 +29073,151 @@ module.exports = FindClosestInSorted; */ /** - * Takes an array and flattens it, returning a shallow-copy flattened array. + * The Game Object Removed from Scene Event. * - * @function Phaser.Utils.Array.Flatten + * This event is dispatched when a Game Object is removed from a Scene. + * + * Listen for it on a Game Object instance using `GameObject.on('removedfromscene', listener)`. + * + * @event Phaser.GameObjects.Events#REMOVED_FROM_SCENE + * @type {string} + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene. + * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed. + */ +module.exports = 'removedfromscene'; + + +/***/ }), + +/***/ 3420: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Complete Event. + * + * This event is dispatched when a Video finishes playback by reaching the end of its duration. It + * is also dispatched if a video marker sequence is being played and reaches the end. + * + * Note that not all videos can fire this event. Live streams, for example, have no fixed duration, + * so never technically 'complete'. + * + * If a video is stopped from playback, via the `Video.stop` method, it will emit the + * `VIDEO_STOP` event instead of this one. + * + * Listen for it from a Video Game Object instance using `Video.on('complete', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_COMPLETE + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed playback. + */ +module.exports = 'complete'; + + +/***/ }), + +/***/ 601: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Created Event. + * + * This event is dispatched when the texture for a Video has been created. This happens + * when enough of the video source has been loaded that the browser is able to render a + * frame from it. + * + * Listen for it from a Video Game Object instance using `Video.on('created', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_CREATED + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. + * @param {number} width - The width of the video. + * @param {number} height - The height of the video. + */ +module.exports = 'created'; + + +/***/ }), + +/***/ 7919: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Error Event. + * + * This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type. + * + * Listen for it from a Video Game Object instance using `Video.on('error', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_ERROR + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. + * @param {DOMException|string} event - The native DOM event the browser raised during playback. + */ +module.exports = 'error'; + + +/***/ }), + +/***/ 6231: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Locked Event. + * + * This event is dispatched when a Video was attempted to be played, but the browser prevented it + * from doing so due to the Media Engagement Interaction policy. + * + * If you get this event you will need to wait for the user to interact with the browser before + * the video will play. This is a browser security measure to prevent autoplaying videos with + * audio. An interaction includes a mouse click, a touch, or a key press. + * + * Listen for it from a Video Game Object instance using `Video.on('locked', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_LOCKED + * @type {string} * @since 3.60.0 * - * @param {array} array - The array to flatten. - * @param {array} [output] - An array to hold the results in. - * - * @return {array} The flattened output array. + * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. */ -var Flatten = function (array, output) -{ - if (output === undefined) { output = []; } - - for (var i = 0; i < array.length; i++) - { - if (Array.isArray(array[i])) - { - Flatten(array[i], output); - } - else - { - output.push(array[i]); - } - } - - return output; -}; - -module.exports = Flatten; +module.exports = 'locked'; /***/ }), -/* 276 */ -/***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Returns all elements in the array. - * - * You can optionally specify a matching criteria using the `property` and `value` arguments. - * - * For example: `getAll('visible', true)` would return only elements that have their visible property set. - * - * Optionally you can specify a start and end index. For example if the array had 100 elements, - * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only - * the first 50 elements. - * - * @function Phaser.Utils.Array.GetAll - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {string} [property] - The property to test on each array element. - * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {number} [startIndex] - An optional start index to search from. - * @param {number} [endIndex] - An optional end index to search to. - * - * @return {array} All matching elements from the array. - */ -var GetAll = function (array, property, value, startIndex, endIndex) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - - var output = []; - - if (SafeRange(array, startIndex, endIndex)) - { - for (var i = startIndex; i < endIndex; i++) - { - var child = array[i]; - - if (!property || - (property && value === undefined && child.hasOwnProperty(property)) || - (property && value !== undefined && child[property] === value)) - { - output.push(child); - } - } - } - - return output; -}; - -module.exports = GetAll; - - -/***/ }), -/* 277 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Returns the first element in the array. - * - * You can optionally specify a matching criteria using the `property` and `value` arguments. - * - * For example: `getAll('visible', true)` would return the first element that had its `visible` property set. - * - * Optionally you can specify a start and end index. For example if the array had 100 elements, - * and you set `startIndex` to 0 and `endIndex` to 50, it would search only the first 50 elements. - * - * @function Phaser.Utils.Array.GetFirst - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {string} [property] - The property to test on each array element. - * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {number} [startIndex=0] - An optional start index to search from. - * @param {number} [endIndex=array.length] - An optional end index to search up to (but not included) - * - * @return {object} The first matching element from the array, or `null` if no element could be found in the range given. - */ -var GetFirst = function (array, property, value, startIndex, endIndex) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - - if (SafeRange(array, startIndex, endIndex)) - { - for (var i = startIndex; i < endIndex; i++) - { - var child = array[i]; - - if (!property || - (property && value === undefined && child.hasOwnProperty(property)) || - (property && value !== undefined && child[property] === value)) - { - return child; - } - } - } - - return null; -}; - -module.exports = GetFirst; - - -/***/ }), -/* 278 */ -/***/ (function(module, exports) { +/***/ 5241: +/***/ ((module) => { /** * @author Richard Davey @@ -39426,722 +29226,464 @@ module.exports = GetFirst; */ /** - * Returns a Random element from the array. + * The Video Game Object Loop Event. * - * @function Phaser.Utils.Array.GetRandom + * This event is dispatched when a Video that is currently playing has looped. This only + * happens if the `loop` parameter was specified, or the `setLoop` method was called, + * and if the video has a fixed duration. Video streams, for example, cannot loop, as + * they have no duration. + * + * Looping is based on the result of the Video `timeupdate` event. This event is not + * frame-accurate, due to the way browsers work, so please do not rely on this loop + * event to be time or frame precise. + * + * Listen for it from a Video Game Object instance using `Video.on('loop', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_LOOP + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which has looped. + */ +module.exports = 'loop'; + + +/***/ }), + +/***/ 8325: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Playing Event. + * + * The playing event is fired after playback is first started, + * and whenever it is restarted. For example it is fired when playback + * resumes after having been paused or delayed due to lack of data. + * + * Listen for it from a Video Game Object instance using `Video.on('playing', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_PLAYING + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. + */ +module.exports = 'playing'; + + +/***/ }), + +/***/ 3356: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Play Event. + * + * This event is dispatched when a Video begins playback. For videos that do not require + * interaction unlocking, this is usually as soon as the `Video.play` method is called. + * However, for videos that require unlocking, it is fired once playback begins after + * they've been unlocked. + * + * Listen for it from a Video Game Object instance using `Video.on('play', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_PLAY + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. + */ +module.exports = 'play'; + + +/***/ }), + +/***/ 7513: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Seeked Event. + * + * This event is dispatched when a Video completes seeking to a new point in its timeline. + * + * Listen for it from a Video Game Object instance using `Video.on('seeked', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_SEEKED + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed seeking. + */ +module.exports = 'seeked'; + + +/***/ }), + +/***/ 5788: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Seeking Event. + * + * This event is dispatched when a Video _begins_ seeking to a new point in its timeline. + * When the seek is complete, it will dispatch the `VIDEO_SEEKED` event to conclude. + * + * Listen for it from a Video Game Object instance using `Video.on('seeking', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_SEEKING + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started seeking. + */ +module.exports = 'seeking'; + + +/***/ }), + +/***/ 7111: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Stalled Event. + * + * This event is dispatched by a Video Game Object when the video playback stalls. + * + * This can happen if the video is buffering. + * + * If will fire for any of the following native DOM events: + * + * `stalled` + * `suspend` + * `waiting` + * + * Listen for it from a Video Game Object instance using `Video.on('stalled', listener)`. + * + * Note that being stalled isn't always a negative thing. A video can be stalled if it + * has downloaded enough data in to its buffer to not need to download any more until + * the current batch of frames have rendered. + * + * @event Phaser.GameObjects.Events#VIDEO_STALLED + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. + * @param {Event} event - The native DOM event the browser raised during playback. + */ +module.exports = 'stalled'; + + +/***/ }), + +/***/ 8118: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Stopped Event. + * + * This event is dispatched when a Video is stopped from playback via a call to the `Video.stop` method, + * either directly via game code, or indirectly as the result of changing a video source or destroying it. + * + * Listen for it from a Video Game Object instance using `Video.on('stop', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_STOP + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which stopped playback. + */ +module.exports = 'stop'; + + +/***/ }), + +/***/ 9184: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Texture Ready Event. + * + * This event is dispatched by a Video Game Object when it has finished creating its texture. + * + * This happens when the video has finished loading enough data for its first frame. + * + * If you wish to use the Video texture elsewhere in your game, such as as a Sprite texture, + * then you should listen for this event first, before creating the Sprites that use it. + * + * Listen for it from a Video Game Object instance using `Video.on('textureready', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_TEXTURE + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object that emitted the event. + * @param {Phaser.Textures.Texture} texture - The Texture that was created. + */ +module.exports = 'textureready'; + + +/***/ }), + +/***/ 4287: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Unlocked Event. + * + * This event is dispatched when a Video that was prevented from playback due to the browsers + * Media Engagement Interaction policy, is unlocked by a user gesture. + * + * Listen for it from a Video Game Object instance using `Video.on('unlocked', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_UNLOCKED + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. + */ +module.exports = 'unlocked'; + + +/***/ }), + +/***/ 857: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Unsupported Event. + * + * This event is dispatched by a Video Game Object if the media source + * (which may be specified as a MediaStream, MediaSource, Blob, or File, + * for example) doesn't represent a supported media format. + * + * Listen for it from a Video Game Object instance using `Video.on('unsupported', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_UNSUPPORTED + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. + * @param {DOMException|string} event - The native DOM event the browser raised during playback. + */ +module.exports = 'unsupported'; + + +/***/ }), + +/***/ 3389: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Events + */ + +module.exports = { + + ADDED_TO_SCENE: __webpack_require__(6608), + DESTROY: __webpack_require__(4265), + REMOVED_FROM_SCENE: __webpack_require__(8671), + VIDEO_COMPLETE: __webpack_require__(3420), + VIDEO_CREATED: __webpack_require__(601), + VIDEO_ERROR: __webpack_require__(7919), + VIDEO_LOCKED: __webpack_require__(6231), + VIDEO_LOOP: __webpack_require__(5241), + VIDEO_PLAY: __webpack_require__(3356), + VIDEO_PLAYING: __webpack_require__(8325), + VIDEO_SEEKED: __webpack_require__(7513), + VIDEO_SEEKING: __webpack_require__(5788), + VIDEO_STALLED: __webpack_require__(7111), + VIDEO_STOP: __webpack_require__(8118), + VIDEO_TEXTURE: __webpack_require__(9184), + VIDEO_UNLOCKED: __webpack_require__(4287), + VIDEO_UNSUPPORTED: __webpack_require__(857) + +}; + + +/***/ }), + +/***/ 1643: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GEOM_CONST = { + + /** + * A Circle Geometry object type. + * + * @name Phaser.Geom.CIRCLE + * @type {number} + * @since 3.19.0 + */ + CIRCLE: 0, + + /** + * An Ellipse Geometry object type. + * + * @name Phaser.Geom.ELLIPSE + * @type {number} + * @since 3.19.0 + */ + ELLIPSE: 1, + + /** + * A Line Geometry object type. + * + * @name Phaser.Geom.LINE + * @type {number} + * @since 3.19.0 + */ + LINE: 2, + + /** + * A Point Geometry object type. + * + * @name Phaser.Geom.POINT + * @type {number} + * @since 3.19.0 + */ + POINT: 3, + + /** + * A Polygon Geometry object type. + * + * @name Phaser.Geom.POLYGON + * @type {number} + * @since 3.19.0 + */ + POLYGON: 4, + + /** + * A Rectangle Geometry object type. + * + * @name Phaser.Geom.RECTANGLE + * @type {number} + * @since 3.19.0 + */ + RECTANGLE: 5, + + /** + * A Triangle Geometry object type. + * + * @name Phaser.Geom.TRIANGLE + * @type {number} + * @since 3.19.0 + */ + TRIANGLE: 6 + +}; + +module.exports = GEOM_CONST; + + +/***/ }), + +/***/ 8881: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(7655); + +/** + * Get a point on a line that's a given percentage along its length. + * + * @function Phaser.Geom.Line.GetPoint * @since 3.0.0 * - * @param {array} array - The array to select the random entry from. - * @param {number} [startIndex=0] - An optional start index. - * @param {number} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from. + * @generic {Phaser.Geom.Point} O - [out,$return] * - * @return {*} A random element from the array, or `null` if no element could be found in the range given. + * @param {Phaser.Geom.Line} line - The line. + * @param {number} position - A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line. + * @param {(Phaser.Geom.Point|object)} [out] - An optional point, or point-like object, to store the coordinates of the point on the line. + * + * @return {(Phaser.Geom.Point|object)} The point on the line. */ -var GetRandom = function (array, startIndex, length) +var GetPoint = function (line, position, out) { - if (startIndex === undefined) { startIndex = 0; } - if (length === undefined) { length = array.length; } + if (out === undefined) { out = new Point(); } - var randomIndex = startIndex + Math.floor(Math.random() * length); - - return (array[randomIndex] === undefined) ? null : array[randomIndex]; -}; - -module.exports = GetRandom; - - -/***/ }), -/* 279 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given array element down one place in the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.MoveDown - * @since 3.4.0 - * - * @param {array} array - The input array. - * @param {*} item - The element to move down the array. - * - * @return {array} The input array. - */ -var MoveDown = function (array, item) -{ - var currentIndex = array.indexOf(item); - - if (currentIndex > 0) - { - var item2 = array[currentIndex - 1]; - - var index2 = array.indexOf(item2); - - array[currentIndex] = item2; - array[index2] = item; - } - - return array; -}; - -module.exports = MoveDown; - - -/***/ }), -/* 280 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves an element in an array to a new position within the same array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.MoveTo - * @since 3.4.0 - * - * @param {array} array - The array. - * @param {*} item - The element to move. - * @param {number} index - The new index that the element will be moved to. - * - * @return {*} The element that was moved. - */ -var MoveTo = function (array, item, index) -{ - var currentIndex = array.indexOf(item); - - if (currentIndex === -1 || index < 0 || index >= array.length) - { - throw new Error('Supplied index out of bounds'); - } - - if (currentIndex !== index) - { - // Remove - array.splice(currentIndex, 1); - - // Add in new location - array.splice(index, 0, item); - } - - return item; -}; - -module.exports = MoveTo; - - -/***/ }), -/* 281 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given array element up one place in the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.MoveUp - * @since 3.4.0 - * - * @param {array} array - The input array. - * @param {*} item - The element to move up the array. - * - * @return {array} The input array. - */ -var MoveUp = function (array, item) -{ - var currentIndex = array.indexOf(item); - - if (currentIndex !== -1 && currentIndex < array.length - 1) - { - // The element one above `item` in the array - var item2 = array[currentIndex + 1]; - var index2 = array.indexOf(item2); - - array[currentIndex] = item2; - array[index2] = item; - } - - return array; -}; - -module.exports = MoveUp; - - -/***/ }), -/* 282 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given array element above another one in the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.MoveAbove - * @since 3.55.0 - * - * @param {array} array - The input array. - * @param {*} item1 - The element to move above base element. - * @param {*} item2 - The base element. - * - * - * @return {array} The input array. - */ -var MoveAbove = function (array, item1, item2) -{ - if (item1 === item2) - { - return array; - } - - var currentIndex = array.indexOf(item1); - var baseIndex = array.indexOf(item2); - - if (currentIndex < 0 || baseIndex < 0) - { - throw new Error('Supplied items must be elements of the same array'); - } - - if (currentIndex > baseIndex) - { - // item1 is already above item2 - return array; - } - - // Remove - array.splice(currentIndex, 1); - - // Add in new location - if (baseIndex === array.length - 1) - { - array.push(item1); - } - else - { - array.splice(baseIndex, 0, item1); - } - - return array; -}; - -module.exports = MoveAbove; - - -/***/ }), -/* 283 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given array element below another one in the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.MoveBelow - * @since 3.55.0 - * - * @param {array} array - The input array. - * @param {*} item1 - The element to move below base element. - * @param {*} item2 - The base element. - * - * - * @return {array} The input array. - */ -var MoveBelow = function (array, item1, item2) -{ - if (item1 === item2) - { - return array; - } - - var currentIndex = array.indexOf(item1); - var baseIndex = array.indexOf(item2); - - if (currentIndex < 0 || baseIndex < 0) - { - throw new Error('Supplied items must be elements of the same array'); - } - - if (currentIndex < baseIndex) - { - // item1 is already below item2 - return array; - } - - // Remove - array.splice(currentIndex, 1); - - // Add in new location - if (baseIndex === 0) - { - array.unshift(item1); - } - else - { - array.splice(baseIndex, 0, item1); - } - - return array; -}; - -module.exports = MoveBelow; - - -/***/ }), -/* 284 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Create an array representing the range of numbers (usually integers), between, and inclusive of, - * the given `start` and `end` arguments. For example: - * - * `var array = Phaser.Utils.Array.NumberArray(2, 4); // array = [2, 3, 4]` - * `var array = Phaser.Utils.Array.NumberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` - * `var array = Phaser.Utils.Array.NumberArray(8, 2); // array = [8, 7, 6, 5, 4, 3, 2]` - * - * This is equivalent to `Phaser.Utils.Array.NumberArrayStep(start, end, 1)`. - * - * You can optionally provide a prefix and / or suffix string. If given the array will contain - * strings, not integers. For example: - * - * `var array = Phaser.Utils.Array.NumberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` - * `var array = Phaser.Utils.Array.NumberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` - * - * @function Phaser.Utils.Array.NumberArray - * @since 3.0.0 - * - * @param {number} start - The minimum value the array starts with. - * @param {number} end - The maximum value the array contains. - * @param {string} [prefix] - Optional prefix to place before the number. If provided the array will contain strings, not integers. - * @param {string} [suffix] - Optional suffix to place after the number. If provided the array will contain strings, not integers. - * - * @return {(number[]|string[])} The array of number values, or strings if a prefix or suffix was provided. - */ -var NumberArray = function (start, end, prefix, suffix) -{ - var result = []; - - var i; - var asString = false; - - if (prefix || suffix) - { - asString = true; - - if (!prefix) - { - prefix = ''; - } - - if (!suffix) - { - suffix = ''; - } - } - - if (end < start) - { - for (i = start; i >= end; i--) - { - if (asString) - { - result.push(prefix + i.toString() + suffix); - } - else - { - result.push(i); - } - } - } - else - { - for (i = start; i <= end; i++) - { - if (asString) - { - result.push(prefix + i.toString() + suffix); - } - else - { - result.push(i); - } - } - } - - return result; -}; - -module.exports = NumberArray; - - -/***/ }), -/* 285 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var RoundAwayFromZero = __webpack_require__(42); - -/** - * Create an array of numbers (positive and/or negative) progressing from `start` - * up to but not including `end` by advancing by `step`. - * - * If `start` is less than `end` a zero-length range is created unless a negative `step` is specified. - * - * Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0; - * for forward compatibility make sure to pass in actual numbers. - * - * @example - * NumberArrayStep(4); - * // => [0, 1, 2, 3] - * - * NumberArrayStep(1, 5); - * // => [1, 2, 3, 4] - * - * NumberArrayStep(0, 20, 5); - * // => [0, 5, 10, 15] - * - * NumberArrayStep(0, -4, -1); - * // => [0, -1, -2, -3] - * - * NumberArrayStep(1, 4, 0); - * // => [1, 1, 1] - * - * NumberArrayStep(0); - * // => [] - * - * @function Phaser.Utils.Array.NumberArrayStep - * @since 3.0.0 - * - * @param {number} [start=0] - The start of the range. - * @param {number} [end=null] - The end of the range. - * @param {number} [step=1] - The value to increment or decrement by. - * - * @return {number[]} The array of number values. - */ -var NumberArrayStep = function (start, end, step) -{ - if (start === undefined) { start = 0; } - if (end === undefined) { end = null; } - if (step === undefined) { step = 1; } - - if (end === null) - { - end = start; - start = 0; - } - - var result = []; - - var total = Math.max(RoundAwayFromZero((end - start) / (step || 1)), 0); - - for (var i = 0; i < total; i++) - { - result.push(start); - start += step; - } - - return result; -}; - -module.exports = NumberArrayStep; - - -/***/ }), -/* 286 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @ignore - */ -function swap (arr, i, j) -{ - var tmp = arr[i]; - arr[i] = arr[j]; - arr[j] = tmp; -} - -/** - * @ignore - */ -function defaultCompare (a, b) -{ - return a < b ? -1 : a > b ? 1 : 0; -} - -/** - * A [Floyd-Rivest](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm) quick selection algorithm. - * - * Rearranges the array items so that all items in the [left, k] range are smaller than all items in [k, right]; - * The k-th element will have the (k - left + 1)th smallest value in [left, right]. - * - * The array is modified in-place. - * - * Based on code by [Vladimir Agafonkin](https://www.npmjs.com/~mourner) - * - * @function Phaser.Utils.Array.QuickSelect - * @since 3.0.0 - * - * @param {array} arr - The array to sort. - * @param {number} k - The k-th element index. - * @param {number} [left=0] - The index of the left part of the range. - * @param {number} [right] - The index of the right part of the range. - * @param {function} [compare] - An optional comparison function. Is passed two elements and should return 0, 1 or -1. - */ -var QuickSelect = function (arr, k, left, right, compare) -{ - if (left === undefined) { left = 0; } - if (right === undefined) { right = arr.length - 1; } - if (compare === undefined) { compare = defaultCompare; } - - while (right > left) - { - if (right - left > 600) - { - var n = right - left + 1; - var m = k - left + 1; - var z = Math.log(n); - var s = 0.5 * Math.exp(2 * z / 3); - var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1); - var newLeft = Math.max(left, Math.floor(k - m * s / n + sd)); - var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd)); - - QuickSelect(arr, k, newLeft, newRight, compare); - } - - var t = arr[k]; - var i = left; - var j = right; - - swap(arr, left, k); - - if (compare(arr[right], t) > 0) - { - swap(arr, left, right); - } - - while (i < j) - { - swap(arr, i, j); - - i++; - j--; - - while (compare(arr[i], t) < 0) - { - i++; - } - - while (compare(arr[j], t) > 0) - { - j--; - } - } - - if (compare(arr[left], t) === 0) - { - swap(arr, left, j); - } - else - { - j++; - swap(arr, j, right); - } - - if (j <= k) - { - left = j + 1; - } - - if (k <= j) - { - right = j - 1; - } - } -}; - -module.exports = QuickSelect; - - -/***/ }), -/* 287 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GetValue = __webpack_require__(7); -var Shuffle = __webpack_require__(64); - -var BuildChunk = function (a, b, qty) -{ - var out = []; - - for (var aIndex = 0; aIndex < a.length; aIndex++) - { - for (var bIndex = 0; bIndex < b.length; bIndex++) - { - for (var i = 0; i < qty; i++) - { - out.push({ a: a[aIndex], b: b[bIndex] }); - } - } - } + out.x = line.x1 + (line.x2 - line.x1) * position; + out.y = line.y1 + (line.y2 - line.y1) * position; return out; }; -/** - * Creates an array populated with a range of values, based on the given arguments and configuration object. - * - * Range ([a,b,c], [1,2,3]) = - * a1, a2, a3, b1, b2, b3, c1, c2, c3 - * - * Range ([a,b], [1,2,3], qty = 3) = - * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3 - * - * Range ([a,b,c], [1,2,3], repeat x1) = - * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3 - * - * Range ([a,b], [1,2], repeat -1 = endless, max = 14) = - * Maybe if max is set then repeat goes to -1 automatically? - * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements) - * - * Range ([a], [1,2,3,4,5], random = true) = - * a4, a1, a5, a2, a3 - * - * Range ([a, b], [1,2,3], random = true) = - * b3, a2, a1, b1, a3, b2 - * - * Range ([a, b, c], [1,2,3], randomB = true) = - * a3, a1, a2, b2, b3, b1, c1, c3, c2 - * - * Range ([a], [1,2,3,4,5], yoyo = true) = - * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1 - * - * Range ([a, b], [1,2,3], yoyo = true) = - * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1 - * - * @function Phaser.Utils.Array.Range - * @since 3.0.0 - * - * @param {array} a - The first array of range elements. - * @param {array} b - The second array of range elements. - * @param {object} [options] - A range configuration object. Can contain: repeat, random, randomB, yoyo, max, qty. - * - * @return {array} An array of arranged elements. - */ -var Range = function (a, b, options) -{ - var max = GetValue(options, 'max', 0); - var qty = GetValue(options, 'qty', 1); - var random = GetValue(options, 'random', false); - var randomB = GetValue(options, 'randomB', false); - var repeat = GetValue(options, 'repeat', 0); - var yoyo = GetValue(options, 'yoyo', false); - - var out = []; - - if (randomB) - { - Shuffle(b); - } - - // Endless repeat, so limit by max - if (repeat === -1) - { - if (max === 0) - { - repeat = 0; - } - else - { - // Work out how many repeats we need - var total = (a.length * b.length) * qty; - - if (yoyo) - { - total *= 2; - } - - repeat = Math.ceil(max / total); - } - } - - for (var i = 0; i <= repeat; i++) - { - var chunk = BuildChunk(a, b, qty); - - if (random) - { - Shuffle(chunk); - } - - out = out.concat(chunk); - - if (yoyo) - { - chunk.reverse(); - - out = out.concat(chunk); - } - } - - if (max) - { - out.splice(max); - } - - return out; -}; - -module.exports = Range; +module.exports = GetPoint; /***/ }), -/* 288 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 4479: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -40149,3183 +29691,53 @@ module.exports = Range; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(10); +var Length = __webpack_require__(4771); +var Point = __webpack_require__(7655); /** - * Removes the given item, or array of items, from the array. + * Get a number of points along a line's length. * - * The array is modified in-place. + * Provide a `quantity` to get an exact number of points along the line. * - * You can optionally specify a callback to be invoked for each item successfully removed from the array. + * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when + * providing a `stepRate`. * - * @function Phaser.Utils.Array.Remove - * @since 3.4.0 - * - * @param {array} array - The array to be modified. - * @param {*|Array.<*>} item - The item, or array of items, to be removed from the array. - * @param {function} [callback] - A callback to be invoked for each item successfully removed from the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {*|Array.<*>} The item, or array of items, that were successfully removed from the array. - */ -var Remove = function (array, item, callback, context) -{ - if (context === undefined) { context = array; } - - var index; - - // Fast path to avoid array mutation and iteration - if (!Array.isArray(item)) - { - index = array.indexOf(item); - - if (index !== -1) - { - SpliceOne(array, index); - - if (callback) - { - callback.call(context, item); - } - - return item; - } - else - { - return null; - } - } - - // If we got this far, we have an array of items to remove - - var itemLength = item.length - 1; - var removed = []; - - while (itemLength >= 0) - { - var entry = item[itemLength]; - - index = array.indexOf(entry); - - if (index !== -1) - { - SpliceOne(array, index); - - removed.push(entry); - - if (callback) - { - callback.call(context, entry); - } - } - - itemLength--; - } - - return removed; -}; - -module.exports = Remove; - - -/***/ }), -/* 289 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SpliceOne = __webpack_require__(10); - -/** - * Removes the item from the given position in the array. - * - * The array is modified in-place. - * - * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array. - * - * @function Phaser.Utils.Array.RemoveAt - * @since 3.4.0 - * - * @param {array} array - The array to be modified. - * @param {number} index - The array index to remove the item from. The index must be in bounds or it will throw an error. - * @param {function} [callback] - A callback to be invoked for the item removed from the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {*} The item that was removed. - */ -var RemoveAt = function (array, index, callback, context) -{ - if (context === undefined) { context = array; } - - if (index < 0 || index > array.length - 1) - { - throw new Error('Index out of bounds'); - } - - var item = SpliceOne(array, index); - - if (callback) - { - callback.call(context, item); - } - - return item; -}; - -module.exports = RemoveAt; - - -/***/ }), -/* 290 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Removes the item within the given range in the array. - * - * The array is modified in-place. - * - * You can optionally specify a callback to be invoked for the item/s successfully removed from the array. - * - * @function Phaser.Utils.Array.RemoveBetween - * @since 3.4.0 - * - * @param {array} array - The array to be modified. - * @param {number} startIndex - The start index to remove from. - * @param {number} endIndex - The end index to remove to. - * @param {function} [callback] - A callback to be invoked for the item removed from the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {Array.<*>} An array of items that were removed. - */ -var RemoveBetween = function (array, startIndex, endIndex, callback, context) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - if (context === undefined) { context = array; } - - if (SafeRange(array, startIndex, endIndex)) - { - var size = endIndex - startIndex; - - var removed = array.splice(startIndex, size); - - if (callback) - { - for (var i = 0; i < removed.length; i++) - { - var entry = removed[i]; - - callback.call(context, entry); - } - } - - return removed; - } - else - { - return []; - } -}; - -module.exports = RemoveBetween; - - -/***/ }), -/* 291 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SpliceOne = __webpack_require__(10); - -/** - * Removes a random object from the given array and returns it. - * Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index. - * - * @function Phaser.Utils.Array.RemoveRandomElement - * @since 3.0.0 - * - * @param {array} array - The array to removed a random element from. - * @param {number} [start=0] - The array index to start the search from. - * @param {number} [length=array.length] - Optional restriction on the number of elements to randomly select from. - * - * @return {object} The random element that was removed, or `null` if there were no array elements that fell within the given range. - */ -var RemoveRandomElement = function (array, start, length) -{ - if (start === undefined) { start = 0; } - if (length === undefined) { length = array.length; } - - var randomIndex = start + Math.floor(Math.random() * length); - - return SpliceOne(array, randomIndex); -}; - -module.exports = RemoveRandomElement; - - -/***/ }), -/* 292 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Replaces an element of the array with the new element. - * The new element cannot already be a member of the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.Replace - * @since 3.4.0 - * - * @param {array} array - The array to search within. - * @param {*} oldChild - The element in the array that will be replaced. - * @param {*} newChild - The element to be inserted into the array at the position of `oldChild`. - * - * @return {boolean} Returns true if the oldChild was successfully replaced, otherwise returns false. - */ -var Replace = function (array, oldChild, newChild) -{ - var index1 = array.indexOf(oldChild); - var index2 = array.indexOf(newChild); - - if (index1 !== -1 && index2 === -1) - { - array[index1] = newChild; - - return true; - } - else - { - return false; - } -}; - -module.exports = Replace; - - -/***/ }), -/* 293 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given element to the bottom of the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.SendToBack - * @since 3.4.0 - * - * @param {array} array - The array. - * @param {*} item - The element to move. - * - * @return {*} The element that was moved. - */ -var SendToBack = function (array, item) -{ - var currentIndex = array.indexOf(item); - - if (currentIndex !== -1 && currentIndex > 0) - { - array.splice(currentIndex, 1); - array.unshift(item); - } - - return item; -}; - -module.exports = SendToBack; - - -/***/ }), -/* 294 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Scans the array for elements with the given property. If found, the property is set to the `value`. - * - * For example: `SetAll('visible', true)` would set all elements that have a `visible` property to `false`. - * - * Optionally you can specify a start and end index. For example if the array had 100 elements, - * and you set `startIndex` to 0 and `endIndex` to 50, it would update only the first 50 elements. - * - * @function Phaser.Utils.Array.SetAll - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {string} property - The property to test for on each array element. - * @param {*} value - The value to set the property to. - * @param {number} [startIndex] - An optional start index to search from. - * @param {number} [endIndex] - An optional end index to search to. - * - * @return {array} The input array. - */ -var SetAll = function (array, property, value, startIndex, endIndex) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - - if (SafeRange(array, startIndex, endIndex)) - { - for (var i = startIndex; i < endIndex; i++) - { - var entry = array[i]; - - if (entry.hasOwnProperty(property)) - { - entry[property] = value; - } - } - } - - return array; -}; - -module.exports = SetAll; - - -/***/ }), -/* 295 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Takes the given array and runs a numeric sort on it, ignoring any non-digits that - * may be in the entries. - * - * You should only run this on arrays containing strings. - * - * @function Phaser.Utils.Array.SortByDigits - * @since 3.50.0 - * - * @param {string[]} array - The input array of strings. - * - * @return {string[]} The sorted input array. - */ -var SortByDigits = function (array) -{ - var re = /\D/g; - - array.sort(function (a, b) - { - return (parseInt(a.replace(re, ''), 10) - parseInt(b.replace(re, ''), 10)); - }); - - return array; -}; - -module.exports = SortByDigits; - - -/***/ }), -/* 296 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author Angry Bytes (and contributors) - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Device = __webpack_require__(297); - -/** - * The comparator function. - * - * @ignore - * - * @param {*} a - The first item to test. - * @param {*} b - The second itemt to test. - * - * @return {boolean} True if they localCompare, otherwise false. - */ -function Compare (a, b) -{ - return String(a).localeCompare(b); -} - -/** - * Process the array contents. - * - * @ignore - * - * @param {array} array - The array to process. - * @param {function} compare - The comparison function. - * - * @return {array} - The processed array. - */ -function Process (array, compare) -{ - // Short-circuit when there's nothing to sort. - var len = array.length; - - if (len <= 1) - { - return array; - } - - // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. - // Chunks are the size of the left or right hand in merge sort. - // Stop when the left-hand covers all of the array. - var buffer = new Array(len); - - for (var chk = 1; chk < len; chk *= 2) - { - RunPass(array, compare, chk, buffer); - - var tmp = array; - - array = buffer; - - buffer = tmp; - } - - return array; -} - -/** - * Run a single pass with the given chunk size. - * - * @ignore - * - * @param {array} arr - The array to run the pass on. - * @param {function} comp - The comparison function. - * @param {number} chk - The number of iterations. - * @param {array} result - The array to store the result in. - */ -function RunPass (arr, comp, chk, result) -{ - var len = arr.length; - var i = 0; - - // Step size / double chunk size. - var dbl = chk * 2; - - // Bounds of the left and right chunks. - var l, r, e; - - // Iterators over the left and right chunk. - var li, ri; - - // Iterate over pairs of chunks. - for (l = 0; l < len; l += dbl) - { - r = l + chk; - e = r + chk; - - if (r > len) - { - r = len; - } - - if (e > len) - { - e = len; - } - - // Iterate both chunks in parallel. - li = l; - ri = r; - - while (true) - { - // Compare the chunks. - if (li < r && ri < e) - { - // This works for a regular `sort()` compatible comparator, - // but also for a simple comparator like: `a > b` - if (comp(arr[li], arr[ri]) <= 0) - { - result[i++] = arr[li++]; - } - else - { - result[i++] = arr[ri++]; - } - } - else if (li < r) - { - // Nothing to compare, just flush what's left. - result[i++] = arr[li++]; - } - else if (ri < e) - { - result[i++] = arr[ri++]; - } - else - { - // Both iterators are at the chunk ends. - break; - } - } - } -} - -/** - * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. - * - * This is an implementation of merge sort, without recursion. - * - * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable - * - * @function Phaser.Utils.Array.StableSort - * @since 3.0.0 - * - * @param {array} array - The input array to be sorted. - * @param {function} [compare] - The comparison function. - * - * @return {array} The sorted result. - */ -var StableSort = function (array, compare) -{ - if (compare === undefined) { compare = Compare; } - - // Short-circuit when there's nothing to sort. - if (!array || array.length < 2) - { - return array; - } - - if (Device.features.stableSort) - { - return array.sort(compare); - } - - var result = Process(array, compare); - - // This simply copies back if the result isn't in the original array, which happens on an odd number of passes. - if (result !== array) - { - RunPass(result, null, array.length, array); - } - - return array; -}; - -module.exports = StableSort; - - -/***/ }), -/* 297 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// This singleton is instantiated as soon as Phaser loads, -// before a Phaser.Game instance has even been created. -// Which means all instances of Phaser Games can share it, -// without having to re-poll the device all over again - -/** - * @namespace Phaser.Device - * @since 3.0.0 - */ - -/** - * @typedef {object} Phaser.DeviceConf - * - * @property {Phaser.Device.OS} os - The OS Device functions. - * @property {Phaser.Device.Browser} browser - The Browser Device functions. - * @property {Phaser.Device.Features} features - The Features Device functions. - * @property {Phaser.Device.Input} input - The Input Device functions. - * @property {Phaser.Device.Audio} audio - The Audio Device functions. - * @property {Phaser.Device.Video} video - The Video Device functions. - * @property {Phaser.Device.Fullscreen} fullscreen - The Fullscreen Device functions. - * @property {Phaser.Device.CanvasFeatures} canvasFeatures - The Canvas Device functions. - */ - -module.exports = { - - os: __webpack_require__(27), - browser: __webpack_require__(16), - features: __webpack_require__(299), - input: __webpack_require__(303), - audio: __webpack_require__(304), - video: __webpack_require__(305), - fullscreen: __webpack_require__(306), - canvasFeatures: __webpack_require__(307) - -}; - - -/***/ }), -/* 298 */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), -/* 299 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var OS = __webpack_require__(27); -var Browser = __webpack_require__(16); -var CanvasPool = __webpack_require__(65); - -/** - * Determines the features of the browser running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.features` from within any Scene. - * - * @typedef {object} Phaser.Device.Features - * @since 3.0.0 - * - * @property {boolean} canvas - Is canvas available? - * @property {?boolean} canvasBitBltShift - True if canvas supports a 'copy' bitblt onto itself when the source and destination regions overlap. - * @property {boolean} file - Is file available? - * @property {boolean} fileSystem - Is fileSystem available? - * @property {boolean} getUserMedia - Does the device support the getUserMedia API? - * @property {boolean} littleEndian - Is the device big or little endian? (only detected if the browser supports TypedArrays) - * @property {boolean} localStorage - Is localStorage available? - * @property {boolean} pointerLock - Is Pointer Lock available? - * @property {boolean} stableSort - Is Array.sort stable? - * @property {boolean} support32bit - Does the device context support 32bit pixel manipulation using array buffer views? - * @property {boolean} vibration - Does the device support the Vibration API? - * @property {boolean} webGL - Is webGL available? - * @property {boolean} worker - Is worker available? - */ -var Features = { - - canvas: false, - canvasBitBltShift: null, - file: false, - fileSystem: false, - getUserMedia: true, - littleEndian: false, - localStorage: false, - pointerLock: false, - stableSort: false, - support32bit: false, - vibration: false, - webGL: false, - worker: false - -}; - -// Check Little or Big Endian system. -// @author Matt DesLauriers (@mattdesl) -function checkIsLittleEndian () -{ - var a = new ArrayBuffer(4); - var b = new Uint8Array(a); - var c = new Uint32Array(a); - - b[0] = 0xa1; - b[1] = 0xb2; - b[2] = 0xc3; - b[3] = 0xd4; - - if (c[0] === 0xd4c3b2a1) - { - return true; - } - - if (c[0] === 0xa1b2c3d4) - { - return false; - } - else - { - // Could not determine endianness - return null; - } -} - -function init () -{ - if (typeof importScripts === 'function') - { - return Features; - } - - Features.canvas = !!window['CanvasRenderingContext2D']; - - try - { - Features.localStorage = !!localStorage.getItem; - } - catch (error) - { - Features.localStorage = false; - } - - Features.file = !!window['File'] && !!window['FileReader'] && !!window['FileList'] && !!window['Blob']; - Features.fileSystem = !!window['requestFileSystem']; - - var isUint8 = false; - - var testWebGL = function () - { - if (window['WebGLRenderingContext']) - { - try - { - var canvas = CanvasPool.createWebGL(this); - - var ctx = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); - - var canvas2D = CanvasPool.create2D(this); - - var ctx2D = canvas2D.getContext('2d', { willReadFrequently: true }); - - // Can't be done on a webgl context - var image = ctx2D.createImageData(1, 1); - - // Test to see if ImageData uses CanvasPixelArray or Uint8ClampedArray. - // @author Matt DesLauriers (@mattdesl) - isUint8 = image.data instanceof Uint8ClampedArray; - - CanvasPool.remove(canvas); - CanvasPool.remove(canvas2D); - - return !!ctx; - } - catch (e) - { - return false; - } - } - - return false; - }; - - Features.webGL = testWebGL(); - - Features.worker = !!window['Worker']; - - Features.pointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document; - - navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia; - - window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL; - - Features.getUserMedia = Features.getUserMedia && !!navigator.getUserMedia && !!window.URL; - - // Older versions of firefox (< 21) apparently claim support but user media does not actually work - if (Browser.firefox && Browser.firefoxVersion < 21) - { - Features.getUserMedia = false; - } - - // Excludes iOS versions as they generally wrap UIWebView (eg. Safari WebKit) and it - // is safer to not try and use the fast copy-over method. - if (!OS.iOS && (Browser.ie || Browser.firefox || Browser.chrome)) - { - Features.canvasBitBltShift = true; - } - - // Known not to work - if (Browser.safari || Browser.mobileSafari) - { - Features.canvasBitBltShift = false; - } - - navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate; - - if (navigator.vibrate) - { - Features.vibration = true; - } - - if (typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint32Array !== 'undefined') - { - Features.littleEndian = checkIsLittleEndian(); - } - - Features.support32bit = ( - typeof ArrayBuffer !== 'undefined' && - typeof Uint8ClampedArray !== 'undefined' && - typeof Int32Array !== 'undefined' && - Features.littleEndian !== null && - isUint8 - ); - - return Features; -} - -module.exports = init(); - - -/***/ }), -/* 300 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Global constants. - * - * @ignore - */ - -var CONST = { - - /** - * Phaser Release Version - * - * @name Phaser.VERSION - * @const - * @type {string} - * @since 3.0.0 - */ - VERSION: '3.60.0-beta.18', - - BlendModes: __webpack_require__(12), - - ScaleModes: __webpack_require__(301), - - /** - * This setting will auto-detect if the browser is capable of suppporting WebGL. - * If it is, it will use the WebGL Renderer. If not, it will fall back to the Canvas Renderer. - * - * @name Phaser.AUTO - * @const - * @type {number} - * @since 3.0.0 - */ - AUTO: 0, - - /** - * Forces Phaser to only use the Canvas Renderer, regardless if the browser supports - * WebGL or not. - * - * @name Phaser.CANVAS - * @const - * @type {number} - * @since 3.0.0 - */ - CANVAS: 1, - - /** - * Forces Phaser to use the WebGL Renderer. If the browser does not support it, there is - * no fallback to Canvas with this setting, so you should trap it and display a suitable - * message to the user. - * - * @name Phaser.WEBGL - * @const - * @type {number} - * @since 3.0.0 - */ - WEBGL: 2, - - /** - * A Headless Renderer doesn't create either a Canvas or WebGL Renderer. However, it still - * absolutely relies on the DOM being present and available. This mode is meant for unit testing, - * not for running Phaser on the server, which is something you really shouldn't do. - * - * @name Phaser.HEADLESS - * @const - * @type {number} - * @since 3.0.0 - */ - HEADLESS: 3, - - /** - * In Phaser the value -1 means 'forever' in lots of cases, this const allows you to use it instead - * to help you remember what the value is doing in your code. - * - * @name Phaser.FOREVER - * @const - * @type {number} - * @since 3.0.0 - */ - FOREVER: -1, - - /** - * Direction constant. - * - * @name Phaser.NONE - * @const - * @type {number} - * @since 3.0.0 - */ - NONE: 4, - - /** - * Direction constant. - * - * @name Phaser.UP - * @const - * @type {number} - * @since 3.0.0 - */ - UP: 5, - - /** - * Direction constant. - * - * @name Phaser.DOWN - * @const - * @type {number} - * @since 3.0.0 - */ - DOWN: 6, - - /** - * Direction constant. - * - * @name Phaser.LEFT - * @const - * @type {number} - * @since 3.0.0 - */ - LEFT: 7, - - /** - * Direction constant. - * - * @name Phaser.RIGHT - * @const - * @type {number} - * @since 3.0.0 - */ - RIGHT: 8 - -}; - -module.exports = CONST; - - -/***/ }), -/* 301 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Phaser Scale Modes. - * - * @namespace Phaser.ScaleModes - * @since 3.0.0 - */ - -var ScaleModes = { - - /** - * Default Scale Mode (Linear). - * - * @name Phaser.ScaleModes.DEFAULT - * @type {number} - * @readonly - * @since 3.0.0 - */ - DEFAULT: 0, - - /** - * Linear Scale Mode. - * - * @name Phaser.ScaleModes.LINEAR - * @type {number} - * @readonly - * @since 3.0.0 - */ - LINEAR: 0, - - /** - * Nearest Scale Mode. - * - * @name Phaser.ScaleModes.NEAREST - * @type {number} - * @readonly - * @since 3.0.0 - */ - NEAREST: 1 - -}; - -module.exports = ScaleModes; - - -/***/ }), -/* 302 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Browser specific prefix, so not going to change between contexts, only between browsers -var prefix = ''; - -/** - * @namespace Phaser.Display.Canvas.Smoothing - * @since 3.0.0 - */ -var Smoothing = function () -{ - /** - * Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set. - * - * @function Phaser.Display.Canvas.Smoothing.getPrefix - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The canvas context to check. - * - * @return {string} The name of the property on the context which controls image smoothing (either `imageSmoothingEnabled` or a vendor-prefixed version thereof), or `null` if not supported. - */ - var getPrefix = function (context) - { - var vendors = [ 'i', 'webkitI', 'msI', 'mozI', 'oI' ]; - - for (var i = 0; i < vendors.length; i++) - { - var s = vendors[i] + 'mageSmoothingEnabled'; - - if (s in context) - { - return s; - } - } - - return null; - }; - - /** - * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. - * By default browsers have image smoothing enabled, which isn't always what you visually want, especially - * when using pixel art in a game. Note that this sets the property on the context itself, so that any image - * drawn to the context will be affected. This sets the property across all current browsers but support is - * patchy on earlier browsers, especially on mobile. - * - * @function Phaser.Display.Canvas.Smoothing.enable - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to enable smoothing. - * - * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. - */ - var enable = function (context) - { - if (prefix === '') - { - prefix = getPrefix(context); - } - - if (prefix) - { - context[prefix] = true; - } - - return context; - }; - - /** - * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. - * By default browsers have image smoothing enabled, which isn't always what you visually want, especially - * when using pixel art in a game. Note that this sets the property on the context itself, so that any image - * drawn to the context will be affected. This sets the property across all current browsers but support is - * patchy on earlier browsers, especially on mobile. - * - * @function Phaser.Display.Canvas.Smoothing.disable - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to disable smoothing. - * - * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. - */ - var disable = function (context) - { - if (prefix === '') - { - prefix = getPrefix(context); - } - - if (prefix) - { - context[prefix] = false; - } - - return context; - }; - - /** - * Returns `true` if the given context has image smoothing enabled, otherwise returns `false`. - * Returns null if no smoothing prefix is available. - * - * @function Phaser.Display.Canvas.Smoothing.isEnabled - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context to check. - * - * @return {?boolean} `true` if smoothing is enabled on the context, otherwise `false`. `null` if not supported. - */ - var isEnabled = function (context) - { - return (prefix !== null) ? context[prefix] : null; - }; - - return { - disable: disable, - enable: enable, - getPrefix: getPrefix, - isEnabled: isEnabled - }; - -}; - -module.exports = Smoothing(); - - -/***/ }), -/* 303 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Browser = __webpack_require__(16); - -/** - * Determines the input support of the browser running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.input` from within any Scene. - * - * @typedef {object} Phaser.Device.Input - * @since 3.0.0 - * - * @property {?string} wheelType - The newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll' - * @property {boolean} gamepads - Is navigator.getGamepads available? - * @property {boolean} mspointer - Is mspointer available? - * @property {boolean} touch - Is touch available? - */ -var Input = { - - gamepads: false, - mspointer: false, - touch: false, - wheelEvent: null - -}; - -function init () -{ - if (typeof importScripts === 'function') - { - return Input; - } - - if ('ontouchstart' in document.documentElement || (navigator.maxTouchPoints && navigator.maxTouchPoints >= 1)) - { - Input.touch = true; - } - - if (navigator.msPointerEnabled || navigator.pointerEnabled) - { - Input.mspointer = true; - } - - if (navigator.getGamepads) - { - Input.gamepads = true; - } - - // See https://developer.mozilla.org/en-US/docs/Web/Events/wheel - if ('onwheel' in window || (Browser.ie && 'WheelEvent' in window)) - { - // DOM3 Wheel Event: FF 17+, IE 9+, Chrome 31+, Safari 7+ - Input.wheelEvent = 'wheel'; - } - else if ('onmousewheel' in window) - { - // Non-FF legacy: IE 6-9, Chrome 1-31, Safari 5-7. - Input.wheelEvent = 'mousewheel'; - } - else if (Browser.firefox && 'MouseScrollEvent' in window) - { - // FF prior to 17. This should probably be scrubbed. - Input.wheelEvent = 'DOMMouseScroll'; - } - - return Input; -} - -module.exports = init(); - - -/***/ }), -/* 304 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Browser = __webpack_require__(16); - -/** - * Determines the audio playback capabilities of the device running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.audio` from within any Scene. - * - * @typedef {object} Phaser.Device.Audio - * @since 3.0.0 - * - * @property {boolean} audioData - Can this device play HTML Audio tags? - * @property {boolean} dolby - Can this device play EC-3 Dolby Digital Plus files? - * @property {boolean} m4a - Can this device can play m4a files. - * @property {boolean} aac - Can this device can play aac files. - * @property {boolean} flac - Can this device can play flac files. - * @property {boolean} mp3 - Can this device play mp3 files? - * @property {boolean} ogg - Can this device play ogg files? - * @property {boolean} opus - Can this device play opus files? - * @property {boolean} wav - Can this device play wav files? - * @property {boolean} webAudio - Does this device have the Web Audio API? - * @property {boolean} webm - Can this device play webm files? - */ -var Audio = { - - flac: false, - aac: false, - audioData: false, - dolby: false, - m4a: false, - mp3: false, - ogg: false, - opus: false, - wav: false, - webAudio: false, - webm: false - -}; - -function init () -{ - if (typeof importScripts === 'function') - { - return Audio; - } - - Audio.audioData = !!(window['Audio']); - - Audio.webAudio = !!(window['AudioContext'] || window['webkitAudioContext']); - - var audioElement = document.createElement('audio'); - var result = !!audioElement.canPlayType; - - try - { - if (result) - { - var CanPlay = function (type1, type2) - { - var canPlayType1 = audioElement.canPlayType('audio/' + type1).replace(/^no$/, ''); - - if (type2) - { - return Boolean(canPlayType1 || audioElement.canPlayType('audio/' + type2).replace(/^no$/, '')); - } - else - { - return Boolean(canPlayType1); - } - }; - - // wav Mimetypes accepted: - // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements - - Audio.ogg = CanPlay('ogg; codecs="vorbis"'); - Audio.opus = CanPlay('ogg; codecs="opus"', 'opus'); - Audio.mp3 = CanPlay('mpeg'); - Audio.wav = CanPlay('wav'); - Audio.m4a = CanPlay('x-m4a'); - Audio.aac = CanPlay('aac'); - Audio.flac = CanPlay('flac', 'x-flac'); - Audio.webm = CanPlay('webm; codecs="vorbis"'); - - if (audioElement.canPlayType('audio/mp4; codecs="ec-3"') !== '') - { - if (Browser.edge) - { - Audio.dolby = true; - } - else if (Browser.safari && Browser.safariVersion >= 9) - { - if ((/Mac OS X (\d+)_(\d+)/).test(navigator.userAgent)) - { - var major = parseInt(RegExp.$1, 10); - var minor = parseInt(RegExp.$2, 10); - - if ((major === 10 && minor >= 11) || major > 10) - { - Audio.dolby = true; - } - } - } - } - } - } - catch (e) - { - // Nothing to do here - } - - return Audio; -} - -module.exports = init(); - - -/***/ }), -/* 305 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Determines the video support of the browser running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.video` from within any Scene. - * - * In Phaser 3.20 the properties were renamed to drop the 'Video' suffix. - * - * @typedef {object} Phaser.Device.Video - * @since 3.0.0 - * - * @property {boolean} h264 - Can this device play h264 mp4 video files? - * @property {boolean} hls - Can this device play hls video files? - * @property {boolean} mp4 - Can this device play h264 mp4 video files? - * @property {boolean} m4v - Can this device play m4v (typically mp4) video files? - * @property {boolean} ogg - Can this device play ogg video files? - * @property {boolean} vp9 - Can this device play vp9 video files? - * @property {boolean} webm - Can this device play webm video files? - */ -var Video = { - - h264: false, - hls: false, - mp4: false, - m4v: false, - ogg: false, - vp9: false, - webm: false - -}; - -function init () -{ - if (typeof importScripts === 'function') - { - return Video; - } - - var videoElement = document.createElement('video'); - var result = !!videoElement.canPlayType; - var no = /^no$/; - - try - { - if (result) - { - if (videoElement.canPlayType('video/ogg; codecs="theora"').replace(no, '')) - { - Video.ogg = true; - } - - if (videoElement.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(no, '')) - { - // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546 - Video.h264 = true; - Video.mp4 = true; - } - - if (videoElement.canPlayType('video/x-m4v').replace(no, '')) - { - Video.m4v = true; - } - - if (videoElement.canPlayType('video/webm; codecs="vp8, vorbis"').replace(no, '')) - { - Video.webm = true; - } - - if (videoElement.canPlayType('video/webm; codecs="vp9"').replace(no, '')) - { - Video.vp9 = true; - } - - if (videoElement.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(no, '')) - { - Video.hls = true; - } - } - } - catch (e) - { - // Nothing to do - } - - return Video; -} - -module.exports = init(); - - -/***/ }), -/* 306 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Determines the full screen support of the browser running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.fullscreen` from within any Scene. - * - * @typedef {object} Phaser.Device.Fullscreen - * @since 3.0.0 - * - * @property {boolean} available - Does the browser support the Full Screen API? - * @property {boolean} keyboard - Does the browser support access to the Keyboard during Full Screen mode? - * @property {string} cancel - If the browser supports the Full Screen API this holds the call you need to use to cancel it. - * @property {string} request - If the browser supports the Full Screen API this holds the call you need to use to activate it. - */ -var Fullscreen = { - - available: false, - cancel: '', - keyboard: false, - request: '' - -}; - -/** -* Checks for support of the Full Screen API. -* -* @ignore -*/ -function init () -{ - if (typeof importScripts === 'function') - { - return Fullscreen; - } - - var i; - - var suffix1 = 'Fullscreen'; - var suffix2 = 'FullScreen'; - - var fs = [ - 'request' + suffix1, - 'request' + suffix2, - 'webkitRequest' + suffix1, - 'webkitRequest' + suffix2, - 'msRequest' + suffix1, - 'msRequest' + suffix2, - 'mozRequest' + suffix2, - 'mozRequest' + suffix1 - ]; - - for (i = 0; i < fs.length; i++) - { - if (document.documentElement[fs[i]]) - { - Fullscreen.available = true; - Fullscreen.request = fs[i]; - break; - } - } - - var cfs = [ - 'cancel' + suffix2, - 'exit' + suffix1, - 'webkitCancel' + suffix2, - 'webkitExit' + suffix1, - 'msCancel' + suffix2, - 'msExit' + suffix1, - 'mozCancel' + suffix2, - 'mozExit' + suffix1 - ]; - - if (Fullscreen.available) - { - for (i = 0; i < cfs.length; i++) - { - if (document[cfs[i]]) - { - Fullscreen.cancel = cfs[i]; - break; - } - } - } - - // Keyboard Input? - // Safari 5.1 says it supports fullscreen keyboard, but is lying. - if (window['Element'] && Element['ALLOW_KEYBOARD_INPUT'] && !(/ Version\/5\.1(?:\.\d+)? Safari\//).test(navigator.userAgent)) - { - Fullscreen.keyboard = true; - } - - Object.defineProperty(Fullscreen, 'active', { get: function () { return !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement); } }); - - return Fullscreen; -} - -module.exports = init(); - - -/***/ }), -/* 307 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CanvasPool = __webpack_require__(65); - -/** - * Determines the canvas features of the browser running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.canvasFeatures` from within any Scene. - * - * @typedef {object} Phaser.Device.CanvasFeatures - * @since 3.0.0 - * - * @property {boolean} supportInverseAlpha - Set to true if the browser supports inversed alpha. - * @property {boolean} supportNewBlendModes - Set to true if the browser supports new canvas blend modes. - */ -var CanvasFeatures = { - - supportInverseAlpha: false, - supportNewBlendModes: false - -}; - -function checkBlendMode () -{ - var pngHead = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/'; - var pngEnd = 'AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg=='; - - var magenta = new Image(); - - magenta.onload = function () - { - var yellow = new Image(); - - yellow.onload = function () - { - var canvas = CanvasPool.create2D(yellow, 6); - var context = canvas.getContext('2d', { willReadFrequently: true }); - - context.globalCompositeOperation = 'multiply'; - - context.drawImage(magenta, 0, 0); - context.drawImage(yellow, 2, 0); - - if (!context.getImageData(2, 0, 1, 1)) - { - return false; - } - - var data = context.getImageData(2, 0, 1, 1).data; - - CanvasPool.remove(yellow); - - CanvasFeatures.supportNewBlendModes = (data[0] === 255 && data[1] === 0 && data[2] === 0); - }; - - yellow.src = pngHead + '/wCKxvRF' + pngEnd; - }; - - magenta.src = pngHead + 'AP804Oa6' + pngEnd; - - return false; -} - -function checkInverseAlpha () -{ - var canvas = CanvasPool.create2D(this, 2); - var context = canvas.getContext('2d', { willReadFrequently: true }); - - context.fillStyle = 'rgba(10, 20, 30, 0.5)'; - - // Draw a single pixel - context.fillRect(0, 0, 1, 1); - - // Get the color values - var s1 = context.getImageData(0, 0, 1, 1); - - if (s1 === null) - { - return false; - } - - // Plot them to x2 - context.putImageData(s1, 1, 0); - - // Get those values - var s2 = context.getImageData(1, 0, 1, 1); - - var result = (s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]); - - CanvasPool.remove(this); - - // Compare and return - return result; -} - -function init () -{ - if (typeof importScripts !== 'function' && document !== undefined) - { - CanvasFeatures.supportNewBlendModes = checkBlendMode(); - CanvasFeatures.supportInverseAlpha = checkInverseAlpha(); - } - - return CanvasFeatures; -} - -module.exports = init(); - - -/***/ }), -/* 308 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Swaps the position of two elements in the given array. - * The elements must exist in the same array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.Swap - * @since 3.4.0 - * - * @param {array} array - The input array. - * @param {*} item1 - The first element to swap. - * @param {*} item2 - The second element to swap. - * - * @return {array} The input array. - */ -var Swap = function (array, item1, item2) -{ - if (item1 === item2) - { - return array; - } - - var index1 = array.indexOf(item1); - var index2 = array.indexOf(item2); - - if (index1 < 0 || index2 < 0) - { - throw new Error('Supplied items must be elements of the same array'); - } - - array[index1] = item2; - array[index2] = item1; - - return array; -}; - -module.exports = Swap; - - -/***/ }), -/* 309 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.GameObjects.Components - */ - -module.exports = { - - Alpha: __webpack_require__(310), - AlphaSingle: __webpack_require__(311), - BlendMode: __webpack_require__(312), - ComputedSize: __webpack_require__(51), - Crop: __webpack_require__(313), - Depth: __webpack_require__(52), - Flip: __webpack_require__(53), - FX: __webpack_require__(314), - GetBounds: __webpack_require__(315), - Mask: __webpack_require__(324), - Origin: __webpack_require__(329), - PathFollower: __webpack_require__(330), - Pipeline: __webpack_require__(333), - ScrollFactor: __webpack_require__(54), - Size: __webpack_require__(335), - Texture: __webpack_require__(336), - TextureCrop: __webpack_require__(337), - Tint: __webpack_require__(338), - ToJSON: __webpack_require__(59), - Transform: __webpack_require__(55), - TransformMatrix: __webpack_require__(56), - Visible: __webpack_require__(57) - -}; - - -/***/ }), -/* 310 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(4); - -// bitmask flag for GameObject.renderMask -var _FLAG = 2; // 0010 - -/** - * Provides methods used for setting the alpha properties of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Alpha - * @since 3.0.0 - */ - -var Alpha = { - - /** - * Private internal value. Holds the global alpha value. - * - * @name Phaser.GameObjects.Components.Alpha#_alpha - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alpha: 1, - - /** - * Private internal value. Holds the top-left alpha value. - * - * @name Phaser.GameObjects.Components.Alpha#_alphaTL - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alphaTL: 1, - - /** - * Private internal value. Holds the top-right alpha value. - * - * @name Phaser.GameObjects.Components.Alpha#_alphaTR - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alphaTR: 1, - - /** - * Private internal value. Holds the bottom-left alpha value. - * - * @name Phaser.GameObjects.Components.Alpha#_alphaBL - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alphaBL: 1, - - /** - * Private internal value. Holds the bottom-right alpha value. - * - * @name Phaser.GameObjects.Components.Alpha#_alphaBR - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alphaBR: 1, - - /** - * Clears all alpha values associated with this Game Object. - * - * Immediately sets the alpha levels back to 1 (fully opaque). - * - * @method Phaser.GameObjects.Components.Alpha#clearAlpha - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - clearAlpha: function () - { - return this.setAlpha(1); - }, - - /** - * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. - * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * - * If your game is running under WebGL you can optionally specify four different alpha values, each of which - * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. - * - * @method Phaser.GameObjects.Components.Alpha#setAlpha - * @since 3.0.0 - * - * @param {number} [topLeft=1] - The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. - * @param {number} [topRight] - The alpha value used for the top-right of the Game Object. WebGL only. - * @param {number} [bottomLeft] - The alpha value used for the bottom-left of the Game Object. WebGL only. - * @param {number} [bottomRight] - The alpha value used for the bottom-right of the Game Object. WebGL only. - * - * @return {this} This Game Object instance. - */ - setAlpha: function (topLeft, topRight, bottomLeft, bottomRight) - { - if (topLeft === undefined) { topLeft = 1; } - - // Treat as if there is only one alpha value for the whole Game Object - if (topRight === undefined) - { - this.alpha = topLeft; - } - else - { - this._alphaTL = Clamp(topLeft, 0, 1); - this._alphaTR = Clamp(topRight, 0, 1); - this._alphaBL = Clamp(bottomLeft, 0, 1); - this._alphaBR = Clamp(bottomRight, 0, 1); - } - - return this; - }, - - /** - * The alpha value of the Game Object. - * - * This is a global value, impacting the entire Game Object, not just a region of it. - * - * @name Phaser.GameObjects.Components.Alpha#alpha - * @type {number} - * @since 3.0.0 - */ - alpha: { - - get: function () - { - return this._alpha; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alpha = v; - this._alphaTL = v; - this._alphaTR = v; - this._alphaBL = v; - this._alphaBR = v; - - if (v === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The alpha value starting from the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Alpha#alphaTopLeft - * @type {number} - * @webglOnly - * @since 3.0.0 - */ - alphaTopLeft: { - - get: function () - { - return this._alphaTL; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alphaTL = v; - - if (v !== 0) - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The alpha value starting from the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Alpha#alphaTopRight - * @type {number} - * @webglOnly - * @since 3.0.0 - */ - alphaTopRight: { - - get: function () - { - return this._alphaTR; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alphaTR = v; - - if (v !== 0) - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The alpha value starting from the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Alpha#alphaBottomLeft - * @type {number} - * @webglOnly - * @since 3.0.0 - */ - alphaBottomLeft: { - - get: function () - { - return this._alphaBL; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alphaBL = v; - - if (v !== 0) - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The alpha value starting from the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Alpha#alphaBottomRight - * @type {number} - * @webglOnly - * @since 3.0.0 - */ - alphaBottomRight: { - - get: function () - { - return this._alphaBR; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alphaBR = v; - - if (v !== 0) - { - this.renderFlags |= _FLAG; - } - } - - } - -}; - -module.exports = Alpha; - - -/***/ }), -/* 311 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(4); - -// bitmask flag for GameObject.renderMask -var _FLAG = 2; // 0010 - -/** - * Provides methods used for setting the alpha property of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.AlphaSingle - * @since 3.22.0 - */ - -var AlphaSingle = { - - /** - * Private internal value. Holds the global alpha value. - * - * @name Phaser.GameObjects.Components.AlphaSingle#_alpha - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alpha: 1, - - /** - * Clears all alpha values associated with this Game Object. - * - * Immediately sets the alpha levels back to 1 (fully opaque). - * - * @method Phaser.GameObjects.Components.AlphaSingle#clearAlpha - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - clearAlpha: function () - { - return this.setAlpha(1); - }, - - /** - * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. - * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * - * @method Phaser.GameObjects.Components.AlphaSingle#setAlpha - * @since 3.0.0 - * - * @param {number} [value=1] - The alpha value applied across the whole Game Object. - * - * @return {this} This Game Object instance. - */ - setAlpha: function (value) - { - if (value === undefined) { value = 1; } - - this.alpha = value; - - return this; - }, - - /** - * The alpha value of the Game Object. - * - * This is a global value, impacting the entire Game Object, not just a region of it. - * - * @name Phaser.GameObjects.Components.AlphaSingle#alpha - * @type {number} - * @since 3.0.0 - */ - alpha: { - - get: function () - { - return this._alpha; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alpha = v; - - if (v === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - } - -}; - -module.exports = AlphaSingle; - - -/***/ }), -/* 312 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BlendModes = __webpack_require__(12); - -/** - * Provides methods used for setting the blend mode of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.BlendMode - * @since 3.0.0 - */ - -var BlendMode = { - - /** - * Private internal value. Holds the current blend mode. - * - * @name Phaser.GameObjects.Components.BlendMode#_blendMode - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - _blendMode: BlendModes.NORMAL, - - /** - * Sets the Blend Mode being used by this Game Object. - * - * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * - * Under WebGL only the following Blend Modes are available: - * - * * NORMAL - * * ADD - * * MULTIPLY - * * SCREEN - * * ERASE - * - * Canvas has more available depending on browser support. - * - * You can also create your own custom Blend Modes in WebGL. - * - * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending - * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these - * reasons try to be careful about the construction of your Scene and the frequency of which blend modes - * are used. - * - * @name Phaser.GameObjects.Components.BlendMode#blendMode - * @type {(Phaser.BlendModes|string|number)} - * @since 3.0.0 - */ - blendMode: { - - get: function () - { - return this._blendMode; - }, - - set: function (value) - { - if (typeof value === 'string') - { - value = BlendModes[value]; - } - - value |= 0; - - if (value >= -1) - { - this._blendMode = value; - } - } - - }, - - /** - * Sets the Blend Mode being used by this Game Object. - * - * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * - * Under WebGL only the following Blend Modes are available: - * - * * NORMAL - * * ADD - * * MULTIPLY - * * SCREEN - * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * - * Canvas has more available depending on browser support. - * - * You can also create your own custom Blend Modes in WebGL. - * - * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending - * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these - * reasons try to be careful about the construction of your Scene and the frequency in which blend modes - * are used. - * - * @method Phaser.GameObjects.Components.BlendMode#setBlendMode - * @since 3.0.0 - * - * @param {(string|Phaser.BlendModes|number)} value - The BlendMode value. Either a string, a CONST or a number. - * - * @return {this} This Game Object instance. - */ - setBlendMode: function (value) - { - this.blendMode = value; - - return this; - } - -}; - -module.exports = BlendMode; - - -/***/ }), -/* 313 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for getting and setting the texture of a Game Object. - * - * @namespace Phaser.GameObjects.Components.Crop - * @since 3.12.0 - */ - -var Crop = { - - /** - * The Texture this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.Crop#texture - * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} - * @since 3.0.0 - */ - texture: null, - - /** - * The Texture Frame this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.Crop#frame - * @type {Phaser.Textures.Frame} - * @since 3.0.0 - */ - frame: null, - - /** - * A boolean flag indicating if this Game Object is being cropped or not. - * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. - * Equally, calling `setCrop` with no arguments will reset the crop and disable it. - * - * @name Phaser.GameObjects.Components.Crop#isCropped - * @type {boolean} - * @since 3.11.0 - */ - isCropped: false, - - /** - * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * - * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * - * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just - * changes what is shown when rendered. - * - * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * - * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left - * half of it, you could call `setCrop(0, 0, 400, 600)`. - * - * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop - * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * - * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * - * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * - * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow - * the renderer to skip several internal calculations. - * - * @method Phaser.GameObjects.Components.Crop#setCrop - * @since 3.11.0 - * - * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. - * @param {number} [y] - The y coordinate to start the crop from. - * @param {number} [width] - The width of the crop rectangle in pixels. - * @param {number} [height] - The height of the crop rectangle in pixels. - * - * @return {this} This Game Object instance. - */ - setCrop: function (x, y, width, height) - { - if (x === undefined) - { - this.isCropped = false; - } - else if (this.frame) - { - if (typeof x === 'number') - { - this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY); - } - else - { - var rect = x; - - this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY); - } - - this.isCropped = true; - } - - return this; - }, - - /** - * Internal method that returns a blank, well-formed crop object for use by a Game Object. - * - * @method Phaser.GameObjects.Components.Crop#resetCropObject - * @private - * @since 3.12.0 - * - * @return {object} The crop object. - */ - resetCropObject: function () - { - return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 }; - } - -}; - -module.exports = Crop; - - -/***/ }), -/* 314 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for setting the FX values of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.FX - * @webglOnly - * @since 3.60.0 - */ - -var FX = { - - /** - * The amount of extra padding to be applied to this Game Object - * when it is being rendered by a SpriteFX Pipeline. - * - * Lots of FX require additional spacing added to the texture the - * Game Object uses, for example a glow or shadow effect, and this - * method allows you to control how much extra padding is included - * in addition to the texture size. - * - * @name Phaser.GameObjects.Components.FX#fxPadding - * @type {number} - * @default 0 - * @since 3.60.0 - */ - fxPadding: 0, - - /** - * Sets the amount of extra padding to be applied to this Game Object - * when it is being rendered by a SpriteFX Pipeline. - * - * Lots of FX require additional spacing added to the texture the - * Game Object uses, for example a glow or shadow effect, and this - * method allows you to control how much extra padding is included - * in addition to the texture size. - * - * @method Phaser.GameObjects.Components.FX#setFXPadding - * @webglOnly - * @since 3.60.0 - * - * @param {number} [padding=0] - The amount of padding to add to the texture. - * - * @return {this} This Game Object instance. - */ - setFXPadding: function (padding) - { - if (padding === undefined) { padding = 0; } - - this.fxPadding = padding; - - return this; - }, - - /** - * This callback is invoked when this Game Object is copied by a SpriteFX Pipeline. - * - * This happens when the pipeline uses its `copySprite` method. - * - * It's invoked prior to the copy, allowing you to set shader uniforms, etc on the pipeline. - * - * @method Phaser.GameObjects.Components.FX#onFXCopy - * @webglOnly - * @since 3.60.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline} pipeline - The SpriteFX Pipeline that invoked this callback. - */ - onFXCopy: function () - { - }, - - /** - * This callback is invoked when this Game Object is rendered by a SpriteFX Pipeline. - * - * This happens when the pipeline uses its `drawSprite` method. - * - * It's invoked prior to the draw, allowing you to set shader uniforms, etc on the pipeline. - * - * @method Phaser.GameObjects.Components.FX#onFX - * @webglOnly - * @since 3.60.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline} pipeline - The SpriteFX Pipeline that invoked this callback. - */ - onFX: function () - { - } - -}; - -module.exports = FX; - - -/***/ }), -/* 315 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Rectangle = __webpack_require__(28); -var RotateAround = __webpack_require__(41); -var Vector2 = __webpack_require__(2); - -/** - * Provides methods used for obtaining the bounds of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.GetBounds - * @since 3.0.0 - */ - -var GetBounds = { - - /** - * Processes the bounds output vector before returning it. - * - * @method Phaser.GameObjects.Components.GetBounds#prepareBoundsOutput - * @private - * @since 3.18.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} output - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - prepareBoundsOutput: function (output, includeParent) - { - if (includeParent === undefined) { includeParent = false; } - - if (this.rotation !== 0) - { - RotateAround(output, this.x, this.y, this.rotation); - } - - if (includeParent && this.parentContainer) - { - var parentMatrix = this.parentContainer.getBoundsTransformMatrix(); - - parentMatrix.transformPoint(output.x, output.y, output); - } - - return output; - }, - - /** - * Gets the center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getCenter - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getCenter: function (output) - { - if (output === undefined) { output = new Vector2(); } - - output.x = this.x - (this.displayWidth * this.originX) + (this.displayWidth / 2); - output.y = this.y - (this.displayHeight * this.originY) + (this.displayHeight / 2); - - return output; - }, - - /** - * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getTopLeft - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getTopLeft: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = this.x - (this.displayWidth * this.originX); - output.y = this.y - (this.displayHeight * this.originY); - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the top-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getTopCenter - * @since 3.18.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getTopCenter: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2); - output.y = this.y - (this.displayHeight * this.originY); - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getTopRight - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getTopRight: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; - output.y = this.y - (this.displayHeight * this.originY); - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the left-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getLeftCenter - * @since 3.18.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getLeftCenter: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = this.x - (this.displayWidth * this.originX); - output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2); - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the right-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getRightCenter - * @since 3.18.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getRightCenter: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; - output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2); - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getBottomLeft - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getBottomLeft: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = this.x - (this.displayWidth * this.originX); - output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getBottomCenter - * @since 3.18.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getBottomCenter: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2); - output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getBottomRight - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getBottomRight: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; - output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the bounds of this Game Object, regardless of origin. - * The values are stored and returned in a Rectangle, or Rectangle-like, object. - * - * @method Phaser.GameObjects.Components.GetBounds#getBounds - * @since 3.0.0 - * - * @generic {Phaser.Geom.Rectangle} O - [output,$return] - * - * @param {(Phaser.Geom.Rectangle|object)} [output] - An object to store the values in. If not provided a new Rectangle will be created. - * - * @return {(Phaser.Geom.Rectangle|object)} The values stored in the output object. - */ - getBounds: function (output) - { - if (output === undefined) { output = new Rectangle(); } - - // We can use the output object to temporarily store the x/y coords in: - - var TLx, TLy, TRx, TRy, BLx, BLy, BRx, BRy; - - // Instead of doing a check if parent container is - // defined per corner we only do it once. - if (this.parentContainer) - { - var parentMatrix = this.parentContainer.getBoundsTransformMatrix(); - - this.getTopLeft(output); - parentMatrix.transformPoint(output.x, output.y, output); - - TLx = output.x; - TLy = output.y; - - this.getTopRight(output); - parentMatrix.transformPoint(output.x, output.y, output); - - TRx = output.x; - TRy = output.y; - - this.getBottomLeft(output); - parentMatrix.transformPoint(output.x, output.y, output); - - BLx = output.x; - BLy = output.y; - - this.getBottomRight(output); - parentMatrix.transformPoint(output.x, output.y, output); - - BRx = output.x; - BRy = output.y; - } - else - { - this.getTopLeft(output); - - TLx = output.x; - TLy = output.y; - - this.getTopRight(output); - - TRx = output.x; - TRy = output.y; - - this.getBottomLeft(output); - - BLx = output.x; - BLy = output.y; - - this.getBottomRight(output); - - BRx = output.x; - BRy = output.y; - } - - output.x = Math.min(TLx, TRx, BLx, BRx); - output.y = Math.min(TLy, TRy, BLy, BRy); - output.width = Math.max(TLx, TRx, BLx, BRx) - output.x; - output.height = Math.max(TLy, TRy, BLy, BRy) - output.y; - - return output; - } - -}; - -module.exports = GetBounds; - - -/***/ }), -/* 316 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if a given point is inside a Rectangle's bounds. - * - * @function Phaser.Geom.Rectangle.Contains - * @since 3.0.0 - * - * @param {Phaser.Geom.Rectangle} rect - The Rectangle to check. - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. - * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ -var Contains = function (rect, x, y) -{ - if (rect.width <= 0 || rect.height <= 0) - { - return false; - } - - return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); -}; - -module.exports = Contains; - - -/***/ }), -/* 317 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GetPoint = __webpack_require__(66); -var Perimeter = __webpack_require__(67); - -/** - * Return an array of points from the perimeter of the rectangle, each spaced out based on the quantity or step required. - * - * @function Phaser.Geom.Rectangle.GetPoints + * @function Phaser.Geom.Line.GetPoints * @since 3.0.0 * * @generic {Phaser.Geom.Point[]} O - [out,$return] * - * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from. - * @param {number} step - Step between points. Used to calculate the number of points to return when quantity is falsey. Ignored if quantity is positive. - * @param {number} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points. - * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in. + * @param {Phaser.Geom.Line} line - The line. + * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. + * @param {(array|Phaser.Geom.Point[])} [out] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. * - * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle. + * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line. */ -var GetPoints = function (rectangle, quantity, stepRate, out) +var GetPoints = function (line, quantity, stepRate, out) { if (out === undefined) { out = []; } // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead. if (!quantity && stepRate > 0) { - quantity = Perimeter(rectangle) / stepRate; + quantity = Length(line) / stepRate; } + var x1 = line.x1; + var y1 = line.y1; + + var x2 = line.x2; + var y2 = line.y2; + for (var i = 0; i < quantity; i++) { var position = i / quantity; - out.push(GetPoint(rectangle, position)); + var x = x1 + (x2 - x1) * position; + var y = y1 + (y2 - y1) * position; + + out.push(new Point(x, y)); } return out; @@ -43335,8 +29747,9 @@ module.exports = GetPoints; /***/ }), -/* 318 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 4771: +/***/ ((module) => { /** * @author Richard Davey @@ -43344,12 +29757,41 @@ module.exports = GetPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); -var GetPoint = __webpack_require__(319); -var GetPoints = __webpack_require__(320); -var GEOM_CONST = __webpack_require__(29); -var Random = __webpack_require__(322); -var Vector2 = __webpack_require__(2); +/** + * Calculate the length of the given line. + * + * @function Phaser.Geom.Line.Length + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line to calculate the length of. + * + * @return {number} The length of the line. + */ +var Length = function (line) +{ + return Math.sqrt((line.x2 - line.x1) * (line.x2 - line.x1) + (line.y2 - line.y1) * (line.y2 - line.y1)); +}; + +module.exports = Length; + + +/***/ }), + +/***/ 284: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var GetPoint = __webpack_require__(8881); +var GetPoints = __webpack_require__(4479); +var GEOM_CONST = __webpack_require__(1643); +var Random = __webpack_require__(3915); +var Vector2 = __webpack_require__(2529); /** * @classdesc @@ -43672,8 +30114,9 @@ module.exports = Line; /***/ }), -/* 319 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 3915: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -43681,139 +30124,7 @@ module.exports = Line; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(11); - -/** - * Get a point on a line that's a given percentage along its length. - * - * @function Phaser.Geom.Line.GetPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [out,$return] - * - * @param {Phaser.Geom.Line} line - The line. - * @param {number} position - A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line. - * @param {(Phaser.Geom.Point|object)} [out] - An optional point, or point-like object, to store the coordinates of the point on the line. - * - * @return {(Phaser.Geom.Point|object)} The point on the line. - */ -var GetPoint = function (line, position, out) -{ - if (out === undefined) { out = new Point(); } - - out.x = line.x1 + (line.x2 - line.x1) * position; - out.y = line.y1 + (line.y2 - line.y1) * position; - - return out; -}; - -module.exports = GetPoint; - - -/***/ }), -/* 320 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Length = __webpack_require__(321); -var Point = __webpack_require__(11); - -/** - * Get a number of points along a line's length. - * - * Provide a `quantity` to get an exact number of points along the line. - * - * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when - * providing a `stepRate`. - * - * @function Phaser.Geom.Line.GetPoints - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point[]} O - [out,$return] - * - * @param {Phaser.Geom.Line} line - The line. - * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. - * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. - * @param {(array|Phaser.Geom.Point[])} [out] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. - * - * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line. - */ -var GetPoints = function (line, quantity, stepRate, out) -{ - if (out === undefined) { out = []; } - - // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead. - if (!quantity && stepRate > 0) - { - quantity = Length(line) / stepRate; - } - - var x1 = line.x1; - var y1 = line.y1; - - var x2 = line.x2; - var y2 = line.y2; - - for (var i = 0; i < quantity; i++) - { - var position = i / quantity; - - var x = x1 + (x2 - x1) * position; - var y = y1 + (y2 - y1) * position; - - out.push(new Point(x, y)); - } - - return out; -}; - -module.exports = GetPoints; - - -/***/ }), -/* 321 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the length of the given line. - * - * @function Phaser.Geom.Line.Length - * @since 3.0.0 - * - * @param {Phaser.Geom.Line} line - The line to calculate the length of. - * - * @return {number} The length of the line. - */ -var Length = function (line) -{ - return Math.sqrt((line.x2 - line.x1) * (line.x2 - line.x1) + (line.y2 - line.y1) * (line.y2 - line.y1)); -}; - -module.exports = Length; - - -/***/ }), -/* 322 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Point = __webpack_require__(11); +var Point = __webpack_require__(7655); /** * Returns a random point on a given Line. @@ -43844,8 +30155,9 @@ module.exports = Random; /***/ }), -/* 323 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 7655: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -43853,7 +30165,300 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(11); +var Class = __webpack_require__(7473); +var GEOM_CONST = __webpack_require__(1643); + +/** + * @classdesc + * Defines a Point in 2D space, with an x and y component. + * + * @class Point + * @memberof Phaser.Geom + * @constructor + * @since 3.0.0 + * + * @param {number} [x=0] - The x coordinate of this Point. + * @param {number} [y=x] - The y coordinate of this Point. + */ +var Point = new Class({ + + initialize: + + function Point (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + + /** + * The geometry constant type of this object: `GEOM_CONST.POINT`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Point#type + * @type {number} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.POINT; + + /** + * The x coordinate of this Point. + * + * @name Phaser.Geom.Point#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = x; + + /** + * The y coordinate of this Point. + * + * @name Phaser.Geom.Point#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = y; + }, + + /** + * Set the x and y coordinates of the point to the given values. + * + * @method Phaser.Geom.Point#setTo + * @since 3.0.0 + * + * @param {number} [x=0] - The x coordinate of this Point. + * @param {number} [y=x] - The y coordinate of this Point. + * + * @return {this} This Point object. + */ + setTo: function (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + } + +}); + +module.exports = Point; + + +/***/ }), + +/***/ 5956: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if a given point is inside a Rectangle's bounds. + * + * @function Phaser.Geom.Rectangle.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to check. + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. + * + * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. + */ +var Contains = function (rect, x, y) +{ + if (rect.width <= 0 || rect.height <= 0) + { + return false; + } + + return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); +}; + +module.exports = Contains; + + +/***/ }), + +/***/ 716: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Perimeter = __webpack_require__(7120); +var Point = __webpack_require__(7655); + +/** + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * + * @function Phaser.Geom.Rectangle.GetPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle to get the perimeter point from. + * @param {number} position - The normalized distance into the Rectangle's perimeter to return. + * @param {(Phaser.Geom.Point|object)} [out] - An object to update with the `x` and `y` coordinates of the point. + * + * @return {Phaser.Geom.Point} The updated `output` object, or a new Point if no `output` object was given. + */ +var GetPoint = function (rectangle, position, out) +{ + if (out === undefined) { out = new Point(); } + + if (position <= 0 || position >= 1) + { + out.x = rectangle.x; + out.y = rectangle.y; + + return out; + } + + var p = Perimeter(rectangle) * position; + + if (position > 0.5) + { + p -= (rectangle.width + rectangle.height); + + if (p <= rectangle.width) + { + // Face 3 + out.x = rectangle.right - p; + out.y = rectangle.bottom; + } + else + { + // Face 4 + out.x = rectangle.x; + out.y = rectangle.bottom - (p - rectangle.width); + } + } + else if (p <= rectangle.width) + { + // Face 1 + out.x = rectangle.x + p; + out.y = rectangle.y; + } + else + { + // Face 2 + out.x = rectangle.right; + out.y = rectangle.y + (p - rectangle.width); + } + + return out; +}; + +module.exports = GetPoint; + + +/***/ }), + +/***/ 8151: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetPoint = __webpack_require__(716); +var Perimeter = __webpack_require__(7120); + +/** + * Return an array of points from the perimeter of the rectangle, each spaced out based on the quantity or step required. + * + * @function Phaser.Geom.Rectangle.GetPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point[]} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from. + * @param {number} step - Step between points. Used to calculate the number of points to return when quantity is falsey. Ignored if quantity is positive. + * @param {number} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points. + * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in. + * + * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle. + */ +var GetPoints = function (rectangle, quantity, stepRate, out) +{ + if (out === undefined) { out = []; } + + // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead. + if (!quantity && stepRate > 0) + { + quantity = Perimeter(rectangle) / stepRate; + } + + for (var i = 0; i < quantity; i++) + { + var position = i / quantity; + + out.push(GetPoint(rectangle, position)); + } + + return out; +}; + +module.exports = GetPoints; + + +/***/ }), + +/***/ 7120: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the perimeter of a Rectangle. + * + * @function Phaser.Geom.Rectangle.Perimeter + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to use. + * + * @return {number} The perimeter of the Rectangle, equal to `(width * 2) + (height * 2)`. + */ +var Perimeter = function (rect) +{ + return 2 * (rect.width + rect.height); +}; + +module.exports = Perimeter; + + +/***/ }), + +/***/ 2161: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(7655); /** * Returns a random point within a Rectangle. @@ -43882,8 +30487,9 @@ module.exports = Random; /***/ }), -/* 324 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 1392: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -43891,402 +30497,1123 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapMask = __webpack_require__(325); -var GeometryMask = __webpack_require__(328); - -/** - * Provides methods used for getting and setting the mask of a Game Object. - * - * @namespace Phaser.GameObjects.Components.Mask - * @since 3.0.0 - */ - -var Mask = { - - /** - * The Mask this Game Object is using during render. - * - * @name Phaser.GameObjects.Components.Mask#mask - * @type {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} - * @since 3.0.0 - */ - mask: null, - - /** - * Sets the mask that this Game Object will use to render with. - * - * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. - * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. - * - * If a mask is already set on this Game Object it will be immediately replaced. - * - * Masks are positioned in global space and are not relative to the Game Object to which they - * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * - * Masks have no impact on physics or input detection. They are purely a rendering component - * that allows you to limit what is visible during the render pass. - * - * @method Phaser.GameObjects.Components.Mask#setMask - * @since 3.6.2 - * - * @param {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} mask - The mask this Game Object will use when rendering. - * - * @return {this} This Game Object instance. - */ - setMask: function (mask) - { - this.mask = mask; - - return this; - }, - - /** - * Clears the mask that this Game Object was using. - * - * @method Phaser.GameObjects.Components.Mask#clearMask - * @since 3.6.2 - * - * @param {boolean} [destroyMask=false] - Destroy the mask before clearing it? - * - * @return {this} This Game Object instance. - */ - clearMask: function (destroyMask) - { - if (destroyMask === undefined) { destroyMask = false; } - - if (destroyMask && this.mask) - { - this.mask.destroy(); - } - - this.mask = null; - - return this; - }, - - /** - * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, - * including this one, or a Dynamic Texture. - * - * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. - * - * To create the mask you need to pass in a reference to a renderable Game Object. - * A renderable Game Object is one that uses a texture to render with, such as an - * Image, Sprite, Render Texture or BitmapText. - * - * If you do not provide a renderable object, and this Game Object has a texture, - * it will use itself as the object. This means you can call this method to create - * a Bitmap Mask from any renderable texture-based Game Object. - * - * @method Phaser.GameObjects.Components.Mask#createBitmapMask - * @since 3.6.2 - * - * @generic {Phaser.GameObjects.GameObject} G - * @generic {Phaser.Textures.DynamicTexture} T - * @genericUse {(G|T|null)} [maskObject] - * - * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Dynamic Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. - * @param {number} [x] - If creating a Game Object, the horizontal position in the world. - * @param {number} [y] - If creating a Game Object, the vertical position in the world. - * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. - * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. - * - * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created. - */ - createBitmapMask: function (maskObject, x, y, texture, frame) - { - if (maskObject === undefined && (this.texture || this.shader || this.geom)) - { - // eslint-disable-next-line consistent-this - maskObject = this; - } - - return new BitmapMask(this.scene, maskObject, x, y, texture, frame); - }, - - /** - * Creates and returns a Geometry Mask. This mask can be used by any Game Object, - * including this one. - * - * To create the mask you need to pass in a reference to a Graphics Game Object. - * - * If you do not provide a graphics object, and this Game Object is an instance - * of a Graphics object, then it will use itself to create the mask. - * - * This means you can call this method to create a Geometry Mask from any Graphics Game Object. - * - * @method Phaser.GameObjects.Components.Mask#createGeometryMask - * @since 3.6.2 - * - * @generic {Phaser.GameObjects.Graphics} G - * @generic {Phaser.GameObjects.Shape} S - * @genericUse {(G|S)} [graphics] - * - * @param {Phaser.GameObjects.Graphics|Phaser.GameObjects.Shape} [graphics] - A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask. - * - * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. - */ - createGeometryMask: function (graphics) - { - if (graphics === undefined && (this.type === 'Graphics' || this.geom)) - { - // eslint-disable-next-line consistent-this - graphics = this; - } - - return new GeometryMask(this.scene, graphics); - } - -}; - -module.exports = Mask; - - -/***/ }), -/* 325 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var GameObjectFactory = __webpack_require__(326); +var Class = __webpack_require__(7473); +var Contains = __webpack_require__(5956); +var GetPoint = __webpack_require__(716); +var GetPoints = __webpack_require__(8151); +var GEOM_CONST = __webpack_require__(1643); +var Line = __webpack_require__(284); +var Random = __webpack_require__(2161); /** * @classdesc - * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. - * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask, - * not a clipping path. It is only available when using the WebGL Renderer. + * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height) * - * A Bitmap Mask can use any Game Object or Dynamic Texture to determine the alpha of each pixel of the masked Game Object(s). - * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha - * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the - * Bitmap Mask doesn't matter. - * - * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an - * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means - * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects - * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the - * corresponding pixel in the mask. - * - * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, - * combine Geometry Masks and Blend Modes together. - * - * The Bitmap Mask's location matches the location of its Game Object, not the location of the - * masked objects. Moving or transforming the underlying Game Object will change the mask - * (and affect the visibility of any masked objects), whereas moving or transforming a masked object - * will not affect the mask. - * - * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a - * Scene's display list, it will only be used for the mask and its full texture will not be directly - * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will - * render as a normal Game Object and will also serve as a mask. - * - * @class BitmapMask - * @memberof Phaser.Display.Masks + * @class Rectangle + * @memberof Phaser.Geom * @constructor * @since 3.0.0 * - * @param {Phaser.Scene} scene - The Scene to which this mask is being added. - * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Dynamic Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. - * @param {number} [x] - If creating a Game Object, the horizontal position in the world. - * @param {number} [y] - If creating a Game Object, the vertical position in the world. - * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. - * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. + * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. + * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. + * @param {number} [width=0] - The width of the Rectangle. + * @param {number} [height=0] - The height of the Rectangle. */ -var BitmapMask = new Class({ +var Rectangle = new Class({ initialize: - function BitmapMask (scene, maskObject, x, y, texture, frame) + function Rectangle (x, y, width, height) { - if (!maskObject) + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = 0; } + if (height === undefined) { height = 0; } + + /** + * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Rectangle#type + * @type {number} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.RECTANGLE; + + /** + * The X coordinate of the top left corner of the Rectangle. + * + * @name Phaser.Geom.Rectangle#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = x; + + /** + * The Y coordinate of the top left corner of the Rectangle. + * + * @name Phaser.Geom.Rectangle#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = y; + + /** + * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. + * + * @name Phaser.Geom.Rectangle#width + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.width = width; + + /** + * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. + * + * @name Phaser.Geom.Rectangle#height + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.height = height; + }, + + /** + * Checks if the given point is inside the Rectangle's bounds. + * + * @method Phaser.Geom.Rectangle#contains + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. + * + * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. + */ + contains: function (x, y) + { + return Contains(this, x, y); + }, + + /** + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * + * @method Phaser.Geom.Rectangle#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [output,$return] + * + * @param {number} position - The normalized distance into the Rectangle's perimeter to return. + * @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point. + * + * @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given. + */ + getPoint: function (position, output) + { + return GetPoint(this, position, output); + }, + + /** + * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. + * + * @method Phaser.Geom.Rectangle#getPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point[]} O - [output,$return] + * + * @param {number} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. + * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points. + * + * @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided. + */ + getPoints: function (quantity, stepRate, output) + { + return GetPoints(this, quantity, stepRate, output); + }, + + /** + * Returns a random point within the Rectangle's bounds. + * + * @method Phaser.Geom.Rectangle#getRandomPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [point,$return] + * + * @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point. + * + * @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided. + */ + getRandomPoint: function (point) + { + return Random(this, point); + }, + + /** + * Sets the position, width, and height of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setTo + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the top left corner of the Rectangle. + * @param {number} y - The Y coordinate of the top left corner of the Rectangle. + * @param {number} width - The width of the Rectangle. + * @param {number} height - The height of the Rectangle. + * + * @return {this} This Rectangle object. + */ + setTo: function (x, y, width, height) + { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + + return this; + }, + + /** + * Resets the position, width, and height of the Rectangle to 0. + * + * @method Phaser.Geom.Rectangle#setEmpty + * @since 3.0.0 + * + * @return {this} This Rectangle object. + */ + setEmpty: function () + { + return this.setTo(0, 0, 0, 0); + }, + + /** + * Sets the position of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setPosition + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the top left corner of the Rectangle. + * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. + * + * @return {this} This Rectangle object. + */ + setPosition: function (x, y) + { + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + }, + + /** + * Sets the width and height of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setSize + * @since 3.0.0 + * + * @param {number} width - The width to set the Rectangle to. + * @param {number} [height=width] - The height to set the Rectangle to. + * + * @return {this} This Rectangle object. + */ + setSize: function (width, height) + { + if (height === undefined) { height = width; } + + this.width = width; + this.height = height; + + return this; + }, + + /** + * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. + * + * @method Phaser.Geom.Rectangle#isEmpty + * @since 3.0.0 + * + * @return {boolean} `true` if the Rectangle is empty. A Rectangle object is empty if its width or height is less than or equal to 0. + */ + isEmpty: function () + { + return (this.width <= 0 || this.height <= 0); + }, + + /** + * Returns a Line object that corresponds to the top of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineA + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle. + */ + getLineA: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.x, this.y, this.right, this.y); + + return line; + }, + + /** + * Returns a Line object that corresponds to the right of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineB + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle. + */ + getLineB: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.right, this.y, this.right, this.bottom); + + return line; + }, + + /** + * Returns a Line object that corresponds to the bottom of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineC + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle. + */ + getLineC: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.right, this.bottom, this.x, this.bottom); + + return line; + }, + + /** + * Returns a Line object that corresponds to the left of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineD + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle. + */ + getLineD: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.x, this.bottom, this.x, this.y); + + return line; + }, + + /** + * The x coordinate of the left of the Rectangle. + * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. + * + * @name Phaser.Geom.Rectangle#left + * @type {number} + * @since 3.0.0 + */ + left: { + + get: function () { - maskObject = scene.sys.make.image({ x: x, y: y, key: texture, frame: frame, add: false }); + return this.x; + }, + + set: function (value) + { + if (value >= this.right) + { + this.width = 0; + } + else + { + this.width = this.right - value; + } + + this.x = value; + } + + }, + + /** + * The sum of the x and width properties. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. + * + * @name Phaser.Geom.Rectangle#right + * @type {number} + * @since 3.0.0 + */ + right: { + + get: function () + { + return this.x + this.width; + }, + + set: function (value) + { + if (value <= this.x) + { + this.width = 0; + } + else + { + this.width = value - this.x; + } + } + + }, + + /** + * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. + * However it does affect the height property, whereas changing the y value does not affect the height property. + * + * @name Phaser.Geom.Rectangle#top + * @type {number} + * @since 3.0.0 + */ + top: { + + get: function () + { + return this.y; + }, + + set: function (value) + { + if (value >= this.bottom) + { + this.height = 0; + } + else + { + this.height = (this.bottom - value); + } + + this.y = value; + } + + }, + + /** + * The sum of the y and height properties. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. + * + * @name Phaser.Geom.Rectangle#bottom + * @type {number} + * @since 3.0.0 + */ + bottom: { + + get: function () + { + return this.y + this.height; + }, + + set: function (value) + { + if (value <= this.y) + { + this.height = 0; + } + else + { + this.height = value - this.y; + } + } + + }, + + /** + * The x coordinate of the center of the Rectangle. + * + * @name Phaser.Geom.Rectangle#centerX + * @type {number} + * @since 3.0.0 + */ + centerX: { + + get: function () + { + return this.x + (this.width / 2); + }, + + set: function (value) + { + this.x = value - (this.width / 2); + } + + }, + + /** + * The y coordinate of the center of the Rectangle. + * + * @name Phaser.Geom.Rectangle#centerY + * @type {number} + * @since 3.0.0 + */ + centerY: { + + get: function () + { + return this.y + (this.height / 2); + }, + + set: function (value) + { + this.y = value - (this.height / 2); + } + + } + +}); + +module.exports = Rectangle; + + +/***/ }), + +/***/ 9422: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(1392); + +/** + * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union. + * + * @function Phaser.Geom.Rectangle.Union + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to use. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to use. + * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the union in. + * + * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided. + */ +var Union = function (rectA, rectB, out) +{ + if (out === undefined) { out = new Rectangle(); } + + // Cache vars so we can use one of the input rects as the output rect + var x = Math.min(rectA.x, rectB.x); + var y = Math.min(rectA.y, rectB.y); + var w = Math.max(rectA.right, rectB.right) - x; + var h = Math.max(rectA.bottom, rectB.bottom) - y; + + return out.setTo(x, y, w, h); +}; + +module.exports = Union; + + +/***/ }), + +/***/ 1593: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var CONST = __webpack_require__(4359); +var Events = __webpack_require__(1179); +var GetFastValue = __webpack_require__(4597); +var GetURL = __webpack_require__(5593); +var MergeXHRSettings = __webpack_require__(7410); +var XHRLoader = __webpack_require__(5874); +var XHRSettings = __webpack_require__(707); + +/** + * @classdesc + * The base File class used by all File Types that the Loader can support. + * You shouldn't create an instance of a File directly, but should extend it with your own class, setting a custom type and processing methods. + * + * @class File + * @memberof Phaser.Loader + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. + * @param {Phaser.Types.Loader.FileConfig} fileConfig - The file configuration object, as created by the file type. + */ +var File = new Class({ + + initialize: + + function File (loader, fileConfig) + { + /** + * A reference to the Loader that is going to load this file. + * + * @name Phaser.Loader.File#loader + * @type {Phaser.Loader.LoaderPlugin} + * @since 3.0.0 + */ + this.loader = loader; + + /** + * A reference to the Cache, or Texture Manager, that is going to store this file if it loads. + * + * @name Phaser.Loader.File#cache + * @type {(Phaser.Cache.BaseCache|Phaser.Textures.TextureManager)} + * @since 3.7.0 + */ + this.cache = GetFastValue(fileConfig, 'cache', false); + + /** + * The file type string (image, json, etc) for sorting within the Loader. + * + * @name Phaser.Loader.File#type + * @type {string} + * @since 3.0.0 + */ + this.type = GetFastValue(fileConfig, 'type', false); + + if (!this.type) + { + throw new Error('Invalid File type: ' + this.type); } /** - * The Game Object that is used as the mask. Must use a texture, such as a Sprite. + * Unique cache key (unique within its file type) * - * @name Phaser.Display.Masks.BitmapMask#bitmapMask - * @type {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} + * @name Phaser.Loader.File#key + * @type {string} * @since 3.0.0 */ - this.bitmapMask = maskObject; + this.key = GetFastValue(fileConfig, 'key', false); + + var loadKey = this.key; + + if (loader.prefix && loader.prefix !== '') + { + this.key = loader.prefix + loadKey; + } + + if (!this.key) + { + throw new Error('Invalid File key: ' + this.key); + } + + var url = GetFastValue(fileConfig, 'url'); + + if (url === undefined) + { + url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); + } + else if (typeof url === 'string' && !url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)) + { + url = loader.path + url; + } /** - * Whether to invert the masks alpha. + * The URL of the file, not including baseURL. * - * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. + * Automatically has Loader.path prepended to it if a string. * - * Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. + * Can also be a JavaScript Object, such as the results of parsing JSON data. * - * @name Phaser.Display.Masks.BitmapMask#invertAlpha - * @type {boolean} - * @since 3.1.2 + * @name Phaser.Loader.File#url + * @type {object|string} + * @since 3.0.0 */ - this.invertAlpha = false; + this.url = url; /** - * Is this mask a stencil mask? This is false by default and should not be changed. + * The final URL this file will load from, including baseURL and path. + * Set automatically when the Loader calls 'load' on this file. * - * @name Phaser.Display.Masks.BitmapMask#isStencil - * @type {boolean} - * @readonly - * @since 3.17.0 + * @name Phaser.Loader.File#src + * @type {string} + * @since 3.0.0 */ - this.isStencil = false; + this.src = ''; + + /** + * The merged XHRSettings for this file. + * + * @name Phaser.Loader.File#xhrSettings + * @type {Phaser.Types.Loader.XHRSettingsObject} + * @since 3.0.0 + */ + this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined)); + + if (GetFastValue(fileConfig, 'xhrSettings', false)) + { + this.xhrSettings = MergeXHRSettings(this.xhrSettings, GetFastValue(fileConfig, 'xhrSettings', {})); + } + + /** + * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File. + * + * @name Phaser.Loader.File#xhrLoader + * @type {?XMLHttpRequest} + * @since 3.0.0 + */ + this.xhrLoader = null; + + /** + * The current state of the file. One of the FILE_CONST values. + * + * @name Phaser.Loader.File#state + * @type {number} + * @since 3.0.0 + */ + this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING; + + /** + * The total size of this file. + * Set by onProgress and only if loading via XHR. + * + * @name Phaser.Loader.File#bytesTotal + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.bytesTotal = 0; + + /** + * Updated as the file loads. + * Only set if loading via XHR. + * + * @name Phaser.Loader.File#bytesLoaded + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.bytesLoaded = -1; + + /** + * A percentage value between 0 and 1 indicating how much of this file has loaded. + * Only set if loading via XHR. + * + * @name Phaser.Loader.File#percentComplete + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.percentComplete = -1; + + /** + * For CORs based loading. + * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set) + * + * @name Phaser.Loader.File#crossOrigin + * @type {(string|undefined)} + * @since 3.0.0 + */ + this.crossOrigin = undefined; + + /** + * The processed file data, stored here after the file has loaded. + * + * @name Phaser.Loader.File#data + * @type {*} + * @since 3.0.0 + */ + this.data = undefined; + + /** + * A config object that can be used by file types to store transitional data. + * + * @name Phaser.Loader.File#config + * @type {*} + * @since 3.0.0 + */ + this.config = GetFastValue(fileConfig, 'config', {}); + + /** + * If this is a multipart file, i.e. an atlas and its json together, then this is a reference + * to the parent MultiFile. Set and used internally by the Loader or specific file types. + * + * @name Phaser.Loader.File#multiFile + * @type {?Phaser.Loader.MultiFile} + * @since 3.7.0 + */ + this.multiFile; + + /** + * Does this file have an associated linked file? Such as an image and a normal map. + * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't + * actually bound by data, where-as a linkFile is. + * + * @name Phaser.Loader.File#linkFile + * @type {?Phaser.Loader.File} + * @since 3.7.0 + */ + this.linkFile; }, /** - * Sets a new Game Object or Dynamic Texture for this Bitmap Mask to use. + * Links this File with another, so they depend upon each other for loading and processing. * - * If a Game Object it must have a texture, such as a Sprite. + * @method Phaser.Loader.File#setLink + * @since 3.7.0 * - * You can update the source of the mask as often as you like. + * @param {Phaser.Loader.File} fileB - The file to link to this one. + */ + setLink: function (fileB) + { + this.linkFile = fileB; + + fileB.linkFile = this; + }, + + /** + * Resets the XHRLoader instance this file is using. * - * @method Phaser.Display.Masks.BitmapMask#setBitmap + * @method Phaser.Loader.File#resetXHR + * @since 3.0.0 + */ + resetXHR: function () + { + if (this.xhrLoader) + { + this.xhrLoader.onload = undefined; + this.xhrLoader.onerror = undefined; + this.xhrLoader.onprogress = undefined; + } + }, + + /** + * Called by the Loader, starts the actual file downloading. + * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. + * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. + * + * @method Phaser.Loader.File#load + * @since 3.0.0 + */ + load: function () + { + if (this.state === CONST.FILE_POPULATED) + { + // Can happen for example in a JSONFile if they've provided a JSON object instead of a URL + this.loader.nextFile(this, true); + } + else + { + this.state = CONST.FILE_LOADING; + + this.src = GetURL(this, this.loader.baseURL); + + if (this.src.indexOf('data:') === 0) + { + console.warn('Local data URIs are not supported: ' + this.key); + } + else + { + // The creation of this XHRLoader starts the load process going. + // It will automatically call the following, based on the load outcome: + // + // xhr.onload = this.onLoad + // xhr.onerror = this.onError + // xhr.onprogress = this.onProgress + + this.xhrLoader = XHRLoader(this, this.loader.xhr); + } + } + }, + + /** + * Called when the file finishes loading, is sent a DOM ProgressEvent. + * + * @method Phaser.Loader.File#onLoad * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} maskObject - The Game Object or Dynamic Texture that will be used as the mask. If a Game Object, it must have a texture, such as a Sprite. + * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event. + * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load. */ - setBitmap: function (maskObject) + onLoad: function (xhr, event) { - this.bitmapMask = maskObject; + var isLocalFile = xhr.responseURL && this.loader.localSchemes.some(function (scheme) + { + return xhr.responseURL.indexOf(scheme) === 0; + }); + + var localFileOk = (isLocalFile && event.target.status === 0); + + var success = !(event.target && event.target.status !== 200) || localFileOk; + + // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called. + if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599) + { + success = false; + } + + this.state = CONST.FILE_LOADED; + + this.resetXHR(); + + this.loader.nextFile(this, success); }, /** - * Prepares the WebGL Renderer to render a Game Object with this mask applied. + * Called if the file errors while loading, is sent a DOM ProgressEvent. * - * This renders the masking Game Object to the mask framebuffer and switches to the main framebuffer so that the masked Game Object will be rendered to it instead of being rendered directly to the frame. - * - * @method Phaser.Display.Masks.BitmapMask#preRenderWebGL + * @method Phaser.Loader.File#onError * @since 3.0.0 * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to prepare. - * @param {Phaser.GameObjects.GameObject} maskedObject - The masked Game Object which will be drawn. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. + * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event. + * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this error. */ - preRenderWebGL: function (renderer, maskedObject, camera) + onError: function () { - renderer.pipelines.BITMAPMASK_PIPELINE.beginMask(this, maskedObject, camera); + this.resetXHR(); + + this.loader.nextFile(this, false); }, /** - * Finalizes rendering of a masked Game Object. + * Called during the file load progress. Is sent a DOM ProgressEvent. * - * This resets the previously bound framebuffer and switches the WebGL Renderer to the Bitmap Mask Pipeline, which uses a special fragment shader to apply the masking effect. - * - * @method Phaser.Display.Masks.BitmapMask#postRenderWebGL + * @method Phaser.Loader.File#onProgress + * @fires Phaser.Loader.Events#FILE_PROGRESS * @since 3.0.0 * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to clean up. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. - * @param {Phaser.Renderer.WebGL.RenderTarget} [renderTarget] - Optional WebGL RenderTarget. + * @param {ProgressEvent} event - The DOM ProgressEvent. */ - postRenderWebGL: function (renderer, camera, renderTarget) + onProgress: function (event) { - renderer.pipelines.BITMAPMASK_PIPELINE.endMask(this, camera, renderTarget); + if (event.lengthComputable) + { + this.bytesLoaded = event.loaded; + this.bytesTotal = event.total; + + this.percentComplete = Math.min((this.bytesLoaded / this.bytesTotal), 1); + + this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete); + } }, /** - * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * Usually overridden by the FileTypes and is called by Loader.nextFile. + * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage. * - * @method Phaser.Display.Masks.BitmapMask#preRenderCanvas + * @method Phaser.Loader.File#onProcess * @since 3.0.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to. - * @param {Phaser.GameObjects.GameObject} mask - The masked Game Object which would be rendered. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. */ - preRenderCanvas: function () + onProcess: function () { - // NOOP + this.state = CONST.FILE_PROCESSING; + + this.onProcessComplete(); }, /** - * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * Called when the File has completed processing. + * Checks on the state of its multifile, if set. * - * @method Phaser.Display.Masks.BitmapMask#postRenderCanvas - * @since 3.0.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to. + * @method Phaser.Loader.File#onProcessComplete + * @since 3.7.0 */ - postRenderCanvas: function () + onProcessComplete: function () { - // NOOP + this.state = CONST.FILE_COMPLETE; + + if (this.multiFile) + { + this.multiFile.onFileComplete(this); + } + + this.loader.fileProcessComplete(this); }, /** - * Destroys this BitmapMask and nulls any references it holds. + * Called when the File has completed processing but it generated an error. + * Checks on the state of its multifile, if set. * - * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, - * so be sure to call `clearMask` on any Game Object using it, before destroying it. + * @method Phaser.Loader.File#onProcessError + * @since 3.7.0 + */ + onProcessError: function () + { + // eslint-disable-next-line no-console + console.error('Failed to process file: %s "%s"', this.type, this.key); + + this.state = CONST.FILE_ERRORED; + + if (this.multiFile) + { + this.multiFile.onFileFailed(this); + } + + this.loader.fileProcessComplete(this); + }, + + /** + * Checks if a key matching the one used by this file exists in the target Cache or not. + * This is called automatically by the LoaderPlugin to decide if the file can be safely + * loaded or will conflict. * - * @method Phaser.Display.Masks.BitmapMask#destroy + * @method Phaser.Loader.File#hasCacheConflict + * @since 3.7.0 + * + * @return {boolean} `true` if adding this file will cause a conflict, otherwise `false`. + */ + hasCacheConflict: function () + { + return (this.cache && this.cache.exists(this.key)); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * This method is often overridden by specific file types. + * + * @method Phaser.Loader.File#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + if (this.cache && this.data) + { + this.cache.add(this.key, this.data); + } + }, + + /** + * Called once the file has been added to its cache and is now ready for deletion from the Loader. + * It will emit a `filecomplete` event from the LoaderPlugin. + * + * @method Phaser.Loader.File#pendingDestroy + * @fires Phaser.Loader.Events#FILE_COMPLETE + * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE + * @since 3.7.0 + */ + pendingDestroy: function (data) + { + if (this.state === CONST.FILE_PENDING_DESTROY) + { + return; + } + + if (data === undefined) { data = this.data; } + + var key = this.key; + var type = this.type; + + this.loader.emit(Events.FILE_COMPLETE, key, type, data); + this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data); + + this.loader.flagForRemoval(this); + + this.state = CONST.FILE_PENDING_DESTROY; + }, + + /** + * Destroy this File and any references it holds. + * + * @method Phaser.Loader.File#destroy * @since 3.7.0 */ destroy: function () { - this.bitmapMask = null; + this.loader = null; + this.cache = null; + this.xhrSettings = null; + this.multiFile = null; + this.linkFile = null; + this.data = null; } }); /** - * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. - * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask, - * not a clipping path. It is only available when using the WebGL Renderer. + * Static method for creating object URL using URL API and setting it as image 'src' attribute. + * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader. * - * A Bitmap Mask can use any Game Object, or Dynamic Texture, to determine the alpha of each pixel of the masked Game Object(s). - * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha - * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the - * Bitmap Mask doesn't matter. + * @method Phaser.Loader.File.createObjectURL + * @static + * @since 3.7.0 * - * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an - * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means - * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects - * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the - * corresponding pixel in the mask. - * - * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, - * combine Geometry Masks and Blend Modes together. - * - * The Bitmap Mask's location matches the location of its Game Object, not the location of the - * masked objects. Moving or transforming the underlying Game Object will change the mask - * (and affect the visibility of any masked objects), whereas moving or transforming a masked object - * will not affect the mask. - * - * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a - * Scene's display list, it will only be used for the mask and its full texture will not be directly - * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will - * render as a normal Game Object and will also serve as a mask. - * - * @method Phaser.GameObjects.GameObjectFactory#bitmapMask - * @since 3.60.0 - * - * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. - * @param {number} [x] - If creating a Game Object, the horizontal position in the world. - * @param {number} [y] - If creating a Game Object, the vertical position in the world. - * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. - * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. - * - * @return {Phaser.Display.Masks.BitmapMask} The Bitmap Mask that was created. + * @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL. + * @param {Blob} blob - A Blob object to create an object URL for. + * @param {string} defaultType - Default mime type used if blob type is not available. */ -GameObjectFactory.register('bitmapMask', function (maskObject, x, y, key, frame) +File.createObjectURL = function (image, blob, defaultType) { - return new BitmapMask(this.scene, maskObject, x, y, key, frame); -}); + if (typeof URL === 'function') + { + image.src = URL.createObjectURL(blob); + } + else + { + var reader = new FileReader(); -module.exports = BitmapMask; + reader.onload = function () + { + image.removeAttribute('crossOrigin'); + image.src = 'data:' + (blob.type || defaultType) + ';base64,' + reader.result.split(',')[1]; + }; + + reader.onerror = image.onerror; + + reader.readAsDataURL(blob); + } +}; + +/** + * Static method for releasing an existing object URL which was previously created + * by calling {@link File#createObjectURL} method. + * + * @method Phaser.Loader.File.revokeObjectURL + * @static + * @since 3.7.0 + * + * @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked. + */ +File.revokeObjectURL = function (image) +{ + if (typeof URL === 'function') + { + URL.revokeObjectURL(image.src); + } +}; + +module.exports = File; /***/ }), -/* 326 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 9845: +/***/ ((module) => { /** * @author Richard Davey @@ -44294,232 +31621,13484 @@ module.exports = BitmapMask; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(327); -var SceneEvents = __webpack_require__(23); +var types = {}; /** - * @classdesc - * The Game Object Factory is a Scene plugin that allows you to quickly create many common - * types of Game Objects and have them automatically registered with the Scene. - * - * Game Objects directly register themselves with the Factory and inject their own creation - * methods into the class. - * - * @class GameObjectFactory - * @memberof Phaser.GameObjects - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object Factory belongs. + * @namespace Phaser.Loader.FileTypesManager */ -var GameObjectFactory = new Class({ - initialize: - - function GameObjectFactory (scene) - { - /** - * The Scene to which this Game Object Factory belongs. - * - * @name Phaser.GameObjects.GameObjectFactory#scene - * @type {Phaser.Scene} - * @protected - * @since 3.0.0 - */ - this.scene = scene; - - /** - * A reference to the Scene.Systems. - * - * @name Phaser.GameObjects.GameObjectFactory#systems - * @type {Phaser.Scenes.Systems} - * @protected - * @since 3.0.0 - */ - this.systems = scene.sys; - - /** - * A reference to the Scene Event Emitter. - * - * @name Phaser.GameObjects.GameObjectFactory#events - * @type {Phaser.Events.EventEmitter} - * @protected - * @since 3.50.0 - */ - this.events = scene.sys.events; - - /** - * A reference to the Scene Display List. - * - * @name Phaser.GameObjects.GameObjectFactory#displayList - * @type {Phaser.GameObjects.DisplayList} - * @protected - * @since 3.0.0 - */ - this.displayList; - - /** - * A reference to the Scene Update List. - * - * @name Phaser.GameObjects.GameObjectFactory#updateList - * @type {Phaser.GameObjects.UpdateList} - * @protected - * @since 3.0.0 - */ - this.updateList; - - this.events.once(SceneEvents.BOOT, this.boot, this); - this.events.on(SceneEvents.START, this.start, this); - }, +var FileTypesManager = { /** - * This method is called automatically, only once, when the Scene is first created. - * Do not invoke it directly. + * Static method called when a LoaderPlugin is created. * - * @method Phaser.GameObjects.GameObjectFactory#boot - * @private - * @since 3.5.1 - */ - boot: function () - { - this.displayList = this.systems.displayList; - this.updateList = this.systems.updateList; - - this.events.once(SceneEvents.DESTROY, this.destroy, this); - }, - - /** - * This method is called automatically by the Scene when it is starting up. - * It is responsible for creating local systems, properties and listening for Scene events. - * Do not invoke it directly. + * Loops through the local types object and injects all of them as + * properties into the LoaderPlugin instance. * - * @method Phaser.GameObjects.GameObjectFactory#start - * @private - * @since 3.5.0 - */ - start: function () - { - this.events.once(SceneEvents.SHUTDOWN, this.shutdown, this); - }, - - /** - * Adds an existing Game Object to this Scene. - * - * If the Game Object renders, it will be added to the Display List. - * If it has a `preUpdate` method, it will be added to the Update List. - * - * @method Phaser.GameObjects.GameObjectFactory#existing + * @method Phaser.Loader.FileTypesManager.install * @since 3.0.0 * - * @generic {(Phaser.GameObjects.GameObject|Phaser.GameObjects.Group|Phaser.GameObjects.Layer)} G - [child,$return] - * - * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.Group|Phaser.GameObjects.Layer)} child - The child to be added to this Scene. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that was added. + * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into. */ - existing: function (child) + install: function (loader) { - if (child.renderCanvas || child.renderWebGL) + for (var key in types) { - this.displayList.add(child); + loader[key] = types[key]; } - - // For when custom objects have overridden `preUpdate` but don't hook into the ADDED_TO_SCENE event: - // Adding to the list multiple times is safe, as it won't add duplicates into the list anyway. - if (child.preUpdate) - { - this.updateList.add(child); - } - - return child; }, /** - * The Scene that owns this plugin is shutting down. - * We need to kill and reset all internal properties as well as stop listening to Scene events. + * Static method called directly by the File Types. * - * @method Phaser.GameObjects.GameObjectFactory#shutdown - * @private + * The key is a reference to the function used to load the files via the Loader, i.e. `image`. + * + * @method Phaser.Loader.FileTypesManager.register * @since 3.0.0 + * + * @param {string} key - The key that will be used as the method name in the LoaderPlugin. + * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked. */ - shutdown: function () + register: function (key, factoryFunction) { - this.events.off(SceneEvents.SHUTDOWN, this.shutdown, this); + types[key] = factoryFunction; }, /** - * The Scene that owns this plugin is being destroyed. - * We need to shutdown and then kill off all external references. + * Removed all associated file types. * - * @method Phaser.GameObjects.GameObjectFactory#destroy - * @private + * @method Phaser.Loader.FileTypesManager.destroy * @since 3.0.0 */ destroy: function () { - this.shutdown(); + types = {}; + } - this.events.off(SceneEvents.START, this.start, this); +}; - this.scene = null; - this.systems = null; - this.events = null; +module.exports = FileTypesManager; - this.displayList = null; - this.updateList = null; + +/***/ }), + +/***/ 5593: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Given a File and a baseURL value this returns the URL the File will use to download from. + * + * @function Phaser.Loader.GetURL + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - The File object. + * @param {string} baseURL - A default base URL. + * + * @return {string} The URL the File will use. + */ +var GetURL = function (file, baseURL) +{ + if (!file.url) + { + return false; + } + + if (file.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)) + { + return file.url; + } + else + { + return baseURL + file.url; + } +}; + +module.exports = GetURL; + + +/***/ }), + +/***/ 7410: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(1030); +var XHRSettings = __webpack_require__(707); + +/** + * Takes two XHRSettings Objects and creates a new XHRSettings object from them. + * + * The new object is seeded by the values given in the global settings, but any setting in + * the local object overrides the global ones. + * + * @function Phaser.Loader.MergeXHRSettings + * @since 3.0.0 + * + * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object. + * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object. + */ +var MergeXHRSettings = function (global, local) +{ + var output = (global === undefined) ? XHRSettings() : Extend({}, global); + + if (local) + { + for (var setting in local) + { + if (local[setting] !== undefined) + { + output[setting] = local[setting]; + } + } + } + + return output; +}; + +module.exports = MergeXHRSettings; + + +/***/ }), + +/***/ 3137: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var CONST = __webpack_require__(4359); +var Events = __webpack_require__(1179); + +/** + * @classdesc + * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after + * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. + * + * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. + * + * @class MultiFile + * @memberof Phaser.Loader + * @constructor + * @since 3.7.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. + * @param {string} type - The file type string for sorting within the Loader. + * @param {string} key - The key of the file within the loader. + * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile. + */ +var MultiFile = new Class({ + + initialize: + + function MultiFile (loader, type, key, files) + { + var finalFiles = []; + + // Clean out any potential 'null' or 'undefined' file entries + files.forEach(function (file) + { + if (file) + { + finalFiles.push(file); + } + }); + + /** + * A reference to the Loader that is going to load this file. + * + * @name Phaser.Loader.MultiFile#loader + * @type {Phaser.Loader.LoaderPlugin} + * @since 3.7.0 + */ + this.loader = loader; + + /** + * The file type string for sorting within the Loader. + * + * @name Phaser.Loader.MultiFile#type + * @type {string} + * @since 3.7.0 + */ + this.type = type; + + /** + * Unique cache key (unique within its file type) + * + * @name Phaser.Loader.MultiFile#key + * @type {string} + * @since 3.7.0 + */ + this.key = key; + + /** + * The current index being used by multi-file loaders to avoid key clashes. + * + * @name Phaser.Loader.MultiFile#multiKeyIndex + * @type {number} + * @private + * @since 3.20.0 + */ + this.multiKeyIndex = loader.multiKeyIndex++; + + /** + * Array of files that make up this MultiFile. + * + * @name Phaser.Loader.MultiFile#files + * @type {Phaser.Loader.File[]} + * @since 3.7.0 + */ + this.files = finalFiles; + + /** + * The current state of the file. One of the FILE_CONST values. + * + * @name Phaser.Loader.MultiFile#state + * @type {number} + * @since 3.60.0 + */ + this.state = CONST.FILE_PENDING; + + /** + * The completion status of this MultiFile. + * + * @name Phaser.Loader.MultiFile#complete + * @type {boolean} + * @default false + * @since 3.7.0 + */ + this.complete = false; + + /** + * The number of files to load. + * + * @name Phaser.Loader.MultiFile#pending + * @type {number} + * @since 3.7.0 + */ + + this.pending = finalFiles.length; + + /** + * The number of files that failed to load. + * + * @name Phaser.Loader.MultiFile#failed + * @type {number} + * @default 0 + * @since 3.7.0 + */ + this.failed = 0; + + /** + * A storage container for transient data that the loading files need. + * + * @name Phaser.Loader.MultiFile#config + * @type {any} + * @since 3.7.0 + */ + this.config = {}; + + /** + * A reference to the Loaders baseURL at the time this MultiFile was created. + * Used to populate child-files. + * + * @name Phaser.Loader.MultiFile#baseURL + * @type {string} + * @since 3.20.0 + */ + this.baseURL = loader.baseURL; + + /** + * A reference to the Loaders path at the time this MultiFile was created. + * Used to populate child-files. + * + * @name Phaser.Loader.MultiFile#path + * @type {string} + * @since 3.20.0 + */ + this.path = loader.path; + + /** + * A reference to the Loaders prefix at the time this MultiFile was created. + * Used to populate child-files. + * + * @name Phaser.Loader.MultiFile#prefix + * @type {string} + * @since 3.20.0 + */ + this.prefix = loader.prefix; + + // Link the files + for (var i = 0; i < finalFiles.length; i++) + { + finalFiles[i].multiFile = this; + } + }, + + /** + * Checks if this MultiFile is ready to process its children or not. + * + * @method Phaser.Loader.MultiFile#isReadyToProcess + * @since 3.7.0 + * + * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`. + */ + isReadyToProcess: function () + { + return (this.pending === 0 && this.failed === 0 && !this.complete); + }, + + /** + * Adds another child to this MultiFile, increases the pending count and resets the completion status. + * + * @method Phaser.Loader.MultiFile#addToMultiFile + * @since 3.7.0 + * + * @param {Phaser.Loader.File} files - The File to add to this MultiFile. + * + * @return {Phaser.Loader.MultiFile} This MultiFile instance. + */ + addToMultiFile: function (file) + { + this.files.push(file); + + file.multiFile = this; + + this.pending++; + + this.complete = false; + + return this; + }, + + /** + * Called by each File when it finishes loading. + * + * @method Phaser.Loader.MultiFile#onFileComplete + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The File that has completed processing. + */ + onFileComplete: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.pending--; + } + }, + + /** + * Called by each File that fails to load. + * + * @method Phaser.Loader.MultiFile#onFileFailed + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The File that has failed to load. + */ + onFileFailed: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.failed++; + + // eslint-disable-next-line no-console + console.error('File failed: %s "%s" (via %s "%s")', this.type, this.key, file.type, file.key); + } + }, + + /** + * Called once all children of this multi file have been added to their caches and is now + * ready for deletion from the Loader. + * + * It will emit a `filecomplete` event from the LoaderPlugin. + * + * @method Phaser.Loader.MultiFile#pendingDestroy + * @fires Phaser.Loader.Events#FILE_COMPLETE + * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE + * @since 3.60.0 + */ + pendingDestroy: function () + { + if (this.state === CONST.FILE_PENDING_DESTROY) + { + return; + } + + var key = this.key; + var type = this.type; + + this.loader.emit(Events.FILE_COMPLETE, key, type); + this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type); + + this.loader.flagForRemoval(this); + + for (var i = 0; i < this.files.length; i++) + { + this.files[i].pendingDestroy(); + } + + this.state = CONST.FILE_PENDING_DESTROY; + }, + + /** + * Destroy this Multi File and any references it holds. + * + * @method Phaser.Loader.MultiFile#destroy + * @since 3.60.0 + */ + destroy: function () + { + this.loader = null; + this.files = null; + this.config = null; + } + +}); + +module.exports = MultiFile; + + +/***/ }), + +/***/ 5874: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MergeXHRSettings = __webpack_require__(7410); + +/** + * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings + * and starts the download of it. It uses the Files own XHRSettings and merges them + * with the global XHRSettings object to set the xhr values before download. + * + * @function Phaser.Loader.XHRLoader + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - The File to download. + * @param {Phaser.Types.Loader.XHRSettingsObject} globalXHRSettings - The global XHRSettings object. + * + * @return {XMLHttpRequest} The XHR object. + */ +var XHRLoader = function (file, globalXHRSettings) +{ + var config = MergeXHRSettings(globalXHRSettings, file.xhrSettings); + + var xhr = new XMLHttpRequest(); + + xhr.open('GET', file.src, config.async, config.user, config.password); + + xhr.responseType = file.xhrSettings.responseType; + xhr.timeout = config.timeout; + + if (config.headers) + { + for (var key in config.headers) + { + xhr.setRequestHeader(key, config.headers[key]); + } + } + + if (config.header && config.headerValue) + { + xhr.setRequestHeader(config.header, config.headerValue); + } + + if (config.requestedWith) + { + xhr.setRequestHeader('X-Requested-With', config.requestedWith); + } + + if (config.overrideMimeType) + { + xhr.overrideMimeType(config.overrideMimeType); + } + + if (config.withCredentials) + { + xhr.withCredentials = true; + } + + // After a successful request, the xhr.response property will contain the requested data as a DOMString, ArrayBuffer, Blob, or Document (depending on what was set for responseType.) + + xhr.onload = file.onLoad.bind(file, xhr); + xhr.onerror = file.onError.bind(file, xhr); + xhr.onprogress = file.onProgress.bind(file); + + // This is the only standard method, the ones above are browser additions (maybe not universal?) + // xhr.onreadystatechange + + xhr.send(); + + return xhr; +}; + +module.exports = XHRLoader; + + +/***/ }), + +/***/ 707: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Creates an XHRSettings Object with default values. + * + * @function Phaser.Loader.XHRSettings + * @since 3.0.0 + * + * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'. + * @param {boolean} [async=true] - Should the XHR request use async or not? + * @param {string} [user=''] - Optional username for the XHR request. + * @param {string} [password=''] - Optional password for the XHR request. + * @param {number} [timeout=0] - Optional XHR timeout value. + * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. + */ +var XHRSettings = function (responseType, async, user, password, timeout, withCredentials) +{ + if (responseType === undefined) { responseType = ''; } + if (async === undefined) { async = true; } + if (user === undefined) { user = ''; } + if (password === undefined) { password = ''; } + if (timeout === undefined) { timeout = 0; } + if (withCredentials === undefined) { withCredentials = false; } + + // Before sending a request, set the xhr.responseType to "text", + // "arraybuffer", "blob", or "document", depending on your data needs. + // Note, setting xhr.responseType = '' (or omitting) will default the response to "text". + + return { + + // Ignored by the Loader, only used by File. + responseType: responseType, + + async: async, + + // credentials + user: user, + password: password, + + // timeout in ms (0 = no timeout) + timeout: timeout, + + // setRequestHeader + headers: undefined, + header: undefined, + headerValue: undefined, + requestedWith: false, + + // overrideMimeType + overrideMimeType: undefined, + + // withCredentials + withCredentials: withCredentials + + }; +}; + +module.exports = XHRSettings; + + +/***/ }), + +/***/ 4359: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FILE_CONST = { + + /** + * The Loader is idle. + * + * @name Phaser.Loader.LOADER_IDLE + * @type {number} + * @since 3.0.0 + */ + LOADER_IDLE: 0, + + /** + * The Loader is actively loading. + * + * @name Phaser.Loader.LOADER_LOADING + * @type {number} + * @since 3.0.0 + */ + LOADER_LOADING: 1, + + /** + * The Loader is processing files is has loaded. + * + * @name Phaser.Loader.LOADER_PROCESSING + * @type {number} + * @since 3.0.0 + */ + LOADER_PROCESSING: 2, + + /** + * The Loader has completed loading and processing. + * + * @name Phaser.Loader.LOADER_COMPLETE + * @type {number} + * @since 3.0.0 + */ + LOADER_COMPLETE: 3, + + /** + * The Loader is shutting down. + * + * @name Phaser.Loader.LOADER_SHUTDOWN + * @type {number} + * @since 3.0.0 + */ + LOADER_SHUTDOWN: 4, + + /** + * The Loader has been destroyed. + * + * @name Phaser.Loader.LOADER_DESTROYED + * @type {number} + * @since 3.0.0 + */ + LOADER_DESTROYED: 5, + + /** + * File is in the load queue but not yet started. + * + * @name Phaser.Loader.FILE_PENDING + * @type {number} + * @since 3.0.0 + */ + FILE_PENDING: 10, + + /** + * File has been started to load by the loader (onLoad called) + * + * @name Phaser.Loader.FILE_LOADING + * @type {number} + * @since 3.0.0 + */ + FILE_LOADING: 11, + + /** + * File has loaded successfully, awaiting processing. + * + * @name Phaser.Loader.FILE_LOADED + * @type {number} + * @since 3.0.0 + */ + FILE_LOADED: 12, + + /** + * File failed to load. + * + * @name Phaser.Loader.FILE_FAILED + * @type {number} + * @since 3.0.0 + */ + FILE_FAILED: 13, + + /** + * File is being processed (onProcess callback) + * + * @name Phaser.Loader.FILE_PROCESSING + * @type {number} + * @since 3.0.0 + */ + FILE_PROCESSING: 14, + + /** + * The File has errored somehow during processing. + * + * @name Phaser.Loader.FILE_ERRORED + * @type {number} + * @since 3.0.0 + */ + FILE_ERRORED: 16, + + /** + * File has finished processing. + * + * @name Phaser.Loader.FILE_COMPLETE + * @type {number} + * @since 3.0.0 + */ + FILE_COMPLETE: 17, + + /** + * File has been destroyed. + * + * @name Phaser.Loader.FILE_DESTROYED + * @type {number} + * @since 3.0.0 + */ + FILE_DESTROYED: 18, + + /** + * File was populated from local data and doesn't need an HTTP request. + * + * @name Phaser.Loader.FILE_POPULATED + * @type {number} + * @since 3.0.0 + */ + FILE_POPULATED: 19, + + /** + * File is pending being destroyed. + * + * @name Phaser.Loader.FILE_PENDING_DESTROY + * @type {number} + * @since 3.60.0 + */ + FILE_PENDING_DESTROY: 20 + +}; + +module.exports = FILE_CONST; + + +/***/ }), + +/***/ 462: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Add File Event. + * + * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue. + * + * Listen to it from a Scene using: `this.load.on('addfile', listener)`. + * + * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them. + * + * @event Phaser.Loader.Events#ADD + * @type {string} + * @since 3.0.0 + * + * @param {string} key - The unique key of the file that was added to the Loader. + * @param {string} type - The [file type]{@link Phaser.Loader.File#type} string of the file that was added to the Loader, i.e. `image`. + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @param {Phaser.Loader.File} file - A reference to the File which was added to the Loader. + */ +module.exports = 'addfile'; + + +/***/ }), + +/***/ 7297: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Complete Event. + * + * This event is dispatched when the Loader has fully processed everything in the load queue. + * By this point every loaded file will now be in its associated cache and ready for use. + * + * Listen to it from a Scene using: `this.load.on('complete', listener)`. + * + * @event Phaser.Loader.Events#COMPLETE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @param {number} totalComplete - The total number of files that successfully loaded. + * @param {number} totalFailed - The total number of files that failed to load. + */ +module.exports = 'complete'; + + +/***/ }), + +/***/ 8660: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Complete Event. + * + * This event is dispatched by the Loader Plugin when _any_ file in the queue finishes loading. + * + * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`. + * + * Make sure you remove this listener when you have finished, or it will continue to fire if the Scene reloads. + * + * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. + * + * @event Phaser.Loader.Events#FILE_COMPLETE + * @type {string} + * @since 3.0.0 + * + * @param {string} key - The key of the file that just loaded and finished processing. + * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. + * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. + */ +module.exports = 'filecomplete'; + + +/***/ }), + +/***/ 6484: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Complete Event. + * + * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. + * + * It uses a special dynamic event name constructed from the key and type of the file. + * + * For example, if you have loaded an `image` with a key of `monster`, you can listen for it + * using the following: + * + * ```javascript + * this.load.on('filecomplete-image-monster', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Or, if you have loaded a texture `atlas` with a key of `Level1`: + * + * ```javascript + * this.load.on('filecomplete-atlasjson-Level1', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`: + * + * ```javascript + * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Make sure you remove your listeners when you have finished, or they will continue to fire if the Scene reloads. + * + * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event. + * + * @event Phaser.Loader.Events#FILE_KEY_COMPLETE + * @type {string} + * @since 3.0.0 + * + * @param {string} key - The key of the file that just loaded and finished processing. + * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. + * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. + */ +module.exports = 'filecomplete-'; + + +/***/ }), + +/***/ 7972: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Error Event. + * + * This event is dispatched by the Loader Plugin when a file fails to load. + * + * Listen to it from a Scene using: `this.load.on('loaderror', listener)`. + * + * @event Phaser.Loader.Events#FILE_LOAD_ERROR + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + */ +module.exports = 'loaderror'; + + +/***/ }), + +/***/ 1906: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Event. + * + * This event is dispatched by the Loader Plugin when a file finishes loading, + * but _before_ it is processed and added to the internal Phaser caches. + * + * Listen to it from a Scene using: `this.load.on('load', listener)`. + * + * @event Phaser.Loader.Events#FILE_LOAD + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which just finished loading. + */ +module.exports = 'load'; + + +/***/ }), + +/***/ 1441: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Progress Event. + * + * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and + * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen. + * + * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`. + * + * @event Phaser.Loader.Events#FILE_PROGRESS + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + * @param {number} percentComplete - A value between 0 and 1 indicating how 'complete' this file is. + */ +module.exports = 'fileprogress'; + + +/***/ }), + +/***/ 1072: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Post Process Event. + * + * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue. + * It is dispatched before the internal lists are cleared and each File is destroyed. + * + * Use this hook to perform any last minute processing of files that can only happen once the + * Loader has completed, but prior to it emitting the `complete` event. + * + * Listen to it from a Scene using: `this.load.on('postprocess', listener)`. + * + * @event Phaser.Loader.Events#POST_PROCESS + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'postprocess'; + + +/***/ }), + +/***/ 1927: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Progress Event. + * + * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading. + * + * Listen to it from a Scene using: `this.load.on('progress', listener)`. + * + * @event Phaser.Loader.Events#PROGRESS + * @type {string} + * @since 3.0.0 + * + * @param {number} progress - The current progress of the load. A value between 0 and 1. + */ +module.exports = 'progress'; + + +/***/ }), + +/***/ 6597: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Start Event. + * + * This event is dispatched when the Loader starts running. At this point load progress is zero. + * + * This event is dispatched even if there aren't any files in the load queue. + * + * Listen to it from a Scene using: `this.load.on('start', listener)`. + * + * @event Phaser.Loader.Events#START + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'start'; + + +/***/ }), + +/***/ 1179: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Loader.Events + */ + +module.exports = { + + ADD: __webpack_require__(462), + COMPLETE: __webpack_require__(7297), + FILE_COMPLETE: __webpack_require__(8660), + FILE_KEY_COMPLETE: __webpack_require__(6484), + FILE_LOAD_ERROR: __webpack_require__(7972), + FILE_LOAD: __webpack_require__(1906), + FILE_PROGRESS: __webpack_require__(1441), + POST_PROCESS: __webpack_require__(1072), + PROGRESS: __webpack_require__(1927), + START: __webpack_require__(6597) + +}; + + +/***/ }), + +/***/ 6732: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var CONST = __webpack_require__(4359); +var File = __webpack_require__(1593); +var FileTypesManager = __webpack_require__(9845); +var GetFastValue = __webpack_require__(4597); +var IsPlainObject = __webpack_require__(2482); +var GetURL = __webpack_require__(5593); + +/** + * @classdesc + * A single Image File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image. + * + * @class ImageFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets. + */ +var ImageFile = new Class({ + + Extends: File, + + initialize: + + function ImageFile (loader, key, url, xhrSettings, frameConfig) + { + var extension = 'png'; + var normalMapURL; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + normalMapURL = GetFastValue(config, 'normalMap'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + frameConfig = GetFastValue(config, 'frameConfig'); + } + + if (Array.isArray(url)) + { + normalMapURL = url[1]; + url = url[0]; + } + + var fileConfig = { + type: 'image', + cache: loader.textureManager, + extension: extension, + responseType: 'blob', + key: key, + url: url, + xhrSettings: xhrSettings, + config: frameConfig + }; + + File.call(this, loader, fileConfig); + + // Do we have a normal map to load as well? + if (normalMapURL) + { + var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig); + + normalMap.type = 'normalMap'; + + this.setLink(normalMap); + + loader.addFile(normalMap); + } + + this.useImageElementLoad = loader.imageLoadType === 'HTMLImageElement'; + + if (this.useImageElementLoad) + { + this.load = this.loadImage; + this.onProcess = this.onProcessImage; + } + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.ImageFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = new Image(); + + this.data.crossOrigin = this.crossOrigin; + + var _this = this; + + this.data.onload = function () + { + File.revokeObjectURL(_this.data); + + _this.onProcessComplete(); + }; + + this.data.onerror = function () + { + File.revokeObjectURL(_this.data); + + _this.onProcessError(); + }; + + File.createObjectURL(this.data, this.xhrLoader.response, 'image/png'); + }, + + /** + * Handles image load processing. + * + * @method Phaser.Loader.FileTypes.ImageFile#onProcessImage + * @private + * @since 3.60.0 + */ + onProcessImage: function () + { + var result = this.state; + + this.state = CONST.FILE_PROCESSING; + + if (result === CONST.FILE_LOADED) + { + this.onProcessComplete(); + } + else + { + this.onProcessError(); + } + }, + + /** + * Loads the image using either XHR or an Image tag. + * + * @method Phaser.Loader.FileTypes.ImageFile#loadImage + * @private + * @since 3.60.0 + */ + loadImage: function () + { + this.state = CONST.FILE_LOADING; + + this.src = GetURL(this, this.loader.baseURL); + + if (this.src.indexOf('data:') === 0) + { + console.warn('Local data URIs are not supported: ' + this.key); + } + else + { + this.data = new Image(); + + this.data.crossOrigin = this.crossOrigin; + + var _this = this; + + this.data.onload = function () + { + _this.state = CONST.FILE_LOADED; + + _this.loader.nextFile(_this, true); + }; + + this.data.onerror = function () + { + _this.loader.nextFile(_this, false); + }; + + this.data.src = this.src; + } + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.ImageFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + // Check if we have a linked normal map + var linkFile = this.linkFile; + + if (linkFile) + { + // We do, but has it loaded? + if (linkFile.state >= CONST.FILE_COMPLETE) + { + // Both files have loaded + if (this.type === 'normalMap') + { + // linkFile.data = Image + // this.data = Normal Map + this.cache.addImage(this.key, linkFile.data, this.data); + } + else + { + // linkFile.data = Normal Map + // this.data = Image + this.cache.addImage(this.key, this.data, linkFile.data); + } + } + + // Nothing to do here, we'll use the linkFile `addToCache` call + // to process this pair + } + else + { + this.cache.addImage(this.key, this.data); + } } }); /** - * Static method called directly by the Game Object factory functions. - * With this method you can register a custom GameObject factory in the GameObjectFactory, - * providing a name (`factoryType`) and the constructor (`factoryFunction`) in order - * to be called when you call to Phaser.Scene.add[ factoryType ] method. + * Adds an Image, or array of Images, to the current load queue. * - * @method Phaser.GameObjects.GameObjectFactory.register - * @static + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.image('logo', 'images/phaserLogo.png'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback + * of animated gifs to Canvas elements. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.image('logo', 'images/AtariLogo.png'); + * // and later in your game ... + * this.add.image(x, y, 'logo'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png', + * normalMap: 'images/AtariLogo-n.png' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * In Phaser 3.60 a new property was added that allows you to control how images are loaded. By default, images are loaded via XHR as Blobs. + * However, you can set `loader.imageLoadType: "HTMLImageElement"` in the Game Configuration and instead, the Loader will load all images + * via the Image tag instead. + * + * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#image + * @fires Phaser.Loader.LoaderPlugin#ADD * @since 3.0.0 * - * @param {string} factoryType - The key of the factory that you will use to call to Phaser.Scene.add[ factoryType ] method. - * @param {function} factoryFunction - The constructor function to be called when you invoke to the Phaser.Scene.add method. - */ -GameObjectFactory.register = function (factoryType, factoryFunction) -{ - if (!GameObjectFactory.prototype.hasOwnProperty(factoryType)) - { - GameObjectFactory.prototype[factoryType] = factoryFunction; - } -}; - -/** - * Static method called directly by the Game Object factory functions. - * With this method you can remove a custom GameObject factory registered in the GameObjectFactory, - * providing a its `factoryType`. + * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig|Phaser.Types.Loader.FileTypes.ImageFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * - * @method Phaser.GameObjects.GameObjectFactory.remove - * @static - * @since 3.0.0 - * - * @param {string} factoryType - The key of the factory that you want to remove from the GameObjectFactory. + * @return {this} The Loader instance. */ -GameObjectFactory.remove = function (factoryType) +FileTypesManager.register('image', function (key, url, xhrSettings) { - if (GameObjectFactory.prototype.hasOwnProperty(factoryType)) + if (Array.isArray(key)) { - delete GameObjectFactory.prototype[factoryType]; + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new ImageFile(this, key[i])); + } + } + else + { + this.addFile(new ImageFile(this, key, url, xhrSettings)); } -}; -PluginCache.register('GameObjectFactory', GameObjectFactory, 'add'); + return this; +}); -module.exports = GameObjectFactory; +module.exports = ImageFile; /***/ }), -/* 327 */ -/***/ (function(module, exports) { + +/***/ 704: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var CONST = __webpack_require__(4359); +var File = __webpack_require__(1593); +var FileTypesManager = __webpack_require__(9845); +var GetFastValue = __webpack_require__(4597); +var GetValue = __webpack_require__(5851); +var IsPlainObject = __webpack_require__(2482); + +/** + * @classdesc + * A single JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. + * + * @class JSONFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + */ +var JSONFile = new Class({ + + Extends: File, + + initialize: + + // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object + // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing + + function JSONFile (loader, key, url, xhrSettings, dataKey) + { + var extension = 'json'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + dataKey = GetFastValue(config, 'dataKey', dataKey); + } + + var fileConfig = { + type: 'json', + cache: loader.cacheManager.json, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings, + config: dataKey + }; + + File.call(this, loader, fileConfig); + + // A JSON object has been provided (instead of a URL), so we'll use it directly as the File.data. No need to load it. + if (IsPlainObject(url)) + { + if (dataKey) + { + this.data = GetValue(url, dataKey); + } + else + { + this.data = url; + } + + this.state = CONST.FILE_POPULATED; + } + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.JSONFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + if (this.state !== CONST.FILE_POPULATED) + { + this.state = CONST.FILE_PROCESSING; + + try + { + var json = JSON.parse(this.xhrLoader.responseText); + } + catch (e) + { + this.onProcessError(); + + throw e; + } + + var key = this.config; + + if (typeof key === 'string') + { + this.data = GetValue(json, key, json); + } + else + { + this.data = json; + } + } + + this.onProcessComplete(); + } + +}); + +/** + * Adds a JSON file, or array of JSON files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.json({ + * key: 'wavedata', + * url: 'files/AlienWaveData.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * // and later in your game ... + * var data = this.cache.json.get('wavedata'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#json + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {this} The Loader instance. + */ +FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new JSONFile(this, key[i])); + } + } + else + { + this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); + } + + return this; +}); + +module.exports = JSONFile; + + +/***/ }), + +/***/ 1192: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var CONST = __webpack_require__(4359); +var File = __webpack_require__(1593); +var FileTypesManager = __webpack_require__(9845); +var GetFastValue = __webpack_require__(4597); +var IsPlainObject = __webpack_require__(2482); + +/** + * @classdesc + * A single Text File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text. + * + * @class TextFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var TextFile = new Class({ + + Extends: File, + + initialize: + + function TextFile (loader, key, url, xhrSettings) + { + var type = 'text'; + var extension = 'txt'; + var cache = loader.cacheManager.text; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + type = GetFastValue(config, 'type', type); + cache = GetFastValue(config, 'cache', cache); + } + + var fileConfig = { + type: type, + cache: cache, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.TextFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = this.xhrLoader.responseText; + + this.onProcessComplete(); + } + +}); + +/** + * Adds a Text file, or array of Text files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.text('story', 'files/IntroStory.txt'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Text Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.text({ + * key: 'story', + * url: 'files/IntroStory.txt' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.text('story', 'files/IntroStory.txt'); + * // and later in your game ... + * var data = this.cache.text.get('story'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Text Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.txt". It will always add `.txt` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#text + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig|Phaser.Types.Loader.FileTypes.TextFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {this} The Loader instance. + */ +FileTypesManager.register('text', function (key, url, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new TextFile(this, key[i])); + } + } + else + { + this.addFile(new TextFile(this, key, url, xhrSettings)); + } + + return this; +}); + +module.exports = TextFile; + + +/***/ }), + +/***/ 3136: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the mean average of the given values. + * + * @function Phaser.Math.Average + * @since 3.0.0 + * + * @param {number[]} values - The values to average. + * + * @return {number} The average value. + */ +var Average = function (values) +{ + var sum = 0; + + for (var i = 0; i < values.length; i++) + { + sum += (+values[i]); + } + + return sum / values.length; +}; + +module.exports = Average; + + +/***/ }), + +/***/ 785: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Factorial = __webpack_require__(3916); + +/** + * Calculates the Bernstein basis from the three factorial coefficients. + * + * @function Phaser.Math.Bernstein + * @since 3.0.0 + * + * @param {number} n - The first value. + * @param {number} i - The second value. + * + * @return {number} The Bernstein basis of Factorial(n) / Factorial(i) / Factorial(n - i) + */ +var Bernstein = function (n, i) +{ + return Factorial(n) / Factorial(i) / Factorial(n - i); +}; + +module.exports = Bernstein; + + +/***/ }), + +/***/ 7025: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random integer between the `min` and `max` values, inclusive. + * + * @function Phaser.Math.Between + * @since 3.0.0 + * + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. + * + * @return {number} The random integer. + */ +var Between = function (min, max) +{ + return Math.floor(Math.random() * (max - min + 1) + min); +}; + +module.exports = Between; + + +/***/ }), + +/***/ 48: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a Catmull-Rom value from the given points, based on an alpha of 0.5. + * + * @function Phaser.Math.CatmullRom + * @since 3.0.0 + * + * @param {number} t - The amount to interpolate by. + * @param {number} p0 - The first control point. + * @param {number} p1 - The second control point. + * @param {number} p2 - The third control point. + * @param {number} p3 - The fourth control point. + * + * @return {number} The Catmull-Rom value. + */ +var CatmullRom = function (t, p0, p1, p2, p3) +{ + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + var t2 = t * t; + var t3 = t * t2; + + return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1; +}; + +module.exports = CatmullRom; + + +/***/ }), + +/***/ 5035: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Ceils to some place comparative to a `base`, default is 10 for decimal place. + * + * The `place` is represented by the power applied to `base` to get that place. + * + * @function Phaser.Math.CeilTo + * @since 3.0.0 + * + * @param {number} value - The value to round. + * @param {number} [place=0] - The place to round to. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. + * + * @return {number} The rounded value. + */ +var CeilTo = function (value, place, base) +{ + if (place === undefined) { place = 0; } + if (base === undefined) { base = 10; } + + var p = Math.pow(base, -place); + + return Math.ceil(value * p) / p; +}; + +module.exports = CeilTo; + + +/***/ }), + +/***/ 2915: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Force a value within the boundaries by clamping it to the range `min`, `max`. + * + * @function Phaser.Math.Clamp + * @since 3.0.0 + * + * @param {number} value - The value to be clamped. + * @param {number} min - The minimum bounds. + * @param {number} max - The maximum bounds. + * + * @return {number} The clamped value. + */ +var Clamp = function (value, min, max) +{ + return Math.max(min, Math.min(max, value)); +}; + +module.exports = Clamp; + + +/***/ }), + +/***/ 7149: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(7425); + +/** + * Convert the given angle from degrees, to the equivalent angle in radians. + * + * @function Phaser.Math.DegToRad + * @since 3.0.0 + * + * @param {number} degrees - The angle (in degrees) to convert to radians. + * + * @return {number} The given angle converted to radians. + */ +var DegToRad = function (degrees) +{ + return degrees * CONST.DEG_TO_RAD; +}; + +module.exports = DegToRad; + + +/***/ }), + +/***/ 2975: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the positive difference of two given numbers. + * + * @function Phaser.Math.Difference + * @since 3.0.0 + * + * @param {number} a - The first number in the calculation. + * @param {number} b - The second number in the calculation. + * + * @return {number} The positive difference of the two given numbers. + */ +var Difference = function (a, b) +{ + return Math.abs(a - b); +}; + +module.exports = Difference; + + +/***/ }), + +/***/ 2107: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(2915); +var Class = __webpack_require__(7473); +var Matrix4 = __webpack_require__(9652); +var NOOP = __webpack_require__(1984); + +var tempMatrix = new Matrix4(); + +/** + * @classdesc + * + * @class Euler + * @memberof Phaser.Math + * @constructor + * @since 3.50.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Euler = new Class({ + + initialize: + + function Euler (x, y, z, order) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (z === undefined) { z = 0; } + if (order === undefined) { order = Euler.DefaultOrder; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback = NOOP; + }, + + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + order: { + get: function () + { + return this._order; + }, + + set: function (value) + { + this._order = value; + + this.onChangeCallback(this); + } + }, + + set: function (x, y, z, order) + { + if (order === undefined) { order = this._order; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback(this); + + return this; + }, + + copy: function (euler) + { + return this.set(euler.x, euler.y, euler.z, euler.order); + }, + + setFromQuaternion: function (quaternion, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + tempMatrix.fromQuat(quaternion); + + return this.setFromRotationMatrix(tempMatrix, order, update); + }, + + setFromRotationMatrix: function (matrix, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + var elements = matrix.val; + + // Upper 3x3 of matrix is un-scaled rotation matrix + var m11 = elements[0]; + var m12 = elements[4]; + var m13 = elements[8]; + var m21 = elements[1]; + var m22 = elements[5]; + var m23 = elements[9]; + var m31 = elements[2]; + var m32 = elements[6]; + var m33 = elements[10]; + + var x = 0; + var y = 0; + var z = 0; + var epsilon = 0.99999; + + switch (order) + { + case 'XYZ': + { + y = Math.asin(Clamp(m13, -1, 1)); + + if (Math.abs(m13) < epsilon) + { + x = Math.atan2(-m23, m33); + z = Math.atan2(-m12, m11); + } + else + { + x = Math.atan2(m32, m22); + } + + break; + } + + case 'YXZ': + { + x = Math.asin(-Clamp(m23, -1, 1)); + + if (Math.abs(m23) < epsilon) + { + y = Math.atan2(m13, m33); + z = Math.atan2(m21, m22); + } + else + { + y = Math.atan2(-m31, m11); + } + + break; + } + + case 'ZXY': + { + x = Math.asin(Clamp(m32, -1, 1)); + + if (Math.abs(m32) < epsilon) + { + y = Math.atan2(-m31, m33); + z = Math.atan2(-m12, m22); + } + else + { + z = Math.atan2(m21, m11); + } + + break; + } + + case 'ZYX': + { + y = Math.asin(-Clamp(m31, -1, 1)); + + if (Math.abs(m31) < epsilon) + { + x = Math.atan2(m32, m33); + z = Math.atan2(m21, m11); + } + else + { + z = Math.atan2(-m12, m22); + } + + break; + } + + case 'YZX': + { + z = Math.asin(Clamp(m21, -1, 1)); + + if (Math.abs(m21) < epsilon) + { + x = Math.atan2(-m23, m22); + y = Math.atan2(-m31, m11); + } + else + { + y = Math.atan2(m13, m33); + } + + break; + } + + case 'XZY': + { + z = Math.asin(-Clamp(m12, -1, 1)); + + if (Math.abs(m12) < epsilon) + { + x = Math.atan2(m32, m22); + y = Math.atan2(m13, m11); + } + else + { + x = Math.atan2(-m23, m33); + } + + break; + } + } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + if (update) + { + this.onChangeCallback(this); + } + + return this; + } + +}); + +Euler.RotationOrders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ]; + +Euler.DefaultOrder = 'XYZ'; + +module.exports = Euler; + + +/***/ }), + +/***/ 3916: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the factorial of a given number for integer values greater than 0. + * + * @function Phaser.Math.Factorial + * @since 3.0.0 + * + * @param {number} value - A positive integer to calculate the factorial of. + * + * @return {number} The factorial of the given number. + */ +var Factorial = function (value) +{ + if (value === 0) + { + return 1; + } + + var res = value; + + while (--value) + { + res *= value; + } + + return res; +}; + +module.exports = Factorial; + + +/***/ }), + +/***/ 104: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Generate a random floating point number between the two given bounds, minimum inclusive, maximum exclusive. + * + * @function Phaser.Math.FloatBetween + * @since 3.0.0 + * + * @param {number} min - The lower bound for the float, inclusive. + * @param {number} max - The upper bound for the float exclusive. + * + * @return {number} A random float within the given range. + */ +var FloatBetween = function (min, max) +{ + return Math.random() * (max - min) + min; +}; + +module.exports = FloatBetween; + + +/***/ }), + +/***/ 4941: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Floors to some place comparative to a `base`, default is 10 for decimal place. + * + * The `place` is represented by the power applied to `base` to get that place. + * + * @function Phaser.Math.FloorTo + * @since 3.0.0 + * + * @param {number} value - The value to round. + * @param {number} [place=0] - The place to round to. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. + * + * @return {number} The rounded value. + */ +var FloorTo = function (value, place, base) +{ + if (place === undefined) { place = 0; } + if (base === undefined) { base = 10; } + + var p = Math.pow(base, -place); + + return Math.floor(value * p) / p; +}; + +module.exports = FloorTo; + + +/***/ }), + +/***/ 1555: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(2915); + +/** + * Return a value based on the range between `min` and `max` and the percentage given. + * + * @function Phaser.Math.FromPercent + * @since 3.0.0 + * + * @param {number} percent - A value between 0 and 1 representing the percentage. + * @param {number} min - The minimum value. + * @param {number} [max] - The maximum value. + * + * @return {number} The value that is `percent` percent between `min` and `max`. + */ +var FromPercent = function (percent, min, max) +{ + percent = Clamp(percent, 0, 1); + + return (max - min) * percent + min; +}; + +module.exports = FromPercent; + + +/***/ }), + +/***/ 5005: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate a per-ms speed from a distance and time (given in seconds). + * + * @function Phaser.Math.GetSpeed + * @since 3.0.0 + * + * @param {number} distance - The distance. + * @param {number} time - The time, in seconds. + * + * @return {number} The speed, in distance per ms. + * + * @example + * // 400px over 1 second is 0.4 px/ms + * Phaser.Math.GetSpeed(400, 1) // -> 0.4 + */ +var GetSpeed = function (distance, time) +{ + return (distance / time) / 1000; +}; + +module.exports = GetSpeed; + + +/***/ }), + +/***/ 3702: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check if a given value is an even number. + * + * @function Phaser.Math.IsEven + * @since 3.0.0 + * + * @param {number} value - The number to perform the check with. + * + * @return {boolean} Whether the number is even or not. + */ +var IsEven = function (value) +{ + // Use abstract equality == for "is number" test + + // eslint-disable-next-line eqeqeq + return (value == parseFloat(value)) ? !(value % 2) : void 0; +}; + +module.exports = IsEven; + + +/***/ }), + +/***/ 8820: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check if a given value is an even number using a strict type check. + * + * @function Phaser.Math.IsEvenStrict + * @since 3.0.0 + * + * @param {number} value - The number to perform the check with. + * + * @return {boolean} Whether the number is even or not. + */ +var IsEvenStrict = function (value) +{ + // Use strict equality === for "is number" test + return (value === parseFloat(value)) ? !(value % 2) : void 0; +}; + +module.exports = IsEvenStrict; + + +/***/ }), + +/***/ 1743: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a linear (interpolation) value over t. + * + * @function Phaser.Math.Linear + * @since 3.0.0 + * + * @param {number} p0 - The first point. + * @param {number} p1 - The second point. + * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1. + * + * @return {number} The step t% of the way between p0 and p1. + */ +var Linear = function (p0, p1, t) +{ + return (p1 - p0) * t + p0; +}; + +module.exports = Linear; + + +/***/ }), + +/***/ 3416: +/***/ ((module) => { + +/** + * @author Greg McLean + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Interpolates two given Vectors and returns a new Vector between them. + * + * Does not modify either of the passed Vectors. + * + * @function Phaser.Math.LinearXY + * @since 3.60.0 + * + * @param {Phaser.Math.Vector2} vector1 - Starting vector + * @param {Phaser.Math.Vector2} vector2 - Ending vector + * @param {number} [t=0] - The percentage between vector1 and vector2 to return, represented as a number between 0 and 1. + * + * @return {Phaser.Math.Vector2} The step t% of the way between vector1 and vector2. + */ +var LinearXY = function (vector1, vector2, t) +{ + if (t === undefined) { t = 0; } + + return vector1.clone().lerp(vector2, t); +}; + +module.exports = LinearXY; + + +/***/ }), + +/***/ 2149: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A three-dimensional matrix. + * + * Defaults to the identity matrix when instantiated. + * + * @class Matrix3 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from. + */ +var Matrix3 = new Class({ + + initialize: + + function Matrix3 (m) + { + /** + * The matrix values. + * + * @name Phaser.Math.Matrix3#val + * @type {Float32Array} + * @since 3.0.0 + */ + this.val = new Float32Array(9); + + if (m) + { + // Assume Matrix3 with val: + this.copy(m); + } + else + { + // Default to identity + this.identity(); + } + }, + + /** + * Make a clone of this Matrix3. + * + * @method Phaser.Math.Matrix3#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} A clone of this Matrix3. + */ + clone: function () + { + return new Matrix3(this); + }, + + /** + * This method is an alias for `Matrix3.copy`. + * + * @method Phaser.Math.Matrix3#set + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * Copy the values of a given Matrix into this Matrix. + * + * @method Phaser.Math.Matrix3#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + copy: function (src) + { + var out = this.val; + var a = src.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + + return this; + }, + + /** + * Copy the values of a given Matrix4 into this Matrix3. + * + * @method Phaser.Math.Matrix3#fromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromMat4: function (m) + { + var a = m.val; + var out = this.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + + return this; + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix3#fromArray + * @since 3.0.0 + * + * @param {array} a - The array to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromArray: function (a) + { + var out = this.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix3#identity + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + identity: function () + { + var out = this.val; + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + + return this; + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix3#transpose + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + transpose: function () + { + var a = this.val; + var a01 = a[1]; + var a02 = a[2]; + var a12 = a[5]; + + a[1] = a[3]; + a[2] = a[6]; + a[3] = a01; + a[5] = a[7]; + a[6] = a02; + a[7] = a12; + + return this; + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix3#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + var b01 = a22 * a11 - a12 * a21; + var b11 = -a22 * a10 + a12 * a20; + var b21 = a21 * a10 - a11 * a20; + + // Calculate the determinant + var det = a00 * b01 + a01 * b11 + a02 * b21; + + if (!det) + { + return null; + } + + det = 1 / det; + + a[0] = b01 * det; + a[1] = (-a22 * a01 + a02 * a21) * det; + a[2] = (a12 * a01 - a02 * a11) * det; + a[3] = b11 * det; + a[4] = (a22 * a00 - a02 * a20) * det; + a[5] = (-a12 * a00 + a02 * a10) * det; + a[6] = b21 * det; + a[7] = (-a21 * a00 + a01 * a20) * det; + a[8] = (a11 * a00 - a01 * a10) * det; + + return this; + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix3#adjoint + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + a[0] = (a11 * a22 - a12 * a21); + a[1] = (a02 * a21 - a01 * a22); + a[2] = (a01 * a12 - a02 * a11); + a[3] = (a12 * a20 - a10 * a22); + a[4] = (a00 * a22 - a02 * a20); + a[5] = (a02 * a10 - a00 * a12); + a[6] = (a10 * a21 - a11 * a20); + a[7] = (a01 * a20 - a00 * a21); + a[8] = (a00 * a11 - a01 * a10); + + return this; + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix3#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix3#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + var b = src.val; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b10 = b[3]; + var b11 = b[4]; + var b12 = b[5]; + var b20 = b[6]; + var b21 = b[7]; + var b22 = b[8]; + + a[0] = b00 * a00 + b01 * a10 + b02 * a20; + a[1] = b00 * a01 + b01 * a11 + b02 * a21; + a[2] = b00 * a02 + b01 * a12 + b02 * a22; + + a[3] = b10 * a00 + b11 * a10 + b12 * a20; + a[4] = b10 * a01 + b11 * a11 + b12 * a21; + a[5] = b10 * a02 + b11 * a12 + b12 * a22; + + a[6] = b20 * a00 + b21 * a10 + b22 * a20; + a[7] = b20 * a01 + b21 * a11 + b22 * a21; + a[8] = b20 * a02 + b21 * a12 + b22 * a22; + + return this; + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix3#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + translate: function (v) + { + var a = this.val; + var x = v.x; + var y = v.y; + + a[6] = x * a[0] + y * a[3] + a[6]; + a[7] = x * a[1] + y * a[4] + a[7]; + a[8] = x * a[2] + y * a[5] + a[8]; + + return this; + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix3#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + rotate: function (rad) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + + var s = Math.sin(rad); + var c = Math.cos(rad); + + a[0] = c * a00 + s * a10; + a[1] = c * a01 + s * a11; + a[2] = c * a02 + s * a12; + + a[3] = c * a10 - s * a00; + a[4] = c * a11 - s * a01; + a[5] = c * a12 - s * a02; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x` and `y` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix3#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + scale: function (v) + { + var a = this.val; + var x = v.x; + var y = v.y; + + a[0] = x * a[0]; + a[1] = x * a[1]; + a[2] = x * a[2]; + + a[3] = y * a[3]; + a[4] = y * a[4]; + a[5] = y * a[5]; + + return this; + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix3#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromQuat: function (q) + { + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + var out = this.val; + + out[0] = 1 - (yy + zz); + out[3] = xy + wz; + out[6] = xz - wy; + + out[1] = xy - wz; + out[4] = 1 - (xx + zz); + out[7] = yz + wx; + + out[2] = xz + wy; + out[5] = yz - wx; + out[8] = 1 - (xx + yy); + + return this; + }, + + /** + * Set the values of this Matrix3 to be normalized from the given Matrix4. + * + * @method Phaser.Math.Matrix3#normalFromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to normalize the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + normalFromMat4: function (m) + { + var a = m.val; + var out = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) + { + return null; + } + + det = 1 / det; + + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + + return this; + } + +}); + +module.exports = Matrix3; + + +/***/ }), + +/***/ 9652: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Vector3 = __webpack_require__(5689); + +/** + * @ignore + */ +var EPSILON = 0.000001; + +/** + * @classdesc + * A four-dimensional matrix. + * + * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji + * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + * + * @class Matrix4 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. + */ +var Matrix4 = new Class({ + + initialize: + + function Matrix4 (m) + { + /** + * The matrix values. + * + * @name Phaser.Math.Matrix4#val + * @type {Float32Array} + * @since 3.0.0 + */ + this.val = new Float32Array(16); + + if (m) + { + // Assume Matrix4 with val: + this.copy(m); + } + else + { + // Default to identity + this.identity(); + } + }, + + /** + * Make a clone of this Matrix4. + * + * @method Phaser.Math.Matrix4#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} A clone of this Matrix4. + */ + clone: function () + { + return new Matrix4(this); + }, + + /** + * This method is an alias for `Matrix4.copy`. + * + * @method Phaser.Math.Matrix4#set + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. + * + * @return {this} This Matrix4. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * Sets all values of this Matrix4. + * + * @method Phaser.Math.Matrix4#setValues + * @since 3.50.0 + * + * @param {number} m00 - The m00 value. + * @param {number} m01 - The m01 value. + * @param {number} m02 - The m02 value. + * @param {number} m03 - The m03 value. + * @param {number} m10 - The m10 value. + * @param {number} m11 - The m11 value. + * @param {number} m12 - The m12 value. + * @param {number} m13 - The m13 value. + * @param {number} m20 - The m20 value. + * @param {number} m21 - The m21 value. + * @param {number} m22 - The m22 value. + * @param {number} m23 - The m23 value. + * @param {number} m30 - The m30 value. + * @param {number} m31 - The m31 value. + * @param {number} m32 - The m32 value. + * @param {number} m33 - The m33 value. + * + * @return {this} This Matrix4 instance. + */ + setValues: function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) + { + var out = this.val; + + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + + return this; + }, + + /** + * Copy the values of a given Matrix into this Matrix. + * + * @method Phaser.Math.Matrix4#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. + * + * @return {this} This Matrix4. + */ + copy: function (src) + { + var a = src.val; + + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix4#fromArray + * @since 3.0.0 + * + * @param {number[]} a - The array to copy the values from. Must have at least 16 elements. + * + * @return {this} This Matrix4. + */ + fromArray: function (a) + { + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Reset this Matrix. + * + * Sets all values to `0`. + * + * @method Phaser.Math.Matrix4#zero + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + zero: function () + { + return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + }, + + /** + * Generates a transform matrix based on the given position, scale and rotation. + * + * @method Phaser.Math.Matrix4#transform + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {Phaser.Math.Vector3} scale - The scale vector. + * @param {Phaser.Math.Quaternion} rotation - The rotation quaternion. + * + * @return {this} This Matrix4. + */ + transform: function (position, scale, rotation) + { + var rotMatrix = _tempMat1.fromQuat(rotation); + + var rm = rotMatrix.val; + + var sx = scale.x; + var sy = scale.y; + var sz = scale.z; + + return this.setValues( + rm[0] * sx, + rm[1] * sx, + rm[2] * sx, + 0, + + rm[4] * sy, + rm[5] * sy, + rm[6] * sy, + 0, + + rm[8] * sz, + rm[9] * sz, + rm[10] * sz, + 0, + + position.x, + position.y, + position.z, + 1 + ); + }, + + /** + * Set the `x`, `y` and `z` values of this Matrix. + * + * @method Phaser.Math.Matrix4#xyz + * @since 3.0.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {number} z - The z value. + * + * @return {this} This Matrix4. + */ + xyz: function (x, y, z) + { + this.identity(); + + var out = this.val; + + out[12] = x; + out[13] = y; + out[14] = z; + + return this; + }, + + /** + * Set the scaling values of this Matrix. + * + * @method Phaser.Math.Matrix4#scaling + * @since 3.0.0 + * + * @param {number} x - The x scaling value. + * @param {number} y - The y scaling value. + * @param {number} z - The z scaling value. + * + * @return {this} This Matrix4. + */ + scaling: function (x, y, z) + { + this.zero(); + + var out = this.val; + + out[0] = x; + out[5] = y; + out[10] = z; + out[15] = 1; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix4#identity + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + identity: function () + { + return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix4#transpose + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + transpose: function () + { + var a = this.val; + + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a12 = a[6]; + var a13 = a[7]; + var a23 = a[11]; + + a[1] = a[4]; + a[2] = a[8]; + a[3] = a[12]; + a[4] = a01; + a[6] = a[9]; + a[7] = a[13]; + a[8] = a02; + a[9] = a12; + a[11] = a[14]; + a[12] = a03; + a[13] = a13; + a[14] = a23; + + return this; + }, + + /** + * Copies the given Matrix4 into this Matrix and then inverses it. + * + * @method Phaser.Math.Matrix4#getInverse + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to invert into this Matrix4. + * + * @return {this} This Matrix4. + */ + getInverse: function (m) + { + this.copy(m); + + return this.invert(); + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix4#invert + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) + { + return this; + } + + det = 1 / det; + + return this.setValues( + (a11 * b11 - a12 * b10 + a13 * b09) * det, + (a02 * b10 - a01 * b11 - a03 * b09) * det, + (a31 * b05 - a32 * b04 + a33 * b03) * det, + (a22 * b04 - a21 * b05 - a23 * b03) * det, + (a12 * b08 - a10 * b11 - a13 * b07) * det, + (a00 * b11 - a02 * b08 + a03 * b07) * det, + (a32 * b02 - a30 * b05 - a33 * b01) * det, + (a20 * b05 - a22 * b02 + a23 * b01) * det, + (a10 * b10 - a11 * b08 + a13 * b06) * det, + (a01 * b08 - a00 * b10 - a03 * b06) * det, + (a30 * b04 - a31 * b02 + a33 * b00) * det, + (a21 * b02 - a20 * b04 - a23 * b00) * det, + (a11 * b07 - a10 * b09 - a12 * b06) * det, + (a00 * b09 - a01 * b07 + a02 * b06) * det, + (a31 * b01 - a30 * b03 - a32 * b00) * det, + (a20 * b03 - a21 * b01 + a22 * b00) * det + ); + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix4#adjoint + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + return this.setValues( + (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)), + -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), + (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)), + -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), + -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)), + (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)), + -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)), + (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)), + (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)), + -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)), + (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)), + -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)), + -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)), + (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)), + -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)), + (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)) + ); + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix4#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix4#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. + * + * @return {this} This Matrix4. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b = src.val; + + // Cache only the current line of the second matrix + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + + a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + + a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + + a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + + a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + return this; + }, + + /** + * Multiply the values of this Matrix4 by those given in the `src` argument. + * + * @method Phaser.Math.Matrix4#multiplyLocal + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. + * + * @return {this} This Matrix4. + */ + multiplyLocal: function (src) + { + var a = this.val; + var b = src.val; + + return this.setValues( + a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12], + a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13], + a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14], + a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15], + + a[4] * b[0] + a[5] * b[4] + a[6] * b[8] + a[7] * b[12], + a[4] * b[1] + a[5] * b[5] + a[6] * b[9] + a[7] * b[13], + a[4] * b[2] + a[5] * b[6] + a[6] * b[10] + a[7] * b[14], + a[4] * b[3] + a[5] * b[7] + a[6] * b[11] + a[7] * b[15], + + a[8] * b[0] + a[9] * b[4] + a[10] * b[8] + a[11] * b[12], + a[8] * b[1] + a[9] * b[5] + a[10] * b[9] + a[11] * b[13], + a[8] * b[2] + a[9] * b[6] + a[10] * b[10] + a[11] * b[14], + a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11] * b[15], + + a[12] * b[0] + a[13] * b[4] + a[14] * b[8] + a[15] * b[12], + a[12] * b[1] + a[13] * b[5] + a[14] * b[9] + a[15] * b[13], + a[12] * b[2] + a[13] * b[6] + a[14] * b[10] + a[15] * b[14], + a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15] + ); + }, + + /** + * Multiplies the given Matrix4 object with this Matrix. + * + * This is the same as calling `multiplyMatrices(m, this)`. + * + * @method Phaser.Math.Matrix4#premultiply + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to multiply with this one. + * + * @return {this} This Matrix4. + */ + premultiply: function (m) + { + return this.multiplyMatrices(m, this); + }, + + /** + * Multiplies the two given Matrix4 objects and stores the results in this Matrix. + * + * @method Phaser.Math.Matrix4#multiplyMatrices + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} a - The first Matrix4 to multiply. + * @param {Phaser.Math.Matrix4} b - The second Matrix4 to multiply. + * + * @return {this} This Matrix4. + */ + multiplyMatrices: function (a, b) + { + var am = a.val; + var bm = b.val; + + var a11 = am[0]; + var a12 = am[4]; + var a13 = am[8]; + var a14 = am[12]; + var a21 = am[1]; + var a22 = am[5]; + var a23 = am[9]; + var a24 = am[13]; + var a31 = am[2]; + var a32 = am[6]; + var a33 = am[10]; + var a34 = am[14]; + var a41 = am[3]; + var a42 = am[7]; + var a43 = am[11]; + var a44 = am[15]; + + var b11 = bm[0]; + var b12 = bm[4]; + var b13 = bm[8]; + var b14 = bm[12]; + var b21 = bm[1]; + var b22 = bm[5]; + var b23 = bm[9]; + var b24 = bm[13]; + var b31 = bm[2]; + var b32 = bm[6]; + var b33 = bm[10]; + var b34 = bm[14]; + var b41 = bm[3]; + var b42 = bm[7]; + var b43 = bm[11]; + var b44 = bm[15]; + + return this.setValues( + a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41, + a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41, + a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41, + a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41, + a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42, + a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42, + a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42, + a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42, + a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43, + a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43, + a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43, + a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43, + a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44, + a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44, + a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44, + a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44 + ); + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix4#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {this} This Matrix4. + */ + translate: function (v) + { + return this.translateXYZ(v.x, v.y, v.z); + }, + + /** + * Translate this Matrix using the given values. + * + * @method Phaser.Math.Matrix4#translateXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + translateXYZ: function (x, y, z) + { + var a = this.val; + + a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix4#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {this} This Matrix4. + */ + scale: function (v) + { + return this.scaleXYZ(v.x, v.y, v.z); + }, + + /** + * Apply a scale transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#scaleXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + scaleXYZ: function (x, y, z) + { + var a = this.val; + + a[0] = a[0] * x; + a[1] = a[1] * x; + a[2] = a[2] * x; + a[3] = a[3] * x; + + a[4] = a[4] * y; + a[5] = a[5] * y; + a[6] = a[6] * y; + a[7] = a[7] * y; + + a[8] = a[8] * z; + a[9] = a[9] * z; + a[10] = a[10] * z; + a[11] = a[11] * z; + + return this; + }, + + /** + * Derive a rotation matrix around the given axis. + * + * @method Phaser.Math.Matrix4#makeRotationAxis + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. + * @param {number} angle - The rotation angle in radians. + * + * @return {this} This Matrix4. + */ + makeRotationAxis: function (axis, angle) + { + // Based on http://www.gamedev.net/reference/articles/article1199.asp + + var c = Math.cos(angle); + var s = Math.sin(angle); + var t = 1 - c; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var tx = t * x; + var ty = t * y; + + return this.setValues( + tx * x + c, tx * y - s * z, tx * z + s * y, 0, + tx * y + s * z, ty * y + c, ty * z - s * x, 0, + tx * z - s * y, ty * z + s * x, t * z * z + c, 0, + 0, 0, 0, 1 + ); + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. + * + * @return {this} This Matrix4. + */ + rotate: function (rad, axis) + { + var a = this.val; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var len = Math.sqrt(x * x + y * y + z * z); + + if (Math.abs(len) < EPSILON) + { + return this; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + + var s = Math.sin(rad); + var c = Math.cos(rad); + var t = 1 - c; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + // Construct the elements of the rotation matrix + var b00 = x * x * t + c; + var b01 = y * x * t + z * s; + var b02 = z * x * t - y * s; + + var b10 = x * y * t - z * s; + var b11 = y * y * t + c; + var b12 = z * y * t + x * s; + + var b20 = x * z * t + y * s; + var b21 = y * z * t - x * s; + var b22 = z * z * t + c; + + // Perform rotation-specific matrix multiplication + return this.setValues( + a00 * b00 + a10 * b01 + a20 * b02, + a01 * b00 + a11 * b01 + a21 * b02, + a02 * b00 + a12 * b01 + a22 * b02, + a03 * b00 + a13 * b01 + a23 * b02, + a00 * b10 + a10 * b11 + a20 * b12, + a01 * b10 + a11 * b11 + a21 * b12, + a02 * b10 + a12 * b11 + a22 * b12, + a03 * b10 + a13 * b11 + a23 * b12, + a00 * b20 + a10 * b21 + a20 * b22, + a01 * b20 + a11 * b21 + a21 * b22, + a02 * b20 + a12 * b21 + a22 * b22, + a03 * b20 + a13 * b21 + a23 * b22, + a30, a31, a32, a33 + ); + }, + + /** + * Rotate this matrix on its X axis. + * + * @method Phaser.Math.Matrix4#rotateX + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {this} This Matrix4. + */ + rotateX: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[4] = a10 * c + a20 * s; + a[5] = a11 * c + a21 * s; + a[6] = a12 * c + a22 * s; + a[7] = a13 * c + a23 * s; + a[8] = a20 * c - a10 * s; + a[9] = a21 * c - a11 * s; + a[10] = a22 * c - a12 * s; + a[11] = a23 * c - a13 * s; + + return this; + }, + + /** + * Rotate this matrix on its Y axis. + * + * @method Phaser.Math.Matrix4#rotateY + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateY: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c - a20 * s; + a[1] = a01 * c - a21 * s; + a[2] = a02 * c - a22 * s; + a[3] = a03 * c - a23 * s; + a[8] = a00 * s + a20 * c; + a[9] = a01 * s + a21 * c; + a[10] = a02 * s + a22 * c; + a[11] = a03 * s + a23 * c; + + return this; + }, + + /** + * Rotate this matrix on its Z axis. + * + * @method Phaser.Math.Matrix4#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateZ: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c + a10 * s; + a[1] = a01 * c + a11 * s; + a[2] = a02 * c + a12 * s; + a[3] = a03 * c + a13 * s; + a[4] = a10 * c - a00 * s; + a[5] = a11 * c - a01 * s; + a[6] = a12 * c - a02 * s; + a[7] = a13 * c - a03 * s; + + return this; + }, + + /** + * Set the values of this Matrix from the given rotation Quaternion and translation Vector. + * + * @method Phaser.Math.Matrix4#fromRotationTranslation + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. + * @param {Phaser.Math.Vector3} v - The Vector to set translation from. + * + * @return {this} This Matrix4. + */ + fromRotationTranslation: function (q, v) + { + // Quaternion math + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + v.x, + v.y, + v.z, + 1 + ); + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix4#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {this} This Matrix4. + */ + fromQuat: function (q) + { + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + 0, + 0, + 0, + 1 + ); + }, + + /** + * Generate a frustum matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#frustum + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + frustum: function (left, right, bottom, top, near, far) + { + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + + return this.setValues( + (near * 2) * rl, + 0, + 0, + 0, + + 0, + (near * 2) * tb, + 0, + 0, + + (right + left) * rl, + (top + bottom) * tb, + (far + near) * nf, + -1, + + 0, + 0, + (far * near * 2) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspective + * @since 3.0.0 + * + * @param {number} fovy - Vertical field of view in radians + * @param {number} aspect - Aspect ratio. Typically viewport width /height. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspective: function (fovy, aspect, near, far) + { + var f = 1.0 / Math.tan(fovy / 2); + var nf = 1 / (near - far); + + return this.setValues( + f / aspect, + 0, + 0, + 0, + + 0, + f, + 0, + 0, + + 0, + 0, + (far + near) * nf, + -1, + + 0, + 0, + (2 * far * near) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspectiveLH + * @since 3.0.0 + * + * @param {number} width - The width of the frustum. + * @param {number} height - The height of the frustum. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspectiveLH: function (width, height, near, far) + { + return this.setValues( + (2 * near) / width, + 0, + 0, + 0, + + 0, + (2 * near) / height, + 0, + 0, + + 0, + 0, + -far / (near - far), + 1, + + 0, + 0, + (near * far) / (near - far), + 0 + ); + }, + + /** + * Generate an orthogonal projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#ortho + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + ortho: function (left, right, bottom, top, near, far) + { + var lr = left - right; + var bt = bottom - top; + var nf = near - far; + + // Avoid division by zero + lr = (lr === 0) ? lr : 1 / lr; + bt = (bt === 0) ? bt : 1 / bt; + nf = (nf === 0) ? nf : 1 / nf; + + return this.setValues( + -2 * lr, + 0, + 0, + 0, + + 0, + -2 * bt, + 0, + 0, + + 0, + 0, + 2 * nf, + 0, + + (left + right) * lr, + (top + bottom) * bt, + (far + near) * nf, + 1 + ); + }, + + /** + * Generate a right-handed look-at matrix with the given eye position, target and up axis. + * + * @method Phaser.Math.Matrix4#lookAtRH + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer. + * @param {Phaser.Math.Vector3} target - Point the viewer is looking at. + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAtRH: function (eye, target, up) + { + var m = this.val; + + _z.subVectors(eye, target); + + if (_z.getLengthSquared() === 0) + { + // eye and target are in the same position + _z.z = 1; + } + + _z.normalize(); + _x.crossVectors(up, _z); + + if (_x.getLengthSquared() === 0) + { + // up and z are parallel + + if (Math.abs(up.z) === 1) + { + _z.x += 0.0001; + } + else + { + _z.z += 0.0001; + } + + _z.normalize(); + _x.crossVectors(up, _z); + } + + _x.normalize(); + _y.crossVectors(_z, _x); + + m[0] = _x.x; + m[1] = _x.y; + m[2] = _x.z; + m[4] = _y.x; + m[5] = _y.y; + m[6] = _y.z; + m[8] = _z.x; + m[9] = _z.y; + m[10] = _z.z; + + return this; + }, + + /** + * Generate a look-at matrix with the given eye position, focal point, and up axis. + * + * @method Phaser.Math.Matrix4#lookAt + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer + * @param {Phaser.Math.Vector3} center - Point the viewer is looking at + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAt: function (eye, center, up) + { + var eyex = eye.x; + var eyey = eye.y; + var eyez = eye.z; + + var upx = up.x; + var upy = up.y; + var upz = up.z; + + var centerx = center.x; + var centery = center.y; + var centerz = center.z; + + if (Math.abs(eyex - centerx) < EPSILON && + Math.abs(eyey - centery) < EPSILON && + Math.abs(eyez - centerz) < EPSILON) + { + return this.identity(); + } + + var z0 = eyex - centerx; + var z1 = eyey - centery; + var z2 = eyez - centerz; + + var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + + z0 *= len; + z1 *= len; + z2 *= len; + + var x0 = upy * z2 - upz * z1; + var x1 = upz * z0 - upx * z2; + var x2 = upx * z1 - upy * z0; + + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + + if (!len) + { + x0 = 0; + x1 = 0; + x2 = 0; + } + else + { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + var y0 = z1 * x2 - z2 * x1; + var y1 = z2 * x0 - z0 * x2; + var y2 = z0 * x1 - z1 * x0; + + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + + if (!len) + { + y0 = 0; + y1 = 0; + y2 = 0; + } + else + { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + return this.setValues( + x0, + y0, + z0, + 0, + + x1, + y1, + z1, + 0, + + x2, + y2, + z2, + 0, + + -(x0 * eyex + x1 * eyey + x2 * eyez), + -(y0 * eyex + y1 * eyey + y2 * eyez), + -(z0 * eyex + z1 * eyey + z2 * eyez), + 1 + ); + }, + + /** + * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. + * + * @method Phaser.Math.Matrix4#yawPitchRoll + * @since 3.0.0 + * + * @param {number} yaw - The yaw value. + * @param {number} pitch - The pitch value. + * @param {number} roll - The roll value. + * + * @return {this} This Matrix4. + */ + yawPitchRoll: function (yaw, pitch, roll) + { + this.zero(); + _tempMat1.zero(); + _tempMat2.zero(); + + var m0 = this.val; + var m1 = _tempMat1.val; + var m2 = _tempMat2.val; + + // Rotate Z + var s = Math.sin(roll); + var c = Math.cos(roll); + + m0[10] = 1; + m0[15] = 1; + m0[0] = c; + m0[1] = s; + m0[4] = -s; + m0[5] = c; + + // Rotate X + s = Math.sin(pitch); + c = Math.cos(pitch); + + m1[0] = 1; + m1[15] = 1; + m1[5] = c; + m1[10] = c; + m1[9] = -s; + m1[6] = s; + + // Rotate Y + s = Math.sin(yaw); + c = Math.cos(yaw); + + m2[5] = 1; + m2[15] = 1; + m2[0] = c; + m2[2] = -s; + m2[8] = s; + m2[10] = c; + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + return this; + }, + + /** + * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. + * + * @method Phaser.Math.Matrix4#setWorldMatrix + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. + * @param {Phaser.Math.Vector3} position - The position of the world matrix. + * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. + * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. + * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. + * + * @return {this} This Matrix4. + */ + setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) + { + this.yawPitchRoll(rotation.y, rotation.x, rotation.z); + + _tempMat1.scaling(scale.x, scale.y, scale.z); + _tempMat2.xyz(position.x, position.y, position.z); + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + if (viewMatrix) + { + this.multiplyLocal(viewMatrix); + } + + if (projectionMatrix) + { + this.multiplyLocal(projectionMatrix); + } + + return this; + }, + + /** + * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. + * + * @method Phaser.Math.Matrix4#multiplyToMat4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix4 to multiply with this one. + * @param {Phaser.Math.Matrix4} out - The receiving Matrix. + * + * @return {Phaser.Math.Matrix4} This `out` Matrix4. + */ + multiplyToMat4: function (src, out) + { + var a = this.val; + var b = src.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b03 = b[3]; + var b10 = b[4]; + var b11 = b[5]; + var b12 = b[6]; + var b13 = b[7]; + var b20 = b[8]; + var b21 = b[9]; + var b22 = b[10]; + var b23 = b[11]; + var b30 = b[12]; + var b31 = b[13]; + var b32 = b[14]; + var b33 = b[15]; + + return out.setValues( + b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, + b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31, + b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32, + b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33, + + b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, + b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, + b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, + b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, + + b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, + b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, + b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, + b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, + + b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, + b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, + b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, + b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 + ); + }, + + /** + * Takes the rotation and position vectors and builds this Matrix4 from them. + * + * @method Phaser.Math.Matrix4#fromRotationXYTranslation + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation vector. + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {boolean} translateFirst - Should the operation translate then rotate (`true`), or rotate then translate? (`false`) + * + * @return {this} This Matrix4. + */ + fromRotationXYTranslation: function (rotation, position, translateFirst) + { + var x = position.x; + var y = position.y; + var z = position.z; + + var sx = Math.sin(rotation.x); + var cx = Math.cos(rotation.x); + + var sy = Math.sin(rotation.y); + var cy = Math.cos(rotation.y); + + var a30 = x; + var a31 = y; + var a32 = z; + + // Rotate X + + var b21 = -sx; + + // Rotate Y + + var c01 = 0 - b21 * sy; + + var c02 = 0 - cx * sy; + + var c21 = b21 * cy; + + var c22 = cx * cy; + + // Translate + if (!translateFirst) + { + // a30 = cy * x + 0 * y + sy * z; + a30 = cy * x + sy * z; + a31 = c01 * x + cx * y + c21 * z; + a32 = c02 * x + sx * y + c22 * z; + } + + return this.setValues( + cy, + c01, + c02, + 0, + 0, + cx, + sx, + 0, + sy, + c21, + c22, + 0, + a30, + a31, + a32, + 1 + ); + }, + + /** + * Returns the maximum axis scale from this Matrix4. + * + * @method Phaser.Math.Matrix4#getMaxScaleOnAxis + * @since 3.50.0 + * + * @return {number} The maximum axis scale. + */ + getMaxScaleOnAxis: function () + { + var m = this.val; + + var scaleXSq = m[0] * m[0] + m[1] * m[1] + m[2] * m[2]; + var scaleYSq = m[4] * m[4] + m[5] * m[5] + m[6] * m[6]; + var scaleZSq = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; + + return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); + } + +}); + +/** + * @ignore + */ +var _tempMat1 = new Matrix4(); + +/** + * @ignore + */ +var _tempMat2 = new Matrix4(); + +/** + * @ignore + */ +var _x = new Vector3(); + +/** + * @ignore + */ +var _y = new Vector3(); + +/** + * @ignore + */ +var _z = new Vector3(); + +module.exports = Matrix4; + + +/***/ }), + +/***/ 3733: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Add an `amount` to a `value`, limiting the maximum result to `max`. + * + * @function Phaser.Math.MaxAdd + * @since 3.0.0 + * + * @param {number} value - The value to add to. + * @param {number} amount - The amount to add. + * @param {number} max - The maximum value to return. + * + * @return {number} The resulting value. + */ +var MaxAdd = function (value, amount, max) +{ + return Math.min(value + amount, max); +}; + +module.exports = MaxAdd; + + +/***/ }), + +/***/ 44: +/***/ ((module) => { + +/** + * @author Vladislav Forsh + * @copyright 2021 RoboWhale + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the median of the given values. The values are sorted and the middle value is returned. + * In case of an even number of values, the average of the two middle values is returned. + * + * @function Phaser.Math.Median + * @since 3.54.0 + * + * @param {number[]} values - The values to average. + * + * @return {number} The median value. + */ +var Median = function (values) +{ + var valuesNum = values.length; + if (valuesNum === 0) + { + return 0; + } + + values.sort(function (a, b) { return a - b; }); + + var halfIndex = Math.floor(valuesNum / 2); + + return valuesNum % 2 === 0 + ? (values[halfIndex] + values[halfIndex - 1]) / 2 + : values[halfIndex]; +}; + +module.exports = Median; + + +/***/ }), + +/***/ 5385: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Subtract an `amount` from `value`, limiting the minimum result to `min`. + * + * @function Phaser.Math.MinSub + * @since 3.0.0 + * + * @param {number} value - The value to subtract from. + * @param {number} amount - The amount to subtract. + * @param {number} min - The minimum value to return. + * + * @return {number} The resulting value. + */ +var MinSub = function (value, amount, min) +{ + return Math.max(value - amount, min); +}; + +module.exports = MinSub; + + +/***/ }), + +/***/ 8585: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Work out what percentage `value` is of the range between `min` and `max`. + * If `max` isn't given then it will return the percentage of `value` to `min`. + * + * You can optionally specify an `upperMax` value, which is a mid-way point in the range that represents 100%, after which the % starts to go down to zero again. + * + * @function Phaser.Math.Percent + * @since 3.0.0 + * + * @param {number} value - The value to determine the percentage of. + * @param {number} min - The minimum value. + * @param {number} [max] - The maximum value. + * @param {number} [upperMax] - The mid-way point in the range that represents 100%. + * + * @return {number} A value between 0 and 1 representing the percentage. + */ +var Percent = function (value, min, max, upperMax) +{ + if (max === undefined) { max = min + 1; } + + var percentage = (value - min) / (max - min); + + if (percentage > 1) + { + if (upperMax !== undefined) + { + percentage = ((upperMax - value)) / (upperMax - max); + + if (percentage < 0) + { + percentage = 0; + } + } + else + { + percentage = 1; + } + } + else if (percentage < 0) + { + percentage = 0; + } + + return percentage; +}; + +module.exports = Percent; + + +/***/ }), + +/***/ 372: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(7473); +var Matrix3 = __webpack_require__(2149); +var NOOP = __webpack_require__(1984); +var Vector3 = __webpack_require__(5689); + +var EPSILON = 0.000001; + +// Some shared 'private' arrays +var siNext = new Int8Array([ 1, 2, 0 ]); +var tmp = new Float32Array([ 0, 0, 0 ]); + +var xUnitVec3 = new Vector3(1, 0, 0); +var yUnitVec3 = new Vector3(0, 1, 0); + +var tmpvec = new Vector3(); +var tmpMat3 = new Matrix3(); + +/** + * @classdesc + * A quaternion. + * + * @class Quaternion + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x=0] - The x component. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=1] - The w component. + */ +var Quaternion = new Class({ + + initialize: + + function Quaternion (x, y, z, w) + { + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_x + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_y + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_z + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_w + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * This callback is invoked, if set, each time a value in this quaternion is changed. + * The callback is passed one argument, a reference to this quaternion. + * + * @name Phaser.Math.Quaternion#onChangeCallback + * @type {function} + * @since 3.50.0 + */ + this.onChangeCallback = NOOP; + + this.set(x, y, z, w); + }, + + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: { + get: function () + { + return this._w; + }, + + set: function (value) + { + this._w = value; + + this.onChangeCallback(this); + } + }, + + /** + * Copy the components of a given Quaternion or Vector into this Quaternion. + * + * @method Phaser.Math.Quaternion#copy + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + copy: function (src) + { + return this.set(src); + }, + + /** + * Set the components of this Quaternion and optionally call the `onChangeCallback`. + * + * @method Phaser.Math.Quaternion#set + * @since 3.0.0 + * + * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=0] - The w component. + * @param {boolean} [update=true] - Call the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + set: function (x, y, z, w, update) + { + if (update === undefined) { update = true; } + + if (typeof x === 'object') + { + this._x = x.x || 0; + this._y = x.y || 0; + this._z = x.z || 0; + this._w = x.w || 0; + } + else + { + this._x = x || 0; + this._y = y || 0; + this._z = z || 0; + this._w = w || 0; + } + + if (update) + { + this.onChangeCallback(this); + } + + return this; + }, + + /** + * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise. + * + * @method Phaser.Math.Quaternion#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + add: function (v) + { + this._x += v.x; + this._y += v.y; + this._z += v.z; + this._w += v.w; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise. + * + * @method Phaser.Math.Quaternion#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + subtract: function (v) + { + this._x -= v.x; + this._y -= v.y; + this._z -= v.z; + this._w -= v.w; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Scale this Quaternion by the given value. + * + * @method Phaser.Math.Quaternion#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Quaternion by. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + scale: function (scale) + { + this._x *= scale; + this._y *= scale; + this._z *= scale; + this._w *= scale; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Calculate the length of this Quaternion. + * + * @method Phaser.Math.Quaternion#length + * @since 3.0.0 + * + * @return {number} The length of this Quaternion. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return Math.sqrt(x * x + y * y + z * z + w * w); + }, + + /** + * Calculate the length of this Quaternion squared. + * + * @method Phaser.Math.Quaternion#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Quaternion, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return x * x + y * y + z * z + w * w; + }, + + /** + * Normalize this Quaternion. + * + * @method Phaser.Math.Quaternion#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + var len = x * x + y * y + z * z + w * w; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this._x = x * len; + this._y = y * len; + this._z = z * len; + this._w = w * len; + } + + this.onChangeCallback(this); + + return this; + }, + + /** + * Calculate the dot product of this Quaternion and the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#dot + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion. + * + * @return {number} The dot product of this Quaternion and the given Quaternion or Vector. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; + }, + + /** + * Linearly interpolate this Quaternion towards the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#lerp + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards. + * @param {number} [t=0] - The percentage of interpolation. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + return this.set( + ax + t * (v.x - ax), + ay + t * (v.y - ay), + az + t * (v.z - az), + aw + t * (v.w - aw) + ); + }, + + /** + * Rotates this Quaternion based on the two given vectors. + * + * @method Phaser.Math.Quaternion#rotationTo + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - The transform rotation vector. + * @param {Phaser.Math.Vector3} b - The target rotation vector. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotationTo: function (a, b) + { + var dot = a.x * b.x + a.y * b.y + a.z * b.z; + + if (dot < -0.999999) + { + if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON) + { + tmpvec.copy(yUnitVec3).cross(a); + } + + tmpvec.normalize(); + + return this.setAxisAngle(tmpvec, Math.PI); + + } + else if (dot > 0.999999) + { + return this.set(0, 0, 0, 1); + } + else + { + tmpvec.copy(a).cross(b); + + this._x = tmpvec.x; + this._y = tmpvec.y; + this._z = tmpvec.z; + this._w = 1 + dot; + + return this.normalize(); + } + }, + + /** + * Set the axes of this Quaternion. + * + * @method Phaser.Math.Quaternion#setAxes + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} view - The view axis. + * @param {Phaser.Math.Vector3} right - The right axis. + * @param {Phaser.Math.Vector3} up - The upwards axis. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setAxes: function (view, right, up) + { + var m = tmpMat3.val; + + m[0] = right.x; + m[3] = right.y; + m[6] = right.z; + + m[1] = up.x; + m[4] = up.y; + m[7] = up.z; + + m[2] = -view.x; + m[5] = -view.y; + m[8] = -view.z; + + return this.fromMat3(tmpMat3).normalize(); + }, + + /** + * Reset this Matrix to an identity (default) Quaternion. + * + * @method Phaser.Math.Quaternion#identity + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + identity: function () + { + return this.set(0, 0, 0, 1); + }, + + /** + * Set the axis angle of this Quaternion. + * + * @method Phaser.Math.Quaternion#setAxisAngle + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} axis - The axis. + * @param {number} rad - The angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setAxisAngle: function (axis, rad) + { + rad = rad * 0.5; + + var s = Math.sin(rad); + + return this.set( + s * axis.x, + s * axis.y, + s * axis.z, + Math.cos(rad) + ); + }, + + /** + * Multiply this Quaternion by the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + multiply: function (b) + { + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = b.x; + var by = b.y; + var bz = b.z; + var bw = b.w; + + return this.set( + ax * bw + aw * bx + ay * bz - az * by, + ay * bw + aw * by + az * bx - ax * bz, + az * bw + aw * bz + ax * by - ay * bx, + aw * bw - ax * bx - ay * by - az * bz + ); + }, + + /** + * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#slerp + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards. + * @param {number} t - The percentage of interpolation. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + slerp: function (b, t) + { + // benchmarks: http://jsperf.com/quaternion-slerp-implementations + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = b.x; + var by = b.y; + var bz = b.z; + var bw = b.w; + + // calc cosine + var cosom = ax * bx + ay * by + az * bz + aw * bw; + + // adjust signs (if necessary) + if (cosom < 0) + { + cosom = -cosom; + bx = - bx; + by = - by; + bz = - bz; + bw = - bw; + } + + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + var scale0 = 1 - t; + var scale1 = t; + + // calculate coefficients + if ((1 - cosom) > EPSILON) + { + // standard case (slerp) + var omega = Math.acos(cosom); + var sinom = Math.sin(omega); + + scale0 = Math.sin((1.0 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } + + // calculate final values + return this.set( + scale0 * ax + scale1 * bx, + scale0 * ay + scale1 * by, + scale0 * az + scale1 * bz, + scale0 * aw + scale1 * bw + ); + }, + + /** + * Invert this Quaternion. + * + * @method Phaser.Math.Quaternion#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + invert: function () + { + var a0 = this.x; + var a1 = this.y; + var a2 = this.z; + var a3 = this.w; + + var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + var invDot = (dot) ? 1 / dot : 0; + + return this.set( + -a0 * invDot, + -a1 * invDot, + -a2 * invDot, + a3 * invDot + ); + }, + + /** + * Convert this Quaternion into its conjugate. + * + * Sets the x, y and z components. + * + * @method Phaser.Math.Quaternion#conjugate + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + conjugate: function () + { + this._x = -this.x; + this._y = -this.y; + this._z = -this.z; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Rotate this Quaternion on the X axis. + * + * @method Phaser.Math.Quaternion#rotateX + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateX: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = Math.sin(rad); + var bw = Math.cos(rad); + + return this.set( + ax * bw + aw * bx, + ay * bw + az * bx, + az * bw - ay * bx, + aw * bw - ax * bx + ); + }, + + /** + * Rotate this Quaternion on the Y axis. + * + * @method Phaser.Math.Quaternion#rotateY + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateY: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var by = Math.sin(rad); + var bw = Math.cos(rad); + + return this.set( + ax * bw - az * by, + ay * bw + aw * by, + az * bw + ax * by, + aw * bw - ay * by + ); + }, + + /** + * Rotate this Quaternion on the Z axis. + * + * @method Phaser.Math.Quaternion#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateZ: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bz = Math.sin(rad); + var bw = Math.cos(rad); + + return this.set( + ax * bw + ay * bz, + ay * bw - ax * bz, + az * bw + aw * bz, + aw * bw - az * bz + ); + }, + + /** + * Create a unit (or rotation) Quaternion from its x, y, and z components. + * + * Sets the w component. + * + * @method Phaser.Math.Quaternion#calculateW + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + calculateW: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + this.w = -Math.sqrt(1.0 - x * x - y * y - z * z); + + return this; + }, + + /** + * Set this Quaternion from the given Euler, based on Euler order. + * + * @method Phaser.Math.Quaternion#setFromEuler + * @since 3.50.0 + * + * @param {Phaser.Math.Euler} euler - The Euler to convert from. + * @param {boolean} [update=true] - Run the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromEuler: function (euler, update) + { + var x = euler.x / 2; + var y = euler.y / 2; + var z = euler.z / 2; + + var c1 = Math.cos(x); + var c2 = Math.cos(y); + var c3 = Math.cos(z); + + var s1 = Math.sin(x); + var s2 = Math.sin(y); + var s3 = Math.sin(z); + + switch (euler.order) + { + case 'XYZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'YXZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'ZXY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'ZYX': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'YZX': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'XZY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + } + + return this; + }, + + /** + * Sets the rotation of this Quaternion from the given Matrix4. + * + * @method Phaser.Math.Quaternion#setFromRotationMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to set the rotation from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromRotationMatrix: function (mat4) + { + var m = mat4.val; + + var m11 = m[0]; + var m12 = m[4]; + var m13 = m[8]; + var m21 = m[1]; + var m22 = m[5]; + var m23 = m[9]; + var m31 = m[2]; + var m32 = m[6]; + var m33 = m[10]; + + var trace = m11 + m22 + m33; + var s; + + if (trace > 0) + { + s = 0.5 / Math.sqrt(trace + 1.0); + + this.set( + (m32 - m23) * s, + (m13 - m31) * s, + (m21 - m12) * s, + 0.25 / s + ); + } + else if (m11 > m22 && m11 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); + + this.set( + 0.25 * s, + (m12 + m21) / s, + (m13 + m31) / s, + (m32 - m23) / s + ); + } + else if (m22 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); + + this.set( + (m12 + m21) / s, + 0.25 * s, + (m23 + m32) / s, + (m13 - m31) / s + ); + } + else + { + s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); + + this.set( + (m13 + m31) / s, + (m23 + m32) / s, + 0.25 * s, + (m21 - m12) / s + ); + } + + return this; + }, + + /** + * Convert the given Matrix into this Quaternion. + * + * @method Phaser.Math.Quaternion#fromMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + fromMat3: function (mat) + { + // benchmarks: + // http://jsperf.com/typed-array-access-speed + // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion + + // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes + // article "Quaternion Calculus and Fast Animation". + var m = mat.val; + var fTrace = m[0] + m[4] + m[8]; + var fRoot; + + if (fTrace > 0) + { + // |w| > 1/2, may as well choose w > 1/2 + fRoot = Math.sqrt(fTrace + 1.0); // 2w + + this.w = 0.5 * fRoot; + + fRoot = 0.5 / fRoot; // 1/(4w) + + this._x = (m[7] - m[5]) * fRoot; + this._y = (m[2] - m[6]) * fRoot; + this._z = (m[3] - m[1]) * fRoot; + } + else + { + // |w| <= 1/2 + var i = 0; + + if (m[4] > m[0]) + { + i = 1; + } + + if (m[8] > m[i * 3 + i]) + { + i = 2; + } + + var j = siNext[i]; + var k = siNext[j]; + + // This isn't quite as clean without array access + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); + tmp[i] = 0.5 * fRoot; + + fRoot = 0.5 / fRoot; + + tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + + this._x = tmp[0]; + this._y = tmp[1]; + this._z = tmp[2]; + this._w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; + } + + this.onChangeCallback(this); + + return this; + } + +}); + +module.exports = Quaternion; + + +/***/ }), + +/***/ 4208: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(7425); + +/** + * Convert the given angle in radians, to the equivalent angle in degrees. + * + * @function Phaser.Math.RadToDeg + * @since 3.0.0 + * + * @param {number} radians - The angle in radians to convert ot degrees. + * + * @return {number} The given angle converted to degrees. + */ +var RadToDeg = function (radians) +{ + return radians * CONST.RAD_TO_DEG; +}; + +module.exports = RadToDeg; + + +/***/ }), + +/***/ 1705: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random unit vector. + * + * Computes random values for the given vector between -1 and 1 that can be used to represent a direction. + * + * Optionally accepts a scale value to scale the resulting vector by. + * + * @function Phaser.Math.RandomXY + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} vector - The Vector to compute random values for. + * @param {number} [scale=1] - The scale of the random values. + * + * @return {Phaser.Math.Vector2} The given Vector. + */ +var RandomXY = function (vector, scale) +{ + if (scale === undefined) { scale = 1; } + + var r = Math.random() * 2 * Math.PI; + + vector.x = Math.cos(r) * scale; + vector.y = Math.sin(r) * scale; + + return vector; +}; + +module.exports = RandomXY; + + +/***/ }), + +/***/ 6650: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random position vector in a spherical area, optionally defined by the given radius. + * + * @function Phaser.Math.RandomXYZ + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} vec3 - The Vector to compute random values for. + * @param {number} [radius=1] - The radius. + * + * @return {Phaser.Math.Vector3} The given Vector. + */ +var RandomXYZ = function (vec3, radius) +{ + if (radius === undefined) { radius = 1; } + + var r = Math.random() * 2 * Math.PI; + var z = (Math.random() * 2) - 1; + var zScale = Math.sqrt(1 - z * z) * radius; + + vec3.x = Math.cos(r) * zScale; + vec3.y = Math.sin(r) * zScale; + vec3.z = z * radius; + + return vec3; +}; + +module.exports = RandomXYZ; + + +/***/ }), + +/***/ 2037: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random four-dimensional vector. + * + * @function Phaser.Math.RandomXYZW + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} vec4 - The Vector to compute random values for. + * @param {number} [scale=1] - The scale of the random values. + * + * @return {Phaser.Math.Vector4} The given Vector. + */ +var RandomXYZW = function (vec4, scale) +{ + if (scale === undefined) { scale = 1; } + + vec4.x = (Math.random() * 2 - 1) * scale; + vec4.y = (Math.random() * 2 - 1) * scale; + vec4.z = (Math.random() * 2 - 1) * scale; + vec4.w = (Math.random() * 2 - 1) * scale; + + return vec4; +}; + +module.exports = RandomXYZW; + + +/***/ }), + +/***/ 6283: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a given point by a given angle around the origin (0, 0), in an anti-clockwise direction. + * + * @function Phaser.Math.Rotate + * @since 3.0.0 + * + * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. + * @param {number} angle - The angle to be rotated by in an anticlockwise direction. + * + * @return {Phaser.Geom.Point} The given point, rotated by the given angle in an anticlockwise direction. + */ +var Rotate = function (point, angle) +{ + var x = point.x; + var y = point.y; + + point.x = (x * Math.cos(angle)) - (y * Math.sin(angle)); + point.y = (x * Math.sin(angle)) + (y * Math.cos(angle)); + + return point; +}; + +module.exports = Rotate; + + +/***/ }), + +/***/ 9876: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` to the given `angle`, at the same distance. + * + * In polar notation, this maps a point from (r, t) to (r, angle), vs. the origin (x, y). + * + * @function Phaser.Math.RotateAround + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] + * + * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. + * @param {number} x - The horizontal coordinate to rotate around. + * @param {number} y - The vertical coordinate to rotate around. + * @param {number} angle - The angle of rotation in radians. + * + * @return {Phaser.Types.Math.Vector2Like} The given point. + */ +var RotateAround = function (point, x, y, angle) +{ + var c = Math.cos(angle); + var s = Math.sin(angle); + + var tx = point.x - x; + var ty = point.y - y; + + point.x = tx * c - ty * s + x; + point.y = tx * s + ty * c + y; + + return point; +}; + +module.exports = RotateAround; + + +/***/ }), + +/***/ 8348: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` by the given `angle` and `distance`. + * + * In polar notation, this maps a point from (r, t) to (distance, t + angle), vs. the origin (x, y). + * + * @function Phaser.Math.RotateAroundDistance + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] + * + * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. + * @param {number} x - The horizontal coordinate to rotate around. + * @param {number} y - The vertical coordinate to rotate around. + * @param {number} angle - The angle of rotation in radians. + * @param {number} distance - The distance from (x, y) to place the point at. + * + * @return {Phaser.Types.Math.Vector2Like} The given point. + */ +var RotateAroundDistance = function (point, x, y, angle, distance) +{ + var t = angle + Math.atan2(point.y - y, point.x - x); + + point.x = x + (distance * Math.cos(t)); + point.y = y + (distance * Math.sin(t)); + + return point; +}; + +module.exports = RotateAroundDistance; + + +/***/ }), + +/***/ 4497: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Position a `point` at the given `angle` and `distance` to (`x`, `y`). + * + * @function Phaser.Math.RotateTo + * @since 3.24.0 + * + * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] + * + * @param {Phaser.Types.Math.Vector2Like} point - The point to be positioned. + * @param {number} x - The horizontal coordinate to position from. + * @param {number} y - The vertical coordinate to position from. + * @param {number} angle - The angle of rotation in radians. + * @param {number} distance - The distance from (x, y) to place the point at. + * + * @return {Phaser.Types.Math.Vector2Like} The given point. + */ +var RotateTo = function (point, x, y, angle, distance) +{ + point.x = x + (distance * Math.cos(angle)); + point.y = y + (distance * Math.sin(angle)); + + return point; +}; + +module.exports = RotateTo; + + +/***/ }), + +/***/ 9640: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector3 = __webpack_require__(5689); +var Matrix4 = __webpack_require__(9652); +var Quaternion = __webpack_require__(372); + +var tmpMat4 = new Matrix4(); +var tmpQuat = new Quaternion(); +var tmpVec3 = new Vector3(); + +/** + * Rotates a vector in place by axis angle. + * + * This is the same as transforming a point by an + * axis-angle quaternion, but it has higher precision. + * + * @function Phaser.Math.RotateVec3 + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} vec - The vector to be rotated. + * @param {Phaser.Math.Vector3} axis - The axis to rotate around. + * @param {number} radians - The angle of rotation in radians. + * + * @return {Phaser.Math.Vector3} The given vector. + */ +var RotateVec3 = function (vec, axis, radians) +{ + // Set the quaternion to our axis angle + tmpQuat.setAxisAngle(axis, radians); + + // Create a rotation matrix from the axis angle + tmpMat4.fromRotationTranslation(tmpQuat, tmpVec3.set(0, 0, 0)); + + // Multiply our vector by the rotation matrix + return vec.transformMat4(tmpMat4); +}; + +module.exports = RotateVec3; + + +/***/ }), + +/***/ 4078: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down. + * + * @function Phaser.Math.RoundAwayFromZero + * @since 3.0.0 + * + * @param {number} value - The number to round. + * + * @return {number} The rounded number, rounded away from zero. + */ +var RoundAwayFromZero = function (value) +{ + // "Opposite" of truncate. + return (value > 0) ? Math.ceil(value) : Math.floor(value); +}; + +module.exports = RoundAwayFromZero; + + +/***/ }), + +/***/ 855: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Round a value to the given precision. + * + * For example: + * + * ```javascript + * RoundTo(123.456, 0) = 123 + * RoundTo(123.456, 1) = 120 + * RoundTo(123.456, 2) = 100 + * ``` + * + * To round the decimal, i.e. to round to precision, pass in a negative `place`: + * + * ```javascript + * RoundTo(123.456789, 0) = 123 + * RoundTo(123.456789, -1) = 123.5 + * RoundTo(123.456789, -2) = 123.46 + * RoundTo(123.456789, -3) = 123.457 + * ``` + * + * @function Phaser.Math.RoundTo + * @since 3.0.0 + * + * @param {number} value - The value to round. + * @param {number} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. + * + * @return {number} The rounded value. + */ +var RoundTo = function (value, place, base) +{ + if (place === undefined) { place = 0; } + if (base === undefined) { base = 10; } + + var p = Math.pow(base, -place); + + return Math.round(value * p) / p; +}; + +module.exports = RoundTo; + + +/***/ }), + +/***/ 4936: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Generate a series of sine and cosine values. + * + * @function Phaser.Math.SinCosTableGenerator + * @since 3.0.0 + * + * @param {number} length - The number of values to generate. + * @param {number} [sinAmp=1] - The sine value amplitude. + * @param {number} [cosAmp=1] - The cosine value amplitude. + * @param {number} [frequency=1] - The frequency of the values. + * + * @return {Phaser.Types.Math.SinCosTable} The generated values. + */ +var SinCosTableGenerator = function (length, sinAmp, cosAmp, frequency) +{ + if (sinAmp === undefined) { sinAmp = 1; } + if (cosAmp === undefined) { cosAmp = 1; } + if (frequency === undefined) { frequency = 1; } + + frequency *= Math.PI / length; + + var cos = []; + var sin = []; + + for (var c = 0; c < length; c++) + { + cosAmp -= sinAmp * frequency; + sinAmp += cosAmp * frequency; + + cos[c] = cosAmp; + sin[c] = sinAmp; + } + + return { + sin: sin, + cos: cos, + length: length + }; +}; + +module.exports = SinCosTableGenerator; + + +/***/ }), + +/***/ 2733: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate a smooth interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * + * @function Phaser.Math.SmoothStep + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep} + * + * @param {number} x - The input value. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The percentage of interpolation, between 0 and 1. + */ +var SmoothStep = function (x, min, max) +{ + if (x <= min) + { + return 0; + } + + if (x >= max) + { + return 1; + } + + x = (x - min) / (max - min); + + return x * x * (3 - 2 * x); +}; + +module.exports = SmoothStep; + + +/***/ }), + +/***/ 278: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate a smoother interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * + * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}. + * + * @function Phaser.Math.SmootherStep + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} + * + * @param {number} x - The input value. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The percentage of interpolation, between 0 and 1. + */ +var SmootherStep = function (x, min, max) +{ + x = Math.max(0, Math.min(1, (x - min) / (max - min))); + + return x * x * x * (x * (x * 6 - 15) + 10); +}; + +module.exports = SmootherStep; + + +/***/ }), + +/***/ 163: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(2529); + +/** + * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid. + * + * For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2. + * + * If the given index is out of range an empty Vector2 is returned. + * + * @function Phaser.Math.ToXY + * @since 3.19.0 + * + * @param {number} index - The position within the grid to get the x/y value for. + * @param {number} width - The width of the grid. + * @param {number} height - The height of the grid. + * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created. + * + * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index. + */ +var ToXY = function (index, width, height, out) +{ + if (out === undefined) { out = new Vector2(); } + + var x = 0; + var y = 0; + var total = width * height; + + if (index > 0 && index <= total) + { + if (index > width - 1) + { + y = Math.floor(index / width); + x = index - (y * width); + } + else + { + x = index; + } + } + + return out.set(x, y); +}; + +module.exports = ToXY; + + +/***/ }), + +/***/ 7556: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(2529); + +/** + * Takes the `x` and `y` coordinates and transforms them into the same space as + * defined by the position, rotation and scale values. + * + * @function Phaser.Math.TransformXY + * @since 3.0.0 + * + * @param {number} x - The x coordinate to be transformed. + * @param {number} y - The y coordinate to be transformed. + * @param {number} positionX - Horizontal position of the transform point. + * @param {number} positionY - Vertical position of the transform point. + * @param {number} rotation - Rotation of the transform point, in radians. + * @param {number} scaleX - Horizontal scale of the transform point. + * @param {number} scaleY - Vertical scale of the transform point. + * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates. + * + * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point. + */ +var TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output) +{ + if (output === undefined) { output = new Vector2(); } + + var radianSin = Math.sin(rotation); + var radianCos = Math.cos(rotation); + + // Rotate and Scale + var a = radianCos * scaleX; + var b = radianSin * scaleX; + var c = -radianSin * scaleY; + var d = radianCos * scaleY; + + // Invert + var id = 1 / ((a * d) + (c * -b)); + + output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id); + output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id); + + return output; +}; + +module.exports = TransformXY; + + +/***/ }), + +/***/ 2529: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(7473); +var FuzzyEqual = __webpack_require__(12); + +/** + * @classdesc + * A representation of a vector in 2D space. + * + * A two-component vector. + * + * @class Vector2 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number|Phaser.Types.Math.Vector2Like} [x=0] - The x component, or an object with `x` and `y` properties. + * @param {number} [y=x] - The y component. + */ +var Vector2 = new Class({ + + initialize: + + function Vector2 (x, y) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector2#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector2#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + } + else + { + if (y === undefined) { y = x; } + + this.x = x || 0; + this.y = y || 0; + } + }, + + /** + * Make a clone of this Vector2. + * + * @method Phaser.Math.Vector2#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} A clone of this Vector2. + */ + clone: function () + { + return new Vector2(this.x, this.y); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector2#copy + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + copy: function (src) + { + this.x = src.x || 0; + this.y = src.y || 0; + + return this; + }, + + /** + * Set the component values of this Vector from a given Vector2Like object. + * + * @method Phaser.Math.Vector2#setFromObject + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setFromObject: function (obj) + { + this.x = obj.x || 0; + this.y = obj.y || 0; + + return this; + }, + + /** + * Set the `x` and `y` components of the this Vector to the given `x` and `y` values. + * + * @method Phaser.Math.Vector2#set + * @since 3.0.0 + * + * @param {number} x - The x value to set for this Vector. + * @param {number} [y=x] - The y value to set for this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + set: function (x, y) + { + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + }, + + /** + * This method is an alias for `Vector2.set`. + * + * @method Phaser.Math.Vector2#setTo + * @since 3.4.0 + * + * @param {number} x - The x value to set for this Vector. + * @param {number} [y=x] - The y value to set for this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setTo: function (x, y) + { + return this.set(x, y); + }, + + /** + * Sets the `x` and `y` values of this object from a given polar coordinate. + * + * @method Phaser.Math.Vector2#setToPolar + * @since 3.0.0 + * + * @param {number} azimuth - The angular coordinate, in radians. + * @param {number} [radius=1] - The radial coordinate (length). + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setToPolar: function (azimuth, radius) + { + if (radius == null) { radius = 1; } + + this.x = Math.cos(azimuth) * radius; + this.y = Math.sin(azimuth) * radius; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @method Phaser.Math.Vector2#equals + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. + * + * @return {boolean} Whether the given Vector is equal to this Vector. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y)); + }, + + /** + * Check whether this Vector is approximately equal to a given Vector. + * + * @method Phaser.Math.Vector2#fuzzyEquals + * @since 3.23.0 + * + * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. + * @param {number} [epsilon=0.0001] - The tolerance value. + * + * @return {boolean} Whether both absolute differences of the x and y components are smaller than `epsilon`. + */ + fuzzyEquals: function (v, epsilon) + { + return (FuzzyEqual(this.x, v.x, epsilon) && FuzzyEqual(this.y, v.y, epsilon)); + }, + + /** + * Calculate the angle between this Vector and the positive x-axis, in radians. + * + * @method Phaser.Math.Vector2#angle + * @since 3.0.0 + * + * @return {number} The angle between this Vector, and the positive x-axis, given in radians. + */ + angle: function () + { + // computes the angle in radians with respect to the positive x-axis + + var angle = Math.atan2(this.y, this.x); + + if (angle < 0) + { + angle += 2 * Math.PI; + } + + return angle; + }, + + /** + * Set the angle of this Vector. + * + * @method Phaser.Math.Vector2#setAngle + * @since 3.23.0 + * + * @param {number} angle - The angle, in radians. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setAngle: function (angle) + { + return this.setToPolar(angle, this.length()); + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector2#add + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + add: function (src) + { + this.x += src.x; + this.y += src.y; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector2#subtract + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + subtract: function (src) + { + this.x -= src.x; + this.y -= src.y; + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector2#multiply + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + multiply: function (src) + { + this.x *= src.x; + this.y *= src.y; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector2#scale + * @since 3.0.0 + * + * @param {number} value - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + scale: function (value) + { + if (isFinite(value)) + { + this.x *= value; + this.y *= value; + } + else + { + this.x = 0; + this.y = 0; + } + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector2#divide + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + divide: function (src) + { + this.x /= src.x; + this.y /= src.y; + + return this; + }, + + /** + * Negate the `x` and `y` components of this Vector. + * + * @method Phaser.Math.Vector2#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#distance + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (src) + { + var dx = src.x - this.x; + var dy = src.y - this.y; + + return Math.sqrt(dx * dx + dy * dy); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector2#distanceSq + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (src) + { + var dx = src.x - this.x; + var dy = src.y - this.y; + + return dx * dx + dy * dy; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector2#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + + return Math.sqrt(x * x + y * y); + }, + + /** + * Set the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector2#setLength + * @since 3.23.0 + * + * @param {number} length + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setLength: function (length) + { + return this.normalize().scale(length); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector2#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + + return x * x + y * y; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector2#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var len = x * x + y * y; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + } + + return this; + }, + + /** + * Rotate this Vector to its perpendicular, in the positive direction. + * + * @method Phaser.Math.Vector2#normalizeRightHand + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + normalizeRightHand: function () + { + var x = this.x; + + this.x = this.y * -1; + this.y = x; + + return this; + }, + + /** + * Rotate this Vector to its perpendicular, in the negative direction. + * + * @method Phaser.Math.Vector2#normalizeLeftHand + * @since 3.23.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + normalizeLeftHand: function () + { + var x = this.x; + + this.x = this.y; + this.y = x * -1; + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#dot + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to dot product with this Vector2. + * + * @return {number} The dot product of this Vector and the given Vector. + */ + dot: function (src) + { + return this.x * src.x + this.y * src.y; + }, + + /** + * Calculate the cross product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#cross + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to cross with this Vector2. + * + * @return {number} The cross product of this Vector and the given Vector. + */ + cross: function (src) + { + return this.x * src.y - this.y * src.x; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector2#lerp + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + lerp: function (src, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + + this.x = ax + t * (src.x - ax); + this.y = ay + t * (src.y - ay); + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector2#transformMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + transformMat3: function (mat) + { + var x = this.x; + var y = this.y; + var m = mat.val; + + this.x = m[0] * x + m[3] * y + m[6]; + this.y = m[1] * x + m[4] * y + m[7]; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector2#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[12]; + this.y = m[1] * x + m[5] * y + m[13]; + + return this; + }, + + /** + * Make this Vector the zero vector (0, 0). + * + * @method Phaser.Math.Vector2#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + reset: function () + { + this.x = 0; + this.y = 0; + + return this; + }, + + /** + * Limit the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector2#limit + * @since 3.23.0 + * + * @param {number} max - The maximum length. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + limit: function (max) + { + var len = this.length(); + + if (len && len > max) + { + this.scale(max / len); + } + + return this; + }, + + /** + * Reflect this Vector off a line defined by a normal. + * + * @method Phaser.Math.Vector2#reflect + * @since 3.23.0 + * + * @param {Phaser.Math.Vector2} normal - A vector perpendicular to the line. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + reflect: function (normal) + { + normal = normal.clone().normalize(); + + return this.subtract(normal.scale(2 * this.dot(normal))); + }, + + /** + * Reflect this Vector across another. + * + * @method Phaser.Math.Vector2#mirror + * @since 3.23.0 + * + * @param {Phaser.Math.Vector2} axis - A vector to reflect across. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + mirror: function (axis) + { + return this.reflect(axis).negate(); + }, + + /** + * Rotate this Vector by an angle amount. + * + * @method Phaser.Math.Vector2#rotate + * @since 3.23.0 + * + * @param {number} delta - The angle to rotate by, in radians. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + rotate: function (delta) + { + var cos = Math.cos(delta); + var sin = Math.sin(delta); + + return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); + }, + + /** + * Project this Vector onto another. + * + * @method Phaser.Math.Vector2#project + * @since 3.60.0 + * + * @param {Phaser.Math.Vector2} src - The vector to project onto. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + project: function (src) + { + var scalar = this.dot(src) / src.dot(src); + + return this.copy(src).scale(scalar); + } + +}); + +/** + * A static zero Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.ZERO + * @type {Phaser.Math.Vector2} + * @since 3.1.0 + */ +Vector2.ZERO = new Vector2(); + +/** + * A static right Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.RIGHT + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.RIGHT = new Vector2(1, 0); + +/** + * A static left Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.LEFT + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.LEFT = new Vector2(-1, 0); + +/** + * A static up Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.UP + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.UP = new Vector2(0, -1); + +/** + * A static down Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.DOWN + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.DOWN = new Vector2(0, 1); + +/** + * A static one Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.ONE + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.ONE = new Vector2(1, 1); + +module.exports = Vector2; + + +/***/ }), + +/***/ 5689: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A representation of a vector in 3D space. + * + * A three-component vector. + * + * @class Vector3 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Vector3 = new Class({ + + initialize: + + function Vector3 (x, y, z) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector3#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector3#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The z component of this Vector. + * + * @name Phaser.Math.Vector3#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.z = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + }, + + /** + * Set this Vector to point up. + * + * Sets the y component of the vector to 1, and the others to 0. + * + * @method Phaser.Math.Vector3#up + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + up: function () + { + this.x = 0; + this.y = 1; + this.z = 0; + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.min` result from the given vector. + * + * @method Phaser.Math.Vector3#min + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the minimum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + min: function (v) + { + this.x = Math.min(this.x, v.x); + this.y = Math.min(this.y, v.y); + this.z = Math.min(this.z, v.z); + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.max` result from the given vector. + * + * @method Phaser.Math.Vector3#max + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the maximum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + max: function (v) + { + this.x = Math.max(this.x, v.x); + this.y = Math.max(this.y, v.y); + this.z = Math.max(this.z, v.z); + + return this; + }, + + /** + * Make a clone of this Vector3. + * + * @method Phaser.Math.Vector3#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. + */ + clone: function () + { + return new Vector3(this.x, this.y, this.z); + }, + + /** + * Adds the two given Vector3s and sets the results into this Vector3. + * + * @method Phaser.Math.Vector3#addVectors + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to add. + * @param {Phaser.Math.Vector3} b - The second Vector to add. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addVectors: function (a, b) + { + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + + return this; + }, + + /** + * Calculate the cross (vector) product of two given Vectors. + * + * @method Phaser.Math.Vector3#crossVectors + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to multiply. + * @param {Phaser.Math.Vector3} b - The second Vector to multiply. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + crossVectors: function (a, b) + { + var ax = a.x; + var ay = a.y; + var az = a.z; + var bx = b.x; + var by = b.y; + var bz = b.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @method Phaser.Math.Vector3#equals + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. + * + * @return {boolean} True if the two vectors strictly match, otherwise false. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector3#copy + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + copy: function (src) + { + this.x = src.x; + this.y = src.y; + this.z = src.z || 0; + + return this; + }, + + /** + * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. + * + * @method Phaser.Math.Vector3#set + * @since 3.0.0 + * + * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. + * @param {number} [y] - The y value to set for this Vector. + * @param {number} [z] - The z value to set for this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + set: function (x, y, z) + { + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + + return this; + }, + + /** + * Sets the components of this Vector3 from the position of the given Matrix4. + * + * @method Phaser.Math.Vector3#setFromMatrixPosition + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the position from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixPosition: function (m) + { + return this.fromArray(m.val, 12); + }, + + /** + * Sets the components of this Vector3 from the Matrix4 column specified. + * + * @method Phaser.Math.Vector3#setFromMatrixColumn + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the column from. + * @param {number} index - The column index. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixColumn: function (mat4, index) + { + return this.fromArray(mat4.val, index * 4); + }, + + /** + * Sets the components of this Vector3 from the given array, based on the offset. + * + * Vector3.x = array[offset] + * Vector3.y = array[offset + 1] + * Vector3.z = array[offset + 2] + * + * @method Phaser.Math.Vector3#fromArray + * @since 3.50.0 + * + * @param {number[]} array - The array of values to get this Vector from. + * @param {number} [offset=0] - The offset index into the array. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + fromArray: function (array, offset) + { + if (offset === undefined) { offset = 0; } + + this.x = array[offset]; + this.y = array[offset + 1]; + this.z = array[offset + 2]; + + return this; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + add: function (v) + { + this.x += v.x; + this.y += v.y; + this.z += v.z || 0; + + return this; + }, + + /** + * Add the given value to each component of this Vector. + * + * @method Phaser.Math.Vector3#addScalar + * @since 3.50.0 + * + * @param {number} s - The amount to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScalar: function (s) + { + this.x += s; + this.y += s; + this.z += s; + + return this; + }, + + /** + * Add and scale a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#addScale + * @since 3.50.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * @param {number} scale - The amount to scale `v` by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScale: function (v, scale) + { + this.x += v.x * scale; + this.y += v.y * scale; + this.z += v.z * scale || 0; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector3#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + subtract: function (v) + { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z || 0; + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + multiply: function (v) + { + this.x *= v.x; + this.y *= v.y; + this.z *= v.z || 1; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector3#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + scale: function (scale) + { + if (isFinite(scale)) + { + this.x *= scale; + this.y *= scale; + this.z *= scale; + } + else + { + this.x = 0; + this.y = 0; + this.z = 0; + } + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#divide + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + divide: function (v) + { + this.x /= v.x; + this.y /= v.y; + this.z /= v.z || 1; + + return this; + }, + + /** + * Negate the `x`, `y` and `z` components of this Vector. + * + * @method Phaser.Math.Vector3#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#distance + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return Math.sqrt(dx * dx + dy * dy + dz * dz); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector3#distanceSq + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return dx * dx + dy * dy + dz * dz; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector3#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return Math.sqrt(x * x + y * y + z * z); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector3#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return x * x + y * y + z * z; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector3#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var len = x * x + y * y + z * z; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + this.z = z * len; + } + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. + * + * @return {number} The dot product of this Vector and `v`. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z; + }, + + /** + * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. + * + * @method Phaser.Math.Vector3#cross + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector to cross product with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + cross: function (v) + { + var ax = this.x; + var ay = this.y; + var az = this.z; + var bx = v.x; + var by = v.y; + var bz = v.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector3#lerp + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + + this.x = ax + t * (v.x - ax); + this.y = ay + t * (v.y - ay); + this.z = az + t * (v.z - az); + + return this; + }, + + /** + * Takes a Matrix3 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix3 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix3} mat3 - The Matrix3 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix3: function (mat3) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat3.val; + + this.x = m[0] * x + m[3] * y + m[6] * z; + this.y = m[1] * x + m[4] * y + m[7] * z; + this.z = m[2] * x + m[5] * y + m[8] * z; + + return this; + }, + + /** + * Takes a Matrix4 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix4: function (mat4) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat4.val; + + var w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]); + + this.x = (m[0] * x + m[4] * y + m[8] * z + m[12]) * w; + this.y = (m[1] * x + m[5] * y + m[9] * z + m[13]) * w; + this.z = (m[2] * x + m[6] * y + m[10] * z + m[14]) * w; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector3#transformMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat3: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = x * m[0] + y * m[3] + z * m[6]; + this.y = x * m[1] + y * m[4] + z * m[7]; + this.z = x * m[2] + y * m[5] + z * m[8]; + + return this; + }, + + /** + * Transform this Vector with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; + this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; + this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; + + return this; + }, + + /** + * Transforms the coordinates of this Vector3 with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformCoordinates + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformCoordinates: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; + var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; + var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; + var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; + + this.x = tx / tw; + this.y = ty / tw; + this.z = tz / tw; + + return this; + }, + + /** + * Transform this Vector with the given Quaternion. + * + * @method Phaser.Math.Vector3#transformQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformQuat: function (q) + { + // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations + var x = this.x; + var y = this.y; + var z = this.z; + var qx = q.x; + var qy = q.y; + var qz = q.z; + var qw = q.w; + + // calculate quat * vec + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; + + return this; + }, + + /** + * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, + * e.g. unprojecting a 2D point into 3D space. + * + * @method Phaser.Math.Vector3#project + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + project: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var a00 = m[0]; + var a01 = m[1]; + var a02 = m[2]; + var a03 = m[3]; + var a10 = m[4]; + var a11 = m[5]; + var a12 = m[6]; + var a13 = m[7]; + var a20 = m[8]; + var a21 = m[9]; + var a22 = m[10]; + var a23 = m[11]; + var a30 = m[12]; + var a31 = m[13]; + var a32 = m[14]; + var a33 = m[15]; + + var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); + + this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; + this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; + this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; + + return this; + }, + + /** + * Multiplies this Vector3 by the given view and projection matrices. + * + * @method Phaser.Math.Vector3#projectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} viewMatrix - A View Matrix. + * @param {Phaser.Math.Matrix4} projectionMatrix - A Projection Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + projectViewMatrix: function (viewMatrix, projectionMatrix) + { + return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix); + }, + + /** + * Multiplies this Vector3 by the given inversed projection matrix and world matrix. + * + * @method Phaser.Math.Vector3#unprojectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} projectionMatrix - An inversed Projection Matrix. + * @param {Phaser.Math.Matrix4} worldMatrix - A World View Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unprojectViewMatrix: function (projectionMatrix, worldMatrix) + { + return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix); + }, + + /** + * Unproject this point from 2D space to 3D space. + * The point should have its x and y properties set to + * 2D screen space, and the z either at 0 (near plane) + * or 1 (far plane). The provided matrix is assumed to already + * be combined, i.e. projection * view * model. + * + * After this operation, this vector's (x, y, z) components will + * represent the unprojected 3D coordinate. + * + * @method Phaser.Math.Vector3#unproject + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. + * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unproject: function (viewport, invProjectionView) + { + var viewX = viewport.x; + var viewY = viewport.y; + var viewWidth = viewport.z; + var viewHeight = viewport.w; + + var x = this.x - viewX; + var y = (viewHeight - this.y - 1) - viewY; + var z = this.z; + + this.x = (2 * x) / viewWidth - 1; + this.y = (2 * y) / viewHeight - 1; + this.z = 2 * z - 1; + + return this.project(invProjectionView); + }, + + /** + * Make this Vector the zero vector (0, 0, 0). + * + * @method Phaser.Math.Vector3#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + reset: function () + { + this.x = 0; + this.y = 0; + this.z = 0; + + return this; + } + +}); + +/** + * A static zero Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ZERO + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ZERO = new Vector3(); + +/** + * A static right Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.RIGHT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.RIGHT = new Vector3(1, 0, 0); + +/** + * A static left Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.LEFT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.LEFT = new Vector3(-1, 0, 0); + +/** + * A static up Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.UP + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.UP = new Vector3(0, -1, 0); + +/** + * A static down Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.DOWN + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.DOWN = new Vector3(0, 1, 0); + +/** + * A static forward Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.FORWARD + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.FORWARD = new Vector3(0, 0, 1); + +/** + * A static back Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.BACK + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.BACK = new Vector3(0, 0, -1); + +/** + * A static one Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ONE + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ONE = new Vector3(1, 1, 1); + +module.exports = Vector3; + + +/***/ }), + +/***/ 9279: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A representation of a vector in 4D space. + * + * A four-component vector. + * + * @class Vector4 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + * @param {number} [w] - The w component. + */ +var Vector4 = new Class({ + + initialize: + + function Vector4 (x, y, z, w) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector4#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector4#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The z component of this Vector. + * + * @name Phaser.Math.Vector4#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.z = 0; + + /** + * The w component of this Vector. + * + * @name Phaser.Math.Vector4#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.w = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + this.w = x.w || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + this.w = w || 0; + } + }, + + /** + * Make a clone of this Vector4. + * + * @method Phaser.Math.Vector4#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} A clone of this Vector4. + */ + clone: function () + { + return new Vector4(this.x, this.y, this.z, this.w); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector4#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + copy: function (src) + { + this.x = src.x; + this.y = src.y; + this.z = src.z || 0; + this.w = src.w || 0; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict quality check against each Vector's components. + * + * @method Phaser.Math.Vector4#equals + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} v - The vector to check equality with. + * + * @return {boolean} A boolean indicating whether the two Vectors are equal or not. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z) && (this.w === v.w)); + }, + + /** + * Set the `x`, `y`, `z` and `w` components of the this Vector to the given `x`, `y`, `z` and `w` values. + * + * @method Phaser.Math.Vector4#set + * @since 3.0.0 + * + * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y, z and w components. + * @param {number} y - The y value to set for this Vector. + * @param {number} z - The z value to set for this Vector. + * @param {number} w - The z value to set for this Vector. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + set: function (x, y, z, w) + { + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + this.w = x.w || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + this.w = w || 0; + } + + return this; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector4#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + add: function (v) + { + this.x += v.x; + this.y += v.y; + this.z += v.z || 0; + this.w += v.w || 0; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector4#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + subtract: function (v) + { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z || 0; + this.w -= v.w || 0; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector4#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + scale: function (scale) + { + this.x *= scale; + this.y *= scale; + this.z *= scale; + this.w *= scale; + + return this; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector4#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return Math.sqrt(x * x + y * y + z * z + w * w); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector4#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return x * x + y * y + z * z + w * w; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector4#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + var len = x * x + y * y + z * z + w * w; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + this.z = z * len; + this.w = w * len; + } + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector4#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} v - The Vector4 to dot product with this Vector4. + * + * @return {number} The dot product of this Vector and the given Vector. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector4#lerp + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} v - The Vector4 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + this.x = ax + t * (v.x - ax); + this.y = ay + t * (v.y - ay); + this.z = az + t * (v.z - az); + this.w = aw + t * (v.w - aw); + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector4#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + multiply: function (v) + { + this.x *= v.x; + this.y *= v.y; + this.z *= v.z || 1; + this.w *= v.w || 1; + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector4#divide + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + divide: function (v) + { + this.x /= v.x; + this.y /= v.y; + this.z /= v.z || 1; + this.w /= v.w || 1; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector4#distance + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + var dw = v.w - this.w || 0; + + return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector4#distanceSq + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + var dw = v.w - this.w || 0; + + return dx * dx + dy * dy + dz * dz + dw * dw; + }, + + /** + * Negate the `x`, `y`, `z` and `w` components of this Vector. + * + * @method Phaser.Math.Vector4#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + this.w = -this.w; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector4#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector4 with. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + this.y = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + this.z = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + this.w = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + + return this; + }, + + /** + * Transform this Vector with the given Quaternion. + * + * @method Phaser.Math.Vector4#transformQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + transformQuat: function (q) + { + var x = this.x; + var y = this.y; + var z = this.z; + var qx = q.x; + var qy = q.y; + var qz = q.z; + var qw = q.w; + + // calculate quat * vec + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; + + return this; + }, + + /** + * Make this Vector the zero vector (0, 0, 0, 0). + * + * @method Phaser.Math.Vector4#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + reset: function () + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 0; + + return this; + } + +}); + +Vector4.prototype.sub = Vector4.prototype.subtract; +Vector4.prototype.mul = Vector4.prototype.multiply; +Vector4.prototype.div = Vector4.prototype.divide; +Vector4.prototype.dist = Vector4.prototype.distance; +Vector4.prototype.distSq = Vector4.prototype.distanceSq; +Vector4.prototype.len = Vector4.prototype.length; +Vector4.prototype.lenSq = Vector4.prototype.lengthSq; + +module.exports = Vector4; + + +/***/ }), + +/***/ 4119: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if the two values are within the given `tolerance` of each other. + * + * @function Phaser.Math.Within + * @since 3.0.0 + * + * @param {number} a - The first value to use in the calculation. + * @param {number} b - The second value to use in the calculation. + * @param {number} tolerance - The tolerance. Anything equal to or less than this value is considered as being within range. + * + * @return {boolean} Returns `true` if `a` is less than or equal to the tolerance of `b`. + */ +var Within = function (a, b, tolerance) +{ + return (Math.abs(a - b) <= tolerance); +}; + +module.exports = Within; + + +/***/ }), + +/***/ 8445: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Wrap the given `value` between `min` and `max`. + * + * @function Phaser.Math.Wrap + * @since 3.0.0 + * + * @param {number} value - The value to wrap. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. + * + * @return {number} The wrapped value. + */ +var Wrap = function (value, min, max) +{ + if (value >= min && value <= max) + { + // Skip modulo if already in range + return value; + } + + var range = max - min; + + return (min + ((((value - min) % range) + range) % range)); +}; + +module.exports = Wrap; + + +/***/ }), + +/***/ 6412: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * + * @function Phaser.Math.Angle.Between + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The angle in radians. + */ +var Between = function (x1, y1, x2, y2) +{ + return Math.atan2(y2 - y1, x2 - x1); +}; + +module.exports = Between; + + +/***/ }), + +/***/ 760: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * + * Calculates the angle of the vector from the first point to the second point. + * + * @function Phaser.Math.Angle.BetweenPoints + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} point1 - The first point. + * @param {Phaser.Types.Math.Vector2Like} point2 - The second point. + * + * @return {number} The angle in radians. + */ +var BetweenPoints = function (point1, point2) +{ + return Math.atan2(point2.y - point1.y, point2.x - point1.x); +}; + +module.exports = BetweenPoints; + + +/***/ }), + +/***/ 6909: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * + * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate + * travels down the screen. + * + * @function Phaser.Math.Angle.BetweenPointsY + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} point1 - The first point. + * @param {Phaser.Types.Math.Vector2Like} point2 - The second point. + * + * @return {number} The angle in radians. + */ +var BetweenPointsY = function (point1, point2) +{ + return Math.atan2(point2.x - point1.x, point2.y - point1.y); +}; + +module.exports = BetweenPointsY; + + +/***/ }), + +/***/ 6947: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * + * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate + * travels down the screen. + * + * @function Phaser.Math.Angle.BetweenY + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The angle in radians. + */ +var BetweenY = function (x1, y1, x2, y2) +{ + return Math.atan2(x2 - x1, y2 - y1); +}; + +module.exports = BetweenY; + + +/***/ }), + +/***/ 3426: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(7425); + +/** + * Takes an angle in Phasers default clockwise format and converts it so that + * 0 is North, 90 is West, 180 is South and 270 is East, + * therefore running counter-clockwise instead of clockwise. + * + * You can pass in the angle from a Game Object using: + * + * ```javascript + * var converted = CounterClockwise(gameobject.rotation); + * ``` + * + * All values for this function are in radians. + * + * @function Phaser.Math.Angle.CounterClockwise + * @since 3.16.0 + * + * @param {number} angle - The angle to convert, in radians. + * + * @return {number} The converted angle, in radians. + */ +var CounterClockwise = function (angle) +{ + if (angle > Math.PI) + { + angle -= CONST.PI2; + } + + return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); +}; + +module.exports = CounterClockwise; + + +/***/ }), + +/***/ 6906: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Normalize an angle to the [0, 2pi] range. + * + * @function Phaser.Math.Angle.Normalize + * @since 3.0.0 + * + * @param {number} angle - The angle to normalize, in radians. + * + * @return {number} The normalized angle, in radians. + */ +var Normalize = function (angle) +{ + angle = angle % (2 * Math.PI); + + if (angle >= 0) + { + return angle; + } + else + { + return angle + 2 * Math.PI; + } +}; + +module.exports = Normalize; + + +/***/ }), + +/***/ 3270: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @author @samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FloatBetween = __webpack_require__(104); + +/** + * Returns a random angle in the range [-pi, pi]. + * + * @function Phaser.Math.Angle.Random + * @since 3.23.0 + * + * @return {number} The angle, in radians. + */ +var Random = function () +{ + return FloatBetween(-Math.PI, Math.PI); +}; + +module.exports = Random; + + +/***/ }), + +/***/ 2748: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @author @samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FloatBetween = __webpack_require__(104); + +/** + * Returns a random angle in the range [-180, 180]. + * + * @function Phaser.Math.Angle.RandomDegrees + * @since 3.23.0 + * + * @return {number} The angle, in degrees. + */ +var RandomDegrees = function () +{ + return FloatBetween(-180, 180); +}; + +module.exports = RandomDegrees; + + +/***/ }), + +/***/ 936: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Normalize = __webpack_require__(6906); + +/** + * Reverse the given angle. + * + * @function Phaser.Math.Angle.Reverse + * @since 3.0.0 + * + * @param {number} angle - The angle to reverse, in radians. + * + * @return {number} The reversed angle, in radians. + */ +var Reverse = function (angle) +{ + return Normalize(angle + Math.PI); +}; + +module.exports = Reverse; + + +/***/ }), + +/***/ 1935: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(7425); + +/** + * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. + * + * @function Phaser.Math.Angle.RotateTo + * @since 3.0.0 + * + * @param {number} currentAngle - The current angle, in radians. + * @param {number} targetAngle - The target angle to rotate to, in radians. + * @param {number} [lerp=0.05] - The lerp value to add to the current angle. + * + * @return {number} The adjusted angle. + */ +var RotateTo = function (currentAngle, targetAngle, lerp) +{ + if (lerp === undefined) { lerp = 0.05; } + + if (currentAngle === targetAngle) + { + return currentAngle; + } + + if (Math.abs(targetAngle - currentAngle) <= lerp || Math.abs(targetAngle - currentAngle) >= (MATH_CONST.PI2 - lerp)) + { + currentAngle = targetAngle; + } + else + { + if (Math.abs(targetAngle - currentAngle) > Math.PI) + { + if (targetAngle < currentAngle) + { + targetAngle += MATH_CONST.PI2; + } + else + { + targetAngle -= MATH_CONST.PI2; + } + } + + if (targetAngle > currentAngle) + { + currentAngle += lerp; + } + else if (targetAngle < currentAngle) + { + currentAngle -= lerp; + } + } + + return currentAngle; +}; + +module.exports = RotateTo; + + +/***/ }), + +/***/ 5393: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Gets the shortest angle between `angle1` and `angle2`. + * + * Both angles must be in the range -180 to 180, which is the same clamped + * range that `sprite.angle` uses, so you can pass in two sprite angles to + * this method and get the shortest angle back between the two of them. + * + * The angle returned will be in the same range. If the returned angle is + * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's + * a clockwise rotation. + * + * @function Phaser.Math.Angle.ShortestBetween + * @since 3.0.0 + * + * @param {number} angle1 - The first angle in the range -180 to 180. + * @param {number} angle2 - The second angle in the range -180 to 180. + * + * @return {number} The shortest angle, in degrees. If greater than zero it's a counter-clockwise rotation. + */ +var ShortestBetween = function (angle1, angle2) +{ + var difference = angle2 - angle1; + + if (difference === 0) + { + return 0; + } + + var times = Math.floor((difference - (-180)) / 360); + + return difference - (times * 360); + +}; + +module.exports = ShortestBetween; + + +/***/ }), + +/***/ 3692: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MathWrap = __webpack_require__(8445); + +/** + * Wrap an angle. + * + * Wraps the angle to a value in the range of -PI to PI. + * + * @function Phaser.Math.Angle.Wrap + * @since 3.0.0 + * + * @param {number} angle - The angle to wrap, in radians. + * + * @return {number} The wrapped angle, in radians. + */ +var Wrap = function (angle) +{ + return MathWrap(angle, -Math.PI, Math.PI); +}; + +module.exports = Wrap; + + +/***/ }), + +/***/ 2820: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Wrap = __webpack_require__(8445); + +/** + * Wrap an angle in degrees. + * + * Wraps the angle to a value in the range of -180 to 180. + * + * @function Phaser.Math.Angle.WrapDegrees + * @since 3.0.0 + * + * @param {number} angle - The angle to wrap, in degrees. + * + * @return {number} The wrapped angle, in degrees. + */ +var WrapDegrees = function (angle) +{ + return Wrap(angle, -180, 180); +}; + +module.exports = WrapDegrees; + + +/***/ }), + +/***/ 1833: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Angle + */ + +module.exports = { + + Between: __webpack_require__(6412), + BetweenPoints: __webpack_require__(760), + BetweenPointsY: __webpack_require__(6909), + BetweenY: __webpack_require__(6947), + CounterClockwise: __webpack_require__(3426), + Normalize: __webpack_require__(6906), + Random: __webpack_require__(3270), + RandomDegrees: __webpack_require__(2748), + Reverse: __webpack_require__(936), + RotateTo: __webpack_require__(1935), + ShortestBetween: __webpack_require__(5393), + Wrap: __webpack_require__(3692), + WrapDegrees: __webpack_require__(2820) + +}; + + +/***/ }), + +/***/ 7425: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = { + + /** + * The value of PI * 2. + * + * @name Phaser.Math.PI2 + * @type {number} + * @since 3.0.0 + */ + PI2: Math.PI * 2, + + /** + * The value of PI * 0.5. + * + * Yes, we understand that this should actually be PI * 2, but + * it has been like this for so long we can't change it now. + * If you need PI * 2, use the PI2 constant instead. + * + * @name Phaser.Math.TAU + * @type {number} + * @since 3.0.0 + */ + TAU: Math.PI * 0.5, + + /** + * An epsilon value (1.0e-6) + * + * @name Phaser.Math.EPSILON + * @type {number} + * @since 3.0.0 + */ + EPSILON: 1.0e-6, + + /** + * For converting degrees to radians (PI / 180) + * + * @name Phaser.Math.DEG_TO_RAD + * @type {number} + * @since 3.0.0 + */ + DEG_TO_RAD: Math.PI / 180, + + /** + * For converting radians to degrees (180 / PI) + * + * @name Phaser.Math.RAD_TO_DEG + * @type {number} + * @since 3.0.0 + */ + RAD_TO_DEG: 180 / Math.PI, + + /** + * An instance of the Random Number Generator. + * This is not set until the Game boots. + * + * @name Phaser.Math.RND + * @type {Phaser.Math.RandomDataGenerator} + * @since 3.0.0 + */ + RND: null, + + /** + * The minimum safe integer this browser supports. + * We use a const for backward compatibility with Internet Explorer. + * + * @name Phaser.Math.MIN_SAFE_INTEGER + * @type {number} + * @since 3.21.0 + */ + MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER || -9007199254740991, + + /** + * The maximum safe integer this browser supports. + * We use a const for backward compatibility with Internet Explorer. + * + * @name Phaser.Math.MAX_SAFE_INTEGER + * @type {number} + * @since 3.21.0 + */ + MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER || 9007199254740991 + +}; + +module.exports = MATH_CONST; + + +/***/ }), + +/***/ 1518: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the distance between two sets of coordinates (points). + * + * @function Phaser.Math.Distance.Between + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point. + */ +var DistanceBetween = function (x1, y1, x2, y2) +{ + var dx = x1 - x2; + var dy = y1 - y2; + + return Math.sqrt(dx * dx + dy * dy); +}; + +module.exports = DistanceBetween; + + +/***/ }), + +/***/ 5372: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the distance between two points. + * + * @function Phaser.Math.Distance.BetweenPoints + * @since 3.22.0 + * + * @param {Phaser.Types.Math.Vector2Like} a - The first point. + * @param {Phaser.Types.Math.Vector2Like} b - The second point. + * + * @return {number} The distance between the points. + */ +var DistanceBetweenPoints = function (a, b) +{ + var dx = a.x - b.x; + var dy = a.y - b.y; + + return Math.sqrt(dx * dx + dy * dy); +}; + +module.exports = DistanceBetweenPoints; + + +/***/ }), + +/***/ 4430: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the squared distance between two points. + * + * @function Phaser.Math.Distance.BetweenPointsSquared + * @since 3.22.0 + * + * @param {Phaser.Types.Math.Vector2Like} a - The first point. + * @param {Phaser.Types.Math.Vector2Like} b - The second point. + * + * @return {number} The squared distance between the points. + */ +var DistanceBetweenPointsSquared = function (a, b) +{ + var dx = a.x - b.x; + var dy = a.y - b.y; + + return dx * dx + dy * dy; +}; + +module.exports = DistanceBetweenPointsSquared; + + +/***/ }), + +/***/ 4361: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the Chebyshev distance between two sets of coordinates (points). + * + * Chebyshev distance (or chessboard distance) is the maximum of the horizontal and vertical distances. + * It's the effective distance when movement can be horizontal, vertical, or diagonal. + * + * @function Phaser.Math.Distance.Chebyshev + * @since 3.22.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point. + */ +var ChebyshevDistance = function (x1, y1, x2, y2) +{ + return Math.max(Math.abs(x1 - x2), Math.abs(y1 - y2)); +}; + +module.exports = ChebyshevDistance; + + +/***/ }), + +/***/ 7798: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the distance between two sets of coordinates (points) to the power of `pow`. + * + * @function Phaser.Math.Distance.Power + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * @param {number} pow - The exponent. + * + * @return {number} The distance between each point. + */ +var DistancePower = function (x1, y1, x2, y2, pow) +{ + if (pow === undefined) { pow = 2; } + + return Math.sqrt(Math.pow(x2 - x1, pow) + Math.pow(y2 - y1, pow)); +}; + +module.exports = DistancePower; + + +/***/ }), + +/***/ 8290: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the snake distance between two sets of coordinates (points). + * + * Snake distance (rectilinear distance, Manhattan distance) is the sum of the horizontal and vertical distances. + * It's the effective distance when movement is allowed only horizontally or vertically (but not both). + * + * @function Phaser.Math.Distance.Snake + * @since 3.22.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point. + */ +var SnakeDistance = function (x1, y1, x2, y2) +{ + return Math.abs(x1 - x2) + Math.abs(y1 - y2); +}; + +module.exports = SnakeDistance; + + +/***/ }), + +/***/ 3788: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the distance between two sets of coordinates (points), squared. + * + * @function Phaser.Math.Distance.Squared + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point, squared. + */ +var DistanceSquared = function (x1, y1, x2, y2) +{ + var dx = x1 - x2; + var dy = y1 - y2; + + return dx * dx + dy * dy; +}; + +module.exports = DistanceSquared; + + +/***/ }), + +/***/ 6338: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Distance + */ + +module.exports = { + + Between: __webpack_require__(1518), + BetweenPoints: __webpack_require__(5372), + BetweenPointsSquared: __webpack_require__(4430), + Chebyshev: __webpack_require__(4361), + Power: __webpack_require__(7798), + Snake: __webpack_require__(8290), + Squared: __webpack_require__(3788) + +}; + + +/***/ }), + +/***/ 5751: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Back ease-in. + * + * @function Phaser.Math.Easing.Back.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [overshoot=1.70158] - The overshoot amount. + * + * @return {number} The tweened value. + */ +var In = function (v, overshoot) +{ + if (overshoot === undefined) { overshoot = 1.70158; } + + return v * v * ((overshoot + 1) * v - overshoot); +}; + +module.exports = In; + + +/***/ }), + +/***/ 6203: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Back ease-in/out. + * + * @function Phaser.Math.Easing.Back.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [overshoot=1.70158] - The overshoot amount. + * + * @return {number} The tweened value. + */ +var InOut = function (v, overshoot) +{ + if (overshoot === undefined) { overshoot = 1.70158; } + + var s = overshoot * 1.525; + + if ((v *= 2) < 1) + { + return 0.5 * (v * v * ((s + 1) * v - s)); + } + else + { + return 0.5 * ((v -= 2) * v * ((s + 1) * v + s) + 2); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 9103: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Back ease-out. + * + * @function Phaser.Math.Easing.Back.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [overshoot=1.70158] - The overshoot amount. + * + * @return {number} The tweened value. + */ +var Out = function (v, overshoot) +{ + if (overshoot === undefined) { overshoot = 1.70158; } + + return --v * v * ((overshoot + 1) * v + overshoot) + 1; +}; + +module.exports = Out; + + +/***/ }), + +/***/ 4938: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Back + */ + +module.exports = { + + In: __webpack_require__(5751), + Out: __webpack_require__(9103), + InOut: __webpack_require__(6203) + +}; + + +/***/ }), + +/***/ 8677: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Bounce ease-in. + * + * @function Phaser.Math.Easing.Bounce.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + v = 1 - v; + + if (v < 1 / 2.75) + { + return 1 - (7.5625 * v * v); + } + else if (v < 2 / 2.75) + { + return 1 - (7.5625 * (v -= 1.5 / 2.75) * v + 0.75); + } + else if (v < 2.5 / 2.75) + { + return 1 - (7.5625 * (v -= 2.25 / 2.75) * v + 0.9375); + } + else + { + return 1 - (7.5625 * (v -= 2.625 / 2.75) * v + 0.984375); + } +}; + +module.exports = In; + + +/***/ }), + +/***/ 4649: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Bounce ease-in/out. + * + * @function Phaser.Math.Easing.Bounce.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + var reverse = false; + + if (v < 0.5) + { + v = 1 - (v * 2); + reverse = true; + } + else + { + v = (v * 2) - 1; + } + + if (v < 1 / 2.75) + { + v = 7.5625 * v * v; + } + else if (v < 2 / 2.75) + { + v = 7.5625 * (v -= 1.5 / 2.75) * v + 0.75; + } + else if (v < 2.5 / 2.75) + { + v = 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375; + } + else + { + v = 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375; + } + + if (reverse) + { + return (1 - v) * 0.5; + } + else + { + return v * 0.5 + 0.5; + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 504: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Bounce ease-out. + * + * @function Phaser.Math.Easing.Bounce.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + if (v < 1 / 2.75) + { + return 7.5625 * v * v; + } + else if (v < 2 / 2.75) + { + return 7.5625 * (v -= 1.5 / 2.75) * v + 0.75; + } + else if (v < 2.5 / 2.75) + { + return 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375; + } + else + { + return 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375; + } +}; + +module.exports = Out; + + +/***/ }), + +/***/ 8872: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Bounce + */ + +module.exports = { + + In: __webpack_require__(8677), + Out: __webpack_require__(504), + InOut: __webpack_require__(4649) + +}; + + +/***/ }), + +/***/ 3170: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Circular ease-in. + * + * @function Phaser.Math.Easing.Circular.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return 1 - Math.sqrt(1 - v * v); +}; + +module.exports = In; + + +/***/ }), + +/***/ 2627: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Circular ease-in/out. + * + * @function Phaser.Math.Easing.Circular.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return -0.5 * (Math.sqrt(1 - v * v) - 1); + } + else + { + return 0.5 * (Math.sqrt(1 - (v -= 2) * v) + 1); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 1349: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Circular ease-out. + * + * @function Phaser.Math.Easing.Circular.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return Math.sqrt(1 - (--v * v)); +}; + +module.exports = Out; + + +/***/ }), + +/***/ 5006: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Circular + */ + +module.exports = { + + In: __webpack_require__(3170), + Out: __webpack_require__(1349), + InOut: __webpack_require__(2627) + +}; + + +/***/ }), + +/***/ 6046: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Cubic ease-in. + * + * @function Phaser.Math.Easing.Cubic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v * v; +}; + +module.exports = In; + + +/***/ }), + +/***/ 9531: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Cubic ease-in/out. + * + * @function Phaser.Math.Easing.Cubic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v * v; + } + else + { + return 0.5 * ((v -= 2) * v * v + 2); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 4836: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Cubic ease-out. + * + * @function Phaser.Math.Easing.Cubic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return --v * v * v + 1; +}; + +module.exports = Out; + + +/***/ }), + +/***/ 875: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Cubic + */ + +module.exports = { + + In: __webpack_require__(6046), + Out: __webpack_require__(4836), + InOut: __webpack_require__(9531) + +}; + + +/***/ }), + +/***/ 7619: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Elastic ease-in. + * + * @function Phaser.Math.Easing.Elastic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. + * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. + * + * @return {number} The tweened value. + */ +var In = function (v, amplitude, period) +{ + if (amplitude === undefined) { amplitude = 0.1; } + if (period === undefined) { period = 0.1; } + + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + var s = period / 4; + + if (amplitude < 1) + { + amplitude = 1; + } + else + { + s = period * Math.asin(1 / amplitude) / (2 * Math.PI); + } + + return -(amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period)); + } +}; + +module.exports = In; + + +/***/ }), + +/***/ 7437: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Elastic ease-in/out. + * + * @function Phaser.Math.Easing.Elastic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. + * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. + * + * @return {number} The tweened value. + */ +var InOut = function (v, amplitude, period) +{ + if (amplitude === undefined) { amplitude = 0.1; } + if (period === undefined) { period = 0.1; } + + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + var s = period / 4; + + if (amplitude < 1) + { + amplitude = 1; + } + else + { + s = period * Math.asin(1 / amplitude) / (2 * Math.PI); + } + + if ((v *= 2) < 1) + { + return -0.5 * (amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period)); + } + else + { + return amplitude * Math.pow(2, -10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period) * 0.5 + 1; + } + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 8119: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Elastic ease-out. + * + * @function Phaser.Math.Easing.Elastic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. + * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. + * + * @return {number} The tweened value. + */ +var Out = function (v, amplitude, period) +{ + if (amplitude === undefined) { amplitude = 0.1; } + if (period === undefined) { period = 0.1; } + + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + var s = period / 4; + + if (amplitude < 1) + { + amplitude = 1; + } + else + { + s = period * Math.asin(1 / amplitude) / (2 * Math.PI); + } + + return (amplitude * Math.pow(2, -10 * v) * Math.sin((v - s) * (2 * Math.PI) / period) + 1); + } +}; + +module.exports = Out; + + +/***/ }), + +/***/ 2884: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Elastic + */ + +module.exports = { + + In: __webpack_require__(7619), + Out: __webpack_require__(8119), + InOut: __webpack_require__(7437) + +}; + + +/***/ }), + +/***/ 5456: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Exponential ease-in. + * + * @function Phaser.Math.Easing.Expo.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return Math.pow(2, 10 * (v - 1)) - 0.001; +}; + +module.exports = In; + + +/***/ }), + +/***/ 3461: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Exponential ease-in/out. + * + * @function Phaser.Math.Easing.Expo.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * Math.pow(2, 10 * (v - 1)); + } + else + { + return 0.5 * (2 - Math.pow(2, -10 * (v - 1))); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 2711: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Exponential ease-out. + * + * @function Phaser.Math.Easing.Expo.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return 1 - Math.pow(2, -10 * v); +}; + +module.exports = Out; + + +/***/ }), + +/***/ 6287: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Expo + */ + +module.exports = { + + In: __webpack_require__(5456), + Out: __webpack_require__(2711), + InOut: __webpack_require__(3461) + +}; + + +/***/ }), + +/***/ 8613: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing + */ + +module.exports = { + + Back: __webpack_require__(4938), + Bounce: __webpack_require__(8872), + Circular: __webpack_require__(5006), + Cubic: __webpack_require__(875), + Elastic: __webpack_require__(2884), + Expo: __webpack_require__(6287), + Linear: __webpack_require__(4233), + Quadratic: __webpack_require__(6341), + Quartic: __webpack_require__(762), + Quintic: __webpack_require__(345), + Sine: __webpack_require__(8698), + Stepped: __webpack_require__(7051) + +}; + + +/***/ }), + +/***/ 744: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Linear easing (no variation). + * + * @function Phaser.Math.Easing.Linear + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Linear = function (v) +{ + return v; +}; + +module.exports = Linear; + + +/***/ }), + +/***/ 4233: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +module.exports = __webpack_require__(744); + + +/***/ }), + +/***/ 9810: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quadratic ease-in. + * + * @function Phaser.Math.Easing.Quadratic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v; +}; + +module.exports = In; + + +/***/ }), + +/***/ 8163: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quadratic ease-in/out. + * + * @function Phaser.Math.Easing.Quadratic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v; + } + else + { + return -0.5 * (--v * (v - 2) - 1); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 6123: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quadratic ease-out. + * + * @function Phaser.Math.Easing.Quadratic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return v * (2 - v); +}; + +module.exports = Out; + + +/***/ }), + +/***/ 6341: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quadratic + */ + +module.exports = { + + In: __webpack_require__(9810), + Out: __webpack_require__(6123), + InOut: __webpack_require__(8163) + +}; + + +/***/ }), + +/***/ 7337: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quartic ease-in. + * + * @function Phaser.Math.Easing.Quartic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v * v * v; +}; + +module.exports = In; + + +/***/ }), + +/***/ 4878: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quartic ease-in/out. + * + * @function Phaser.Math.Easing.Quartic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v * v * v; + } + else + { + return -0.5 * ((v -= 2) * v * v * v - 2); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 9012: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quartic ease-out. + * + * @function Phaser.Math.Easing.Quartic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return 1 - (--v * v * v * v); +}; + +module.exports = Out; + + +/***/ }), + +/***/ 762: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quartic + */ + +module.exports = { + + In: __webpack_require__(7337), + Out: __webpack_require__(9012), + InOut: __webpack_require__(4878) + +}; + + +/***/ }), + +/***/ 303: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quintic ease-in. + * + * @function Phaser.Math.Easing.Quintic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v * v * v * v; +}; + +module.exports = In; + + +/***/ }), + +/***/ 553: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quintic ease-in/out. + * + * @function Phaser.Math.Easing.Quintic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v * v * v * v; + } + else + { + return 0.5 * ((v -= 2) * v * v * v * v + 2); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 1632: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quintic ease-out. + * + * @function Phaser.Math.Easing.Quintic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return --v * v * v * v * v + 1; +}; + +module.exports = Out; + + +/***/ }), + +/***/ 345: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quintic + */ + +module.exports = { + + In: __webpack_require__(303), + Out: __webpack_require__(1632), + InOut: __webpack_require__(553) + +}; + + +/***/ }), + +/***/ 8455: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sinusoidal ease-in. + * + * @function Phaser.Math.Easing.Sine.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + return 1 - Math.cos(v * Math.PI / 2); + } +}; + +module.exports = In; + + +/***/ }), + +/***/ 1844: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sinusoidal ease-in/out. + * + * @function Phaser.Math.Easing.Sine.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + return 0.5 * (1 - Math.cos(Math.PI * v)); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 990: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sinusoidal ease-out. + * + * @function Phaser.Math.Easing.Sine.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + return Math.sin(v * Math.PI / 2); + } +}; + +module.exports = Out; + + +/***/ }), + +/***/ 8698: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Sine + */ + +module.exports = { + + In: __webpack_require__(8455), + Out: __webpack_require__(990), + InOut: __webpack_require__(1844) + +}; + + +/***/ }), + +/***/ 6745: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Stepped easing. + * + * @function Phaser.Math.Easing.Stepped + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [steps=1] - The number of steps in the ease. + * + * @return {number} The tweened value. + */ +var Stepped = function (v, steps) +{ + if (steps === undefined) { steps = 1; } + + if (v <= 0) + { + return 0; + } + else if (v >= 1) + { + return 1; + } + else + { + return (((steps * v) | 0) + 1) * (1 / steps); + } +}; + +module.exports = Stepped; + + +/***/ }), + +/***/ 7051: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Stepped + */ + +module.exports = __webpack_require__(6745); + + +/***/ }), + +/***/ 3158: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the fuzzy ceiling of the given value. + * + * @function Phaser.Math.Fuzzy.Ceil + * @since 3.0.0 + * + * @param {number} value - The value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {number} The fuzzy ceiling of the value. + */ +var Ceil = function (value, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return Math.ceil(value - epsilon); +}; + +module.exports = Ceil; + + +/***/ }), + +/***/ 12: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check whether the given values are fuzzily equal. + * + * Two numbers are fuzzily equal if their difference is less than `epsilon`. + * + * @function Phaser.Math.Fuzzy.Equal + * @since 3.0.0 + * + * @param {number} a - The first value. + * @param {number} b - The second value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`. + */ +var Equal = function (a, b, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return Math.abs(a - b) < epsilon; +}; + +module.exports = Equal; + + +/***/ }), + +/***/ 1326: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the fuzzy floor of the given value. + * + * @function Phaser.Math.Fuzzy.Floor + * @since 3.0.0 + * + * @param {number} value - The value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {number} The floor of the value. + */ +var Floor = function (value, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return Math.floor(value + epsilon); +}; + +module.exports = Floor; + + +/***/ }), + +/***/ 7373: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check whether `a` is fuzzily greater than `b`. + * + * `a` is fuzzily greater than `b` if it is more than `b - epsilon`. + * + * @function Phaser.Math.Fuzzy.GreaterThan + * @since 3.0.0 + * + * @param {number} a - The first value. + * @param {number} b - The second value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {boolean} `true` if `a` is fuzzily greater than than `b`, otherwise `false`. + */ +var GreaterThan = function (a, b, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return a > b - epsilon; +}; + +module.exports = GreaterThan; + + +/***/ }), + +/***/ 2622: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check whether `a` is fuzzily less than `b`. + * + * `a` is fuzzily less than `b` if it is less than `b + epsilon`. + * + * @function Phaser.Math.Fuzzy.LessThan + * @since 3.0.0 + * + * @param {number} a - The first value. + * @param {number} b - The second value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {boolean} `true` if `a` is fuzzily less than `b`, otherwise `false`. + */ +var LessThan = function (a, b, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return a < b + epsilon; +}; + +module.exports = LessThan; + + +/***/ }), + +/***/ 7927: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Fuzzy + */ + +module.exports = { + + Ceil: __webpack_require__(3158), + Equal: __webpack_require__(12), + Floor: __webpack_require__(1326), + GreaterThan: __webpack_require__(7373), + LessThan: __webpack_require__(2622) + +}; + + +/***/ }), + +/***/ 4675: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(7425); +var Extend = __webpack_require__(1030); + +/** + * @namespace Phaser.Math + */ + +var PhaserMath = { + + // Collections of functions + Angle: __webpack_require__(1833), + Distance: __webpack_require__(6338), + Easing: __webpack_require__(8613), + Fuzzy: __webpack_require__(7927), + Interpolation: __webpack_require__(2140), + Pow2: __webpack_require__(7897), + Snap: __webpack_require__(3943), + + // Expose the RNG Class + RandomDataGenerator: __webpack_require__(6957), + + // Single functions + Average: __webpack_require__(3136), + Bernstein: __webpack_require__(785), + Between: __webpack_require__(7025), + CatmullRom: __webpack_require__(48), + CeilTo: __webpack_require__(5035), + Clamp: __webpack_require__(2915), + DegToRad: __webpack_require__(7149), + Difference: __webpack_require__(2975), + Euler: __webpack_require__(2107), + Factorial: __webpack_require__(3916), + FloatBetween: __webpack_require__(104), + FloorTo: __webpack_require__(4941), + FromPercent: __webpack_require__(1555), + GetSpeed: __webpack_require__(5005), + IsEven: __webpack_require__(3702), + IsEvenStrict: __webpack_require__(8820), + Linear: __webpack_require__(1743), + LinearXY: __webpack_require__(3416), + MaxAdd: __webpack_require__(3733), + Median: __webpack_require__(44), + MinSub: __webpack_require__(5385), + Percent: __webpack_require__(8585), + RadToDeg: __webpack_require__(4208), + RandomXY: __webpack_require__(1705), + RandomXYZ: __webpack_require__(6650), + RandomXYZW: __webpack_require__(2037), + Rotate: __webpack_require__(6283), + RotateAround: __webpack_require__(9876), + RotateAroundDistance: __webpack_require__(8348), + RotateTo: __webpack_require__(4497), + RoundAwayFromZero: __webpack_require__(4078), + RoundTo: __webpack_require__(855), + SinCosTableGenerator: __webpack_require__(4936), + SmootherStep: __webpack_require__(278), + SmoothStep: __webpack_require__(2733), + ToXY: __webpack_require__(163), + TransformXY: __webpack_require__(7556), + Within: __webpack_require__(4119), + Wrap: __webpack_require__(8445), + + // Vector classes + Vector2: __webpack_require__(2529), + Vector3: __webpack_require__(5689), + Vector4: __webpack_require__(9279), + Matrix3: __webpack_require__(2149), + Matrix4: __webpack_require__(9652), + Quaternion: __webpack_require__(372), + RotateVec3: __webpack_require__(9640) + +}; + +// Merge in the consts + +PhaserMath = Extend(false, PhaserMath, CONST); + +// Export it + +module.exports = PhaserMath; + + +/***/ }), + +/***/ 1640: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bernstein = __webpack_require__(785); + +/** + * A bezier interpolation method. + * + * @function Phaser.Math.Interpolation.Bezier + * @since 3.0.0 + * + * @param {number[]} v - The input array of values to interpolate between. + * @param {number} k - The percentage of interpolation, between 0 and 1. + * + * @return {number} The interpolated value. + */ +var BezierInterpolation = function (v, k) +{ + var b = 0; + var n = v.length - 1; + + for (var i = 0; i <= n; i++) + { + b += Math.pow(1 - k, n - i) * Math.pow(k, i) * v[i] * Bernstein(n, i); + } + + return b; +}; + +module.exports = BezierInterpolation; + + +/***/ }), + +/***/ 6105: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CatmullRom = __webpack_require__(48); + +/** + * A Catmull-Rom interpolation method. + * + * @function Phaser.Math.Interpolation.CatmullRom + * @since 3.0.0 + * + * @param {number[]} v - The input array of values to interpolate between. + * @param {number} k - The percentage of interpolation, between 0 and 1. + * + * @return {number} The interpolated value. + */ +var CatmullRomInterpolation = function (v, k) +{ + var m = v.length - 1; + var f = m * k; + var i = Math.floor(f); + + if (v[0] === v[m]) + { + if (k < 0) + { + i = Math.floor(f = m * (1 + k)); + } + + return CatmullRom(f - i, v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m]); + } + else + { + if (k < 0) + { + return v[0] - (CatmullRom(-f, v[0], v[0], v[1], v[1]) - v[0]); + } + + if (k > 1) + { + return v[m] - (CatmullRom(f - m, v[m], v[m], v[m - 1], v[m - 1]) - v[m]); + } + + return CatmullRom(f - i, v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2]); + } +}; + +module.exports = CatmullRomInterpolation; + + +/***/ }), + +/***/ 4002: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @ignore + */ +function P0 (t, p) +{ + var k = 1 - t; + + return k * k * k * p; +} + +/** + * @ignore + */ +function P1 (t, p) +{ + var k = 1 - t; + + return 3 * k * k * t * p; +} + +/** + * @ignore + */ +function P2 (t, p) +{ + return 3 * (1 - t) * t * t * p; +} + +/** + * @ignore + */ +function P3 (t, p) +{ + return t * t * t * p; +} + +/** + * A cubic bezier interpolation method. + * + * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a + * + * @function Phaser.Math.Interpolation.CubicBezier + * @since 3.0.0 + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} p0 - The start point. + * @param {number} p1 - The first control point. + * @param {number} p2 - The second control point. + * @param {number} p3 - The end point. + * + * @return {number} The interpolated value. + */ +var CubicBezierInterpolation = function (t, p0, p1, p2, p3) +{ + return P0(t, p0) + P1(t, p1) + P2(t, p2) + P3(t, p3); +}; + +module.exports = CubicBezierInterpolation; + + +/***/ }), + +/***/ 6765: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Linear = __webpack_require__(1743); + +/** + * A linear interpolation method. + * + * @function Phaser.Math.Interpolation.Linear + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Linear_interpolation} + * + * @param {number[]} v - The input array of values to interpolate between. + * @param {!number} k - The percentage of interpolation, between 0 and 1. + * + * @return {!number} The interpolated value. + */ +var LinearInterpolation = function (v, k) +{ + var m = v.length - 1; + var f = m * k; + var i = Math.floor(f); + + if (k < 0) + { + return Linear(v[0], v[1], f); + } + else if (k > 1) + { + return Linear(v[m], v[m - 1], m - f); + } + else + { + return Linear(v[i], v[(i + 1 > m) ? m : i + 1], f - i); + } +}; + +module.exports = LinearInterpolation; + + +/***/ }), + +/***/ 6388: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @ignore + */ +function P0 (t, p) +{ + var k = 1 - t; + + return k * k * p; +} + +/** + * @ignore + */ +function P1 (t, p) +{ + return 2 * (1 - t) * t * p; +} + +/** + * @ignore + */ +function P2 (t, p) +{ + return t * t * p; +} + +// https://github.com/mrdoob/three.js/blob/master/src/extras/core/Interpolations.js + +/** + * A quadratic bezier interpolation method. + * + * @function Phaser.Math.Interpolation.QuadraticBezier + * @since 3.2.0 + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} p0 - The start point. + * @param {number} p1 - The control point. + * @param {number} p2 - The end point. + * + * @return {number} The interpolated value. + */ +var QuadraticBezierInterpolation = function (t, p0, p1, p2) +{ + return P0(t, p0) + P1(t, p1) + P2(t, p2); +}; + +module.exports = QuadraticBezierInterpolation; + + +/***/ }), + +/***/ 5735: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmoothStep = __webpack_require__(2733); + +/** + * A Smooth Step interpolation method. + * + * @function Phaser.Math.Interpolation.SmoothStep + * @since 3.9.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep} + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The interpolated value. + */ +var SmoothStepInterpolation = function (t, min, max) +{ + return min + (max - min) * SmoothStep(t, 0, 1); +}; + +module.exports = SmoothStepInterpolation; + + +/***/ }), + +/***/ 8705: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmootherStep = __webpack_require__(278); + +/** + * A Smoother Step interpolation method. + * + * @function Phaser.Math.Interpolation.SmootherStep + * @since 3.9.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The interpolated value. + */ +var SmootherStepInterpolation = function (t, min, max) +{ + return min + (max - min) * SmootherStep(t, 0, 1); +}; + +module.exports = SmootherStepInterpolation; + + +/***/ }), + +/***/ 2140: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Interpolation + */ + +module.exports = { + + Bezier: __webpack_require__(1640), + CatmullRom: __webpack_require__(6105), + CubicBezier: __webpack_require__(4002), + Linear: __webpack_require__(6765), + QuadraticBezier: __webpack_require__(6388), + SmoothStep: __webpack_require__(5735), + SmootherStep: __webpack_require__(8705) + +}; + + +/***/ }), + +/***/ 5443: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns the nearest power of 2 to the given `value`. + * + * @function Phaser.Math.Pow2.GetNext + * @since 3.0.0 + * + * @param {number} value - The value. + * + * @return {number} The nearest power of 2 to `value`. + */ +var GetPowerOfTwo = function (value) +{ + var index = Math.log(value) / 0.6931471805599453; + + return (1 << Math.ceil(index)); +}; + +module.exports = GetPowerOfTwo; + + +/***/ }), + +/***/ 725: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if the given `width` and `height` are a power of two. + * Useful for checking texture dimensions. + * + * @function Phaser.Math.Pow2.IsSize + * @since 3.0.0 + * + * @param {number} width - The width. + * @param {number} height - The height. + * + * @return {boolean} `true` if `width` and `height` are a power of two, otherwise `false`. + */ +var IsSizePowerOfTwo = function (width, height) +{ + return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0); +}; + +module.exports = IsSizePowerOfTwo; + + +/***/ }), + +/***/ 167: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Tests the value and returns `true` if it is a power of two. + * + * @function Phaser.Math.Pow2.IsValue + * @since 3.0.0 + * + * @param {number} value - The value to check if it's a power of two. + * + * @return {boolean} Returns `true` if `value` is a power of two, otherwise `false`. + */ +var IsValuePowerOfTwo = function (value) +{ + return (value > 0 && (value & (value - 1)) === 0); +}; + +module.exports = IsValuePowerOfTwo; + + +/***/ }), + +/***/ 7897: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Pow2 + */ + +module.exports = { + + GetNext: __webpack_require__(5443), + IsSize: __webpack_require__(725), + IsValue: __webpack_require__(167) + +}; + + +/***/ }), + +/***/ 6957: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A seeded Random Data Generator. + * + * Access via `Phaser.Math.RND` which is an instance of this class pre-defined + * by Phaser. Or, create your own instance to use as you require. + * + * The `Math.RND` generator is seeded by the Game Config property value `seed`. + * If no such config property exists, a random number is used. + * + * If you create your own instance of this class you should provide a seed for it. + * If no seed is given it will use a 'random' one based on Date.now. + * + * @class RandomDataGenerator + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {(string|string[])} [seeds] - The seeds to use for the random number generator. + */ +var RandomDataGenerator = new Class({ + + initialize: + + function RandomDataGenerator (seeds) + { + if (seeds === undefined) { seeds = [ (Date.now() * Math.random()).toString() ]; } + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#c + * @type {number} + * @default 1 + * @private + * @since 3.0.0 + */ + this.c = 1; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#s0 + * @type {number} + * @default 0 + * @private + * @since 3.0.0 + */ + this.s0 = 0; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#s1 + * @type {number} + * @default 0 + * @private + * @since 3.0.0 + */ + this.s1 = 0; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#s2 + * @type {number} + * @default 0 + * @private + * @since 3.0.0 + */ + this.s2 = 0; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#n + * @type {number} + * @default 0 + * @private + * @since 3.2.0 + */ + this.n = 0; + + /** + * Signs to choose from. + * + * @name Phaser.Math.RandomDataGenerator#signs + * @type {number[]} + * @since 3.0.0 + */ + this.signs = [ -1, 1 ]; + + if (seeds) + { + this.init(seeds); + } + }, + + /** + * Private random helper. + * + * @method Phaser.Math.RandomDataGenerator#rnd + * @since 3.0.0 + * @private + * + * @return {number} A random number. + */ + rnd: function () + { + var t = 2091639 * this.s0 + this.c * 2.3283064365386963e-10; // 2^-32 + + this.c = t | 0; + this.s0 = this.s1; + this.s1 = this.s2; + this.s2 = t - this.c; + + return this.s2; + }, + + /** + * Internal method that creates a seed hash. + * + * @method Phaser.Math.RandomDataGenerator#hash + * @since 3.0.0 + * @private + * + * @param {string} data - The value to hash. + * + * @return {number} The hashed value. + */ + hash: function (data) + { + var h; + var n = this.n; + + data = data.toString(); + + for (var i = 0; i < data.length; i++) + { + n += data.charCodeAt(i); + h = 0.02519603282416938 * n; + n = h >>> 0; + h -= n; + h *= n; + n = h >>> 0; + h -= n; + n += h * 0x100000000;// 2^32 + } + + this.n = n; + + return (n >>> 0) * 2.3283064365386963e-10;// 2^-32 + }, + + /** + * Initialize the state of the random data generator. + * + * @method Phaser.Math.RandomDataGenerator#init + * @since 3.0.0 + * + * @param {(string|string[])} seeds - The seeds to initialize the random data generator with. + */ + init: function (seeds) + { + if (typeof seeds === 'string') + { + this.state(seeds); + } + else + { + this.sow(seeds); + } + }, + + /** + * Reset the seed of the random data generator. + * + * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present. + * + * @method Phaser.Math.RandomDataGenerator#sow + * @since 3.0.0 + * + * @param {string[]} seeds - The array of seeds: the `toString()` of each value is used. + */ + sow: function (seeds) + { + // Always reset to default seed + this.n = 0xefc8249d; + this.s0 = this.hash(' '); + this.s1 = this.hash(' '); + this.s2 = this.hash(' '); + this.c = 1; + + if (!seeds) + { + return; + } + + // Apply any seeds + for (var i = 0; i < seeds.length && (seeds[i] != null); i++) + { + var seed = seeds[i]; + + this.s0 -= this.hash(seed); + this.s0 += ~~(this.s0 < 0); + this.s1 -= this.hash(seed); + this.s1 += ~~(this.s1 < 0); + this.s2 -= this.hash(seed); + this.s2 += ~~(this.s2 < 0); + } + }, + + /** + * Returns a random integer between 0 and 2^32. + * + * @method Phaser.Math.RandomDataGenerator#integer + * @since 3.0.0 + * + * @return {number} A random integer between 0 and 2^32. + */ + integer: function () + { + // 2^32 + return this.rnd() * 0x100000000; + }, + + /** + * Returns a random real number between 0 and 1. + * + * @method Phaser.Math.RandomDataGenerator#frac + * @since 3.0.0 + * + * @return {number} A random real number between 0 and 1. + */ + frac: function () + { + // 2^-53 + return this.rnd() + (this.rnd() * 0x200000 | 0) * 1.1102230246251565e-16; + }, + + /** + * Returns a random real number between 0 and 2^32. + * + * @method Phaser.Math.RandomDataGenerator#real + * @since 3.0.0 + * + * @return {number} A random real number between 0 and 2^32. + */ + real: function () + { + return this.integer() + this.frac(); + }, + + /** + * Returns a random integer between and including min and max. + * + * @method Phaser.Math.RandomDataGenerator#integerInRange + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random number between min and max. + */ + integerInRange: function (min, max) + { + return Math.floor(this.realInRange(0, max - min + 1) + min); + }, + + /** + * Returns a random integer between and including min and max. + * This method is an alias for RandomDataGenerator.integerInRange. + * + * @method Phaser.Math.RandomDataGenerator#between + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random number between min and max. + */ + between: function (min, max) + { + return Math.floor(this.realInRange(0, max - min + 1) + min); + }, + + /** + * Returns a random real number between min and max. + * + * @method Phaser.Math.RandomDataGenerator#realInRange + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random number between min and max. + */ + realInRange: function (min, max) + { + return this.frac() * (max - min) + min; + }, + + /** + * Returns a random real number between -1 and 1. + * + * @method Phaser.Math.RandomDataGenerator#normal + * @since 3.0.0 + * + * @return {number} A random real number between -1 and 1. + */ + normal: function () + { + return 1 - (2 * this.frac()); + }, + + /** + * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368 + * + * @method Phaser.Math.RandomDataGenerator#uuid + * @since 3.0.0 + * + * @return {string} A valid RFC4122 version4 ID hex string + */ + uuid: function () + { + var a = ''; + var b = ''; + + for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-') + { + // eslint-disable-next-line no-empty + } + + return b; + }, + + /** + * Returns a random element from within the given array. + * + * @method Phaser.Math.RandomDataGenerator#pick + * @since 3.0.0 + * + * @generic T + * @genericUse {T[]} - [array] + * @genericUse {T} - [$return] + * + * @param {T[]} array - The array to pick a random element from. + * + * @return {T} A random member of the array. + */ + pick: function (array) + { + return array[this.integerInRange(0, array.length - 1)]; + }, + + /** + * Returns a sign to be used with multiplication operator. + * + * @method Phaser.Math.RandomDataGenerator#sign + * @since 3.0.0 + * + * @return {number} -1 or +1. + */ + sign: function () + { + return this.pick(this.signs); + }, + + /** + * Returns a random element from within the given array, favoring the earlier entries. + * + * @method Phaser.Math.RandomDataGenerator#weightedPick + * @since 3.0.0 + * + * @generic T + * @genericUse {T[]} - [array] + * @genericUse {T} - [$return] + * + * @param {T[]} array - The array to pick a random element from. + * + * @return {T} A random member of the array. + */ + weightedPick: function (array) + { + return array[~~(Math.pow(this.frac(), 2) * (array.length - 1) + 0.5)]; + }, + + /** + * Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified. + * + * @method Phaser.Math.RandomDataGenerator#timestamp + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random timestamp between min and max. + */ + timestamp: function (min, max) + { + return this.realInRange(min || 946684800000, max || 1577862000000); + }, + + /** + * Returns a random angle between -180 and 180. + * + * @method Phaser.Math.RandomDataGenerator#angle + * @since 3.0.0 + * + * @return {number} A random number between -180 and 180. + */ + angle: function () + { + return this.integerInRange(-180, 180); + }, + + /** + * Returns a random rotation in radians, between -3.141 and 3.141 + * + * @method Phaser.Math.RandomDataGenerator#rotation + * @since 3.0.0 + * + * @return {number} A random number between -3.141 and 3.141 + */ + rotation: function () + { + return this.realInRange(-3.1415926, 3.1415926); + }, + + /** + * Gets or Sets the state of the generator. This allows you to retain the values + * that the generator is using between games, i.e. in a game save file. + * + * To seed this generator with a previously saved state you can pass it as the + * `seed` value in your game config, or call this method directly after Phaser has booted. + * + * Call this method with no parameters to return the current state. + * + * If providing a state it should match the same format that this method + * returns, which is a string with a header `!rnd` followed by the `c`, + * `s0`, `s1` and `s2` values respectively, each comma-delimited. + * + * @method Phaser.Math.RandomDataGenerator#state + * @since 3.0.0 + * + * @param {string} [state] - Generator state to be set. + * + * @return {string} The current state of the generator. + */ + state: function (state) + { + if (typeof state === 'string' && state.match(/^!rnd/)) + { + state = state.split(','); + + this.c = parseFloat(state[1]); + this.s0 = parseFloat(state[2]); + this.s1 = parseFloat(state[3]); + this.s2 = parseFloat(state[4]); + } + + return [ '!rnd', this.c, this.s0, this.s1, this.s2 ].join(','); + }, + + /** + * Shuffles the given array, using the current seed. + * + * @method Phaser.Math.RandomDataGenerator#shuffle + * @since 3.7.0 + * + * @generic T + * @genericUse {T[]} - [array,$return] + * + * @param {T[]} [array] - The array to be shuffled. + * + * @return {T[]} The shuffled array. + */ + shuffle: function (array) + { + var len = array.length - 1; + + for (var i = len; i > 0; i--) + { + var randomIndex = Math.floor(this.frac() * (i + 1)); + var itemAtIndex = array[randomIndex]; + + array[randomIndex] = array[i]; + array[i] = itemAtIndex; + } + + return array; + } + +}); + +module.exports = RandomDataGenerator; + + +/***/ }), + +/***/ 5659: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using ceil. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`. + * As will `14` snap to `15`... but `16` will snap to `20`. + * + * @function Phaser.Math.Snap.Ceil + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapCeil = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.ceil(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapCeil; + + +/***/ }), + +/***/ 5461: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using floor. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`. + * As will `14` snap to `10`... but `16` will snap to `15`. + * + * @function Phaser.Math.Snap.Floor + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapFloor = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.floor(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapFloor; + + +/***/ }), + +/***/ 5131: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using rounding. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10` whereas `14` will snap to `15`. + * + * @function Phaser.Math.Snap.To + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapTo = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.round(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapTo; + + +/***/ }), + +/***/ 3943: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Snap + */ + +module.exports = { + + Ceil: __webpack_require__(5659), + Floor: __webpack_require__(5461), + To: __webpack_require__(5131) + +}; + + +/***/ }), + +/***/ 8666: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** +* @author Richard Davey +* @copyright 2013-2023 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A Global Plugin is installed just once into the Game owned Plugin Manager. + * It can listen for Game events and respond to them. + * + * @class BasePlugin + * @memberof Phaser.Plugins + * @constructor + * @since 3.8.0 + * + * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager. + */ +var BasePlugin = new Class({ + + initialize: + + function BasePlugin (pluginManager) + { + /** + * A handy reference to the Plugin Manager that is responsible for this plugin. + * Can be used as a route to gain access to game systems and events. + * + * @name Phaser.Plugins.BasePlugin#pluginManager + * @type {Phaser.Plugins.PluginManager} + * @protected + * @since 3.8.0 + */ + this.pluginManager = pluginManager; + + /** + * A reference to the Game instance this plugin is running under. + * + * @name Phaser.Plugins.BasePlugin#game + * @type {Phaser.Game} + * @protected + * @since 3.8.0 + */ + this.game = pluginManager.game; + }, + + /** + * The PluginManager calls this method on a Global Plugin when the plugin is first instantiated. + * It will never be called again on this instance. + * In here you can set-up whatever you need for this plugin to run. + * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this. + * On a Scene Plugin, this method is never called. Use {@link Phaser.Plugins.ScenePlugin#boot} instead. + * + * @method Phaser.Plugins.BasePlugin#init + * @since 3.8.0 + * + * @param {?any} [data] - A value specified by the user, if any, from the `data` property of the plugin's configuration object (if started at game boot) or passed in the PluginManager's `install` method (if started manually). + */ + init: function () + { + }, + + /** + * The PluginManager calls this method on a Global Plugin when the plugin is started. + * If a plugin is stopped, and then started again, this will get called again. + * Typically called immediately after `BasePlugin.init`. + * On a Scene Plugin, this method is never called. + * + * @method Phaser.Plugins.BasePlugin#start + * @since 3.8.0 + */ + start: function () + { + // Here are the game-level events you can listen to. + // At the very least you should offer a destroy handler for when the game closes down. + + // var eventEmitter = this.game.events; + + // eventEmitter.once('destroy', this.gameDestroy, this); + // eventEmitter.on('pause', this.gamePause, this); + // eventEmitter.on('resume', this.gameResume, this); + // eventEmitter.on('resize', this.gameResize, this); + // eventEmitter.on('prestep', this.gamePreStep, this); + // eventEmitter.on('step', this.gameStep, this); + // eventEmitter.on('poststep', this.gamePostStep, this); + // eventEmitter.on('prerender', this.gamePreRender, this); + // eventEmitter.on('postrender', this.gamePostRender, this); + }, + + /** + * The PluginManager calls this method on a Global Plugin when the plugin is stopped. + * The game code has requested that your plugin stop doing whatever it does. + * It is now considered as 'inactive' by the PluginManager. + * Handle that process here (i.e. stop listening for events, etc) + * If the plugin is started again then `BasePlugin.start` will be called again. + * On a Scene Plugin, this method is never called. + * + * @method Phaser.Plugins.BasePlugin#stop + * @since 3.8.0 + */ + stop: function () + { + }, + + /** + * Game instance has been destroyed. + * You must release everything in here, all references, all objects, free it all up. + * + * @method Phaser.Plugins.BasePlugin#destroy + * @since 3.8.0 + */ + destroy: function () + { + this.pluginManager = null; + this.game = null; + this.scene = null; + this.systems = null; + } + +}); + +module.exports = BasePlugin; + + +/***/ }), + +/***/ 8456: +/***/ ((module) => { /** * @author Richard Davey @@ -44727,328 +45306,152 @@ module.exports = PluginCache; /***/ }), -/* 328 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 5722: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ +* @author Richard Davey +* @copyright 2013-2023 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ -var Class = __webpack_require__(0); +var BasePlugin = __webpack_require__(8666); +var Class = __webpack_require__(7473); +var SceneEvents = __webpack_require__(204); /** * @classdesc - * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect - * a visible pixel from the geometry mask. The mask is essentially a clipping path which can only - * make a masked pixel fully visible or fully invisible without changing its alpha (opacity). + * A Scene Level Plugin is installed into every Scene and belongs to that Scene. + * It can listen for Scene events and respond to them. + * It can map itself to a Scene property, or into the Scene Systems, or both. * - * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) - * should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed - * if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and - * alpha of the pixel from the Geometry Mask do not matter. - * - * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. - * Moving or transforming the underlying Graphics object will change the mask (and affect the visibility - * of any masked objects), whereas moving or transforming a masked object will not affect the mask. - * You can think of the Geometry Mask (or rather, of its Graphics object) as an invisible curtain placed - * in front of all masked objects which has its own visual properties and, naturally, respects the camera's - * visual properties, but isn't affected by and doesn't follow the masked objects by itself. - * - * @class GeometryMask - * @memberof Phaser.Display.Masks + * @class ScenePlugin + * @memberof Phaser.Plugins + * @extends Phaser.Plugins.BasePlugin * @constructor - * @since 3.0.0 + * @since 3.8.0 * - * @param {Phaser.Scene} scene - This parameter is not used. - * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List. + * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin. + * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager. + * @param {string} pluginKey - The key under which this plugin has been installed into the Scene Systems. */ -var GeometryMask = new Class({ +var ScenePlugin = new Class({ + + Extends: BasePlugin, initialize: - function GeometryMask (scene, graphicsGeometry) + function ScenePlugin (scene, pluginManager, pluginKey) { - /** - * The Graphics object which describes the Geometry Mask. - * - * @name Phaser.Display.Masks.GeometryMask#geometryMask - * @type {Phaser.GameObjects.Graphics} - * @since 3.0.0 - */ - this.geometryMask = graphicsGeometry; + BasePlugin.call(this, pluginManager); /** - * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels - * drawn to the Geometry Mask. + * A reference to the Scene that has installed this plugin. + * Only set if it's a Scene Plugin, otherwise `null`. + * This property is only set when the plugin is instantiated and added to the Scene, not before. + * You can use it during the `boot` method. * - * This is a WebGL only feature. - * - * @name Phaser.Display.Masks.GeometryMask#invertAlpha - * @type {boolean} - * @since 3.16.0 + * @name Phaser.Plugins.ScenePlugin#scene + * @type {?Phaser.Scene} + * @protected + * @since 3.8.0 */ - this.invertAlpha = false; + this.scene = scene; /** - * Is this mask a stencil mask? + * A reference to the Scene Systems of the Scene that has installed this plugin. + * Only set if it's a Scene Plugin, otherwise `null`. + * This property is only set when the plugin is instantiated and added to the Scene, not before. + * You can use it during the `boot` method. * - * @name Phaser.Display.Masks.GeometryMask#isStencil - * @type {boolean} + * @name Phaser.Plugins.ScenePlugin#systems + * @type {?Phaser.Scenes.Systems} + * @protected + * @since 3.8.0 + */ + this.systems = scene.sys; + + /** + * The key under which this plugin was installed into the Scene Systems. + * + * This property is only set when the plugin is instantiated and added to the Scene, not before. + * You can use it during the `boot` method. + * + * @name Phaser.Plugins.ScenePlugin#pluginKey + * @type {string} * @readonly - * @since 3.17.0 + * @since 3.54.0 */ - this.isStencil = true; + this.pluginKey = pluginKey; - /** - * The current stencil level. - * - * @name Phaser.Display.Masks.GeometryMask#level - * @type {boolean} - * @private - * @since 3.17.0 - */ - this.level = 0; + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); }, /** - * Sets a new Graphics object for the Geometry Mask. + * This method is called when the Scene boots. It is only ever called once. * - * @method Phaser.Display.Masks.GeometryMask#setShape - * @since 3.0.0 + * By this point the plugin properties `scene` and `systems` will have already been set. * - * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. + * In here you can listen for {@link Phaser.Scenes.Events Scene events} and set-up whatever you need for this plugin to run. + * Here are the Scene events you can listen to: * - * @return {this} This Geometry Mask + * - start + * - ready + * - preupdate + * - update + * - postupdate + * - resize + * - pause + * - resume + * - sleep + * - wake + * - transitioninit + * - transitionstart + * - transitioncomplete + * - transitionout + * - shutdown + * - destroy + * + * At the very least you should offer a destroy handler for when the Scene closes down, i.e: + * + * ```javascript + * var eventEmitter = this.systems.events; + * eventEmitter.once('destroy', this.sceneDestroy, this); + * ``` + * + * @method Phaser.Plugins.ScenePlugin#boot + * @since 3.8.0 */ - setShape: function (graphicsGeometry) + boot: function () { - this.geometryMask = graphicsGeometry; - - return this; }, /** - * Sets the `invertAlpha` property of this Geometry Mask. + * Game instance has been destroyed. * - * Inverting the alpha essentially flips the way the mask works. + * You must release everything in here, all references, all objects, free it all up. * - * This is a WebGL only feature. - * - * @method Phaser.Display.Masks.GeometryMask#setInvertAlpha - * @since 3.17.0 - * - * @param {boolean} [value=true] - Invert the alpha of this mask? - * - * @return {this} This Geometry Mask - */ - setInvertAlpha: function (value) - { - if (value === undefined) { value = true; } - - this.invertAlpha = value; - - return this; - }, - - /** - * Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask. - * - * @method Phaser.Display.Masks.GeometryMask#preRenderWebGL - * @since 3.0.0 - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. - * @param {Phaser.GameObjects.GameObject} child - The Game Object being rendered. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. - */ - preRenderWebGL: function (renderer, child, camera) - { - var gl = renderer.gl; - - // Force flushing before drawing to stencil buffer - renderer.flush(); - - if (renderer.maskStack.length === 0) - { - gl.enable(gl.STENCIL_TEST); - gl.clear(gl.STENCIL_BUFFER_BIT); - - renderer.maskCount = 0; - } - - if (renderer.currentCameraMask.mask !== this) - { - renderer.currentMask.mask = this; - } - - renderer.maskStack.push({ mask: this, camera: camera }); - - this.applyStencil(renderer, camera, true); - - renderer.maskCount++; - }, - - /** - * Applies the current stencil mask to the renderer. - * - * @method Phaser.Display.Masks.GeometryMask#applyStencil - * @since 3.17.0 - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. - * @param {boolean} inc - Is this an INCR stencil or a DECR stencil? - */ - applyStencil: function (renderer, camera, inc) - { - var gl = renderer.gl; - var geometryMask = this.geometryMask; - var level = renderer.maskCount; - - gl.colorMask(false, false, false, false); - - if (inc) - { - gl.stencilFunc(gl.EQUAL, level, 0xFF); - gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL, level + 1, 0xFF); - gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR); - } - - // Write stencil buffer - geometryMask.renderWebGL(renderer, geometryMask, camera); - - renderer.flush(); - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); - - if (inc) - { - if (this.invertAlpha) - { - gl.stencilFunc(gl.NOTEQUAL, level + 1, 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL, level + 1, 0xFF); - } - } - else if (this.invertAlpha) - { - gl.stencilFunc(gl.NOTEQUAL, level, 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL, level, 0xFF); - } - }, - - /** - * Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it. - * - * @method Phaser.Display.Masks.GeometryMask#postRenderWebGL - * @since 3.0.0 - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw flush. - */ - postRenderWebGL: function (renderer) - { - var gl = renderer.gl; - - renderer.maskStack.pop(); - - renderer.maskCount--; - - // Force flush before disabling stencil test - renderer.flush(); - - var current = renderer.currentMask; - - if (renderer.maskStack.length === 0) - { - // If this is the only mask in the stack, flush and disable - current.mask = null; - - gl.disable(gl.STENCIL_TEST); - } - else - { - var prev = renderer.maskStack[renderer.maskStack.length - 1]; - - prev.mask.applyStencil(renderer, prev.camera, false); - - if (renderer.currentCameraMask.mask !== prev.mask) - { - current.mask = prev.mask; - current.camera = prev.camera; - } - else - { - current.mask = null; - } - } - }, - - /** - * Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object. - * - * @method Phaser.Display.Masks.GeometryMask#preRenderCanvas - * @since 3.0.0 - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance to set the clipping path on. - * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. - */ - preRenderCanvas: function (renderer, mask, camera) - { - var geometryMask = this.geometryMask; - - renderer.currentContext.save(); - - geometryMask.renderCanvas(renderer, geometryMask, camera, null, null, true); - - renderer.currentContext.clip(); - }, - - /** - * Restore the canvas context's previous clipping path, thus turning off the mask for it. - * - * @method Phaser.Display.Masks.GeometryMask#postRenderCanvas - * @since 3.0.0 - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance being restored. - */ - postRenderCanvas: function (renderer) - { - renderer.currentContext.restore(); - }, - - /** - * Destroys this GeometryMask and nulls any references it holds. - * - * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, - * so be sure to call `clearMask` on any Game Object using it, before destroying it. - * - * @method Phaser.Display.Masks.GeometryMask#destroy - * @since 3.7.0 + * @method Phaser.Plugins.ScenePlugin#destroy + * @since 3.8.0 */ destroy: function () { - this.geometryMask = null; + this.pluginManager = null; + this.game = null; + this.scene = null; + this.systems = null; } }); -module.exports = GeometryMask; +module.exports = ScenePlugin; /***/ }), -/* 329 */ -/***/ (function(module, exports) { + +/***/ 8351: +/***/ ((module) => { /** * @author Richard Davey @@ -45057,201 +45460,338 @@ module.exports = GeometryMask; */ /** - * Provides methods used for getting and setting the origin of a Game Object. - * Values are normalized, given in the range 0 to 1. - * Display values contain the calculated pixel values. - * Should be applied as a mixin and not used directly. + * Phaser Blend Modes. * - * @namespace Phaser.GameObjects.Components.Origin + * @namespace Phaser.BlendModes * @since 3.0.0 */ -var Origin = { +module.exports = { /** - * A property indicating that a Game Object has this component. + * Skips the Blend Mode check in the renderer. * - * @name Phaser.GameObjects.Components.Origin#_originComponent - * @type {boolean} - * @private - * @default true - * @since 3.2.0 - */ - _originComponent: true, - - /** - * The horizontal origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the left of the Game Object. - * - * @name Phaser.GameObjects.Components.Origin#originX + * @name Phaser.BlendModes.SKIP_CHECK * @type {number} - * @default 0.5 + * @const * @since 3.0.0 */ - originX: 0.5, + SKIP_CHECK: -1, /** - * The vertical origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the top of the Game Object. + * Normal blend mode. For Canvas and WebGL. + * This is the default setting and draws new shapes on top of the existing canvas content. * - * @name Phaser.GameObjects.Components.Origin#originY + * @name Phaser.BlendModes.NORMAL * @type {number} - * @default 0.5 + * @const * @since 3.0.0 */ - originY: 0.5, - - // private + read only - _displayOriginX: 0, - _displayOriginY: 0, + NORMAL: 0, /** - * The horizontal display origin of this Game Object. - * The origin is a normalized value between 0 and 1. - * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + * Add blend mode. For Canvas and WebGL. + * Where both shapes overlap the color is determined by adding color values. * - * @name Phaser.GameObjects.Components.Origin#displayOriginX + * @name Phaser.BlendModes.ADD * @type {number} + * @const * @since 3.0.0 */ - displayOriginX: { - - get: function () - { - return this._displayOriginX; - }, - - set: function (value) - { - this._displayOriginX = value; - this.originX = value / this.width; - } - - }, + ADD: 1, /** - * The vertical display origin of this Game Object. - * The origin is a normalized value between 0 and 1. - * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + * Multiply blend mode. For Canvas and WebGL. + * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. * - * @name Phaser.GameObjects.Components.Origin#displayOriginY + * @name Phaser.BlendModes.MULTIPLY * @type {number} + * @const * @since 3.0.0 */ - displayOriginY: { - - get: function () - { - return this._displayOriginY; - }, - - set: function (value) - { - this._displayOriginY = value; - this.originY = value / this.height; - } - - }, + MULTIPLY: 2, /** - * Sets the origin of this Game Object. + * Screen blend mode. For Canvas and WebGL. + * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) * - * The values are given in the range 0 to 1. - * - * @method Phaser.GameObjects.Components.Origin#setOrigin + * @name Phaser.BlendModes.SCREEN + * @type {number} + * @const * @since 3.0.0 - * - * @param {number} [x=0.5] - The horizontal origin value. - * @param {number} [y=x] - The vertical origin value. If not defined it will be set to the value of `x`. - * - * @return {this} This Game Object instance. */ - setOrigin: function (x, y) - { - if (x === undefined) { x = 0.5; } - if (y === undefined) { y = x; } - - this.originX = x; - this.originY = y; - - return this.updateDisplayOrigin(); - }, + SCREEN: 3, /** - * Sets the origin of this Game Object based on the Pivot values in its Frame. + * Overlay blend mode. For Canvas only. + * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. * - * @method Phaser.GameObjects.Components.Origin#setOriginFromFrame + * @name Phaser.BlendModes.OVERLAY + * @type {number} + * @const * @since 3.0.0 - * - * @return {this} This Game Object instance. */ - setOriginFromFrame: function () - { - if (!this.frame || !this.frame.customPivot) - { - return this.setOrigin(); - } - else - { - this.originX = this.frame.pivotX; - this.originY = this.frame.pivotY; - } - - return this.updateDisplayOrigin(); - }, + OVERLAY: 4, /** - * Sets the display origin of this Game Object. - * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * Darken blend mode. For Canvas only. + * Retains the darkest pixels of both layers. * - * @method Phaser.GameObjects.Components.Origin#setDisplayOrigin + * @name Phaser.BlendModes.DARKEN + * @type {number} + * @const * @since 3.0.0 - * - * @param {number} [x=0] - The horizontal display origin value. - * @param {number} [y=x] - The vertical display origin value. If not defined it will be set to the value of `x`. - * - * @return {this} This Game Object instance. */ - setDisplayOrigin: function (x, y) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = x; } - - this.displayOriginX = x; - this.displayOriginY = y; - - return this; - }, + DARKEN: 5, /** - * Updates the Display Origin cached values internally stored on this Game Object. - * You don't usually call this directly, but it is exposed for edge-cases where you may. + * Lighten blend mode. For Canvas only. + * Retains the lightest pixels of both layers. * - * @method Phaser.GameObjects.Components.Origin#updateDisplayOrigin + * @name Phaser.BlendModes.LIGHTEN + * @type {number} + * @const * @since 3.0.0 - * - * @return {this} This Game Object instance. */ - updateDisplayOrigin: function () - { - this._displayOriginX = this.originX * this.width; - this._displayOriginY = this.originY * this.height; + LIGHTEN: 6, - return this; - } + /** + * Color Dodge blend mode. For Canvas only. + * Divides the bottom layer by the inverted top layer. + * + * @name Phaser.BlendModes.COLOR_DODGE + * @type {number} + * @const + * @since 3.0.0 + */ + COLOR_DODGE: 7, + + /** + * Color Burn blend mode. For Canvas only. + * Divides the inverted bottom layer by the top layer, and then inverts the result. + * + * @name Phaser.BlendModes.COLOR_BURN + * @type {number} + * @const + * @since 3.0.0 + */ + COLOR_BURN: 8, + + /** + * Hard Light blend mode. For Canvas only. + * A combination of multiply and screen like overlay, but with top and bottom layer swapped. + * + * @name Phaser.BlendModes.HARD_LIGHT + * @type {number} + * @const + * @since 3.0.0 + */ + HARD_LIGHT: 9, + + /** + * Soft Light blend mode. For Canvas only. + * A softer version of hard-light. Pure black or white does not result in pure black or white. + * + * @name Phaser.BlendModes.SOFT_LIGHT + * @type {number} + * @const + * @since 3.0.0 + */ + SOFT_LIGHT: 10, + + /** + * Difference blend mode. For Canvas only. + * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. + * + * @name Phaser.BlendModes.DIFFERENCE + * @type {number} + * @const + * @since 3.0.0 + */ + DIFFERENCE: 11, + + /** + * Exclusion blend mode. For Canvas only. + * Like difference, but with lower contrast. + * + * @name Phaser.BlendModes.EXCLUSION + * @type {number} + * @const + * @since 3.0.0 + */ + EXCLUSION: 12, + + /** + * Hue blend mode. For Canvas only. + * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. + * + * @name Phaser.BlendModes.HUE + * @type {number} + * @const + * @since 3.0.0 + */ + HUE: 13, + + /** + * Saturation blend mode. For Canvas only. + * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. + * + * @name Phaser.BlendModes.SATURATION + * @type {number} + * @const + * @since 3.0.0 + */ + SATURATION: 14, + + /** + * Color blend mode. For Canvas only. + * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. + * + * @name Phaser.BlendModes.COLOR + * @type {number} + * @const + * @since 3.0.0 + */ + COLOR: 15, + + /** + * Luminosity blend mode. For Canvas only. + * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. + * + * @name Phaser.BlendModes.LUMINOSITY + * @type {number} + * @const + * @since 3.0.0 + */ + LUMINOSITY: 16, + + /** + * Alpha erase blend mode. For Canvas and WebGL. + * + * @name Phaser.BlendModes.ERASE + * @type {number} + * @const + * @since 3.0.0 + */ + ERASE: 17, + + /** + * Source-in blend mode. For Canvas only. + * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. + * + * @name Phaser.BlendModes.SOURCE_IN + * @type {number} + * @const + * @since 3.0.0 + */ + SOURCE_IN: 18, + + /** + * Source-out blend mode. For Canvas only. + * The new shape is drawn where it doesn't overlap the existing canvas content. + * + * @name Phaser.BlendModes.SOURCE_OUT + * @type {number} + * @const + * @since 3.0.0 + */ + SOURCE_OUT: 19, + + /** + * Source-out blend mode. For Canvas only. + * The new shape is only drawn where it overlaps the existing canvas content. + * + * @name Phaser.BlendModes.SOURCE_ATOP + * @type {number} + * @const + * @since 3.0.0 + */ + SOURCE_ATOP: 20, + + /** + * Destination-over blend mode. For Canvas only. + * New shapes are drawn behind the existing canvas content. + * + * @name Phaser.BlendModes.DESTINATION_OVER + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_OVER: 21, + + /** + * Destination-in blend mode. For Canvas only. + * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. + * + * @name Phaser.BlendModes.DESTINATION_IN + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_IN: 22, + + /** + * Destination-out blend mode. For Canvas only. + * The existing content is kept where it doesn't overlap the new shape. + * + * @name Phaser.BlendModes.DESTINATION_OUT + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_OUT: 23, + + /** + * Destination-out blend mode. For Canvas only. + * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. + * + * @name Phaser.BlendModes.DESTINATION_ATOP + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_ATOP: 24, + + /** + * Lighten blend mode. For Canvas only. + * Where both shapes overlap the color is determined by adding color values. + * + * @name Phaser.BlendModes.LIGHTER + * @type {number} + * @const + * @since 3.0.0 + */ + LIGHTER: 25, + + /** + * Copy blend mode. For Canvas only. + * Only the new shape is shown. + * + * @name Phaser.BlendModes.COPY + * @type {number} + * @const + * @since 3.0.0 + */ + COPY: 26, + + /** + * Xor blend mode. For Canvas only. + * Shapes are made transparent where both overlap and drawn normal everywhere else. + * + * @name Phaser.BlendModes.XOR + * @type {number} + * @const + * @since 3.0.0 + */ + XOR: 27 }; -module.exports = Origin; - /***/ }), -/* 330 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8196: +/***/ ((module) => { /** * @author Richard Davey @@ -45259,428 +45799,1727 @@ module.exports = Origin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DegToRad = __webpack_require__(20); -var GetBoolean = __webpack_require__(331); -var GetValue = __webpack_require__(7); -var TWEEN_CONST = __webpack_require__(332); -var Vector2 = __webpack_require__(2); - /** - * Provides methods used for managing a Game Object following a Path. - * Should be applied as a mixin and not used directly. + * Phaser Scale Modes. * - * @namespace Phaser.GameObjects.Components.PathFollower - * @since 3.17.0 + * @namespace Phaser.ScaleModes + * @since 3.0.0 */ -var PathFollower = { +var ScaleModes = { /** - * The Path this PathFollower is following. It can only follow one Path at a time. + * Default Scale Mode (Linear). * - * @name Phaser.GameObjects.Components.PathFollower#path - * @type {Phaser.Curves.Path} - * @since 3.0.0 - */ - path: null, - - /** - * Should the PathFollower automatically rotate to point in the direction of the Path? - * - * @name Phaser.GameObjects.Components.PathFollower#rotateToPath - * @type {boolean} - * @default false - * @since 3.0.0 - */ - rotateToPath: false, - - /** - * If the PathFollower is rotating to match the Path (@see Phaser.GameObjects.PathFollower#rotateToPath) - * this value is added to the rotation value. This allows you to rotate objects to a path but control - * the angle of the rotation as well. - * - * @name Phaser.GameObjects.PathFollower#pathRotationOffset + * @name Phaser.ScaleModes.DEFAULT * @type {number} - * @default 0 + * @readonly * @since 3.0.0 */ - pathRotationOffset: 0, + DEFAULT: 0, /** - * An additional vector to add to the PathFollowers position, allowing you to offset it from the - * Path coordinates. + * Linear Scale Mode. * - * @name Phaser.GameObjects.PathFollower#pathOffset - * @type {Phaser.Math.Vector2} - * @since 3.0.0 - */ - pathOffset: null, - - /** - * A Vector2 that stores the current point of the path the follower is on. - * - * @name Phaser.GameObjects.PathFollower#pathVector - * @type {Phaser.Math.Vector2} - * @since 3.0.0 - */ - pathVector: null, - - /** - * The distance the follower has traveled from the previous point to the current one, at the last update. - * - * @name Phaser.GameObjects.PathFollower#pathDelta - * @type {Phaser.Math.Vector2} - * @since 3.23.0 - */ - pathDelta: null, - - /** - * The Tween used for following the Path. - * - * @name Phaser.GameObjects.PathFollower#pathTween - * @type {Phaser.Tweens.Tween} - * @since 3.0.0 - */ - pathTween: null, - - /** - * Settings for the PathFollower. - * - * @name Phaser.GameObjects.PathFollower#pathConfig - * @type {?Phaser.Types.GameObjects.PathFollower.PathConfig} - * @default null - * @since 3.0.0 - */ - pathConfig: null, - - /** - * Records the direction of the follower so it can change direction. - * - * @name Phaser.GameObjects.PathFollower#_prevDirection + * @name Phaser.ScaleModes.LINEAR * @type {number} - * @private + * @readonly * @since 3.0.0 */ - _prevDirection: TWEEN_CONST.PLAYING_FORWARD, + LINEAR: 0, /** - * Set the Path that this PathFollower should follow. + * Nearest Scale Mode. * - * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings. - * - * @method Phaser.GameObjects.Components.PathFollower#setPath + * @name Phaser.ScaleModes.NEAREST + * @type {number} + * @readonly * @since 3.0.0 - * - * @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time. - * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config] - Settings for the PathFollower. - * - * @return {this} This Game Object. */ - setPath: function (path, config) - { - if (config === undefined) { config = this.pathConfig; } - - var tween = this.pathTween; - - if (tween && tween.isPlaying()) - { - tween.stop(); - } - - this.path = path; - - if (config) - { - this.startFollow(config); - } - - return this; - }, - - /** - * Set whether the PathFollower should automatically rotate to point in the direction of the Path. - * - * @method Phaser.GameObjects.Components.PathFollower#setRotateToPath - * @since 3.0.0 - * - * @param {boolean} value - Whether the PathFollower should automatically rotate to point in the direction of the Path. - * @param {number} [offset=0] - Rotation offset in degrees. - * - * @return {this} This Game Object. - */ - setRotateToPath: function (value, offset) - { - if (offset === undefined) { offset = 0; } - - this.rotateToPath = value; - - this.pathRotationOffset = offset; - - return this; - }, - - /** - * Is this PathFollower actively following a Path or not? - * - * To be considered as `isFollowing` it must be currently moving on a Path, and not paused. - * - * @method Phaser.GameObjects.Components.PathFollower#isFollowing - * @since 3.0.0 - * - * @return {boolean} `true` is this PathFollower is actively following a Path, otherwise `false`. - */ - isFollowing: function () - { - var tween = this.pathTween; - - return (tween && tween.isPlaying()); - }, - - /** - * Starts this PathFollower following its given Path. - * - * @method Phaser.GameObjects.Components.PathFollower#startFollow - * @since 3.3.0 - * - * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config={}] - The duration of the follow, or a PathFollower config object. - * @param {number} [startAt=0] - Optional start position of the follow, between 0 and 1. - * - * @return {this} This Game Object. - */ - startFollow: function (config, startAt) - { - if (config === undefined) { config = {}; } - if (startAt === undefined) { startAt = 0; } - - var tween = this.pathTween; - - if (tween && tween.isPlaying()) - { - tween.stop(); - } - - if (typeof config === 'number') - { - config = { duration: config }; - } - - // Override in case they've been specified in the config - config.from = GetValue(config, 'from', 0); - config.to = GetValue(config, 'to', 1); - - var positionOnPath = GetBoolean(config, 'positionOnPath', false); - - this.rotateToPath = GetBoolean(config, 'rotateToPath', false); - this.pathRotationOffset = GetValue(config, 'rotationOffset', 0); - - // This works, but it's not an ideal way of doing it as the follower jumps position - var seek = GetValue(config, 'startAt', startAt); - - if (seek) - { - config.onStart = function (tween) - { - var tweenData = tween.data[0]; - tweenData.progress = seek; - tweenData.elapsed = tweenData.duration * seek; - var v = tweenData.ease(tweenData.progress); - tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); - tweenData.setTargetValue(); - }; - } - - if (!this.pathOffset) - { - this.pathOffset = new Vector2(this.x, this.y); - } - - if (!this.pathVector) - { - this.pathVector = new Vector2(); - } - - if (!this.pathDelta) - { - this.pathDelta = new Vector2(); - } - - this.pathDelta.reset(); - - config.persist = true; - - this.pathTween = this.scene.sys.tweens.addCounter(config); - - // The starting point of the path, relative to this follower - this.path.getStartPoint(this.pathOffset); - - if (positionOnPath) - { - this.x = this.pathOffset.x; - this.y = this.pathOffset.y; - } - - this.pathOffset.x = this.x - this.pathOffset.x; - this.pathOffset.y = this.y - this.pathOffset.y; - - this._prevDirection = TWEEN_CONST.PLAYING_FORWARD; - - if (this.rotateToPath) - { - // Set the rotation now (in case the tween has a delay on it, etc) - var nextPoint = this.path.getPoint(0.1); - - this.rotation = Math.atan2(nextPoint.y - this.y, nextPoint.x - this.x) + DegToRad(this.pathRotationOffset); - } - - this.pathConfig = config; - - return this; - }, - - /** - * Pauses this PathFollower. It will still continue to render, but it will remain motionless at the - * point on the Path at which you paused it. - * - * @method Phaser.GameObjects.Components.PathFollower#pauseFollow - * @since 3.3.0 - * - * @return {this} This Game Object. - */ - pauseFollow: function () - { - var tween = this.pathTween; - - if (tween && tween.isPlaying()) - { - tween.pause(); - } - - return this; - }, - - /** - * Resumes a previously paused PathFollower. - * - * If the PathFollower was not paused this has no effect. - * - * @method Phaser.GameObjects.Components.PathFollower#resumeFollow - * @since 3.3.0 - * - * @return {this} This Game Object. - */ - resumeFollow: function () - { - var tween = this.pathTween; - - if (tween && tween.isPaused()) - { - tween.resume(); - } - - return this; - }, - - /** - * Stops this PathFollower from following the path any longer. - * - * This will invoke any 'stop' conditions that may exist on the Path, or for the follower. - * - * @method Phaser.GameObjects.Components.PathFollower#stopFollow - * @since 3.3.0 - * - * @return {this} This Game Object. - */ - stopFollow: function () - { - var tween = this.pathTween; - - if (tween && tween.isPlaying()) - { - tween.stop(); - } - - return this; - }, - - /** - * Internal update handler that advances this PathFollower along the path. - * - * Called automatically by the Scene step, should not typically be called directly. - * - * @method Phaser.GameObjects.Components.PathFollower#pathUpdate - * @since 3.17.0 - */ - pathUpdate: function () - { - var tween = this.pathTween; - - if (tween) - { - var tweenData = tween.data[0]; - var pathDelta = this.pathDelta; - var pathVector = this.pathVector; - - pathDelta.copy(pathVector).negate(); - - if (tweenData.state === TWEEN_CONST.COMPLETE) - { - this.path.getPoint(tweenData.end, pathVector); - - pathDelta.add(pathVector); - pathVector.add(this.pathOffset); - - this.setPosition(pathVector.x, pathVector.y); - - return; - } - else if (tweenData.state !== TWEEN_CONST.PLAYING_FORWARD && tweenData.state !== TWEEN_CONST.PLAYING_BACKWARD) - { - // If delayed, etc then bail out - return; - } - - this.path.getPoint(tween.getValue(), pathVector); - - pathDelta.add(pathVector); - pathVector.add(this.pathOffset); - - var oldX = this.x; - var oldY = this.y; - - this.setPosition(pathVector.x, pathVector.y); - - var speedX = this.x - oldX; - var speedY = this.y - oldY; - - if (speedX === 0 && speedY === 0) - { - // Bail out early - return; - } - - if (tweenData.state !== this._prevDirection) - { - // We've changed direction, so don't do a rotate this frame - this._prevDirection = tweenData.state; - - return; - } - - if (this.rotateToPath) - { - this.rotation = Math.atan2(speedY, speedX) + DegToRad(this.pathRotationOffset); - } - } - } + NEAREST: 1 }; -module.exports = PathFollower; +module.exports = ScaleModes; /***/ }), -/* 331 */ -/***/ (function(module, exports) { + +/***/ 3527: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scale Manager Resize Event. + * + * This event is dispatched whenever the Scale Manager detects a resize event from the browser. + * It sends three parameters to the callback, each of them being Size components. You can read + * the `width`, `height`, `aspectRatio` and other properties of these components to help with + * scaling your own game content. + * + * @event Phaser.Scale.Events#RESIZE + * @type {string} + * @since 3.16.1 + * + * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas. + * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size. + * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode. + * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width. + * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height. + */ +module.exports = 'resize'; + + +/***/ }), + +/***/ 8618: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Added to Scene Event. + * + * This event is dispatched when a Game Object is added to a Scene. + * + * Listen for it from a Scene using `this.events.on('addedtoscene', listener)`. + * + * @event Phaser.Scenes.Events#ADDED_TO_SCENE + * @type {string} + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene. + * @param {Phaser.Scene} scene - The Scene to which the Game Object was added. + */ +module.exports = 'addedtoscene'; + + +/***/ }), + +/***/ 4328: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Boot Event. + * + * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins. + * + * Listen to it from a Scene using `this.events.on('boot', listener)`. + * + * @event Phaser.Scenes.Events#BOOT + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + */ +module.exports = 'boot'; + + +/***/ }), + +/***/ 6099: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Create Event. + * + * This event is dispatched by a Scene after it has been created by the Scene Manager. + * + * If a Scene has a `create` method then this event is emitted _after_ that has run. + * + * If there is a transition, this event will be fired after the `TRANSITION_START` event. + * + * Listen to it from a Scene using `this.events.on('create', listener)`. + * + * @event Phaser.Scenes.Events#CREATE + * @type {string} + * @since 3.17.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event. + */ +module.exports = 'create'; + + +/***/ }), + +/***/ 7645: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Destroy Event. + * + * This event is dispatched by a Scene during the Scene Systems destroy process. + * + * Listen to it from a Scene using `this.events.on('destroy', listener)`. + * + * You should destroy any resources that may be in use by your Scene in this event handler. + * + * @event Phaser.Scenes.Events#DESTROY + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + */ +module.exports = 'destroy'; + + +/***/ }), + +/***/ 2710: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Pause Event. + * + * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an + * action from another Scene. + * + * Listen to it from a Scene using `this.events.on('pause', listener)`. + * + * @event Phaser.Scenes.Events#PAUSE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was paused. + */ +module.exports = 'pause'; + + +/***/ }), + +/***/ 2547: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Post Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('postupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#POST_UPDATE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'postupdate'; + + +/***/ }), + +/***/ 8577: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Pre-Render Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to this event from a Scene using `this.events.on('prerender', listener)`. + * + * A Scene will only render if it is visible. + * + * This event is dispatched after the Scene Display List is sorted and before the Scene is rendered. + * + * @event Phaser.Scenes.Events#PRE_RENDER + * @type {string} + * @since 3.53.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. + */ +module.exports = 'prerender'; + + +/***/ }), + +/***/ 8197: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Pre Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('preupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#PRE_UPDATE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'preupdate'; + + +/***/ }), + +/***/ 8997: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Ready Event. + * + * This event is dispatched by a Scene during the Scene Systems start process. + * By this point in the process the Scene is now fully active and rendering. + * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event. + * + * Listen to it from a Scene using `this.events.on('ready', listener)`. + * + * @event Phaser.Scenes.Events#READY + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was started. + */ +module.exports = 'ready'; + + +/***/ }), + +/***/ 7604: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Removed from Scene Event. + * + * This event is dispatched when a Game Object is removed from a Scene. + * + * Listen for it from a Scene using `this.events.on('removedfromscene', listener)`. + * + * @event Phaser.Scenes.Events#REMOVED_FROM_SCENE + * @type {string} + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene. + * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed. + */ +module.exports = 'removedfromscene'; + + +/***/ }), + +/***/ 8999: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Render Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('render', listener)`. + * + * A Scene will only render if it is visible. + * + * By the time this event is dispatched, the Scene will have already been rendered. + * + * @event Phaser.Scenes.Events#RENDER + * @type {string} + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. + */ +module.exports = 'render'; + + +/***/ }), + +/***/ 9742: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Resume Event. + * + * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.events.on('resume', listener)`. + * + * @event Phaser.Scenes.Events#RESUME + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was resumed. + */ +module.exports = 'resume'; + + +/***/ }), + +/***/ 3667: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Shutdown Event. + * + * This event is dispatched by a Scene during the Scene Systems shutdown process. + * + * Listen to it from a Scene using `this.events.on('shutdown', listener)`. + * + * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding + * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not + * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources. + * + * @event Phaser.Scenes.Events#SHUTDOWN + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was shutdown. + */ +module.exports = 'shutdown'; + + +/***/ }), + +/***/ 3468: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Sleep Event. + * + * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.events.on('sleep', listener)`. + * + * @event Phaser.Scenes.Events#SLEEP + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was sent to sleep. + */ +module.exports = 'sleep'; + + +/***/ }), + +/***/ 7840: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Start Event. + * + * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins. + * + * Listen to it from a Scene using `this.events.on('start', listener)`. + * + * @event Phaser.Scenes.Events#START + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + */ +module.exports = 'start'; + + +/***/ }), + +/***/ 9896: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Complete Event. + * + * This event is dispatched by the Target Scene of a transition. + * + * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration + * of the transition. + * + * Listen to it from a Scene using `this.events.on('transitioncomplete', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_COMPLETE + * @type {string} + * @since 3.5.0 + * + * @param {Phaser.Scene} scene -The Scene on which the transitioned completed. + */ +module.exports = 'transitioncomplete'; + + +/***/ }), + +/***/ 5103: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Init Event. + * + * This event is dispatched by the Target Scene of a transition. + * + * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method, + * this event is not dispatched. + * + * Listen to it from a Scene using `this.events.on('transitioninit', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_INIT + * @type {string} + * @since 3.5.0 + * + * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitioninit'; + + +/***/ }), + +/***/ 3162: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Out Event. + * + * This event is dispatched by a Scene when it initiates a transition to another Scene. + * + * Listen to it from a Scene using `this.events.on('transitionout', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_OUT + * @type {string} + * @since 3.5.0 + * + * @param {Phaser.Scene} target - A reference to the Scene that is being transitioned to. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitionout'; + + +/***/ }), + +/***/ 7841: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Start Event. + * + * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep. + * + * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method, + * this event is dispatched anyway. + * + * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is + * dispatched instead of this event. + * + * Listen to it from a Scene using `this.events.on('transitionstart', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_START + * @type {string} + * @since 3.5.0 + * + * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitionstart'; + + +/***/ }), + +/***/ 6454: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Wake Event. + * + * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before + * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead. + * + * Listen to it from a Scene using `this.events.on('transitionwake', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_WAKE + * @type {string} + * @since 3.5.0 + * + * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitionwake'; + + +/***/ }), + +/***/ 6536: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists and the Scene is in a Running state, otherwise this is skipped. + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('update', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#UPDATE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'update'; + + +/***/ }), + +/***/ 3875: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Wake Event. + * + * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.events.on('wake', listener)`. + * + * @event Phaser.Scenes.Events#WAKE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was woken up. + */ +module.exports = 'wake'; + + +/***/ }), + +/***/ 204: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Scenes.Events + */ + +module.exports = { + + ADDED_TO_SCENE: __webpack_require__(8618), + BOOT: __webpack_require__(4328), + CREATE: __webpack_require__(6099), + DESTROY: __webpack_require__(7645), + PAUSE: __webpack_require__(2710), + POST_UPDATE: __webpack_require__(2547), + PRE_RENDER: __webpack_require__(8577), + PRE_UPDATE: __webpack_require__(8197), + READY: __webpack_require__(8997), + REMOVED_FROM_SCENE: __webpack_require__(7604), + RENDER: __webpack_require__(8999), + RESUME: __webpack_require__(9742), + SHUTDOWN: __webpack_require__(3667), + SLEEP: __webpack_require__(3468), + START: __webpack_require__(7840), + TRANSITION_COMPLETE: __webpack_require__(9896), + TRANSITION_INIT: __webpack_require__(5103), + TRANSITION_OUT: __webpack_require__(3162), + TRANSITION_START: __webpack_require__(7841), + TRANSITION_WAKE: __webpack_require__(6454), + UPDATE: __webpack_require__(6536), + WAKE: __webpack_require__(3875) + +}; + + +/***/ }), + +/***/ 2362: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Clamp = __webpack_require__(2915); +var Extend = __webpack_require__(1030); + +/** + * @classdesc + * A Frame is a section of a Texture. + * + * @class Frame + * @memberof Phaser.Textures + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Textures.Texture} texture - The Texture this Frame is a part of. + * @param {(number|string)} name - The name of this Frame. The name is unique within the Texture. + * @param {number} sourceIndex - The index of the TextureSource that this Frame is a part of. + * @param {number} x - The x coordinate of the top-left of this Frame. + * @param {number} y - The y coordinate of the top-left of this Frame. + * @param {number} width - The width of this Frame. + * @param {number} height - The height of this Frame. + */ +var Frame = new Class({ + + initialize: + + function Frame (texture, name, sourceIndex, x, y, width, height) + { + /** + * The Texture this Frame is a part of. + * + * @name Phaser.Textures.Frame#texture + * @type {Phaser.Textures.Texture} + * @since 3.0.0 + */ + this.texture = texture; + + /** + * The name of this Frame. + * The name is unique within the Texture. + * + * @name Phaser.Textures.Frame#name + * @type {string} + * @since 3.0.0 + */ + this.name = name; + + /** + * The TextureSource this Frame is part of. + * + * @name Phaser.Textures.Frame#source + * @type {Phaser.Textures.TextureSource} + * @since 3.0.0 + */ + this.source = texture.source[sourceIndex]; + + /** + * The index of the TextureSource in the Texture sources array. + * + * @name Phaser.Textures.Frame#sourceIndex + * @type {number} + * @since 3.0.0 + */ + this.sourceIndex = sourceIndex; + + /** + * A reference to the Texture Source WebGL Texture that this Frame is using. + * + * @name Phaser.Textures.Frame#glTexture + * @type {?WebGLTexture} + * @default null + * @since 3.11.0 + */ + this.glTexture = this.source.glTexture; + + /** + * X position within the source image to cut from. + * + * @name Phaser.Textures.Frame#cutX + * @type {number} + * @since 3.0.0 + */ + this.cutX; + + /** + * Y position within the source image to cut from. + * + * @name Phaser.Textures.Frame#cutY + * @type {number} + * @since 3.0.0 + */ + this.cutY; + + /** + * The width of the area in the source image to cut. + * + * @name Phaser.Textures.Frame#cutWidth + * @type {number} + * @since 3.0.0 + */ + this.cutWidth; + + /** + * The height of the area in the source image to cut. + * + * @name Phaser.Textures.Frame#cutHeight + * @type {number} + * @since 3.0.0 + */ + this.cutHeight; + + /** + * The X rendering offset of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The Y rendering offset of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The rendering width of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#width + * @type {number} + * @since 3.0.0 + */ + this.width; + + /** + * The rendering height of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#height + * @type {number} + * @since 3.0.0 + */ + this.height; + + /** + * Half the width, floored. + * Precalculated for the renderer. + * + * @name Phaser.Textures.Frame#halfWidth + * @type {number} + * @since 3.0.0 + */ + this.halfWidth; + + /** + * Half the height, floored. + * Precalculated for the renderer. + * + * @name Phaser.Textures.Frame#halfHeight + * @type {number} + * @since 3.0.0 + */ + this.halfHeight; + + /** + * The x center of this frame, floored. + * + * @name Phaser.Textures.Frame#centerX + * @type {number} + * @since 3.0.0 + */ + this.centerX; + + /** + * The y center of this frame, floored. + * + * @name Phaser.Textures.Frame#centerY + * @type {number} + * @since 3.0.0 + */ + this.centerY; + + /** + * The horizontal pivot point of this Frame. + * + * @name Phaser.Textures.Frame#pivotX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.pivotX = 0; + + /** + * The vertical pivot point of this Frame. + * + * @name Phaser.Textures.Frame#pivotY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.pivotY = 0; + + /** + * Does this Frame have a custom pivot point? + * + * @name Phaser.Textures.Frame#customPivot + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.customPivot = false; + + /** + * **CURRENTLY UNSUPPORTED** + * + * Is this frame is rotated or not in the Texture? + * Rotation allows you to use rotated frames in texture atlas packing. + * It has nothing to do with Sprite rotation. + * + * @name Phaser.Textures.Frame#rotated + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.rotated = false; + + /** + * Over-rides the Renderer setting. + * -1 = use Renderer Setting + * 0 = No rounding + * 1 = Round + * + * @name Phaser.Textures.Frame#autoRound + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.autoRound = -1; + + /** + * Any Frame specific custom data can be stored here. + * + * @name Phaser.Textures.Frame#customData + * @type {object} + * @since 3.0.0 + */ + this.customData = {}; + + /** + * WebGL UV u0 value. + * + * @name Phaser.Textures.Frame#u0 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.u0 = 0; + + /** + * WebGL UV v0 value. + * + * @name Phaser.Textures.Frame#v0 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.v0 = 0; + + /** + * WebGL UV u1 value. + * + * @name Phaser.Textures.Frame#u1 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.u1 = 0; + + /** + * WebGL UV v1 value. + * + * @name Phaser.Textures.Frame#v1 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.v1 = 0; + + /** + * The un-modified source frame, trim and UV data. + * + * @name Phaser.Textures.Frame#data + * @type {object} + * @private + * @since 3.0.0 + */ + this.data = { + cut: { + x: 0, + y: 0, + w: 0, + h: 0, + r: 0, + b: 0 + }, + trim: false, + sourceSize: { + w: 0, + h: 0 + }, + spriteSourceSize: { + x: 0, + y: 0, + w: 0, + h: 0, + r: 0, + b: 0 + }, + radius: 0, + drawImage: { + x: 0, + y: 0, + width: 0, + height: 0 + } + }; + + this.setSize(width, height, x, y); + }, + + /** + * Sets the width, height, x and y of this Frame. + * + * This is called automatically by the constructor + * and should rarely be changed on-the-fly. + * + * @method Phaser.Textures.Frame#setSize + * @since 3.7.0 + * + * @param {number} width - The width of the frame before being trimmed. + * @param {number} height - The height of the frame before being trimmed. + * @param {number} [x=0] - The x coordinate of the top-left of this Frame. + * @param {number} [y=0] - The y coordinate of the top-left of this Frame. + * + * @return {this} This Frame object. + */ + setSize: function (width, height, x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + this.cutX = x; + this.cutY = y; + this.cutWidth = width; + this.cutHeight = height; + + this.width = width; + this.height = height; + + this.halfWidth = Math.floor(width * 0.5); + this.halfHeight = Math.floor(height * 0.5); + + this.centerX = Math.floor(width / 2); + this.centerY = Math.floor(height / 2); + + var data = this.data; + var cut = data.cut; + + cut.x = x; + cut.y = y; + cut.w = width; + cut.h = height; + cut.r = x + width; + cut.b = y + height; + + data.sourceSize.w = width; + data.sourceSize.h = height; + + data.spriteSourceSize.w = width; + data.spriteSourceSize.h = height; + + data.radius = 0.5 * Math.sqrt(width * width + height * height); + + var drawImage = data.drawImage; + + drawImage.x = x; + drawImage.y = y; + drawImage.width = width; + drawImage.height = height; + + return this.updateUVs(); + }, + + /** + * If the frame was trimmed when added to the Texture Atlas, this records the trim and source data. + * + * @method Phaser.Textures.Frame#setTrim + * @since 3.0.0 + * + * @param {number} actualWidth - The width of the frame before being trimmed. + * @param {number} actualHeight - The height of the frame before being trimmed. + * @param {number} destX - The destination X position of the trimmed frame for display. + * @param {number} destY - The destination Y position of the trimmed frame for display. + * @param {number} destWidth - The destination width of the trimmed frame for display. + * @param {number} destHeight - The destination height of the trimmed frame for display. + * + * @return {this} This Frame object. + */ + setTrim: function (actualWidth, actualHeight, destX, destY, destWidth, destHeight) + { + var data = this.data; + var ss = data.spriteSourceSize; + + // Store actual values + + data.trim = true; + + data.sourceSize.w = actualWidth; + data.sourceSize.h = actualHeight; + + ss.x = destX; + ss.y = destY; + ss.w = destWidth; + ss.h = destHeight; + ss.r = destX + destWidth; + ss.b = destY + destHeight; + + // Adjust properties + this.x = destX; + this.y = destY; + + this.width = destWidth; + this.height = destHeight; + + this.halfWidth = destWidth * 0.5; + this.halfHeight = destHeight * 0.5; + + this.centerX = Math.floor(destWidth / 2); + this.centerY = Math.floor(destHeight / 2); + + return this.updateUVs(); + }, + + /** + * Takes a crop data object and, based on the rectangular region given, calculates the + * required UV coordinates in order to crop this Frame for WebGL and Canvas rendering. + * + * This is called directly by the Game Object Texture Components `setCrop` method. + * Please use that method to crop a Game Object. + * + * @method Phaser.Textures.Frame#setCropUVs + * @since 3.11.0 + * + * @param {object} crop - The crop data object. This is the `GameObject._crop` property. + * @param {number} x - The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. + * @param {number} y - The y coordinate to start the crop from. Cannot be negative or exceed the Frame height. + * @param {number} width - The width of the crop rectangle. Cannot exceed the Frame width. + * @param {number} height - The height of the crop rectangle. Cannot exceed the Frame height. + * @param {boolean} flipX - Does the parent Game Object have flipX set? + * @param {boolean} flipY - Does the parent Game Object have flipY set? + * + * @return {object} The updated crop data object. + */ + setCropUVs: function (crop, x, y, width, height, flipX, flipY) + { + // Clamp the input values + + var cx = this.cutX; + var cy = this.cutY; + var cw = this.cutWidth; + var ch = this.cutHeight; + var rw = this.realWidth; + var rh = this.realHeight; + + x = Clamp(x, 0, rw); + y = Clamp(y, 0, rh); + + width = Clamp(width, 0, rw - x); + height = Clamp(height, 0, rh - y); + + var ox = cx + x; + var oy = cy + y; + var ow = width; + var oh = height; + + var data = this.data; + + if (data.trim) + { + var ss = data.spriteSourceSize; + + // Need to check for intersection between the cut area and the crop area + // If there is none, we set UV to be empty, otherwise set it to be the intersection area + + width = Clamp(width, 0, cw - x); + height = Clamp(height, 0, ch - y); + + var cropRight = x + width; + var cropBottom = y + height; + + var intersects = !(ss.r < x || ss.b < y || ss.x > cropRight || ss.y > cropBottom); + + if (intersects) + { + var ix = Math.max(ss.x, x); + var iy = Math.max(ss.y, y); + var iw = Math.min(ss.r, cropRight) - ix; + var ih = Math.min(ss.b, cropBottom) - iy; + + ow = iw; + oh = ih; + + if (flipX) + { + ox = cx + (cw - (ix - ss.x) - iw); + } + else + { + ox = cx + (ix - ss.x); + } + + if (flipY) + { + oy = cy + (ch - (iy - ss.y) - ih); + } + else + { + oy = cy + (iy - ss.y); + } + + x = ix; + y = iy; + + width = iw; + height = ih; + } + else + { + ox = 0; + oy = 0; + ow = 0; + oh = 0; + } + } + else + { + if (flipX) + { + ox = cx + (cw - x - width); + } + + if (flipY) + { + oy = cy + (ch - y - height); + } + } + + var tw = this.source.width; + var th = this.source.height; + + // Map the given coordinates into UV space, clamping to the 0-1 range. + + crop.u0 = Math.max(0, ox / tw); + crop.v0 = Math.max(0, oy / th); + crop.u1 = Math.min(1, (ox + ow) / tw); + crop.v1 = Math.min(1, (oy + oh) / th); + + crop.x = x; + crop.y = y; + + crop.cx = ox; + crop.cy = oy; + crop.cw = ow; + crop.ch = oh; + + crop.width = width; + crop.height = height; + + crop.flipX = flipX; + crop.flipY = flipY; + + return crop; + }, + + /** + * Takes a crop data object and recalculates the UVs based on the dimensions inside the crop object. + * Called automatically by `setFrame`. + * + * @method Phaser.Textures.Frame#updateCropUVs + * @since 3.11.0 + * + * @param {object} crop - The crop data object. This is the `GameObject._crop` property. + * @param {boolean} flipX - Does the parent Game Object have flipX set? + * @param {boolean} flipY - Does the parent Game Object have flipY set? + * + * @return {object} The updated crop data object. + */ + updateCropUVs: function (crop, flipX, flipY) + { + return this.setCropUVs(crop, crop.x, crop.y, crop.width, crop.height, flipX, flipY); + }, + + /** + * Directly sets the canvas and WebGL UV data for this frame. + * + * Use this if you need to override the values that are generated automatically + * when the Frame is created. + * + * @method Phaser.Textures.Frame#setUVs + * @since 3.50.0 + * + * @param {number} width - Width of this frame for the Canvas data. + * @param {number} height - Height of this frame for the Canvas data. + * @param {number} u0 - UV u0 value. + * @param {number} v0 - UV v0 value. + * @param {number} u1 - UV u1 value. + * @param {number} v1 - UV v1 value. + * + * @return {this} This Frame object. + */ + setUVs: function (width, height, u0, v0, u1, v1) + { + // Canvas data + + var cd = this.data.drawImage; + + cd.width = width; + cd.height = height; + + // WebGL data + + this.u0 = u0; + this.v0 = v0; + + this.u1 = u1; + this.v1 = v1; + + return this; + }, + + /** + * Updates the internal WebGL UV cache and the drawImage cache. + * + * @method Phaser.Textures.Frame#updateUVs + * @since 3.0.0 + * + * @return {this} This Frame object. + */ + updateUVs: function () + { + var cx = this.cutX; + var cy = this.cutY; + var cw = this.cutWidth; + var ch = this.cutHeight; + + // Canvas data + + var cd = this.data.drawImage; + + cd.width = cw; + cd.height = ch; + + // WebGL data + + var tw = this.source.width; + var th = this.source.height; + + this.u0 = cx / tw; + this.v0 = cy / th; + + this.u1 = (cx + cw) / tw; + this.v1 = (cy + ch) / th; + + return this; + }, + + /** + * Updates the internal WebGL UV cache. + * + * @method Phaser.Textures.Frame#updateUVsInverted + * @since 3.0.0 + * + * @return {this} This Frame object. + */ + updateUVsInverted: function () + { + var tw = this.source.width; + var th = this.source.height; + + this.u0 = (this.cutX + this.cutHeight) / tw; + this.v0 = this.cutY / th; + + this.u1 = this.cutX / tw; + this.v1 = (this.cutY + this.cutWidth) / th; + + return this; + }, + + /** + * Clones this Frame into a new Frame object. + * + * @method Phaser.Textures.Frame#clone + * @since 3.0.0 + * + * @return {Phaser.Textures.Frame} A clone of this Frame. + */ + clone: function () + { + var clone = new Frame(this.texture, this.name, this.sourceIndex); + + clone.cutX = this.cutX; + clone.cutY = this.cutY; + clone.cutWidth = this.cutWidth; + clone.cutHeight = this.cutHeight; + + clone.x = this.x; + clone.y = this.y; + + clone.width = this.width; + clone.height = this.height; + + clone.halfWidth = this.halfWidth; + clone.halfHeight = this.halfHeight; + + clone.centerX = this.centerX; + clone.centerY = this.centerY; + + clone.rotated = this.rotated; + + clone.data = Extend(true, clone.data, this.data); + + clone.updateUVs(); + + return clone; + }, + + /** + * Destroys this Frame by nulling its reference to the parent Texture and and data objects. + * + * @method Phaser.Textures.Frame#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.source = null; + this.texture = null; + this.glTexture = null; + this.customData = null; + this.data = null; + }, + + /** + * The width of the Frame in its un-trimmed, un-padded state, as prepared in the art package, + * before being packed. + * + * @name Phaser.Textures.Frame#realWidth + * @type {number} + * @readonly + * @since 3.0.0 + */ + realWidth: { + + get: function () + { + return this.data.sourceSize.w; + } + + }, + + /** + * The height of the Frame in its un-trimmed, un-padded state, as prepared in the art package, + * before being packed. + * + * @name Phaser.Textures.Frame#realHeight + * @type {number} + * @readonly + * @since 3.0.0 + */ + realHeight: { + + get: function () + { + return this.data.sourceSize.h; + } + + }, + + /** + * The radius of the Frame (derived from sqrt(w * w + h * h) / 2) + * + * @name Phaser.Textures.Frame#radius + * @type {number} + * @readonly + * @since 3.0.0 + */ + radius: { + + get: function () + { + return this.data.radius; + } + + }, + + /** + * Is the Frame trimmed or not? + * + * @name Phaser.Textures.Frame#trimmed + * @type {boolean} + * @readonly + * @since 3.0.0 + */ + trimmed: { + + get: function () + { + return this.data.trim; + } + + }, + + /** + * The Canvas drawImage data object. + * + * @name Phaser.Textures.Frame#canvasData + * @type {object} + * @readonly + * @since 3.0.0 + */ + canvasData: { + + get: function () + { + return this.data.drawImage; + } + + } + +}); + +module.exports = Frame; + + +/***/ }), + +/***/ 1864: +/***/ ((module) => { /** * @author Richard Davey @@ -45720,8 +47559,9 @@ module.exports = GetBoolean; /***/ }), -/* 332 */ -/***/ (function(module, exports) { + +/***/ 3747: +/***/ ((module) => { /** * @author Richard Davey @@ -45945,8 +47785,9 @@ module.exports = TWEEN_CONST; /***/ }), -/* 333 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 7473: +/***/ ((module) => { /** * @author Richard Davey @@ -45954,426 +47795,3319 @@ module.exports = TWEEN_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DeepCopy = __webpack_require__(334); -var SpliceOne = __webpack_require__(10); +// Taken from klasse by mattdesl https://github.com/mattdesl/klasse + +function hasGetterOrSetter (def) +{ + return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function'); +} + +function getProperty (definition, k, isClassDescriptor) +{ + // This may be a lightweight object, OR it might be a property that was defined previously. + + // For simple class descriptors we can just assume its NOT previously defined. + var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k); + + if (!isClassDescriptor && def.value && typeof def.value === 'object') + { + def = def.value; + } + + // This might be a regular property, or it may be a getter/setter the user defined in a class. + if (def && hasGetterOrSetter(def)) + { + if (typeof def.enumerable === 'undefined') + { + def.enumerable = true; + } + + if (typeof def.configurable === 'undefined') + { + def.configurable = true; + } + + return def; + } + else + { + return false; + } +} + +function hasNonConfigurable (obj, k) +{ + var prop = Object.getOwnPropertyDescriptor(obj, k); + + if (!prop) + { + return false; + } + + if (prop.value && typeof prop.value === 'object') + { + prop = prop.value; + } + + if (prop.configurable === false) + { + return true; + } + + return false; +} /** - * Provides methods used for setting the WebGL rendering pipeline of a Game Object. + * Extends the given `myClass` object's prototype with the properties of `definition`. * - * @namespace Phaser.GameObjects.Components.Pipeline - * @webglOnly - * @since 3.0.0 + * @function extend + * @ignore + * @param {Object} ctor The constructor object to mix into. + * @param {Object} definition A dictionary of functions for the class. + * @param {boolean} isClassDescriptor Is the definition a class descriptor? + * @param {Object} [extend] The parent constructor object. */ - -var Pipeline = { - - /** - * The initial WebGL pipeline of this Game Object. - * - * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. - * - * @name Phaser.GameObjects.Components.Pipeline#defaultPipeline - * @type {Phaser.Renderer.WebGL.WebGLPipeline} - * @default null - * @webglOnly - * @since 3.0.0 - */ - defaultPipeline: null, - - /** - * The current WebGL pipeline of this Game Object. - * - * @name Phaser.GameObjects.Components.Pipeline#pipeline - * @type {Phaser.Renderer.WebGL.WebGLPipeline} - * @default null - * @webglOnly - * @since 3.0.0 - */ - pipeline: null, - - /** - * Does this Game Object have any Post Pipelines set? - * - * @name Phaser.GameObjects.Components.Pipeline#hasPostPipeline - * @type {boolean} - * @webglOnly - * @since 3.50.0 - */ - hasPostPipeline: false, - - /** - * The WebGL Post FX Pipelines this Game Object uses for post-render effects. - * - * The pipelines are processed in the order in which they appear in this array. - * - * If you modify this array directly, be sure to set the - * `hasPostPipeline` property accordingly. - * - * @name Phaser.GameObjects.Components.Pipeline#postPipelines - * @type {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]} - * @webglOnly - * @since 3.50.0 - */ - postPipelines: null, - - /** - * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. - * - * @name Phaser.GameObjects.Components.Pipeline#pipelineData - * @type {object} - * @webglOnly - * @since 3.50.0 - */ - pipelineData: null, - - /** - * Sets the initial WebGL Pipeline of this Game Object. - * - * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. - * - * @method Phaser.GameObjects.Components.Pipeline#initPipeline - * @webglOnly - * @since 3.0.0 - * - * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - Either the string-based name of the pipeline, or a pipeline instance to set. - * - * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. - */ - initPipeline: function (pipeline) +function extend (ctor, definition, isClassDescriptor, extend) +{ + for (var k in definition) { - var renderer = this.scene.sys.renderer; - - if (!renderer) + if (!definition.hasOwnProperty(k)) { - return false; + continue; } - var pipelines = renderer.pipelines; + var def = getProperty(definition, k, isClassDescriptor); - this.postPipelines = []; - this.pipelineData = {}; - - if (pipelines) + if (def !== false) { - if (pipeline === undefined) + // If Extends is used, we will check its prototype to see if the final variable exists. + + var parent = extend || ctor; + + if (hasNonConfigurable(parent.prototype, k)) { - pipeline = pipelines.default; - } - - var instance = pipelines.get(pipeline); - - if (instance) - { - this.defaultPipeline = instance; - this.pipeline = instance; - - return true; - } - } - - return false; - }, - - /** - * Sets the main WebGL Pipeline of this Game Object. - * - * Also sets the `pipelineData` property, if the parameter is given. - * - * Both the pipeline and post pipelines share the same pipeline data object. - * - * @method Phaser.GameObjects.Components.Pipeline#setPipeline - * @webglOnly - * @since 3.0.0 - * - * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set. - * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. - * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. - * - * @return {this} This Game Object instance. - */ - setPipeline: function (pipeline, pipelineData, copyData) - { - var renderer = this.scene.sys.renderer; - - if (!renderer) - { - return this; - } - - var pipelines = renderer.pipelines; - - if (pipelines) - { - var instance = pipelines.get(pipeline); - - if (instance) - { - this.pipeline = instance; - } - - if (pipelineData) - { - this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; - } - } - - return this; - }, - - /** - * Sets one, or more, Post Pipelines on this Game Object. - * - * Post Pipelines are invoked after this Game Object has rendered to its target and - * are commonly used for post-fx. - * - * The post pipelines are appended to the `postPipelines` array belonging to this - * Game Object. When the renderer processes this Game Object, it iterates through the post - * pipelines in the order in which they appear in the array. If you are stacking together - * multiple effects, be aware that the order is important. - * - * If you call this method multiple times, the new pipelines will be appended to any existing - * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. - * - * You can optionally also set the `pipelineData` property, if the parameter is given. - * - * Both the pipeline and post pipelines share the pipeline data object together. - * - * @method Phaser.GameObjects.Components.Pipeline#setPostPipeline - * @webglOnly - * @since 3.50.0 - * - * @param {(string|string[]|function|function[]|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} pipelines - Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. - * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. - * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. - * - * @return {this} This Game Object instance. - */ - setPostPipeline: function (pipelines, pipelineData, copyData) - { - var renderer = this.scene.sys.renderer; - - if (!renderer) - { - return this; - } - - var pipelineManager = renderer.pipelines; - - if (pipelineManager) - { - if (!Array.isArray(pipelines)) - { - pipelines = [ pipelines ]; - } - - for (var i = 0; i < pipelines.length; i++) - { - var instance = pipelineManager.getPostPipeline(pipelines[i], this); - - if (instance) + // Just skip the final property + if (Class.ignoreFinals) { - this.postPipelines.push(instance); + continue; } + + // We cannot re-define a property that is configurable=false. + // So we will consider them final and throw an error. This is by + // default so it is clear to the developer what is happening. + // You can set ignoreFinals to true if you need to extend a class + // which has configurable=false; it will simply not re-define final properties. + throw new Error('cannot override final property \'' + k + '\', set Class.ignoreFinals = true to skip'); } - if (pipelineData) - { - this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; - } - } - - this.hasPostPipeline = (this.postPipelines.length > 0); - - return this; - }, - - /** - * Adds an entry to the `pipelineData` object belonging to this Game Object. - * - * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. - * - * If `value` is undefined, and `key` exists, `key` is removed from the data object. - * - * Both the pipeline and post pipelines share the pipeline data object together. - * - * @method Phaser.GameObjects.Components.Pipeline#setPipelineData - * @webglOnly - * @since 3.50.0 - * - * @param {string} key - The key of the pipeline data to set, update, or delete. - * @param {any} [value] - The value to be set with the key. If `undefined` then `key` will be deleted from the object. - * - * @return {this} This Game Object instance. - */ - setPipelineData: function (key, value) - { - var data = this.pipelineData; - - if (value === undefined) - { - delete data[key]; + Object.defineProperty(ctor.prototype, k, def); } else { - data[key] = value; + ctor.prototype[k] = definition[k]; } + } +} - return this; - }, - - /** - * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. - * - * @method Phaser.GameObjects.Components.Pipeline#getPostPipeline - * @webglOnly - * @since 3.50.0 - * - * @param {(string|function|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline)} pipeline - The string-based name of the pipeline, or a pipeline class. - * - * @return {(Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} The Post Pipeline/s matching the name, or undefined if no match. If more than one match they are returned in an array. - */ - getPostPipeline: function (pipeline) +/** + * Applies the given `mixins` to the prototype of `myClass`. + * + * @function mixin + * @ignore + * @param {Object} myClass The constructor object to mix into. + * @param {Object|Array} mixins The mixins to apply to the constructor. + */ +function mixin (myClass, mixins) +{ + if (!mixins) { - var isString = (typeof pipeline === 'string'); - - var pipelines = this.postPipelines; - - var results = []; - - for (var i = 0; i < pipelines.length; i++) - { - var instance = pipelines[i]; - - if ((isString && instance.name === pipeline) || (!isString && instance instanceof pipeline)) - { - results.push(instance); - } - } - - return (results.length === 1) ? results[0] : results; - }, - - /** - * Resets the WebGL Pipeline of this Game Object back to the default it was created with. - * - * @method Phaser.GameObjects.Components.Pipeline#resetPipeline - * @webglOnly - * @since 3.0.0 - * - * @param {boolean} [resetPostPipelines=false] - Reset all of the post pipelines? - * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? - * - * @return {boolean} `true` if the pipeline was reset successfully, otherwise `false`. - */ - resetPipeline: function (resetPostPipelines, resetData) - { - if (resetPostPipelines === undefined) { resetPostPipelines = false; } - if (resetData === undefined) { resetData = false; } - - this.pipeline = this.defaultPipeline; - - if (resetPostPipelines) - { - this.postPipelines = []; - this.hasPostPipeline = false; - } - - if (resetData) - { - this.pipelineData = {}; - } - - return (this.pipeline !== null); - }, - - /** - * Resets the WebGL Post Pipelines of this Game Object. It does this by calling - * the `destroy` method on each post pipeline and then clearing the local array. - * - * @method Phaser.GameObjects.Components.Pipeline#resetPostPipeline - * @webglOnly - * @since 3.50.0 - * - * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? - */ - resetPostPipeline: function (resetData) - { - if (resetData === undefined) { resetData = false; } - - var pipelines = this.postPipelines; - - for (var i = 0; i < pipelines.length; i++) - { - pipelines[i].destroy(); - } - - this.postPipelines = []; - this.hasPostPipeline = false; - - if (resetData) - { - this.pipelineData = {}; - } - }, - - /** - * Removes a type of Post Pipeline instances from this Game Object, based on the given name, and destroys them. - * - * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. - * - * @method Phaser.GameObjects.Components.Pipeline#removePostPipeline - * @webglOnly - * @since 3.50.0 - * - * @param {string|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} pipeline - The string-based name of the pipeline, or a pipeline class. - * - * @return {this} This Game Object. - */ - removePostPipeline: function (pipeline) - { - var pipelines = this.postPipelines; - - for (var i = pipelines.length - 1; i >= 0; i--) - { - var instance = pipelines[i]; - - if ( - (typeof pipeline === 'string' && instance.name === pipeline) || - (typeof pipeline !== 'string' && instance instanceof pipeline)) - { - instance.destroy(); - - SpliceOne(pipelines, i); - } - } - - this.hasPostPipeline = (this.postPipelines.length > 0); - - return this; - }, - - /** - * Gets the name of the WebGL Pipeline this Game Object is currently using. - * - * @method Phaser.GameObjects.Components.Pipeline#getPipelineName - * @webglOnly - * @since 3.0.0 - * - * @return {string} The string-based name of the pipeline being used by this Game Object. - */ - getPipelineName: function () - { - return this.pipeline.name; + return; } -}; + if (!Array.isArray(mixins)) + { + mixins = [ mixins ]; + } -module.exports = Pipeline; + for (var i = 0; i < mixins.length; i++) + { + extend(myClass, mixins[i].prototype || mixins[i]); + } +} + +/** + * Creates a new class with the given descriptor. + * The constructor, defined by the name `initialize`, + * is an optional function. If unspecified, an anonymous + * function will be used which calls the parent class (if + * one exists). + * + * You can also use `Extends` and `Mixins` to provide subclassing + * and inheritance. + * + * @class Phaser.Class + * @constructor + * @param {Object} definition a dictionary of functions for the class + * @example + * + * var MyClass = new Phaser.Class({ + * + * initialize: function() { + * this.foo = 2.0; + * }, + * + * bar: function() { + * return this.foo + 5; + * } + * }); + */ +function Class (definition) +{ + if (!definition) + { + definition = {}; + } + + // The variable name here dictates what we see in Chrome debugger + var initialize; + var Extends; + + if (definition.initialize) + { + if (typeof definition.initialize !== 'function') + { + throw new Error('initialize must be a function'); + } + + initialize = definition.initialize; + + // Usually we should avoid 'delete' in V8 at all costs. + // However, its unlikely to make any performance difference + // here since we only call this on class creation (i.e. not object creation). + delete definition.initialize; + } + else if (definition.Extends) + { + var base = definition.Extends; + + initialize = function () + { + base.apply(this, arguments); + }; + } + else + { + initialize = function () {}; + } + + if (definition.Extends) + { + initialize.prototype = Object.create(definition.Extends.prototype); + initialize.prototype.constructor = initialize; + + // For getOwnPropertyDescriptor to work, we need to act directly on the Extends (or Mixin) + + Extends = definition.Extends; + + delete definition.Extends; + } + else + { + initialize.prototype.constructor = initialize; + } + + // Grab the mixins, if they are specified... + var mixins = null; + + if (definition.Mixins) + { + mixins = definition.Mixins; + delete definition.Mixins; + } + + // First, mixin if we can. + mixin(initialize, mixins); + + // Now we grab the actual definition which defines the overrides. + extend(initialize, definition, true, Extends); + + return initialize; +} + +Class.extend = extend; +Class.mixin = mixin; +Class.ignoreFinals = false; + +module.exports = Class; /***/ }), -/* 334 */ -/***/ (function(module, exports) { + +/***/ 1984: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A NOOP (No Operation) callback function. + * + * Used internally by Phaser when it's more expensive to determine if a callback exists + * than it is to just invoke an empty function. + * + * @function Phaser.Utils.NOOP + * @since 3.0.0 + */ +var NOOP = function () +{ + // NOOP +}; + +module.exports = NOOP; + + +/***/ }), + +/***/ 1792: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Adds the given item, or array of items, to the array. + * + * Each item must be unique within the array. + * + * The array is modified in-place and returned. + * + * You can optionally specify a limit to the maximum size of the array. If the quantity of items being + * added will take the array length over this limit, it will stop adding once the limit is reached. + * + * You can optionally specify a callback to be invoked for each item successfully added to the array. + * + * @function Phaser.Utils.Array.Add + * @since 3.4.0 + * + * @param {array} array - The array to be added to. + * @param {any|any[]} item - The item, or array of items, to add to the array. Each item must be unique within the array. + * @param {number} [limit] - Optional limit which caps the size of the array. + * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {array} The input array. + */ +var Add = function (array, item, limit, callback, context) +{ + if (context === undefined) { context = array; } + + if (limit > 0) + { + var remaining = limit - array.length; + + // There's nothing more we can do here, the array is full + if (remaining <= 0) + { + return null; + } + } + + // Fast path to avoid array mutation and iteration + if (!Array.isArray(item)) + { + if (array.indexOf(item) === -1) + { + array.push(item); + + if (callback) + { + callback.call(context, item); + } + + return item; + } + else + { + return null; + } + } + + // If we got this far, we have an array of items to insert + + // Ensure all the items are unique + var itemLength = item.length - 1; + + while (itemLength >= 0) + { + if (array.indexOf(item[itemLength]) !== -1) + { + // Already exists in array, so remove it + item.splice(itemLength, 1); + } + + itemLength--; + } + + // Anything left? + itemLength = item.length; + + if (itemLength === 0) + { + return null; + } + + if (limit > 0 && itemLength > remaining) + { + item.splice(remaining); + + itemLength = remaining; + } + + for (var i = 0; i < itemLength; i++) + { + var entry = item[i]; + + array.push(entry); + + if (callback) + { + callback.call(context, entry); + } + } + + return item; +}; + +module.exports = Add; + + +/***/ }), + +/***/ 2280: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Adds the given item, or array of items, to the array starting at the index specified. + * + * Each item must be unique within the array. + * + * Existing elements in the array are shifted up. + * + * The array is modified in-place and returned. + * + * You can optionally specify a limit to the maximum size of the array. If the quantity of items being + * added will take the array length over this limit, it will stop adding once the limit is reached. + * + * You can optionally specify a callback to be invoked for each item successfully added to the array. + * + * @function Phaser.Utils.Array.AddAt + * @since 3.4.0 + * + * @param {array} array - The array to be added to. + * @param {any|any[]} item - The item, or array of items, to add to the array. + * @param {number} [index=0] - The index in the array where the item will be inserted. + * @param {number} [limit] - Optional limit which caps the size of the array. + * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {array} The input array. + */ +var AddAt = function (array, item, index, limit, callback, context) +{ + if (index === undefined) { index = 0; } + if (context === undefined) { context = array; } + + if (limit > 0) + { + var remaining = limit - array.length; + + // There's nothing more we can do here, the array is full + if (remaining <= 0) + { + return null; + } + } + + // Fast path to avoid array mutation and iteration + if (!Array.isArray(item)) + { + if (array.indexOf(item) === -1) + { + array.splice(index, 0, item); + + if (callback) + { + callback.call(context, item); + } + + return item; + } + else + { + return null; + } + } + + // If we got this far, we have an array of items to insert + + // Ensure all the items are unique + var itemLength = item.length - 1; + + while (itemLength >= 0) + { + if (array.indexOf(item[itemLength]) !== -1) + { + // Already exists in array, so remove it + item.pop(); + } + + itemLength--; + } + + // Anything left? + itemLength = item.length; + + if (itemLength === 0) + { + return null; + } + + // Truncate to the limit + if (limit > 0 && itemLength > remaining) + { + item.splice(remaining); + + itemLength = remaining; + } + + for (var i = itemLength - 1; i >= 0; i--) + { + var entry = item[i]; + + array.splice(index, 0, entry); + + if (callback) + { + callback.call(context, entry); + } + } + + return item; +}; + +module.exports = AddAt; + + +/***/ }), + +/***/ 2513: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given element to the top of the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.BringToTop + * @since 3.4.0 + * + * @param {array} array - The array. + * @param {*} item - The element to move. + * + * @return {*} The element that was moved. + */ +var BringToTop = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex !== -1 && currentIndex < array.length) + { + array.splice(currentIndex, 1); + array.push(item); + } + + return item; +}; + +module.exports = BringToTop; + + +/***/ }), + +/***/ 1771: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Returns the total number of elements in the array which have a property matching the given value. + * + * @function Phaser.Utils.Array.CountAllMatching + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} property - The property to test on each array element. + * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. + * + * @return {number} The total number of elements with properties matching the given value. + */ +var CountAllMatching = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + var total = 0; + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var child = array[i]; + + if (child[property] === value) + { + total++; + } + } + } + + return total; +}; + +module.exports = CountAllMatching; + + +/***/ }), + +/***/ 7883: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Passes each element in the array to the given callback. + * + * @function Phaser.Utils.Array.Each + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {function} callback - A callback to be invoked for each item in the array. + * @param {object} context - The context in which the callback is invoked. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the current array item. + * + * @return {array} The input array. + */ +var Each = function (array, callback, context) +{ + var i; + var args = [ null ]; + + for (i = 3; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (i = 0; i < array.length; i++) + { + args[0] = array[i]; + + callback.apply(context, args); + } + + return array; +}; + +module.exports = Each; + + +/***/ }), + +/***/ 5856: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Passes each element in the array, between the start and end indexes, to the given callback. + * + * @function Phaser.Utils.Array.EachInRange + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {function} callback - A callback to be invoked for each item in the array. + * @param {object} context - The context in which the callback is invoked. + * @param {number} startIndex - The start index to search from. + * @param {number} endIndex - The end index to search to. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + * + * @return {array} The input array. + */ +var EachInRange = function (array, callback, context, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + if (SafeRange(array, startIndex, endIndex)) + { + var i; + var args = [ null ]; + + for (i = 5; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (i = startIndex; i < endIndex; i++) + { + args[0] = array[i]; + + callback.apply(context, args); + } + } + + return array; +}; + +module.exports = EachInRange; + + +/***/ }), + +/***/ 3957: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Searches a pre-sorted array for the closet value to the given number. + * + * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, + * and will check for the closest value of those to the given number. + * + * @function Phaser.Utils.Array.FindClosestInSorted + * @since 3.0.0 + * + * @param {number} value - The value to search for in the array. + * @param {array} array - The array to search, which must be sorted. + * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. + * + * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. + */ +var FindClosestInSorted = function (value, array, key) +{ + if (!array.length) + { + return NaN; + } + else if (array.length === 1) + { + return array[0]; + } + + var i = 1; + var low; + var high; + + if (key) + { + if (value < array[0][key]) + { + return array[0]; + } + + while (array[i][key] < value) + { + i++; + } + } + else + { + while (array[i] < value) + { + i++; + } + } + + if (i > array.length) + { + i = array.length; + } + + if (key) + { + low = array[i - 1][key]; + high = array[i][key]; + + return ((high - value) <= (value - low)) ? array[i] : array[i - 1]; + } + else + { + low = array[i - 1]; + high = array[i]; + + return ((high - value) <= (value - low)) ? high : low; + } +}; + +module.exports = FindClosestInSorted; + + +/***/ }), + +/***/ 4493: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array and flattens it, returning a shallow-copy flattened array. + * + * @function Phaser.Utils.Array.Flatten + * @since 3.60.0 + * + * @param {array} array - The array to flatten. + * @param {array} [output] - An array to hold the results in. + * + * @return {array} The flattened output array. + */ +var Flatten = function (array, output) +{ + if (output === undefined) { output = []; } + + for (var i = 0; i < array.length; i++) + { + if (Array.isArray(array[i])) + { + Flatten(array[i], output); + } + else + { + output.push(array[i]); + } + } + + return output; +}; + +module.exports = Flatten; + + +/***/ }), + +/***/ 6245: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Returns all elements in the array. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('visible', true)` would return only elements that have their visible property set. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 elements. + * + * @function Phaser.Utils.Array.GetAll + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} [property] - The property to test on each array element. + * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. + * + * @return {array} All matching elements from the array. + */ +var GetAll = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + var output = []; + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var child = array[i]; + + if (!property || + (property && value === undefined && child.hasOwnProperty(property)) || + (property && value !== undefined && child[property] === value)) + { + output.push(child); + } + } + } + + return output; +}; + +module.exports = GetAll; + + +/***/ }), + +/***/ 1647: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Returns the first element in the array. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('visible', true)` would return the first element that had its `visible` property set. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would search only the first 50 elements. + * + * @function Phaser.Utils.Array.GetFirst + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} [property] - The property to test on each array element. + * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=array.length] - An optional end index to search up to (but not included) + * + * @return {object} The first matching element from the array, or `null` if no element could be found in the range given. + */ +var GetFirst = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var child = array[i]; + + if (!property || + (property && value === undefined && child.hasOwnProperty(property)) || + (property && value !== undefined && child[property] === value)) + { + return child; + } + } + } + + return null; +}; + +module.exports = GetFirst; + + +/***/ }), + +/***/ 5301: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns a Random element from the array. + * + * @function Phaser.Utils.Array.GetRandom + * @since 3.0.0 + * + * @param {array} array - The array to select the random entry from. + * @param {number} [startIndex=0] - An optional start index. + * @param {number} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from. + * + * @return {*} A random element from the array, or `null` if no element could be found in the range given. + */ +var GetRandom = function (array, startIndex, length) +{ + if (startIndex === undefined) { startIndex = 0; } + if (length === undefined) { length = array.length; } + + var randomIndex = startIndex + Math.floor(Math.random() * length); + + return (array[randomIndex] === undefined) ? null : array[randomIndex]; +}; + +module.exports = GetRandom; + + +/***/ }), + +/***/ 8683: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given array element above another one in the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveAbove + * @since 3.55.0 + * + * @param {array} array - The input array. + * @param {*} item1 - The element to move above base element. + * @param {*} item2 - The base element. + * + * + * @return {array} The input array. + */ +var MoveAbove = function (array, item1, item2) +{ + if (item1 === item2) + { + return array; + } + + var currentIndex = array.indexOf(item1); + var baseIndex = array.indexOf(item2); + + if (currentIndex < 0 || baseIndex < 0) + { + throw new Error('Supplied items must be elements of the same array'); + } + + if (currentIndex > baseIndex) + { + // item1 is already above item2 + return array; + } + + // Remove + array.splice(currentIndex, 1); + + // Add in new location + if (baseIndex === array.length - 1) + { + array.push(item1); + } + else + { + array.splice(baseIndex, 0, item1); + } + + return array; +}; + +module.exports = MoveAbove; + + +/***/ }), + +/***/ 546: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given array element below another one in the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveBelow + * @since 3.55.0 + * + * @param {array} array - The input array. + * @param {*} item1 - The element to move below base element. + * @param {*} item2 - The base element. + * + * + * @return {array} The input array. + */ +var MoveBelow = function (array, item1, item2) +{ + if (item1 === item2) + { + return array; + } + + var currentIndex = array.indexOf(item1); + var baseIndex = array.indexOf(item2); + + if (currentIndex < 0 || baseIndex < 0) + { + throw new Error('Supplied items must be elements of the same array'); + } + + if (currentIndex < baseIndex) + { + // item1 is already below item2 + return array; + } + + // Remove + array.splice(currentIndex, 1); + + // Add in new location + if (baseIndex === 0) + { + array.unshift(item1); + } + else + { + array.splice(baseIndex, 0, item1); + } + + return array; +}; + +module.exports = MoveBelow; + + +/***/ }), + +/***/ 1842: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given array element down one place in the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveDown + * @since 3.4.0 + * + * @param {array} array - The input array. + * @param {*} item - The element to move down the array. + * + * @return {array} The input array. + */ +var MoveDown = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex > 0) + { + var item2 = array[currentIndex - 1]; + + var index2 = array.indexOf(item2); + + array[currentIndex] = item2; + array[index2] = item; + } + + return array; +}; + +module.exports = MoveDown; + + +/***/ }), + +/***/ 1419: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves an element in an array to a new position within the same array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveTo + * @since 3.4.0 + * + * @param {array} array - The array. + * @param {*} item - The element to move. + * @param {number} index - The new index that the element will be moved to. + * + * @return {*} The element that was moved. + */ +var MoveTo = function (array, item, index) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex === -1 || index < 0 || index >= array.length) + { + throw new Error('Supplied index out of bounds'); + } + + if (currentIndex !== index) + { + // Remove + array.splice(currentIndex, 1); + + // Add in new location + array.splice(index, 0, item); + } + + return item; +}; + +module.exports = MoveTo; + + +/***/ }), + +/***/ 6512: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given array element up one place in the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveUp + * @since 3.4.0 + * + * @param {array} array - The input array. + * @param {*} item - The element to move up the array. + * + * @return {array} The input array. + */ +var MoveUp = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex !== -1 && currentIndex < array.length - 1) + { + // The element one above `item` in the array + var item2 = array[currentIndex + 1]; + var index2 = array.indexOf(item2); + + array[currentIndex] = item2; + array[index2] = item; + } + + return array; +}; + +module.exports = MoveUp; + + +/***/ }), + +/***/ 4130: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Create an array representing the range of numbers (usually integers), between, and inclusive of, + * the given `start` and `end` arguments. For example: + * + * `var array = Phaser.Utils.Array.NumberArray(2, 4); // array = [2, 3, 4]` + * `var array = Phaser.Utils.Array.NumberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` + * `var array = Phaser.Utils.Array.NumberArray(8, 2); // array = [8, 7, 6, 5, 4, 3, 2]` + * + * This is equivalent to `Phaser.Utils.Array.NumberArrayStep(start, end, 1)`. + * + * You can optionally provide a prefix and / or suffix string. If given the array will contain + * strings, not integers. For example: + * + * `var array = Phaser.Utils.Array.NumberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` + * `var array = Phaser.Utils.Array.NumberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` + * + * @function Phaser.Utils.Array.NumberArray + * @since 3.0.0 + * + * @param {number} start - The minimum value the array starts with. + * @param {number} end - The maximum value the array contains. + * @param {string} [prefix] - Optional prefix to place before the number. If provided the array will contain strings, not integers. + * @param {string} [suffix] - Optional suffix to place after the number. If provided the array will contain strings, not integers. + * + * @return {(number[]|string[])} The array of number values, or strings if a prefix or suffix was provided. + */ +var NumberArray = function (start, end, prefix, suffix) +{ + var result = []; + + var i; + var asString = false; + + if (prefix || suffix) + { + asString = true; + + if (!prefix) + { + prefix = ''; + } + + if (!suffix) + { + suffix = ''; + } + } + + if (end < start) + { + for (i = start; i >= end; i--) + { + if (asString) + { + result.push(prefix + i.toString() + suffix); + } + else + { + result.push(i); + } + } + } + else + { + for (i = start; i <= end; i++) + { + if (asString) + { + result.push(prefix + i.toString() + suffix); + } + else + { + result.push(i); + } + } + } + + return result; +}; + +module.exports = NumberArray; + + +/***/ }), + +/***/ 1316: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RoundAwayFromZero = __webpack_require__(4078); + +/** + * Create an array of numbers (positive and/or negative) progressing from `start` + * up to but not including `end` by advancing by `step`. + * + * If `start` is less than `end` a zero-length range is created unless a negative `step` is specified. + * + * Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0; + * for forward compatibility make sure to pass in actual numbers. + * + * @example + * NumberArrayStep(4); + * // => [0, 1, 2, 3] + * + * NumberArrayStep(1, 5); + * // => [1, 2, 3, 4] + * + * NumberArrayStep(0, 20, 5); + * // => [0, 5, 10, 15] + * + * NumberArrayStep(0, -4, -1); + * // => [0, -1, -2, -3] + * + * NumberArrayStep(1, 4, 0); + * // => [1, 1, 1] + * + * NumberArrayStep(0); + * // => [] + * + * @function Phaser.Utils.Array.NumberArrayStep + * @since 3.0.0 + * + * @param {number} [start=0] - The start of the range. + * @param {number} [end=null] - The end of the range. + * @param {number} [step=1] - The value to increment or decrement by. + * + * @return {number[]} The array of number values. + */ +var NumberArrayStep = function (start, end, step) +{ + if (start === undefined) { start = 0; } + if (end === undefined) { end = null; } + if (step === undefined) { step = 1; } + + if (end === null) + { + end = start; + start = 0; + } + + var result = []; + + var total = Math.max(RoundAwayFromZero((end - start) / (step || 1)), 0); + + for (var i = 0; i < total; i++) + { + result.push(start); + start += step; + } + + return result; +}; + +module.exports = NumberArrayStep; + + +/***/ }), + +/***/ 9465: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @ignore + */ +function swap (arr, i, j) +{ + var tmp = arr[i]; + arr[i] = arr[j]; + arr[j] = tmp; +} + +/** + * @ignore + */ +function defaultCompare (a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * A [Floyd-Rivest](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm) quick selection algorithm. + * + * Rearranges the array items so that all items in the [left, k] range are smaller than all items in [k, right]; + * The k-th element will have the (k - left + 1)th smallest value in [left, right]. + * + * The array is modified in-place. + * + * Based on code by [Vladimir Agafonkin](https://www.npmjs.com/~mourner) + * + * @function Phaser.Utils.Array.QuickSelect + * @since 3.0.0 + * + * @param {array} arr - The array to sort. + * @param {number} k - The k-th element index. + * @param {number} [left=0] - The index of the left part of the range. + * @param {number} [right] - The index of the right part of the range. + * @param {function} [compare] - An optional comparison function. Is passed two elements and should return 0, 1 or -1. + */ +var QuickSelect = function (arr, k, left, right, compare) +{ + if (left === undefined) { left = 0; } + if (right === undefined) { right = arr.length - 1; } + if (compare === undefined) { compare = defaultCompare; } + + while (right > left) + { + if (right - left > 600) + { + var n = right - left + 1; + var m = k - left + 1; + var z = Math.log(n); + var s = 0.5 * Math.exp(2 * z / 3); + var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1); + var newLeft = Math.max(left, Math.floor(k - m * s / n + sd)); + var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd)); + + QuickSelect(arr, k, newLeft, newRight, compare); + } + + var t = arr[k]; + var i = left; + var j = right; + + swap(arr, left, k); + + if (compare(arr[right], t) > 0) + { + swap(arr, left, right); + } + + while (i < j) + { + swap(arr, i, j); + + i++; + j--; + + while (compare(arr[i], t) < 0) + { + i++; + } + + while (compare(arr[j], t) > 0) + { + j--; + } + } + + if (compare(arr[left], t) === 0) + { + swap(arr, left, j); + } + else + { + j++; + swap(arr, j, right); + } + + if (j <= k) + { + left = j + 1; + } + + if (k <= j) + { + right = j - 1; + } + } +}; + +module.exports = QuickSelect; + + +/***/ }), + +/***/ 9703: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetValue = __webpack_require__(5851); +var Shuffle = __webpack_require__(4912); + +var BuildChunk = function (a, b, qty) +{ + var out = []; + + for (var aIndex = 0; aIndex < a.length; aIndex++) + { + for (var bIndex = 0; bIndex < b.length; bIndex++) + { + for (var i = 0; i < qty; i++) + { + out.push({ a: a[aIndex], b: b[bIndex] }); + } + } + } + + return out; +}; + +/** + * Creates an array populated with a range of values, based on the given arguments and configuration object. + * + * Range ([a,b,c], [1,2,3]) = + * a1, a2, a3, b1, b2, b3, c1, c2, c3 + * + * Range ([a,b], [1,2,3], qty = 3) = + * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3 + * + * Range ([a,b,c], [1,2,3], repeat x1) = + * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3 + * + * Range ([a,b], [1,2], repeat -1 = endless, max = 14) = + * Maybe if max is set then repeat goes to -1 automatically? + * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements) + * + * Range ([a], [1,2,3,4,5], random = true) = + * a4, a1, a5, a2, a3 + * + * Range ([a, b], [1,2,3], random = true) = + * b3, a2, a1, b1, a3, b2 + * + * Range ([a, b, c], [1,2,3], randomB = true) = + * a3, a1, a2, b2, b3, b1, c1, c3, c2 + * + * Range ([a], [1,2,3,4,5], yoyo = true) = + * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1 + * + * Range ([a, b], [1,2,3], yoyo = true) = + * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1 + * + * @function Phaser.Utils.Array.Range + * @since 3.0.0 + * + * @param {array} a - The first array of range elements. + * @param {array} b - The second array of range elements. + * @param {object} [options] - A range configuration object. Can contain: repeat, random, randomB, yoyo, max, qty. + * + * @return {array} An array of arranged elements. + */ +var Range = function (a, b, options) +{ + var max = GetValue(options, 'max', 0); + var qty = GetValue(options, 'qty', 1); + var random = GetValue(options, 'random', false); + var randomB = GetValue(options, 'randomB', false); + var repeat = GetValue(options, 'repeat', 0); + var yoyo = GetValue(options, 'yoyo', false); + + var out = []; + + if (randomB) + { + Shuffle(b); + } + + // Endless repeat, so limit by max + if (repeat === -1) + { + if (max === 0) + { + repeat = 0; + } + else + { + // Work out how many repeats we need + var total = (a.length * b.length) * qty; + + if (yoyo) + { + total *= 2; + } + + repeat = Math.ceil(max / total); + } + } + + for (var i = 0; i <= repeat; i++) + { + var chunk = BuildChunk(a, b, qty); + + if (random) + { + Shuffle(chunk); + } + + out = out.concat(chunk); + + if (yoyo) + { + chunk.reverse(); + + out = out.concat(chunk); + } + } + + if (max) + { + out.splice(max); + } + + return out; +}; + +module.exports = Range; + + +/***/ }), + +/***/ 7161: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SpliceOne = __webpack_require__(8935); + +/** + * Removes the given item, or array of items, from the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for each item successfully removed from the array. + * + * @function Phaser.Utils.Array.Remove + * @since 3.4.0 + * + * @param {array} array - The array to be modified. + * @param {*|Array.<*>} item - The item, or array of items, to be removed from the array. + * @param {function} [callback] - A callback to be invoked for each item successfully removed from the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {*|Array.<*>} The item, or array of items, that were successfully removed from the array. + */ +var Remove = function (array, item, callback, context) +{ + if (context === undefined) { context = array; } + + var index; + + // Fast path to avoid array mutation and iteration + if (!Array.isArray(item)) + { + index = array.indexOf(item); + + if (index !== -1) + { + SpliceOne(array, index); + + if (callback) + { + callback.call(context, item); + } + + return item; + } + else + { + return null; + } + } + + // If we got this far, we have an array of items to remove + + var itemLength = item.length - 1; + var removed = []; + + while (itemLength >= 0) + { + var entry = item[itemLength]; + + index = array.indexOf(entry); + + if (index !== -1) + { + SpliceOne(array, index); + + removed.push(entry); + + if (callback) + { + callback.call(context, entry); + } + } + + itemLength--; + } + + return removed; +}; + +module.exports = Remove; + + +/***/ }), + +/***/ 4725: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SpliceOne = __webpack_require__(8935); + +/** + * Removes the item from the given position in the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array. + * + * @function Phaser.Utils.Array.RemoveAt + * @since 3.4.0 + * + * @param {array} array - The array to be modified. + * @param {number} index - The array index to remove the item from. The index must be in bounds or it will throw an error. + * @param {function} [callback] - A callback to be invoked for the item removed from the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {*} The item that was removed. + */ +var RemoveAt = function (array, index, callback, context) +{ + if (context === undefined) { context = array; } + + if (index < 0 || index > array.length - 1) + { + throw new Error('Index out of bounds'); + } + + var item = SpliceOne(array, index); + + if (callback) + { + callback.call(context, item); + } + + return item; +}; + +module.exports = RemoveAt; + + +/***/ }), + +/***/ 8780: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Removes the item within the given range in the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for the item/s successfully removed from the array. + * + * @function Phaser.Utils.Array.RemoveBetween + * @since 3.4.0 + * + * @param {array} array - The array to be modified. + * @param {number} startIndex - The start index to remove from. + * @param {number} endIndex - The end index to remove to. + * @param {function} [callback] - A callback to be invoked for the item removed from the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {Array.<*>} An array of items that were removed. + */ +var RemoveBetween = function (array, startIndex, endIndex, callback, context) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + if (context === undefined) { context = array; } + + if (SafeRange(array, startIndex, endIndex)) + { + var size = endIndex - startIndex; + + var removed = array.splice(startIndex, size); + + if (callback) + { + for (var i = 0; i < removed.length; i++) + { + var entry = removed[i]; + + callback.call(context, entry); + } + } + + return removed; + } + else + { + return []; + } +}; + +module.exports = RemoveBetween; + + +/***/ }), + +/***/ 5744: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SpliceOne = __webpack_require__(8935); + +/** + * Removes a random object from the given array and returns it. + * Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index. + * + * @function Phaser.Utils.Array.RemoveRandomElement + * @since 3.0.0 + * + * @param {array} array - The array to removed a random element from. + * @param {number} [start=0] - The array index to start the search from. + * @param {number} [length=array.length] - Optional restriction on the number of elements to randomly select from. + * + * @return {object} The random element that was removed, or `null` if there were no array elements that fell within the given range. + */ +var RemoveRandomElement = function (array, start, length) +{ + if (start === undefined) { start = 0; } + if (length === undefined) { length = array.length; } + + var randomIndex = start + Math.floor(Math.random() * length); + + return SpliceOne(array, randomIndex); +}; + +module.exports = RemoveRandomElement; + + +/***/ }), + +/***/ 6960: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Replaces an element of the array with the new element. + * The new element cannot already be a member of the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.Replace + * @since 3.4.0 + * + * @param {array} array - The array to search within. + * @param {*} oldChild - The element in the array that will be replaced. + * @param {*} newChild - The element to be inserted into the array at the position of `oldChild`. + * + * @return {boolean} Returns true if the oldChild was successfully replaced, otherwise returns false. + */ +var Replace = function (array, oldChild, newChild) +{ + var index1 = array.indexOf(oldChild); + var index2 = array.indexOf(newChild); + + if (index1 !== -1 && index2 === -1) + { + array[index1] = newChild; + + return true; + } + else + { + return false; + } +}; + +module.exports = Replace; + + +/***/ }), + +/***/ 1021: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the element at the start of the array to the end, shifting all items in the process. + * The "rotation" happens to the left. + * + * @function Phaser.Utils.Array.RotateLeft + * @since 3.0.0 + * + * @param {array} array - The array to shift to the left. This array is modified in place. + * @param {number} [total=1] - The number of times to shift the array. + * + * @return {*} The most recently shifted element. + */ +var RotateLeft = function (array, total) +{ + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) + { + element = array.shift(); + array.push(element); + } + + return element; +}; + +module.exports = RotateLeft; + + +/***/ }), + +/***/ 4027: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the element at the end of the array to the start, shifting all items in the process. + * The "rotation" happens to the right. + * + * @function Phaser.Utils.Array.RotateRight + * @since 3.0.0 + * + * @param {array} array - The array to shift to the right. This array is modified in place. + * @param {number} [total=1] - The number of times to shift the array. + * + * @return {*} The most recently shifted element. + */ +var RotateRight = function (array, total) +{ + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) + { + element = array.pop(); + array.unshift(element); + } + + return element; +}; + +module.exports = RotateRight; + + +/***/ }), + +/***/ 2497: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Tests if the start and end indexes are a safe range for the given array. + * + * @function Phaser.Utils.Array.SafeRange + * @since 3.4.0 + * + * @param {array} array - The array to check. + * @param {number} startIndex - The start index. + * @param {number} endIndex - The end index. + * @param {boolean} [throwError=true] - Throw an error if the range is out of bounds. + * + * @return {boolean} True if the range is safe, otherwise false. + */ +var SafeRange = function (array, startIndex, endIndex, throwError) +{ + var len = array.length; + + if (startIndex < 0 || + startIndex > len || + startIndex >= endIndex || + endIndex > len) + { + if (throwError) + { + throw new Error('Range Error: Values outside acceptable range'); + } + + return false; + } + else + { + return true; + } +}; + +module.exports = SafeRange; + + +/***/ }), + +/***/ 5361: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given element to the bottom of the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.SendToBack + * @since 3.4.0 + * + * @param {array} array - The array. + * @param {*} item - The element to move. + * + * @return {*} The element that was moved. + */ +var SendToBack = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex !== -1 && currentIndex > 0) + { + array.splice(currentIndex, 1); + array.unshift(item); + } + + return item; +}; + +module.exports = SendToBack; + + +/***/ }), + +/***/ 3718: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Scans the array for elements with the given property. If found, the property is set to the `value`. + * + * For example: `SetAll('visible', true)` would set all elements that have a `visible` property to `false`. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would update only the first 50 elements. + * + * @function Phaser.Utils.Array.SetAll + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} property - The property to test for on each array element. + * @param {*} value - The value to set the property to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. + * + * @return {array} The input array. + */ +var SetAll = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var entry = array[i]; + + if (entry.hasOwnProperty(property)) + { + entry[property] = value; + } + } + } + + return array; +}; + +module.exports = SetAll; + + +/***/ }), + +/***/ 4912: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Shuffles the contents of the given array using the Fisher-Yates implementation. + * + * The original array is modified directly and returned. + * + * @function Phaser.Utils.Array.Shuffle + * @since 3.0.0 + * + * @generic T + * @genericUse {T[]} - [array,$return] + * + * @param {T[]} array - The array to shuffle. This array is modified in place. + * + * @return {T[]} The shuffled array. + */ +var Shuffle = function (array) +{ + for (var i = array.length - 1; i > 0; i--) + { + var j = Math.floor(Math.random() * (i + 1)); + var temp = array[i]; + array[i] = array[j]; + array[j] = temp; + } + + return array; +}; + +module.exports = Shuffle; + + +/***/ }), + +/***/ 2071: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes the given array and runs a numeric sort on it, ignoring any non-digits that + * may be in the entries. + * + * You should only run this on arrays containing strings. + * + * @function Phaser.Utils.Array.SortByDigits + * @since 3.50.0 + * + * @param {string[]} array - The input array of strings. + * + * @return {string[]} The sorted input array. + */ +var SortByDigits = function (array) +{ + var re = /\D/g; + + array.sort(function (a, b) + { + return (parseInt(a.replace(re, ''), 10) - parseInt(b.replace(re, ''), 10)); + }); + + return array; +}; + +module.exports = SortByDigits; + + +/***/ }), + +/***/ 8935: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Removes a single item from an array and returns it without creating gc, like the native splice does. + * Based on code by Mike Reinstein. + * + * @function Phaser.Utils.Array.SpliceOne + * @since 3.0.0 + * + * @param {array} array - The array to splice from. + * @param {number} index - The index of the item which should be spliced. + * + * @return {*} The item which was spliced (removed). + */ +var SpliceOne = function (array, index) +{ + if (index >= array.length) + { + return; + } + + var len = array.length - 1; + + var item = array[index]; + + for (var i = index; i < len; i++) + { + array[i] = array[i + 1]; + } + + array.length = len; + + return item; +}; + +module.exports = SpliceOne; + + +/***/ }), + +/***/ 9992: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @author Angry Bytes (and contributors) + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Device = __webpack_require__(9356); + +/** + * The comparator function. + * + * @ignore + * + * @param {*} a - The first item to test. + * @param {*} b - The second itemt to test. + * + * @return {boolean} True if they localCompare, otherwise false. + */ +function Compare (a, b) +{ + return String(a).localeCompare(b); +} + +/** + * Process the array contents. + * + * @ignore + * + * @param {array} array - The array to process. + * @param {function} compare - The comparison function. + * + * @return {array} - The processed array. + */ +function Process (array, compare) +{ + // Short-circuit when there's nothing to sort. + var len = array.length; + + if (len <= 1) + { + return array; + } + + // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. + // Chunks are the size of the left or right hand in merge sort. + // Stop when the left-hand covers all of the array. + var buffer = new Array(len); + + for (var chk = 1; chk < len; chk *= 2) + { + RunPass(array, compare, chk, buffer); + + var tmp = array; + + array = buffer; + + buffer = tmp; + } + + return array; +} + +/** + * Run a single pass with the given chunk size. + * + * @ignore + * + * @param {array} arr - The array to run the pass on. + * @param {function} comp - The comparison function. + * @param {number} chk - The number of iterations. + * @param {array} result - The array to store the result in. + */ +function RunPass (arr, comp, chk, result) +{ + var len = arr.length; + var i = 0; + + // Step size / double chunk size. + var dbl = chk * 2; + + // Bounds of the left and right chunks. + var l, r, e; + + // Iterators over the left and right chunk. + var li, ri; + + // Iterate over pairs of chunks. + for (l = 0; l < len; l += dbl) + { + r = l + chk; + e = r + chk; + + if (r > len) + { + r = len; + } + + if (e > len) + { + e = len; + } + + // Iterate both chunks in parallel. + li = l; + ri = r; + + while (true) + { + // Compare the chunks. + if (li < r && ri < e) + { + // This works for a regular `sort()` compatible comparator, + // but also for a simple comparator like: `a > b` + if (comp(arr[li], arr[ri]) <= 0) + { + result[i++] = arr[li++]; + } + else + { + result[i++] = arr[ri++]; + } + } + else if (li < r) + { + // Nothing to compare, just flush what's left. + result[i++] = arr[li++]; + } + else if (ri < e) + { + result[i++] = arr[ri++]; + } + else + { + // Both iterators are at the chunk ends. + break; + } + } + } +} + +/** + * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. + * + * This is an implementation of merge sort, without recursion. + * + * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable + * + * @function Phaser.Utils.Array.StableSort + * @since 3.0.0 + * + * @param {array} array - The input array to be sorted. + * @param {function} [compare] - The comparison function. + * + * @return {array} The sorted result. + */ +var StableSort = function (array, compare) +{ + if (compare === undefined) { compare = Compare; } + + // Short-circuit when there's nothing to sort. + if (!array || array.length < 2) + { + return array; + } + + if (Device.features.stableSort) + { + return array.sort(compare); + } + + var result = Process(array, compare); + + // This simply copies back if the result isn't in the original array, which happens on an odd number of passes. + if (result !== array) + { + RunPass(result, null, array.length, array); + } + + return array; +}; + +module.exports = StableSort; + + +/***/ }), + +/***/ 2372: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Swaps the position of two elements in the given array. + * The elements must exist in the same array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.Swap + * @since 3.4.0 + * + * @param {array} array - The input array. + * @param {*} item1 - The first element to swap. + * @param {*} item2 - The second element to swap. + * + * @return {array} The input array. + */ +var Swap = function (array, item1, item2) +{ + if (item1 === item2) + { + return array; + } + + var index1 = array.indexOf(item1); + var index2 = array.indexOf(item2); + + if (index1 < 0 || index2 < 0) + { + throw new Error('Supplied items must be elements of the same array'); + } + + array[index1] = item2; + array[index2] = item1; + + return array; +}; + +module.exports = Swap; + + +/***/ }), + +/***/ 1953: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Utils.Array + */ + +module.exports = { + + Matrix: __webpack_require__(1237), + + Add: __webpack_require__(1792), + AddAt: __webpack_require__(2280), + BringToTop: __webpack_require__(2513), + CountAllMatching: __webpack_require__(1771), + Each: __webpack_require__(7883), + EachInRange: __webpack_require__(5856), + FindClosestInSorted: __webpack_require__(3957), + Flatten: __webpack_require__(4493), + GetAll: __webpack_require__(6245), + GetFirst: __webpack_require__(1647), + GetRandom: __webpack_require__(5301), + MoveDown: __webpack_require__(1842), + MoveTo: __webpack_require__(1419), + MoveUp: __webpack_require__(6512), + MoveAbove: __webpack_require__(8683), + MoveBelow: __webpack_require__(546), + NumberArray: __webpack_require__(4130), + NumberArrayStep: __webpack_require__(1316), + QuickSelect: __webpack_require__(9465), + Range: __webpack_require__(9703), + Remove: __webpack_require__(7161), + RemoveAt: __webpack_require__(4725), + RemoveBetween: __webpack_require__(8780), + RemoveRandomElement: __webpack_require__(5744), + Replace: __webpack_require__(6960), + RotateLeft: __webpack_require__(1021), + RotateRight: __webpack_require__(4027), + SafeRange: __webpack_require__(2497), + SendToBack: __webpack_require__(5361), + SetAll: __webpack_require__(3718), + Shuffle: __webpack_require__(4912), + SortByDigits: __webpack_require__(2071), + SpliceOne: __webpack_require__(8935), + StableSort: __webpack_require__(9992), + Swap: __webpack_require__(2372) + +}; + + +/***/ }), + +/***/ 1816: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if an array can be used as a matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.CheckMatrix + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix] + * + * @param {T[][]} [matrix] - The array to check. + * + * @return {boolean} `true` if the given `matrix` array is a valid matrix. + */ +var CheckMatrix = function (matrix) +{ + if (!Array.isArray(matrix) || !Array.isArray(matrix[0])) + { + return false; + } + + // How long is the first row? + var size = matrix[0].length; + + // Validate the rest of the rows are the same length + for (var i = 1; i < matrix.length; i++) + { + if (matrix[i].length !== size) + { + return false; + } + } + + return true; +}; + +module.exports = CheckMatrix; + + +/***/ }), + +/***/ 6655: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Pad = __webpack_require__(7222); +var CheckMatrix = __webpack_require__(1816); + +/** + * Generates a string (which you can pass to console.log) from the given Array Matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.MatrixToString + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix] + * + * @param {T[][]} [matrix] - A 2-dimensional array. + * + * @return {string} A string representing the matrix. + */ +var MatrixToString = function (matrix) +{ + var str = ''; + + if (!CheckMatrix(matrix)) + { + return str; + } + + for (var r = 0; r < matrix.length; r++) + { + for (var c = 0; c < matrix[r].length; c++) + { + var cell = matrix[r][c].toString(); + + if (cell !== 'undefined') + { + str += Pad(cell, 2); + } + else + { + str += '?'; + } + + if (c < matrix[r].length - 1) + { + str += ' |'; + } + } + + if (r < matrix.length - 1) + { + str += '\n'; + + for (var i = 0; i < matrix[r].length; i++) + { + str += '---'; + + if (i < matrix[r].length - 1) + { + str += '+'; + } + } + + str += '\n'; + } + + } + + return str; +}; + +module.exports = MatrixToString; + + +/***/ }), + +/***/ 582: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Reverses the columns in the given Array Matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.ReverseColumns + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to reverse the columns for. + * + * @return {T[][]} The column reversed matrix. + */ +var ReverseColumns = function (matrix) +{ + return matrix.reverse(); +}; + +module.exports = ReverseColumns; + + +/***/ }), + +/***/ 6063: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Reverses the rows in the given Array Matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.ReverseRows + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to reverse the rows for. + * + * @return {T[][]} The column reversed matrix. + */ +var ReverseRows = function (matrix) +{ + for (var i = 0; i < matrix.length; i++) + { + matrix[i].reverse(); + } + + return matrix; +}; + +module.exports = ReverseRows; + + +/***/ }), + +/***/ 8321: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateMatrix = __webpack_require__(7116); + +/** + * Rotates the array matrix 180 degrees. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.Rotate180 + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var Rotate180 = function (matrix) +{ + return RotateMatrix(matrix, 180); +}; + +module.exports = Rotate180; + + +/***/ }), + +/***/ 2597: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateMatrix = __webpack_require__(7116); + +/** + * Rotates the array matrix to the left (or 90 degrees) + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.RotateLeft + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var RotateLeft = function (matrix) +{ + return RotateMatrix(matrix, 90); +}; + +module.exports = RotateLeft; + + +/***/ }), + +/***/ 7116: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CheckMatrix = __webpack_require__(1816); +var TransposeMatrix = __webpack_require__(4780); + +/** + * Rotates the array matrix based on the given rotation value. + * + * The value can be given in degrees: 90, -90, 270, -270 or 180, + * or a string command: `rotateLeft`, `rotateRight` or `rotate180`. + * + * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.RotateMatrix + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * @param {(number|string)} [direction=90] - The amount to rotate the matrix by. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var RotateMatrix = function (matrix, direction) +{ + if (direction === undefined) { direction = 90; } + + if (!CheckMatrix(matrix)) + { + return null; + } + + if (typeof direction !== 'string') + { + direction = ((direction % 360) + 360) % 360; + } + + if (direction === 90 || direction === -270 || direction === 'rotateLeft') + { + matrix = TransposeMatrix(matrix); + matrix.reverse(); + } + else if (direction === -90 || direction === 270 || direction === 'rotateRight') + { + matrix.reverse(); + matrix = TransposeMatrix(matrix); + } + else if (Math.abs(direction) === 180 || direction === 'rotate180') + { + for (var i = 0; i < matrix.length; i++) + { + matrix[i].reverse(); + } + + matrix.reverse(); + } + + return matrix; +}; + +module.exports = RotateMatrix; + + +/***/ }), + +/***/ 6285: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateMatrix = __webpack_require__(7116); + +/** + * Rotates the array matrix to the left (or -90 degrees) + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.RotateRight + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var RotateRight = function (matrix) +{ + return RotateMatrix(matrix, -90); +}; + +module.exports = RotateRight; + + +/***/ }), + +/***/ 7711: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateLeft = __webpack_require__(1021); +var RotateRight = __webpack_require__(4027); + +/** + * Translates the given Array Matrix by shifting each column and row the + * amount specified. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.Translate + * @since 3.50.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to translate. + * @param {number} [x=0] - The amount to horizontally translate the matrix by. + * @param {number} [y=0] - The amount to vertically translate the matrix by. + * + * @return {T[][]} The translated matrix. + */ +var TranslateMatrix = function (matrix, x, y) +{ + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + // Vertical translation + + if (y !== 0) + { + if (y < 0) + { + // Shift Up + RotateLeft(matrix, Math.abs(y)); + } + else + { + // Shift Down + RotateRight(matrix, y); + } + } + + // Horizontal translation + + if (x !== 0) + { + for (var i = 0; i < matrix.length; i++) + { + var row = matrix[i]; + + if (x < 0) + { + RotateLeft(row, Math.abs(x)); + } + else + { + RotateRight(row, x); + } + } + } + + return matrix; +}; + +module.exports = TranslateMatrix; + + +/***/ }), + +/***/ 4780: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Transposes the elements of the given matrix (array of arrays). + * + * The transpose of a matrix is a new matrix whose rows are the columns of the original. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.TransposeMatrix + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [array,$return] + * + * @param {T[][]} [array] - The array matrix to transpose. + * + * @return {T[][]} A new array matrix which is a transposed version of the given array. + */ +var TransposeMatrix = function (array) +{ + var sourceRowCount = array.length; + var sourceColCount = array[0].length; + + var result = new Array(sourceColCount); + + for (var i = 0; i < sourceColCount; i++) + { + result[i] = new Array(sourceRowCount); + + for (var j = sourceRowCount - 1; j > -1; j--) + { + result[i][j] = array[j][i]; + } + } + + return result; +}; + +module.exports = TransposeMatrix; + + +/***/ }), + +/***/ 1237: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Utils.Array.Matrix + */ + +module.exports = { + + CheckMatrix: __webpack_require__(1816), + MatrixToString: __webpack_require__(6655), + ReverseColumns: __webpack_require__(582), + ReverseRows: __webpack_require__(6063), + Rotate180: __webpack_require__(8321), + RotateLeft: __webpack_require__(2597), + RotateMatrix: __webpack_require__(7116), + RotateRight: __webpack_require__(6285), + Translate: __webpack_require__(7711), + TransposeMatrix: __webpack_require__(4780) + +}; + + +/***/ }), + +/***/ 3911: +/***/ ((module) => { /** * @author Richard Davey @@ -46421,8 +51155,9 @@ module.exports = DeepCopy; /***/ }), -/* 335 */ -/***/ (function(module, exports) { + +/***/ 1030: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -46430,934 +51165,233 @@ module.exports = DeepCopy; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var IsPlainObject = __webpack_require__(2482); + +// @param {boolean} deep - Perform a deep copy? +// @param {object} target - The target object to copy to. +// @return {object} The extended object. + /** - * Provides methods used for getting and setting the size of a Game Object. + * This is a slightly modified version of http://api.jquery.com/jQuery.extend/ * - * @namespace Phaser.GameObjects.Components.Size + * @function Phaser.Utils.Objects.Extend * @since 3.0.0 - */ - -var Size = { - - /** - * A property indicating that a Game Object has this component. - * - * @name Phaser.GameObjects.Components.Size#_sizeComponent - * @type {boolean} - * @private - * @default true - * @since 3.2.0 - */ - _sizeComponent: true, - - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - * - * @name Phaser.GameObjects.Components.Size#width - * @type {number} - * @since 3.0.0 - */ - width: 0, - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - * - * @name Phaser.GameObjects.Components.Size#height - * @type {number} - * @since 3.0.0 - */ - height: 0, - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.Size#displayWidth - * @type {number} - * @since 3.0.0 - */ - displayWidth: { - - get: function () - { - return Math.abs(this.scaleX * this.frame.realWidth); - }, - - set: function (value) - { - this.scaleX = value / this.frame.realWidth; - } - - }, - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.Size#displayHeight - * @type {number} - * @since 3.0.0 - */ - displayHeight: { - - get: function () - { - return Math.abs(this.scaleY * this.frame.realHeight); - }, - - set: function (value) - { - this.scaleY = value / this.frame.realHeight; - } - - }, - - /** - * Sets the size of this Game Object to be that of the given Frame. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * - * @method Phaser.GameObjects.Components.Size#setSizeToFrame - * @since 3.0.0 - * - * @param {Phaser.Textures.Frame} frame - The frame to base the size of this Game Object on. - * - * @return {this} This Game Object instance. - */ - setSizeToFrame: function (frame) - { - if (frame === undefined) { frame = this.frame; } - - this.width = frame.realWidth; - this.height = frame.realHeight; - - var input = this.input; - - if (input && !input.customHitArea) - { - input.hitArea.width = this.width; - input.hitArea.height = this.height; - } - - return this; - }, - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * - * @method Phaser.GameObjects.Components.Size#setSize - * @since 3.0.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setSize: function (width, height) - { - this.width = width; - this.height = height; - - return this; - }, - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * - * @method Phaser.GameObjects.Components.Size#setDisplaySize - * @since 3.0.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setDisplaySize: function (width, height) - { - this.displayWidth = width; - this.displayHeight = height; - - return this; - } - -}; - -module.exports = Size; - - -/***/ }), -/* 336 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Frame = __webpack_require__(68); - -// bitmask flag for GameObject.renderMask -var _FLAG = 8; // 1000 - -/** - * Provides methods used for getting and setting the texture of a Game Object. * - * @namespace Phaser.GameObjects.Components.Texture - * @since 3.0.0 - */ - -var Texture = { - - /** - * The Texture this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.Texture#texture - * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} - * @since 3.0.0 - */ - texture: null, - - /** - * The Texture Frame this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.Texture#frame - * @type {Phaser.Textures.Frame} - * @since 3.0.0 - */ - frame: null, - - /** - * Internal flag. Not to be set by this Game Object. - * - * @name Phaser.GameObjects.Components.Texture#isCropped - * @type {boolean} - * @private - * @since 3.11.0 - */ - isCropped: false, - - /** - * Sets the texture and frame this Game Object will use to render with. - * - * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * - * @method Phaser.GameObjects.Components.Texture#setTexture - * @since 3.0.0 - * - * @param {(string|Phaser.Textures.Texture)} key - The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. - * @param {(string|number)} [frame] - The name or index of the frame within the Texture. - * - * @return {this} This Game Object instance. - */ - setTexture: function (key, frame) - { - this.texture = this.scene.sys.textures.get(key); - - return this.setFrame(frame); - }, - - /** - * Sets the frame this Game Object will use to render with. - * - * If you pass a string or index then the Frame has to belong to the current Texture being used - * by this Game Object. - * - * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * - * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * - * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. - * - * @method Phaser.GameObjects.Components.Texture#setFrame - * @since 3.0.0 - * - * @param {(string|number|Phaser.Textures.Frame)} frame - The name or index of the frame within the Texture, or a Frame instance. - * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? - * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? - * - * @return {this} This Game Object instance. - */ - setFrame: function (frame, updateSize, updateOrigin) - { - if (updateSize === undefined) { updateSize = true; } - if (updateOrigin === undefined) { updateOrigin = true; } - - if (frame instanceof Frame) - { - this.texture = this.scene.sys.textures.get(frame.texture.key); - - this.frame = frame; - } - else - { - this.frame = this.texture.get(frame); - } - - if (!this.frame.cutWidth || !this.frame.cutHeight) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - - if (this._sizeComponent && updateSize) - { - this.setSizeToFrame(); - } - - if (this._originComponent && updateOrigin) - { - if (this.frame.customPivot) - { - this.setOrigin(this.frame.pivotX, this.frame.pivotY); - } - else - { - this.updateDisplayOrigin(); - } - } - - return this; - } - -}; - -module.exports = Texture; - - -/***/ }), -/* 337 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Frame = __webpack_require__(68); - -// bitmask flag for GameObject.renderMask -var _FLAG = 8; // 1000 - -/** - * Provides methods used for getting and setting the texture of a Game Object. + * @param {...*} [args] - The objects that will be mixed. * - * @namespace Phaser.GameObjects.Components.TextureCrop - * @since 3.0.0 + * @return {object} The extended object. */ - -var TextureCrop = { - - /** - * The Texture this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.TextureCrop#texture - * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} - * @since 3.0.0 - */ - texture: null, - - /** - * The Texture Frame this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.TextureCrop#frame - * @type {Phaser.Textures.Frame} - * @since 3.0.0 - */ - frame: null, - - /** - * A boolean flag indicating if this Game Object is being cropped or not. - * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. - * Equally, calling `setCrop` with no arguments will reset the crop and disable it. - * - * @name Phaser.GameObjects.Components.TextureCrop#isCropped - * @type {boolean} - * @since 3.11.0 - */ - isCropped: false, - - /** - * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * - * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * - * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just - * changes what is shown when rendered. - * - * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * - * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left - * half of it, you could call `setCrop(0, 0, 400, 600)`. - * - * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop - * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * - * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * - * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * - * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow - * the renderer to skip several internal calculations. - * - * @method Phaser.GameObjects.Components.TextureCrop#setCrop - * @since 3.11.0 - * - * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. - * @param {number} [y] - The y coordinate to start the crop from. - * @param {number} [width] - The width of the crop rectangle in pixels. - * @param {number} [height] - The height of the crop rectangle in pixels. - * - * @return {this} This Game Object instance. - */ - setCrop: function (x, y, width, height) - { - if (x === undefined) - { - this.isCropped = false; - } - else if (this.frame) - { - if (typeof x === 'number') - { - this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY); - } - else - { - var rect = x; - - this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY); - } - - this.isCropped = true; - } - - return this; - }, - - /** - * Sets the texture and frame this Game Object will use to render with. - * - * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * - * @method Phaser.GameObjects.Components.TextureCrop#setTexture - * @since 3.0.0 - * - * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|number)} [frame] - The name or index of the frame within the Texture. - * - * @return {this} This Game Object instance. - */ - setTexture: function (key, frame) - { - this.texture = this.scene.sys.textures.get(key); - - return this.setFrame(frame); - }, - - /** - * Sets the frame this Game Object will use to render with. - * - * If you pass a string or index then the Frame has to belong to the current Texture being used - * by this Game Object. - * - * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * - * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * - * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. - * - * @method Phaser.GameObjects.Components.TextureCrop#setFrame - * @since 3.0.0 - * - * @param {(string|number|Phaser.Textures.Frame)} frame - The name or index of the frame within the Texture, or a Frame instance. - * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? - * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? - * - * @return {this} This Game Object instance. - */ - setFrame: function (frame, updateSize, updateOrigin) - { - if (updateSize === undefined) { updateSize = true; } - if (updateOrigin === undefined) { updateOrigin = true; } - - if (frame instanceof Frame) - { - this.texture = this.scene.sys.textures.get(frame.texture.key); - - this.frame = frame; - } - else - { - this.frame = this.texture.get(frame); - } - - if (!this.frame.cutWidth || !this.frame.cutHeight) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - - if (this._sizeComponent && updateSize) - { - this.setSizeToFrame(); - } - - if (this._originComponent && updateOrigin) - { - if (this.frame.customPivot) - { - this.setOrigin(this.frame.pivotX, this.frame.pivotY); - } - else - { - this.updateDisplayOrigin(); - } - } - - if (this.isCropped) - { - this.frame.updateCropUVs(this._crop, this.flipX, this.flipY); - } - - return this; - }, - - /** - * Internal method that returns a blank, well-formed crop object for use by a Game Object. - * - * @method Phaser.GameObjects.Components.TextureCrop#resetCropObject - * @private - * @since 3.12.0 - * - * @return {object} The crop object. - */ - resetCropObject: function () - { - return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 }; - } - -}; - -module.exports = TextureCrop; - - -/***/ }), -/* 338 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for setting the tint of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Tint - * @webglOnly - * @since 3.0.0 - */ - -var Tint = { - - /** - * The tint value being applied to the top-left vertice of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. - * - * @name Phaser.GameObjects.Components.Tint#tintTopLeft - * @type {number} - * @default 0xffffff - * @since 3.0.0 - */ - tintTopLeft: 0xffffff, - - /** - * The tint value being applied to the top-right vertice of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. - * - * @name Phaser.GameObjects.Components.Tint#tintTopRight - * @type {number} - * @default 0xffffff - * @since 3.0.0 - */ - tintTopRight: 0xffffff, - - /** - * The tint value being applied to the bottom-left vertice of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomLeft - * @type {number} - * @default 0xffffff - * @since 3.0.0 - */ - tintBottomLeft: 0xffffff, - - /** - * The tint value being applied to the bottom-right vertice of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomRight - * @type {number} - * @default 0xffffff - * @since 3.0.0 - */ - tintBottomRight: 0xffffff, - - /** - * The tint fill mode. - * - * `false` = An additive tint (the default), where vertices colors are blended with the texture. - * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. - * - * @name Phaser.GameObjects.Components.Tint#tintFill - * @type {boolean} - * @default false - * @since 3.11.0 - */ - tintFill: false, - - /** - * Clears all tint values associated with this Game Object. - * - * Immediately sets the color values back to 0xffffff and the tint type to 'additive', - * which results in no visible change to the texture. - * - * @method Phaser.GameObjects.Components.Tint#clearTint - * @webglOnly - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - clearTint: function () - { - this.setTint(0xffffff); - - return this; - }, - - /** - * Sets an additive tint on this Game Object. - * - * The tint works by taking the pixel color values from the Game Objects texture, and then - * multiplying it by the color value of the tint. You can provide either one color value, - * in which case the whole Game Object will be tinted in that color. Or you can provide a color - * per corner. The colors are blended together across the extent of the Game Object. - * - * To modify the tint color once set, either call this method again with new values or use the - * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, - * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * - * To remove a tint call `clearTint`. - * - * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. - * - * @method Phaser.GameObjects.Components.Tint#setTint - * @webglOnly - * @since 3.0.0 - * - * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. - * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. - * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. - * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. - * - * @return {this} This Game Object instance. - */ - setTint: function (topLeft, topRight, bottomLeft, bottomRight) - { - if (topLeft === undefined) { topLeft = 0xffffff; } - - if (topRight === undefined) - { - topRight = topLeft; - bottomLeft = topLeft; - bottomRight = topLeft; - } - - this.tintTopLeft = topLeft; - this.tintTopRight = topRight; - this.tintBottomLeft = bottomLeft; - this.tintBottomRight = bottomRight; - - this.tintFill = false; - - return this; - }, - - /** - * Sets a fill-based tint on this Game Object. - * - * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture - * with those in the tint. You can use this for effects such as making a player flash 'white' - * if hit by something. You can provide either one color value, in which case the whole - * Game Object will be rendered in that color. Or you can provide a color per corner. The colors - * are blended together across the extent of the Game Object. - * - * To modify the tint color once set, either call this method again with new values or use the - * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, - * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * - * To remove a tint call `clearTint`. - * - * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. - * - * @method Phaser.GameObjects.Components.Tint#setTintFill - * @webglOnly - * @since 3.11.0 - * - * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. - * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. - * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. - * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. - * - * @return {this} This Game Object instance. - */ - setTintFill: function (topLeft, topRight, bottomLeft, bottomRight) - { - this.setTint(topLeft, topRight, bottomLeft, bottomRight); - - this.tintFill = true; - - return this; - }, - - /** - * The tint value being applied to the whole of the Game Object. - * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. - * - * @name Phaser.GameObjects.Components.Tint#tint - * @type {number} - * @webglOnly - * @since 3.0.0 - */ - tint: { - - set: function (value) - { - this.setTint(value, value, value, value); - } - }, - - /** - * Does this Game Object have a tint applied? - * - * It checks to see if the 4 tint properties are set to the value 0xffffff - * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. - * - * @name Phaser.GameObjects.Components.Tint#isTinted - * @type {boolean} - * @webglOnly - * @readonly - * @since 3.11.0 - */ - isTinted: { - - get: function () - { - var white = 0xffffff; - - return ( - this.tintFill || - this.tintTopLeft !== white || - this.tintTopRight !== white || - this.tintBottomLeft !== white || - this.tintBottomRight !== white - ); - } - - } - -}; - -module.exports = Tint; - - -/***/ }), -/* 339 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var NOOP = __webpack_require__(1); -var renderWebGL = NOOP; -var renderCanvas = NOOP; - -if (false) -{} - -if (true) +var Extend = function () { - renderCanvas = __webpack_require__(340); -} + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; -module.exports = { + // Handle a deep copy situation + if (typeof target === 'boolean') + { + deep = target; + target = arguments[1] || {}; - renderWebGL: renderWebGL, - renderCanvas: renderCanvas + // skip the boolean and the target + i = 2; + } + // extend Phaser if only one argument is passed + if (length === i) + { + target = this; + --i; + } + + for (; i < length; i++) + { + // Only deal with non-null/undefined values + if ((options = arguments[i]) != null) + { + // Extend the base object + for (name in options) + { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target === copy) + { + continue; + } + + // Recurse if we're merging plain objects or arrays + if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) + { + if (copyIsArray) + { + copyIsArray = false; + clone = src && Array.isArray(src) ? src : []; + } + else + { + clone = src && IsPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = Extend(deep, clone, copy); + + // Don't bring in undefined values + } + else if (copy !== undefined) + { + target[name] = copy; + } + } + } + } + + // Return the modified object + return target; }; +module.exports = Extend; + /***/ }), -/* 340 */ -/***/ (function(module, exports) { + +/***/ 8361: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH = __webpack_require__(4675); +var GetValue = __webpack_require__(5851); + +/** + * Retrieves a value from an object. Allows for more advanced selection options, including: + * + * Allowed types: + * + * Implicit + * { + * x: 4 + * } + * + * From function + * { + * x: function () + * } + * + * Randomly pick one element from the array + * { + * x: [a, b, c, d, e, f] + * } + * + * Random integer between min and max: + * { + * x: { randInt: [min, max] } + * } + * + * Random float between min and max: + * { + * x: { randFloat: [min, max] } + * } + * + * + * @function Phaser.Utils.Objects.GetAdvancedValue + * @since 3.0.0 + * + * @param {object} source - The object to retrieve the value from. + * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. + * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. + * + * @return {*} The value of the requested key. + */ +var GetAdvancedValue = function (source, key, defaultValue) +{ + var value = GetValue(source, key, null); + + if (value === null) + { + return defaultValue; + } + else if (Array.isArray(value)) + { + return MATH.RND.pick(value); + } + else if (typeof value === 'object') + { + if (value.hasOwnProperty('randInt')) + { + return MATH.RND.integerInRange(value.randInt[0], value.randInt[1]); + } + else if (value.hasOwnProperty('randFloat')) + { + return MATH.RND.realInRange(value.randFloat[0], value.randFloat[1]); + } + } + else if (typeof value === 'function') + { + return value(key); + } + + return value; +}; + +module.exports = GetAdvancedValue; + + +/***/ }), + +/***/ 4597: +/***/ ((module) => { /** * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> * @copyright 2013-2023 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * Renders this Game Object with the Canvas Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. + * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue} * - * @method Phaser.GameObjects.Container#renderCanvas - * @since 3.4.0 - * @private + * @function Phaser.Utils.Objects.GetFastValue + * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + * @param {object} source - The object to search + * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods) + * @param {*} [defaultValue] - The default value to use if the key does not exist. + * + * @return {*} The value if found; otherwise, defaultValue (null if none provided) */ -var ContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) +var GetFastValue = function (source, key, defaultValue) { - camera.addToRenderList(container); + var t = typeof(source); - var children = container.list; - - if (children.length === 0) + if (!source || t === 'number' || t === 'string') { - return; + return defaultValue; } - - var transformMatrix = container.localTransform; - - if (parentMatrix) + else if (source.hasOwnProperty(key) && source[key] !== undefined) { - transformMatrix.loadIdentity(); - transformMatrix.multiply(parentMatrix); - transformMatrix.translate(container.x, container.y); - transformMatrix.rotate(container.rotation); - transformMatrix.scale(container.scaleX, container.scaleY); + return source[key]; } else { - transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); - } - - var containerHasBlendMode = (container.blendMode !== -1); - - if (!containerHasBlendMode) - { - // If Container is SKIP_TEST then set blend mode to be Normal - renderer.setBlendMode(0); - } - - var alpha = container._alpha; - var scrollFactorX = container.scrollFactorX; - var scrollFactorY = container.scrollFactorY; - - if (container.mask) - { - container.mask.preRenderCanvas(renderer, null, camera); - } - - for (var i = 0; i < children.length; i++) - { - var child = children[i]; - - if (!child.willRender(camera)) - { - continue; - } - - var childAlpha = child.alpha; - var childScrollFactorX = child.scrollFactorX; - var childScrollFactorY = child.scrollFactorY; - - if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode) - { - // If Container doesn't have its own blend mode, then a child can have one - renderer.setBlendMode(child.blendMode); - } - - // Set parent values - child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); - child.setAlpha(childAlpha * alpha); - - // Render - child.renderCanvas(renderer, child, camera, transformMatrix); - - // Restore original values - child.setAlpha(childAlpha); - child.setScrollFactor(childScrollFactorX, childScrollFactorY); - } - - if (container.mask) - { - container.mask.postRenderCanvas(renderer); + return defaultValue; } }; -module.exports = ContainerCanvasRenderer; +module.exports = GetFastValue; /***/ }), -/* 341 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 5851: +/***/ ((module) => { /** * @author Richard Davey @@ -47365,173 +51399,283 @@ module.exports = ContainerCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(28); - /** - * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union. + * Retrieves a value from an object, or an alternative object, falling to a back-up default value if not found. * - * @function Phaser.Geom.Rectangle.Union + * The key is a string, which can be split based on the use of the period character. + * + * For example: + * + * ```javascript + * const source = { + * lives: 3, + * render: { + * screen: { + * width: 1024 + * } + * } + * } + * + * const lives = GetValue(source, 'lives', 1); + * const width = GetValue(source, 'render.screen.width', 800); + * const height = GetValue(source, 'render.screen.height', 600); + * ``` + * + * In the code above, `lives` will be 3 because it's defined at the top level of `source`. + * The `width` value will be 1024 because it can be found inside the `render.screen` object. + * The `height` value will be 600, the default value, because it is missing from the `render.screen` object. + * + * @function Phaser.Utils.Objects.GetValue * @since 3.0.0 * - * @generic {Phaser.Geom.Rectangle} O - [out,$return] + * @param {object} source - The primary object to try to retrieve the value from. If not found in here, `altSource` is checked. + * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. + * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. + * @param {object} [altSource] - An alternative object to retrieve the value from. If the property exists in `source` then `altSource` will not be used. * - * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to use. - * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to use. - * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the union in. - * - * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided. + * @return {*} The value of the requested key. */ -var Union = function (rectA, rectB, out) +var GetValue = function (source, key, defaultValue, altSource) { - if (out === undefined) { out = new Rectangle(); } - - // Cache vars so we can use one of the input rects as the output rect - var x = Math.min(rectA.x, rectB.x); - var y = Math.min(rectA.y, rectB.y); - var w = Math.max(rectA.right, rectB.right) - x; - var h = Math.max(rectA.bottom, rectB.bottom) - y; - - return out.setTo(x, y, w, h); -}; - -module.exports = Union; - - -/***/ }), -/* 342 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var renderWebGL = __webpack_require__(1); -var renderCanvas = __webpack_require__(1); - -if (false) -{} - -if (true) -{ - renderCanvas = __webpack_require__(343); -} - -module.exports = { - - renderWebGL: renderWebGL, - renderCanvas: renderCanvas - -}; - - -/***/ }), -/* 343 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Renders this Game Object with the Canvas Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * @method Phaser.GameObjects.Container#renderCanvas - * @since 3.4.0 - * @private - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - */ -var SpineContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) -{ - var children = container.list; - - if (children.length === 0) + if ((!source && !altSource) || typeof source === 'number') { - return; + return defaultValue; } - - camera.addToRenderList(container); - - var transformMatrix = container.localTransform; - - if (parentMatrix) + else if (source && source.hasOwnProperty(key)) { - transformMatrix.loadIdentity(); - transformMatrix.multiply(parentMatrix); - transformMatrix.translate(container.x, container.y); - transformMatrix.rotate(container.rotation); - transformMatrix.scale(container.scaleX, container.scaleY); + return source[key]; + } + else if (altSource && altSource.hasOwnProperty(key)) + { + return altSource[key]; + } + else if (key.indexOf('.') !== -1) + { + var keys = key.split('.'); + var parentA = source; + var parentB = altSource; + var valueA = defaultValue; + var valueB = defaultValue; + var valueAFound = true; + var valueBFound = true; + + // Use for loop here so we can break early + for (var i = 0; i < keys.length; i++) + { + if (parentA && parentA.hasOwnProperty(keys[i])) + { + // Yes parentA has a key property, let's carry on down + valueA = parentA[keys[i]]; + parentA = parentA[keys[i]]; + } + else + { + valueAFound = false; + } + + if (parentB && parentB.hasOwnProperty(keys[i])) + { + // Yes parentB has a key property, let's carry on down + valueB = parentB[keys[i]]; + parentB = parentB[keys[i]]; + } + else + { + valueBFound = false; + } + } + + if (valueAFound) + { + return valueA; + } + else if (valueBFound) + { + return valueB; + } + else + { + return defaultValue; + } } else { - transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); - } - - var containerHasBlendMode = (container.blendMode !== -1); - - if (!containerHasBlendMode) - { - // If Container is SKIP_TEST then set blend mode to be Normal - renderer.setBlendMode(0); - } - - var alpha = container._alpha; - var scrollFactorX = container.scrollFactorX; - var scrollFactorY = container.scrollFactorY; - - if (container.mask) - { - container.mask.preRenderCanvas(renderer, null, camera); - } - - for (var i = 0; i < children.length; i++) - { - var child = children[i]; - - if (!child.willRender(camera)) - { - continue; - } - - var childAlpha = child.alpha; - var childScrollFactorX = child.scrollFactorX; - var childScrollFactorY = child.scrollFactorY; - - if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode) - { - // If Container doesn't have its own blend mode, then a child can have one - renderer.setBlendMode(child.blendMode); - } - - // Set parent values - child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); - child.setAlpha(childAlpha * alpha); - - // Render - child.renderCanvas(renderer, child, camera, transformMatrix); - - // Restore original values - child.setAlpha(childAlpha); - child.setScrollFactor(childScrollFactorX, childScrollFactorY); - } - - if (container.mask) - { - container.mask.postRenderCanvas(renderer); + return defaultValue; } }; -module.exports = SpineContainerCanvasRenderer; +module.exports = GetValue; + + +/***/ }), + +/***/ 2482: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * This is a slightly modified version of jQuery.isPlainObject. + * A plain object is an object whose internal class property is [object Object]. + * + * @function Phaser.Utils.Objects.IsPlainObject + * @since 3.0.0 + * + * @param {object} obj - The object to inspect. + * + * @return {boolean} `true` if the object is plain, otherwise `false`. + */ +var IsPlainObject = function (obj) +{ + // Not plain objects: + // - Any object or value whose internal [[Class]] property is not "[object Object]" + // - DOM nodes + // - window + if (!obj || typeof(obj) !== 'object' || obj.nodeType || obj === obj.window) + { + return false; + } + + // Support: Firefox <20 + // The try/catch suppresses exceptions thrown when attempting to access + // the "constructor" property of certain host objects, ie. |window.location| + // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 + try + { + if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf')) + { + return false; + } + } + catch (e) + { + return false; + } + + // If the function hasn't returned already, we're confident that + // |obj| is a plain object, created by {} or constructed with new Object + return true; +}; + +module.exports = IsPlainObject; + + +/***/ }), + +/***/ 7222: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes the given string and pads it out, to the length required, using the character + * specified. For example if you need a string to be 6 characters long, you can call: + * + * `pad('bob', 6, '-', 2)` + * + * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right. + * + * You can also use it to pad numbers (they are always returned as strings): + * + * `pad(512, 6, '0', 1)` + * + * Would return: `000512` with the string padded to the left. + * + * If you don't specify a direction it'll pad to both sides: + * + * `pad('c64', 7, '*')` + * + * Would return: `**c64**` + * + * @function Phaser.Utils.String.Pad + * @since 3.0.0 + * + * @param {string|number|object} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. + * @param {number} [len=0] - The number of characters to be added. + * @param {string} [pad=" "] - The string to pad it out with (defaults to a space). + * @param {number} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). + * + * @return {string} The padded string. + */ +var Pad = function (str, len, pad, dir) +{ + if (len === undefined) { len = 0; } + if (pad === undefined) { pad = ' '; } + if (dir === undefined) { dir = 3; } + + str = str.toString(); + + var padlen = 0; + + if (len + 1 >= str.length) + { + switch (dir) + { + case 1: + str = new Array(len + 1 - str.length).join(pad) + str; + break; + + case 3: + var right = Math.ceil((padlen = len - str.length) / 2); + var left = padlen - right; + str = new Array(left + 1).join(pad) + str + new Array(right + 1).join(pad); + break; + + default: + str = str + new Array(len + 1 - str.length).join(pad); + break; + } + } + + return str; +}; + +module.exports = Pad; /***/ }) -/******/ ]); \ No newline at end of file + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module is referenced by other modules so it can't be inlined +/******/ var __webpack_exports__ = __webpack_require__(4513); +/******/ window.SpinePlugin = __webpack_exports__; +/******/ +/******/ })() +; \ No newline at end of file diff --git a/plugins/spine4.1/dist/SpineCanvasPlugin.min.js b/plugins/spine4.1/dist/SpineCanvasPlugin.min.js index 40bf0282f..c56389e49 100644 --- a/plugins/spine4.1/dist/SpineCanvasPlugin.min.js +++ b/plugins/spine4.1/dist/SpineCanvasPlugin.min.js @@ -1,1254 +1 @@ -window.SpinePlugin=function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=69)}([function(t,e){function i(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||! -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function n(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,e,s,r){for(var o in e)if(e.hasOwnProperty(o)){var h=i(e,o,s);if(!1!==h){if(n((r||t).prototype,o)){if(a.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=e[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(34),r=new n({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new r(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return s(this.x,t.x,e)&&s(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});r.ZERO=new r,r.RIGHT=new r(1,0),r.LEFT=new r(-1,0),r.UP=new r(0,-1),r.DOWN=new r(0,1),r.ONE=new r(1,1),t.exports=r},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=i},function(t,e){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e){t.exports=function(t,e,i,n){var s=t.length;if(e<0||e>s||e>=i||i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e){t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},function(t,e){t.exports=function(t,e,i,n){if(!t&&!n||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(n&&n.hasOwnProperty(e))return n[e];if(-1!==e.indexOf(".")){for(var s=e.split("."),r=t,a=n,o=i,h=i,l=!0,u=!0,c=0;c=t.length)){for(var i=t.length-1,n=t[e],s=e;s - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(29),r=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=s.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=r},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=new(i(0))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new n(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,n=t.y,s=t.z,r=e.x,a=e.y,o=e.z;return this.x=n*o-s*a,this.y=s*r-i*o,this.z=i*a-n*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,a=t.z;return this.x=i*a-n*r,this.y=n*s-e*a,this.z=e*r-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this},applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=s[0]*e+s[3]*i+s[6]*n,this.y=s[1]*e+s[4]*i+s[7]*n,this.z=s[2]*e+s[5]*i+s[8]*n,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=1/(s[3]*e+s[7]*i+s[11]*n+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*n+s[12])*r,this.y=(s[1]*e+s[5]*i+s[9]*n+s[13])*r,this.z=(s[2]*e+s[6]*i+s[10]*n+s[14])*r,this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+n*s[6],this.y=e*s[1]+i*s[4]+n*s[7],this.z=e*s[2]+i*s[5]+n*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12],this.y=s[1]*e+s[5]*i+s[9]*n+s[13],this.z=s[2]*e+s[6]*i+s[10]*n+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=e*s[0]+i*s[4]+n*s[8]+s[12],a=e*s[1]+i*s[5]+n*s[9]+s[13],o=e*s[2]+i*s[6]+n*s[10]+s[14],h=e*s[3]+i*s[7]+n*s[11]+s[15];return this.x=r/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,a=t.z,o=t.w,h=o*e+r*n-a*i,l=o*i+a*e-s*n,u=o*n+s*i-r*e,c=-s*e-r*i-a*n;return this.x=h*o+c*-s+l*-a-u*-r,this.y=l*o+c*-r+u*-s-h*-a,this.z=u*o+c*-a+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],a=s[1],o=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],m=s[10],g=s[11],x=s[12],v=s[13],y=s[14],w=1/(e*h+i*d+n*g+s[15]);return this.x=(e*r+i*l+n*f+x)*w,this.y=(e*a+i*u+n*p+v)*w,this.z=(e*o+i*c+n*m+y)*w,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,a=this.x-i,o=r-this.y-1-n,h=this.z;return this.x=2*a/s-1,this.y=2*o/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});n.ZERO=new n,n.RIGHT=new n(1,0,0),n.LEFT=new n(-1,0,0),n.UP=new n(0,-1,0),n.DOWN=new n(0,1,0),n.FORWARD=new n(0,0,1),n.BACK=new n(0,0,-1),n.ONE=new n(1,1,1),t.exports=n},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(26),s=i(61);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=s(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=s(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n,s=i(27),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(n=navigator.userAgent,/Edg\/\d+/.test(n)?(r.edge=!0,r.es2019=!0):/OPR/.test(n)?(r.opera=!0,r.es2019=!0):/Chrome\/(\d+)/.test(n)&&!s.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10),r.es2019=r.chromeVersion>69):/Firefox\D+(\d+)/.test(n)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10),r.es2019=r.firefoxVersion>10):/AppleWebKit/.test(n)&&s.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+) Safari/.test(n)&&!s.windowsPhone?(r.safari=!0,r.safariVersion=parseInt(RegExp.$1,10),r.es2019=r.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(r.silk=!0),r)},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(6),s=function(){var t,e,i,r,a,o,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(3);t.exports=function(t){return t>Math.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e){t.exports=function(t,e){return Math.random()*(e-t)+t}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(3);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(14),r=new n({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new r(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,n,s,r,a,o,h,l,u,c,d,f,p,m){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=n,g[4]=s,g[5]=r,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=u,g[11]=c,g[12]=d,g[13]=f,g[14]=p,g[15]=m,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var n=a.fromQuat(i).val,s=e.x,r=e.y,o=e.z;return this.setValues(n[0]*s,n[1]*s,n[2]*s,0,n[4]*r,n[5]*r,n[6]*r,0,n[8]*o,n[9]*o,n[10]*o,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=n,t[13]=r,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15],x=e*a-i*r,v=e*o-n*r,y=e*h-s*r,w=i*o-n*a,b=i*h-s*a,M=n*h-s*o,A=l*p-u*f,S=l*m-c*f,k=l*g-d*f,E=u*m-c*p,T=u*g-d*p,I=c*g-d*m,R=x*I-v*T+y*E+w*k-b*S+M*A;return R?(R=1/R,this.setValues((a*I-o*T+h*E)*R,(n*T-i*I-s*E)*R,(p*M-m*b+g*w)*R,(c*b-u*M-d*w)*R,(o*k-r*I-h*S)*R,(e*I-n*k+s*S)*R,(m*y-f*M-g*v)*R,(l*M-c*y+d*v)*R,(r*T-a*k+h*A)*R,(i*k-e*T-s*A)*R,(f*b-p*y+g*x)*R,(u*y-l*b-d*x)*R,(a*S-r*E-o*A)*R,(e*E-i*S+n*A)*R,(p*v-f*w-m*x)*R,(l*w-u*v+c*x)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return this.setValues(a*(c*g-d*m)-u*(o*g-h*m)+p*(o*d-h*c),-(i*(c*g-d*m)-u*(n*g-s*m)+p*(n*d-s*c)),i*(o*g-h*m)-a*(n*g-s*m)+p*(n*h-s*o),-(i*(o*d-h*c)-a*(n*d-s*c)+u*(n*h-s*o)),-(r*(c*g-d*m)-l*(o*g-h*m)+f*(o*d-h*c)),e*(c*g-d*m)-l*(n*g-s*m)+f*(n*d-s*c),-(e*(o*g-h*m)-r*(n*g-s*m)+f*(n*h-s*o)),e*(o*d-h*c)-r*(n*d-s*c)+l*(n*h-s*o),r*(u*g-d*p)-l*(a*g-h*p)+f*(a*d-h*u),-(e*(u*g-d*p)-l*(i*g-s*p)+f*(i*d-s*u)),e*(a*g-h*p)-r*(i*g-s*p)+f*(i*h-s*a),-(e*(a*d-h*u)-r*(i*d-s*u)+l*(i*h-s*a)),-(r*(u*m-c*p)-l*(a*m-o*p)+f*(a*c-o*u)),e*(u*m-c*p)-l*(i*m-n*p)+f*(i*c-n*u),-(e*(a*m-o*p)-r*(i*m-n*p)+f*(i*o-n*a)),e*(a*c-o*u)-r*(i*c-n*u)+l*(i*o-n*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return(e*a-i*r)*(c*g-d*m)-(e*o-n*r)*(u*g-d*p)+(e*h-s*r)*(u*m-c*p)+(i*o-n*a)*(l*g-d*f)-(i*h-s*a)*(l*m-c*f)+(n*h-s*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],m=e[13],g=e[14],x=e[15],v=t.val,y=v[0],w=v[1],b=v[2],M=v[3];return e[0]=y*i+w*a+b*u+M*p,e[1]=y*n+w*o+b*c+M*m,e[2]=y*s+w*h+b*d+M*g,e[3]=y*r+w*l+b*f+M*x,y=v[4],w=v[5],b=v[6],M=v[7],e[4]=y*i+w*a+b*u+M*p,e[5]=y*n+w*o+b*c+M*m,e[6]=y*s+w*h+b*d+M*g,e[7]=y*r+w*l+b*f+M*x,y=v[8],w=v[9],b=v[10],M=v[11],e[8]=y*i+w*a+b*u+M*p,e[9]=y*n+w*o+b*c+M*m,e[10]=y*s+w*h+b*d+M*g,e[11]=y*r+w*l+b*f+M*x,y=v[12],w=v[13],b=v[14],M=v[15],e[12]=y*i+w*a+b*u+M*p,e[13]=y*n+w*o+b*c+M*m,e[14]=y*s+w*h+b*d+M*g,e[15]=y*r+w*l+b*f+M*x,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,n=e.val,s=i[0],r=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],f=i[6],p=i[10],m=i[14],g=i[3],x=i[7],v=i[11],y=i[15],w=n[0],b=n[4],M=n[8],A=n[12],S=n[1],k=n[5],E=n[9],T=n[13],I=n[2],R=n[6],C=n[10],F=n[14],P=n[3],Y=n[7],O=n[11],L=n[15];return this.setValues(s*w+r*S+a*I+o*P,h*w+l*S+u*I+c*P,d*w+f*S+p*I+m*P,g*w+x*S+v*I+y*P,s*b+r*k+a*R+o*Y,h*b+l*k+u*R+c*Y,d*b+f*k+p*R+m*Y,g*b+x*k+v*R+y*Y,s*M+r*E+a*C+o*O,h*M+l*E+u*C+c*O,d*M+f*E+p*C+m*O,g*M+x*E+v*C+y*O,s*A+r*T+a*F+o*L,h*A+l*T+u*F+c*L,d*A+f*T+p*F+m*L,g*A+x*T+v*F+y*L)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var n=this.val;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var n=this.val;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),s=1-i,r=t.x,a=t.y,o=t.z,h=s*r,l=s*a;return this.setValues(h*r+i,h*a-n*o,h*o+n*a,0,h*a+n*o,l*a+i,l*o-n*r,0,h*o-n*a,l*o+n*r,s*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,a=Math.sqrt(n*n+s*s+r*r);if(Math.abs(a)<1e-6)return this;n*=a=1/a,s*=a,r*=a;var o=Math.sin(t),h=Math.cos(t),l=1-h,u=i[0],c=i[1],d=i[2],f=i[3],p=i[4],m=i[5],g=i[6],x=i[7],v=i[8],y=i[9],w=i[10],b=i[11],M=i[12],A=i[13],S=i[14],k=i[15],E=n*n*l+h,T=s*n*l+r*o,I=r*n*l-s*o,R=n*s*l-r*o,C=s*s*l+h,F=r*s*l+n*o,P=n*r*l+s*o,Y=s*r*l-n*o,O=r*r*l+h;return this.setValues(u*E+p*T+v*I,c*E+m*T+y*I,d*E+g*T+w*I,f*E+x*T+b*I,u*R+p*C+v*F,c*R+m*C+y*F,d*R+g*C+w*F,f*R+x*C+b*F,u*P+p*Y+v*O,c*P+m*Y+y*O,d*P+g*Y+w*O,f*P+x*Y+b*O,M,A,S,k)},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],a=e[6],o=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=a*n+u*i,e[7]=o*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-a*i,e[11]=c*n-o*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],a=e[2],o=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=a*n-u*i,e[3]=o*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=a*i+u*n,e[11]=o*i+c*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],a=e[2],o=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=a*n+u*i,e[3]=o*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-a*i,e[7]=c*n-o*i,this},fromRotationTranslation:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,a=i+i,o=n+n,h=s+s,l=i*a,u=i*o,c=i*h,d=n*o,f=n*h,p=s*h,m=r*a,g=r*o,x=r*h;return this.setValues(1-(d+p),u+x,c-g,0,u-x,1-(l+p),f+m,0,c+g,f-m,1-(l+d),0,e.x,e.y,e.z,1)},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,s=t.w,r=e+e,a=i+i,o=n+n,h=e*r,l=e*a,u=e*o,c=i*a,d=i*o,f=n*o,p=s*r,m=s*a,g=s*o;return this.setValues(1-(c+f),l+g,u-m,0,l-g,1-(h+f),d+p,0,u+m,d-p,1-(h+c),0,0,0,0,1)},frustum:function(t,e,i,n,s,r){var a=1/(e-t),o=1/(n-i),h=1/(s-r);return this.setValues(2*s*a,0,0,0,0,2*s*o,0,0,(e+t)*a,(n+i)*o,(r+s)*h,-1,0,0,r*s*2*h,0)},perspective:function(t,e,i,n){var s=1/Math.tan(t/2),r=1/(i-n);return this.setValues(s/e,0,0,0,0,s,0,0,0,0,(n+i)*r,-1,0,0,2*n*i*r,0)},perspectiveLH:function(t,e,i,n){return this.setValues(2*i/t,0,0,0,0,2*i/e,0,0,0,0,-n/(i-n),1,0,0,i*n/(i-n),0)},ortho:function(t,e,i,n,s,r){var a=t-e,o=i-n,h=s-r;return a=0===a?a:1/a,o=0===o?o:1/o,h=0===h?h:1/h,this.setValues(-2*a,0,0,0,0,-2*o,0,0,0,0,2*h,0,(t+e)*a,(n+i)*o,(r+s)*h,1)},lookAtRH:function(t,e,i){var n=this.val;return u.subVectors(t,e),0===u.getLengthSquared()&&(u.z=1),u.normalize(),h.crossVectors(i,u),0===h.getLengthSquared()&&(1===Math.abs(i.z)?u.x+=1e-4:u.z+=1e-4,u.normalize(),h.crossVectors(i,u)),h.normalize(),l.crossVectors(u,h),n[0]=h.x,n[1]=h.y,n[2]=h.z,n[4]=l.x,n[5]=l.y,n[6]=l.z,n[8]=u.x,n[9]=u.y,n[10]=u.z,this},lookAt:function(t,e,i){var n=t.x,s=t.y,r=t.z,a=i.x,o=i.y,h=i.z,l=e.x,u=e.y,c=e.z;if(Math.abs(n-l)<1e-6&&Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6)return this.identity();var d=n-l,f=s-u,p=r-c,m=1/Math.sqrt(d*d+f*f+p*p),g=o*(p*=m)-h*(f*=m),x=h*(d*=m)-a*p,v=a*f-o*d;(m=Math.sqrt(g*g+x*x+v*v))?(g*=m=1/m,x*=m,v*=m):(g=0,x=0,v=0);var y=f*v-p*x,w=p*g-d*v,b=d*x-f*g;return(m=Math.sqrt(y*y+w*w+b*b))?(y*=m=1/m,w*=m,b*=m):(y=0,w=0,b=0),this.setValues(g,y,d,0,x,w,f,0,v,b,p,0,-(g*n+x*s+v*r),-(y*n+w*s+b*r),-(d*n+f*s+p*r),1)},yawPitchRoll:function(t,e,i){this.zero(),a.zero(),o.zero();var n=this.val,s=a.val,r=o.val,h=Math.sin(i),l=Math.cos(i);return n[10]=1,n[15]=1,n[0]=l,n[1]=h,n[4]=-h,n[5]=l,h=Math.sin(e),l=Math.cos(e),s[0]=1,s[15]=1,s[5]=l,s[10]=l,s[9]=-h,s[6]=h,h=Math.sin(t),l=Math.cos(t),r[5]=1,r[15]=1,r[0]=l,r[2]=-h,r[8]=h,r[10]=l,this.multiplyLocal(a),this.multiplyLocal(o),this},setWorldMatrix:function(t,e,i,n,s){return this.yawPitchRoll(t.y,t.x,t.z),a.scaling(i.x,i.y,i.z),o.xyz(e.x,e.y,e.z),this.multiplyLocal(a),this.multiplyLocal(o),n&&this.multiplyLocal(n),s&&this.multiplyLocal(s),this},multiplyToMat4:function(t,e){var i=this.val,n=t.val,s=i[0],r=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=i[6],c=i[7],d=i[8],f=i[9],p=i[10],m=i[11],g=i[12],x=i[13],v=i[14],y=i[15],w=n[0],b=n[1],M=n[2],A=n[3],S=n[4],k=n[5],E=n[6],T=n[7],I=n[8],R=n[9],C=n[10],F=n[11],P=n[12],Y=n[13],O=n[14],L=n[15];return e.setValues(w*s+b*h+M*d+A*g,b*r+b*l+M*f+A*x,M*a+b*u+M*p+A*v,A*o+b*c+M*m+A*y,S*s+k*h+E*d+T*g,S*r+k*l+E*f+T*x,S*a+k*u+E*p+T*v,S*o+k*c+E*m+T*y,I*s+R*h+C*d+F*g,I*r+R*l+C*f+F*x,I*a+R*u+C*p+F*v,I*o+R*c+C*m+F*y,P*s+Y*h+O*d+L*g,P*r+Y*l+O*f+L*x,P*a+Y*u+O*p+L*v,P*o+Y*c+O*m+L*y)},fromRotationXYTranslation:function(t,e,i){var n=e.x,s=e.y,r=e.z,a=Math.sin(t.x),o=Math.cos(t.x),h=Math.sin(t.y),l=Math.cos(t.y),u=n,c=s,d=r,f=-a,p=0-f*h,m=0-o*h,g=f*l,x=o*l;return i||(u=l*n+h*r,c=p*n+o*s+g*r,d=m*n+a*s+x*r),this.setValues(l,p,m,0,0,o,a,0,h,g,x,0,u,c,d,1)},getMaxScaleOnAxis:function(){var t=this.val,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}}),a=new r,o=new r,h=new s,l=new s,u=new s;t.exports=r},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(3);t.exports=function(t){return t*n.RAD_TO_DEG}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={ADDED_TO_SCENE:i(187),BOOT:i(188),CREATE:i(189),DESTROY:i(190),PAUSE:i(191),POST_UPDATE:i(192),PRE_RENDER:i(193),PRE_UPDATE:i(194),READY:i(195),REMOVED_FROM_SCENE:i(196),RENDER:i(197),RESUME:i(198),SHUTDOWN:i(199),SLEEP:i(200),START:i(201),TRANSITION_COMPLETE:i(202),TRANSITION_INIT:i(203),TRANSITION_OUT:i(204),TRANSITION_START:i(205),TRANSITION_WAKE:i(206),UPDATE:i(207),WAKE:i(208)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(9),r=i(47),a=i(8),o=i(48),h=i(49),l=i(221),u=i(50),c=new n({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var n=a(e,"url");void 0===n?n=t.path+i+"."+a(e,"extension",""):"string"!=typeof n||n.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(n=t.path+n),this.url=n,this.src="",this.xhrSettings=u(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?s.FILE_POPULATED:s.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===s.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=s.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,n=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(n=!1),this.state=s.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,n)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==s.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(r.FILE_COMPLETE,e,i,t),this.loader.emit(r.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=s.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={},n={install:function(t){for(var e in i)t[e]=i[e]},register:function(t,e){i[t]=e},destroy:function(){i={}}};t.exports=n},function(t,e){t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return i;var t=navigator.userAgent;/Windows/.test(t)?i.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(i.iOS=!0,i.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),i.iOSVersion=parseInt(RegExp.$1,10)):i.macOS=!0:/Android/.test(t)?i.android=!0:/Linux/.test(t)?i.linux=!0:/iP[ao]d|iPhone/i.test(t)?(i.iOS=!0,navigator.appVersion.match(/OS (\d+)/),i.iOSVersion=parseInt(RegExp.$1,10),i.iPhone=-1!==t.toLowerCase().indexOf("iphone"),i.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?i.kindle=!0:/CrOS/.test(t)&&(i.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(i.android=!1,i.iOS=!1,i.macOS=!1,i.windows=!0,i.windowsPhone=!0);var n=/Silk/.test(t);return(i.windows||i.macOS||i.linux&&!n||i.chromeOS)&&(i.desktop=!0),(i.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(i.desktop=!1),navigator.standalone&&(i.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(i.cordova=!0),void 0!==window.ejecta&&(i.ejecta=!0)),void 0!==e&&e.versions&&e.versions.node&&(i.node=!0),i.node&&"object"==typeof e.versions&&(i.nodeWebkit=!!e.versions["node-webkit"],i.electron=!!e.versions.electron),/Crosswalk/.test(t)&&(i.crosswalk=!0),i.pixelRatio=window.devicePixelRatio||1,i}()}).call(this,i(298))},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(316),r=i(66),a=i(317),o=i(29),h=i(318),l=i(323),u=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},function(t,e){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},function(t,e){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(13);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(13);t.exports=function(t){return n(t,-180,180)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e) - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(36);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e){t.exports=function(t,e,i,n,s){var r=.5*(n-e),a=.5*(s-i),o=t*t;return(2*i-2*n+r+a)*(t*o)+(-3*i+3*n-2*r-a)*o+r*t+i}},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),a=t.x-e,o=t.y-i;return t.x=a*s-o*r+e,t.y=a*r+o*s+i,t}},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(2);t.exports=function(t,e,i,s,r,a,o,h){void 0===h&&(h=new n);var l=Math.sin(r),u=Math.cos(r),c=u*a,d=l*a,f=-l*o,p=u*o,m=1/(c*p+f*-d);return h.x=p*m*t+-f*m*e+(s*f-i*p)*m,h.y=c*m*e+-d*m*t+(-s*c+i*d)*m,h}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*r-a*h,c=-l*s+a*o,d=h*s-r*o,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(a*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*o)*f,t[5]=(-a*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(r*e-i*s)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=r*l-a*h,t[1]=n*h-i*l,t[2]=i*a-n*r,t[3]=a*o-s*l,t[4]=e*l-n*o,t[5]=n*s-e*a,t[6]=s*h-r*o,t[7]=i*o-e*h,t[8]=e*r-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*r-a*h)+i*(-l*s+a*o)+n*(h*s-r*o)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],m=c[3],g=c[4],x=c[5],v=c[6],y=c[7],w=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*a+p*l,e[2]=d*s+f*o+p*u,e[3]=m*i+g*r+x*h,e[4]=m*n+g*a+x*l,e[5]=m*s+g*o+x*u,e[6]=v*i+y*r+w*h,e[7]=v*n+y*a+w*l,e[8]=v*s+y*o+w*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*a,e[2]=l*s+h*o,e[3]=l*r-h*i,e[4]=l*a-h*n,e[5]=l*o-h*s,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,s=t.w,r=e+e,a=i+i,o=n+n,h=e*r,l=e*a,u=e*o,c=i*a,d=i*o,f=n*o,p=s*r,m=s*a,g=s*o,x=this.val;return x[0]=1-(c+f),x[3]=l+g,x[6]=u-m,x[1]=l-g,x[4]=1-(h+f),x[7]=d+p,x[2]=u+m,x[5]=d-p,x[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],m=e[12],g=e[13],x=e[14],v=e[15],y=n*h-s*o,w=n*l-r*o,b=n*u-a*o,M=s*l-r*h,A=s*u-a*h,S=r*u-a*l,k=c*g-d*m,E=c*x-f*m,T=c*v-p*m,I=d*x-f*g,R=d*v-p*g,C=f*v-p*x,F=y*C-w*R+b*I+M*T-A*E+S*k;return F?(F=1/F,i[0]=(h*C-l*R+u*I)*F,i[1]=(l*T-o*C-u*E)*F,i[2]=(o*R-h*T+u*k)*F,i[3]=(r*R-s*C-a*I)*F,i[4]=(n*C-r*T+a*E)*F,i[5]=(s*T-n*R-a*k)*F,i[6]=(g*S-x*A+v*M)*F,i[7]=(x*b-m*S-v*w)*F,i[8]=(m*A-g*b+v*y)*F,this):null}});t.exports=n},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(44),r=i(1),a=i(14),o=new Int8Array([1,2,0]),h=new Float32Array([0,0,0]),l=new a(1,0,0),u=new a(0,1,0),c=new a,d=new s,f=new n({initialize:function(t,e,i,n){this.onChangeCallback=r,this.set(t,e,i,n)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,n,s){return void 0===s&&(s=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=n||0),s&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return s>0&&(s=1/Math.sqrt(s),this._x=t*s,this._y=e*s,this._z=i*s,this._w=n*s),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.set(i+e*(t.x-i),n+e*(t.y-n),s+e*(t.z-s),r+e*(t.w-r))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(c.copy(l).cross(t).length()<1e-6&&c.copy(u).cross(t),c.normalize(),this.setAxisAngle(c,Math.PI)):i>.999999?this.set(0,0,0,1):(c.copy(t).cross(e),this._x=c.x,this._y=c.y,this._z=c.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var n=d.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(d).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+s*r+i*o-n*a,i*h+s*a+n*r-e*o,n*h+s*o+e*a-i*r,s*h-e*r-i*a-n*o)},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,a=t.x,o=t.y,h=t.z,l=t.w,u=i*a+n*o+s*h+r*l;u<0&&(u=-u,a=-a,o=-o,h=-h,l=-l);var c=1-e,d=e;if(1-u>1e-6){var f=Math.acos(u),p=Math.sin(f);c=Math.sin((1-e)*f)/p,d=Math.sin(e*f)/p}return this.set(c*i+d*a,c*n+d*o,c*s+d*h,c*r+d*l)},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n,r=s?1/s:0;return this.set(-t*r,-e*r,-i*r,n*r)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a+s*r,i*a+n*r,n*a-i*r,s*a-e*r)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a-n*r,i*a+s*r,n*a+e*r,s*a-i*r)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*r,i*a-e*r,n*a+s*r,s*a-n*r)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,n=t.y/2,s=t.z/2,r=Math.cos(i),a=Math.cos(n),o=Math.cos(s),h=Math.sin(i),l=Math.sin(n),u=Math.sin(s);switch(t.order){case"XYZ":this.set(h*a*o+r*l*u,r*l*o-h*a*u,r*a*u+h*l*o,r*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+r*l*u,r*l*o-h*a*u,r*a*u-h*l*o,r*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-r*l*u,r*l*o+h*a*u,r*a*u+h*l*o,r*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-r*l*u,r*l*o+h*a*u,r*a*u-h*l*o,r*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+r*l*u,r*l*o+h*a*u,r*a*u-h*l*o,r*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-r*l*u,r*l*o-h*a*u,r*a*u+h*l*o,r*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,n=i[0],s=i[4],r=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=n+o+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(r-l)*e,(a-s)*e,.25/e)):n>o&&n>c?(e=2*Math.sqrt(1+n-o-c),this.set(.25*e,(s+a)/e,(r+l)/e,(u-h)/e)):o>c?(e=2*Math.sqrt(1+o-n-c),this.set((s+a)/e,.25*e,(h+u)/e,(r-l)/e)):(e=2*Math.sqrt(1+c-n-o),this.set((r+l)/e,(h+u)/e,.25*e,(a-s)/e)),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var r=o[s],a=o[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*a+a]+1),h[s]=.5*e,e=.5/e,h[r]=(i[3*r+s]+i[3*s+r])*e,h[a]=(i[3*a+s]+i[3*s+a])*e,this._x=h[0],this._y=h[1],this._z=h[2],this._w=(i[3*a+r]-i[3*r+a])*e}return this.onChangeCallback(this),this}});t.exports=f},function(t,e){(function(){"use strict";var e=(()=>{var t=Object.defineProperty,e=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,s={};((e,i)=>{for(var n in i)t(e,n,{get:i[n],enumerable:!0})})(s,{AlphaTimeline:()=>ft,Animation:()=>I,AnimationState:()=>Ct,AnimationStateAdapter:()=>Ot,AnimationStateData:()=>Nt,AssetManager:()=>bi,AssetManagerBase:()=>ue,AtlasAttachmentLoader:()=>re,Attachment:()=>b,AttachmentTimeline:()=>gt,BinaryInput:()=>Ye,BlendMode:()=>Ce,Bone:()=>he,BoneData:()=>ae,BoundingBoxAttachment:()=>Ut,CURRENT:()=>Vt,CanvasTexture:()=>wi,ClippingAttachment:()=>qt,Color:()=>h,ConstraintData:()=>le,CurveTimeline:()=>Q,CurveTimeline1:()=>J,CurveTimeline2:()=>tt,DebugUtils:()=>g,DeformTimeline:()=>xt,Downloader:()=>ce,DrawOrderTimeline:()=>bt,Event:()=>de,EventData:()=>fe,EventQueue:()=>Pt,EventTimeline:()=>yt,EventType:()=>Yt,FIRST:()=>Dt,FakeTexture:()=>$t,HOLD_FIRST:()=>_t,HOLD_MIX:()=>zt,HOLD_SUBSEQUENT:()=>Xt,IkConstraint:()=>pe,IkConstraintData:()=>me,IkConstraintTimeline:()=>Mt,IntSet:()=>r,Interpolation:()=>c,MathUtils:()=>u,MeshAttachment:()=>te,MixBlend:()=>R,MixDirection:()=>C,PathAttachment:()=>ee,PathConstraint:()=>be,PathConstraintData:()=>ge,PathConstraintMixTimeline:()=>Et,PathConstraintPositionTimeline:()=>St,PathConstraintSpacingTimeline:()=>kt,PointAttachment:()=>ie,Pool:()=>x,PositionMode:()=>xe,Pow:()=>d,PowOut:()=>f,RGB2Timeline:()=>mt,RGBA2Timeline:()=>pt,RGBATimeline:()=>ct,RGBTimeline:()=>dt,RegionAttachment:()=>se,RotateMode:()=>ye,RotateTimeline:()=>et,SETUP:()=>Bt,SUBSEQUENT:()=>Lt,ScaleTimeline:()=>rt,ScaleXTimeline:()=>at,ScaleYTimeline:()=>ot,SequenceTimeline:()=>It,ShearTimeline:()=>ht,ShearXTimeline:()=>lt,ShearYTimeline:()=>ut,Skeleton:()=>ke,SkeletonBinary:()=>Pe,SkeletonBounds:()=>ui,SkeletonClipping:()=>di,SkeletonData:()=>Ee,SkeletonJson:()=>fi,SkeletonRenderer:()=>Si,Skin:()=>Ie,SkinEntry:()=>Te,Slot:()=>Me,SlotData:()=>Re,SpacingMode:()=>ve,StringSet:()=>a,Texture:()=>Wt,TextureAtlas:()=>Kt,TextureAtlasPage:()=>Qt,TextureAtlasRegion:()=>Jt,TextureFilter:()=>Gt,TextureRegion:()=>jt,TextureWrap:()=>Ht,TimeKeeper:()=>y,Timeline:()=>Z,TrackEntry:()=>Ft,TransformConstraint:()=>Ae,TransformConstraintData:()=>Fe,TransformConstraintTimeline:()=>At,TransformMode:()=>oe,TranslateTimeline:()=>it,TranslateXTimeline:()=>nt,TranslateYTimeline:()=>st,Triangulator:()=>ci,Utils:()=>m,Vector2:()=>v,VertexAttachment:()=>A,WindowedMean:()=>w});var r=class{constructor(){this.array=new Array}add(t){let e=this.contains(t);return this.array[0|t]=0|t,!e}contains(t){return null!=this.array[0|t]}remove(t){this.array[0|t]=void 0}clear(){this.array.length=0}},a=class{constructor(){this.entries={},this.size=0}add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var i=0,n=t.length;i1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}static fromString(t){return(new o).setFromString(t)}},h=o;h.WHITE=new o(1,1,1,1),h.RED=new o(1,0,0,1),h.GREEN=new o(0,1,0,1),h.BLUE=new o(0,0,1,1),h.MAGENTA=new o(1,0,1,1);var l=class{static clamp(t,e,i){return ti?i:t}static cosDeg(t){return Math.cos(t*l.degRad)}static sinDeg(t){return Math.sin(t*l.degRad)}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return l.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,i){let n=Math.random(),s=e-t;return n<=(i-t)/s?t+Math.sqrt(n*s*(i-t)):e-Math.sqrt((1-n)*s*(e-i))}static isPowerOfTwo(t){return t&&0==(t&t-1)}},u=l;u.PI=3.1415927,u.PI2=2*l.PI,u.radiansToDegrees=180/l.PI,u.radDeg=l.radiansToDegrees,u.degreesToRadians=l.PI/180,u.degRad=l.degreesToRadians;var c=class{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}},d=class extends c{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}},f=class extends d{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}},p=class{static arrayCopy(t,e,i,n,s){for(let r=e,a=n;r=e?t:p.setArraySize(t,e,i)}static newArray(t,e){let i=new Array(t);for(let n=0;n0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},w=class{constructor(t=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let e=0;e>1)*r;let a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(!l){o.length>0&&(h=o);let a=t.bone,l=a.worldX,u=a.worldY,c=a.a,d=a.b,f=a.c,p=a.d;for(let t=e,a=s;a=this.regions.length&&(i=this.regions.length-1);let n=this.regions[i];e.region!=n&&(e.region=n,e.updateRegion())}getPath(t,e){let i=t,n=(this.start+e).toString();for(let t=this.digits-n.length;t>0;t--)i+="0";return i+=n,i}static nextID(){return S._nextID++}},k=S;k._nextID=0;var E=(t=>(t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse",t))(E||{}),T=[0,1,2,3,4,5,6],I=class{constructor(t,e,i){if(this.timelines=[],this.timelineIds=new a,!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=i}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e0&&(e%=this.duration));let h=this.timelines;for(let n=0,l=h.length;n(t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add",t))(R||{}),C=(t=>(t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut",t))(C||{}),F=0,P=1,Y=2,O=3,L=4,D=5,X=6,_=7,z=8,B=9,V=10,N=11,U=12,q=13,W=14,G=15,H=16,j=17,$=18,K=19,Z=class{constructor(t,e){this.propertyIds=e,this.frames=m.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let i=t.length;for(let n=1;ne)return n-1;return i-1}static search(t,e,i){let n=t.length;for(let s=i;se)return s-i;return n-i}},Q=class extends Z{constructor(t,e,i){super(t,i),this.curves=m.newFloatArray(t+18*e),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+18*t;if(this.curves.length>e){let t=m.newFloatArray(e);m.arrayCopy(this.curves,0,t,0,e),this.curves=t}}setBezier(t,e,i,n,s,r,a,o,h,l,u){let c=this.curves,d=this.getFrameCount()+18*t;0==i&&(c[e]=2+d);let f=.03*(n-2*r+o),p=.03*(s-2*a+h),m=.006*(3*(r-o)-n+l),g=.006*(3*(a-h)-s+u),x=2*f+m,v=2*p+g,y=.3*(r-n)+f+.16666667*m,w=.3*(a-s)+p+.16666667*g,b=n+y,M=s+w;for(let t=d+18;dt){let r=this.frames[e],a=this.frames[e+i];return a+(t-r)/(s[n]-r)*(s[n+1]-a)}let r=n+18;for(n+=2;n=t){let e=s[n-2],i=s[n-1];return i+(t-e)/(s[n]-e)*(s[n+1]-i)}e+=this.getFrameEntries();let a=s[r-2],o=s[r-1];return o+(t-a)/(this.frames[e]-a)*(this.frames[e+i]-o)}},J=class extends Q{constructor(t,e,i){super(t,e,[i])}getFrameEntries(){return 2}setFrame(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+1]=i}getCurveValue(t){let e=this.frames,i=e.length-2;for(let n=2;n<=i;n+=2)if(e[n]>t){i=n-2;break}let n=this.curves[i>>1];switch(n){case 0:let n=e[i],s=e[i+1];return s+(t-n)/(e[i+2]-n)*(e[i+2+1]-s);case 1:return e[i+1]}return this.getBezierValue(t,i,1,n-2)}},tt=class extends Q{constructor(t,e,i,n){super(t,e,[i,n])}getFrameEntries(){return 3}setFrame(t,e,i,n){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=n}},et=class extends J{constructor(t,e,i){super(t,e,F+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,n,s,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i>2];switch(p){case 0:let t=h[f];u=h[f+1],c=h[f+2],d=h[f+3];let e=(i-t)/(h[f+4]-t);u+=(h[f+4+1]-u)*e,c+=(h[f+4+2]-c)*e,d+=(h[f+4+3]-d)*e;break;case 1:u=h[f+1],c=h[f+2],d=h[f+3];break;default:u=this.getBezierValue(i,f,1,p-2),c=this.getBezierValue(i,f,2,p+18-2),d=this.getBezierValue(i,f,3,p+36-2)}if(1==s)l.r=u,l.g=c,l.b=d;else{if(0==r){let t=o.data.color;l.r=t.r,l.g=t.g,l.b=t.b}l.r+=(u-l.r)*s,l.g+=(c-l.g)*s,l.b+=(d-l.b)*s}}},ft=class extends J{constructor(t,e,i){super(t,e,z+"|"+i),this.slotIndex=0,this.slotIndex=i}apply(t,e,i,n,s,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.color;if(i>3];switch(y){case 0:let t=h[v];c=h[v+1],d=h[v+2],f=h[v+3],p=h[v+4],m=h[v+5],g=h[v+6],x=h[v+7];let e=(i-t)/(h[v+8]-t);c+=(h[v+8+1]-c)*e,d+=(h[v+8+2]-d)*e,f+=(h[v+8+3]-f)*e,p+=(h[v+8+4]-p)*e,m+=(h[v+8+5]-m)*e,g+=(h[v+8+6]-g)*e,x+=(h[v+8+7]-x)*e;break;case 1:c=h[v+1],d=h[v+2],f=h[v+3],p=h[v+4],m=h[v+5],g=h[v+6],x=h[v+7];break;default:c=this.getBezierValue(i,v,1,y-2),d=this.getBezierValue(i,v,2,y+18-2),f=this.getBezierValue(i,v,3,y+36-2),p=this.getBezierValue(i,v,4,y+54-2),m=this.getBezierValue(i,v,5,y+72-2),g=this.getBezierValue(i,v,6,y+90-2),x=this.getBezierValue(i,v,7,y+108-2)}if(1==s)l.set(c,d,f,p),u.r=m,u.g=g,u.b=x;else{if(0==r){l.setFromColor(o.data.color);let t=o.data.darkColor;u.r=t.r,u.g=t.g,u.b=t.b}l.add((c-l.r)*s,(d-l.g)*s,(f-l.b)*s,(p-l.a)*s),u.r+=(m-u.r)*s,u.g+=(g-u.g)*s,u.b+=(x-u.b)*s}}},mt=class extends Q{constructor(t,e,i){super(t,e,[_+"|"+i,B+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,n,s,r,a,o){t*=7,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=n,this.frames[t+3]=s,this.frames[t+4]=r,this.frames[t+5]=a,this.frames[t+6]=o}apply(t,e,i,n,s,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,u=o.darkColor;if(it){let s=this.frames[e];return i[n+1]*(t-s)/(i[n]-s)}let s=n+18;for(n+=2;n=t){let e=i[n-2],s=i[n-1];return s+(t-e)/(i[n]-e)*(i[n+1]-s)}let r=i[s-2],a=i[s-1];return a+(1-a)*(t-r)/(this.frames[e+this.getFrameEntries()]-r)}apply(t,e,i,n,s,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.getAttachment();if(!h)return;if(!(h instanceof A)||h.timelineAttachment!=this.attachment)return;let l=o.deform;0==l.length&&(r=0);let u=this.vertices,c=u[0].length,d=this.frames;if(i=d[d.length-1]){let t=u[d.length-1];if(1==s)if(3==r){let e=h;if(e.bones)for(let e=0;ei)this.apply(t,e,Number.MAX_VALUE,n,s,r,a),e=-1;else if(e>=o[h-1])return;if(i0&&o[l-1]==t;)l--}for(;l=o[l];l++)n.push(this.events[l])}},yt=vt;yt.propertyIds=[""+U];var wt=class extends Z{constructor(t){super(t,wt.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,n,s,r,a){if(1==a)return void(0==r&&m.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));if(i>2];switch(f){case 0:let t=c[d];h=c[d+1],l=c[d+2],u=c[d+3];let e=(i-t)/(c[d+4]-t);h+=(c[d+4+1]-h)*e,l+=(c[d+4+2]-l)*e,u+=(c[d+4+3]-u)*e;break;case 1:h=c[d+1],l=c[d+2],u=c[d+3];break;default:h=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),u=this.getBezierValue(i,d,3,f+36-2)}if(0==r){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*s,o.mixX=t.mixX+(l-t.mixX)*s,o.mixY=t.mixY+(u-t.mixY)*s}else o.mixRotate+=(h-o.mixRotate)*s,o.mixX+=(l-o.mixX)*s,o.mixY+=(u-o.mixY)*s}},Tt=class extends Z{constructor(t,e,i){super(t,[K+"|"+e+"|"+i.sequence.id]),this.slotIndex=e,this.attachment=i}getFrameEntries(){return Tt.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,i,n,s){let r=this.frames;r[t*=Tt.ENTRIES]=e,r[t+Tt.MODE]=i|n<<4,r[t+Tt.DELAY]=s}apply(t,e,i,n,s,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.attachment,l=this.attachment;if(!(h==l||h instanceof A&&h.timelineAttachment==l))return;let u=this.frames;if(i>4,g=this.attachment.sequence.regions.length,x=T[15&f];if(0!=x)switch(m+=(i-d)/p+1e-5|0,x){case 1:m=Math.min(g-1,m);break;case 2:m%=g;break;case 3:{let t=(g<<1)-2;m=0==t?0:m%t,m>=g&&(m=t-m);break}case 4:m=Math.max(g-1-m,0);break;case 5:m=g-1-m%g;break;case 6:{let t=(g<<1)-2;m=0==t?0:(m+g-1)%t,m>=g&&(m=t-m)}}o.sequenceIndex=m}},It=Tt;It.ENTRIES=3,It.MODE=1,It.DELAY=2;var Rt=class{constructor(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Pt(this),this.propertyIDs=new a,this.animationsChanged=!1,this.trackEntryPool=new x(()=>new Ft),this.data=t}static emptyAnimation(){return Rt._emptyAnimation}update(t){t*=this.timeScale;let e=this.tracks;for(let i=0,n=e.length;i0){if(n.delay-=s,n.delay>0)continue;s=-n.delay,n.delay=0}let r=n.next;if(r){let e=n.trackLast-r.delay;if(e>=0){for(r.delay=0,r.trackTime+=0==n.timeScale?0:(e/n.timeScale+t)*r.timeScale,n.trackTime+=s,this.setCurrent(i,r,!0);r.mixingFrom;)r.mixTime+=t,r=r.mixingFrom;continue}}else if(n.trackLast>=n.trackEnd&&!n.mixingFrom){e[i]=null,this.queue.end(n),this.clearNext(n);continue}if(n.mixingFrom&&this.updateMixingFrom(n,t)){let t=n.mixingFrom;for(n.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}n.trackTime+=s}this.queue.drain()}updateMixingFrom(t,e){let i=t.mixingFrom;if(!i)return!0;let n=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,i=this.tracks,n=!1;for(let r=0,a=i.length;r0)continue;n=!0;let o=0==r?1:a.mixBlend,h=a.alpha;a.mixingFrom?h*=this.applyMixingFrom(a,t,o):a.trackTime>=a.trackEnd&&!a.next&&(h=0);let l=a.animationLast,u=a.getAnimationTime(),c=u,d=e;a.reverse&&(c=a.animation.duration-c,d=null);let f=a.animation.timelines,p=f.length;if(0==r&&1==h||3==o)for(let e=0;e1&&(s=1),1!=i&&(i=n.mixBlend));let r=s0&&this.queueEvents(n,d),this.events.length=0,n.nextAnimationLast=d,n.nextTrackLast=n.trackTime,s}applyAttachmentTimeline(t,e,i,n,s){var r=e.slots[t.slotIndex];r.bone.active&&(i0,n=t>=0;u.signum(e)!=u.signum(f)&&Math.abs(e)<=90&&(Math.abs(t)>180&&(t+=360*u.signum(t)),n=i),d=f+t-t%360,n!=i&&(d+=360*u.signum(t)),r[a]=d}r[a+1]=f,h.rotation=l+d*n}queueEvents(t,e){let i=t.animationStart,n=t.animationEnd,s=n-i,r=t.trackLast%s,a=this.events,o=0,h=a.length;for(;on||this.queue.event(t,e)}let l=!1;for(l=t.loop?0==s||r>t.trackTime%s:e>=n&&t.animationLast=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let i=e;for(;;){let t=i.mixingFrom;if(!t)break;this.queue.end(t),i.mixingFrom=null,i.mixingTo=null,i=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,i){let n=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,n&&(i&&this.queue.interrupt(n),e.mixingFrom=n,n.mixingTo=e,e.mixTime=0,n.mixingFrom&&n.mixDuration>0&&(e.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,i=!1){let n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,n,i)}setAnimationWith(t,e,i=!1){if(!e)throw new Error("animation cannot be null.");let n=!0,s=this.expandToIndex(t);s&&(-1==s.nextTrackLast?(this.tracks[t]=s.mixingFrom,this.queue.interrupt(s),this.queue.end(s),this.clearNext(s),s=s.mixingFrom,n=!1):this.clearNext(s));let r=this.trackEntry(t,e,i,s);return this.setCurrent(t,r,n),this.queue.drain(),r}addAnimation(t,e,i=!1,n=0){let s=this.data.skeletonData.findAnimation(e);if(!s)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,s,i,n)}addAnimationWith(t,e,i=!1,n=0){if(!e)throw new Error("animation cannot be null.");let s=this.expandToIndex(t);if(s)for(;s.next;)s=s.next;let r=this.trackEntry(t,e,i,s);return s?(s.next=r,r.previous=s,n<=0&&(n+=s.getTrackComplete()-r.mixDuration)):(this.setCurrent(t,r,!0),this.queue.drain()),r.delay=n,r}setEmptyAnimation(t,e=0){let i=this.setAnimationWith(t,Rt.emptyAnimation(),!1);return i.mixDuration=e,i.trackEnd=e,i}addEmptyAnimation(t,e=0,i=0){let n=this.addAnimationWith(t,Rt.emptyAnimation(),!1,i);return i<=0&&(n.delay+=n.mixDuration-e),n.mixDuration=e,n.trackEnd=e,n}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e0){s[o]=zt,r[o]=i;continue t}break}s[o]=_t}else s[o]=Lt}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},Ct=Rt;Ct._emptyAnimation=new I("",[],0);var Ft=class{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=2,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime(t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event",t))(Yt||{}),Ot=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}},Lt=0,Dt=1,Xt=2,_t=3,zt=4,Bt=1,Vt=2,Nt=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,i){let n=this.skeletonData.findAnimation(t);if(!n)throw new Error("Animation not found: "+t);let s=this.skeletonData.findAnimation(e);if(!s)throw new Error("Animation not found: "+e);this.setMixWith(n,s,i)}setMixWith(t,e,i){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let n=t.name+"."+e.name;this.animationToMixTime[n]=i}getMix(t,e){let i=t.name+"."+e.name,n=this.animationToMixTime[i];return void 0===n?this.defaultMix:n}},Ut=class extends A{constructor(t){super(t),this.color=new h(1,1,1,1)}copy(){let t=new Ut(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},qt=class extends A{constructor(t){super(t),this.endSlot=null,this.color=new h(.2275,.2275,.8078,1)}copy(){let t=new qt(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},Wt=class{constructor(t){this._image=t}getImage(){return this._image}},Gt=(t=>(t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear",t))(Gt||{}),Ht=(t=>(t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat",t))(Ht||{}),jt=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},$t=class extends Wt{setFilters(t,e){}setWraps(t,e){}dispose(){}},Kt=class{constructor(t){this.pages=new Array,this.regions=new Array;let e=new Zt(t),i=new Array(4),n={size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},format:()=>{},filter:t=>{t.minFilter=m.enumValue(Gt,i[1]),t.magFilter=m.enumValue(Gt,i[2])},repeat:t=>{-1!=i[1].indexOf("x")&&(t.uWrap=10497),-1!=i[1].indexOf("y")&&(t.vWrap=10497)},pma:t=>{t.pma="true"==i[1]}};var s={xy:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2])},size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},bounds:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2]),t.width=parseInt(i[3]),t.height=parseInt(i[4])},offset:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2])},orig:t=>{t.originalWidth=parseInt(i[1]),t.originalHeight=parseInt(i[2])},offsets:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2]),t.originalWidth=parseInt(i[3]),t.originalHeight=parseInt(i[4])},rotate:t=>{let e=i[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:t=>{t.index=parseInt(i[1])}};let r=e.readLine();for(;r&&0==r.trim().length;)r=e.readLine();for(;r&&0!=r.trim().length&&0!=e.readEntry(i,r);)r=e.readLine();let a=null,o=null,h=null;for(;null!==r;)if(0==r.trim().length)a=null,r=e.readLine();else if(a){let t=new Jt(a,r);for(;;){let n=e.readEntry(i,r=e.readLine());if(0==n)break;let a=s[i[0]];if(a)a(t);else{o||(o=[]),h||(h=[]),o.push(i[0]);let t=[];for(let e=0;e0&&h&&h.length>0&&(t.names=o,t.values=h,o=null,h=null),t.u=t.x/a.width,t.v=t.y/a.height,90==t.degrees?(t.u2=(t.x+t.height)/a.width,t.v2=(t.y+t.width)/a.height):(t.u2=(t.x+t.width)/a.width,t.v2=(t.y+t.height)/a.height),this.regions.push(t)}else{for(a=new Qt(r.trim());0!=e.readEntry(i,r=e.readLine());){let t=n[i[0]];t&&t(a)}this.pages.push(a)}}findRegion(t){for(let e=0;e=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;let i=e.indexOf(":");if(-1==i)return 0;t[0]=e.substr(0,i).trim();for(let n=1,s=i+1;;n++){let i=e.indexOf(",",s);if(-1==i)return t[n]=e.substr(s).trim(),n;if(t[n]=e.substr(s,i-s).trim(),s=i+1,4==n)return 4}}},Qt=class{constructor(t){this.minFilter=9728,this.magFilter=9728,this.uWrap=33071,this.vWrap=33071,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}},Jt=class extends jt{constructor(t,e){super(),this.x=0,this.y=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.index=0,this.degrees=0,this.names=null,this.values=null,this.page=t,this.name=e}},te=class extends A{constructor(t,e){super(t),this.region=null,this.regionUVs=[],this.uvs=[],this.triangles=[],this.color=new h(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=[],this.parentMesh=null,this.sequence=null,this.tempColor=new h(0,0,0,0),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=m.newFloatArray(t.length));let e=this.uvs,i=this.uvs.length,n=this.region.u,s=this.region.v,r=0,a=0;if(this.region instanceof Jt){let o=this.region,h=o.page.texture.getImage(),l=h.width,u=h.height;switch(o.degrees){case 90:n-=(o.originalHeight-o.offsetY-o.height)/l,s-=(o.originalWidth-o.offsetX-o.width)/u,r=o.originalHeight/l,a=o.originalWidth/u;for(let o=0;o= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}},oe=(t=>(t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection",t))(oe||{}),he=class{constructor(t,e,i){if(this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,n,s,r,a){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=n,this.ascaleY=s,this.ashearX=r,this.ashearY=a;let o=this.parent;if(!o){let o=this.skeleton,h=i+90+a,l=o.scaleX,c=o.scaleY;return this.a=u.cosDeg(i+r)*n*l,this.b=u.cosDeg(h)*s*l,this.c=u.sinDeg(i+r)*n*c,this.d=u.sinDeg(h)*s*c,this.worldX=t*l+o.x,void(this.worldY=e*c+o.y)}let h=o.a,l=o.b,c=o.c,d=o.d;switch(this.worldX=h*t+l*e+o.worldX,this.worldY=c*t+d*e+o.worldY,this.data.transformMode){case 0:{let t=i+90+a,e=u.cosDeg(i+r)*n,o=u.cosDeg(t)*s,f=u.sinDeg(i+r)*n,p=u.sinDeg(t)*s;return this.a=h*e+l*f,this.b=h*o+l*p,this.c=c*e+d*f,void(this.d=c*o+d*p)}case 1:{let t=i+90+a;this.a=u.cosDeg(i+r)*n,this.b=u.cosDeg(t)*s,this.c=u.sinDeg(i+r)*n,this.d=u.sinDeg(t)*s;break}case 2:{let t=h*h+c*c,e=0;t>1e-4?(t=Math.abs(h*d-l*c)/t,h/=this.skeleton.scaleX,c/=this.skeleton.scaleY,l=c*t,d=h*t,e=Math.atan2(c,h)*u.radDeg):(h=0,c=0,e=90-Math.atan2(d,l)*u.radDeg);let o=i+r-e,f=i+a-e+90,p=u.cosDeg(o)*n,m=u.cosDeg(f)*s,g=u.sinDeg(o)*n,x=u.sinDeg(f)*s;this.a=h*p-l*g,this.b=h*m-l*x,this.c=c*p+d*g,this.d=c*m+d*x;break}case 3:case 4:{let t=u.cosDeg(i),e=u.sinDeg(i),o=(h*t+l*e)/this.skeleton.scaleX,f=(c*t+d*e)/this.skeleton.scaleY,p=Math.sqrt(o*o+f*f);p>1e-5&&(p=1/p),o*=p,f*=p,p=Math.sqrt(o*o+f*f),3==this.data.transformMode&&h*d-l*c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let m=Math.PI/2+Math.atan2(f,o),g=Math.cos(m)*p,x=Math.sin(m)*p,v=u.cosDeg(r)*n,y=u.cosDeg(90+a)*s,w=u.sinDeg(r)*n,b=u.sinDeg(90+a)*s;this.a=o*v+g*w,this.b=o*y+g*b,this.c=f*v+x*w,this.d=f*y+x*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.c,this.a)*u.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*u.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){let t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*u.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*u.radDeg);let e=t.a,i=t.b,n=t.c,s=t.d,r=1/(e*s-i*n),a=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=a*s*r-o*i*r,this.ay=o*e*r-a*n*r;let h=r*s,l=r*e,c=r*i,d=r*n,f=h*this.a-c*this.c,p=h*this.b-c*this.d,m=l*this.c-d*this.a,g=l*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let t=f*g-p*m;this.ascaleY=t/this.ascaleX,this.ashearY=Math.atan2(f*p+m*g,t)*u.radDeg,this.arotation=Math.atan2(m,f)*u.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*u.radDeg}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),i=t.x-this.worldX,n=t.y-this.worldY;return t.x=i*this.d*e-n*this.b*e,t.y=n*this.a*e-i*this.c*e,t}localToWorld(t){let e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t}worldToLocalRotation(t){let e=u.sinDeg(t),i=u.cosDeg(t);return Math.atan2(this.a*e-this.c*i,this.d*i-this.b*e)*u.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=u.sinDeg(t),i=u.cosDeg(t);return Math.atan2(i*this.c+e*this.d,i*this.a+e*this.b)*u.radDeg}rotateWorld(t){let e=this.a,i=this.b,n=this.c,s=this.d,r=u.cosDeg(t),a=u.sinDeg(t);this.a=r*e-a*n,this.b=r*i-a*s,this.c=a*e+r*n,this.d=a*i+r*s}},le=class{constructor(t,e,i){this.name=t,this.order=e,this.skinRequired=i}},ue=class{constructor(t,e="",i=new ce){this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e,this.downloader=i}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,i){this.toLoad--,this.loaded++,this.assets[e]=i,t&&t(e,i)}error(t,e,i){this.toLoad--,this.loaded++,this.errors[e]=i,t&&t(e,i)}loadAll(){return new Promise((t,e)=>{let i=()=>{this.isLoadingComplete()?this.hasErrors()?e(this.errors):t(this):requestAnimationFrame(i)};requestAnimationFrame(i)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadBinary(t,i=>{this.success(e,t,i)},(e,n)=>{this.error(i,t,`Couldn't load binary ${t}: status ${e}, ${n}`)})}loadText(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadText(t,i=>{this.success(e,t,i)},(e,n)=>{this.error(i,t,`Couldn't load text ${t}: status ${e}, ${n}`)})}loadJson(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadJson(t,i=>{this.success(e,t,i)},(e,n)=>{this.error(i,t,`Couldn't load JSON ${t}: status ${e}, ${n}`)})}loadTexture(t,e=(()=>{}),i=(()=>{})){if(t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then(e=>e.ok?e.blob():(this.error(i,t,"Couldn't load image: "+t),null)).then(t=>t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(i=>{i&&this.success(e,t,this.textureLoader(i))});else{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{this.success(e,t,this.textureLoader(n))},n.onerror=()=>{this.error(i,t,"Couldn't load image: "+t)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),n.src=t}}loadTextureAtlas(t,e=(()=>{}),i=(()=>{}),n){let s=t.lastIndexOf("/"),r=s>=0?t.substring(0,s+1):"";t=this.start(t),this.downloader.downloadText(t,s=>{try{let a=new Kt(s),o=a.pages.length,h=!1;for(let s of a.pages)this.loadTexture(n?n[s.name]:r+s.name,(i,n)=>{h||(s.setTexture(n),0==--o&&this.success(e,t,a))},(e,n)=>{h||this.error(i,t,`Couldn't load texture atlas ${t} page image: ${e}`),h=!0})}catch(e){this.error(i,t,`Couldn't parse texture atlas ${t}: ${e.message}`)}},(e,n)=>{this.error(i,t,`Couldn't load texture atlas ${t}: status ${e}, ${n}`)})}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let e=this.assets[t];if(e)return e;let i=this.errors[t];throw Error("Asset not found: "+t+(i?"\n"+i:""))}remove(t){t=this.pathPrefix+t;let e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}removeAll(){for(let t in this.assets){let e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}isLoadingComplete(){return 0==this.toLoad}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},ce=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return-1!=e?(e+="base64,".length,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var e=window.atob(t),i=e.length,n=new Uint8Array(i),s=0;s{this.finish(t,n.status,n.responseText)};n.onload=s,n.onerror=s,n.send()}downloadJson(t,e,i){this.downloadText(t,t=>{e(JSON.parse(t))},i)}downloadBinary(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer";let s=()=>{this.finish(t,n.status,n.response)};n.onload=()=>{200==n.status||0==n.status?this.finish(t,200,new Uint8Array(n.response)):s()},n.onerror=s,n.send()}start(t,e,i){let n=this.callbacks[t];try{if(n)return!0;this.callbacks[t]=n=[]}finally{n.push(e,i)}}finish(t,e,i){let n=this.callbacks[t];delete this.callbacks[t];let s=200==e||0==e?[i]:[e,i];for(let t=s.length-1,e=n.length;t180?f-=360:f<-180&&(f+=360);let g=t.ascaleX,x=t.ascaleY;if(n||s){switch(t.data.transformMode){case 3:case 4:p=e-t.worldX,m=i-t.worldY}let o=t.data.length*g,h=Math.sqrt(p*p+m*m);if(n&&ho&&o>1e-4){let t=(h/o-1)*a+1;g*=t,r&&(x*=t)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*a,g,x,t.ashearX,t.ashearY)}apply2(t,e,i,n,s,r,a,o,h){let l=t.ax,c=t.ay,d=t.ascaleX,f=t.ascaleY,p=d,m=f,g=e.ascaleX,x=0,v=0,y=0;d<0?(d=-d,x=180,y=-1):(x=0,y=1),f<0&&(f=-f,y=-y),g<0?(g=-g,v=180):v=0;let w=e.ax,b=0,M=0,A=0,S=t.a,k=t.b,E=t.c,T=t.d,I=Math.abs(d-f)<=1e-4;!I||r?(b=0,M=S*w+t.worldX,A=E*w+t.worldY):(b=e.ay,M=S*w+k*b+t.worldX,A=E*w+T*b+t.worldY);let R=t.parent;if(!R)throw new Error("IK parent must itself have a parent.");S=R.a,k=R.b,E=R.c,T=R.d;let C,F,P=1/(S*T-k*E),Y=M-R.worldX,O=A-R.worldY,L=(Y*T-O*k)*P-l,D=(O*S-Y*E)*P-c,X=Math.sqrt(L*L+D*D),_=e.data.length*g;if(X<1e-4)return this.apply1(t,i,n,!1,r,!1,h),void e.updateWorldTransformWith(w,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);Y=i-R.worldX,O=n-R.worldY;let z=(Y*T-O*k)*P-l,B=(O*S-Y*E)*P-c,V=z*z+B*B;if(0!=o){o*=d*(g+1)*.5;let t=Math.sqrt(V),e=t-X-_*d+o;if(e>0){let i=Math.min(1,e/(2*o))-1;i=(e-o*(1-i*i))/t,z-=i*z,B-=i*B,V=z*z+B*B}}t:if(I){_*=d;let t=(V-X*X-_*_)/(2*X*_);t<-1?(t=-1,F=Math.PI*s):t>1?(t=1,F=0,r&&(S=(Math.sqrt(V)/(X+_)-1)*h+1,p*=S,a&&(m*=S))):F=Math.acos(t)*s,S=X+_*t,k=_*Math.sin(F),C=Math.atan2(B*S-z*k,z*S+B*k)}else{S=d*_,k=f*_;let t=S*S,e=k*k,i=Math.atan2(B,z);E=e*X*X+t*V-t*e;let n=-2*e*X,r=e-t;if(T=n*n-4*r*E,T>=0){let t=Math.sqrt(T);n<0&&(t=-t),t=.5*-(n+t);let e=t/r,a=E/t,o=Math.abs(e)=-1&&E<=1&&(E=Math.acos(E),Y=S*Math.cos(E)+X,O=k*Math.sin(E),T=Y*Y+O*O,Tm&&(c=E,m=T,p=Y,g=O)),V<=.5*(h+m)?(C=i-Math.atan2(l*s,o),F=a*s):(C=i-Math.atan2(g*s,p),F=c*s)}let N=Math.atan2(b,w)*y,U=t.arotation;C=(C-N)*u.radDeg+x-U,C>180?C-=360:C<-180&&(C+=360),t.updateWorldTransformWith(l,c,U+C*h,p,m,0,0),U=e.arotation,F=((F+N)*u.radDeg-e.ashearX)*y+v-U,F>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(w,b,U+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}},me=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},ge=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.positionMode=xe.Fixed,this.spacingMode=ve.Fixed,this.rotateMode=ye.Chain,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}},xe=(t=>(t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent",t))(xe||{}),ve=(t=>(t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional",t))(ve||{}),ye=(t=>(t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale",t))(ye||{}),we=class{constructor(t,e){if(this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0,n=t.bones.length;i0){t=l/t*f;for(let e=1;e0?u.degRad:-u.degRad}for(let t=0,s=3;t0){let i=h.a,n=h.b,a=h.c,o=h.d,l=0,d=0,f=0;if(l=r?p[s-1]:0==c[t+1]?p[s+2]:Math.atan2(w,m),l-=Math.atan2(a,i),y){d=Math.cos(l),f=Math.sin(l);let t=h.data.length;g+=(t*(d*i-f*a)-m)*e,x+=(t*(f*i+d*a)-w)*e}else l+=v;l>u.PI?l-=u.PI2:l<-u.PI&&(l+=u.PI2),l*=e,d=Math.cos(l),f=Math.sin(l),h.a=d*i-f*a,h.b=d*n-f*o,h.c=f*i+d*a,h.d=f*n+d*o}h.updateAppliedTransform()}}computeWorldPositions(t,e,i){let n=this.target,s=this.position,r=this.spaces,a=m.setArraySize(this.positions,3*e+2),o=this.world,h=t.closed,l=t.worldVerticesLength,u=l/6,c=we.NONE;if(!t.constantSpeed){let d=t.lengths;u-=h?1:2;let f,p=d[u];switch(1==this.data.positionMode&&(s*=p),this.data.spacingMode){case 2:f=p;break;case 3:f=p/e;break;default:f=1}o=m.setArraySize(this.world,8);for(let m=0,g=0,x=0;mp){c!=we.AFTER&&(c=we.AFTER,t.computeWorldVertices(n,l-6,4,o,0,2)),this.addAfterPosition(v-p,o,0,a,g);continue}}for(;;x++){let t=d[x];if(!(v>t)){if(0==x)v/=t;else{let e=d[x-1];v=(v-e)/(t-e)}break}}x!=c&&(c=x,h&&x==u?(t.computeWorldVertices(n,l-4,4,o,0,2),t.computeWorldVertices(n,0,4,o,4,2)):t.computeWorldVertices(n,6*x+2,8,o,0,2)),this.addCurvePosition(v,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],a,g,i||m>0&&0==e)}return a}h?(l+=2,o=m.setArraySize(this.world,l),t.computeWorldVertices(n,2,l-4,o,0,2),t.computeWorldVertices(n,0,2,o,l-4,2),o[l-2]=o[0],o[l-1]=o[1]):(u--,l-=4,o=m.setArraySize(this.world,l),t.computeWorldVertices(n,2,l,o,0,2));let d,f=m.setArraySize(this.curves,u),p=0,g=o[0],x=o[1],v=0,y=0,w=0,b=0,M=0,A=0,S=0,k=0,E=0,T=0,I=0,R=0,C=0,F=0;for(let t=0,e=2;tp){this.addAfterPosition(O-p,o,l-4,a,n);continue}}for(;;u++){let t=f[u];if(!(O>t)){if(0==u)O/=t;else{let e=f[u-1];O=(O-e)/(t-e)}break}}if(u!=c){c=u;let t=6*u;for(g=o[t],x=o[t+1],v=o[t+2],y=o[t+3],w=o[t+4],b=o[t+5],M=o[t+6],A=o[t+7],S=.03*(g-2*v+w),k=.03*(x-2*y+b),E=.006*(3*(v-w)-g+M),T=.006*(3*(y-b)-x+A),I=2*S+E,R=2*k+T,C=.3*(v-g)+S+.16666667*E,F=.3*(y-x)+k+.16666667*T,Y=Math.sqrt(C*C+F*F),P[0]=Y,t=1;t<8;t++)C+=I,F+=R,I+=E,R+=T,Y+=Math.sqrt(C*C+F*F),P[t]=Y;C+=I,F+=R,Y+=Math.sqrt(C*C+F*F),P[8]=Y,C+=I+E,F+=R+T,Y+=Math.sqrt(C*C+F*F),P[9]=Y,m=0}for(O*=Y;;m++){let t=P[m];if(!(O>t)){if(0==m)O/=t;else{let e=P[m-1];O=m+(O-e)/(t-e)}break}}this.addCurvePosition(.1*O,g,x,v,y,w,b,M,A,a,n,i||t>0&&0==e)}return a}addBeforePosition(t,e,i,n,s){let r=e[i],a=e[i+1],o=e[i+2]-r,h=e[i+3]-a,l=Math.atan2(h,o);n[s]=r+t*Math.cos(l),n[s+1]=a+t*Math.sin(l),n[s+2]=l}addAfterPosition(t,e,i,n,s){let r=e[i+2],a=e[i+3],o=r-e[i],h=a-e[i+1],l=Math.atan2(h,o);n[s]=r+t*Math.cos(l),n[s+1]=a+t*Math.sin(l),n[s+2]=l}addCurvePosition(t,e,i,n,s,r,a,o,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=i,void(l[u+2]=Math.atan2(s-i,n-e));let d=t*t,f=d*t,p=1-t,m=p*p,g=m*p,x=p*t,v=3*x,y=p*v,w=v*t,b=e*g+n*y+r*w+o*f,M=i*g+s*y+a*w+h*f;l[u]=b,l[u+1]=M,c&&(l[u+2]=t<.001?Math.atan2(s-i,n-e):Math.atan2(M-(i*m+s*x*2+a*d),b-(e*m+n*x*2+r*d)))}},be=we;be.NONE=-1,be.BEFORE=-2,be.AFTER=-3,be.epsilon=1e-5;var Me=class{constructor(t,e){if(this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new h,this.darkColor=t.darkColor?new h:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(t instanceof A&&this.attachment instanceof A&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},Ae=class{constructor(t,e){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new v,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(let i=0;i0?u.degRad:-u.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;fu.PI?r-=u.PI2:r<-u.PI&&(r+=u.PI2),r*=t;let a=Math.cos(r),o=Math.sin(r);x.a=a*e-o*n,x.b=a*i-o*s,x.c=o*e+a*n,x.d=o*i+a*s}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(t.x-x.worldX)*e,x.worldY+=(t.y-x.worldY)*i}if(0!=n){let t=Math.sqrt(x.a*x.a+x.c*x.c);0!=t&&(t=(t+(Math.sqrt(h*h+c*c)-t+this.data.offsetScaleX)*n)/t),x.a*=t,x.c*=t}if(0!=s){let t=Math.sqrt(x.b*x.b+x.d*x.d);0!=t&&(t=(t+(Math.sqrt(l*l+d*d)-t+this.data.offsetScaleY)*s)/t),x.b*=t,x.d*=t}if(r>0){let t=x.b,e=x.d,i=Math.atan2(e,t),n=Math.atan2(d,l)-Math.atan2(c,h)-(i-Math.atan2(x.c,x.a));n>u.PI?n-=u.PI2:n<-u.PI&&(n+=u.PI2),n=i+(n+m)*r;let s=Math.sqrt(t*t+e*e);x.b=Math.cos(n)*s,x.d=Math.sin(n)*s}x.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,n=this.mixScaleX,s=this.mixScaleY,r=this.mixShearY,a=0!=e||0!=i,o=this.target,h=o.a,l=o.b,c=o.c,d=o.d,f=h*d-l*c>0?u.degRad:-u.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;fu.PI?r-=u.PI2:r<-u.PI&&(r+=u.PI2),r*=t;let a=Math.cos(r),o=Math.sin(r);x.a=a*e-o*n,x.b=a*i-o*s,x.c=o*e+a*n,x.d=o*i+a*s}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=t.x*e,x.worldY+=t.y*i}if(0!=n){let t=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleX)*n+1;x.a*=t,x.c*=t}if(0!=s){let t=(Math.sqrt(l*l+d*d)-1+this.data.offsetScaleY)*s+1;x.b*=t,x.d*=t}if(r>0){let t=Math.atan2(d,l)-Math.atan2(c,h);t>u.PI?t-=u.PI2:t<-u.PI&&(t+=u.PI2);let e=x.b,i=x.d;t=Math.atan2(i,e)+(t-u.PI/2+m)*r;let n=Math.sqrt(e*e+i*i);x.b=Math.cos(t)*n,x.d=Math.sin(t)*n}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,n=this.mixScaleX,s=this.mixScaleY,r=this.mixShearY,a=this.target,o=this.bones;for(let h=0,l=o.length;h=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=i}addSkin(t){for(let e=0;e= 0.");if(!e)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}},Ce=(t=>(t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen",t))(Ce||{}),Fe=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Pe=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new Ee;i.name="";let n=new Ye(t),s=n.readInt32(),r=n.readInt32();i.hash=0==r&&0==s?null:r.toString(16)+s.toString(16),i.version=n.readString(),i.x=n.readFloat(),i.y=n.readFloat(),i.width=n.readFloat(),i.height=n.readFloat();let a=n.readBoolean();a&&(i.fps=n.readFloat(),i.imagesPath=n.readString(),i.audioPath=n.readString());let o=0;o=n.readInt(!0);for(let t=0;t>4,t.readFloat())}n.push(e);break}}}}}let r=t.readInt(!0);if(r>0){let e=new bt(r),s=i.slots.length;for(let i=0;i=0;t--)a[t]=-1;let o=m.newArray(s-r,0),h=0,l=0;for(let e=0;e=0;t--)-1==a[t]&&(a[t]=o[--l]);e.setFrame(i,n,a)}n.push(e)}let a=t.readInt(!0);if(a>0){let e=new yt(a);for(let n=0;n>>1^-(1&i)}readStringRef(){let t=this.readInt(!0);return 0==t?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&t)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(t),i++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return 0!=this.readByte()}},Oe=class{constructor(t,e,i,n,s){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=n,this.inheritTimeline=s}},Le=class{constructor(t=null,e=null){this.bones=t,this.vertices=e}},De=(t=>(t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping",t))(De||{});function Xe(t,e,i){let n=t.readFloat(),s=t.readFloat()*i;for(let r=0,a=0,o=e.getFrameCount()-1;e.setFrame(r,n,s),r!=o;r++){let o=t.readFloat(),h=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(r);break;case li:ze(t,e,a++,r,0,n,o,s,h,i)}n=o,s=h}return e}function _e(t,e,i){let n=t.readFloat(),s=t.readFloat()*i,r=t.readFloat()*i;for(let a=0,o=0,h=e.getFrameCount()-1;e.setFrame(a,n,s,r),a!=h;a++){let h=t.readFloat(),l=t.readFloat()*i,u=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(a);break;case li:ze(t,e,o++,a,0,n,h,s,l,i),ze(t,e,o++,a,1,n,h,r,u,i)}n=h,s=l,r=u}return e}function ze(t,e,i,n,s,r,a,o,h,l){e.setBezier(i,n,s,r,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,a,h)}var Be,Ve=0,Ne=1,Ue=2,qe=3,We=4,Ge=5,He=6,je=7,$e=8,Ke=9,Ze=0,Qe=1,Je=2,ti=3,ei=4,ii=5,ni=0,si=1,ri=0,ai=1,oi=2,hi=1,li=2,ui=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new x(()=>m.newFloatArray(16))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");let i=this.boundingBoxes,n=this.polygons,s=this.polygonPool,r=t.slots,a=r.length;i.length=0,s.freeAll(n),n.length=0;for(let t=0;t=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,i,n){let s=this.minX,r=this.minY,a=this.maxX,o=this.maxY;if(t<=s&&i<=s||e<=r&&n<=r||t>=a&&i>=a||e>=o&&n>=o)return!1;let h=(n-e)/(i-t),l=h*(s-t)+e;if(l>r&&lr&&ls&&us&&ut.minX&&this.minYt.minY}containsPoint(t,e){let i=this.polygons;for(let n=0,s=i.length;n=i||o=i){let h=n[t];h+(i-s)/(o-s)*(n[r]-h)=u&&x<=a||x>=a&&x<=u)&&(x>=e&&x<=n||x>=n&&x<=e)){let t=(l*m-h*f)/g;if((t>=c&&t<=d||t>=d&&t<=c)&&(t>=i&&t<=s||t>=s&&t<=i))return!0}u=a,c=d}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},ci=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new x(()=>new Array),this.polygonIndicesPool=new x(()=>new Array)}triangulate(t){let e=t,i=t.length>>1,n=this.indicesArray;n.length=0;for(let t=0;t3;){let t=i-1,a=0,o=1;for(;;){t:if(!s[a]){let r=n[t]<<1,h=n[a]<<1,l=n[o]<<1,u=e[r],c=e[r+1],d=e[h],f=e[h+1],p=e[l],m=e[l+1];for(let r=(o+1)%i;r!=t;r=(r+1)%i){if(!s[r])continue;let t=n[r]<<1,i=e[t],a=e[t+1];if(ci.positiveArea(p,m,u,c,i,a)&&ci.positiveArea(u,c,d,f,i,a)&&ci.positiveArea(d,f,p,m,i,a))break t}break}if(0==o){do{if(!s[a])break;a--}while(a>0);break}t=a,a=o,o=(o+1)%i}r.push(n[(i+a-1)%i]),r.push(n[a]),r.push(n[(a+1)%i]),n.splice(a,1),s.splice(a,1),i--;let h=(i+a-1)%i,l=a==i?0:a;s[h]=ci.isConcave(h,i,e,n),s[l]=ci.isConcave(l,i,e,n)}return 3==i&&(r.push(n[2]),r.push(n[0]),r.push(n[1])),r}decompose(t,e){let i=t,n=this.convexPolygons;this.polygonPool.freeAll(n),n.length=0;let s=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(s),s.length=0;let r=this.polygonIndicesPool.obtain();r.length=0;let a=this.polygonPool.obtain();a.length=0;let o=-1,h=0;for(let t=0,l=e.length;t0?(n.push(a),s.push(r)):(this.polygonPool.free(a),this.polygonIndicesPool.free(r)),a=this.polygonPool.obtain(),a.length=0,a.push(d),a.push(f),a.push(p),a.push(m),a.push(g),a.push(x),r=this.polygonIndicesPool.obtain(),r.length=0,r.push(l),r.push(u),r.push(c),h=ci.winding(d,f,p,m,g,x),o=l)}a.length>0&&(n.push(a),s.push(r));for(let t=0,e=n.length;t=0;t--)a=n[t],0==a.length&&(n.splice(t,1),this.polygonPool.free(a),r=s[t],s.splice(t,1),this.polygonIndicesPool.free(r));return n}static isConcave(t,e,i,n){let s=n[(e+t-1)%e]<<1,r=n[t]<<1,a=n[(t+1)%e]<<1;return!this.positiveArea(i[s],i[s+1],i[r],i[r+1],i[a],i[a+1])}static positiveArea(t,e,i,n,s,r){return t*(r-n)+i*(e-r)+s*(n-e)>=0}static winding(t,e,i,n,s,r){let a=i-t,o=n-e;return s*o-r*a+a*e-t*o>=0?1:-1}},di=class{constructor(){this.triangulator=new ci,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let i=e.worldVerticesLength,n=m.setArraySize(this.clippingPolygon,i);e.computeWorldVertices(t,0,i,n,0,2);let s=this.clippingPolygon;di.makeClockwise(s);let r=this.clippingPolygons=this.triangulator.decompose(s,this.triangulator.triangulate(s));for(let t=0,e=r.length;t>1,R=this.clipOutput,C=m.setArraySize(l,e+I*f);for(let h=0;h=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(i),h.push(n),h.push(s),h.push(r),h.push(t),h.push(e),o.length=0;let c=a,d=a.length-4;for(let t=0;;t+=2){let e=c[t],i=c[t+1],n=c[t+2],s=c[t+3],r=e-n,a=i-s,f=h,p=h.length-2,m=o.length;for(let t=0;t0;if(r*(l-s)-a*(h-n)>0){if(p){o.push(c),o.push(d);continue}let t=d-l,r=c-h,a=t*(n-e)-r*(s-i);if(Math.abs(a)>1e-6){let u=(r*(i-l)-t*(e-h))/a;o.push(e+(n-e)*u),o.push(i+(s-i)*u)}else o.push(e),o.push(i)}else if(p){let t=d-l,r=c-h,a=t*(n-e)-r*(s-i);if(Math.abs(a)>1e-6){let u=(r*(i-l)-t*(e-h))/a;o.push(e+(n-e)*u),o.push(i+(s-i)*u)}else o.push(e),o.push(i);o.push(c),o.push(d)}u=!0}if(m==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),t==d)break;let g=o;(o=h).length=0,h=g}if(l!=o){l.length=0;for(let t=0,e=o.length-2;t>1;t=0;e--)-1==o[e]&&(o[e]=t[--s])}e.setFrame(r,vi(a,"time",0),o)}s.push(e)}if(t.events){let e=new yt(t.events.length),n=0;for(let s=0;snew wi(t),t,e)}},Mi=m.newFloatArray(8),Ai=class{constructor(t){this.triangleRendering=!1,this.debugRendering=!1,this.vertices=m.newFloatArray(8192),this.tempColor=new h,this.ctx=t}draw(t){this.triangleRendering?this.drawTriangles(t):this.drawImages(t)}drawImages(t){let e=this.ctx,i=this.tempColor,n=t.color,s=t.drawOrder;this.debugRendering&&(e.strokeStyle="green");for(let t=0,r=s.length;t{if(r&&"object"==typeof r||"function"==typeof r)for(let h of i(r))n.call(s,h)||h===a||t(s,h,{get:()=>r[h],enumerable:!(o=e(r,h))||o.enumerable});return s})(t({},"__esModule",{value:!0}),yi)})();t.exports=e}).call(window)},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={ADD:i(211),COMPLETE:i(212),FILE_COMPLETE:i(213),FILE_KEY_COMPLETE:i(214),FILE_LOAD_ERROR:i(215),FILE_LOAD:i(216),FILE_PROGRESS:i(217),POST_PROCESS:i(218),PROGRESS:i(219),START:i(220)}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(17),s=i(50);t.exports=function(t,e){var i=void 0===t?s():n({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===s&&(s=0),void 0===r&&(r=!1),{responseType:t,async:e,user:i,password:n,timeout:s,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:r}}},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(3),s=i(56),r=i(43),a=i(32),o=i(33),h=i(2),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new s),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new s),void 0===e&&(e=new s);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,n){i||(i=new h),n||(n=this.scene.sys.cameras.main);var s=n.scrollX,a=n.scrollY,o=t+s*this.scrollFactorX-s,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):r(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(3),r=i(2),a=new n({initialize:function(t,e,i,n,s,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===s&&(s=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,n,s,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],r=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):n||r?s.TAU-(r>0?Math.acos(-n/this.scaleY):-Math.acos(n/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,s=n[0],r=n[1],a=n[2],o=n[3];return n[0]=s*i+a*e,n[1]=r*i+o*e,n[2]=s*-e+a*i,n[3]=r*-e+o*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,s=i[0],r=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],m=n[5],g=void 0===e?i:e.matrix;return g[0]=u*s+c*a,g[1]=u*r+c*o,g[2]=d*s+f*a,g[3]=d*r+f*o,g[4]=p*s+m*a+h,g[5]=p*r+m*o+l,g},multiplyWithOffset:function(t,e,i){var n=this.matrix,s=t.matrix,r=n[0],a=n[1],o=n[2],h=n[3],l=e*r+i*o+n[4],u=e*a+i*h+n[5],c=s[0],d=s[1],f=s[2],p=s[3],m=s[4],g=s[5];return n[0]=c*r+d*o,n[1]=c*a+d*h,n[2]=f*r+p*o,n[3]=f*a+p*h,n[4]=m*r+g*o+l,n[5]=m*a+g*h+u,this},transform:function(t,e,i,n,s,r){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+n*l,a[3]=i*h+n*u,a[4]=s*o+r*l+c,a[5]=s*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,s=n[0],r=n[1],a=n[2],o=n[3],h=n[4],l=n[5];return i.x=t*s+e*a+h,i.y=t*r+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=e*s-i*n;return t[0]=s/o,t[1]=-i/o,t[2]=-n/o,t[3]=e/o,t[4]=(n*a-s*r)/o,t[5]=-(e*a-i*r)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,s,r){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=n,a[4]=s,a[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],a=i*r-n*s;if(t.translateX=e[4],t.translateY=e[5],i||n){var o=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(s||r){var h=Math.sqrt(s*s+r*r);t.rotation=.5*Math.PI-(r>0?Math.acos(-s/h):-Math.acos(s/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,n,s){var r=this.matrix,a=Math.sin(i),o=Math.cos(i);return r[4]=t,r[5]=e,r[0]=o*n,r[1]=a*n,r[2]=-a*s,r[3]=o*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var n=this.matrix,s=n[0],a=n[1],o=n[2],h=n[3],l=n[4],u=n[5],c=1/(s*h+o*-a);return i.x=h*c*t+-o*c*e+(u*o-l*h)*c,i.y=s*c*e+-a*c*t+(-u*s+l*a)*c,i},setQuad:function(t,e,i,n,s,r){void 0===r&&(r=this.quad);var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return r[0]=t*o+e*l+c,r[1]=t*h+e*u+d,r[2]=t*o+n*l+c,r[3]=t*h+n*u+d,r[4]=i*o+n*l+c,r[5]=i*h+n*u+d,r[6]=i*o+e*l+c,r[7]=i*h+e*u+d,s&&r.forEach((function(t,e){r[e]=Math.round(t)})),r},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var n=this.getX(t,e);return i&&(n=Math.round(n)),n},getYRound:function(t,e,i){var n=this.getY(t,e);return i&&(n=Math.round(n)),n},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(59),r=i(226),a=i(233),o=i(60),h=i(23),l=new n({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new r(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new r(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return s(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={ADDED_TO_SCENE:i(234),DESTROY:i(235),REMOVED_FROM_SCENE:i(236),VIDEO_COMPLETE:i(237),VIDEO_CREATED:i(238),VIDEO_ERROR:i(239),VIDEO_LOOP:i(240),VIDEO_PLAY:i(241),VIDEO_SEEKED:i(242),VIDEO_SEEKING:i(243),VIDEO_STOP:i(244),VIDEO_TIMEOUT:i(245),VIDEO_UNLOCKED:i(246)}},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),s=0;s-1;r--)n[s][r]=t[r][s]}return n}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n,s,r,a=i(300),o=i(302),h=[],l=!1;t.exports=(r=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return n(t,e,i,a.CANVAS)},create:n=function(t,e,i,n,r){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=a.CANVAS),void 0===r&&(r=!1);var c=s(n);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:n},n===a.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),r&&(c.parent=u),u.width=e,u.height=i,l&&n===a.CANVAS&&o.disable(u.getContext("2d")),u},createWebGL:function(t,e,i){return n(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:s=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(67),s=i(11);t.exports=function(t,e,i){if(void 0===i&&(i=new s),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var r=n(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},function(t,e){t.exports=function(t){return 2*(t.width+t.height)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(4),r=i(17),a=new n({initialize:function(t,e,i,n,s,r,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,a,n,s)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var s=this.data,r=s.cut;r.x=i,r.y=n,r.w=t,r.h=e,r.r=i+t,r.b=n+e,s.sourceSize.w=t,s.sourceSize.h=e,s.spriteSourceSize.w=t,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(t*t+e*e);var a=s.drawImage;return a.x=i,a.y=n,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=n,o.w=s,o.h=r,o.r=i+s,o.b=n+r,this.x=i,this.y=n,this.width=s,this.height=r,this.halfWidth=.5*s,this.halfHeight=.5*r,this.centerX=Math.floor(s/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,n,r,a,o){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=s(e,0,d)),m=l+(i=s(i,0,f)),g=n=s(n,0,d-e),x=r=s(r,0,f-i),v=this.data;if(v.trim){var y=v.spriteSourceSize,w=e+(n=s(n,0,u-e)),b=i+(r=s(r,0,c-i));if(!(y.rw||y.y>b)){var M=Math.max(y.x,e),A=Math.max(y.y,i),S=Math.min(y.r,w)-M,k=Math.min(y.b,b)-A;g=S,x=k,p=a?h+(u-(M-y.x)-S):h+(M-y.x),m=o?l+(c-(A-y.y)-k):l+(A-y.y),e=M,i=A,n=S,r=k}else p=0,m=0,g=0,x=0}else a&&(p=h+(u-e-n)),o&&(m=l+(c-i-r));var E=this.source.width,T=this.source.height;return t.u0=Math.max(0,p/E),t.v0=Math.max(0,m/T),t.u1=Math.min(1,(p+g)/E),t.v1=Math.min(1,(m+x)/T),t.x=e,t.y=i,t.cx=p,t.cy=m,t.cw=g,t.ch=x,t.width=n,t.height=r,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,n,s,r){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=n,this.u1=s,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=n;var r=this.source.width,a=this.source.height;return this.u0=t/r,this.v0=e/a,this.u1=(t+i)/r,this.v1=(e+n)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var n=i(70),s=i(0),r=i(7),a=i(184),o=i(185),h={canvas:i(46),webgl:i(46)},l=i(209),u=i(225),c=i(256),d=i(1),f=new s({Extends:o,initialize:function(t,e,i){o.call(this,t,e,i);var s=e.game;this.isWebGL=2===s.config.renderType,this.cache=s.cache.addCustom("spine"),this.spineTextures=s.cache.addCustom("spineTextures"),this.json=s.cache.json,this.textures=s.textures,this.drawDebug=!1,this.gl,this.renderer,this.sceneRenderer,this.skeletonRenderer,this.skeletonDebugRenderer,this.plugin=h,this.temp1,this.temp2,this.isWebGL?(this.runtime=h.webgl,this.renderer=s.renderer,this.gl=s.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=s.renderer,this.getAtlas=this.getAtlasCanvas),this.renderer||(this.renderer={width:s.scale.width,height:s.scale.height,preRender:d,postRender:d,render:d,destroy:d});e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",(function(t,e,n,s,r){var a=this.scene.sys[i],o=new u(this.scene,a,t,e,n,s,r);return this.displayList.add(o),this.updateList.add(o),o}),(function(t,e){void 0===t&&(t={});var s=r(t,"key",null),a=r(t,"animationName",null),o=r(t,"loop",!1),h=this.scene.sys[i],l=new u(this.scene,h,0,0,s,a,o);void 0!==e&&(t.add=e),n(this.scene,l,t);var c=r(t,"skinName",!1);c&&l.setSkinByName(c);var d=r(t,"slotName",!1),f=r(t,"attachmentName",null);return d&&l.setAttachment(d,f),l.refresh()})),e.registerGameObject("spineContainer",(function(t,e,n){var s=this.scene.sys[i],r=new c(this.scene,s,t,e,n);return this.displayList.add(r),r}),(function(t,e){void 0===t&&(t={});var s=r(t,"x",0),a=r(t,"y",0),o=r(t,"children",null),h=this.scene.sys[i],l=new c(this.scene,h,s,a,o);return void 0!==e&&(t.add=e),n(this.scene,l,t),l}))},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(a,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this),this.game.events.once("destroy",this.gameDestroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){var t=this.renderer.spineSceneRenderer;t||(t=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0),this.renderer.spineSceneRenderer=t),this.sceneRenderer=t,this.skeletonRenderer=t.skeletonRenderer,this.skeletonDebugRenderer=t.skeletonDebugRenderer,this.temp1=new h.webgl.Vector3(0,0,0),this.temp2=new h.webgl.Vector3(0,0,0)},getAtlasCanvas:function(t){var e=this.cache.get(t);if(e){var i,n=this.spineTextures;if(n.has(t))i=n.get(t);else{var s=this.textures;i=new this.runtime.TextureAtlas(e.data,(function(t){return new h.canvas.CanvasTexture(s.get(e.prefix+t).getSourceImage())}))}return i}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var i,n=this.spineTextures;if(n.has(t))i=n.get(t);else{var s=this.textures,r=this.sceneRenderer.context.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i=new this.runtime.TextureAtlas(e.data,(function(t){return new h.webgl.GLTexture(r,s.get(e.prefix+t).getSourceImage(),!1)}))}return i}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,i,n,s,r,a){var o;if(a=a||{},Array.isArray(t))for(var h=0;h - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(12),s=i(71);t.exports=function(t,e,i){e.x=s(i,"x",0),e.y=s(i,"y",0),e.depth=s(i,"depth",0),e.flipX=s(i,"flipX",!1),e.flipY=s(i,"flipY",!1);var r=s(i,"scale",null);"number"==typeof r?e.setScale(r):null!==r&&(e.scaleX=s(r,"x",1),e.scaleY=s(r,"y",1));var a=s(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=s(a,"x",1),e.scrollFactorY=s(a,"y",1)),e.rotation=s(i,"rotation",0);var o=s(i,"angle",null);null!==o&&(e.angle=o),e.alpha=s(i,"alpha",1);var h=s(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=s(h,"x",.5),u=s(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=s(i,"blendMode",n.NORMAL),e.visible=s(i,"visible",!0),s(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(72),s=i(7);t.exports=function(t,e,i){var r=s(t,e,null);if(null===r)return i;if(Array.isArray(r))return n.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return n.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return n.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(3),s=i(17),r={Angle:i(73),Distance:i(82),Easing:i(90),Fuzzy:i(135),Interpolation:i(140),Pow2:i(148),Snap:i(152),RandomDataGenerator:i(156),Average:i(157),Bernstein:i(35),Between:i(158),CatmullRom:i(37),CeilTo:i(159),Clamp:i(4),DegToRad:i(20),Difference:i(160),Euler:i(161),Factorial:i(36),FloatBetween:i(19),FloorTo:i(162),FromPercent:i(163),GetSpeed:i(164),IsEven:i(165),IsEvenStrict:i(166),Linear:i(38),LinearXY:i(167),MaxAdd:i(168),Median:i(169),MinSub:i(170),Percent:i(171),RadToDeg:i(22),RandomXY:i(172),RandomXYZ:i(173),RandomXYZW:i(174),Rotate:i(175),RotateAround:i(41),RotateAroundDistance:i(176),RotateTo:i(177),RoundAwayFromZero:i(42),RoundTo:i(178),SinCosTableGenerator:i(179),SmootherStep:i(40),SmoothStep:i(39),ToXY:i(180),TransformXY:i(43),Within:i(181),Wrap:i(13),Vector2:i(2),Vector3:i(14),Vector4:i(182),Matrix3:i(44),Matrix4:i(21),Quaternion:i(45),RotateVec3:i(183)};r=s(!1,r,n),t.exports=r},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Between:i(30),BetweenPoints:i(74),BetweenPointsY:i(75),BetweenY:i(76),CounterClockwise:i(18),Normalize:i(31),Random:i(77),RandomDegrees:i(78),Reverse:i(79),RotateTo:i(80),ShortestBetween:i(81),Wrap:i(32),WrapDegrees:i(33)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(i-t,n-e)}},function(t,e,i){ -/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(19);t.exports=function(){return n(-Math.PI,Math.PI)}},function(t,e,i){ -/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(19);t.exports=function(){return n(-180,180)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(31);t.exports=function(t){return n(t+Math.PI)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(3);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Between:i(83),BetweenPoints:i(84),BetweenPointsSquared:i(85),Chebyshev:i(86),Power:i(87),Snake:i(88),Squared:i(89)}},function(t,e){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return Math.sqrt(s*s+r*r)}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},function(t,e){t.exports=function(t,e,i,n){return Math.max(Math.abs(t-i),Math.abs(e-n))}},function(t,e){t.exports=function(t,e,i,n,s){return void 0===s&&(s=2),Math.sqrt(Math.pow(i-t,s)+Math.pow(n-e,s))}},function(t,e){t.exports=function(t,e,i,n){return Math.abs(t-i)+Math.abs(e-n)}},function(t,e){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return s*s+r*r}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Back:i(91),Bounce:i(95),Circular:i(99),Cubic:i(103),Elastic:i(107),Expo:i(111),Linear:i(115),Quadratic:i(117),Quartic:i(121),Quintic:i(125),Sine:i(129),Stepped:i(133)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(92),Out:i(93),InOut:i(94)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(96),Out:i(97),InOut:i(98)}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(100),Out:i(101),InOut:i(102)}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(104),Out:i(105),InOut:i(106)}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(108),Out:i(109),InOut:i(110)}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(112),Out:i(113),InOut:i(114)}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports=i(116)},function(t,e){t.exports=function(t){return t}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(118),Out:i(119),InOut:i(120)}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(122),Out:i(123),InOut:i(124)}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(126),Out:i(127),InOut:i(128)}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(130),Out:i(131),InOut:i(132)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports=i(134)},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Ceil:i(136),Equal:i(34),Floor:i(137),GreaterThan:i(138),LessThan:i(139)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Bezier:i(141),CatmullRom:i(142),CubicBezier:i(143),Linear:i(144),QuadraticBezier:i(145),SmoothStep:i(146),SmootherStep:i(147)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(35);t.exports=function(t,e){for(var i=0,s=t.length-1,r=0;r<=s;r++)i+=Math.pow(1-e,s-r)*Math.pow(e,r)*t[r]*n(s,r);return i}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(37);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return t[0]===t[i]?(e<0&&(r=Math.floor(s=i*(1+e))),n(s-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(n(-s,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(s-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(s-r,t[r?r-1:0],t[r],t[i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,s)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(38);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return e<0?n(t[0],t[1],s):e>1?n(t[i],t[i-1],i-s):n(t[r],t[r+1>i?i:r+1],s-r)}},function(t,e){t.exports=function(t,e,i,n){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(39);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(40);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={GetNext:i(149),IsSize:i(150),IsValue:i(151)}},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Ceil:i(153),Floor:i(154),To:i(155)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),n?(i+t)/e:i+t)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),n?(i+t)/e:i+t)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=new(i(0))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var n=0;n>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),n=t[i];t[i]=t[e],t[e]=n}return t}});t.exports=n},function(t,e){t.exports=function(t){for(var e=0,i=0;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(4),s=i(0),r=i(21),a=i(1),o=new r,h=new s({initialize:function t(e,i,n,s){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=t.DefaultOrder),this._x=e,this._y=i,this._z=n,this._order=s,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,n){return void 0===n&&(n=this._order),this._x=t,this._y=e,this._z=i,this._order=n,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var s=t.val,r=s[0],a=s[4],o=s[8],h=s[1],l=s[5],u=s[9],c=s[2],d=s[6],f=s[10],p=0,m=0,g=0;switch(e){case"XYZ":m=Math.asin(n(o,-1,1)),Math.abs(o)<.99999?(p=Math.atan2(-u,f),g=Math.atan2(-a,r)):p=Math.atan2(d,l);break;case"YXZ":p=Math.asin(-n(u,-1,1)),Math.abs(u)<.99999?(m=Math.atan2(o,f),g=Math.atan2(h,l)):m=Math.atan2(-c,r);break;case"ZXY":p=Math.asin(n(d,-1,1)),Math.abs(d)<.99999?(m=Math.atan2(-c,f),g=Math.atan2(-a,l)):g=Math.atan2(h,r);break;case"ZYX":m=Math.asin(-n(c,-1,1)),Math.abs(c)<.99999?(p=Math.atan2(d,f),g=Math.atan2(h,r)):g=Math.atan2(-a,l);break;case"YZX":g=Math.asin(n(h,-1,1)),Math.abs(h)<.99999?(p=Math.atan2(-u,l),m=Math.atan2(-c,r)):m=Math.atan2(o,f);break;case"XZY":g=Math.asin(-n(a,-1,1)),Math.abs(a)<.99999?(p=Math.atan2(d,l),m=Math.atan2(o,r)):p=Math.atan2(-u,f)}return this._x=p,this._y=m,this._z=g,this._order=e,i&&this.onChangeCallback(this),this}});h.RotationOrders=["XYZ","YXZ","ZXY","ZYX","YZX","XZY"],h.DefaultOrder="XYZ",t.exports=h},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(4);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))+e}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=e+1);var s=(t-e)/(i-e);return s>1?void 0!==n?(s=(n-t)/(n-i))<0&&(s=0):s=1:s<0&&(s=0),s}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,n=2*Math.random()-1,s=Math.sqrt(1-n*n)*e;return t.x=Math.cos(i)*s,t.y=Math.sin(i)*s,t.z=n*e,t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},function(t,e){t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},function(t,e){t.exports=function(t,e,i,n,s){var r=n+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},function(t,e){t.exports=function(t,e,i,n,s){return t.x=e+s*Math.cos(n),t.y=i+s*Math.sin(n),t}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.round(t*n)/n}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var s=[],r=[],a=0;a - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(2);t.exports=function(t,e,i,s){void 0===s&&(s=new n);var r=0,a=0;return t>0&&t<=e*i&&(r=t>e-1?t-(a=Math.floor(t/e))*e:t),s.set(r,a)}},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=new(i(0))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+n*n+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12]*s,this.y=r[1]*e+r[5]*i+r[9]*n+r[13]*s,this.z=r[2]*e+r[6]*i+r[10]*n+r[14]*s,this.w=r[3]*e+r[7]*i+r[11]*n+r[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,a=t.z,o=t.w,h=o*e+r*n-a*i,l=o*i+a*e-s*n,u=o*n+s*i-r*e,c=-s*e-r*i-a*n;return this.x=h*o+c*-s+l*-a-u*-r,this.y=l*o+c*-r+u*-s-h*-a,this.z=u*o+c*-a+h*-r-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(14),s=i(21),r=i(45),a=new s,o=new r,h=new n;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="resize"},function(t,e,i){ -/** -* @author Richard Davey -* @copyright 2013-2023 Photon Storm Ltd. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/ -var n=i(186),s=i(0),r=i(23),a=new s({Extends:n,initialize:function(t,e,i){n.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},function(t,e,i){ -/** -* @author Richard Davey -* @copyright 2013-2023 Photon Storm Ltd. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/ -var n=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="addedtoscene"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="boot"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="create"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="destroy"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="pause"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="postupdate"},function(t,e){ -/** - * @author samme - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="prerender"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="preupdate"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="ready"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="removedfromscene"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="render"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="resume"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="shutdown"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="sleep"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="start"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="transitioncomplete"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="transitioninit"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="transitionout"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="transitionstart"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="transitionwake"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="update"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="wake"},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var n=i(0),s=i(8),r=i(210),a=i(6),o=i(222),h=i(223),l=i(224),u=new n({Extends:h,initialize:function(t,e,i,n,r,u,c){var d,f,p,m=[],g=t.cacheManager.custom.spine;if(a(e)){var x=e;for(e=s(x,"key"),f=new o(t,{key:e,url:s(x,"jsonURL"),extension:s(x,"jsonExtension","json"),xhrSettings:s(x,"jsonXhrSettings")}),n=s(x,"atlasURL"),r=s(x,"preMultipliedAlpha"),Array.isArray(n)||(n=[n]),d=0;d - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(9),r=i(24),a=i(25),o=i(8),h=i(6),l=i(48),u=new n({Extends:r,initialize:function t(e,i,n,s,a){var l,u="png";if(h(i)){var c=i;i=o(c,"key"),n=o(c,"url"),l=o(c,"normalMap"),s=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"frameConfig")}Array.isArray(n)&&(l=n[1],n=n[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:n,xhrSettings:s,config:a};if(r.call(this,e,d),l){var f=new t(e,this.key,l,s,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=s.FILE_PROCESSING,t===s.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=s.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=s.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t?t.state>=s.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var n=0;n - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="addfile"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="complete"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="filecomplete"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="filecomplete-"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="loaderror"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="load"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="fileprogress"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="postprocess"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="progress"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="start"},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(49);t.exports=function(t,e){var i=n(e,t.xhrSettings),s=new XMLHttpRequest;if(s.open("GET",t.src,i.async,i.user,i.password),s.responseType=t.xhrSettings.responseType,s.timeout=i.timeout,i.headers)for(var r in i.headers)s.setRequestHeader(r,i.headers[r]);return i.header&&i.headerValue&&s.setRequestHeader(i.header,i.headerValue),i.requestedWith&&s.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&s.overrideMimeType(i.overrideMimeType),i.withCredentials&&(s.withCredentials=!0),s.onload=t.onLoad.bind(t,s),s.onerror=t.onError.bind(t,s),s.onprogress=t.onProgress.bind(t),s.send(),s}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(9),r=i(24),a=i(25),o=i(8),h=i(7),l=i(6),u=new n({Extends:r,initialize:function(t,e,i,n,a){var u="json";if(l(e)){var c=e;e=o(c,"key"),i=o(c,"url"),n=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:a};r.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,n){if(Array.isArray(t))for(var s=0;s - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(9),r=i(47),a=new n({initialize:function(t,e,i,n){var r=[];n.forEach((function(t){t&&r.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=r,this.state=s.FILE_PENDING,this.complete=!1,this.pending=r.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(9),r=i(24),a=i(25),o=i(8),h=i(6),l=new n({Extends:r,initialize:function(t,e,i,n){var s="text",a="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),n=o(u,"xhrSettings"),a=o(u,"extension",a),s=o(u,"type",s),l=o(u,"cache",l)}var c={type:s,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,c)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var n=0;n - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var n=i(30),s=i(4),r=i(0),a=i(51),o=i(52),h=i(53),l=i(54),u=i(55),c=i(57),d=i(18),f=i(20),p=i(58),m=i(22),g=i(247),x=i(254),v=new r({Extends:p,Mixins:[a,o,h,l,u,c,x],initialize:function(t,e,i,n,s,r,a){p.call(this,t,"Spine"),this.plugin=e,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null,this.root=null,this.bounds=null,this.drawDebug=!1,this.timeScale=1,this.displayOriginX=0,this.displayOriginY=0,this.preMultipliedAlpha=!1,this.blendMode=-1,this.setPosition(i,n),s&&this.setSkeleton(s,r,a)},willRender:function(t,e){var i=!this.skeleton||!(15!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id);if(!e&&!i&&this.parentContainer){var n=this.plugin,s=n.sceneRenderer;n.gl&&s.batcher.isDrawing&&(s.end(),n.renderer.pipelines.rebind())}return i},setAlpha:function(t,e){if(void 0===t&&(t=1),e){var i=this.findSlot(e);i&&(i.color.a=s(t,0,1))}else this.alpha=t;return this},alpha:{get:function(){return this.skeleton.color.a},set:function(t){var e=s(t,0,1);this.skeleton&&(this.skeleton.color.a=e),0===e?this.renderFlags&=-3:this.renderFlags|=2}},red:{get:function(){return this.skeleton.color.r},set:function(t){var e=s(t,0,1);this.skeleton&&(this.skeleton.color.r=e)}},green:{get:function(){return this.skeleton.color.g},set:function(t){var e=s(t,0,1);this.skeleton&&(this.skeleton.color.g=e)}},blue:{get:function(){return this.skeleton.color.b},set:function(t){var e=s(t,0,1);this.skeleton&&(this.skeleton.color.b=e)}},setColor:function(t,e){void 0===t&&(t=16777215);var i=(t>>16&255)/255,n=(t>>8&255)/255,s=(255&t)/255,r=t>16777215?(t>>>24)/255:null,a=this.skeleton;if(e){var o=this.findSlot(e);o&&(a=o)}return a.color.r=i,a.color.g=n,a.color.b=s,null!==r&&(a.color.a=r),this},setSkeletonFromJSON:function(t,e,i,n){return this.setSkeleton(t,e,i,n)},setSkeleton:function(t,e,i,n){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var s=this.plugin.createSkeleton(t,n);this.skeletonData=s.skeletonData,this.preMultipliedAlpha=s.preMultipliedAlpha;var r=s.skeleton;return r.setSkin(),r.setToSetupPose(),this.skeleton=r,s=this.plugin.createAnimationState(r),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=s.state,this.stateData=s.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=m(d(this.rotation))+90),this.state.apply(r),r.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=m(d(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,n){var s=this.skeleton;return void 0===t&&(t=s.data.width),void 0===e&&(e=s.data.height),void 0===i&&(i=0),void 0===n&&(n=0),this.width=t,this.height=e,this.displayOriginX=s.x-i,this.displayOriginY=s.y-n,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,n=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var s=this.getBounds();return this.width=s.size.x,this.height=s.size.y,this.displayOriginX=this.x-s.offset.x,this.displayOriginY=this.y-(e-(this.height+s.offset.y)),t.scaleX=i,t.scaleY=n,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(227),r=new n({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(s.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={CHANGE_DATA:i(228),CHANGE_DATA_KEY:i(229),DESTROY:i(230),REMOVE_DATA:i(231),SET_DATA:i(232)}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="changedata"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="changedata-"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="destroy"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="removedata"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="setdata"},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,s="~";function r(){}function a(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,i,n,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new a(i,n||t,r),h=s?s+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function l(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(s=!1)),l.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(s?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},l.prototype.listeners=function(t){var e=s?s+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,r=i.length,a=new Array(r);n - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="addedtoscene"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="destroy"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="removedfromscene"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="complete"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="created"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="error"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="loop"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="play"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="seeked"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="seeking"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="stop"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="timeout"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="unlocked"},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={COMPLETE:i(248),DISPOSE:i(249),END:i(250),EVENT:i(251),INTERRUPTED:i(252),START:i(253)}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="complete"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="dispose"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="end"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="event"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="interrupted"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="start"},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var n=i(1),s=i(1),r=i(1);s=i(255),t.exports={renderWebGL:n,renderCanvas:s,renderDirect:r}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var n=i(18),s=i(22),r=i(13);t.exports=function(t,e,i,a){var o=t.currentContext,h=e.plugin,l=e.skeleton,u=h.skeletonRenderer,c=t._tempMatrix1,d=t._tempMatrix2,f=t._tempMatrix3;i.addToRenderList(e),d.applyITRS(e.x,e.y,e.rotation,Math.abs(e.scaleX),Math.abs(e.scaleY)),c.copyFrom(i.matrix),a?(c.multiplyWithOffset(a,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),d.e=e.x,d.f=e.y,c.multiply(d,f)):(d.e-=i.scrollX*e.scrollFactorX,d.f-=i.scrollY*e.scrollFactorY,c.multiply(d,f)),l.x=f.tx,l.y=f.ty,l.scaleX=f.scaleX,l.scaleY=-1*f.scaleY,e.scaleX<0?(l.scaleX*=-1,e.root.rotation=s(f.rotationNormalized)):e.root.rotation=r(s(n(f.rotationNormalized))+90,0,360),e.scaleY<0&&(l.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*s(f.rotationNormalized):e.root.rotation+=2*s(f.rotationNormalized)),i.renderToTexture&&(l.y=f.ty,l.scaleY*=-1),l.updateWorldTransform(),u.ctx=o,u.debugRendering=h.drawDebug||e.drawDebug,o.save(),u.draw(l),o.restore()}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var n=i(0),s=i(257),r=i(342),a=new n({Extends:s,Mixins:[r],initialize:function(t,e,i,n,r){s.call(this,t,i,n,r),this.type="Spine",this.plugin=e},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null,this.plugin=null}});t.exports=a},function(t,e,i){ -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(258),s=i(12),r=i(0),a=i(309),o=i(60),h=i(58),l=i(28),u=i(339),c=i(341),d=i(2),f=new r({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.Pipeline,a.Transform,a.Visible,u],initialize:function(t,e,i,n){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPipeline(),this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,n=new l,s=!1;t.setEmpty();for(var r=0;r-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){var i,n=[null],s=this.list.slice(),r=s.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Matrix:i(259),Add:i(268),AddAt:i(269),BringToTop:i(270),CountAllMatching:i(271),Each:i(272),EachInRange:i(273),FindClosestInSorted:i(274),Flatten:i(275),GetAll:i(276),GetFirst:i(277),GetRandom:i(278),MoveDown:i(279),MoveTo:i(280),MoveUp:i(281),MoveAbove:i(282),MoveBelow:i(283),NumberArray:i(284),NumberArrayStep:i(285),QuickSelect:i(286),Range:i(287),Remove:i(288),RemoveAt:i(289),RemoveBetween:i(290),RemoveRandomElement:i(291),Replace:i(292),RotateLeft:i(62),RotateRight:i(63),SafeRange:i(5),SendToBack:i(293),SetAll:i(294),Shuffle:i(64),SortByDigits:i(295),SpliceOne:i(10),StableSort:i(296),Swap:i(308)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={CheckMatrix:i(26),MatrixToString:i(260),ReverseColumns:i(262),ReverseRows:i(263),Rotate180:i(264),RotateLeft:i(265),RotateMatrix:i(15),RotateRight:i(266),Translate:i(267),TransposeMatrix:i(61)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(261),s=i(26);t.exports=function(t){var e="";if(!s(t))return e;for(var i=0;i=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(s-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;e - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(15);t.exports=function(t){return n(t,180)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(15);t.exports=function(t){return n(t,90)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(15);t.exports=function(t){return n(t,-90)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(62),s=i(63);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?n(t,Math.abs(i)):s(t,i)),0!==e)for(var r=0;r0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(s,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>r&&(e.splice(r),a=r);for(var o=0;o0){var a=n-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(r,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;n>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),s&&s.call(r,l)}return e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(5);t.exports=function(t,e,i,s,r){void 0===s&&(s=0),void 0===r&&(r=t.length);var a=0;if(n(t,s,r))for(var o=s;o - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(5);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r)){var a,o=[null];for(a=5;ae.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i=function(t,e){void 0===e&&(e=[]);for(var n=0;n - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(5);t.exports=function(t,e,i,s,r){void 0===s&&(s=0),void 0===r&&(r=t.length);var a=[];if(n(t,s,r))for(var o=s;o - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(5);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r))for(var a=s;a0){var n=t[i-1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e);if(-1===n||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&is||(t.splice(n,1),s===t.length-1?t.push(e):t.splice(s,0,e)),t}},function(t,e){t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),s=t.indexOf(i);if(n<0||s<0)throw new Error("Supplied items must be elements of the same array");return n=e;s--)a?r.push(i+s.toString()+n):r.push(s);else for(s=t;s<=e;s++)a?r.push(i+s.toString()+n):r.push(s);return r}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(42);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var s=[],r=Math.max(n((e-t)/(i||1)),0),a=0;a - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -function i(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function n(t,e){return te?1:0}var s=function(t,e,r,a,o){for(void 0===r&&(r=0),void 0===a&&(a=t.length-1),void 0===o&&(o=n);a>r;){if(a-r>600){var h=a-r+1,l=e-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(e-l*c/h+d)),p=Math.min(a,Math.floor(e+(h-l)*c/h+d));s(t,e,f,p,o)}var m=t[e],g=r,x=a;for(i(t,r,e),o(t[a],m)>0&&i(t,r,a);g0;)x--}0===o(t[r],m)?i(t,r,x):i(t,++x,a),x<=e&&(r=x+1),e<=x&&(a=x-1)}};t.exports=s},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(7),s=i(64),r=function(t,e,i){for(var n=[],s=0;s - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(10);t.exports=function(t,e,i,s){var r;if(void 0===s&&(s=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(n(t,r),i&&i.call(s,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(r=t.indexOf(h))&&(n(t,r),o.push(h),i&&i.call(s,h)),a--}return o}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(10);t.exports=function(t,e,i,s){if(void 0===s&&(s=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var r=n(t,e);return i&&i.call(s,r),r}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(5);t.exports=function(t,e,i,s,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),n(t,e,i)){var a=i-e,o=t.splice(e,a);if(s)for(var h=0;h - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(10);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return n(t,s)}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e),s=t.indexOf(i);return-1!==n&&-1===s&&(t[n]=i,!0)}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(5);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r))for(var a=s;a - * @author Angry Bytes (and contributors) - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(297);function s(t,e){return String(t).localeCompare(e)}function r(t,e,i,n){var s,r,a,o,h,l=t.length,u=0,c=2*i;for(s=0;sl&&(r=l),a>l&&(a=l),o=s,h=r;;)if(o - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={os:i(27),browser:i(16),features:i(299),input:i(303),audio:i(304),video:i(305),fullscreen:i(306),canvasFeatures:i(307)}},function(t,e){var i,n,s=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var h,l=[],u=!1,c=-1;function d(){u&&h&&(u=!1,h.length?l=h.concat(l):c=-1,l.length&&f())}function f(){if(!u){var t=o(d);u=!0;for(var e=l.length;e;){for(h=l,l=[];++c1)for(var i=1;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(27),s=i(16),r=i(65),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=r.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=r.create2D(this),n=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=n.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(a.getUserMedia=!1),!n.iOS&&(s.ie||s.firefox||s.chrome)&&(a.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n={VERSION:"3.60.0-beta.18",BlendModes:i(12),ScaleModes:i(301),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i,n="";t.exports={disable:function(t){return""===n&&(n=i(t)),n&&(t[n]=!1),t},enable:function(t){return""===n&&(n=i(t)),n&&(t[n]=!0),t},getPrefix:i=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(16),s={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(s.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(s.mspointer=!0),navigator.getGamepads&&(s.gamepads=!0),"onwheel"in window||n.ie&&"WheelEvent"in window?s.wheelEvent="wheel":"onmousewheel"in window?s.wheelEvent="mousewheel":n.firefox&&"MouseScrollEvent"in window&&(s.wheelEvent="DOMMouseScroll")),s)},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(16),s={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return s;s.audioData=!!window.Audio,s.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var n=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(n||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(n)};if(s.ogg=i('ogg; codecs="vorbis"'),s.opus=i('ogg; codecs="opus"',"opus"),s.mp3=i("mpeg"),s.wav=i("wav"),s.m4a=i("x-m4a"),s.aac=i("aac"),s.flac=i("flac","x-flac"),s.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(n.edge)s.dolby=!0;else if(n.safari&&n.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var r=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===r&&a>=11||r>10)&&(s.dolby=!0)}}}catch(t){}return s}()},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return i;var t=document.createElement("video"),e=!!t.canPlayType,n=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(n,"")&&(i.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(n,"")&&(i.h264=!0,i.mp4=!0),t.canPlayType("video/x-m4v").replace(n,"")&&(i.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(n,"")&&(i.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(n,"")&&(i.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(n,"")&&(i.hls=!0))}catch(t){}return i}()},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return i;var t,e="Fullscreen",n="FullScreen",s=["request"+e,"request"+n,"webkitRequest"+e,"webkitRequest"+n,"msRequest"+e,"msRequest"+n,"mozRequest"+n,"mozRequest"+e];for(t=0;t - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n,s,r,a=i(65),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),n=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),n}()),o)},function(t,e){t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),s=t.indexOf(i);if(n<0||s<0)throw new Error("Supplied items must be elements of the same array");return t[n]=i,t[s]=e,t}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Alpha:i(310),AlphaSingle:i(311),BlendMode:i(312),ComputedSize:i(51),Crop:i(313),Depth:i(52),Flip:i(53),FX:i(314),GetBounds:i(315),Mask:i(324),Origin:i(329),PathFollower:i(330),Pipeline:i(333),ScrollFactor:i(54),Size:i(335),Texture:i(336),TextureCrop:i(337),Tint:i(338),ToJSON:i(59),Transform:i(55),TransformMatrix:i(56),Visible:i(57)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(4),s={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,s){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(s,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=s},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(4),s={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=s},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(12),s={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={fxPadding:0,setFXPadding:function(t){return void 0===t&&(t=0),this.fxPadding=t,this},onFXCopy:function(){},onFX:function(){}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(28),s=i(41),r=i(2),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,s,r,a,o,h,l;if(void 0===t&&(t=new n),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),s=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),s=t.x,r=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,s,a,h),t.y=Math.min(i,r,o,l),t.width=Math.max(e,s,a,h)-t.x,t.height=Math.max(i,r,o,l)-t.y,t}};t.exports=a},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(66),s=i(67);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=s(t)/i);for(var a=0;a - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(319),r=i(320),a=i(29),o=i(322),h=i(2),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=n},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(11);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(321),s=i(11);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=n(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;u - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(11);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(11);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(325),s=i(328),r={mask:null,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},createBitmapMask:function(t,e,i,s,r){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new n(this.scene,t,e,i,s,r)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new s(this.scene,t)}};t.exports=r},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(326),r=new n({initialize:function(t,e,i,n,s,r){e||(e=t.sys.make.image({x:i,y:n,key:s,frame:r,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});s.register("bitmapMask",(function(t,e,i,n,s){return new r(this.scene,t,e,i,n,s)})),t.exports=r},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(0),s=i(327),r=i(23),a=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},s.register("GameObjectFactory",a,"add"),t.exports=a},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={},n={},s={register:function(t,e,n,s){void 0===s&&(s=!1),i[t]={plugin:e,mapping:n,custom:s}},registerCustom:function(t,e,i,s){n[t]={plugin:e,mapping:i,data:s}},hasCore:function(t){return i.hasOwnProperty(t)},hasCustom:function(t){return n.hasOwnProperty(t)},getCore:function(t){return i[t]},getCustom:function(t){return n[t]},getCustomClass:function(t){return n.hasOwnProperty(t)?n[t].plugin:null},remove:function(t){i.hasOwnProperty(t)&&delete i[t]},removeCustom:function(t){n.hasOwnProperty(t)&&delete n[t]},destroyCorePlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]},destroyCustomPlugins:function(){for(var t in n)n.hasOwnProperty(t)&&delete n[t]}};t.exports=s},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=new(i(0))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var n=t.gl;t.flush(),0===t.maskStack.length&&(n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var n=t.gl,s=this.geometryMask,r=t.maskCount;n.colorMask(!1,!1,!1,!1),i?(n.stencilFunc(n.EQUAL,r,255),n.stencilOp(n.KEEP,n.KEEP,n.INCR)):(n.stencilFunc(n.EQUAL,r+1,255),n.stencilOp(n.KEEP,n.KEEP,n.DECR)),s.renderWebGL(t,s,e),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),i?this.invertAlpha?n.stencilFunc(n.NOTEQUAL,r+1,255):n.stencilFunc(n.EQUAL,r+1,255):this.invertAlpha?n.stencilFunc(n.NOTEQUAL,r,255):n.stencilFunc(n.EQUAL,r,255)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var n=t.maskStack[t.maskStack.length-1];n.mask.applyStencil(t,n.camera,!1),t.currentCameraMask.mask!==n.mask?(i.mask=n.mask,i.camera=n.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(20),s=i(331),r=i(7),a=i(332),o=i(2),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=r(t,"from",0),t.to=r(t,"to",1);var h=s(t,"positionOnPath",!1);this.rotateToPath=s(t,"rotateToPath",!1),this.pathRotationOffset=r(t,"rotationOffset",0);var l=r(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+n(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,s=this.pathVector;if(i.copy(s).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,s),i.add(s),s.add(this.pathOffset),void this.setPosition(s.x,s.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),s),i.add(s),s.add(this.pathOffset);var r=this.x,o=this.y;this.setPosition(s.x,s.y);var h=this.x-r,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+n(this.pathRotationOffset))}}};t.exports=h},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(334),s=i(10),r={defaultPipeline:null,pipeline:null,hasPostPipeline:!1,postPipelines:null,pipelineData:null,initPipeline:function(t){var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(this.postPipelines=[],this.pipelineData={},i){void 0===t&&(t=i.default);var n=i.get(t);if(n)return this.defaultPipeline=n,this.pipeline=n,!0}return!1},setPipeline:function(t,e,i){var s=this.scene.sys.renderer;if(!s)return this;var r=s.pipelines;if(r){var a=r.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?n(e):e)}return this},setPostPipeline:function(t,e,i){var s=this.scene.sys.renderer;if(!s)return this;var r=s.pipelines;if(r){Array.isArray(t)||(t=[t]);for(var a=0;a0,this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,n=[],s=0;s=0;i--){var n=e[i];("string"==typeof t&&n.name===t||"string"!=typeof t&&n instanceof t)&&(n.destroy(),s(e,i))}return this.hasPostPipeline=this.postPipelines.length>0,this},getPipelineName:function(){return this.pipeline.name}};t.exports=r},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i=function(t){var e,n,s;if("object"!=typeof t||null===t)return t;for(s in e=Array.isArray(t)?[]:{},t)n=t[s],e[s]=i(n);return e};t.exports=i},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(68),s={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof n?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=s},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(68),s={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof n?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=s},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,n){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,n=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=n,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this.tintFill||16777215!==this.tintTopLeft||16777215!==this.tintTopRight||16777215!==this.tintBottomLeft||16777215!==this.tintBottomRight}}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(1),s=n,r=n;r=i(340),t.exports={renderWebGL:s,renderCanvas:r}},function(t,e){t.exports=function(t,e,i,n){i.addToRenderList(e);var s=e.list;if(0!==s.length){var r=e.localTransform;n?(r.loadIdentity(),r.multiply(n),r.translate(e.x,e.y),r.rotate(e.rotation),r.scale(e.scaleX,e.scaleY)):r.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(28);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=Math.min(t.x,e.x),r=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-s,o=Math.max(t.bottom,e.bottom)-r;return i.setTo(s,r,a,o)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var n=i(1),s=i(1);s=i(343),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n){var s=e.list;if(0!==s.length){i.addToRenderList(e);var r=e.localTransform;n?(r.loadIdentity(),r.multiply(n),r.translate(e.x,e.y),r.rotate(e.rotation),r.scale(e.scaleX,e.scaleY)):r.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var t={4399:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function n(t,e,s,n,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new r(s,n||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,s,r=[];if(0===this._eventsCount)return r;for(s in t=this._events)e.call(t,s)&&r.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var r=0,n=s.length,a=new Array(n);r{(function(){"use strict";var e=(()=>{var t=Object.defineProperty,e=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,r={};((e,i)=>{for(var s in i)t(e,s,{get:i[s],enumerable:!0})})(r,{AlphaTimeline:()=>ft,Animation:()=>T,AnimationState:()=>Ct,AnimationStateAdapter:()=>Yt,AnimationStateData:()=>Vt,AssetManager:()=>bi,AssetManagerBase:()=>ue,AtlasAttachmentLoader:()=>ne,Attachment:()=>b,AttachmentTimeline:()=>gt,BinaryInput:()=>Oe,BlendMode:()=>Ce,Bone:()=>he,BoneData:()=>ae,BoundingBoxAttachment:()=>Ut,CURRENT:()=>Nt,CanvasTexture:()=>wi,ClippingAttachment:()=>Wt,Color:()=>h,ConstraintData:()=>le,CurveTimeline:()=>Q,CurveTimeline1:()=>J,CurveTimeline2:()=>tt,DebugUtils:()=>g,DeformTimeline:()=>xt,Downloader:()=>ce,DrawOrderTimeline:()=>bt,Event:()=>de,EventData:()=>fe,EventQueue:()=>Ft,EventTimeline:()=>yt,EventType:()=>Ot,FIRST:()=>Dt,FakeTexture:()=>$t,HOLD_FIRST:()=>_t,HOLD_MIX:()=>Bt,HOLD_SUBSEQUENT:()=>Xt,IkConstraint:()=>pe,IkConstraintData:()=>me,IkConstraintTimeline:()=>At,IntSet:()=>n,Interpolation:()=>c,MathUtils:()=>u,MeshAttachment:()=>te,MixBlend:()=>R,MixDirection:()=>C,PathAttachment:()=>ee,PathConstraint:()=>be,PathConstraintData:()=>ge,PathConstraintMixTimeline:()=>It,PathConstraintPositionTimeline:()=>St,PathConstraintSpacingTimeline:()=>Et,PointAttachment:()=>ie,Pool:()=>x,PositionMode:()=>xe,Pow:()=>d,PowOut:()=>f,RGB2Timeline:()=>mt,RGBA2Timeline:()=>pt,RGBATimeline:()=>ct,RGBTimeline:()=>dt,RegionAttachment:()=>re,RotateMode:()=>ye,RotateTimeline:()=>et,SETUP:()=>zt,SUBSEQUENT:()=>Lt,ScaleTimeline:()=>nt,ScaleXTimeline:()=>at,ScaleYTimeline:()=>ot,SequenceTimeline:()=>Tt,ShearTimeline:()=>ht,ShearXTimeline:()=>lt,ShearYTimeline:()=>ut,Skeleton:()=>Ee,SkeletonBinary:()=>Fe,SkeletonBounds:()=>ui,SkeletonClipping:()=>di,SkeletonData:()=>Ie,SkeletonJson:()=>fi,SkeletonRenderer:()=>Si,Skin:()=>Te,SkinEntry:()=>ke,Slot:()=>Ae,SlotData:()=>Re,SpacingMode:()=>ve,StringSet:()=>a,Texture:()=>qt,TextureAtlas:()=>Kt,TextureAtlasPage:()=>Qt,TextureAtlasRegion:()=>Jt,TextureFilter:()=>Gt,TextureRegion:()=>jt,TextureWrap:()=>Ht,TimeKeeper:()=>y,Timeline:()=>Z,TrackEntry:()=>Pt,TransformConstraint:()=>Me,TransformConstraintData:()=>Pe,TransformConstraintTimeline:()=>Mt,TransformMode:()=>oe,TranslateTimeline:()=>it,TranslateXTimeline:()=>st,TranslateYTimeline:()=>rt,Triangulator:()=>ci,Utils:()=>m,Vector2:()=>v,VertexAttachment:()=>M,WindowedMean:()=>w});var n=class{constructor(){this.array=new Array}add(t){let e=this.contains(t);return this.array[0|t]=0|t,!e}contains(t){return null!=this.array[0|t]}remove(t){this.array[0|t]=void 0}clear(){this.array.length=0}},a=class{constructor(){this.entries={},this.size=0}add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var i=0,s=t.length;i1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}static fromString(t){return(new o).setFromString(t)}},h=o;h.WHITE=new o(1,1,1,1),h.RED=new o(1,0,0,1),h.GREEN=new o(0,1,0,1),h.BLUE=new o(0,0,1,1),h.MAGENTA=new o(1,0,1,1);var l=class{static clamp(t,e,i){return ti?i:t}static cosDeg(t){return Math.cos(t*l.degRad)}static sinDeg(t){return Math.sin(t*l.degRad)}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return l.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,i){let s=Math.random(),r=e-t;return s<=(i-t)/r?t+Math.sqrt(s*r*(i-t)):e-Math.sqrt((1-s)*r*(e-i))}static isPowerOfTwo(t){return t&&0==(t&t-1)}},u=l;u.PI=3.1415927,u.PI2=2*l.PI,u.radiansToDegrees=180/l.PI,u.radDeg=l.radiansToDegrees,u.degreesToRadians=l.PI/180,u.degRad=l.degreesToRadians;var c=class{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}},d=class extends c{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}},f=class extends d{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}},p=class{static arrayCopy(t,e,i,s,r){for(let n=e,a=s;n=e?t:p.setArraySize(t,e,i)}static newArray(t,e){let i=new Array(t);for(let s=0;s0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},w=class{constructor(t=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let e=0;e>1)*n;let a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(!l){o.length>0&&(h=o);let a=t.bone,l=a.worldX,u=a.worldY,c=a.a,d=a.b,f=a.c,p=a.d;for(let t=e,a=r;a=this.regions.length&&(i=this.regions.length-1);let s=this.regions[i];e.region!=s&&(e.region=s,e.updateRegion())}getPath(t,e){let i=t,s=(this.start+e).toString();for(let t=this.digits-s.length;t>0;t--)i+="0";return i+=s,i}static nextID(){return S._nextID++}},E=S;E._nextID=0;var I=(t=>(t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse",t))(I||{}),k=[0,1,2,3,4,5,6],T=class{constructor(t,e,i){if(this.timelines=[],this.timelineIds=new a,!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=i}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e0&&(e%=this.duration));let h=this.timelines;for(let s=0,l=h.length;s(t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add",t))(R||{}),C=(t=>(t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut",t))(C||{}),P=0,F=1,O=2,Y=3,L=4,D=5,X=6,_=7,B=8,z=9,N=10,V=11,U=12,W=13,q=14,G=15,H=16,j=17,$=18,K=19,Z=class{constructor(t,e){this.propertyIds=e,this.frames=m.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let i=t.length;for(let s=1;se)return s-1;return i-1}static search(t,e,i){let s=t.length;for(let r=i;re)return r-i;return s-i}},Q=class extends Z{constructor(t,e,i){super(t,i),this.curves=m.newFloatArray(t+18*e),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+18*t;if(this.curves.length>e){let t=m.newFloatArray(e);m.arrayCopy(this.curves,0,t,0,e),this.curves=t}}setBezier(t,e,i,s,r,n,a,o,h,l,u){let c=this.curves,d=this.getFrameCount()+18*t;0==i&&(c[e]=2+d);let f=.03*(s-2*n+o),p=.03*(r-2*a+h),m=.006*(3*(n-o)-s+l),g=.006*(3*(a-h)-r+u),x=2*f+m,v=2*p+g,y=.3*(n-s)+f+.16666667*m,w=.3*(a-r)+p+.16666667*g,b=s+y,A=r+w;for(let t=d+18;dt){let n=this.frames[e],a=this.frames[e+i];return a+(t-n)/(r[s]-n)*(r[s+1]-a)}let n=s+18;for(s+=2;s=t){let e=r[s-2],i=r[s-1];return i+(t-e)/(r[s]-e)*(r[s+1]-i)}e+=this.getFrameEntries();let a=r[n-2],o=r[n-1];return o+(t-a)/(this.frames[e]-a)*(this.frames[e+i]-o)}},J=class extends Q{constructor(t,e,i){super(t,e,[i])}getFrameEntries(){return 2}setFrame(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+1]=i}getCurveValue(t){let e=this.frames,i=e.length-2;for(let s=2;s<=i;s+=2)if(e[s]>t){i=s-2;break}let s=this.curves[i>>1];switch(s){case 0:let s=e[i],r=e[i+1];return r+(t-s)/(e[i+2]-s)*(e[i+2+1]-r);case 1:return e[i+1]}return this.getBezierValue(t,i,1,s-2)}},tt=class extends Q{constructor(t,e,i,s){super(t,e,[i,s])}getFrameEntries(){return 3}setFrame(t,e,i,s){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s}},et=class extends J{constructor(t,e,i){super(t,e,P+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,r,n,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i>2];switch(p){case 0:let t=h[f];u=h[f+1],c=h[f+2],d=h[f+3];let e=(i-t)/(h[f+4]-t);u+=(h[f+4+1]-u)*e,c+=(h[f+4+2]-c)*e,d+=(h[f+4+3]-d)*e;break;case 1:u=h[f+1],c=h[f+2],d=h[f+3];break;default:u=this.getBezierValue(i,f,1,p-2),c=this.getBezierValue(i,f,2,p+18-2),d=this.getBezierValue(i,f,3,p+36-2)}if(1==r)l.r=u,l.g=c,l.b=d;else{if(0==n){let t=o.data.color;l.r=t.r,l.g=t.g,l.b=t.b}l.r+=(u-l.r)*r,l.g+=(c-l.g)*r,l.b+=(d-l.b)*r}}},ft=class extends J{constructor(t,e,i){super(t,e,B+"|"+i),this.slotIndex=0,this.slotIndex=i}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.color;if(i>3];switch(y){case 0:let t=h[v];c=h[v+1],d=h[v+2],f=h[v+3],p=h[v+4],m=h[v+5],g=h[v+6],x=h[v+7];let e=(i-t)/(h[v+8]-t);c+=(h[v+8+1]-c)*e,d+=(h[v+8+2]-d)*e,f+=(h[v+8+3]-f)*e,p+=(h[v+8+4]-p)*e,m+=(h[v+8+5]-m)*e,g+=(h[v+8+6]-g)*e,x+=(h[v+8+7]-x)*e;break;case 1:c=h[v+1],d=h[v+2],f=h[v+3],p=h[v+4],m=h[v+5],g=h[v+6],x=h[v+7];break;default:c=this.getBezierValue(i,v,1,y-2),d=this.getBezierValue(i,v,2,y+18-2),f=this.getBezierValue(i,v,3,y+36-2),p=this.getBezierValue(i,v,4,y+54-2),m=this.getBezierValue(i,v,5,y+72-2),g=this.getBezierValue(i,v,6,y+90-2),x=this.getBezierValue(i,v,7,y+108-2)}if(1==r)l.set(c,d,f,p),u.r=m,u.g=g,u.b=x;else{if(0==n){l.setFromColor(o.data.color);let t=o.data.darkColor;u.r=t.r,u.g=t.g,u.b=t.b}l.add((c-l.r)*r,(d-l.g)*r,(f-l.b)*r,(p-l.a)*r),u.r+=(m-u.r)*r,u.g+=(g-u.g)*r,u.b+=(x-u.b)*r}}},mt=class extends Q{constructor(t,e,i){super(t,e,[_+"|"+i,z+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,s,r,n,a,o){t*=7,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=r,this.frames[t+4]=n,this.frames[t+5]=a,this.frames[t+6]=o}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,u=o.darkColor;if(it){let r=this.frames[e];return i[s+1]*(t-r)/(i[s]-r)}let r=s+18;for(s+=2;s=t){let e=i[s-2],r=i[s-1];return r+(t-e)/(i[s]-e)*(i[s+1]-r)}let n=i[r-2],a=i[r-1];return a+(1-a)*(t-n)/(this.frames[e+this.getFrameEntries()]-n)}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.getAttachment();if(!h)return;if(!(h instanceof M)||h.timelineAttachment!=this.attachment)return;let l=o.deform;0==l.length&&(n=0);let u=this.vertices,c=u[0].length,d=this.frames;if(i=d[d.length-1]){let t=u[d.length-1];if(1==r)if(3==n){let e=h;if(e.bones)for(let e=0;ei)this.apply(t,e,Number.MAX_VALUE,s,r,n,a),e=-1;else if(e>=o[h-1])return;if(i0&&o[l-1]==t;)l--}for(;l=o[l];l++)s.push(this.events[l])}},yt=vt;yt.propertyIds=[""+U];var wt=class extends Z{constructor(t){super(t,wt.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,s,r,n,a){if(1==a)return void(0==n&&m.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));if(i>2];switch(f){case 0:let t=c[d];h=c[d+1],l=c[d+2],u=c[d+3];let e=(i-t)/(c[d+4]-t);h+=(c[d+4+1]-h)*e,l+=(c[d+4+2]-l)*e,u+=(c[d+4+3]-u)*e;break;case 1:h=c[d+1],l=c[d+2],u=c[d+3];break;default:h=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),u=this.getBezierValue(i,d,3,f+36-2)}if(0==n){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*r,o.mixX=t.mixX+(l-t.mixX)*r,o.mixY=t.mixY+(u-t.mixY)*r}else o.mixRotate+=(h-o.mixRotate)*r,o.mixX+=(l-o.mixX)*r,o.mixY+=(u-o.mixY)*r}},kt=class extends Z{constructor(t,e,i){super(t,[K+"|"+e+"|"+i.sequence.id]),this.slotIndex=e,this.attachment=i}getFrameEntries(){return kt.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,i,s,r){let n=this.frames;n[t*=kt.ENTRIES]=e,n[t+kt.MODE]=i|s<<4,n[t+kt.DELAY]=r}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.attachment,l=this.attachment;if(!(h==l||h instanceof M&&h.timelineAttachment==l))return;let u=this.frames;if(i>4,g=this.attachment.sequence.regions.length,x=k[15&f];if(0!=x)switch(m+=(i-d)/p+1e-5|0,x){case 1:m=Math.min(g-1,m);break;case 2:m%=g;break;case 3:{let t=(g<<1)-2;m=0==t?0:m%t,m>=g&&(m=t-m);break}case 4:m=Math.max(g-1-m,0);break;case 5:m=g-1-m%g;break;case 6:{let t=(g<<1)-2;m=0==t?0:(m+g-1)%t,m>=g&&(m=t-m)}}o.sequenceIndex=m}},Tt=kt;Tt.ENTRIES=3,Tt.MODE=1,Tt.DELAY=2;var Rt=class{constructor(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Ft(this),this.propertyIDs=new a,this.animationsChanged=!1,this.trackEntryPool=new x((()=>new Pt)),this.data=t}static emptyAnimation(){return Rt._emptyAnimation}update(t){t*=this.timeScale;let e=this.tracks;for(let i=0,s=e.length;i0){if(s.delay-=r,s.delay>0)continue;r=-s.delay,s.delay=0}let n=s.next;if(n){let e=s.trackLast-n.delay;if(e>=0){for(n.delay=0,n.trackTime+=0==s.timeScale?0:(e/s.timeScale+t)*n.timeScale,s.trackTime+=r,this.setCurrent(i,n,!0);n.mixingFrom;)n.mixTime+=t,n=n.mixingFrom;continue}}else if(s.trackLast>=s.trackEnd&&!s.mixingFrom){e[i]=null,this.queue.end(s),this.clearNext(s);continue}if(s.mixingFrom&&this.updateMixingFrom(s,t)){let t=s.mixingFrom;for(s.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}s.trackTime+=r}this.queue.drain()}updateMixingFrom(t,e){let i=t.mixingFrom;if(!i)return!0;let s=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),s):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,i=this.tracks,s=!1;for(let n=0,a=i.length;n0)continue;s=!0;let o=0==n?1:a.mixBlend,h=a.alpha;a.mixingFrom?h*=this.applyMixingFrom(a,t,o):a.trackTime>=a.trackEnd&&!a.next&&(h=0);let l=a.animationLast,u=a.getAnimationTime(),c=u,d=e;a.reverse&&(c=a.animation.duration-c,d=null);let f=a.animation.timelines,p=f.length;if(0==n&&1==h||3==o)for(let e=0;e1&&(r=1),1!=i&&(i=s.mixBlend));let n=r0&&this.queueEvents(s,d),this.events.length=0,s.nextAnimationLast=d,s.nextTrackLast=s.trackTime,r}applyAttachmentTimeline(t,e,i,s,r){var n=e.slots[t.slotIndex];n.bone.active&&(i0,s=t>=0;u.signum(e)!=u.signum(f)&&Math.abs(e)<=90&&(Math.abs(t)>180&&(t+=360*u.signum(t)),s=i),d=f+t-t%360,s!=i&&(d+=360*u.signum(t)),n[a]=d}n[a+1]=f,h.rotation=l+d*s}queueEvents(t,e){let i=t.animationStart,s=t.animationEnd,r=s-i,n=t.trackLast%r,a=this.events,o=0,h=a.length;for(;os||this.queue.event(t,e)}let l=!1;for(l=t.loop?0==r||n>t.trackTime%r:e>=s&&t.animationLast=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let i=e;for(;;){let t=i.mixingFrom;if(!t)break;this.queue.end(t),i.mixingFrom=null,i.mixingTo=null,i=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,i){let s=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,s&&(i&&this.queue.interrupt(s),e.mixingFrom=s,s.mixingTo=e,e.mixTime=0,s.mixingFrom&&s.mixDuration>0&&(e.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,i=!1){let s=this.data.skeletonData.findAnimation(e);if(!s)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,s,i)}setAnimationWith(t,e,i=!1){if(!e)throw new Error("animation cannot be null.");let s=!0,r=this.expandToIndex(t);r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,s=!1):this.clearNext(r));let n=this.trackEntry(t,e,i,r);return this.setCurrent(t,n,s),this.queue.drain(),n}addAnimation(t,e,i=!1,s=0){let r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,i,s)}addAnimationWith(t,e,i=!1,s=0){if(!e)throw new Error("animation cannot be null.");let r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;let n=this.trackEntry(t,e,i,r);return r?(r.next=n,n.previous=r,s<=0&&(s+=r.getTrackComplete()-n.mixDuration)):(this.setCurrent(t,n,!0),this.queue.drain()),n.delay=s,n}setEmptyAnimation(t,e=0){let i=this.setAnimationWith(t,Rt.emptyAnimation(),!1);return i.mixDuration=e,i.trackEnd=e,i}addEmptyAnimation(t,e=0,i=0){let s=this.addAnimationWith(t,Rt.emptyAnimation(),!1,i);return i<=0&&(s.delay+=s.mixDuration-e),s.mixDuration=e,s.trackEnd=e,s}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e0){r[o]=Bt,n[o]=i;continue t}break}r[o]=_t}else r[o]=Lt}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},Ct=Rt;Ct._emptyAnimation=new T("",[],0);var Pt=class{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=2,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime(t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event",t))(Ot||{}),Yt=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}},Lt=0,Dt=1,Xt=2,_t=3,Bt=4,zt=1,Nt=2,Vt=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,i){let s=this.skeletonData.findAnimation(t);if(!s)throw new Error("Animation not found: "+t);let r=this.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);this.setMixWith(s,r,i)}setMixWith(t,e,i){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let s=t.name+"."+e.name;this.animationToMixTime[s]=i}getMix(t,e){let i=t.name+"."+e.name,s=this.animationToMixTime[i];return void 0===s?this.defaultMix:s}},Ut=class extends M{constructor(t){super(t),this.color=new h(1,1,1,1)}copy(){let t=new Ut(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},Wt=class extends M{constructor(t){super(t),this.endSlot=null,this.color=new h(.2275,.2275,.8078,1)}copy(){let t=new Wt(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},qt=class{constructor(t){this._image=t}getImage(){return this._image}},Gt=(t=>(t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear",t))(Gt||{}),Ht=(t=>(t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat",t))(Ht||{}),jt=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},$t=class extends qt{setFilters(t,e){}setWraps(t,e){}dispose(){}},Kt=class{constructor(t){this.pages=new Array,this.regions=new Array;let e=new Zt(t),i=new Array(4),s={size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},format:()=>{},filter:t=>{t.minFilter=m.enumValue(Gt,i[1]),t.magFilter=m.enumValue(Gt,i[2])},repeat:t=>{-1!=i[1].indexOf("x")&&(t.uWrap=10497),-1!=i[1].indexOf("y")&&(t.vWrap=10497)},pma:t=>{t.pma="true"==i[1]}};var r={xy:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2])},size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},bounds:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2]),t.width=parseInt(i[3]),t.height=parseInt(i[4])},offset:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2])},orig:t=>{t.originalWidth=parseInt(i[1]),t.originalHeight=parseInt(i[2])},offsets:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2]),t.originalWidth=parseInt(i[3]),t.originalHeight=parseInt(i[4])},rotate:t=>{let e=i[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:t=>{t.index=parseInt(i[1])}};let n=e.readLine();for(;n&&0==n.trim().length;)n=e.readLine();for(;n&&0!=n.trim().length&&0!=e.readEntry(i,n);)n=e.readLine();let a=null,o=null,h=null;for(;null!==n;)if(0==n.trim().length)a=null,n=e.readLine();else if(a){let t=new Jt(a,n);for(;;){let s=e.readEntry(i,n=e.readLine());if(0==s)break;let a=r[i[0]];if(a)a(t);else{o||(o=[]),h||(h=[]),o.push(i[0]);let t=[];for(let e=0;e0&&h&&h.length>0&&(t.names=o,t.values=h,o=null,h=null),t.u=t.x/a.width,t.v=t.y/a.height,90==t.degrees?(t.u2=(t.x+t.height)/a.width,t.v2=(t.y+t.width)/a.height):(t.u2=(t.x+t.width)/a.width,t.v2=(t.y+t.height)/a.height),this.regions.push(t)}else{for(a=new Qt(n.trim());0!=e.readEntry(i,n=e.readLine());){let t=s[i[0]];t&&t(a)}this.pages.push(a)}}findRegion(t){for(let e=0;e=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;let i=e.indexOf(":");if(-1==i)return 0;t[0]=e.substr(0,i).trim();for(let s=1,r=i+1;;s++){let i=e.indexOf(",",r);if(-1==i)return t[s]=e.substr(r).trim(),s;if(t[s]=e.substr(r,i-r).trim(),r=i+1,4==s)return 4}}},Qt=class{constructor(t){this.minFilter=9728,this.magFilter=9728,this.uWrap=33071,this.vWrap=33071,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}},Jt=class extends jt{constructor(t,e){super(),this.x=0,this.y=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.index=0,this.degrees=0,this.names=null,this.values=null,this.page=t,this.name=e}},te=class extends M{constructor(t,e){super(t),this.region=null,this.regionUVs=[],this.uvs=[],this.triangles=[],this.color=new h(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=[],this.parentMesh=null,this.sequence=null,this.tempColor=new h(0,0,0,0),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=m.newFloatArray(t.length));let e=this.uvs,i=this.uvs.length,s=this.region.u,r=this.region.v,n=0,a=0;if(this.region instanceof Jt){let o=this.region,h=o.page.texture.getImage(),l=h.width,u=h.height;switch(o.degrees){case 90:s-=(o.originalHeight-o.offsetY-o.height)/l,r-=(o.originalWidth-o.offsetX-o.width)/u,n=o.originalHeight/l,a=o.originalWidth/u;for(let o=0;o= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}},oe=(t=>(t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection",t))(oe||{}),he=class{constructor(t,e,i){if(this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,s,r,n,a){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=s,this.ascaleY=r,this.ashearX=n,this.ashearY=a;let o=this.parent;if(!o){let o=this.skeleton,h=i+90+a,l=o.scaleX,c=o.scaleY;return this.a=u.cosDeg(i+n)*s*l,this.b=u.cosDeg(h)*r*l,this.c=u.sinDeg(i+n)*s*c,this.d=u.sinDeg(h)*r*c,this.worldX=t*l+o.x,void(this.worldY=e*c+o.y)}let h=o.a,l=o.b,c=o.c,d=o.d;switch(this.worldX=h*t+l*e+o.worldX,this.worldY=c*t+d*e+o.worldY,this.data.transformMode){case 0:{let t=i+90+a,e=u.cosDeg(i+n)*s,o=u.cosDeg(t)*r,f=u.sinDeg(i+n)*s,p=u.sinDeg(t)*r;return this.a=h*e+l*f,this.b=h*o+l*p,this.c=c*e+d*f,void(this.d=c*o+d*p)}case 1:{let t=i+90+a;this.a=u.cosDeg(i+n)*s,this.b=u.cosDeg(t)*r,this.c=u.sinDeg(i+n)*s,this.d=u.sinDeg(t)*r;break}case 2:{let t=h*h+c*c,e=0;t>1e-4?(t=Math.abs(h*d-l*c)/t,h/=this.skeleton.scaleX,c/=this.skeleton.scaleY,l=c*t,d=h*t,e=Math.atan2(c,h)*u.radDeg):(h=0,c=0,e=90-Math.atan2(d,l)*u.radDeg);let o=i+n-e,f=i+a-e+90,p=u.cosDeg(o)*s,m=u.cosDeg(f)*r,g=u.sinDeg(o)*s,x=u.sinDeg(f)*r;this.a=h*p-l*g,this.b=h*m-l*x,this.c=c*p+d*g,this.d=c*m+d*x;break}case 3:case 4:{let t=u.cosDeg(i),e=u.sinDeg(i),o=(h*t+l*e)/this.skeleton.scaleX,f=(c*t+d*e)/this.skeleton.scaleY,p=Math.sqrt(o*o+f*f);p>1e-5&&(p=1/p),o*=p,f*=p,p=Math.sqrt(o*o+f*f),3==this.data.transformMode&&h*d-l*c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let m=Math.PI/2+Math.atan2(f,o),g=Math.cos(m)*p,x=Math.sin(m)*p,v=u.cosDeg(n)*s,y=u.cosDeg(90+a)*r,w=u.sinDeg(n)*s,b=u.sinDeg(90+a)*r;this.a=o*v+g*w,this.b=o*y+g*b,this.c=f*v+x*w,this.d=f*y+x*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.c,this.a)*u.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*u.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){let t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*u.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*u.radDeg);let e=t.a,i=t.b,s=t.c,r=t.d,n=1/(e*r-i*s),a=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=a*r*n-o*i*n,this.ay=o*e*n-a*s*n;let h=n*r,l=n*e,c=n*i,d=n*s,f=h*this.a-c*this.c,p=h*this.b-c*this.d,m=l*this.c-d*this.a,g=l*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let t=f*g-p*m;this.ascaleY=t/this.ascaleX,this.ashearY=Math.atan2(f*p+m*g,t)*u.radDeg,this.arotation=Math.atan2(m,f)*u.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*u.radDeg}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),i=t.x-this.worldX,s=t.y-this.worldY;return t.x=i*this.d*e-s*this.b*e,t.y=s*this.a*e-i*this.c*e,t}localToWorld(t){let e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t}worldToLocalRotation(t){let e=u.sinDeg(t),i=u.cosDeg(t);return Math.atan2(this.a*e-this.c*i,this.d*i-this.b*e)*u.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=u.sinDeg(t),i=u.cosDeg(t);return Math.atan2(i*this.c+e*this.d,i*this.a+e*this.b)*u.radDeg}rotateWorld(t){let e=this.a,i=this.b,s=this.c,r=this.d,n=u.cosDeg(t),a=u.sinDeg(t);this.a=n*e-a*s,this.b=n*i-a*r,this.c=a*e+n*s,this.d=a*i+n*r}},le=class{constructor(t,e,i){this.name=t,this.order=e,this.skinRequired=i}},ue=class{constructor(t,e="",i=new ce){this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e,this.downloader=i}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,i){this.toLoad--,this.loaded++,this.assets[e]=i,t&&t(e,i)}error(t,e,i){this.toLoad--,this.loaded++,this.errors[e]=i,t&&t(e,i)}loadAll(){return new Promise(((t,e)=>{let i=()=>{this.isLoadingComplete()?this.hasErrors()?e(this.errors):t(this):requestAnimationFrame(i)};requestAnimationFrame(i)}))}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadBinary(t,(i=>{this.success(e,t,i)}),((e,s)=>{this.error(i,t,`Couldn't load binary ${t}: status ${e}, ${s}`)}))}loadText(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadText(t,(i=>{this.success(e,t,i)}),((e,s)=>{this.error(i,t,`Couldn't load text ${t}: status ${e}, ${s}`)}))}loadJson(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadJson(t,(i=>{this.success(e,t,i)}),((e,s)=>{this.error(i,t,`Couldn't load JSON ${t}: status ${e}, ${s}`)}))}loadTexture(t,e=(()=>{}),i=(()=>{})){if(t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then((e=>e.ok?e.blob():(this.error(i,t,`Couldn't load image: ${t}`),null))).then((t=>t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null)).then((i=>{i&&this.success(e,t,this.textureLoader(i))}));else{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>{this.success(e,t,this.textureLoader(s))},s.onerror=()=>{this.error(i,t,`Couldn't load image: ${t}`)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),s.src=t}}loadTextureAtlas(t,e=(()=>{}),i=(()=>{}),s){let r=t.lastIndexOf("/"),n=r>=0?t.substring(0,r+1):"";t=this.start(t),this.downloader.downloadText(t,(r=>{try{let a=new Kt(r),o=a.pages.length,h=!1;for(let r of a.pages)this.loadTexture(s?s[r.name]:n+r.name,((i,s)=>{h||(r.setTexture(s),0==--o&&this.success(e,t,a))}),((e,s)=>{h||this.error(i,t,`Couldn't load texture atlas ${t} page image: ${e}`),h=!0}))}catch(e){this.error(i,t,`Couldn't parse texture atlas ${t}: ${e.message}`)}}),((e,s)=>{this.error(i,t,`Couldn't load texture atlas ${t}: status ${e}, ${s}`)}))}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let e=this.assets[t];if(e)return e;let i=this.errors[t];throw Error("Asset not found: "+t+(i?"\n"+i:""))}remove(t){t=this.pathPrefix+t;let e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}removeAll(){for(let t in this.assets){let e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}isLoadingComplete(){return 0==this.toLoad}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},ce=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return-1!=e?(e+="base64,".length,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var e=window.atob(t),i=e.length,s=new Uint8Array(i),r=0;r{this.finish(t,s.status,s.responseText)};s.onload=r,s.onerror=r,s.send()}downloadJson(t,e,i){this.downloadText(t,(t=>{e(JSON.parse(t))}),i)}downloadBinary(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType="arraybuffer";let r=()=>{this.finish(t,s.status,s.response)};s.onload=()=>{200==s.status||0==s.status?this.finish(t,200,new Uint8Array(s.response)):r()},s.onerror=r,s.send()}start(t,e,i){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,i)}}finish(t,e,i){let s=this.callbacks[t];delete this.callbacks[t];let r=200==e||0==e?[i]:[e,i];for(let t=r.length-1,e=s.length;t180?f-=360:f<-180&&(f+=360);let g=t.ascaleX,x=t.ascaleY;if(s||r){switch(t.data.transformMode){case 3:case 4:p=e-t.worldX,m=i-t.worldY}let o=t.data.length*g,h=Math.sqrt(p*p+m*m);if(s&&ho&&o>1e-4){let t=(h/o-1)*a+1;g*=t,n&&(x*=t)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*a,g,x,t.ashearX,t.ashearY)}apply2(t,e,i,s,r,n,a,o,h){let l=t.ax,c=t.ay,d=t.ascaleX,f=t.ascaleY,p=d,m=f,g=e.ascaleX,x=0,v=0,y=0;d<0?(d=-d,x=180,y=-1):(x=0,y=1),f<0&&(f=-f,y=-y),g<0?(g=-g,v=180):v=0;let w=e.ax,b=0,A=0,M=0,S=t.a,E=t.b,I=t.c,k=t.d,T=Math.abs(d-f)<=1e-4;!T||n?(b=0,A=S*w+t.worldX,M=I*w+t.worldY):(b=e.ay,A=S*w+E*b+t.worldX,M=I*w+k*b+t.worldY);let R=t.parent;if(!R)throw new Error("IK parent must itself have a parent.");S=R.a,E=R.b,I=R.c,k=R.d;let C,P,F=1/(S*k-E*I),O=A-R.worldX,Y=M-R.worldY,L=(O*k-Y*E)*F-l,D=(Y*S-O*I)*F-c,X=Math.sqrt(L*L+D*D),_=e.data.length*g;if(X<1e-4)return this.apply1(t,i,s,!1,n,!1,h),void e.updateWorldTransformWith(w,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);O=i-R.worldX,Y=s-R.worldY;let B=(O*k-Y*E)*F-l,z=(Y*S-O*I)*F-c,N=B*B+z*z;if(0!=o){o*=d*(g+1)*.5;let t=Math.sqrt(N),e=t-X-_*d+o;if(e>0){let i=Math.min(1,e/(2*o))-1;i=(e-o*(1-i*i))/t,B-=i*B,z-=i*z,N=B*B+z*z}}t:if(T){_*=d;let t=(N-X*X-_*_)/(2*X*_);t<-1?(t=-1,P=Math.PI*r):t>1?(t=1,P=0,n&&(S=(Math.sqrt(N)/(X+_)-1)*h+1,p*=S,a&&(m*=S))):P=Math.acos(t)*r,S=X+_*t,E=_*Math.sin(P),C=Math.atan2(z*S-B*E,B*S+z*E)}else{S=d*_,E=f*_;let t=S*S,e=E*E,i=Math.atan2(z,B);I=e*X*X+t*N-t*e;let s=-2*e*X,n=e-t;if(k=s*s-4*n*I,k>=0){let t=Math.sqrt(k);s<0&&(t=-t),t=.5*-(s+t);let e=t/n,a=I/t,o=Math.abs(e)=-1&&I<=1&&(I=Math.acos(I),O=S*Math.cos(I)+X,Y=E*Math.sin(I),k=O*O+Y*Y,km&&(c=I,m=k,p=O,g=Y)),N<=.5*(h+m)?(C=i-Math.atan2(l*r,o),P=a*r):(C=i-Math.atan2(g*r,p),P=c*r)}let V=Math.atan2(b,w)*y,U=t.arotation;C=(C-V)*u.radDeg+x-U,C>180?C-=360:C<-180&&(C+=360),t.updateWorldTransformWith(l,c,U+C*h,p,m,0,0),U=e.arotation,P=((P+V)*u.radDeg-e.ashearX)*y+v-U,P>180?P-=360:P<-180&&(P+=360),e.updateWorldTransformWith(w,b,U+P*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}},me=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},ge=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.positionMode=xe.Fixed,this.spacingMode=ve.Fixed,this.rotateMode=ye.Chain,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}},xe=(t=>(t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent",t))(xe||{}),ve=(t=>(t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional",t))(ve||{}),ye=(t=>(t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale",t))(ye||{}),we=class{constructor(t,e){if(this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0,s=t.bones.length;i0){t=l/t*f;for(let e=1;e0?u.degRad:-u.degRad}for(let t=0,r=3;t0){let i=h.a,s=h.b,a=h.c,o=h.d,l=0,d=0,f=0;if(l=n?p[r-1]:0==c[t+1]?p[r+2]:Math.atan2(w,m),l-=Math.atan2(a,i),y){d=Math.cos(l),f=Math.sin(l);let t=h.data.length;g+=(t*(d*i-f*a)-m)*e,x+=(t*(f*i+d*a)-w)*e}else l+=v;l>u.PI?l-=u.PI2:l<-u.PI&&(l+=u.PI2),l*=e,d=Math.cos(l),f=Math.sin(l),h.a=d*i-f*a,h.b=d*s-f*o,h.c=f*i+d*a,h.d=f*s+d*o}h.updateAppliedTransform()}}computeWorldPositions(t,e,i){let s=this.target,r=this.position,n=this.spaces,a=m.setArraySize(this.positions,3*e+2),o=this.world,h=t.closed,l=t.worldVerticesLength,u=l/6,c=we.NONE;if(!t.constantSpeed){let d=t.lengths;u-=h?1:2;let f,p=d[u];switch(1==this.data.positionMode&&(r*=p),this.data.spacingMode){case 2:f=p;break;case 3:f=p/e;break;default:f=1}o=m.setArraySize(this.world,8);for(let m=0,g=0,x=0;mp){c!=we.AFTER&&(c=we.AFTER,t.computeWorldVertices(s,l-6,4,o,0,2)),this.addAfterPosition(v-p,o,0,a,g);continue}}for(;;x++){let t=d[x];if(!(v>t)){if(0==x)v/=t;else{let e=d[x-1];v=(v-e)/(t-e)}break}}x!=c&&(c=x,h&&x==u?(t.computeWorldVertices(s,l-4,4,o,0,2),t.computeWorldVertices(s,0,4,o,4,2)):t.computeWorldVertices(s,6*x+2,8,o,0,2)),this.addCurvePosition(v,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],a,g,i||m>0&&0==e)}return a}h?(l+=2,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l-4,o,0,2),t.computeWorldVertices(s,0,2,o,l-4,2),o[l-2]=o[0],o[l-1]=o[1]):(u--,l-=4,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l,o,0,2));let d,f=m.setArraySize(this.curves,u),p=0,g=o[0],x=o[1],v=0,y=0,w=0,b=0,A=0,M=0,S=0,E=0,I=0,k=0,T=0,R=0,C=0,P=0;for(let t=0,e=2;tp){this.addAfterPosition(Y-p,o,l-4,a,s);continue}}for(;;u++){let t=f[u];if(!(Y>t)){if(0==u)Y/=t;else{let e=f[u-1];Y=(Y-e)/(t-e)}break}}if(u!=c){c=u;let t=6*u;for(g=o[t],x=o[t+1],v=o[t+2],y=o[t+3],w=o[t+4],b=o[t+5],A=o[t+6],M=o[t+7],S=.03*(g-2*v+w),E=.03*(x-2*y+b),I=.006*(3*(v-w)-g+A),k=.006*(3*(y-b)-x+M),T=2*S+I,R=2*E+k,C=.3*(v-g)+S+.16666667*I,P=.3*(y-x)+E+.16666667*k,O=Math.sqrt(C*C+P*P),F[0]=O,t=1;t<8;t++)C+=T,P+=R,T+=I,R+=k,O+=Math.sqrt(C*C+P*P),F[t]=O;C+=T,P+=R,O+=Math.sqrt(C*C+P*P),F[8]=O,C+=T+I,P+=R+k,O+=Math.sqrt(C*C+P*P),F[9]=O,m=0}for(Y*=O;;m++){let t=F[m];if(!(Y>t)){if(0==m)Y/=t;else{let e=F[m-1];Y=m+(Y-e)/(t-e)}break}}this.addCurvePosition(.1*Y,g,x,v,y,w,b,A,M,a,s,i||t>0&&0==e)}return a}addBeforePosition(t,e,i,s,r){let n=e[i],a=e[i+1],o=e[i+2]-n,h=e[i+3]-a,l=Math.atan2(h,o);s[r]=n+t*Math.cos(l),s[r+1]=a+t*Math.sin(l),s[r+2]=l}addAfterPosition(t,e,i,s,r){let n=e[i+2],a=e[i+3],o=n-e[i],h=a-e[i+1],l=Math.atan2(h,o);s[r]=n+t*Math.cos(l),s[r+1]=a+t*Math.sin(l),s[r+2]=l}addCurvePosition(t,e,i,s,r,n,a,o,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=i,void(l[u+2]=Math.atan2(r-i,s-e));let d=t*t,f=d*t,p=1-t,m=p*p,g=m*p,x=p*t,v=3*x,y=p*v,w=v*t,b=e*g+s*y+n*w+o*f,A=i*g+r*y+a*w+h*f;l[u]=b,l[u+1]=A,c&&(l[u+2]=t<.001?Math.atan2(r-i,s-e):Math.atan2(A-(i*m+r*x*2+a*d),b-(e*m+s*x*2+n*d)))}},be=we;be.NONE=-1,be.BEFORE=-2,be.AFTER=-3,be.epsilon=1e-5;var Ae=class{constructor(t,e){if(this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new h,this.darkColor=t.darkColor?new h:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(t instanceof M&&this.attachment instanceof M&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},Me=class{constructor(t,e){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new v,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(let i=0;i0?u.degRad:-u.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;fu.PI?n-=u.PI2:n<-u.PI&&(n+=u.PI2),n*=t;let a=Math.cos(n),o=Math.sin(n);x.a=a*e-o*s,x.b=a*i-o*r,x.c=o*e+a*s,x.d=o*i+a*r}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(t.x-x.worldX)*e,x.worldY+=(t.y-x.worldY)*i}if(0!=s){let t=Math.sqrt(x.a*x.a+x.c*x.c);0!=t&&(t=(t+(Math.sqrt(h*h+c*c)-t+this.data.offsetScaleX)*s)/t),x.a*=t,x.c*=t}if(0!=r){let t=Math.sqrt(x.b*x.b+x.d*x.d);0!=t&&(t=(t+(Math.sqrt(l*l+d*d)-t+this.data.offsetScaleY)*r)/t),x.b*=t,x.d*=t}if(n>0){let t=x.b,e=x.d,i=Math.atan2(e,t),s=Math.atan2(d,l)-Math.atan2(c,h)-(i-Math.atan2(x.c,x.a));s>u.PI?s-=u.PI2:s<-u.PI&&(s+=u.PI2),s=i+(s+m)*n;let r=Math.sqrt(t*t+e*e);x.b=Math.cos(s)*r,x.d=Math.sin(s)*r}x.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,r=this.mixScaleY,n=this.mixShearY,a=0!=e||0!=i,o=this.target,h=o.a,l=o.b,c=o.c,d=o.d,f=h*d-l*c>0?u.degRad:-u.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;fu.PI?n-=u.PI2:n<-u.PI&&(n+=u.PI2),n*=t;let a=Math.cos(n),o=Math.sin(n);x.a=a*e-o*s,x.b=a*i-o*r,x.c=o*e+a*s,x.d=o*i+a*r}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=t.x*e,x.worldY+=t.y*i}if(0!=s){let t=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleX)*s+1;x.a*=t,x.c*=t}if(0!=r){let t=(Math.sqrt(l*l+d*d)-1+this.data.offsetScaleY)*r+1;x.b*=t,x.d*=t}if(n>0){let t=Math.atan2(d,l)-Math.atan2(c,h);t>u.PI?t-=u.PI2:t<-u.PI&&(t+=u.PI2);let e=x.b,i=x.d;t=Math.atan2(i,e)+(t-u.PI/2+m)*n;let s=Math.sqrt(e*e+i*i);x.b=Math.cos(t)*s,x.d=Math.sin(t)*s}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,r=this.mixScaleY,n=this.mixShearY,a=this.target,o=this.bones;for(let h=0,l=o.length;h=s.length&&(s.length=t+1),s[t]||(s[t]={}),s[t][e]=i}addSkin(t){for(let e=0;e= 0.");if(!e)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}},Ce=(t=>(t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen",t))(Ce||{}),Pe=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Fe=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new Ie;i.name="";let s=new Oe(t),r=s.readInt32(),n=s.readInt32();i.hash=0==n&&0==r?null:n.toString(16)+r.toString(16),i.version=s.readString(),i.x=s.readFloat(),i.y=s.readFloat(),i.width=s.readFloat(),i.height=s.readFloat();let a=s.readBoolean();a&&(i.fps=s.readFloat(),i.imagesPath=s.readString(),i.audioPath=s.readString());let o=0;o=s.readInt(!0);for(let t=0;t>4,t.readFloat())}s.push(e);break}}}}}let n=t.readInt(!0);if(n>0){let e=new bt(n),r=i.slots.length;for(let i=0;i=0;t--)a[t]=-1;let o=m.newArray(r-n,0),h=0,l=0;for(let e=0;e=0;t--)-1==a[t]&&(a[t]=o[--l]);e.setFrame(i,s,a)}s.push(e)}let a=t.readInt(!0);if(a>0){let e=new yt(a);for(let s=0;s>>1^-(1&i)}readStringRef(){let t=this.readInt(!0);return 0==t?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&t)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(t),i++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return 0!=this.readByte()}},Ye=class{constructor(t,e,i,s,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=s,this.inheritTimeline=r}},Le=class{constructor(t=null,e=null){this.bones=t,this.vertices=e}},De=(t=>(t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping",t))(De||{});function Xe(t,e,i){let s=t.readFloat(),r=t.readFloat()*i;for(let n=0,a=0,o=e.getFrameCount()-1;e.setFrame(n,s,r),n!=o;n++){let o=t.readFloat(),h=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(n);break;case li:Be(t,e,a++,n,0,s,o,r,h,i)}s=o,r=h}return e}function _e(t,e,i){let s=t.readFloat(),r=t.readFloat()*i,n=t.readFloat()*i;for(let a=0,o=0,h=e.getFrameCount()-1;e.setFrame(a,s,r,n),a!=h;a++){let h=t.readFloat(),l=t.readFloat()*i,u=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(a);break;case li:Be(t,e,o++,a,0,s,h,r,l,i),Be(t,e,o++,a,1,s,h,n,u,i)}s=h,r=l,n=u}return e}function Be(t,e,i,s,r,n,a,o,h,l){e.setBezier(i,s,r,n,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,a,h)}var ze,Ne=0,Ve=1,Ue=2,We=3,qe=4,Ge=5,He=6,je=7,$e=8,Ke=9,Ze=0,Qe=1,Je=2,ti=3,ei=4,ii=5,si=0,ri=1,ni=0,ai=1,oi=2,hi=1,li=2,ui=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new x((()=>m.newFloatArray(16)))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");let i=this.boundingBoxes,s=this.polygons,r=this.polygonPool,n=t.slots,a=n.length;i.length=0,r.freeAll(s),s.length=0;for(let t=0;t=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,i,s){let r=this.minX,n=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&i<=r||e<=n&&s<=n||t>=a&&i>=a||e>=o&&s>=o)return!1;let h=(s-e)/(i-t),l=h*(r-t)+e;if(l>n&&ln&&lr&&ur&&ut.minX&&this.minYt.minY}containsPoint(t,e){let i=this.polygons;for(let s=0,r=i.length;s=i||o=i){let h=s[t];h+(i-r)/(o-r)*(s[n]-h)=u&&x<=a||x>=a&&x<=u)&&(x>=e&&x<=s||x>=s&&x<=e)){let t=(l*m-h*f)/g;if((t>=c&&t<=d||t>=d&&t<=c)&&(t>=i&&t<=r||t>=r&&t<=i))return!0}u=a,c=d}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},ci=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new x((()=>new Array)),this.polygonIndicesPool=new x((()=>new Array))}triangulate(t){let e=t,i=t.length>>1,s=this.indicesArray;s.length=0;for(let t=0;t3;){let t=i-1,a=0,o=1;for(;;){t:if(!r[a]){let n=s[t]<<1,h=s[a]<<1,l=s[o]<<1,u=e[n],c=e[n+1],d=e[h],f=e[h+1],p=e[l],m=e[l+1];for(let n=(o+1)%i;n!=t;n=(n+1)%i){if(!r[n])continue;let t=s[n]<<1,i=e[t],a=e[t+1];if(ci.positiveArea(p,m,u,c,i,a)&&ci.positiveArea(u,c,d,f,i,a)&&ci.positiveArea(d,f,p,m,i,a))break t}break}if(0==o){do{if(!r[a])break;a--}while(a>0);break}t=a,a=o,o=(o+1)%i}n.push(s[(i+a-1)%i]),n.push(s[a]),n.push(s[(a+1)%i]),s.splice(a,1),r.splice(a,1),i--;let h=(i+a-1)%i,l=a==i?0:a;r[h]=ci.isConcave(h,i,e,s),r[l]=ci.isConcave(l,i,e,s)}return 3==i&&(n.push(s[2]),n.push(s[0]),n.push(s[1])),n}decompose(t,e){let i=t,s=this.convexPolygons;this.polygonPool.freeAll(s),s.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let n=this.polygonIndicesPool.obtain();n.length=0;let a=this.polygonPool.obtain();a.length=0;let o=-1,h=0;for(let t=0,l=e.length;t0?(s.push(a),r.push(n)):(this.polygonPool.free(a),this.polygonIndicesPool.free(n)),a=this.polygonPool.obtain(),a.length=0,a.push(d),a.push(f),a.push(p),a.push(m),a.push(g),a.push(x),n=this.polygonIndicesPool.obtain(),n.length=0,n.push(l),n.push(u),n.push(c),h=ci.winding(d,f,p,m,g,x),o=l)}a.length>0&&(s.push(a),r.push(n));for(let t=0,e=s.length;t=0;t--)a=s[t],0==a.length&&(s.splice(t,1),this.polygonPool.free(a),n=r[t],r.splice(t,1),this.polygonIndicesPool.free(n));return s}static isConcave(t,e,i,s){let r=s[(e+t-1)%e]<<1,n=s[t]<<1,a=s[(t+1)%e]<<1;return!this.positiveArea(i[r],i[r+1],i[n],i[n+1],i[a],i[a+1])}static positiveArea(t,e,i,s,r,n){return t*(n-s)+i*(e-n)+r*(s-e)>=0}static winding(t,e,i,s,r,n){let a=i-t,o=s-e;return r*o-n*a+a*e-t*o>=0?1:-1}},di=class{constructor(){this.triangulator=new ci,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let i=e.worldVerticesLength,s=m.setArraySize(this.clippingPolygon,i);e.computeWorldVertices(t,0,i,s,0,2);let r=this.clippingPolygon;di.makeClockwise(r);let n=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let t=0,e=n.length;t>1,R=this.clipOutput,C=m.setArraySize(l,e+T*f);for(let h=0;h=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(i),h.push(s),h.push(r),h.push(n),h.push(t),h.push(e),o.length=0;let c=a,d=a.length-4;for(let t=0;;t+=2){let e=c[t],i=c[t+1],s=c[t+2],r=c[t+3],n=e-s,a=i-r,f=h,p=h.length-2,m=o.length;for(let t=0;t0;if(n*(l-r)-a*(h-s)>0){if(p){o.push(c),o.push(d);continue}let t=d-l,n=c-h,a=t*(s-e)-n*(r-i);if(Math.abs(a)>1e-6){let u=(n*(i-l)-t*(e-h))/a;o.push(e+(s-e)*u),o.push(i+(r-i)*u)}else o.push(e),o.push(i)}else if(p){let t=d-l,n=c-h,a=t*(s-e)-n*(r-i);if(Math.abs(a)>1e-6){let u=(n*(i-l)-t*(e-h))/a;o.push(e+(s-e)*u),o.push(i+(r-i)*u)}else o.push(e),o.push(i);o.push(c),o.push(d)}u=!0}if(m==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),t==d)break;let g=o;(o=h).length=0,h=g}if(l!=o){l.length=0;for(let t=0,e=o.length-2;t>1;t=0;e--)-1==o[e]&&(o[e]=t[--r])}e.setFrame(n,vi(a,"time",0),o)}r.push(e)}if(t.events){let e=new yt(t.events.length),s=0;for(let r=0;rnew wi(t)),t,e)}},Ai=m.newFloatArray(8),Mi=class{constructor(t){this.triangleRendering=!1,this.debugRendering=!1,this.vertices=m.newFloatArray(8192),this.tempColor=new h,this.ctx=t}draw(t){this.triangleRendering?this.drawTriangles(t):this.drawImages(t)}drawImages(t){let e=this.ctx,i=this.tempColor,s=t.color,r=t.drawOrder;this.debugRendering&&(e.strokeStyle="green");for(let t=0,n=r.length;t{if(n&&"object"==typeof n||"function"==typeof n)for(let h of i(n))s.call(r,h)||h===a||t(r,h,{get:()=>n[h],enumerable:!(o=e(n,h))||o.enumerable});return r})(t({},"__esModule",{value:!0}),yi)})();t.exports=e}).call(window)},3524:(t,e,i)=>{var s=i(7473),r=i(4597),n=i(6732),a=i(2482),o=i(704),h=i(3137),l=i(1192),u=new s({Extends:h,initialize:function(t,e,i,s,n,u,c){var d,f,p,m=[],g=t.cacheManager.custom.spine;if(a(e)){var x=e;for(e=r(x,"key"),f=new o(t,{key:e,url:r(x,"jsonURL"),extension:r(x,"jsonExtension","json"),xhrSettings:r(x,"jsonXhrSettings")}),s=r(x,"atlasURL"),n=r(x,"preMultipliedAlpha"),Array.isArray(s)||(s=[s]),d=0;d{var s=i(2494),r=i(7473),n=i(5851),a=i(3527),o=i(5722),h={canvas:i(5159),webgl:i(5159)},l=i(3524),u=i(8332),c=i(5782),d=i(1984),f=new r({Extends:o,initialize:function(t,e,i){o.call(this,t,e,i);var r=e.game;this.isWebGL=2===r.config.renderType,this.cache=r.cache.addCustom("spine"),this.spineTextures=r.cache.addCustom("spineTextures"),this.json=r.cache.json,this.textures=r.textures,this.drawDebug=!1,this.gl,this.renderer,this.sceneRenderer,this.skeletonRenderer,this.skeletonDebugRenderer,this.plugin=h,this.temp1,this.temp2,this.isWebGL?(this.runtime=h.webgl,this.renderer=r.renderer,this.gl=r.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=r.renderer,this.getAtlas=this.getAtlasCanvas),this.renderer||(this.renderer={width:r.scale.width,height:r.scale.height,preRender:d,postRender:d,render:d,destroy:d});e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",(function(t,e,s,r,n){var a=this.scene.sys[i],o=new u(this.scene,a,t,e,s,r,n);return this.displayList.add(o),this.updateList.add(o),o}),(function(t,e){void 0===t&&(t={});var r=n(t,"key",null),a=n(t,"animationName",null),o=n(t,"loop",!1),h=this.scene.sys[i],l=new u(this.scene,h,0,0,r,a,o);void 0!==e&&(t.add=e),s(this.scene,l,t);var c=n(t,"skinName",!1);c&&l.setSkinByName(c);var d=n(t,"slotName",!1),f=n(t,"attachmentName",null);return d&&l.setAttachment(d,f),l.refresh()})),e.registerGameObject("spineContainer",(function(t,e,s){var r=this.scene.sys[i],n=new c(this.scene,r,t,e,s);return this.displayList.add(n),n}),(function(t,e){void 0===t&&(t={});var r=n(t,"x",0),a=n(t,"y",0),o=n(t,"children",null),h=this.scene.sys[i],l=new c(this.scene,h,r,a,o);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(a,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this),this.game.events.once("destroy",this.gameDestroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){var t=this.renderer.spineSceneRenderer;t||(t=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0),this.renderer.spineSceneRenderer=t),this.sceneRenderer=t,this.skeletonRenderer=t.skeletonRenderer,this.skeletonDebugRenderer=t.skeletonDebugRenderer,this.temp1=new h.webgl.Vector3(0,0,0),this.temp2=new h.webgl.Vector3(0,0,0)},getAtlasCanvas:function(t){var e=this.cache.get(t);if(e){var i,s=this.spineTextures;if(s.has(t))i=s.get(t);else{var r=this.textures;i=new this.runtime.TextureAtlas(e.data,(function(t){return new h.canvas.CanvasTexture(r.get(e.prefix+t).getSourceImage())}))}return i}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var i,s=this.spineTextures;if(s.has(t))i=s.get(t);else{var r=this.textures,n=this.sceneRenderer.context.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i=new this.runtime.TextureAtlas(e.data,(function(t){return new h.webgl.GLTexture(n,r.get(e.prefix+t).getSourceImage(),!1)}))}return i}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,i,s,r,n,a){var o;if(a=a||{},Array.isArray(t))for(var h=0;h{var s=i(7473),r=i(7361),n=i(7738),a=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n){r.call(this,t,i,s,n),this.type="Spine",this.plugin=e},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null,this.plugin=null}});t.exports=a},8064:t=>{t.exports=function(t,e,i,s){var r=e.list;if(0!==r.length){i.addToRenderList(e);var n=e.localTransform;s?(n.loadIdentity(),n.multiply(s),n.translate(e.x,e.y),n.rotate(e.rotation),n.scale(e.scaleX,e.scaleY)):n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var s=i(1984),r=i(1984);r=i(8064),t.exports={renderWebGL:s,renderCanvas:r}},6576:t=>{t.exports="complete"},8621:t=>{t.exports="dispose"},8944:t=>{t.exports="end"},7494:t=>{t.exports="event"},1908:t=>{t.exports="interrupted"},5591:t=>{t.exports="start"},5146:(t,e,i)=>{t.exports={COMPLETE:i(6576),DISPOSE:i(8621),END:i(8944),EVENT:i(7494),INTERRUPTED:i(1908),START:i(5591)}},8332:(t,e,i)=>{var s=i(6412),r=i(2915),n=i(7473),a=i(1991),o=i(3131),h=i(9660),l=i(4627),u=i(3212),c=i(8414),d=i(3426),f=i(7149),p=i(2273),m=i(4208),g=i(5146),x=i(2762),v=new n({Extends:p,Mixins:[a,o,h,l,u,c,x],initialize:function(t,e,i,s,r,n,a){p.call(this,t,"Spine"),this.plugin=e,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null,this.root=null,this.bounds=null,this.drawDebug=!1,this.timeScale=1,this.displayOriginX=0,this.displayOriginY=0,this.preMultipliedAlpha=!1,this.blendMode=-1,this.setPosition(i,s),r&&this.setSkeleton(r,n,a)},willRender:function(t,e){var i=!this.skeleton||!(15!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id);if(!e&&!i&&this.parentContainer){var s=this.plugin,r=s.sceneRenderer;s.gl&&r.batcher.isDrawing&&(r.end(),s.renderer.pipelines.rebind())}return i},setAlpha:function(t,e){if(void 0===t&&(t=1),e){var i=this.findSlot(e);i&&(i.color.a=r(t,0,1))}else this.alpha=t;return this},alpha:{get:function(){return this.skeleton.color.a},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.a=e),0===e?this.renderFlags&=-3:this.renderFlags|=2}},red:{get:function(){return this.skeleton.color.r},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.r=e)}},green:{get:function(){return this.skeleton.color.g},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.g=e)}},blue:{get:function(){return this.skeleton.color.b},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.b=e)}},setColor:function(t,e){void 0===t&&(t=16777215);var i=(t>>16&255)/255,s=(t>>8&255)/255,r=(255&t)/255,n=t>16777215?(t>>>24)/255:null,a=this.skeleton;if(e){var o=this.findSlot(e);o&&(a=o)}return a.color.r=i,a.color.g=s,a.color.b=r,null!==n&&(a.color.a=n),this},setSkeletonFromJSON:function(t,e,i,s){return this.setSkeleton(t,e,i,s)},setSkeleton:function(t,e,i,s){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,s);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var n=r.skeleton;return n.setSkin(),n.setToSetupPose(),this.skeleton=n,r=this.plugin.createAnimationState(n),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=m(d(this.rotation))+90),this.state.apply(n),n.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=m(d(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,s){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===i&&(i=0),void 0===s&&(s=0),this.width=t,this.height=e,this.displayOriginX=r.x-i,this.displayOriginY=r.y-s,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,s=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=i,t.scaleY=s,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i{var s=i(3426),r=i(4208),n=i(8445);t.exports=function(t,e,i,a){var o=t.currentContext,h=e.plugin,l=e.skeleton,u=h.skeletonRenderer,c=t._tempMatrix1,d=t._tempMatrix2,f=t._tempMatrix3;i.addToRenderList(e),d.applyITRS(e.x,e.y,e.rotation,Math.abs(e.scaleX),Math.abs(e.scaleY)),c.copyFrom(i.matrix),a?(c.multiplyWithOffset(a,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),d.e=e.x,d.f=e.y,c.multiply(d,f)):(d.e-=i.scrollX*e.scrollFactorX,d.f-=i.scrollY*e.scrollFactorY,c.multiply(d,f)),l.x=f.tx,l.y=f.ty,l.scaleX=f.scaleX,l.scaleY=-1*f.scaleY,e.scaleX<0?(l.scaleX*=-1,e.root.rotation=r(f.rotationNormalized)):e.root.rotation=n(r(s(f.rotationNormalized))+90,0,360),e.scaleY<0&&(l.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*r(f.rotationNormalized):e.root.rotation+=2*r(f.rotationNormalized)),i.renderToTexture&&(l.y=f.ty,l.scaleY*=-1),l.updateWorldTransform(),u.ctx=o,u.debugRendering=h.drawDebug||e.drawDebug,o.save(),u.draw(l),o.restore()}},2762:(t,e,i)=>{var s=i(1984),r=i(1984),n=i(1984);r=i(2753),t.exports={renderWebGL:s,renderCanvas:r,renderDirect:n}},9454:(t,e,i)=>{var s={VERSION:"3.60.0",BlendModes:i(8351),ScaleModes:i(8196),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},1081:(t,e,i)=>{var s=i(7473),r=i(6748),n=new s({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(r.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],s=0;s{t.exports="changedata"},7801:t=>{t.exports="changedata-"},4873:t=>{t.exports="destroy"},9966:t=>{t.exports="removedata"},4586:t=>{t.exports="setdata"},6748:(t,e,i)=>{t.exports={CHANGE_DATA:i(9044),CHANGE_DATA_KEY:i(7801),DESTROY:i(4873),REMOVE_DATA:i(9966),SET_DATA:i(4586)}},3004:(t,e,i)=>{var s=i(2776),r={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return r;r.audioData=!!window.Audio,r.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var s=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(s||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(s)};if(r.ogg=i('ogg; codecs="vorbis"'),r.opus=i('ogg; codecs="opus"',"opus"),r.mp3=i("mpeg"),r.wav=i("wav"),r.m4a=i("x-m4a"),r.aac=i("aac"),r.flac=i("flac","x-flac"),r.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(s.edge)r.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var n=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===n&&a>=11||n>10)&&(r.dolby=!0)}}}catch(t){}return r}()},2776:(t,e,i)=>{var s,r=i(5203),n={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(s=navigator.userAgent,/Edg\/\d+/.test(s)?(n.edge=!0,n.es2019=!0):/OPR/.test(s)?(n.opera=!0,n.es2019=!0):/Chrome\/(\d+)/.test(s)&&!r.windowsPhone?(n.chrome=!0,n.chromeVersion=parseInt(RegExp.$1,10),n.es2019=n.chromeVersion>69):/Firefox\D+(\d+)/.test(s)?(n.firefox=!0,n.firefoxVersion=parseInt(RegExp.$1,10),n.es2019=n.firefoxVersion>10):/AppleWebKit/.test(s)&&r.iOS?n.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(s)?(n.ie=!0,n.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+) Safari/.test(s)&&!r.windowsPhone?(n.safari=!0,n.safariVersion=parseInt(RegExp.$1,10),n.es2019=n.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(n.ie=!0,n.trident=!0,n.tridentVersion=parseInt(RegExp.$1,10),n.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(n.silk=!0),n)},6505:(t,e,i)=>{var s,r,n,a=i(8073),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",r="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(n=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(n,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+r},n.src=s+"AP804Oa6"+r,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),s=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),s}()),o)},6543:(t,e,i)=>{var s=i(5203),r=i(2776),n=i(8073),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=n.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=n.create2D(this),s=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=s.data instanceof Uint8ClampedArray,n.remove(t),n.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!s.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},3922:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",s="FullScreen",r=["request"+i,"request"+s,"webkitRequest"+i,"webkitRequest"+s,"msRequest"+i,"msRequest"+s,"mozRequest"+s,"mozRequest"+i];for(t=0;t{var s=i(2776),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},5203:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},2131:(t,e,i)=>{var s=i(4597),r={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return r;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(r.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(r.h264=!0,r.mp4=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(r.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(r.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(r.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(r.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),r.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e{t.exports={os:i(5203),browser:i(2776),features:i(6543),input:i(1454),audio:i(3004),video:i(2131),fullscreen:i(3922),canvasFeatures:i(6505)}},5686:(t,e,i)=>{var s=i(7473),r=new Float32Array(20),n=new s({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(t){return this._matrix.set(t),this._dirty=!0,this},reset:function(){var t=this._matrix;return t.fill(0),t[0]=1,t[6]=1,t[12]=1,t[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var t=this._data;return this._dirty&&(t.set(this._matrix),t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._dirty=!1),t},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,s=-.5*(i-1);return this.multiply([i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),s=Math.sin(t),r=.213,n=.715,a=.072;return this.multiply([r+.787*i+s*-r,n+i*-n+s*-n,a+i*-a+.928*s,0,0,r+i*-r+.143*s,n+i*(1-n)+.14*s,a+i*-a+-.283*s,0,0,r+i*-r+-.787*s,n+i*-n+s*n,a+.928*i+s*a,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply(n.BLACK_WHITE,t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,s=-.5*(i-1);return this.multiply([i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply(n.NEGATIVE,t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply(n.DESATURATE_LUMINANCE,t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply(n.SEPIA,t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply(n.LSD,t)},brown:function(t){return void 0===t&&(t=!1),this.multiply(n.BROWN,t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply(n.VINTAGE,t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply(n.KODACHROME,t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply(n.TECHNICOLOR,t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply(n.POLAROID,t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply(n.SHIFT_BGR,t)},multiply:function(t,e){void 0===e&&(e=!1),e||this.reset();var i=this._matrix,s=r;return s.set(i),i.set([s[0]*t[0]+s[1]*t[5]+s[2]*t[10]+s[3]*t[15],s[0]*t[1]+s[1]*t[6]+s[2]*t[11]+s[3]*t[16],s[0]*t[2]+s[1]*t[7]+s[2]*t[12]+s[3]*t[17],s[0]*t[3]+s[1]*t[8]+s[2]*t[13]+s[3]*t[18],s[0]*t[4]+s[1]*t[9]+s[2]*t[14]+s[3]*t[19]+s[4],s[5]*t[0]+s[6]*t[5]+s[7]*t[10]+s[8]*t[15],s[5]*t[1]+s[6]*t[6]+s[7]*t[11]+s[8]*t[16],s[5]*t[2]+s[6]*t[7]+s[7]*t[12]+s[8]*t[17],s[5]*t[3]+s[6]*t[8]+s[7]*t[13]+s[8]*t[18],s[5]*t[4]+s[6]*t[9]+s[7]*t[14]+s[8]*t[19]+s[9],s[10]*t[0]+s[11]*t[5]+s[12]*t[10]+s[13]*t[15],s[10]*t[1]+s[11]*t[6]+s[12]*t[11]+s[13]*t[16],s[10]*t[2]+s[11]*t[7]+s[12]*t[12]+s[13]*t[17],s[10]*t[3]+s[11]*t[8]+s[12]*t[13]+s[13]*t[18],s[10]*t[4]+s[11]*t[9]+s[12]*t[14]+s[13]*t[19]+s[14],s[15]*t[0]+s[16]*t[5]+s[17]*t[10]+s[18]*t[15],s[15]*t[1]+s[16]*t[6]+s[17]*t[11]+s[18]*t[16],s[15]*t[2]+s[16]*t[7]+s[17]*t[12]+s[18]*t[17],s[15]*t[3]+s[16]*t[8]+s[17]*t[13]+s[18]*t[18],s[15]*t[4]+s[16]*t[9]+s[17]*t[14]+s[18]*t[19]+s[19]]),this._dirty=!0,this}});n.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],n.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],n.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],n.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],n.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],n.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],n.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],n.KODACHROME=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],n.TECHNICOLOR=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],n.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],n.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t.exports=n},8073:(t,e,i)=>{var s,r,n,a=i(9454),o=i(2150),h=[],l=!1;t.exports=(n=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return s(t,e,i,a.CANVAS)},create:s=function(t,e,i,s,n){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=a.CANVAS),void 0===n&&(n=!1);var c=r(s);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:s},s===a.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),n&&(c.parent=u),u.width=e,u.height=i,l&&s===a.CANVAS&&o.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return s(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:r=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{var s=i(7473),r=i(3649),n=new s({initialize:function(t,e,i,s,r,n){e||(e=t.sys.make.image({x:i,y:s,key:r,frame:n,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});r.register("bitmapMask",(function(t,e,i,s,r){return new n(this.scene,t,e,i,s,r)})),t.exports=n},6726:(t,e,i)=>{var s=new(i(7473))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,r=this.geometryMask,n=t.maskCount,a=255;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,n,a),s.stencilOp(s.KEEP,s.KEEP,s.INCR),n++):(s.stencilFunc(s.EQUAL,n+1,a),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),this.level=n,r.renderWebGL(t,r,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),this.invertAlpha?s.stencilFunc(s.NOTEQUAL,n,a):s.stencilFunc(s.EQUAL,n,a)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},7340:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,n.BARREL,t),this.amount=e}});t.exports=a},5170:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h){void 0===i&&(i=1),void 0===s&&(s=1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=4),r.call(this,n.BLOOM,t),this.steps=h,this.offsetX=i,this.offsetY=s,this.blurStrength=a,this.strength=o,this.glcolor=[1,1,1],null!=e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4199:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h){void 0===e&&(e=0),void 0===i&&(i=2),void 0===s&&(s=2),void 0===a&&(a=1),void 0===h&&(h=4),r.call(this,n.BLUR,t),this.quality=0,this.x=i,this.y=s,this.steps=h,this.strength=a,this.glcolor=[1,1,1],null!=o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},3132:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h,l){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===s&&(s=.2),void 0===a&&(a=!1),void 0===o&&(o=1),void 0===h&&(h=1),void 0===l&&(l=1),r.call(this,n.BOKEH,t),this.radius=e,this.amount=i,this.contrast=s,this.isTiltShift=a,this.strength=l,this.blurX=o,this.blurY=h}});t.exports=a},6610:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o){void 0===e&&(e=8),void 0===a&&(a=1),void 0===o&&(o=.005),r.call(this,n.CIRCLE,t),this.scale=a,this.feather=o,this.thickness=e,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],null!=i&&(this.color=i),null!=s&&(this.backgroundColor=s)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundColor:{get:function(){var t=this.glcolor2;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor2;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4931:(t,e,i)=>{var s=i(7473),r=i(5686),n=i(1571),a=new s({Extends:r,initialize:function(t){r.call(this),this.type=n.COLOR_MATRIX,this.gameObject=t,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});t.exports=a},6128:(t,e,i)=>{var s=new(i(7473))({initialize:function(t,e){this.type=t,this.gameObject=e,this.active=!0},setActive:function(t){return this.active=t,this},destroy:function(){this.gameObject=null,this.active=!1}});t.exports=s},9195:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===s&&(s=.005),r.call(this,n.DISPLACEMENT,t),this.x=i,this.y=s,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.gameObject.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=a},445:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a){void 0===i&&(i=4),void 0===s&&(s=0),void 0===a&&(a=!1),r.call(this,n.GLOW,t),this.outerStrength=i,this.innerStrength=s,this.knockout=a,this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},7724:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h,l,u){void 0===s&&(s=.2),void 0===a&&(a=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l=1),void 0===u&&(u=0),r.call(this,n.GRADIENT,t),this.alpha=s,this.size=u,this.fromX=a,this.fromY=o,this.toX=h,this.toY=l,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],null!=e&&(this.color1=e),null!=i&&(this.color2=i)},color1:{get:function(){var t=this.glcolor1;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor1;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}},color2:{get:function(){var t=this.glcolor2;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor2;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}}});t.exports=a},4412:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,n.PIXELATE,t),this.amount=e}});t.exports=a},75:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.1),void 0===a&&(a=1),void 0===h&&(h=6),void 0===l&&(l=1),r.call(this,n.SHADOW,t),this.x=e,this.y=i,this.decay=s,this.power=a,this.glcolor=[0,0,0,1],this.samples=h,this.intensity=l,void 0!==o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},8734:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===s&&(s=3),void 0===a&&(a=!1),r.call(this,n.SHINE,t),this.speed=e,this.lineWidth=i,this.gradient=s,this.reveal=a}});t.exports=a},2437:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===s&&(s=.5),void 0===a&&(a=.5),r.call(this,n.VIGNETTE,t),this.x=e,this.y=i,this.radius=s,this.strength=a}});t.exports=a},5984:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a){void 0===e&&(e=.1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===a&&(a=!1),r.call(this,n.WIPE,t),this.progress=0,this.wipeWidth=e,this.direction=i,this.axis=s,this.reveal=a}});t.exports=a},1571:t=>{t.exports={GLOW:4,SHADOW:5,PIXELATE:6,VIGNETTE:7,SHINE:8,BLUR:9,GRADIENT:12,BLOOM:13,COLOR_MATRIX:14,CIRCLE:15,BARREL:16,DISPLACEMENT:17,WIPE:18,BOKEH:19}},7347:(t,e,i)=>{var s=i(1030),r=i(1571),n={Barrel:i(7340),Controller:i(6128),Bloom:i(5170),Blur:i(4199),Bokeh:i(3132),Circle:i(6610),ColorMatrix:i(4931),Displacement:i(9195),Glow:i(445),Gradient:i(7724),Pixelate:i(4412),Shadow:i(75),Shine:i(8734),Vignette:i(2437),Wipe:i(5984)};n=s(!1,n,r),t.exports=n},2494:(t,e,i)=>{var s=i(8351),r=i(8361);t.exports=function(t,e,i){e.x=r(i,"x",0),e.y=r(i,"y",0),e.depth=r(i,"depth",0),e.flipX=r(i,"flipX",!1),e.flipY=r(i,"flipY",!1);var n=r(i,"scale",null);"number"==typeof n?e.setScale(n):null!==n&&(e.scaleX=r(n,"x",1),e.scaleY=r(n,"y",1));var a=r(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=r(a,"x",1),e.scrollFactorY=r(a,"y",1)),e.rotation=r(i,"rotation",0);var o=r(i,"angle",null);null!==o&&(e.angle=o),e.alpha=r(i,"alpha",1);var h=r(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),u=r(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=r(i,"blendMode",s.NORMAL),e.visible=r(i,"visible",!0),r(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},2273:(t,e,i)=>{var s=i(7473),r=i(6125),n=i(1081),a=i(4399),o=i(3389),h=i(204),l=new s({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new n(this)),this},setData:function(t,e){return this.data||(this.data=new n(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new n(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new n(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new n(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.preFX&&(this.preFX.destroy(),this.preFX=void 0),this.postFX&&(this.postFX.destroy(),this.postFX=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},3649:(t,e,i)=>{var s=i(7473),r=i(8456),n=i(204),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectFactory",a,"add"),t.exports=a},4344:(t,e,i)=>{var s=i(2915),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,r){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=r},4518:(t,e,i)=>{var s=i(2915),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=r},5173:(t,e,i)=>{var s=i(8351),r={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=r},1991:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},8305:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},3131:t=>{var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},1626:(t,e,i)=>{var s=i(7473),r=i(7347),n=i(8935),a=new s({initialize:function(t,e){this.gameObject=t,this.isPost=e,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(t){return void 0===t&&(t=0),this.padding=t,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(t){if(!this.isPost){var e=this.gameObject.scene.sys.renderer;e&&e.pipelines?(this.gameObject.pipeline=e.pipelines.FX_PIPELINE,void 0!==t&&(this.padding=t),this.enabled=!0):this.enabled=!1}},clear:function(){if(this.isPost)this.gameObject.resetPostPipeline(!0);else{for(var t=this.list,e=0;e{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},3671:(t,e,i)=>{var s=i(1392),r=i(9876),n=i(2529),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&r(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t,e){return void 0===t&&(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getTopLeft:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,r,n,a,o,h,l;if(void 0===t&&(t=new s),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),r=t.x,n=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),r=t.x,n=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,r,a,h),t.y=Math.min(i,n,o,l),t.width=Math.max(e,r,a,h)-t.x,t.height=Math.max(i,n,o,l)-t.y,t}};t.exports=a},2246:(t,e,i)=>{var s=i(7499),r=i(6726),n={mask:null,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},createBitmapMask:function(t,e,i,r,n){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new s(this.scene,t,e,i,r,n)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new r(this.scene,t)}};t.exports=n},5085:t=>{var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},77:(t,e,i)=>{var s=i(7149),r=i(1864),n=i(5851),a=i(3747),o=i(2529),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=n(t,"from",0),t.to=n(t,"to",1);var h=r(t,"positionOnPath",!1);this.rotateToPath=r(t,"rotateToPath",!1),this.pathRotationOffset=n(t,"rotationOffset",0);var l=n(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,r=this.pathVector;if(i.copy(r).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,r),i.add(r),r.add(this.pathOffset),void this.setPosition(r.x,r.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),r),i.add(r),r.add(this.pathOffset);var n=this.x,o=this.y;this.setPosition(r.x,r.y);var h=this.x-n,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+s(this.pathRotationOffset))}}};t.exports=h},986:(t,e,i)=>{var s=i(3911),r={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(t){this.pipelineData={};var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(i){void 0===t&&(t=i.default);var s=i.get(t);if(s)return this.defaultPipeline=s,this.pipeline=s,!0}return!1},setPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var n=r.pipelines;if(n){var a=n.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?s(e):e)}return this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},resetPipeline:function(t){return void 0===t&&(t=!1),this.pipeline=this.defaultPipeline,t&&(this.pipelineData={}),null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=r},4461:(t,e,i)=>{var s=i(3911),r=i(1626),n=i(8935),a={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(t){this.postPipelines=[],this.postPipelineData={},this.postFX=new r(this,!0),t&&(this.preFX=new r(this,!1))},setPostPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var n=r.pipelines;if(n){Array.isArray(t)||(t=[t]);for(var a=0;a0,this},setPostPipelineData:function(t,e){var i=this.postPipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,s=[],r=0;r=0;s--){var r=i[s];(e&&r.name===t||!e&&r===t)&&(r.destroy(),n(i,s))}return this.hasPostPipeline=this.postPipelines.length>0,this},clearFX:function(){return this.preFX&&this.preFX.clear(),this.postFX&&this.postFX.clear(),this}};t.exports=a},4627:t=>{var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},1868:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},4976:(t,e,i)=>{var s=i(2362),r={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=r},9243:(t,e,i)=>{var s=i(2362),r={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=r},5693:t=>{var e={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,s=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=s,this.tintFill=!1,this},setTintFill:function(t,e,i,s){return this.setTint(t,e,i,s),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=e},6125:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},3212:(t,e,i)=>{var s=i(7425),r=i(4227),n=i(7556),a=i(3692),o=i(2820),h=i(2529),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:0!==this._scaleY&&(this.renderFlags|=4)}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:0!==this._scaleX&&(this.renderFlags|=4)}},angle:{get:function(){return o(this._rotation*s.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.z=i,this.w=s,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*s,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(e||(e=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,s){i||(i=new h),s||(s=this.scene.sys.cameras.main);var r=s.scrollX,a=s.scrollY,o=t+r*this.scrollFactorX-r,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):n(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},4227:(t,e,i)=>{var s=i(7473),r=i(7425),n=i(2529),a=new s({initialize:function(t,e,i,s,r,n){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===r&&(r=0),void 0===n&&(n=0),this.matrix=new Float32Array([t,e,i,s,r,n,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||n?r.TAU-(n>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,r=s[0],n=s[1],a=s[2],o=s[3];return s[0]=r*i+a*e,s[1]=n*i+o*e,s[2]=r*-e+a*i,s[3]=n*-e+o*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,r=i[0],n=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=s[0],c=s[1],d=s[2],f=s[3],p=s[4],m=s[5],g=void 0===e?i:e.matrix;return g[0]=u*r+c*a,g[1]=u*n+c*o,g[2]=d*r+f*a,g[3]=d*n+f*o,g[4]=p*r+m*a+h,g[5]=p*n+m*o+l,g},multiplyWithOffset:function(t,e,i){var s=this.matrix,r=t.matrix,n=s[0],a=s[1],o=s[2],h=s[3],l=e*n+i*o+s[4],u=e*a+i*h+s[5],c=r[0],d=r[1],f=r[2],p=r[3],m=r[4],g=r[5];return s[0]=c*n+d*o,s[1]=c*a+d*h,s[2]=f*n+p*o,s[3]=f*a+p*h,s[4]=m*n+g*o+l,s[5]=m*a+g*h+u,this},transform:function(t,e,i,s,r,n){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+s*l,a[3]=i*h+s*u,a[4]=r*o+n*l+c,a[5]=r*h+n*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,r=s[0],n=s[1],a=s[2],o=s[3],h=s[4],l=s[5];return i.x=t*r+e*a+h,i.y=t*n+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=e*r-i*s;return t[0]=r/o,t[1]=-i/o,t[2]=-s/o,t[3]=e/o,t[4]=(s*a-r*n)/o,t[5]=-(e*a-i*n)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,r,n){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=s,a[4]=r,a[5]=n,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],r=e[2],n=e[3],a=i*n-s*r;if(t.translateX=e[4],t.translateY=e[5],i||s){var o=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(r||n){var h=Math.sqrt(r*r+n*n);t.rotation=.5*Math.PI-(n>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,r){var n=this.matrix,a=Math.sin(i),o=Math.cos(i);return n[4]=t,n[5]=e,n[0]=o*s,n[1]=a*s,n[2]=-a*r,n[3]=o*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new n);var s=this.matrix,r=s[0],a=s[1],o=s[2],h=s[3],l=s[4],u=s[5],c=1/(r*h+o*-a);return i.x=h*c*t+-o*c*e+(u*o-l*h)*c,i.y=r*c*e+-a*c*t+(-u*r+l*a)*c,i},setQuad:function(t,e,i,s,r,n){void 0===n&&(n=this.quad);var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return n[0]=t*o+e*l+c,n[1]=t*h+e*u+d,n[2]=t*o+s*l+c,n[3]=t*h+s*u+d,n[4]=i*o+s*l+c,n[5]=i*h+s*u+d,n[6]=i*o+e*l+c,n[7]=i*h+e*u+d,r&&n.forEach((function(t,e){n[e]=Math.round(t)})),n},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.round(s)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.round(s)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},8414:t=>{var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},4286:(t,e,i)=>{t.exports={Alpha:i(4344),AlphaSingle:i(4518),BlendMode:i(5173),ComputedSize:i(1991),Crop:i(8305),Depth:i(3131),Flip:i(9660),FX:i(1626),GetBounds:i(3671),Mask:i(2246),Origin:i(5085),PathFollower:i(77),Pipeline:i(986),PostPipeline:i(4461),ScrollFactor:i(4627),Size:i(1868),Texture:i(4976),TextureCrop:i(9243),Tint:i(5693),ToJSON:i(6125),Transform:i(3212),TransformMatrix:i(4227),Visible:i(8414)}},7361:(t,e,i)=>{var s=i(1953),r=i(8351),n=i(7473),a=i(4286),o=i(3389),h=i(2273),l=i(1392),u=i(3232),c=i(9422),d=i(2529),f=new n({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.PostPipeline,a.Transform,a.Visible,u],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(e,i),this.setBlendMode(r.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,r=!1;t.setEmpty();for(var n=0;n-1},setAll:function(t,e,i,r){return s.SetAll(this.list,t,e,i,r),this},each:function(t,e){var i,s=[null],r=this.list.slice(),n=r.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},2840:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var r=e.list;if(0!==r.length){var n=e.localTransform;s?(n.loadIdentity(),n.multiply(s),n.translate(e.x,e.y),n.rotate(e.rotation),n.scale(e.scaleX,e.scaleY)):n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var s=i(1984),r=s,n=s;n=i(2840),t.exports={renderWebGL:r,renderCanvas:n}},6608:t=>{t.exports="addedtoscene"},4265:t=>{t.exports="destroy"},8671:t=>{t.exports="removedfromscene"},3420:t=>{t.exports="complete"},601:t=>{t.exports="created"},7919:t=>{t.exports="error"},6231:t=>{t.exports="locked"},5241:t=>{t.exports="loop"},8325:t=>{t.exports="playing"},3356:t=>{t.exports="play"},7513:t=>{t.exports="seeked"},5788:t=>{t.exports="seeking"},7111:t=>{t.exports="stalled"},8118:t=>{t.exports="stop"},9184:t=>{t.exports="textureready"},4287:t=>{t.exports="unlocked"},857:t=>{t.exports="unsupported"},3389:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(6608),DESTROY:i(4265),REMOVED_FROM_SCENE:i(8671),VIDEO_COMPLETE:i(3420),VIDEO_CREATED:i(601),VIDEO_ERROR:i(7919),VIDEO_LOCKED:i(6231),VIDEO_LOOP:i(5241),VIDEO_PLAY:i(3356),VIDEO_PLAYING:i(8325),VIDEO_SEEKED:i(7513),VIDEO_SEEKING:i(5788),VIDEO_STALLED:i(7111),VIDEO_STOP:i(8118),VIDEO_TEXTURE:i(9184),VIDEO_UNLOCKED:i(4287),VIDEO_UNSUPPORTED:i(857)}},1643:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},8881:(t,e,i)=>{var s=i(7655);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},4479:(t,e,i)=>{var s=i(4771),r=i(7655);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=s(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;u{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},284:(t,e,i)=>{var s=i(7473),r=i(8881),n=i(4479),a=i(1643),o=i(3915),h=i(2529),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return n(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},3915:(t,e,i)=>{var s=i(7655);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},7655:(t,e,i)=>{var s=i(7473),r=i(1643),n=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=r.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=n},5956:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},716:(t,e,i)=>{var s=i(7120),r=i(7655);t.exports=function(t,e,i){if(void 0===i&&(i=new r),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var n=s(t)*e;return e>.5?(n-=t.width+t.height)<=t.width?(i.x=t.right-n,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(n-t.width)):n<=t.width?(i.x=t.x+n,i.y=t.y):(i.x=t.right,i.y=t.y+(n-t.width)),i}},8151:(t,e,i)=>{var s=i(716),r=i(7120);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=r(t)/i);for(var a=0;a{t.exports=function(t){return 2*(t.width+t.height)}},2161:(t,e,i)=>{var s=i(7655);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},1392:(t,e,i)=>{var s=i(7473),r=i(5956),n=i(716),a=i(8151),o=i(1643),h=i(284),l=i(2161),u=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},9422:(t,e,i)=>{var s=i(1392);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=Math.min(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-r,o=Math.max(t.bottom,e.bottom)-n;return i.setTo(r,n,a,o)}},1593:(t,e,i)=>{var s=i(7473),r=i(4359),n=i(1179),a=i(4597),o=i(5593),h=i(7410),l=i(5874),u=i(707),c=new s({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var s=a(e,"url");void 0===s?s=t.path+i+"."+a(e,"extension",""):"string"!=typeof s||s.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(s=t.path+s),this.url=s,this.src="",this.xhrSettings=u(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===r.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=r.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,s=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(s=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==r.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(n.FILE_COMPLETE,e,i,t),this.loader.emit(n.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=r.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},9845:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},5593:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},7410:(t,e,i)=>{var s=i(1030),r=i(707);t.exports=function(t,e){var i=void 0===t?r():s({},t);if(e)for(var n in e)void 0!==e[n]&&(i[n]=e[n]);return i}},3137:(t,e,i)=>{var s=i(7473),r=i(4359),n=i(1179),a=new s({initialize:function(t,e,i,s){var n=[];s.forEach((function(t){t&&n.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=n,this.state=r.FILE_PENDING,this.complete=!1,this.pending=n.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a{var s=i(7410);t.exports=function(t,e){var i=s(e,t.xhrSettings),r=new XMLHttpRequest;if(r.open("GET",t.src,i.async,i.user,i.password),r.responseType=t.xhrSettings.responseType,r.timeout=i.timeout,i.headers)for(var n in i.headers)r.setRequestHeader(n,i.headers[n]);return i.header&&i.headerValue&&r.setRequestHeader(i.header,i.headerValue),i.requestedWith&&r.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&r.overrideMimeType(i.overrideMimeType),i.withCredentials&&(r.withCredentials=!0),r.onload=t.onLoad.bind(t,r),r.onerror=t.onError.bind(t,r),r.onprogress=t.onProgress.bind(t),r.send(),r}},707:t=>{t.exports=function(t,e,i,s,r,n){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===s&&(s=""),void 0===r&&(r=0),void 0===n&&(n=!1),{responseType:t,async:e,user:i,password:s,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:n}}},4359:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},462:t=>{t.exports="addfile"},7297:t=>{t.exports="complete"},8660:t=>{t.exports="filecomplete"},6484:t=>{t.exports="filecomplete-"},7972:t=>{t.exports="loaderror"},1906:t=>{t.exports="load"},1441:t=>{t.exports="fileprogress"},1072:t=>{t.exports="postprocess"},1927:t=>{t.exports="progress"},6597:t=>{t.exports="start"},1179:(t,e,i)=>{t.exports={ADD:i(462),COMPLETE:i(7297),FILE_COMPLETE:i(8660),FILE_KEY_COMPLETE:i(6484),FILE_LOAD_ERROR:i(7972),FILE_LOAD:i(1906),FILE_PROGRESS:i(1441),POST_PROCESS:i(1072),PROGRESS:i(1927),START:i(6597)}},6732:(t,e,i)=>{var s=i(7473),r=i(4359),n=i(1593),a=i(9845),o=i(4597),h=i(2482),l=i(5593),u=new s({Extends:n,initialize:function t(e,i,s,r,a){var l,u="png";if(h(i)){var c=i;i=o(c,"key"),s=o(c,"url"),l=o(c,"normalMap"),r=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"frameConfig")}Array.isArray(s)&&(l=s[1],s=s[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:s,xhrSettings:r,config:a};if(n.call(this,e,d),l){var f=new t(e,this.key,l,r,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){n.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){n.revokeObjectURL(t.data),t.onProcessError()},n.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=r.FILE_PROCESSING,t===r.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=r.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=r.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t?t.state>=r.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(7473),r=i(4359),n=i(1593),a=i(9845),o=i(4597),h=i(5851),l=i(2482),u=new s({Extends:n,initialize:function(t,e,i,s,a){var u="json";if(l(e)){var c=e;e=o(c,"key"),i=o(c,"url"),s=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:s,config:a};n.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=r.FILE_POPULATED)},onProcess:function(){if(this.state!==r.FILE_POPULATED){this.state=r.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,s){if(Array.isArray(t))for(var r=0;r{var s=i(7473),r=i(4359),n=i(1593),a=i(9845),o=i(4597),h=i(2482),l=new s({Extends:n,initialize:function(t,e,i,s){var r="text",a="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),s=o(u,"xhrSettings"),a=o(u,"extension",a),r=o(u,"type",r),l=o(u,"cache",l)}var c={type:r,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:s};n.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{t.exports=function(t){for(var e=0,i=0;i{var s=i(3916);t.exports=function(t,e){return s(t)/s(e)/s(t-e)}},7025:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},48:t=>{t.exports=function(t,e,i,s,r){var n=.5*(s-e),a=.5*(r-i),o=t*t;return(2*i-2*s+n+a)*(t*o)+(-3*i+3*s-2*n-a)*o+n*t+i}},5035:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.ceil(t*s)/s}},2915:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},7149:(t,e,i)=>{var s=i(7425);t.exports=function(t){return t*s.DEG_TO_RAD}},2975:t=>{t.exports=function(t,e){return Math.abs(t-e)}},2107:(t,e,i)=>{var s=i(2915),r=i(7473),n=i(9652),a=i(1984),o=new n,h=new r({initialize:function t(e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=t.DefaultOrder),this._x=e,this._y=i,this._z=s,this._order=r,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,s){return void 0===s&&(s=this._order),this._x=t,this._y=e,this._z=i,this._order=s,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var r=t.val,n=r[0],a=r[4],o=r[8],h=r[1],l=r[5],u=r[9],c=r[2],d=r[6],f=r[10],p=0,m=0,g=0,x=.99999;switch(e){case"XYZ":m=Math.asin(s(o,-1,1)),Math.abs(o){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},104:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},4941:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s}},1555:(t,e,i)=>{var s=i(2915);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))+e}},5005:t=>{t.exports=function(t,e){return t/e/1e3}},3702:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},8820:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},1743:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},3416:t=>{t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},2149:(t,e,i)=>{var s=new(i(7473))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*n-a*h,c=-l*r+a*o,d=h*r-n*o,f=e*u+i*c+s*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+s*h)*f,t[2]=(a*i-s*n)*f,t[3]=c*f,t[4]=(l*e-s*o)*f,t[5]=(-a*e+s*r)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(n*e-i*r)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=n*l-a*h,t[1]=s*h-i*l,t[2]=i*a-s*n,t[3]=a*o-r*l,t[4]=e*l-s*o,t[5]=s*r-e*a,t[6]=r*h-n*o,t[7]=i*o-e*h,t[8]=e*n-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*n-a*h)+i*(-l*r+a*o)+s*(h*r-n*o)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],m=c[3],g=c[4],x=c[5],v=c[6],y=c[7],w=c[8];return e[0]=d*i+f*n+p*h,e[1]=d*s+f*a+p*l,e[2]=d*r+f*o+p*u,e[3]=m*i+g*n+x*h,e[4]=m*s+g*a+x*l,e[5]=m*r+g*o+x*u,e[6]=v*i+y*n+w*h,e[7]=v*s+y*a+w*l,e[8]=v*r+y*o+w*u,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*n,e[1]=l*s+h*a,e[2]=l*r+h*o,e[3]=l*n-h*i,e[4]=l*a-h*s,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,r=t.w,n=e+e,a=i+i,o=s+s,h=e*n,l=e*a,u=e*o,c=i*a,d=i*o,f=s*o,p=r*n,m=r*a,g=r*o,x=this.val;return x[0]=1-(c+f),x[3]=l+g,x[6]=u-m,x[1]=l-g,x[4]=1-(h+f),x[7]=d+p,x[2]=u+m,x[5]=d-p,x[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],m=e[12],g=e[13],x=e[14],v=e[15],y=s*h-r*o,w=s*l-n*o,b=s*u-a*o,A=r*l-n*h,M=r*u-a*h,S=n*u-a*l,E=c*g-d*m,I=c*x-f*m,k=c*v-p*m,T=d*x-f*g,R=d*v-p*g,C=f*v-p*x,P=y*C-w*R+b*T+A*k-M*I+S*E;return P?(P=1/P,i[0]=(h*C-l*R+u*T)*P,i[1]=(l*k-o*C-u*I)*P,i[2]=(o*R-h*k+u*E)*P,i[3]=(n*R-r*C-a*T)*P,i[4]=(s*C-n*k+a*I)*P,i[5]=(r*k-s*R-a*E)*P,i[6]=(g*S-x*M+v*A)*P,i[7]=(x*b-m*S-v*w)*P,i[8]=(m*M-g*b+v*y)*P,this):null}});t.exports=s},9652:(t,e,i)=>{var s=i(7473),r=i(5689),n=1e-6,a=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,r,n,a,o,h,l,u,c,d,f,p,m){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=s,g[4]=r,g[5]=n,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=u,g[11]=c,g[12]=d,g[13]=f,g[14]=p,g[15]=m,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=o.fromQuat(i).val,r=e.x,n=e.y,a=e.z;return this.setValues(s[0]*r,s[1]*r,s[2]*r,0,s[4]*n,s[5]*n,s[6]*n,0,s[8]*a,s[9]*a,s[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],r=t[6],n=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=s,t[13]=n,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15],x=e*a-i*n,v=e*o-s*n,y=e*h-r*n,w=i*o-s*a,b=i*h-r*a,A=s*h-r*o,M=l*p-u*f,S=l*m-c*f,E=l*g-d*f,I=u*m-c*p,k=u*g-d*p,T=c*g-d*m,R=x*T-v*k+y*I+w*E-b*S+A*M;return R?(R=1/R,this.setValues((a*T-o*k+h*I)*R,(s*k-i*T-r*I)*R,(p*A-m*b+g*w)*R,(c*b-u*A-d*w)*R,(o*E-n*T-h*S)*R,(e*T-s*E+r*S)*R,(m*y-f*A-g*v)*R,(l*A-c*y+d*v)*R,(n*k-a*E+h*M)*R,(i*E-e*k-r*M)*R,(f*b-p*y+g*x)*R,(u*y-l*b-d*x)*R,(a*S-n*I-o*M)*R,(e*I-i*S+s*M)*R,(p*v-f*w-m*x)*R,(l*w-u*v+c*x)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return this.setValues(a*(c*g-d*m)-u*(o*g-h*m)+p*(o*d-h*c),-(i*(c*g-d*m)-u*(s*g-r*m)+p*(s*d-r*c)),i*(o*g-h*m)-a*(s*g-r*m)+p*(s*h-r*o),-(i*(o*d-h*c)-a*(s*d-r*c)+u*(s*h-r*o)),-(n*(c*g-d*m)-l*(o*g-h*m)+f*(o*d-h*c)),e*(c*g-d*m)-l*(s*g-r*m)+f*(s*d-r*c),-(e*(o*g-h*m)-n*(s*g-r*m)+f*(s*h-r*o)),e*(o*d-h*c)-n*(s*d-r*c)+l*(s*h-r*o),n*(u*g-d*p)-l*(a*g-h*p)+f*(a*d-h*u),-(e*(u*g-d*p)-l*(i*g-r*p)+f*(i*d-r*u)),e*(a*g-h*p)-n*(i*g-r*p)+f*(i*h-r*a),-(e*(a*d-h*u)-n*(i*d-r*u)+l*(i*h-r*a)),-(n*(u*m-c*p)-l*(a*m-o*p)+f*(a*c-o*u)),e*(u*m-c*p)-l*(i*m-s*p)+f*(i*c-s*u),-(e*(a*m-o*p)-n*(i*m-s*p)+f*(i*o-s*a)),e*(a*c-o*u)-n*(i*c-s*u)+l*(i*o-s*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return(e*a-i*n)*(c*g-d*m)-(e*o-s*n)*(u*g-d*p)+(e*h-r*n)*(u*m-c*p)+(i*o-s*a)*(l*g-d*f)-(i*h-r*a)*(l*m-c*f)+(s*h-r*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],m=e[13],g=e[14],x=e[15],v=t.val,y=v[0],w=v[1],b=v[2],A=v[3];return e[0]=y*i+w*a+b*u+A*p,e[1]=y*s+w*o+b*c+A*m,e[2]=y*r+w*h+b*d+A*g,e[3]=y*n+w*l+b*f+A*x,y=v[4],w=v[5],b=v[6],A=v[7],e[4]=y*i+w*a+b*u+A*p,e[5]=y*s+w*o+b*c+A*m,e[6]=y*r+w*h+b*d+A*g,e[7]=y*n+w*l+b*f+A*x,y=v[8],w=v[9],b=v[10],A=v[11],e[8]=y*i+w*a+b*u+A*p,e[9]=y*s+w*o+b*c+A*m,e[10]=y*r+w*h+b*d+A*g,e[11]=y*n+w*l+b*f+A*x,y=v[12],w=v[13],b=v[14],A=v[15],e[12]=y*i+w*a+b*u+A*p,e[13]=y*s+w*o+b*c+A*m,e[14]=y*r+w*h+b*d+A*g,e[15]=y*n+w*l+b*f+A*x,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,r=i[0],n=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],f=i[6],p=i[10],m=i[14],g=i[3],x=i[7],v=i[11],y=i[15],w=s[0],b=s[4],A=s[8],M=s[12],S=s[1],E=s[5],I=s[9],k=s[13],T=s[2],R=s[6],C=s[10],P=s[14],F=s[3],O=s[7],Y=s[11],L=s[15];return this.setValues(r*w+n*S+a*T+o*F,h*w+l*S+u*T+c*F,d*w+f*S+p*T+m*F,g*w+x*S+v*T+y*F,r*b+n*E+a*R+o*O,h*b+l*E+u*R+c*O,d*b+f*E+p*R+m*O,g*b+x*E+v*R+y*O,r*A+n*I+a*C+o*Y,h*A+l*I+u*C+c*Y,d*A+f*I+p*C+m*Y,g*A+x*I+v*C+y*Y,r*M+n*k+a*P+o*L,h*M+l*k+u*P+c*L,d*M+f*k+p*P+m*L,g*M+x*k+v*P+y*L)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),r=1-i,n=t.x,a=t.y,o=t.z,h=r*n,l=r*a;return this.setValues(h*n+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*n,0,h*o-s*a,l*o+s*n,r*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,r=e.y,a=e.z,o=Math.sqrt(s*s+r*r+a*a);if(Math.abs(o){t.exports=function(t,e,i){return Math.min(t+e,i)}},44:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},5385:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},8585:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=e+1);var r=(t-e)/(i-e);return r>1?void 0!==s?(r=(s-t)/(s-i))<0&&(r=0):r=1:r<0&&(r=0),r}},372:(t,e,i)=>{var s=i(7473),r=i(2149),n=i(1984),a=i(5689),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),c=new a(0,1,0),d=new a,f=new r,p=new s({initialize:function(t,e,i,s){this.onChangeCallback=n,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=s*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),r+e*(t.z-r),n+e*(t.w-n))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=f.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+r*n+i*o-s*a,i*h+r*a+s*n-e*o,s*h+r*o+e*a-i*n,r*h-e*n-i*a-s*o)},slerp:function(t,e){var i=this.x,s=this.y,r=this.z,n=this.w,a=t.x,h=t.y,l=t.z,u=t.w,c=i*a+s*h+r*l+n*u;c<0&&(c=-c,a=-a,h=-h,l=-l,u=-u);var d=1-e,f=e;if(1-c>o){var p=Math.acos(c),m=Math.sin(p);d=Math.sin((1-e)*p)/m,f=Math.sin(e*p)/m}return this.set(d*i+f*a,d*s+f*h,d*r+f*l,d*n+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s,n=r?1/r:0;return this.set(-t*n,-e*n,-i*n,s*n)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+r*n,i*a+s*n,s*a-i*n,r*a-e*n)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a-s*n,i*a+r*n,s*a+e*n,r*a-i*n)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*n,i*a-e*n,s*a+r*n,r*a-s*n)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,r=t.z/2,n=Math.cos(i),a=Math.cos(s),o=Math.cos(r),h=Math.sin(i),l=Math.sin(s),u=Math.sin(r);switch(t.order){case"XYZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],r=i[4],n=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=s+o+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(n-l)*e,(a-r)*e,.25/e)):s>o&&s>c?(e=2*Math.sqrt(1+s-o-c),this.set(.25*e,(r+a)/e,(n+l)/e,(u-h)/e)):o>c?(e=2*Math.sqrt(1+o-s-c),this.set((r+a)/e,.25*e,(h+u)/e,(n-l)/e)):(e=2*Math.sqrt(1+c-s-o),this.set((n+l)/e,(h+u)/e,.25*e,(a-r)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var n=h[r],a=h[n];e=Math.sqrt(i[3*r+r]-i[3*n+n]-i[3*a+a]+1),l[r]=.5*e,e=.5/e,l[n]=(i[3*n+r]+i[3*r+n])*e,l[a]=(i[3*a+r]+i[3*r+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+n]-i[3*n+a])*e}return this.onChangeCallback(this),this}});t.exports=p},4208:(t,e,i)=>{var s=i(7425);t.exports=function(t){return t*s.RAD_TO_DEG}},1705:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},6650:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,r=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=s*e,t}},2037:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},6283:t=>{t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},9876:t=>{t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x-e,o=t.y-i;return t.x=a*r-o*n+e,t.y=a*n+o*r+i,t}},8348:t=>{t.exports=function(t,e,i,s,r){var n=s+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},4497:t=>{t.exports=function(t,e,i,s,r){return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},9640:(t,e,i)=>{var s=i(5689),r=i(9652),n=i(372),a=new r,o=new n,h=new s;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},4078:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},855:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},4936:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1),s*=Math.PI/t;for(var r=[],n=[],a=0;a{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},278:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},163:(t,e,i)=>{var s=i(2529);t.exports=function(t,e,i,r){void 0===r&&(r=new s);var n=0,a=0;return t>0&&t<=e*i&&(n=t>e-1?t-(a=Math.floor(t/e))*e:t),r.set(n,a)}},7556:(t,e,i)=>{var s=i(2529);t.exports=function(t,e,i,r,n,a,o,h){void 0===h&&(h=new s);var l=Math.sin(n),u=Math.cos(n),c=u*a,d=l*a,f=-l*o,p=u*o,m=1/(c*p+f*-d);return h.x=p*m*t+-f*m*e+(r*f-i*p)*m,h.y=c*m*e+-d*m*t+(-r*c+i*d)*m,h}},2529:(t,e,i)=>{var s=i(7473),r=i(12),n=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new n(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return r(this.x,t.x,e)&&r(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});n.ZERO=new n,n.RIGHT=new n(1,0),n.LEFT=new n(-1,0),n.UP=new n(0,-1),n.DOWN=new n(0,1),n.ONE=new n(1,1),t.exports=n},5689:(t,e,i)=>{var s=new(i(7473))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,r=t.z,n=e.x,a=e.y,o=e.z;return this.x=s*o-r*a,this.y=r*n-i*o,this.z=i*a-s*n,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z;return this.x=i*a-s*n,this.y=s*r-e*a,this.z=e*n-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*n,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*n,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*n,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+s*r[6],this.y=e*r[1]+i*r[4]+s*r[7],this.z=e*r[2]+i*r[5]+s*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12],this.y=r[1]*e+r[5]*i+r[9]*s+r[13],this.z=r[2]*e+r[6]*i+r[10]*s+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=e*r[0]+i*r[4]+s*r[8]+r[12],a=e*r[1]+i*r[5]+s*r[9]+r[13],o=e*r[2]+i*r[6]+s*r[10]+r[14],h=e*r[3]+i*r[7]+s*r[11]+r[15];return this.x=n/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,u=o*s+r*i-n*e,c=-r*e-n*i-a*s;return this.x=h*o+c*-r+l*-a-u*-n,this.y=l*o+c*-n+u*-r-h*-a,this.z=u*o+c*-a+h*-n-l*-r,this},project:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],c=r[6],d=r[7],f=r[8],p=r[9],m=r[10],g=r[11],x=r[12],v=r[13],y=r[14],w=1/(e*h+i*d+s*g+r[15]);return this.x=(e*n+i*l+s*f+x)*w,this.y=(e*a+i*u+s*p+v)*w,this.z=(e*o+i*c+s*m+y)*w,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,r=t.z,n=t.w,a=this.x-i,o=n-this.y-1-s,h=this.z;return this.x=2*a/r-1,this.y=2*o/n-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},9279:(t,e,i)=>{var s=new(i(7473))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=s*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this.w=n+e*(t.w-n),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+s*s+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12]*r,this.y=n[1]*e+n[5]*i+n[9]*s+n[13]*r,this.z=n[2]*e+n[6]*i+n[10]*s+n[14]*r,this.w=n[3]*e+n[7]*i+n[11]*s+n[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,u=o*s+r*i-n*e,c=-r*e-n*i-a*s;return this.x=h*o+c*-r+l*-a-u*-n,this.y=l*o+c*-n+u*-r-h*-a,this.z=u*o+c*-a+h*-n-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},4119:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},8445:t=>{t.exports=function(t,e,i){if(t>=e&&t<=i)return t;var s=i-e;return e+((t-e)%s+s)%s}},6412:t=>{t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},760:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},6909:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},6947:t=>{t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},3426:(t,e,i)=>{var s=i(7425);t.exports=function(t){return t>Math.PI&&(t-=s.PI2),Math.abs(((t+s.TAU)%s.PI2-s.PI2)%s.PI2)}},6906:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},3270:(t,e,i)=>{var s=i(104);t.exports=function(){return s(-Math.PI,Math.PI)}},2748:(t,e,i)=>{var s=i(104);t.exports=function(){return s(-180,180)}},936:(t,e,i)=>{var s=i(6906);t.exports=function(t){return s(t+Math.PI)}},1935:(t,e,i)=>{var s=i(7425);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},3692:(t,e,i)=>{var s=i(8445);t.exports=function(t){return s(t,-Math.PI,Math.PI)}},2820:(t,e,i)=>{var s=i(8445);t.exports=function(t){return s(t,-180,180)}},1833:(t,e,i)=>{t.exports={Between:i(6412),BetweenPoints:i(760),BetweenPointsY:i(6909),BetweenY:i(6947),CounterClockwise:i(3426),Normalize:i(6906),Random:i(3270),RandomDegrees:i(2748),Reverse:i(936),RotateTo:i(1935),ShortestBetween:i(5393),Wrap:i(3692),WrapDegrees:i(2820)}},7425:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},1518:t=>{t.exports=function(t,e,i,s){var r=t-i,n=e-s;return Math.sqrt(r*r+n*n)}},5372:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}},4430:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}},4361:t=>{t.exports=function(t,e,i,s){return Math.max(Math.abs(t-i),Math.abs(e-s))}},7798:t=>{t.exports=function(t,e,i,s,r){return void 0===r&&(r=2),Math.sqrt(Math.pow(i-t,r)+Math.pow(s-e,r))}},8290:t=>{t.exports=function(t,e,i,s){return Math.abs(t-i)+Math.abs(e-s)}},3788:t=>{t.exports=function(t,e,i,s){var r=t-i,n=e-s;return r*r+n*n}},6338:(t,e,i)=>{t.exports={Between:i(1518),BetweenPoints:i(5372),BetweenPointsSquared:i(4430),Chebyshev:i(4361),Power:i(7798),Snake:i(8290),Squared:i(3788)}},5751:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},6203:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},9103:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},4938:(t,e,i)=>{t.exports={In:i(5751),Out:i(9103),InOut:i(6203)}},8677:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},4649:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},504:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},8872:(t,e,i)=>{t.exports={In:i(8677),Out:i(504),InOut:i(4649)}},3170:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},2627:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},1349:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},5006:(t,e,i)=>{t.exports={In:i(3170),Out:i(1349),InOut:i(2627)}},6046:t=>{t.exports=function(t){return t*t*t}},9531:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},4836:t=>{t.exports=function(t){return--t*t*t+1}},875:(t,e,i)=>{t.exports={In:i(6046),Out:i(4836),InOut:i(9531)}},7619:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},7437:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+1}},8119:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/i)+1}},2884:(t,e,i)=>{t.exports={In:i(7619),Out:i(8119),InOut:i(7437)}},5456:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},3461:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},2711:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},6287:(t,e,i)=>{t.exports={In:i(5456),Out:i(2711),InOut:i(3461)}},8613:(t,e,i)=>{t.exports={Back:i(4938),Bounce:i(8872),Circular:i(5006),Cubic:i(875),Elastic:i(2884),Expo:i(6287),Linear:i(4233),Quadratic:i(6341),Quartic:i(762),Quintic:i(345),Sine:i(8698),Stepped:i(7051)}},744:t=>{t.exports=function(t){return t}},4233:(t,e,i)=>{t.exports=i(744)},9810:t=>{t.exports=function(t){return t*t}},8163:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},6123:t=>{t.exports=function(t){return t*(2-t)}},6341:(t,e,i)=>{t.exports={In:i(9810),Out:i(6123),InOut:i(8163)}},7337:t=>{t.exports=function(t){return t*t*t*t}},4878:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},9012:t=>{t.exports=function(t){return 1- --t*t*t*t}},762:(t,e,i)=>{t.exports={In:i(7337),Out:i(9012),InOut:i(4878)}},303:t=>{t.exports=function(t){return t*t*t*t*t}},553:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},1632:t=>{t.exports=function(t){return--t*t*t*t*t+1}},345:(t,e,i)=>{t.exports={In:i(303),Out:i(1632),InOut:i(553)}},8455:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},1844:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},990:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},8698:(t,e,i)=>{t.exports={In:i(8455),Out:i(990),InOut:i(1844)}},6745:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},7051:(t,e,i)=>{t.exports=i(6745)},3158:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},12:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},7373:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},2622:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(3158),Equal:i(12),Floor:i(1326),GreaterThan:i(7373),LessThan:i(2622)}},4675:(t,e,i)=>{var s=i(7425),r=i(1030),n={Angle:i(1833),Distance:i(6338),Easing:i(8613),Fuzzy:i(7927),Interpolation:i(2140),Pow2:i(7897),Snap:i(3943),RandomDataGenerator:i(6957),Average:i(3136),Bernstein:i(785),Between:i(7025),CatmullRom:i(48),CeilTo:i(5035),Clamp:i(2915),DegToRad:i(7149),Difference:i(2975),Euler:i(2107),Factorial:i(3916),FloatBetween:i(104),FloorTo:i(4941),FromPercent:i(1555),GetSpeed:i(5005),IsEven:i(3702),IsEvenStrict:i(8820),Linear:i(1743),LinearXY:i(3416),MaxAdd:i(3733),Median:i(44),MinSub:i(5385),Percent:i(8585),RadToDeg:i(4208),RandomXY:i(1705),RandomXYZ:i(6650),RandomXYZW:i(2037),Rotate:i(6283),RotateAround:i(9876),RotateAroundDistance:i(8348),RotateTo:i(4497),RoundAwayFromZero:i(4078),RoundTo:i(855),SinCosTableGenerator:i(4936),SmootherStep:i(278),SmoothStep:i(2733),ToXY:i(163),TransformXY:i(7556),Within:i(4119),Wrap:i(8445),Vector2:i(2529),Vector3:i(5689),Vector4:i(9279),Matrix3:i(2149),Matrix4:i(9652),Quaternion:i(372),RotateVec3:i(9640)};n=r(!1,n,s),t.exports=n},1640:(t,e,i)=>{var s=i(785);t.exports=function(t,e){for(var i=0,r=t.length-1,n=0;n<=r;n++)i+=Math.pow(1-e,r-n)*Math.pow(e,n)*t[n]*s(r,n);return i}},6105:(t,e,i)=>{var s=i(48);t.exports=function(t,e){var i=t.length-1,r=i*e,n=Math.floor(r);return t[0]===t[i]?(e<0&&(n=Math.floor(r=i*(1+e))),s(r-n,t[(n-1+i)%i],t[n],t[(n+1)%i],t[(n+2)%i])):e<0?t[0]-(s(-r,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(s(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(r-n,t[n?n-1:0],t[n],t[i{t.exports=function(t,e,i,s,r){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,r)}},6765:(t,e,i)=>{var s=i(1743);t.exports=function(t,e){var i=t.length-1,r=i*e,n=Math.floor(r);return e<0?s(t[0],t[1],r):e>1?s(t[i],t[i-1],i-r):s(t[n],t[n+1>i?i:n+1],r-n)}},6388:t=>{t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},5735:(t,e,i)=>{var s=i(2733);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},8705:(t,e,i)=>{var s=i(278);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},2140:(t,e,i)=>{t.exports={Bezier:i(1640),CatmullRom:i(6105),CubicBezier:i(4002),Linear:i(6765),QuadraticBezier:i(6388),SmoothStep:i(5735),SmootherStep:i(8705)}},5443:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},167:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},7897:(t,e,i)=>{t.exports={GetNext:i(5443),IsSize:i(725),IsValue:i(167)}},6957:(t,e,i)=>{var s=new(i(7473))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},5659:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},5461:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},5131:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},3943:(t,e,i)=>{t.exports={Ceil:i(5659),Floor:i(5461),To:i(5131)}},8666:(t,e,i)=>{var s=new(i(7473))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},8456:t=>{var e={},i={},s={register:function(t,i,s,r){void 0===r&&(r=!1),e[t]={plugin:i,mapping:s,custom:r}},registerCustom:function(t,e,s,r){i[t]={plugin:e,mapping:s,data:r}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=s},5722:(t,e,i)=>{var s=i(8666),r=i(7473),n=i(204),a=new r({Extends:s,initialize:function(t,e,i){s.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(n.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},8351:t=>{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},8196:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},3527:t=>{t.exports="resize"},8618:t=>{t.exports="addedtoscene"},4328:t=>{t.exports="boot"},6099:t=>{t.exports="create"},7645:t=>{t.exports="destroy"},2710:t=>{t.exports="pause"},2547:t=>{t.exports="postupdate"},8577:t=>{t.exports="prerender"},8197:t=>{t.exports="preupdate"},8997:t=>{t.exports="ready"},7604:t=>{t.exports="removedfromscene"},8999:t=>{t.exports="render"},9742:t=>{t.exports="resume"},3667:t=>{t.exports="shutdown"},3468:t=>{t.exports="sleep"},7840:t=>{t.exports="start"},9896:t=>{t.exports="transitioncomplete"},5103:t=>{t.exports="transitioninit"},3162:t=>{t.exports="transitionout"},7841:t=>{t.exports="transitionstart"},6454:t=>{t.exports="transitionwake"},6536:t=>{t.exports="update"},3875:t=>{t.exports="wake"},204:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(8618),BOOT:i(4328),CREATE:i(6099),DESTROY:i(7645),PAUSE:i(2710),POST_UPDATE:i(2547),PRE_RENDER:i(8577),PRE_UPDATE:i(8197),READY:i(8997),REMOVED_FROM_SCENE:i(7604),RENDER:i(8999),RESUME:i(9742),SHUTDOWN:i(3667),SLEEP:i(3468),START:i(7840),TRANSITION_COMPLETE:i(9896),TRANSITION_INIT:i(5103),TRANSITION_OUT:i(3162),TRANSITION_START:i(7841),TRANSITION_WAKE:i(6454),UPDATE:i(6536),WAKE:i(3875)}},2362:(t,e,i)=>{var s=i(7473),r=i(2915),n=i(1030),a=new s({initialize:function(t,e,i,s,r,n,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(n,a,s,r)},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.cutX=i,this.cutY=s,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var r=this.data,n=r.cut;n.x=i,n.y=s,n.w=t,n.h=e,n.r=i+t,n.b=s+e,r.sourceSize.w=t,r.sourceSize.h=e,r.spriteSourceSize.w=t,r.spriteSourceSize.h=e,r.radius=.5*Math.sqrt(t*t+e*e);var a=r.drawImage;return a.x=i,a.y=s,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,s,r,n){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=s,o.w=r,o.h=n,o.r=i+r,o.b=s+n,this.x=i,this.y=s,this.width=r,this.height=n,this.halfWidth=.5*r,this.halfHeight=.5*n,this.centerX=Math.floor(r/2),this.centerY=Math.floor(n/2),this.updateUVs()},setCropUVs:function(t,e,i,s,n,a,o){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=r(e,0,d)),m=l+(i=r(i,0,f)),g=s=r(s,0,d-e),x=n=r(n,0,f-i),v=this.data;if(v.trim){var y=v.spriteSourceSize,w=e+(s=r(s,0,u-e)),b=i+(n=r(n,0,c-i));if(!(y.rw||y.y>b)){var A=Math.max(y.x,e),M=Math.max(y.y,i),S=Math.min(y.r,w)-A,E=Math.min(y.b,b)-M;g=S,x=E,p=a?h+(u-(A-y.x)-S):h+(A-y.x),m=o?l+(c-(M-y.y)-E):l+(M-y.y),e=A,i=M,s=S,n=E}else p=0,m=0,g=0,x=0}else a&&(p=h+(u-e-s)),o&&(m=l+(c-i-n));var I=this.source.width,k=this.source.height;return t.u0=Math.max(0,p/I),t.v0=Math.max(0,m/k),t.u1=Math.min(1,(p+g)/I),t.v1=Math.min(1,(m+x)/k),t.x=e,t.y=i,t.cx=p,t.cy=m,t.cw=g,t.ch=x,t.width=s,t.height=n,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,r,n){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=s,this.u1=r,this.v1=n,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=s;var n=this.source.width,a=this.source.height;return this.u0=t/n,this.v0=e/a,this.u1=(t+i)/n,this.v1=(e+s)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=n(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},1864:t=>{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},3747:t=>{t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},7473:t=>{function e(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,s,r,a){for(var o in s)if(s.hasOwnProperty(o)){var h=e(s,o,r);if(!1!==h){if(i((a||t).prototype,o)){if(n.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=s[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},1792:t=>{t.exports=function(t,e,i,s,r){if(void 0===r&&(r=t),i>0){var n=i-t.length;if(n<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>n&&(e.splice(n),a=n);for(var o=0;o{t.exports=function(t,e,i,s,r,n){if(void 0===i&&(i=0),void 0===n&&(n=t),s>0){var a=s-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),r&&r.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;s>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),r&&r.call(n,l)}return e}},2513:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var s=i(2497);t.exports=function(t,e,i,r,n){void 0===r&&(r=0),void 0===n&&(n=t.length);var a=0;if(s(t,r,n))for(var o=r;o{t.exports=function(t,e,i){var s,r=[null];for(s=3;s{var s=i(2497);t.exports=function(t,e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=t.length),s(t,r,n)){var a,o=[null];for(a=5;a{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var s,r,n=1;if(i){if(te.length&&(n=e.length),i?(s=e[n-1][i],(r=e[n][i])-t<=t-s?e[n]:e[n-1]):(s=e[n-1],(r=e[n])-t<=t-s?r:s)}},4493:t=>{var e=function(t,i){void 0===i&&(i=[]);for(var s=0;s{var s=i(2497);t.exports=function(t,e,i,r,n){void 0===r&&(r=0),void 0===n&&(n=t.length);var a=[];if(s(t,r,n))for(var o=r;o{var s=i(2497);t.exports=function(t,e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=t.length),s(t,r,n))for(var a=r;a{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return void 0===t[s]?null:t[s]}},8683:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return s>r||(t.splice(s,1),r===t.length-1?t.push(e):t.splice(r,0,e)),t}},546:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return s{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var s=t[i-1],r=t.indexOf(s);t[i]=s,t[r]=e}return t}},1419:t=>{t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},6512:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,s){var r,n=[],a=!1;if((i||s)&&(a=!0,i||(i=""),s||(s="")),e=e;r--)a?n.push(i+r.toString()+s):n.push(r);else for(r=t;r<=e;r++)a?n.push(i+r.toString()+s):n.push(r);return n}},1316:(t,e,i)=>{var s=i(4078);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var r=[],n=Math.max(s((e-t)/(i||1)),0),a=0;a{function e(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function i(t,e){return te?1:0}var s=function(t,r,n,a,o){for(void 0===n&&(n=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>n;){if(a-n>600){var h=a-n+1,l=r-n+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(n,Math.floor(r-l*c/h+d)),p=Math.min(a,Math.floor(r+(h-l)*c/h+d));s(t,r,f,p,o)}var m=t[r],g=n,x=a;for(e(t,n,r),o(t[a],m)>0&&e(t,n,a);g0;)x--}0===o(t[n],m)?e(t,n,x):e(t,++x,a),x<=r&&(n=x+1),r<=x&&(a=x-1)}};t.exports=s},9703:(t,e,i)=>{var s=i(5851),r=i(4912),n=function(t,e,i){for(var s=[],r=0;r{var s=i(8935);t.exports=function(t,e,i,r){var n;if(void 0===r&&(r=t),!Array.isArray(e))return-1!==(n=t.indexOf(e))?(s(t,n),i&&i.call(r,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(n=t.indexOf(h))&&(s(t,n),o.push(h),i&&i.call(r,h)),a--}return o}},4725:(t,e,i)=>{var s=i(8935);t.exports=function(t,e,i,r){if(void 0===r&&(r=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var n=s(t,e);return i&&i.call(r,n),n}},8780:(t,e,i)=>{var s=i(2497);t.exports=function(t,e,i,r,n){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===n&&(n=t),s(t,e,i)){var a=i-e,o=t.splice(e,a);if(r)for(var h=0;h{var s=i(8935);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*i);return s(t,r)}},6960:t=>{t.exports=function(t,e,i){var s=t.indexOf(e),r=t.indexOf(i);return-1!==s&&-1===r&&(t[s]=i,!0)}},1021:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e,i,s){var r=t.length;if(e<0||e>r||e>=i||i>r){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},5361:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},3718:(t,e,i)=>{var s=i(2497);t.exports=function(t,e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=t.length),s(t,r,n))for(var a=r;a{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},2071:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},8935:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],r=e;r{var s=i(9356);function r(t,e){return String(t).localeCompare(e)}function n(t,e,i,s){var r,n,a,o,h,l=t.length,u=0,c=2*i;for(r=0;rl&&(n=l),a>l&&(a=l),o=r,h=n;;)if(o{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return t[s]=i,t[r]=e,t}},1953:(t,e,i)=>{t.exports={Matrix:i(1237),Add:i(1792),AddAt:i(2280),BringToTop:i(2513),CountAllMatching:i(1771),Each:i(7883),EachInRange:i(5856),FindClosestInSorted:i(3957),Flatten:i(4493),GetAll:i(6245),GetFirst:i(1647),GetRandom:i(5301),MoveDown:i(1842),MoveTo:i(1419),MoveUp:i(6512),MoveAbove:i(8683),MoveBelow:i(546),NumberArray:i(4130),NumberArrayStep:i(1316),QuickSelect:i(9465),Range:i(9703),Remove:i(7161),RemoveAt:i(4725),RemoveBetween:i(8780),RemoveRandomElement:i(5744),Replace:i(6960),RotateLeft:i(1021),RotateRight:i(4027),SafeRange:i(2497),SendToBack:i(5361),SetAll:i(3718),Shuffle:i(4912),SortByDigits:i(2071),SpliceOne:i(8935),StableSort:i(9992),Swap:i(2372)}},1816:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var s=i(7222),r=i(1816);t.exports=function(t){var e="";if(!r(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},6063:t=>{t.exports=function(t){for(var e=0;e{var s=i(7116);t.exports=function(t){return s(t,180)}},2597:(t,e,i)=>{var s=i(7116);t.exports=function(t){return s(t,90)}},7116:(t,e,i)=>{var s=i(1816),r=i(4780);t.exports=function(t,e){if(void 0===e&&(e=90),!s(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=r(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=r(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var s=i(7116);t.exports=function(t){return s(t,-90)}},7711:(t,e,i)=>{var s=i(1021),r=i(4027);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?s(t,Math.abs(i)):r(t,i)),0!==e)for(var n=0;n{t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),r=0;r-1;n--)s[r][n]=t[n][r]}return s}},1237:(t,e,i)=>{t.exports={CheckMatrix:i(1816),MatrixToString:i(6655),ReverseColumns:i(582),ReverseRows:i(6063),Rotate180:i(8321),RotateLeft:i(2597),RotateMatrix:i(7116),RotateRight:i(6285),Translate:i(7711),TransposeMatrix:i(4780)}},3911:t=>{var e=function(t){var i,s,r;if("object"!=typeof t||null===t)return t;for(r in i=Array.isArray(t)?[]:{},t)s=t[r],i[r]=e(s);return i};t.exports=e},1030:(t,e,i)=>{var s=i(2482),r=function(){var t,e,i,n,a,o,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l{var s=i(4675),r=i(5851);t.exports=function(t,e,i){var n=r(t,e,null);if(null===n)return i;if(Array.isArray(n))return s.RND.pick(n);if("object"==typeof n){if(n.hasOwnProperty("randInt"))return s.RND.integerInRange(n.randInt[0],n.randInt[1]);if(n.hasOwnProperty("randFloat"))return s.RND.realInRange(n.randFloat[0],n.randFloat[1])}else if("function"==typeof n)return n(e);return n}},4597:t=>{t.exports=function(t,e,i){var s=typeof t;return t&&"number"!==s&&"string"!==s&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},5851:t=>{t.exports=function(t,e,i,s){if(!t&&!s||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(s&&s.hasOwnProperty(e))return s[e];if(-1!==e.indexOf(".")){for(var r=e.split("."),n=t,a=s,o=i,h=i,l=!0,u=!0,c=0;c{t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},7222:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===s&&(s=3);var r=0;if(e+1>=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var n=Math.ceil((r=e-t.length)/2);t=new Array(r-n+1).join(i)+t+new Array(n+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}}},e={};var i=function i(s){var r=e[s];if(void 0!==r)return r.exports;var n=e[s]={exports:{}};return t[s](n,n.exports,i),n.exports}(4513);window.SpinePlugin=i})(); \ No newline at end of file diff --git a/plugins/spine4.1/dist/SpinePlugin.js b/plugins/spine4.1/dist/SpinePlugin.js index 38401887c..880728d78 100644 --- a/plugins/spine4.1/dist/SpinePlugin.js +++ b/plugins/spine4.1/dist/SpinePlugin.js @@ -1,21872 +1,352 @@ -window["SpinePlugin"] = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 69); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports) { +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ 4399: +/***/ ((module) => { + +"use strict"; + + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private */ +function Events() {} -// Taken from klasse by mattdesl https://github.com/mattdesl/klasse +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); -function hasGetterOrSetter (def) -{ - return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function'); -} - -function getProperty (definition, k, isClassDescriptor) -{ - // This may be a lightweight object, OR it might be a property that was defined previously. - - // For simple class descriptors we can just assume its NOT previously defined. - var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k); - - if (!isClassDescriptor && def.value && typeof def.value === 'object') - { - def = def.value; - } - - // This might be a regular property, or it may be a getter/setter the user defined in a class. - if (def && hasGetterOrSetter(def)) - { - if (typeof def.enumerable === 'undefined') - { - def.enumerable = true; - } - - if (typeof def.configurable === 'undefined') - { - def.configurable = true; - } - - return def; - } - else - { - return false; - } -} - -function hasNonConfigurable (obj, k) -{ - var prop = Object.getOwnPropertyDescriptor(obj, k); - - if (!prop) - { - return false; - } - - if (prop.value && typeof prop.value === 'object') - { - prop = prop.value; - } - - if (prop.configurable === false) - { - return true; - } - - return false; + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; } /** - * Extends the given `myClass` object's prototype with the properties of `definition`. + * Representation of a single event listener. * - * @function extend - * @ignore - * @param {Object} ctor The constructor object to mix into. - * @param {Object} definition A dictionary of functions for the class. - * @param {boolean} isClassDescriptor Is the definition a class descriptor? - * @param {Object} [extend] The parent constructor object. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private */ -function extend (ctor, definition, isClassDescriptor, extend) -{ - for (var k in definition) - { - if (!definition.hasOwnProperty(k)) - { - continue; - } - - var def = getProperty(definition, k, isClassDescriptor); - - if (def !== false) - { - // If Extends is used, we will check its prototype to see if the final variable exists. - - var parent = extend || ctor; - - if (hasNonConfigurable(parent.prototype, k)) - { - // Just skip the final property - if (Class.ignoreFinals) - { - continue; - } - - // We cannot re-define a property that is configurable=false. - // So we will consider them final and throw an error. This is by - // default so it is clear to the developer what is happening. - // You can set ignoreFinals to true if you need to extend a class - // which has configurable=false; it will simply not re-define final properties. - throw new Error('cannot override final property \'' + k + '\', set Class.ignoreFinals = true to skip'); - } - - Object.defineProperty(ctor.prototype, k, def); - } - else - { - ctor.prototype[k] = definition[k]; - } - } +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; } /** - * Applies the given `mixins` to the prototype of `myClass`. + * Add a listener for a given event. * - * @function mixin - * @ignore - * @param {Object} myClass The constructor object to mix into. - * @param {Object|Array} mixins The mixins to apply to the constructor. + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private */ -function mixin (myClass, mixins) -{ - if (!mixins) - { - return; - } +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } - if (!Array.isArray(mixins)) - { - mixins = [ mixins ]; - } + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; - for (var i = 0; i < mixins.length; i++) - { - extend(myClass, mixins[i].prototype || mixins[i]); - } + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; } /** - * Creates a new class with the given descriptor. - * The constructor, defined by the name `initialize`, - * is an optional function. If unspecified, an anonymous - * function will be used which calls the parent class (if - * one exists). + * Clear event by name. * - * You can also use `Extends` and `Mixins` to provide subclassing - * and inheritance. - * - * @class Phaser.Class - * @constructor - * @param {Object} definition a dictionary of functions for the class - * @example - * - * var MyClass = new Phaser.Class({ - * - * initialize: function() { - * this.foo = 2.0; - * }, - * - * bar: function() { - * return this.foo + 5; - * } - * }); - */ -function Class (definition) -{ - if (!definition) - { - definition = {}; - } - - // The variable name here dictates what we see in Chrome debugger - var initialize; - var Extends; - - if (definition.initialize) - { - if (typeof definition.initialize !== 'function') - { - throw new Error('initialize must be a function'); - } - - initialize = definition.initialize; - - // Usually we should avoid 'delete' in V8 at all costs. - // However, its unlikely to make any performance difference - // here since we only call this on class creation (i.e. not object creation). - delete definition.initialize; - } - else if (definition.Extends) - { - var base = definition.Extends; - - initialize = function () - { - base.apply(this, arguments); - }; - } - else - { - initialize = function () {}; - } - - if (definition.Extends) - { - initialize.prototype = Object.create(definition.Extends.prototype); - initialize.prototype.constructor = initialize; - - // For getOwnPropertyDescriptor to work, we need to act directly on the Extends (or Mixin) - - Extends = definition.Extends; - - delete definition.Extends; - } - else - { - initialize.prototype.constructor = initialize; - } - - // Grab the mixins, if they are specified... - var mixins = null; - - if (definition.Mixins) - { - mixins = definition.Mixins; - delete definition.Mixins; - } - - // First, mixin if we can. - mixin(initialize, mixins); - - // Now we grab the actual definition which defines the overrides. - extend(initialize, definition, true, Extends); - - return initialize; -} - -Class.extend = extend; -Class.mixin = mixin; -Class.ignoreFinals = false; - -module.exports = Class; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Force a value within the boundaries by clamping it to the range `min`, `max`. - * - * @function Phaser.Math.Clamp - * @since 3.0.0 - * - * @param {number} value - The value to be clamped. - * @param {number} min - The minimum bounds. - * @param {number} max - The maximum bounds. - * - * @return {number} The clamped value. - */ -var Clamp = function (value, min, max) -{ - return Math.max(min, Math.min(max, value)); -}; - -module.exports = Clamp; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * A NOOP (No Operation) callback function. - * - * Used internally by Phaser when it's more expensive to determine if a callback exists - * than it is to just invoke an empty function. - * - * @function Phaser.Utils.NOOP - * @since 3.0.0 - */ -var NOOP = function () -{ - // NOOP -}; - -module.exports = NOOP; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); -var FuzzyEqual = __webpack_require__(35); - -/** - * @classdesc - * A representation of a vector in 2D space. - * - * A two-component vector. - * - * @class Vector2 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number|Phaser.Types.Math.Vector2Like} [x=0] - The x component, or an object with `x` and `y` properties. - * @param {number} [y=x] - The y component. - */ -var Vector2 = new Class({ - - initialize: - - function Vector2 (x, y) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector2#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector2#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - } - else - { - if (y === undefined) { y = x; } - - this.x = x || 0; - this.y = y || 0; - } - }, - - /** - * Make a clone of this Vector2. - * - * @method Phaser.Math.Vector2#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} A clone of this Vector2. - */ - clone: function () - { - return new Vector2(this.x, this.y); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector2#copy - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - copy: function (src) - { - this.x = src.x || 0; - this.y = src.y || 0; - - return this; - }, - - /** - * Set the component values of this Vector from a given Vector2Like object. - * - * @method Phaser.Math.Vector2#setFromObject - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setFromObject: function (obj) - { - this.x = obj.x || 0; - this.y = obj.y || 0; - - return this; - }, - - /** - * Set the `x` and `y` components of the this Vector to the given `x` and `y` values. - * - * @method Phaser.Math.Vector2#set - * @since 3.0.0 - * - * @param {number} x - The x value to set for this Vector. - * @param {number} [y=x] - The y value to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - set: function (x, y) - { - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - }, - - /** - * This method is an alias for `Vector2.set`. - * - * @method Phaser.Math.Vector2#setTo - * @since 3.4.0 - * - * @param {number} x - The x value to set for this Vector. - * @param {number} [y=x] - The y value to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setTo: function (x, y) - { - return this.set(x, y); - }, - - /** - * Sets the `x` and `y` values of this object from a given polar coordinate. - * - * @method Phaser.Math.Vector2#setToPolar - * @since 3.0.0 - * - * @param {number} azimuth - The angular coordinate, in radians. - * @param {number} [radius=1] - The radial coordinate (length). - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setToPolar: function (azimuth, radius) - { - if (radius == null) { radius = 1; } - - this.x = Math.cos(azimuth) * radius; - this.y = Math.sin(azimuth) * radius; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict equality check against each Vector's components. - * - * @method Phaser.Math.Vector2#equals - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. - * - * @return {boolean} Whether the given Vector is equal to this Vector. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y)); - }, - - /** - * Check whether this Vector is approximately equal to a given Vector. - * - * @method Phaser.Math.Vector2#fuzzyEquals - * @since 3.23.0 - * - * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. - * @param {number} [epsilon=0.0001] - The tolerance value. - * - * @return {boolean} Whether both absolute differences of the x and y components are smaller than `epsilon`. - */ - fuzzyEquals: function (v, epsilon) - { - return (FuzzyEqual(this.x, v.x, epsilon) && FuzzyEqual(this.y, v.y, epsilon)); - }, - - /** - * Calculate the angle between this Vector and the positive x-axis, in radians. - * - * @method Phaser.Math.Vector2#angle - * @since 3.0.0 - * - * @return {number} The angle between this Vector, and the positive x-axis, given in radians. - */ - angle: function () - { - // computes the angle in radians with respect to the positive x-axis - - var angle = Math.atan2(this.y, this.x); - - if (angle < 0) - { - angle += 2 * Math.PI; - } - - return angle; - }, - - /** - * Set the angle of this Vector. - * - * @method Phaser.Math.Vector2#setAngle - * @since 3.23.0 - * - * @param {number} angle - The angle, in radians. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setAngle: function (angle) - { - return this.setToPolar(angle, this.length()); - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector2#add - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - add: function (src) - { - this.x += src.x; - this.y += src.y; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector2#subtract - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - subtract: function (src) - { - this.x -= src.x; - this.y -= src.y; - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector2#multiply - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - multiply: function (src) - { - this.x *= src.x; - this.y *= src.y; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector2#scale - * @since 3.0.0 - * - * @param {number} value - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - scale: function (value) - { - if (isFinite(value)) - { - this.x *= value; - this.y *= value; - } - else - { - this.x = 0; - this.y = 0; - } - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector2#divide - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - divide: function (src) - { - this.x /= src.x; - this.y /= src.y; - - return this; - }, - - /** - * Negate the `x` and `y` components of this Vector. - * - * @method Phaser.Math.Vector2#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#distance - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (src) - { - var dx = src.x - this.x; - var dy = src.y - this.y; - - return Math.sqrt(dx * dx + dy * dy); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector2#distanceSq - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (src) - { - var dx = src.x - this.x; - var dy = src.y - this.y; - - return dx * dx + dy * dy; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - - return Math.sqrt(x * x + y * y); - }, - - /** - * Set the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#setLength - * @since 3.23.0 - * - * @param {number} length - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setLength: function (length) - { - return this.normalize().scale(length); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector2#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - - return x * x + y * y; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector2#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var len = x * x + y * y; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - } - - return this; - }, - - /** - * Rotate this Vector to its perpendicular, in the positive direction. - * - * @method Phaser.Math.Vector2#normalizeRightHand - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalizeRightHand: function () - { - var x = this.x; - - this.x = this.y * -1; - this.y = x; - - return this; - }, - - /** - * Rotate this Vector to its perpendicular, in the negative direction. - * - * @method Phaser.Math.Vector2#normalizeLeftHand - * @since 3.23.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalizeLeftHand: function () - { - var x = this.x; - - this.x = this.y; - this.y = x * -1; - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#dot - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to dot product with this Vector2. - * - * @return {number} The dot product of this Vector and the given Vector. - */ - dot: function (src) - { - return this.x * src.x + this.y * src.y; - }, - - /** - * Calculate the cross product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#cross - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to cross with this Vector2. - * - * @return {number} The cross product of this Vector and the given Vector. - */ - cross: function (src) - { - return this.x * src.y - this.y * src.x; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector2#lerp - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - lerp: function (src, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - - this.x = ax + t * (src.x - ax); - this.y = ay + t * (src.y - ay); - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector2#transformMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - transformMat3: function (mat) - { - var x = this.x; - var y = this.y; - var m = mat.val; - - this.x = m[0] * x + m[3] * y + m[6]; - this.y = m[1] * x + m[4] * y + m[7]; - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector2#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[12]; - this.y = m[1] * x + m[5] * y + m[13]; - - return this; - }, - - /** - * Make this Vector the zero vector (0, 0). - * - * @method Phaser.Math.Vector2#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - reset: function () - { - this.x = 0; - this.y = 0; - - return this; - }, - - /** - * Limit the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#limit - * @since 3.23.0 - * - * @param {number} max - The maximum length. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - limit: function (max) - { - var len = this.length(); - - if (len && len > max) - { - this.scale(max / len); - } - - return this; - }, - - /** - * Reflect this Vector off a line defined by a normal. - * - * @method Phaser.Math.Vector2#reflect - * @since 3.23.0 - * - * @param {Phaser.Math.Vector2} normal - A vector perpendicular to the line. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - reflect: function (normal) - { - normal = normal.clone().normalize(); - - return this.subtract(normal.scale(2 * this.dot(normal))); - }, - - /** - * Reflect this Vector across another. - * - * @method Phaser.Math.Vector2#mirror - * @since 3.23.0 - * - * @param {Phaser.Math.Vector2} axis - A vector to reflect across. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - mirror: function (axis) - { - return this.reflect(axis).negate(); - }, - - /** - * Rotate this Vector by an angle amount. - * - * @method Phaser.Math.Vector2#rotate - * @since 3.23.0 - * - * @param {number} delta - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - rotate: function (delta) - { - var cos = Math.cos(delta); - var sin = Math.sin(delta); - - return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); - }, - - /** - * Project this Vector onto another. - * - * @method Phaser.Math.Vector2#project - * @since 3.60.0 - * - * @param {Phaser.Math.Vector2} src - The vector to project onto. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - project: function (src) - { - var scalar = this.dot(src) / src.dot(src); - - return this.copy(src).scale(scalar); - } - -}); - -/** - * A static zero Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.ZERO - * @type {Phaser.Math.Vector2} - * @since 3.1.0 - */ -Vector2.ZERO = new Vector2(); - -/** - * A static right Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.RIGHT - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.RIGHT = new Vector2(1, 0); - -/** - * A static left Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.LEFT - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.LEFT = new Vector2(-1, 0); - -/** - * A static up Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.UP - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.UP = new Vector2(0, -1); - -/** - * A static down Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.DOWN - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.DOWN = new Vector2(0, 1); - -/** - * A static one Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.ONE - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.ONE = new Vector2(1, 1); - -module.exports = Vector2; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MATH_CONST = { - - /** - * The value of PI * 2. - * - * @name Phaser.Math.PI2 - * @type {number} - * @since 3.0.0 - */ - PI2: Math.PI * 2, - - /** - * The value of PI * 0.5. - * - * @name Phaser.Math.TAU - * @type {number} - * @since 3.0.0 - */ - TAU: Math.PI * 0.5, - - /** - * An epsilon value (1.0e-6) - * - * @name Phaser.Math.EPSILON - * @type {number} - * @since 3.0.0 - */ - EPSILON: 1.0e-6, - - /** - * For converting degrees to radians (PI / 180) - * - * @name Phaser.Math.DEG_TO_RAD - * @type {number} - * @since 3.0.0 - */ - DEG_TO_RAD: Math.PI / 180, - - /** - * For converting radians to degrees (180 / PI) - * - * @name Phaser.Math.RAD_TO_DEG - * @type {number} - * @since 3.0.0 - */ - RAD_TO_DEG: 180 / Math.PI, - - /** - * An instance of the Random Number Generator. - * This is not set until the Game boots. - * - * @name Phaser.Math.RND - * @type {Phaser.Math.RandomDataGenerator} - * @since 3.0.0 - */ - RND: null, - - /** - * The minimum safe integer this browser supports. - * We use a const for backward compatibility with Internet Explorer. - * - * @name Phaser.Math.MIN_SAFE_INTEGER - * @type {number} - * @since 3.21.0 - */ - MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER || -9007199254740991, - - /** - * The maximum safe integer this browser supports. - * We use a const for backward compatibility with Internet Explorer. - * - * @name Phaser.Math.MAX_SAFE_INTEGER - * @type {number} - * @since 3.21.0 - */ - MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER || 9007199254740991 - -}; - -module.exports = MATH_CONST; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Tests if the start and end indexes are a safe range for the given array. - * - * @function Phaser.Utils.Array.SafeRange - * @since 3.4.0 - * - * @param {array} array - The array to check. - * @param {number} startIndex - The start index. - * @param {number} endIndex - The end index. - * @param {boolean} [throwError=true] - Throw an error if the range is out of bounds. - * - * @return {boolean} True if the range is safe, otherwise false. - */ -var SafeRange = function (array, startIndex, endIndex, throwError) -{ - var len = array.length; - - if (startIndex < 0 || - startIndex > len || - startIndex >= endIndex || - endIndex > len) - { - if (throwError) - { - throw new Error('Range Error: Values outside acceptable range'); - } - - return false; - } - else - { - return true; - } -}; - -module.exports = SafeRange; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Wrap the given `value` between `min` and `max`. - * - * @function Phaser.Math.Wrap - * @since 3.0.0 - * - * @param {number} value - The value to wrap. - * @param {number} min - The minimum value. - * @param {number} max - The maximum value. - * - * @return {number} The wrapped value. - */ -var Wrap = function (value, min, max) -{ - var range = max - min; - - return (min + ((((value - min) % range) + range) % range)); -}; - -module.exports = Wrap; - - -/***/ }), -/* 7 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * This is a slightly modified version of jQuery.isPlainObject. - * A plain object is an object whose internal class property is [object Object]. - * - * @function Phaser.Utils.Objects.IsPlainObject - * @since 3.0.0 - * - * @param {object} obj - The object to inspect. - * - * @return {boolean} `true` if the object is plain, otherwise `false`. - */ -var IsPlainObject = function (obj) -{ - // Not plain objects: - // - Any object or value whose internal [[Class]] property is not "[object Object]" - // - DOM nodes - // - window - if (!obj || typeof(obj) !== 'object' || obj.nodeType || obj === obj.window) - { - return false; - } - - // Support: Firefox <20 - // The try/catch suppresses exceptions thrown when attempting to access - // the "constructor" property of certain host objects, ie. |window.location| - // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 - try - { - if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf')) - { - return false; - } - } - catch (e) - { - return false; - } - - // If the function hasn't returned already, we're confident that - // |obj| is a plain object, created by {} or constructed with new Object - return true; -}; - -module.exports = IsPlainObject; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(4); - -/** - * Takes an angle in Phasers default clockwise format and converts it so that - * 0 is North, 90 is West, 180 is South and 270 is East, - * therefore running counter-clockwise instead of clockwise. - * - * You can pass in the angle from a Game Object using: - * - * ```javascript - * var converted = CounterClockwise(gameobject.rotation); - * ``` - * - * All values for this function are in radians. - * - * @function Phaser.Math.Angle.CounterClockwise - * @since 3.16.0 - * - * @param {number} angle - The angle to convert, in radians. - * - * @return {number} The converted angle, in radians. - */ -var CounterClockwise = function (angle) -{ - if (angle > Math.PI) - { - angle -= CONST.PI2; - } - - return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); -}; - -module.exports = CounterClockwise; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(4); - -/** - * Convert the given angle in radians, to the equivalent angle in degrees. - * - * @function Phaser.Math.RadToDeg - * @since 3.0.0 - * - * @param {number} radians - The angle in radians to convert ot degrees. - * - * @return {number} The given angle converted to degrees. - */ -var RadToDeg = function (radians) -{ - return radians * CONST.RAD_TO_DEG; -}; - -module.exports = RadToDeg; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Retrieves a value from an object, or an alternative object, falling to a back-up default value if not found. - * - * The key is a string, which can be split based on the use of the period character. - * - * For example: - * - * ```javascript - * const source = { - * lives: 3, - * render: { - * screen: { - * width: 1024 - * } - * } - * } - * - * const lives = GetValue(source, 'lives', 1); - * const width = GetValue(source, 'render.screen.width', 800); - * const height = GetValue(source, 'render.screen.height', 600); - * ``` - * - * In the code above, `lives` will be 3 because it's defined at the top level of `source`. - * The `width` value will be 1024 because it can be found inside the `render.screen` object. - * The `height` value will be 600, the default value, because it is missing from the `render.screen` object. - * - * @function Phaser.Utils.Objects.GetValue - * @since 3.0.0 - * - * @param {object} source - The primary object to try to retrieve the value from. If not found in here, `altSource` is checked. - * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. - * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. - * @param {object} [altSource] - An alternative object to retrieve the value from. If the property exists in `source` then `altSource` will not be used. - * - * @return {*} The value of the requested key. - */ -var GetValue = function (source, key, defaultValue, altSource) -{ - if ((!source && !altSource) || typeof source === 'number') - { - return defaultValue; - } - else if (source && source.hasOwnProperty(key)) - { - return source[key]; - } - else if (altSource && altSource.hasOwnProperty(key)) - { - return altSource[key]; - } - else if (key.indexOf('.') !== -1) - { - var keys = key.split('.'); - var parentA = source; - var parentB = altSource; - var valueA = defaultValue; - var valueB = defaultValue; - var valueAFound = true; - var valueBFound = true; - - // Use for loop here so we can break early - for (var i = 0; i < keys.length; i++) - { - if (parentA && parentA.hasOwnProperty(keys[i])) - { - // Yes parentA has a key property, let's carry on down - valueA = parentA[keys[i]]; - parentA = parentA[keys[i]]; - } - else - { - valueAFound = false; - } - - if (parentB && parentB.hasOwnProperty(keys[i])) - { - // Yes parentB has a key property, let's carry on down - valueB = parentB[keys[i]]; - parentB = parentB[keys[i]]; - } - else - { - valueBFound = false; - } - } - - if (valueAFound) - { - return valueA; - } - else if (valueBFound) - { - return valueB; - } - else - { - return defaultValue; - } - } - else - { - return defaultValue; - } -}; - -module.exports = GetValue; - - -/***/ }), -/* 11 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue} - * - * @function Phaser.Utils.Objects.GetFastValue - * @since 3.0.0 - * - * @param {object} source - The object to search - * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods) - * @param {*} [defaultValue] - The default value to use if the key does not exist. - * - * @return {*} The value if found; otherwise, defaultValue (null if none provided) - */ -var GetFastValue = function (source, key, defaultValue) -{ - var t = typeof(source); - - if (!source || t === 'number' || t === 'string') - { - return defaultValue; - } - else if (source.hasOwnProperty(key) && source[key] !== undefined) - { - return source[key]; - } - else - { - return defaultValue; - } -}; - -module.exports = GetFastValue; - - -/***/ }), -/* 12 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var FILE_CONST = { - - /** - * The Loader is idle. - * - * @name Phaser.Loader.LOADER_IDLE - * @type {number} - * @since 3.0.0 - */ - LOADER_IDLE: 0, - - /** - * The Loader is actively loading. - * - * @name Phaser.Loader.LOADER_LOADING - * @type {number} - * @since 3.0.0 - */ - LOADER_LOADING: 1, - - /** - * The Loader is processing files is has loaded. - * - * @name Phaser.Loader.LOADER_PROCESSING - * @type {number} - * @since 3.0.0 - */ - LOADER_PROCESSING: 2, - - /** - * The Loader has completed loading and processing. - * - * @name Phaser.Loader.LOADER_COMPLETE - * @type {number} - * @since 3.0.0 - */ - LOADER_COMPLETE: 3, - - /** - * The Loader is shutting down. - * - * @name Phaser.Loader.LOADER_SHUTDOWN - * @type {number} - * @since 3.0.0 - */ - LOADER_SHUTDOWN: 4, - - /** - * The Loader has been destroyed. - * - * @name Phaser.Loader.LOADER_DESTROYED - * @type {number} - * @since 3.0.0 - */ - LOADER_DESTROYED: 5, - - /** - * File is in the load queue but not yet started. - * - * @name Phaser.Loader.FILE_PENDING - * @type {number} - * @since 3.0.0 - */ - FILE_PENDING: 10, - - /** - * File has been started to load by the loader (onLoad called) - * - * @name Phaser.Loader.FILE_LOADING - * @type {number} - * @since 3.0.0 - */ - FILE_LOADING: 11, - - /** - * File has loaded successfully, awaiting processing. - * - * @name Phaser.Loader.FILE_LOADED - * @type {number} - * @since 3.0.0 - */ - FILE_LOADED: 12, - - /** - * File failed to load. - * - * @name Phaser.Loader.FILE_FAILED - * @type {number} - * @since 3.0.0 - */ - FILE_FAILED: 13, - - /** - * File is being processed (onProcess callback) - * - * @name Phaser.Loader.FILE_PROCESSING - * @type {number} - * @since 3.0.0 - */ - FILE_PROCESSING: 14, - - /** - * The File has errored somehow during processing. - * - * @name Phaser.Loader.FILE_ERRORED - * @type {number} - * @since 3.0.0 - */ - FILE_ERRORED: 16, - - /** - * File has finished processing. - * - * @name Phaser.Loader.FILE_COMPLETE - * @type {number} - * @since 3.0.0 - */ - FILE_COMPLETE: 17, - - /** - * File has been destroyed. - * - * @name Phaser.Loader.FILE_DESTROYED - * @type {number} - * @since 3.0.0 - */ - FILE_DESTROYED: 18, - - /** - * File was populated from local data and doesn't need an HTTP request. - * - * @name Phaser.Loader.FILE_POPULATED - * @type {number} - * @since 3.0.0 - */ - FILE_POPULATED: 19, - - /** - * File is pending being destroyed. - * - * @name Phaser.Loader.FILE_PENDING_DESTROY - * @type {number} - * @since 3.60.0 - */ - FILE_PENDING_DESTROY: 20 - -}; - -module.exports = FILE_CONST; - - -/***/ }), -/* 13 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Removes a single item from an array and returns it without creating gc, like the native splice does. - * Based on code by Mike Reinstein. - * - * @function Phaser.Utils.Array.SpliceOne - * @since 3.0.0 - * - * @param {array} array - The array to splice from. - * @param {number} index - The index of the item which should be spliced. - * - * @return {*} The item which was spliced (removed). - */ -var SpliceOne = function (array, index) -{ - if (index >= array.length) - { - return; - } - - var len = array.length - 1; - - var item = array[index]; - - for (var i = index; i < len; i++) - { - array[i] = array[i + 1]; - } - - array.length = len; - - return item; -}; - -module.exports = SpliceOne; - - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var GEOM_CONST = __webpack_require__(30); - -/** - * @classdesc - * Defines a Point in 2D space, with an x and y component. - * - * @class Point - * @memberof Phaser.Geom - * @constructor - * @since 3.0.0 - * - * @param {number} [x=0] - The x coordinate of this Point. - * @param {number} [y=x] - The y coordinate of this Point. - */ -var Point = new Class({ - - initialize: - - function Point (x, y) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = x; } - - /** - * The geometry constant type of this object: `GEOM_CONST.POINT`. - * Used for fast type comparisons. - * - * @name Phaser.Geom.Point#type - * @type {number} - * @readonly - * @since 3.19.0 - */ - this.type = GEOM_CONST.POINT; - - /** - * The x coordinate of this Point. - * - * @name Phaser.Geom.Point#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = x; - - /** - * The y coordinate of this Point. - * - * @name Phaser.Geom.Point#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = y; - }, - - /** - * Set the x and y coordinates of the point to the given values. - * - * @method Phaser.Geom.Point#setTo - * @since 3.0.0 - * - * @param {number} [x=0] - The x coordinate of this Point. - * @param {number} [y=x] - The y coordinate of this Point. - * - * @return {this} This Point object. - */ - setTo: function (x, y) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - } - -}); - -module.exports = Point; - - -/***/ }), -/* 15 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Phaser Blend Modes. - * - * @namespace Phaser.BlendModes - * @since 3.0.0 - */ - -module.exports = { - - /** - * Skips the Blend Mode check in the renderer. - * - * @name Phaser.BlendModes.SKIP_CHECK - * @type {number} - * @const - * @since 3.0.0 - */ - SKIP_CHECK: -1, - - /** - * Normal blend mode. For Canvas and WebGL. - * This is the default setting and draws new shapes on top of the existing canvas content. - * - * @name Phaser.BlendModes.NORMAL - * @type {number} - * @const - * @since 3.0.0 - */ - NORMAL: 0, - - /** - * Add blend mode. For Canvas and WebGL. - * Where both shapes overlap the color is determined by adding color values. - * - * @name Phaser.BlendModes.ADD - * @type {number} - * @const - * @since 3.0.0 - */ - ADD: 1, - - /** - * Multiply blend mode. For Canvas and WebGL. - * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. - * - * @name Phaser.BlendModes.MULTIPLY - * @type {number} - * @const - * @since 3.0.0 - */ - MULTIPLY: 2, - - /** - * Screen blend mode. For Canvas and WebGL. - * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) - * - * @name Phaser.BlendModes.SCREEN - * @type {number} - * @const - * @since 3.0.0 - */ - SCREEN: 3, - - /** - * Overlay blend mode. For Canvas only. - * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. - * - * @name Phaser.BlendModes.OVERLAY - * @type {number} - * @const - * @since 3.0.0 - */ - OVERLAY: 4, - - /** - * Darken blend mode. For Canvas only. - * Retains the darkest pixels of both layers. - * - * @name Phaser.BlendModes.DARKEN - * @type {number} - * @const - * @since 3.0.0 - */ - DARKEN: 5, - - /** - * Lighten blend mode. For Canvas only. - * Retains the lightest pixels of both layers. - * - * @name Phaser.BlendModes.LIGHTEN - * @type {number} - * @const - * @since 3.0.0 - */ - LIGHTEN: 6, - - /** - * Color Dodge blend mode. For Canvas only. - * Divides the bottom layer by the inverted top layer. - * - * @name Phaser.BlendModes.COLOR_DODGE - * @type {number} - * @const - * @since 3.0.0 - */ - COLOR_DODGE: 7, - - /** - * Color Burn blend mode. For Canvas only. - * Divides the inverted bottom layer by the top layer, and then inverts the result. - * - * @name Phaser.BlendModes.COLOR_BURN - * @type {number} - * @const - * @since 3.0.0 - */ - COLOR_BURN: 8, - - /** - * Hard Light blend mode. For Canvas only. - * A combination of multiply and screen like overlay, but with top and bottom layer swapped. - * - * @name Phaser.BlendModes.HARD_LIGHT - * @type {number} - * @const - * @since 3.0.0 - */ - HARD_LIGHT: 9, - - /** - * Soft Light blend mode. For Canvas only. - * A softer version of hard-light. Pure black or white does not result in pure black or white. - * - * @name Phaser.BlendModes.SOFT_LIGHT - * @type {number} - * @const - * @since 3.0.0 - */ - SOFT_LIGHT: 10, - - /** - * Difference blend mode. For Canvas only. - * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. - * - * @name Phaser.BlendModes.DIFFERENCE - * @type {number} - * @const - * @since 3.0.0 - */ - DIFFERENCE: 11, - - /** - * Exclusion blend mode. For Canvas only. - * Like difference, but with lower contrast. - * - * @name Phaser.BlendModes.EXCLUSION - * @type {number} - * @const - * @since 3.0.0 - */ - EXCLUSION: 12, - - /** - * Hue blend mode. For Canvas only. - * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. - * - * @name Phaser.BlendModes.HUE - * @type {number} - * @const - * @since 3.0.0 - */ - HUE: 13, - - /** - * Saturation blend mode. For Canvas only. - * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. - * - * @name Phaser.BlendModes.SATURATION - * @type {number} - * @const - * @since 3.0.0 - */ - SATURATION: 14, - - /** - * Color blend mode. For Canvas only. - * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. - * - * @name Phaser.BlendModes.COLOR - * @type {number} - * @const - * @since 3.0.0 - */ - COLOR: 15, - - /** - * Luminosity blend mode. For Canvas only. - * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. - * - * @name Phaser.BlendModes.LUMINOSITY - * @type {number} - * @const - * @since 3.0.0 - */ - LUMINOSITY: 16, - - /** - * Alpha erase blend mode. For Canvas and WebGL. - * - * @name Phaser.BlendModes.ERASE - * @type {number} - * @const - * @since 3.0.0 - */ - ERASE: 17, - - /** - * Source-in blend mode. For Canvas only. - * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. - * - * @name Phaser.BlendModes.SOURCE_IN - * @type {number} - * @const - * @since 3.0.0 - */ - SOURCE_IN: 18, - - /** - * Source-out blend mode. For Canvas only. - * The new shape is drawn where it doesn't overlap the existing canvas content. - * - * @name Phaser.BlendModes.SOURCE_OUT - * @type {number} - * @const - * @since 3.0.0 - */ - SOURCE_OUT: 19, - - /** - * Source-out blend mode. For Canvas only. - * The new shape is only drawn where it overlaps the existing canvas content. - * - * @name Phaser.BlendModes.SOURCE_ATOP - * @type {number} - * @const - * @since 3.0.0 - */ - SOURCE_ATOP: 20, - - /** - * Destination-over blend mode. For Canvas only. - * New shapes are drawn behind the existing canvas content. - * - * @name Phaser.BlendModes.DESTINATION_OVER - * @type {number} - * @const - * @since 3.0.0 - */ - DESTINATION_OVER: 21, - - /** - * Destination-in blend mode. For Canvas only. - * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. - * - * @name Phaser.BlendModes.DESTINATION_IN - * @type {number} - * @const - * @since 3.0.0 - */ - DESTINATION_IN: 22, - - /** - * Destination-out blend mode. For Canvas only. - * The existing content is kept where it doesn't overlap the new shape. - * - * @name Phaser.BlendModes.DESTINATION_OUT - * @type {number} - * @const - * @since 3.0.0 - */ - DESTINATION_OUT: 23, - - /** - * Destination-out blend mode. For Canvas only. - * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. - * - * @name Phaser.BlendModes.DESTINATION_ATOP - * @type {number} - * @const - * @since 3.0.0 - */ - DESTINATION_ATOP: 24, - - /** - * Lighten blend mode. For Canvas only. - * Where both shapes overlap the color is determined by adding color values. - * - * @name Phaser.BlendModes.LIGHTER - * @type {number} - * @const - * @since 3.0.0 - */ - LIGHTER: 25, - - /** - * Copy blend mode. For Canvas only. - * Only the new shape is shown. - * - * @name Phaser.BlendModes.COPY - * @type {number} - * @const - * @since 3.0.0 - */ - COPY: 26, - - /** - * Xor blend mode. For Canvas only. - * Shapes are made transparent where both overlap and drawn normal everywhere else. - * - * @name Phaser.BlendModes.XOR - * @type {number} - * @const - * @since 3.0.0 - */ - XOR: 27 - -}; - - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A representation of a vector in 3D space. - * - * A three-component vector. - * - * @class Vector3 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - */ -var Vector3 = new Class({ - - initialize: - - function Vector3 (x, y, z) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector3#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector3#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - /** - * The z component of this Vector. - * - * @name Phaser.Math.Vector3#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.z = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - } - }, - - /** - * Set this Vector to point up. - * - * Sets the y component of the vector to 1, and the others to 0. - * - * @method Phaser.Math.Vector3#up - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - up: function () - { - this.x = 0; - this.y = 1; - this.z = 0; - - return this; - }, - - /** - * Sets the components of this Vector to be the `Math.min` result from the given vector. - * - * @method Phaser.Math.Vector3#min - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to check the minimum values against. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - min: function (v) - { - this.x = Math.min(this.x, v.x); - this.y = Math.min(this.y, v.y); - this.z = Math.min(this.z, v.z); - - return this; - }, - - /** - * Sets the components of this Vector to be the `Math.max` result from the given vector. - * - * @method Phaser.Math.Vector3#max - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to check the maximum values against. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - max: function (v) - { - this.x = Math.max(this.x, v.x); - this.y = Math.max(this.y, v.y); - this.z = Math.max(this.z, v.z); - - return this; - }, - - /** - * Make a clone of this Vector3. - * - * @method Phaser.Math.Vector3#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. - */ - clone: function () - { - return new Vector3(this.x, this.y, this.z); - }, - - /** - * Adds the two given Vector3s and sets the results into this Vector3. - * - * @method Phaser.Math.Vector3#addVectors - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} a - The first Vector to add. - * @param {Phaser.Math.Vector3} b - The second Vector to add. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - addVectors: function (a, b) - { - this.x = a.x + b.x; - this.y = a.y + b.y; - this.z = a.z + b.z; - - return this; - }, - - /** - * Calculate the cross (vector) product of two given Vectors. - * - * @method Phaser.Math.Vector3#crossVectors - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} a - The first Vector to multiply. - * @param {Phaser.Math.Vector3} b - The second Vector to multiply. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - crossVectors: function (a, b) - { - var ax = a.x; - var ay = a.y; - var az = a.z; - var bx = b.x; - var by = b.y; - var bz = b.z; - - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict equality check against each Vector's components. - * - * @method Phaser.Math.Vector3#equals - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. - * - * @return {boolean} True if the two vectors strictly match, otherwise false. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector3#copy - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - copy: function (src) - { - this.x = src.x; - this.y = src.y; - this.z = src.z || 0; - - return this; - }, - - /** - * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. - * - * @method Phaser.Math.Vector3#set - * @since 3.0.0 - * - * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. - * @param {number} [y] - The y value to set for this Vector. - * @param {number} [z] - The z value to set for this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - set: function (x, y, z) - { - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - } - - return this; - }, - - /** - * Sets the components of this Vector3 from the position of the given Matrix4. - * - * @method Phaser.Math.Vector3#setFromMatrixPosition - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the position from. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - setFromMatrixPosition: function (m) - { - return this.fromArray(m.val, 12); - }, - - /** - * Sets the components of this Vector3 from the Matrix4 column specified. - * - * @method Phaser.Math.Vector3#setFromMatrixColumn - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the column from. - * @param {number} index - The column index. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - setFromMatrixColumn: function (mat4, index) - { - return this.fromArray(mat4.val, index * 4); - }, - - /** - * Sets the components of this Vector3 from the given array, based on the offset. - * - * Vector3.x = array[offset] - * Vector3.y = array[offset + 1] - * Vector3.z = array[offset + 2] - * - * @method Phaser.Math.Vector3#fromArray - * @since 3.50.0 - * - * @param {number[]} array - The array of values to get this Vector from. - * @param {number} [offset=0] - The offset index into the array. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - fromArray: function (array, offset) - { - if (offset === undefined) { offset = 0; } - - this.x = array[offset]; - this.y = array[offset + 1]; - this.z = array[offset + 2]; - - return this; - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector3#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - add: function (v) - { - this.x += v.x; - this.y += v.y; - this.z += v.z || 0; - - return this; - }, - - /** - * Add the given value to each component of this Vector. - * - * @method Phaser.Math.Vector3#addScalar - * @since 3.50.0 - * - * @param {number} s - The amount to add to this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - addScalar: function (s) - { - this.x += s; - this.y += s; - this.z += s; - - return this; - }, - - /** - * Add and scale a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector3#addScale - * @since 3.50.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. - * @param {number} scale - The amount to scale `v` by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - addScale: function (v, scale) - { - this.x += v.x * scale; - this.y += v.y * scale; - this.z += v.z * scale || 0; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector3#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - subtract: function (v) - { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z || 0; - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - multiply: function (v) - { - this.x *= v.x; - this.y *= v.y; - this.z *= v.z || 1; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector3#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - scale: function (scale) - { - if (isFinite(scale)) - { - this.x *= scale; - this.y *= scale; - this.z *= scale; - } - else - { - this.x = 0; - this.y = 0; - this.z = 0; - } - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#divide - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - divide: function (v) - { - this.x /= v.x; - this.y /= v.y; - this.z /= v.z || 1; - - return this; - }, - - /** - * Negate the `x`, `y` and `z` components of this Vector. - * - * @method Phaser.Math.Vector3#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector3#distance - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - - return Math.sqrt(dx * dx + dy * dy + dz * dz); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector3#distanceSq - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - - return dx * dx + dy * dy + dz * dz; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector3#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return Math.sqrt(x * x + y * y + z * z); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector3#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return x * x + y * y + z * z; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector3#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var len = x * x + y * y + z * z; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - this.z = z * len; - } - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector3#dot - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. - * - * @return {number} The dot product of this Vector and `v`. - */ - dot: function (v) - { - return this.x * v.x + this.y * v.y + this.z * v.z; - }, - - /** - * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. - * - * @method Phaser.Math.Vector3#cross - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector to cross product with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - cross: function (v) - { - var ax = this.x; - var ay = this.y; - var az = this.z; - var bx = v.x; - var by = v.y; - var bz = v.z; - - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - - return this; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector3#lerp - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - lerp: function (v, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - var az = this.z; - - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - - return this; - }, - - /** - * Takes a Matrix3 and applies it to this Vector3. - * - * @method Phaser.Math.Vector3#applyMatrix3 - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix3} mat3 - The Matrix3 to apply to this Vector3. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - applyMatrix3: function (mat3) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat3.val; - - this.x = m[0] * x + m[3] * y + m[6] * z; - this.y = m[1] * x + m[4] * y + m[7] * z; - this.z = m[2] * x + m[5] * y + m[8] * z; - - return this; - }, - - /** - * Takes a Matrix4 and applies it to this Vector3. - * - * @method Phaser.Math.Vector3#applyMatrix4 - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to apply to this Vector3. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - applyMatrix4: function (mat4) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat4.val; - - var w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]); - - this.x = (m[0] * x + m[4] * y + m[8] * z + m[12]) * w; - this.y = (m[1] * x + m[5] * y + m[9] * z + m[13]) * w; - this.z = (m[2] * x + m[6] * y + m[10] * z + m[14]) * w; - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector3#transformMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat3: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = x * m[0] + y * m[3] + z * m[6]; - this.y = x * m[1] + y * m[4] + z * m[7]; - this.z = x * m[2] + y * m[5] + z * m[8]; - - return this; - }, - - /** - * Transform this Vector with the given Matrix4. - * - * @method Phaser.Math.Vector3#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; - this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; - this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; - - return this; - }, - - /** - * Transforms the coordinates of this Vector3 with the given Matrix4. - * - * @method Phaser.Math.Vector3#transformCoordinates - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformCoordinates: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; - var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; - var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; - var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; - - this.x = tx / tw; - this.y = ty / tw; - this.z = tz / tw; - - return this; - }, - - /** - * Transform this Vector with the given Quaternion. - * - * @method Phaser.Math.Vector3#transformQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformQuat: function (q) - { - // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations - var x = this.x; - var y = this.y; - var z = this.z; - var qx = q.x; - var qy = q.y; - var qz = q.z; - var qw = q.w; - - // calculate quat * vec - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = -qx * x - qy * y - qz * z; - - // calculate result * inverse quat - this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; - this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; - this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; - - return this; - }, - - /** - * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, - * e.g. unprojecting a 2D point into 3D space. - * - * @method Phaser.Math.Vector3#project - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - project: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var a00 = m[0]; - var a01 = m[1]; - var a02 = m[2]; - var a03 = m[3]; - var a10 = m[4]; - var a11 = m[5]; - var a12 = m[6]; - var a13 = m[7]; - var a20 = m[8]; - var a21 = m[9]; - var a22 = m[10]; - var a23 = m[11]; - var a30 = m[12]; - var a31 = m[13]; - var a32 = m[14]; - var a33 = m[15]; - - var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); - - this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; - this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; - this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; - - return this; - }, - - /** - * Multiplies this Vector3 by the given view and projection matrices. - * - * @method Phaser.Math.Vector3#projectViewMatrix - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} viewMatrix - A View Matrix. - * @param {Phaser.Math.Matrix4} projectionMatrix - A Projection Matrix. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - projectViewMatrix: function (viewMatrix, projectionMatrix) - { - return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix); - }, - - /** - * Multiplies this Vector3 by the given inversed projection matrix and world matrix. - * - * @method Phaser.Math.Vector3#unprojectViewMatrix - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} projectionMatrix - An inversed Projection Matrix. - * @param {Phaser.Math.Matrix4} worldMatrix - A World View Matrix. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - unprojectViewMatrix: function (projectionMatrix, worldMatrix) - { - return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix); - }, - - /** - * Unproject this point from 2D space to 3D space. - * The point should have its x and y properties set to - * 2D screen space, and the z either at 0 (near plane) - * or 1 (far plane). The provided matrix is assumed to already - * be combined, i.e. projection * view * model. - * - * After this operation, this vector's (x, y, z) components will - * represent the unprojected 3D coordinate. - * - * @method Phaser.Math.Vector3#unproject - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. - * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - unproject: function (viewport, invProjectionView) - { - var viewX = viewport.x; - var viewY = viewport.y; - var viewWidth = viewport.z; - var viewHeight = viewport.w; - - var x = this.x - viewX; - var y = (viewHeight - this.y - 1) - viewY; - var z = this.z; - - this.x = (2 * x) / viewWidth - 1; - this.y = (2 * y) / viewHeight - 1; - this.z = 2 * z - 1; - - return this.project(invProjectionView); - }, - - /** - * Make this Vector the zero vector (0, 0, 0). - * - * @method Phaser.Math.Vector3#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - reset: function () - { - this.x = 0; - this.y = 0; - this.z = 0; - - return this; - } - -}); - -/** - * A static zero Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ZERO - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.ZERO = new Vector3(); - -/** - * A static right Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.RIGHT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.RIGHT = new Vector3(1, 0, 0); - -/** - * A static left Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.LEFT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.LEFT = new Vector3(-1, 0, 0); - -/** - * A static up Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.UP - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.UP = new Vector3(0, -1, 0); - -/** - * A static down Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.DOWN - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.DOWN = new Vector3(0, 1, 0); - -/** - * A static forward Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.FORWARD - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.FORWARD = new Vector3(0, 0, 1); - -/** - * A static back Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.BACK - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.BACK = new Vector3(0, 0, -1); - -/** - * A static one Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ONE - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.ONE = new Vector3(1, 1, 1); - -module.exports = Vector3; - - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CheckMatrix = __webpack_require__(27); -var TransposeMatrix = __webpack_require__(61); - -/** - * Rotates the array matrix based on the given rotation value. - * - * The value can be given in degrees: 90, -90, 270, -270 or 180, - * or a string command: `rotateLeft`, `rotateRight` or `rotate180`. - * - * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.RotateMatrix - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array to rotate. - * @param {(number|string)} [direction=90] - The amount to rotate the matrix by. - * - * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. - */ -var RotateMatrix = function (matrix, direction) -{ - if (direction === undefined) { direction = 90; } - - if (!CheckMatrix(matrix)) - { - return null; - } - - if (typeof direction !== 'string') - { - direction = ((direction % 360) + 360) % 360; - } - - if (direction === 90 || direction === -270 || direction === 'rotateLeft') - { - matrix = TransposeMatrix(matrix); - matrix.reverse(); - } - else if (direction === -90 || direction === 270 || direction === 'rotateRight') - { - matrix.reverse(); - matrix = TransposeMatrix(matrix); - } - else if (Math.abs(direction) === 180 || direction === 'rotate180') - { - for (var i = 0; i < matrix.length; i++) - { - matrix[i].reverse(); - } - - matrix.reverse(); - } - - return matrix; -}; - -module.exports = RotateMatrix; - - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var OS = __webpack_require__(28); - -/** - * Determines the browser type and version running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.browser` from within any Scene. - * - * @typedef {object} Phaser.Device.Browser - * @since 3.0.0 - * - * @property {boolean} chrome - Set to true if running in Chrome. - * @property {boolean} edge - Set to true if running in Microsoft Edge browser. - * @property {boolean} firefox - Set to true if running in Firefox. - * @property {boolean} ie - Set to true if running in Internet Explorer 11 or less (not Edge). - * @property {boolean} mobileSafari - Set to true if running in Mobile Safari. - * @property {boolean} opera - Set to true if running in Opera. - * @property {boolean} safari - Set to true if running in Safari. - * @property {boolean} silk - Set to true if running in the Silk browser (as used on the Amazon Kindle) - * @property {boolean} trident - Set to true if running a Trident version of Internet Explorer (IE11+) - * @property {number} chromeVersion - If running in Chrome this will contain the major version number. - * @property {number} firefoxVersion - If running in Firefox this will contain the major version number. - * @property {number} ieVersion - If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Browser.trident and Browser.tridentVersion. - * @property {number} safariVersion - If running in Safari this will contain the major version number. - * @property {number} tridentVersion - If running in Internet Explorer 11 this will contain the major version number. See {@link http://msdn.microsoft.com/en-us/library/ie/ms537503(v=vs.85).aspx} - */ -var Browser = { - - chrome: false, - chromeVersion: 0, - edge: false, - firefox: false, - firefoxVersion: 0, - ie: false, - ieVersion: 0, - mobileSafari: false, - opera: false, - safari: false, - safariVersion: 0, - silk: false, - trident: false, - tridentVersion: 0, - es2019: false - -}; - -function init () -{ - var ua = navigator.userAgent; - - if ((/Edg\/\d+/).test(ua)) - { - Browser.edge = true; - Browser.es2019 = true; - } - else if ((/OPR/).test(ua)) { - Browser.opera = true; - Browser.es2019 = true; - } - else if ((/Chrome\/(\d+)/).test(ua) && !OS.windowsPhone) - { - Browser.chrome = true; - Browser.chromeVersion = parseInt(RegExp.$1, 10); - Browser.es2019 = (Browser.chromeVersion > 69); - } - else if ((/Firefox\D+(\d+)/).test(ua)) - { - Browser.firefox = true; - Browser.firefoxVersion = parseInt(RegExp.$1, 10); - Browser.es2019 = (Browser.firefoxVersion > 10); - } - else if ((/AppleWebKit/).test(ua) && OS.iOS) - { - Browser.mobileSafari = true; - } - else if ((/MSIE (\d+\.\d+);/).test(ua)) - { - Browser.ie = true; - Browser.ieVersion = parseInt(RegExp.$1, 10); - } - else if ((/Version\/(\d+\.\d+) Safari/).test(ua) && !OS.windowsPhone) - { - Browser.safari = true; - Browser.safariVersion = parseInt(RegExp.$1, 10); - Browser.es2019 = (Browser.safariVersion > 10); - } - else if ((/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/).test(ua)) - { - Browser.ie = true; - Browser.trident = true; - Browser.tridentVersion = parseInt(RegExp.$1, 10); - Browser.ieVersion = parseInt(RegExp.$3, 10); - } - - // Silk gets its own if clause because its ua also contains 'Safari' - if ((/Silk/).test(ua)) - { - Browser.silk = true; - } - - return Browser; -} - -module.exports = init(); - - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var IsPlainObject = __webpack_require__(7); - -// @param {boolean} deep - Perform a deep copy? -// @param {object} target - The target object to copy to. -// @return {object} The extended object. - -/** - * This is a slightly modified version of http://api.jquery.com/jQuery.extend/ - * - * @function Phaser.Utils.Objects.Extend - * @since 3.0.0 - * - * @param {...*} [args] - The objects that will be mixed. - * - * @return {object} The extended object. - */ -var Extend = function () -{ - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if (typeof target === 'boolean') - { - deep = target; - target = arguments[1] || {}; - - // skip the boolean and the target - i = 2; - } - - // extend Phaser if only one argument is passed - if (length === i) - { - target = this; - --i; - } - - for (; i < length; i++) - { - // Only deal with non-null/undefined values - if ((options = arguments[i]) != null) - { - // Extend the base object - for (name in options) - { - src = target[name]; - copy = options[name]; - - // Prevent never-ending loop - if (target === copy) - { - continue; - } - - // Recurse if we're merging plain objects or arrays - if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) - { - if (copyIsArray) - { - copyIsArray = false; - clone = src && Array.isArray(src) ? src : []; - } - else - { - clone = src && IsPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[name] = Extend(deep, clone, copy); - - // Don't bring in undefined values - } - else if (copy !== undefined) - { - target[name] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -module.exports = Extend; - - -/***/ }), -/* 20 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Generate a random floating point number between the two given bounds, minimum inclusive, maximum exclusive. - * - * @function Phaser.Math.FloatBetween - * @since 3.0.0 - * - * @param {number} min - The lower bound for the float, inclusive. - * @param {number} max - The upper bound for the float exclusive. - * - * @return {number} A random float within the given range. - */ -var FloatBetween = function (min, max) -{ - return Math.random() * (max - min) + min; -}; - -module.exports = FloatBetween; - - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(4); - -/** - * Convert the given angle from degrees, to the equivalent angle in radians. - * - * @function Phaser.Math.DegToRad - * @since 3.0.0 - * - * @param {number} degrees - The angle (in degrees) to convert to radians. - * - * @return {number} The given angle converted to radians. - */ -var DegToRad = function (degrees) -{ - return degrees * CONST.DEG_TO_RAD; -}; - -module.exports = DegToRad; - - -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Vector3 = __webpack_require__(16); - -/** - * @ignore - */ -var EPSILON = 0.000001; - -/** - * @classdesc - * A four-dimensional matrix. - * - * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji - * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - * - * @class Matrix4 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. - */ -var Matrix4 = new Class({ - - initialize: - - function Matrix4 (m) - { - /** - * The matrix values. - * - * @name Phaser.Math.Matrix4#val - * @type {Float32Array} - * @since 3.0.0 - */ - this.val = new Float32Array(16); - - if (m) - { - // Assume Matrix4 with val: - this.copy(m); - } - else - { - // Default to identity - this.identity(); - } - }, - - /** - * Make a clone of this Matrix4. - * - * @method Phaser.Math.Matrix4#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} A clone of this Matrix4. - */ - clone: function () - { - return new Matrix4(this); - }, - - /** - * This method is an alias for `Matrix4.copy`. - * - * @method Phaser.Math.Matrix4#set - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. - * - * @return {this} This Matrix4. - */ - set: function (src) - { - return this.copy(src); - }, - - /** - * Sets all values of this Matrix4. - * - * @method Phaser.Math.Matrix4#setValues - * @since 3.50.0 - * - * @param {number} m00 - The m00 value. - * @param {number} m01 - The m01 value. - * @param {number} m02 - The m02 value. - * @param {number} m03 - The m03 value. - * @param {number} m10 - The m10 value. - * @param {number} m11 - The m11 value. - * @param {number} m12 - The m12 value. - * @param {number} m13 - The m13 value. - * @param {number} m20 - The m20 value. - * @param {number} m21 - The m21 value. - * @param {number} m22 - The m22 value. - * @param {number} m23 - The m23 value. - * @param {number} m30 - The m30 value. - * @param {number} m31 - The m31 value. - * @param {number} m32 - The m32 value. - * @param {number} m33 - The m33 value. - * - * @return {this} This Matrix4 instance. - */ - setValues: function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) - { - var out = this.val; - - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m03; - out[4] = m10; - out[5] = m11; - out[6] = m12; - out[7] = m13; - out[8] = m20; - out[9] = m21; - out[10] = m22; - out[11] = m23; - out[12] = m30; - out[13] = m31; - out[14] = m32; - out[15] = m33; - - return this; - }, - - /** - * Copy the values of a given Matrix into this Matrix. - * - * @method Phaser.Math.Matrix4#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. - * - * @return {this} This Matrix4. - */ - copy: function (src) - { - var a = src.val; - - return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); - }, - - /** - * Set the values of this Matrix from the given array. - * - * @method Phaser.Math.Matrix4#fromArray - * @since 3.0.0 - * - * @param {number[]} a - The array to copy the values from. Must have at least 16 elements. - * - * @return {this} This Matrix4. - */ - fromArray: function (a) - { - return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); - }, - - /** - * Reset this Matrix. - * - * Sets all values to `0`. - * - * @method Phaser.Math.Matrix4#zero - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - zero: function () - { - return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - }, - - /** - * Generates a transform matrix based on the given position, scale and rotation. - * - * @method Phaser.Math.Matrix4#transform - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} position - The position vector. - * @param {Phaser.Math.Vector3} scale - The scale vector. - * @param {Phaser.Math.Quaternion} rotation - The rotation quaternion. - * - * @return {this} This Matrix4. - */ - transform: function (position, scale, rotation) - { - var rotMatrix = _tempMat1.fromQuat(rotation); - - var rm = rotMatrix.val; - - var sx = scale.x; - var sy = scale.y; - var sz = scale.z; - - return this.setValues( - rm[0] * sx, - rm[1] * sx, - rm[2] * sx, - 0, - - rm[4] * sy, - rm[5] * sy, - rm[6] * sy, - 0, - - rm[8] * sz, - rm[9] * sz, - rm[10] * sz, - 0, - - position.x, - position.y, - position.z, - 1 - ); - }, - - /** - * Set the `x`, `y` and `z` values of this Matrix. - * - * @method Phaser.Math.Matrix4#xyz - * @since 3.0.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {number} z - The z value. - * - * @return {this} This Matrix4. - */ - xyz: function (x, y, z) - { - this.identity(); - - var out = this.val; - - out[12] = x; - out[13] = y; - out[14] = z; - - return this; - }, - - /** - * Set the scaling values of this Matrix. - * - * @method Phaser.Math.Matrix4#scaling - * @since 3.0.0 - * - * @param {number} x - The x scaling value. - * @param {number} y - The y scaling value. - * @param {number} z - The z scaling value. - * - * @return {this} This Matrix4. - */ - scaling: function (x, y, z) - { - this.zero(); - - var out = this.val; - - out[0] = x; - out[5] = y; - out[10] = z; - out[15] = 1; - - return this; - }, - - /** - * Reset this Matrix to an identity (default) matrix. - * - * @method Phaser.Math.Matrix4#identity - * @since 3.0.0 - * - * @return {this} This Matrix4. - */ - identity: function () - { - return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); - }, - - /** - * Transpose this Matrix. - * - * @method Phaser.Math.Matrix4#transpose - * @since 3.0.0 - * - * @return {this} This Matrix4. - */ - transpose: function () - { - var a = this.val; - - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a12 = a[6]; - var a13 = a[7]; - var a23 = a[11]; - - a[1] = a[4]; - a[2] = a[8]; - a[3] = a[12]; - a[4] = a01; - a[6] = a[9]; - a[7] = a[13]; - a[8] = a02; - a[9] = a12; - a[11] = a[14]; - a[12] = a03; - a[13] = a13; - a[14] = a23; - - return this; - }, - - /** - * Copies the given Matrix4 into this Matrix and then inverses it. - * - * @method Phaser.Math.Matrix4#getInverse - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to invert into this Matrix4. - * - * @return {this} This Matrix4. - */ - getInverse: function (m) - { - this.copy(m); - - return this.invert(); - }, - - /** - * Invert this Matrix. - * - * @method Phaser.Math.Matrix4#invert - * @since 3.0.0 - * - * @return {this} This Matrix4. - */ - invert: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) - { - return this; - } - - det = 1 / det; - - return this.setValues( - (a11 * b11 - a12 * b10 + a13 * b09) * det, - (a02 * b10 - a01 * b11 - a03 * b09) * det, - (a31 * b05 - a32 * b04 + a33 * b03) * det, - (a22 * b04 - a21 * b05 - a23 * b03) * det, - (a12 * b08 - a10 * b11 - a13 * b07) * det, - (a00 * b11 - a02 * b08 + a03 * b07) * det, - (a32 * b02 - a30 * b05 - a33 * b01) * det, - (a20 * b05 - a22 * b02 + a23 * b01) * det, - (a10 * b10 - a11 * b08 + a13 * b06) * det, - (a01 * b08 - a00 * b10 - a03 * b06) * det, - (a30 * b04 - a31 * b02 + a33 * b00) * det, - (a21 * b02 - a20 * b04 - a23 * b00) * det, - (a11 * b07 - a10 * b09 - a12 * b06) * det, - (a00 * b09 - a01 * b07 + a02 * b06) * det, - (a31 * b01 - a30 * b03 - a32 * b00) * det, - (a20 * b03 - a21 * b01 + a22 * b00) * det - ); - }, - - /** - * Calculate the adjoint, or adjugate, of this Matrix. - * - * @method Phaser.Math.Matrix4#adjoint - * @since 3.0.0 - * - * @return {this} This Matrix4. - */ - adjoint: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - return this.setValues( - (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)), - -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), - (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)), - -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), - -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)), - (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)), - -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)), - (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)), - (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)), - -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)), - (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)), - -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)), - -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)), - (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)), - -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)), - (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)) - ); - }, - - /** - * Calculate the determinant of this Matrix. - * - * @method Phaser.Math.Matrix4#determinant - * @since 3.0.0 - * - * @return {number} The determinant of this Matrix. - */ - determinant: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * @method Phaser.Math.Matrix4#multiply - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. - * - * @return {this} This Matrix4. - */ - multiply: function (src) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b = src.val; - - // Cache only the current line of the second matrix - var b0 = b[0]; - var b1 = b[1]; - var b2 = b[2]; - var b3 = b[3]; - - a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[4]; - b1 = b[5]; - b2 = b[6]; - b3 = b[7]; - - a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[8]; - b1 = b[9]; - b2 = b[10]; - b3 = b[11]; - - a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[12]; - b1 = b[13]; - b2 = b[14]; - b3 = b[15]; - - a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - return this; - }, - - /** - * Multiply the values of this Matrix4 by those given in the `src` argument. - * - * @method Phaser.Math.Matrix4#multiplyLocal - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. - * - * @return {this} This Matrix4. - */ - multiplyLocal: function (src) - { - var a = this.val; - var b = src.val; - - return this.setValues( - a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12], - a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13], - a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14], - a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15], - - a[4] * b[0] + a[5] * b[4] + a[6] * b[8] + a[7] * b[12], - a[4] * b[1] + a[5] * b[5] + a[6] * b[9] + a[7] * b[13], - a[4] * b[2] + a[5] * b[6] + a[6] * b[10] + a[7] * b[14], - a[4] * b[3] + a[5] * b[7] + a[6] * b[11] + a[7] * b[15], - - a[8] * b[0] + a[9] * b[4] + a[10] * b[8] + a[11] * b[12], - a[8] * b[1] + a[9] * b[5] + a[10] * b[9] + a[11] * b[13], - a[8] * b[2] + a[9] * b[6] + a[10] * b[10] + a[11] * b[14], - a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11] * b[15], - - a[12] * b[0] + a[13] * b[4] + a[14] * b[8] + a[15] * b[12], - a[12] * b[1] + a[13] * b[5] + a[14] * b[9] + a[15] * b[13], - a[12] * b[2] + a[13] * b[6] + a[14] * b[10] + a[15] * b[14], - a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15] - ); - }, - - /** - * Multiplies the given Matrix4 object with this Matrix. - * - * This is the same as calling `multiplyMatrices(m, this)`. - * - * @method Phaser.Math.Matrix4#premultiply - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to multiply with this one. - * - * @return {this} This Matrix4. - */ - premultiply: function (m) - { - return this.multiplyMatrices(m, this); - }, - - /** - * Multiplies the two given Matrix4 objects and stores the results in this Matrix. - * - * @method Phaser.Math.Matrix4#multiplyMatrices - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} a - The first Matrix4 to multiply. - * @param {Phaser.Math.Matrix4} b - The second Matrix4 to multiply. - * - * @return {this} This Matrix4. - */ - multiplyMatrices: function (a, b) - { - var am = a.val; - var bm = b.val; - - var a11 = am[0]; - var a12 = am[4]; - var a13 = am[8]; - var a14 = am[12]; - var a21 = am[1]; - var a22 = am[5]; - var a23 = am[9]; - var a24 = am[13]; - var a31 = am[2]; - var a32 = am[6]; - var a33 = am[10]; - var a34 = am[14]; - var a41 = am[3]; - var a42 = am[7]; - var a43 = am[11]; - var a44 = am[15]; - - var b11 = bm[0]; - var b12 = bm[4]; - var b13 = bm[8]; - var b14 = bm[12]; - var b21 = bm[1]; - var b22 = bm[5]; - var b23 = bm[9]; - var b24 = bm[13]; - var b31 = bm[2]; - var b32 = bm[6]; - var b33 = bm[10]; - var b34 = bm[14]; - var b41 = bm[3]; - var b42 = bm[7]; - var b43 = bm[11]; - var b44 = bm[15]; - - return this.setValues( - a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41, - a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41, - a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41, - a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41, - a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42, - a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42, - a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42, - a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42, - a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43, - a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43, - a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43, - a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43, - a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44, - a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44, - a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44, - a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44 - ); - }, - - /** - * Translate this Matrix using the given Vector. - * - * @method Phaser.Math.Matrix4#translate - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. - * - * @return {this} This Matrix4. - */ - translate: function (v) - { - return this.translateXYZ(v.x, v.y, v.z); - }, - - /** - * Translate this Matrix using the given values. - * - * @method Phaser.Math.Matrix4#translateXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {this} This Matrix4. - */ - translateXYZ: function (x, y, z) - { - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. - * - * @method Phaser.Math.Matrix4#scale - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. - * - * @return {this} This Matrix4. - */ - scale: function (v) - { - return this.scaleXYZ(v.x, v.y, v.z); - }, - - /** - * Apply a scale transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#scaleXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {this} This Matrix4. - */ - scaleXYZ: function (x, y, z) - { - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; - }, - - /** - * Derive a rotation matrix around the given axis. - * - * @method Phaser.Math.Matrix4#makeRotationAxis - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. - * @param {number} angle - The rotation angle in radians. - * - * @return {this} This Matrix4. - */ - makeRotationAxis: function (axis, angle) - { - // Based on http://www.gamedev.net/reference/articles/article1199.asp - - var c = Math.cos(angle); - var s = Math.sin(angle); - var t = 1 - c; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var tx = t * x; - var ty = t * y; - - return this.setValues( - tx * x + c, tx * y - s * z, tx * z + s * y, 0, - tx * y + s * z, ty * y + c, ty * z - s * x, 0, - tx * z - s * y, ty * z + s * x, t * z * z + c, 0, - 0, 0, 0, 1 - ); - }, - - /** - * Apply a rotation transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#rotate - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. - * - * @return {this} This Matrix4. - */ - rotate: function (rad, axis) - { - var a = this.val; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var len = Math.sqrt(x * x + y * y + z * z); - - if (Math.abs(len) < EPSILON) - { - return this; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - - var s = Math.sin(rad); - var c = Math.cos(rad); - var t = 1 - c; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - // Construct the elements of the rotation matrix - var b00 = x * x * t + c; - var b01 = y * x * t + z * s; - var b02 = z * x * t - y * s; - - var b10 = x * y * t - z * s; - var b11 = y * y * t + c; - var b12 = z * y * t + x * s; - - var b20 = x * z * t + y * s; - var b21 = y * z * t - x * s; - var b22 = z * z * t + c; - - // Perform rotation-specific matrix multiplication - return this.setValues( - a00 * b00 + a10 * b01 + a20 * b02, - a01 * b00 + a11 * b01 + a21 * b02, - a02 * b00 + a12 * b01 + a22 * b02, - a03 * b00 + a13 * b01 + a23 * b02, - a00 * b10 + a10 * b11 + a20 * b12, - a01 * b10 + a11 * b11 + a21 * b12, - a02 * b10 + a12 * b11 + a22 * b12, - a03 * b10 + a13 * b11 + a23 * b12, - a00 * b20 + a10 * b21 + a20 * b22, - a01 * b20 + a11 * b21 + a21 * b22, - a02 * b20 + a12 * b21 + a22 * b22, - a03 * b20 + a13 * b21 + a23 * b22, - a30, a31, a32, a33 - ); - }, - - /** - * Rotate this matrix on its X axis. - * - * @method Phaser.Math.Matrix4#rotateX - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * - * @return {this} This Matrix4. - */ - rotateX: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[4] = a10 * c + a20 * s; - a[5] = a11 * c + a21 * s; - a[6] = a12 * c + a22 * s; - a[7] = a13 * c + a23 * s; - a[8] = a20 * c - a10 * s; - a[9] = a21 * c - a11 * s; - a[10] = a22 * c - a12 * s; - a[11] = a23 * c - a13 * s; - - return this; - }, - - /** - * Rotate this matrix on its Y axis. - * - * @method Phaser.Math.Matrix4#rotateY - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {this} This Matrix4. - */ - rotateY: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c - a20 * s; - a[1] = a01 * c - a21 * s; - a[2] = a02 * c - a22 * s; - a[3] = a03 * c - a23 * s; - a[8] = a00 * s + a20 * c; - a[9] = a01 * s + a21 * c; - a[10] = a02 * s + a22 * c; - a[11] = a03 * s + a23 * c; - - return this; - }, - - /** - * Rotate this matrix on its Z axis. - * - * @method Phaser.Math.Matrix4#rotateZ - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {this} This Matrix4. - */ - rotateZ: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c + a10 * s; - a[1] = a01 * c + a11 * s; - a[2] = a02 * c + a12 * s; - a[3] = a03 * c + a13 * s; - a[4] = a10 * c - a00 * s; - a[5] = a11 * c - a01 * s; - a[6] = a12 * c - a02 * s; - a[7] = a13 * c - a03 * s; - - return this; - }, - - /** - * Set the values of this Matrix from the given rotation Quaternion and translation Vector. - * - * @method Phaser.Math.Matrix4#fromRotationTranslation - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. - * @param {Phaser.Math.Vector3} v - The Vector to set translation from. - * - * @return {this} This Matrix4. - */ - fromRotationTranslation: function (q, v) - { - // Quaternion math - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - return this.setValues( - 1 - (yy + zz), - xy + wz, - xz - wy, - 0, - - xy - wz, - 1 - (xx + zz), - yz + wx, - 0, - - xz + wy, - yz - wx, - 1 - (xx + yy), - 0, - - v.x, - v.y, - v.z, - 1 - ); - }, - - /** - * Set the values of this Matrix from the given Quaternion. - * - * @method Phaser.Math.Matrix4#fromQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. - * - * @return {this} This Matrix4. - */ - fromQuat: function (q) - { - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - return this.setValues( - 1 - (yy + zz), - xy + wz, - xz - wy, - 0, - - xy - wz, - 1 - (xx + zz), - yz + wx, - 0, - - xz + wy, - yz - wx, - 1 - (xx + yy), - 0, - - 0, - 0, - 0, - 1 - ); - }, - - /** - * Generate a frustum matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#frustum - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {this} This Matrix4. - */ - frustum: function (left, right, bottom, top, near, far) - { - var rl = 1 / (right - left); - var tb = 1 / (top - bottom); - var nf = 1 / (near - far); - - return this.setValues( - (near * 2) * rl, - 0, - 0, - 0, - - 0, - (near * 2) * tb, - 0, - 0, - - (right + left) * rl, - (top + bottom) * tb, - (far + near) * nf, - -1, - - 0, - 0, - (far * near * 2) * nf, - 0 - ); - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspective - * @since 3.0.0 - * - * @param {number} fovy - Vertical field of view in radians - * @param {number} aspect - Aspect ratio. Typically viewport width /height. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {this} This Matrix4. - */ - perspective: function (fovy, aspect, near, far) - { - var f = 1.0 / Math.tan(fovy / 2); - var nf = 1 / (near - far); - - return this.setValues( - f / aspect, - 0, - 0, - 0, - - 0, - f, - 0, - 0, - - 0, - 0, - (far + near) * nf, - -1, - - 0, - 0, - (2 * far * near) * nf, - 0 - ); - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspectiveLH - * @since 3.0.0 - * - * @param {number} width - The width of the frustum. - * @param {number} height - The height of the frustum. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {this} This Matrix4. - */ - perspectiveLH: function (width, height, near, far) - { - return this.setValues( - (2 * near) / width, - 0, - 0, - 0, - - 0, - (2 * near) / height, - 0, - 0, - - 0, - 0, - -far / (near - far), - 1, - - 0, - 0, - (near * far) / (near - far), - 0 - ); - }, - - /** - * Generate an orthogonal projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#ortho - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {this} This Matrix4. - */ - ortho: function (left, right, bottom, top, near, far) - { - var lr = left - right; - var bt = bottom - top; - var nf = near - far; - - // Avoid division by zero - lr = (lr === 0) ? lr : 1 / lr; - bt = (bt === 0) ? bt : 1 / bt; - nf = (nf === 0) ? nf : 1 / nf; - - return this.setValues( - -2 * lr, - 0, - 0, - 0, - - 0, - -2 * bt, - 0, - 0, - - 0, - 0, - 2 * nf, - 0, - - (left + right) * lr, - (top + bottom) * bt, - (far + near) * nf, - 1 - ); - }, - - /** - * Generate a right-handed look-at matrix with the given eye position, target and up axis. - * - * @method Phaser.Math.Matrix4#lookAtRH - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} eye - Position of the viewer. - * @param {Phaser.Math.Vector3} target - Point the viewer is looking at. - * @param {Phaser.Math.Vector3} up - vec3 pointing up. - * - * @return {this} This Matrix4. - */ - lookAtRH: function (eye, target, up) - { - var m = this.val; - - _z.subVectors(eye, target); - - if (_z.getLengthSquared() === 0) - { - // eye and target are in the same position - _z.z = 1; - } - - _z.normalize(); - _x.crossVectors(up, _z); - - if (_x.getLengthSquared() === 0) - { - // up and z are parallel - - if (Math.abs(up.z) === 1) - { - _z.x += 0.0001; - } - else - { - _z.z += 0.0001; - } - - _z.normalize(); - _x.crossVectors(up, _z); - } - - _x.normalize(); - _y.crossVectors(_z, _x); - - m[0] = _x.x; - m[1] = _x.y; - m[2] = _x.z; - m[4] = _y.x; - m[5] = _y.y; - m[6] = _y.z; - m[8] = _z.x; - m[9] = _z.y; - m[10] = _z.z; - - return this; - }, - - /** - * Generate a look-at matrix with the given eye position, focal point, and up axis. - * - * @method Phaser.Math.Matrix4#lookAt - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} eye - Position of the viewer - * @param {Phaser.Math.Vector3} center - Point the viewer is looking at - * @param {Phaser.Math.Vector3} up - vec3 pointing up. - * - * @return {this} This Matrix4. - */ - lookAt: function (eye, center, up) - { - var eyex = eye.x; - var eyey = eye.y; - var eyez = eye.z; - - var upx = up.x; - var upy = up.y; - var upz = up.z; - - var centerx = center.x; - var centery = center.y; - var centerz = center.z; - - if (Math.abs(eyex - centerx) < EPSILON && - Math.abs(eyey - centery) < EPSILON && - Math.abs(eyez - centerz) < EPSILON) - { - return this.identity(); - } - - var z0 = eyex - centerx; - var z1 = eyey - centery; - var z2 = eyez - centerz; - - var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); - - z0 *= len; - z1 *= len; - z2 *= len; - - var x0 = upy * z2 - upz * z1; - var x1 = upz * z0 - upx * z2; - var x2 = upx * z1 - upy * z0; - - len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); - - if (!len) - { - x0 = 0; - x1 = 0; - x2 = 0; - } - else - { - len = 1 / len; - x0 *= len; - x1 *= len; - x2 *= len; - } - - var y0 = z1 * x2 - z2 * x1; - var y1 = z2 * x0 - z0 * x2; - var y2 = z0 * x1 - z1 * x0; - - len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); - - if (!len) - { - y0 = 0; - y1 = 0; - y2 = 0; - } - else - { - len = 1 / len; - y0 *= len; - y1 *= len; - y2 *= len; - } - - return this.setValues( - x0, - y0, - z0, - 0, - - x1, - y1, - z1, - 0, - - x2, - y2, - z2, - 0, - - -(x0 * eyex + x1 * eyey + x2 * eyez), - -(y0 * eyex + y1 * eyey + y2 * eyez), - -(z0 * eyex + z1 * eyey + z2 * eyez), - 1 - ); - }, - - /** - * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. - * - * @method Phaser.Math.Matrix4#yawPitchRoll - * @since 3.0.0 - * - * @param {number} yaw - The yaw value. - * @param {number} pitch - The pitch value. - * @param {number} roll - The roll value. - * - * @return {this} This Matrix4. - */ - yawPitchRoll: function (yaw, pitch, roll) - { - this.zero(); - _tempMat1.zero(); - _tempMat2.zero(); - - var m0 = this.val; - var m1 = _tempMat1.val; - var m2 = _tempMat2.val; - - // Rotate Z - var s = Math.sin(roll); - var c = Math.cos(roll); - - m0[10] = 1; - m0[15] = 1; - m0[0] = c; - m0[1] = s; - m0[4] = -s; - m0[5] = c; - - // Rotate X - s = Math.sin(pitch); - c = Math.cos(pitch); - - m1[0] = 1; - m1[15] = 1; - m1[5] = c; - m1[10] = c; - m1[9] = -s; - m1[6] = s; - - // Rotate Y - s = Math.sin(yaw); - c = Math.cos(yaw); - - m2[5] = 1; - m2[15] = 1; - m2[0] = c; - m2[2] = -s; - m2[8] = s; - m2[10] = c; - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - return this; - }, - - /** - * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. - * - * @method Phaser.Math.Matrix4#setWorldMatrix - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. - * @param {Phaser.Math.Vector3} position - The position of the world matrix. - * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. - * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. - * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. - * - * @return {this} This Matrix4. - */ - setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) - { - this.yawPitchRoll(rotation.y, rotation.x, rotation.z); - - _tempMat1.scaling(scale.x, scale.y, scale.z); - _tempMat2.xyz(position.x, position.y, position.z); - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - if (viewMatrix) - { - this.multiplyLocal(viewMatrix); - } - - if (projectionMatrix) - { - this.multiplyLocal(projectionMatrix); - } - - return this; - }, - - /** - * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. - * - * @method Phaser.Math.Matrix4#multiplyToMat4 - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix4 to multiply with this one. - * @param {Phaser.Math.Matrix4} out - The receiving Matrix. - * - * @return {Phaser.Math.Matrix4} This `out` Matrix4. - */ - multiplyToMat4: function (src, out) - { - var a = this.val; - var b = src.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = b[0]; - var b01 = b[1]; - var b02 = b[2]; - var b03 = b[3]; - var b10 = b[4]; - var b11 = b[5]; - var b12 = b[6]; - var b13 = b[7]; - var b20 = b[8]; - var b21 = b[9]; - var b22 = b[10]; - var b23 = b[11]; - var b30 = b[12]; - var b31 = b[13]; - var b32 = b[14]; - var b33 = b[15]; - - return out.setValues( - b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, - b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31, - b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32, - b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33, - - b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, - b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, - b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, - b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, - - b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, - b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, - b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, - b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, - - b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, - b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, - b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, - b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 - ); - }, - - /** - * Takes the rotation and position vectors and builds this Matrix4 from them. - * - * @method Phaser.Math.Matrix4#fromRotationXYTranslation - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} rotation - The rotation vector. - * @param {Phaser.Math.Vector3} position - The position vector. - * @param {boolean} translateFirst - Should the operation translate then rotate (`true`), or rotate then translate? (`false`) - * - * @return {this} This Matrix4. - */ - fromRotationXYTranslation: function (rotation, position, translateFirst) - { - var x = position.x; - var y = position.y; - var z = position.z; - - var sx = Math.sin(rotation.x); - var cx = Math.cos(rotation.x); - - var sy = Math.sin(rotation.y); - var cy = Math.cos(rotation.y); - - var a30 = x; - var a31 = y; - var a32 = z; - - // Rotate X - - var b21 = -sx; - - // Rotate Y - - var c01 = 0 - b21 * sy; - - var c02 = 0 - cx * sy; - - var c21 = b21 * cy; - - var c22 = cx * cy; - - // Translate - if (!translateFirst) - { - // a30 = cy * x + 0 * y + sy * z; - a30 = cy * x + sy * z; - a31 = c01 * x + cx * y + c21 * z; - a32 = c02 * x + sx * y + c22 * z; - } - - return this.setValues( - cy, - c01, - c02, - 0, - 0, - cx, - sx, - 0, - sy, - c21, - c22, - 0, - a30, - a31, - a32, - 1 - ); - }, - - /** - * Returns the maximum axis scale from this Matrix4. - * - * @method Phaser.Math.Matrix4#getMaxScaleOnAxis - * @since 3.50.0 - * - * @return {number} The maximum axis scale. - */ - getMaxScaleOnAxis: function () - { - var m = this.val; - - var scaleXSq = m[0] * m[0] + m[1] * m[1] + m[2] * m[2]; - var scaleYSq = m[4] * m[4] + m[5] * m[5] + m[6] * m[6]; - var scaleZSq = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; - - return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); - } - -}); - -/** - * @ignore - */ -var _tempMat1 = new Matrix4(); - -/** - * @ignore - */ -var _tempMat2 = new Matrix4(); - -/** - * @ignore - */ -var _x = new Vector3(); - -/** - * @ignore - */ -var _y = new Vector3(); - -/** - * @ignore - */ -var _z = new Vector3(); - -module.exports = Matrix4; - - -/***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Scenes.Events - */ - -module.exports = { - - ADDED_TO_SCENE: __webpack_require__(187), - BOOT: __webpack_require__(188), - CREATE: __webpack_require__(189), - DESTROY: __webpack_require__(190), - PAUSE: __webpack_require__(191), - POST_UPDATE: __webpack_require__(192), - PRE_RENDER: __webpack_require__(193), - PRE_UPDATE: __webpack_require__(194), - READY: __webpack_require__(195), - REMOVED_FROM_SCENE: __webpack_require__(196), - RENDER: __webpack_require__(197), - RESUME: __webpack_require__(198), - SHUTDOWN: __webpack_require__(199), - SLEEP: __webpack_require__(200), - START: __webpack_require__(201), - TRANSITION_COMPLETE: __webpack_require__(202), - TRANSITION_INIT: __webpack_require__(203), - TRANSITION_OUT: __webpack_require__(204), - TRANSITION_START: __webpack_require__(205), - TRANSITION_WAKE: __webpack_require__(206), - UPDATE: __webpack_require__(207), - WAKE: __webpack_require__(208) - -}; - - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(12); -var Events = __webpack_require__(47); -var GetFastValue = __webpack_require__(11); -var GetURL = __webpack_require__(48); -var MergeXHRSettings = __webpack_require__(49); -var XHRLoader = __webpack_require__(223); -var XHRSettings = __webpack_require__(50); - -/** - * @classdesc - * The base File class used by all File Types that the Loader can support. - * You shouldn't create an instance of a File directly, but should extend it with your own class, setting a custom type and processing methods. - * - * @class File - * @memberof Phaser.Loader - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. - * @param {Phaser.Types.Loader.FileConfig} fileConfig - The file configuration object, as created by the file type. - */ -var File = new Class({ - - initialize: - - function File (loader, fileConfig) - { - /** - * A reference to the Loader that is going to load this file. - * - * @name Phaser.Loader.File#loader - * @type {Phaser.Loader.LoaderPlugin} - * @since 3.0.0 - */ - this.loader = loader; - - /** - * A reference to the Cache, or Texture Manager, that is going to store this file if it loads. - * - * @name Phaser.Loader.File#cache - * @type {(Phaser.Cache.BaseCache|Phaser.Textures.TextureManager)} - * @since 3.7.0 - */ - this.cache = GetFastValue(fileConfig, 'cache', false); - - /** - * The file type string (image, json, etc) for sorting within the Loader. - * - * @name Phaser.Loader.File#type - * @type {string} - * @since 3.0.0 - */ - this.type = GetFastValue(fileConfig, 'type', false); - - if (!this.type) - { - throw new Error('Invalid File type: ' + this.type); - } - - /** - * Unique cache key (unique within its file type) - * - * @name Phaser.Loader.File#key - * @type {string} - * @since 3.0.0 - */ - this.key = GetFastValue(fileConfig, 'key', false); - - var loadKey = this.key; - - if (loader.prefix && loader.prefix !== '') - { - this.key = loader.prefix + loadKey; - } - - if (!this.key) - { - throw new Error('Invalid File key: ' + this.key); - } - - var url = GetFastValue(fileConfig, 'url'); - - if (url === undefined) - { - url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); - } - else if (typeof url === 'string' && !url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)) - { - url = loader.path + url; - } - - /** - * The URL of the file, not including baseURL. - * - * Automatically has Loader.path prepended to it if a string. - * - * Can also be a JavaScript Object, such as the results of parsing JSON data. - * - * @name Phaser.Loader.File#url - * @type {object|string} - * @since 3.0.0 - */ - this.url = url; - - /** - * The final URL this file will load from, including baseURL and path. - * Set automatically when the Loader calls 'load' on this file. - * - * @name Phaser.Loader.File#src - * @type {string} - * @since 3.0.0 - */ - this.src = ''; - - /** - * The merged XHRSettings for this file. - * - * @name Phaser.Loader.File#xhrSettings - * @type {Phaser.Types.Loader.XHRSettingsObject} - * @since 3.0.0 - */ - this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined)); - - if (GetFastValue(fileConfig, 'xhrSettings', false)) - { - this.xhrSettings = MergeXHRSettings(this.xhrSettings, GetFastValue(fileConfig, 'xhrSettings', {})); - } - - /** - * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File. - * - * @name Phaser.Loader.File#xhrLoader - * @type {?XMLHttpRequest} - * @since 3.0.0 - */ - this.xhrLoader = null; - - /** - * The current state of the file. One of the FILE_CONST values. - * - * @name Phaser.Loader.File#state - * @type {number} - * @since 3.0.0 - */ - this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING; - - /** - * The total size of this file. - * Set by onProgress and only if loading via XHR. - * - * @name Phaser.Loader.File#bytesTotal - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.bytesTotal = 0; - - /** - * Updated as the file loads. - * Only set if loading via XHR. - * - * @name Phaser.Loader.File#bytesLoaded - * @type {number} - * @default -1 - * @since 3.0.0 - */ - this.bytesLoaded = -1; - - /** - * A percentage value between 0 and 1 indicating how much of this file has loaded. - * Only set if loading via XHR. - * - * @name Phaser.Loader.File#percentComplete - * @type {number} - * @default -1 - * @since 3.0.0 - */ - this.percentComplete = -1; - - /** - * For CORs based loading. - * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set) - * - * @name Phaser.Loader.File#crossOrigin - * @type {(string|undefined)} - * @since 3.0.0 - */ - this.crossOrigin = undefined; - - /** - * The processed file data, stored here after the file has loaded. - * - * @name Phaser.Loader.File#data - * @type {*} - * @since 3.0.0 - */ - this.data = undefined; - - /** - * A config object that can be used by file types to store transitional data. - * - * @name Phaser.Loader.File#config - * @type {*} - * @since 3.0.0 - */ - this.config = GetFastValue(fileConfig, 'config', {}); - - /** - * If this is a multipart file, i.e. an atlas and its json together, then this is a reference - * to the parent MultiFile. Set and used internally by the Loader or specific file types. - * - * @name Phaser.Loader.File#multiFile - * @type {?Phaser.Loader.MultiFile} - * @since 3.7.0 - */ - this.multiFile; - - /** - * Does this file have an associated linked file? Such as an image and a normal map. - * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't - * actually bound by data, where-as a linkFile is. - * - * @name Phaser.Loader.File#linkFile - * @type {?Phaser.Loader.File} - * @since 3.7.0 - */ - this.linkFile; - }, - - /** - * Links this File with another, so they depend upon each other for loading and processing. - * - * @method Phaser.Loader.File#setLink - * @since 3.7.0 - * - * @param {Phaser.Loader.File} fileB - The file to link to this one. - */ - setLink: function (fileB) - { - this.linkFile = fileB; - - fileB.linkFile = this; - }, - - /** - * Resets the XHRLoader instance this file is using. - * - * @method Phaser.Loader.File#resetXHR - * @since 3.0.0 - */ - resetXHR: function () - { - if (this.xhrLoader) - { - this.xhrLoader.onload = undefined; - this.xhrLoader.onerror = undefined; - this.xhrLoader.onprogress = undefined; - } - }, - - /** - * Called by the Loader, starts the actual file downloading. - * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. - * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. - * - * @method Phaser.Loader.File#load - * @since 3.0.0 - */ - load: function () - { - if (this.state === CONST.FILE_POPULATED) - { - // Can happen for example in a JSONFile if they've provided a JSON object instead of a URL - this.loader.nextFile(this, true); - } - else - { - this.state = CONST.FILE_LOADING; - - this.src = GetURL(this, this.loader.baseURL); - - if (this.src.indexOf('data:') === 0) - { - console.warn('Local data URIs are not supported: ' + this.key); - } - else - { - // The creation of this XHRLoader starts the load process going. - // It will automatically call the following, based on the load outcome: - // - // xhr.onload = this.onLoad - // xhr.onerror = this.onError - // xhr.onprogress = this.onProgress - - this.xhrLoader = XHRLoader(this, this.loader.xhr); - } - } - }, - - /** - * Called when the file finishes loading, is sent a DOM ProgressEvent. - * - * @method Phaser.Loader.File#onLoad - * @since 3.0.0 - * - * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event. - * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load. - */ - onLoad: function (xhr, event) - { - var isLocalFile = xhr.responseURL && this.loader.localSchemes.some(function (scheme) - { - return xhr.responseURL.indexOf(scheme) === 0; - }); - - var localFileOk = (isLocalFile && event.target.status === 0); - - var success = !(event.target && event.target.status !== 200) || localFileOk; - - // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called. - if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599) - { - success = false; - } - - this.state = CONST.FILE_LOADED; - - this.resetXHR(); - - this.loader.nextFile(this, success); - }, - - /** - * Called if the file errors while loading, is sent a DOM ProgressEvent. - * - * @method Phaser.Loader.File#onError - * @since 3.0.0 - * - * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event. - * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this error. - */ - onError: function () - { - this.resetXHR(); - - this.loader.nextFile(this, false); - }, - - /** - * Called during the file load progress. Is sent a DOM ProgressEvent. - * - * @method Phaser.Loader.File#onProgress - * @fires Phaser.Loader.Events#FILE_PROGRESS - * @since 3.0.0 - * - * @param {ProgressEvent} event - The DOM ProgressEvent. - */ - onProgress: function (event) - { - if (event.lengthComputable) - { - this.bytesLoaded = event.loaded; - this.bytesTotal = event.total; - - this.percentComplete = Math.min((this.bytesLoaded / this.bytesTotal), 1); - - this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete); - } - }, - - /** - * Usually overridden by the FileTypes and is called by Loader.nextFile. - * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage. - * - * @method Phaser.Loader.File#onProcess - * @since 3.0.0 - */ - onProcess: function () - { - this.state = CONST.FILE_PROCESSING; - - this.onProcessComplete(); - }, - - /** - * Called when the File has completed processing. - * Checks on the state of its multifile, if set. - * - * @method Phaser.Loader.File#onProcessComplete - * @since 3.7.0 - */ - onProcessComplete: function () - { - this.state = CONST.FILE_COMPLETE; - - if (this.multiFile) - { - this.multiFile.onFileComplete(this); - } - - this.loader.fileProcessComplete(this); - }, - - /** - * Called when the File has completed processing but it generated an error. - * Checks on the state of its multifile, if set. - * - * @method Phaser.Loader.File#onProcessError - * @since 3.7.0 - */ - onProcessError: function () - { - // eslint-disable-next-line no-console - console.error('Failed to process file: %s "%s"', this.type, this.key); - - this.state = CONST.FILE_ERRORED; - - if (this.multiFile) - { - this.multiFile.onFileFailed(this); - } - - this.loader.fileProcessComplete(this); - }, - - /** - * Checks if a key matching the one used by this file exists in the target Cache or not. - * This is called automatically by the LoaderPlugin to decide if the file can be safely - * loaded or will conflict. - * - * @method Phaser.Loader.File#hasCacheConflict - * @since 3.7.0 - * - * @return {boolean} `true` if adding this file will cause a conflict, otherwise `false`. - */ - hasCacheConflict: function () - { - return (this.cache && this.cache.exists(this.key)); - }, - - /** - * Adds this file to its target cache upon successful loading and processing. - * This method is often overridden by specific file types. - * - * @method Phaser.Loader.File#addToCache - * @since 3.7.0 - */ - addToCache: function () - { - if (this.cache && this.data) - { - this.cache.add(this.key, this.data); - } - }, - - /** - * Called once the file has been added to its cache and is now ready for deletion from the Loader. - * It will emit a `filecomplete` event from the LoaderPlugin. - * - * @method Phaser.Loader.File#pendingDestroy - * @fires Phaser.Loader.Events#FILE_COMPLETE - * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE - * @since 3.7.0 - */ - pendingDestroy: function (data) - { - if (this.state === CONST.FILE_PENDING_DESTROY) - { - return; - } - - if (data === undefined) { data = this.data; } - - var key = this.key; - var type = this.type; - - this.loader.emit(Events.FILE_COMPLETE, key, type, data); - this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data); - - this.loader.flagForRemoval(this); - - this.state = CONST.FILE_PENDING_DESTROY; - }, - - /** - * Destroy this File and any references it holds. - * - * @method Phaser.Loader.File#destroy - * @since 3.7.0 - */ - destroy: function () - { - this.loader = null; - this.cache = null; - this.xhrSettings = null; - this.multiFile = null; - this.linkFile = null; - this.data = null; - } - -}); - -/** - * Static method for creating object URL using URL API and setting it as image 'src' attribute. - * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader. - * - * @method Phaser.Loader.File.createObjectURL - * @static - * @since 3.7.0 - * - * @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL. - * @param {Blob} blob - A Blob object to create an object URL for. - * @param {string} defaultType - Default mime type used if blob type is not available. - */ -File.createObjectURL = function (image, blob, defaultType) -{ - if (typeof URL === 'function') - { - image.src = URL.createObjectURL(blob); - } - else - { - var reader = new FileReader(); - - reader.onload = function () - { - image.removeAttribute('crossOrigin'); - image.src = 'data:' + (blob.type || defaultType) + ';base64,' + reader.result.split(',')[1]; - }; - - reader.onerror = image.onerror; - - reader.readAsDataURL(blob); - } -}; - -/** - * Static method for releasing an existing object URL which was previously created - * by calling {@link File#createObjectURL} method. - * - * @method Phaser.Loader.File.revokeObjectURL - * @static - * @since 3.7.0 - * - * @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked. - */ -File.revokeObjectURL = function (image) -{ - if (typeof URL === 'function') - { - URL.revokeObjectURL(image.src); - } -}; - -module.exports = File; - - -/***/ }), -/* 25 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var types = {}; - -/** - * @namespace Phaser.Loader.FileTypesManager - */ - -var FileTypesManager = { - - /** - * Static method called when a LoaderPlugin is created. - * - * Loops through the local types object and injects all of them as - * properties into the LoaderPlugin instance. - * - * @method Phaser.Loader.FileTypesManager.install - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into. - */ - install: function (loader) - { - for (var key in types) - { - loader[key] = types[key]; - } - }, - - /** - * Static method called directly by the File Types. - * - * The key is a reference to the function used to load the files via the Loader, i.e. `image`. - * - * @method Phaser.Loader.FileTypesManager.register - * @since 3.0.0 - * - * @param {string} key - The key that will be used as the method name in the LoaderPlugin. - * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked. - */ - register: function (key, factoryFunction) - { - types[key] = factoryFunction; - }, - - /** - * Removed all associated file types. - * - * @method Phaser.Loader.FileTypesManager.destroy - * @since 3.0.0 - */ - destroy: function () - { - types = {}; - } - -}; - -module.exports = FileTypesManager; - - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var MATH_CONST = __webpack_require__(4); -var Vector2 = __webpack_require__(3); - -/** - * @classdesc - * A Matrix used for display transformations for rendering. - * - * It is represented like so: - * - * ``` - * | a | c | tx | - * | b | d | ty | - * | 0 | 0 | 1 | - * ``` - * - * @class TransformMatrix - * @memberof Phaser.GameObjects.Components - * @constructor - * @since 3.0.0 - * - * @param {number} [a=1] - The Scale X value. - * @param {number} [b=0] - The Skew Y value. - * @param {number} [c=0] - The Skew X value. - * @param {number} [d=1] - The Scale Y value. - * @param {number} [tx=0] - The Translate X value. - * @param {number} [ty=0] - The Translate Y value. - */ -var TransformMatrix = new Class({ - - initialize: - - function TransformMatrix (a, b, c, d, tx, ty) - { - if (a === undefined) { a = 1; } - if (b === undefined) { b = 0; } - if (c === undefined) { c = 0; } - if (d === undefined) { d = 1; } - if (tx === undefined) { tx = 0; } - if (ty === undefined) { ty = 0; } - - /** - * The matrix values. - * - * @name Phaser.GameObjects.Components.TransformMatrix#matrix - * @type {Float32Array} - * @since 3.0.0 - */ - this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]); - - /** - * The decomposed matrix. - * - * @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix - * @type {object} - * @since 3.0.0 - */ - this.decomposedMatrix = { - translateX: 0, - translateY: 0, - scaleX: 1, - scaleY: 1, - rotation: 0 - }; - - /** - * The temporary quad value cache. - * - * @name Phaser.GameObjects.Components.TransformMatrix#quad - * @type {Float32Array} - * @since 3.60.0 - */ - this.quad = new Float32Array(8); - }, - - /** - * The Scale X value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#a - * @type {number} - * @since 3.4.0 - */ - a: { - - get: function () - { - return this.matrix[0]; - }, - - set: function (value) - { - this.matrix[0] = value; - } - - }, - - /** - * The Skew Y value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#b - * @type {number} - * @since 3.4.0 - */ - b: { - - get: function () - { - return this.matrix[1]; - }, - - set: function (value) - { - this.matrix[1] = value; - } - - }, - - /** - * The Skew X value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#c - * @type {number} - * @since 3.4.0 - */ - c: { - - get: function () - { - return this.matrix[2]; - }, - - set: function (value) - { - this.matrix[2] = value; - } - - }, - - /** - * The Scale Y value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#d - * @type {number} - * @since 3.4.0 - */ - d: { - - get: function () - { - return this.matrix[3]; - }, - - set: function (value) - { - this.matrix[3] = value; - } - - }, - - /** - * The Translate X value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#e - * @type {number} - * @since 3.11.0 - */ - e: { - - get: function () - { - return this.matrix[4]; - }, - - set: function (value) - { - this.matrix[4] = value; - } - - }, - - /** - * The Translate Y value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#f - * @type {number} - * @since 3.11.0 - */ - f: { - - get: function () - { - return this.matrix[5]; - }, - - set: function (value) - { - this.matrix[5] = value; - } - - }, - - /** - * The Translate X value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#tx - * @type {number} - * @since 3.4.0 - */ - tx: { - - get: function () - { - return this.matrix[4]; - }, - - set: function (value) - { - this.matrix[4] = value; - } - - }, - - /** - * The Translate Y value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#ty - * @type {number} - * @since 3.4.0 - */ - ty: { - - get: function () - { - return this.matrix[5]; - }, - - set: function (value) - { - this.matrix[5] = value; - } - - }, - - /** - * The rotation of the Matrix. Value is in radians. - * - * @name Phaser.GameObjects.Components.TransformMatrix#rotation - * @type {number} - * @readonly - * @since 3.4.0 - */ - rotation: { - - get: function () - { - return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1); - } - - }, - - /** - * The rotation of the Matrix, normalized to be within the Phaser right-handed - * clockwise rotation space. Value is in radians. - * - * @name Phaser.GameObjects.Components.TransformMatrix#rotationNormalized - * @type {number} - * @readonly - * @since 3.19.0 - */ - rotationNormalized: { - - get: function () - { - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - - if (a || b) - { - // var r = Math.sqrt(a * a + b * b); - - return (b > 0) ? Math.acos(a / this.scaleX) : -Math.acos(a / this.scaleX); - } - else if (c || d) - { - // var s = Math.sqrt(c * c + d * d); - - return MATH_CONST.TAU - ((d > 0) ? Math.acos(-c / this.scaleY) : -Math.acos(c / this.scaleY)); - } - else - { - return 0; - } - } - - }, - - /** - * The decomposed horizontal scale of the Matrix. This value is always positive. - * - * @name Phaser.GameObjects.Components.TransformMatrix#scaleX - * @type {number} - * @readonly - * @since 3.4.0 - */ - scaleX: { - - get: function () - { - return Math.sqrt((this.a * this.a) + (this.b * this.b)); - } - - }, - - /** - * The decomposed vertical scale of the Matrix. This value is always positive. - * - * @name Phaser.GameObjects.Components.TransformMatrix#scaleY - * @type {number} - * @readonly - * @since 3.4.0 - */ - scaleY: { - - get: function () - { - return Math.sqrt((this.c * this.c) + (this.d * this.d)); - } - - }, - - /** - * Reset the Matrix to an identity matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity - * @since 3.0.0 - * - * @return {this} This TransformMatrix. - */ - loadIdentity: function () - { - var matrix = this.matrix; - - matrix[0] = 1; - matrix[1] = 0; - matrix[2] = 0; - matrix[3] = 1; - matrix[4] = 0; - matrix[5] = 0; - - return this; - }, - - /** - * Translate the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#translate - * @since 3.0.0 - * - * @param {number} x - The horizontal translation value. - * @param {number} y - The vertical translation value. - * - * @return {this} This TransformMatrix. - */ - translate: function (x, y) - { - var matrix = this.matrix; - - matrix[4] = matrix[0] * x + matrix[2] * y + matrix[4]; - matrix[5] = matrix[1] * x + matrix[3] * y + matrix[5]; - - return this; - }, - - /** - * Scale the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#scale - * @since 3.0.0 - * - * @param {number} x - The horizontal scale value. - * @param {number} y - The vertical scale value. - * - * @return {this} This TransformMatrix. - */ - scale: function (x, y) - { - var matrix = this.matrix; - - matrix[0] *= x; - matrix[1] *= x; - matrix[2] *= y; - matrix[3] *= y; - - return this; - }, - - /** - * Rotate the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#rotate - * @since 3.0.0 - * - * @param {number} angle - The angle of rotation in radians. - * - * @return {this} This TransformMatrix. - */ - rotate: function (angle) - { - var sin = Math.sin(angle); - var cos = Math.cos(angle); - - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - - matrix[0] = a * cos + c * sin; - matrix[1] = b * cos + d * sin; - matrix[2] = a * -sin + c * cos; - matrix[3] = b * -sin + d * cos; - - return this; - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * If an `out` Matrix is given then the results will be stored in it. - * If it is not given, this matrix will be updated in place instead. - * Use an `out` Matrix if you do not wish to mutate this matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#multiply - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} rhs - The Matrix to multiply by. - * @param {Phaser.GameObjects.Components.TransformMatrix} [out] - An optional Matrix to store the results in. - * - * @return {(this|Phaser.GameObjects.Components.TransformMatrix)} Either this TransformMatrix, or the `out` Matrix, if given in the arguments. - */ - multiply: function (rhs, out) - { - var matrix = this.matrix; - var source = rhs.matrix; - - var localA = matrix[0]; - var localB = matrix[1]; - var localC = matrix[2]; - var localD = matrix[3]; - var localE = matrix[4]; - var localF = matrix[5]; - - var sourceA = source[0]; - var sourceB = source[1]; - var sourceC = source[2]; - var sourceD = source[3]; - var sourceE = source[4]; - var sourceF = source[5]; - - var destinationMatrix = (out === undefined) ? matrix : out.matrix; - - destinationMatrix[0] = (sourceA * localA) + (sourceB * localC); - destinationMatrix[1] = (sourceA * localB) + (sourceB * localD); - destinationMatrix[2] = (sourceC * localA) + (sourceD * localC); - destinationMatrix[3] = (sourceC * localB) + (sourceD * localD); - destinationMatrix[4] = (sourceE * localA) + (sourceF * localC) + localE; - destinationMatrix[5] = (sourceE * localB) + (sourceF * localD) + localF; - - return destinationMatrix; - }, - - /** - * Multiply this Matrix by the matrix given, including the offset. - * - * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`. - * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`. - * - * @method Phaser.GameObjects.Components.TransformMatrix#multiplyWithOffset - * @since 3.11.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from. - * @param {number} offsetX - Horizontal offset to factor in to the multiplication. - * @param {number} offsetY - Vertical offset to factor in to the multiplication. - * - * @return {this} This TransformMatrix. - */ - multiplyWithOffset: function (src, offsetX, offsetY) - { - var matrix = this.matrix; - var otherMatrix = src.matrix; - - var a0 = matrix[0]; - var b0 = matrix[1]; - var c0 = matrix[2]; - var d0 = matrix[3]; - var tx0 = matrix[4]; - var ty0 = matrix[5]; - - var pse = offsetX * a0 + offsetY * c0 + tx0; - var psf = offsetX * b0 + offsetY * d0 + ty0; - - var a1 = otherMatrix[0]; - var b1 = otherMatrix[1]; - var c1 = otherMatrix[2]; - var d1 = otherMatrix[3]; - var tx1 = otherMatrix[4]; - var ty1 = otherMatrix[5]; - - matrix[0] = a1 * a0 + b1 * c0; - matrix[1] = a1 * b0 + b1 * d0; - matrix[2] = c1 * a0 + d1 * c0; - matrix[3] = c1 * b0 + d1 * d0; - matrix[4] = tx1 * a0 + ty1 * c0 + pse; - matrix[5] = tx1 * b0 + ty1 * d0 + psf; - - return this; - }, - - /** - * Transform the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#transform - * @since 3.0.0 - * - * @param {number} a - The Scale X value. - * @param {number} b - The Shear Y value. - * @param {number} c - The Shear X value. - * @param {number} d - The Scale Y value. - * @param {number} tx - The Translate X value. - * @param {number} ty - The Translate Y value. - * - * @return {this} This TransformMatrix. - */ - transform: function (a, b, c, d, tx, ty) - { - var matrix = this.matrix; - - var a0 = matrix[0]; - var b0 = matrix[1]; - var c0 = matrix[2]; - var d0 = matrix[3]; - var tx0 = matrix[4]; - var ty0 = matrix[5]; - - matrix[0] = a * a0 + b * c0; - matrix[1] = a * b0 + b * d0; - matrix[2] = c * a0 + d * c0; - matrix[3] = c * b0 + d * d0; - matrix[4] = tx * a0 + ty * c0 + tx0; - matrix[5] = tx * b0 + ty * d0 + ty0; - - return this; - }, - - /** - * Transform a point in to the local space of this Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint - * @since 3.0.0 - * - * @param {number} x - The x coordinate of the point to transform. - * @param {number} y - The y coordinate of the point to transform. - * @param {Phaser.Types.Math.Vector2Like} [point] - Optional Point object to store the transformed coordinates in. - * - * @return {Phaser.Types.Math.Vector2Like} The Point containing the transformed coordinates. - */ - transformPoint: function (x, y, point) - { - if (point === undefined) { point = { x: 0, y: 0 }; } - - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - var tx = matrix[4]; - var ty = matrix[5]; - - point.x = x * a + y * c + tx; - point.y = x * b + y * d + ty; - - return point; - }, - - /** - * Invert the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#invert - * @since 3.0.0 - * - * @return {this} This TransformMatrix. - */ - invert: function () - { - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - var tx = matrix[4]; - var ty = matrix[5]; - - var n = a * d - b * c; - - matrix[0] = d / n; - matrix[1] = -b / n; - matrix[2] = -c / n; - matrix[3] = a / n; - matrix[4] = (c * ty - d * tx) / n; - matrix[5] = -(a * ty - b * tx) / n; - - return this; - }, - - /** - * Set the values of this Matrix to copy those of the matrix given. - * - * @method Phaser.GameObjects.Components.TransformMatrix#copyFrom - * @since 3.11.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from. - * - * @return {this} This TransformMatrix. - */ - copyFrom: function (src) - { - var matrix = this.matrix; - - matrix[0] = src.a; - matrix[1] = src.b; - matrix[2] = src.c; - matrix[3] = src.d; - matrix[4] = src.e; - matrix[5] = src.f; - - return this; - }, - - /** - * Set the values of this Matrix to copy those of the array given. - * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. - * - * @method Phaser.GameObjects.Components.TransformMatrix#copyFromArray - * @since 3.11.0 - * - * @param {array} src - The array of values to set into this matrix. - * - * @return {this} This TransformMatrix. - */ - copyFromArray: function (src) - { - var matrix = this.matrix; - - matrix[0] = src[0]; - matrix[1] = src[1]; - matrix[2] = src[2]; - matrix[3] = src[3]; - matrix[4] = src[4]; - matrix[5] = src[5]; - - return this; - }, - - /** - * Copy the values from this Matrix to the given Canvas Rendering Context. - * This will use the Context.transform method. - * - * @method Phaser.GameObjects.Components.TransformMatrix#copyToContext - * @since 3.12.0 - * - * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to. - * - * @return {CanvasRenderingContext2D} The Canvas Rendering Context. - */ - copyToContext: function (ctx) - { - var matrix = this.matrix; - - ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); - - return ctx; - }, - - /** - * Copy the values from this Matrix to the given Canvas Rendering Context. - * This will use the Context.setTransform method. - * - * @method Phaser.GameObjects.Components.TransformMatrix#setToContext - * @since 3.12.0 - * - * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to. - * - * @return {CanvasRenderingContext2D} The Canvas Rendering Context. - */ - setToContext: function (ctx) - { - var matrix = this.matrix; - - ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); - - return ctx; - }, - - /** - * Copy the values in this Matrix to the array given. - * - * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. - * - * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray - * @since 3.12.0 - * - * @param {array} [out] - The array to copy the matrix values in to. - * - * @return {array} An array where elements 0 to 5 contain the values from this matrix. - */ - copyToArray: function (out) - { - var matrix = this.matrix; - - if (out === undefined) - { - out = [ matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] ]; - } - else - { - out[0] = matrix[0]; - out[1] = matrix[1]; - out[2] = matrix[2]; - out[3] = matrix[3]; - out[4] = matrix[4]; - out[5] = matrix[5]; - } - - return out; - }, - - /** - * Set the values of this Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#setTransform - * @since 3.0.0 - * - * @param {number} a - The Scale X value. - * @param {number} b - The Shear Y value. - * @param {number} c - The Shear X value. - * @param {number} d - The Scale Y value. - * @param {number} tx - The Translate X value. - * @param {number} ty - The Translate Y value. - * - * @return {this} This TransformMatrix. - */ - setTransform: function (a, b, c, d, tx, ty) - { - var matrix = this.matrix; - - matrix[0] = a; - matrix[1] = b; - matrix[2] = c; - matrix[3] = d; - matrix[4] = tx; - matrix[5] = ty; - - return this; - }, - - /** - * Decompose this Matrix into its translation, scale and rotation values using QR decomposition. - * - * The result must be applied in the following order to reproduce the current matrix: - * - * translate -> rotate -> scale - * - * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix - * @since 3.0.0 - * - * @return {object} The decomposed Matrix. - */ - decomposeMatrix: function () - { - var decomposedMatrix = this.decomposedMatrix; - - var matrix = this.matrix; - - // a = scale X (1) - // b = shear Y (0) - // c = shear X (0) - // d = scale Y (1) - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - - var determ = a * d - b * c; - - decomposedMatrix.translateX = matrix[4]; - decomposedMatrix.translateY = matrix[5]; - - if (a || b) - { - var r = Math.sqrt(a * a + b * b); - - decomposedMatrix.rotation = (b > 0) ? Math.acos(a / r) : -Math.acos(a / r); - decomposedMatrix.scaleX = r; - decomposedMatrix.scaleY = determ / r; - } - else if (c || d) - { - var s = Math.sqrt(c * c + d * d); - - decomposedMatrix.rotation = Math.PI * 0.5 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s)); - decomposedMatrix.scaleX = determ / s; - decomposedMatrix.scaleY = s; - } - else - { - decomposedMatrix.rotation = 0; - decomposedMatrix.scaleX = 0; - decomposedMatrix.scaleY = 0; - } - - return decomposedMatrix; - }, - - /** - * Apply the identity, translate, rotate and scale operations on the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#applyITRS - * @since 3.0.0 - * - * @param {number} x - The horizontal translation. - * @param {number} y - The vertical translation. - * @param {number} rotation - The angle of rotation in radians. - * @param {number} scaleX - The horizontal scale. - * @param {number} scaleY - The vertical scale. - * - * @return {this} This TransformMatrix. - */ - applyITRS: function (x, y, rotation, scaleX, scaleY) - { - var matrix = this.matrix; - - var radianSin = Math.sin(rotation); - var radianCos = Math.cos(rotation); - - // Translate - matrix[4] = x; - matrix[5] = y; - - // Rotate and Scale - matrix[0] = radianCos * scaleX; - matrix[1] = radianSin * scaleX; - matrix[2] = -radianSin * scaleY; - matrix[3] = radianCos * scaleY; - - return this; - }, - - /** - * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of - * the current matrix with its transformation applied. - * - * Can be used to translate points from world to local space. - * - * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse - * @since 3.12.0 - * - * @param {number} x - The x position to translate. - * @param {number} y - The y position to translate. - * @param {Phaser.Math.Vector2} [output] - A Vector2, or point-like object, to store the results in. - * - * @return {Phaser.Math.Vector2} The coordinates, inverse-transformed through this matrix. - */ - applyInverse: function (x, y, output) - { - if (output === undefined) { output = new Vector2(); } - - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - var tx = matrix[4]; - var ty = matrix[5]; - - var id = 1 / ((a * d) + (c * -b)); - - output.x = (d * id * x) + (-c * id * y) + (((ty * c) - (tx * d)) * id); - output.y = (a * id * y) + (-b * id * x) + (((-ty * a) + (tx * b)) * id); - - return output; - }, - - /** - * Performs the 8 calculations required to create the vertices of - * a quad based on this matrix and the given x/y/xw/yh values. - * - * The result is stored in `TransformMatrix.quad`, which is returned - * from this method. - * - * @method Phaser.GameObjects.Components.TransformMatrix#setQuad - * @since 3.60.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {number} xw - The xw value. - * @param {number} yh - The yh value. - * @param {boolean} roundPixels - Pass the results via Math.round? - * @param {Float32Array} [quad] - Optional Float32Array to store the results in. Otherwises uses the local quad array. - * - * @return {Float32Array} The quad Float32Array. - */ - setQuad: function (x, y, xw, yh, roundPixels, quad) - { - if (quad === undefined) { quad = this.quad; } - - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - var e = matrix[4]; - var f = matrix[5]; - - quad[0] = x * a + y * c + e; - quad[1] = x * b + y * d + f; - - quad[2] = x * a + yh * c + e; - quad[3] = x * b + yh * d + f; - - quad[4] = xw * a + yh * c + e; - quad[5] = xw * b + yh * d + f; - - quad[6] = xw * a + y * c + e; - quad[7] = xw * b + y * d + f; - - if (roundPixels) - { - quad.forEach(function (value, index) - { - quad[index] = Math.round(value); - }); - } - - return quad; - }, - - /** - * Returns the X component of this matrix multiplied by the given values. - * This is the same as `x * a + y * c + e`. - * - * @method Phaser.GameObjects.Components.TransformMatrix#getX - * @since 3.12.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * - * @return {number} The calculated x value. - */ - getX: function (x, y) - { - return x * this.a + y * this.c + this.e; - }, - - /** - * Returns the Y component of this matrix multiplied by the given values. - * This is the same as `x * b + y * d + f`. - * - * @method Phaser.GameObjects.Components.TransformMatrix#getY - * @since 3.12.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * - * @return {number} The calculated y value. - */ - getY: function (x, y) - { - return x * this.b + y * this.d + this.f; - }, - - /** - * Returns the X component of this matrix multiplied by the given values. - * - * This is the same as `x * a + y * c + e`, optionally passing via `Math.round`. - * - * @method Phaser.GameObjects.Components.TransformMatrix#getXRound - * @since 3.50.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {boolean} [round=false] - Math.round the resulting value? - * - * @return {number} The calculated x value. - */ - getXRound: function (x, y, round) - { - var v = this.getX(x, y); - - if (round) - { - v = Math.round(v); - } - - return v; - }, - - /** - * Returns the Y component of this matrix multiplied by the given values. - * - * This is the same as `x * b + y * d + f`, optionally passing via `Math.round`. - * - * @method Phaser.GameObjects.Components.TransformMatrix#getYRound - * @since 3.50.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {boolean} [round=false] - Math.round the resulting value? - * - * @return {number} The calculated y value. - */ - getYRound: function (x, y, round) - { - var v = this.getY(x, y); - - if (round) - { - v = Math.round(v); - } - - return v; - }, - - /** - * Returns a string that can be used in a CSS Transform call as a `matrix` property. - * - * @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix - * @since 3.12.0 - * - * @return {string} A string containing the CSS Transform matrix values. - */ - getCSSMatrix: function () - { - var m = this.matrix; - - return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')'; - }, - - /** - * Destroys this Transform Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#destroy - * @since 3.4.0 - */ - destroy: function () - { - this.matrix = null; - this.quad = null; - this.decomposedMatrix = null; - } - -}); - -module.exports = TransformMatrix; - - -/***/ }), -/* 27 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if an array can be used as a matrix. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.CheckMatrix - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix] - * - * @param {T[][]} [matrix] - The array to check. - * - * @return {boolean} `true` if the given `matrix` array is a valid matrix. - */ -var CheckMatrix = function (matrix) -{ - if (!Array.isArray(matrix) || !Array.isArray(matrix[0])) - { - return false; - } - - // How long is the first row? - var size = matrix[0].length; - - // Validate the rest of the rows are the same length - for (var i = 1; i < matrix.length; i++) - { - if (matrix[i].length !== size) - { - return false; - } - } - - return true; -}; - -module.exports = CheckMatrix; - - -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process) {/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Determines the operating system of the device running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.os` from within any Scene. - * - * @typedef {object} Phaser.Device.OS - * @since 3.0.0 - * - * @property {boolean} android - Is running on android? - * @property {boolean} chromeOS - Is running on chromeOS? - * @property {boolean} cordova - Is the game running under Apache Cordova? - * @property {boolean} crosswalk - Is the game running under the Intel Crosswalk XDK? - * @property {boolean} desktop - Is running on a desktop? - * @property {boolean} ejecta - Is the game running under Ejecta? - * @property {boolean} electron - Is the game running under GitHub Electron? - * @property {boolean} iOS - Is running on iOS? - * @property {boolean} iPad - Is running on iPad? - * @property {boolean} iPhone - Is running on iPhone? - * @property {boolean} kindle - Is running on an Amazon Kindle? - * @property {boolean} linux - Is running on linux? - * @property {boolean} macOS - Is running on macOS? - * @property {boolean} node - Is the game running under Node.js? - * @property {boolean} nodeWebkit - Is the game running under Node-Webkit? - * @property {boolean} webApp - Set to true if running as a WebApp, i.e. within a WebView - * @property {boolean} windows - Is running on windows? - * @property {boolean} windowsPhone - Is running on a Windows Phone? - * @property {number} iOSVersion - If running in iOS this will contain the major version number. - * @property {number} pixelRatio - PixelRatio of the host device? - */ -var OS = { - - android: false, - chromeOS: false, - cordova: false, - crosswalk: false, - desktop: false, - ejecta: false, - electron: false, - iOS: false, - iOSVersion: 0, - iPad: false, - iPhone: false, - kindle: false, - linux: false, - macOS: false, - node: false, - nodeWebkit: false, - pixelRatio: 1, - webApp: false, - windows: false, - windowsPhone: false - -}; - -function init () -{ - if (typeof importScripts === 'function') - { - return OS; - } - - var ua = navigator.userAgent; - - if ((/Windows/).test(ua)) - { - OS.windows = true; - } - else if ((/Mac OS/).test(ua) && !((/like Mac OS/).test(ua))) - { - // Because iOS 13 identifies as Mac OS: - if (navigator.maxTouchPoints && navigator.maxTouchPoints > 2) - { - OS.iOS = true; - OS.iPad = true; - - (navigator.appVersion).match(/Version\/(\d+)/); - - OS.iOSVersion = parseInt(RegExp.$1, 10); - } - else - { - OS.macOS = true; - } - } - else if ((/Android/).test(ua)) - { - OS.android = true; - } - else if ((/Linux/).test(ua)) - { - OS.linux = true; - } - else if ((/iP[ao]d|iPhone/i).test(ua)) - { - OS.iOS = true; - - (navigator.appVersion).match(/OS (\d+)/); - - OS.iOSVersion = parseInt(RegExp.$1, 10); - - OS.iPhone = ua.toLowerCase().indexOf('iphone') !== -1; - OS.iPad = ua.toLowerCase().indexOf('ipad') !== -1; - } - else if ((/Kindle/).test(ua) || (/\bKF[A-Z][A-Z]+/).test(ua) || (/Silk.*Mobile Safari/).test(ua)) - { - OS.kindle = true; - - // This will NOT detect early generations of Kindle Fire, I think there is no reliable way... - // E.g. "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true" - } - else if ((/CrOS/).test(ua)) - { - OS.chromeOS = true; - } - - if ((/Windows Phone/i).test(ua) || (/IEMobile/i).test(ua)) - { - OS.android = false; - OS.iOS = false; - OS.macOS = false; - OS.windows = true; - OS.windowsPhone = true; - } - - var silk = (/Silk/).test(ua); - - if (OS.windows || OS.macOS || (OS.linux && !silk) || OS.chromeOS) - { - OS.desktop = true; - } - - // Windows Phone / Table reset - if (OS.windowsPhone || (((/Windows NT/i).test(ua)) && ((/Touch/i).test(ua)))) - { - OS.desktop = false; - } - - // WebApp mode in iOS - if (navigator.standalone) - { - OS.webApp = true; - } - - if (typeof importScripts !== 'function') - { - if (window.cordova !== undefined) - { - OS.cordova = true; - } - - if (window.ejecta !== undefined) - { - OS.ejecta = true; - } - } - - if (typeof process !== 'undefined' && process.versions && process.versions.node) - { - OS.node = true; - } - - if (OS.node && typeof process.versions === 'object') - { - OS.nodeWebkit = !!process.versions['node-webkit']; - - OS.electron = !!process.versions.electron; - } - - if ((/Crosswalk/).test(ua)) - { - OS.crosswalk = true; - } - - OS.pixelRatio = window['devicePixelRatio'] || 1; - - return OS; -} - -module.exports = init(); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(302))) - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Contains = __webpack_require__(320); -var GetPoint = __webpack_require__(66); -var GetPoints = __webpack_require__(321); -var GEOM_CONST = __webpack_require__(30); -var Line = __webpack_require__(322); -var Random = __webpack_require__(327); - -/** - * @classdesc - * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height) - * - * @class Rectangle - * @memberof Phaser.Geom - * @constructor - * @since 3.0.0 - * - * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. - * @param {number} [width=0] - The width of the Rectangle. - * @param {number} [height=0] - The height of the Rectangle. - */ -var Rectangle = new Class({ - - initialize: - - function Rectangle (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = 0; } - if (height === undefined) { height = 0; } - - /** - * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. - * Used for fast type comparisons. - * - * @name Phaser.Geom.Rectangle#type - * @type {number} - * @readonly - * @since 3.19.0 - */ - this.type = GEOM_CONST.RECTANGLE; - - /** - * The X coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = x; - - /** - * The Y coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = y; - - /** - * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. - * - * @name Phaser.Geom.Rectangle#width - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.width = width; - - /** - * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. - * - * @name Phaser.Geom.Rectangle#height - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.height = height; - }, - - /** - * Checks if the given point is inside the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#contains - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. - * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ - contains: function (x, y) - { - return Contains(this, x, y); - }, - - /** - * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * - * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * - * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. - * - * @method Phaser.Geom.Rectangle#getPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [output,$return] - * - * @param {number} position - The normalized distance into the Rectangle's perimeter to return. - * @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point. - * - * @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given. - */ - getPoint: function (position, output) - { - return GetPoint(this, position, output); - }, - - /** - * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. - * - * @method Phaser.Geom.Rectangle#getPoints - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point[]} O - [output,$return] - * - * @param {number} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. - * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. - * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points. - * - * @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided. - */ - getPoints: function (quantity, stepRate, output) - { - return GetPoints(this, quantity, stepRate, output); - }, - - /** - * Returns a random point within the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#getRandomPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [point,$return] - * - * @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point. - * - * @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided. - */ - getRandomPoint: function (point) - { - return Random(this, point); - }, - - /** - * Sets the position, width, and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setTo - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} y - The Y coordinate of the top left corner of the Rectangle. - * @param {number} width - The width of the Rectangle. - * @param {number} height - The height of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setTo: function (x, y, width, height) - { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - - return this; - }, - - /** - * Resets the position, width, and height of the Rectangle to 0. - * - * @method Phaser.Geom.Rectangle#setEmpty - * @since 3.0.0 - * - * @return {this} This Rectangle object. - */ - setEmpty: function () - { - return this.setTo(0, 0, 0, 0); - }, - - /** - * Sets the position of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setPosition - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setPosition: function (x, y) - { - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - }, - - /** - * Sets the width and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setSize - * @since 3.0.0 - * - * @param {number} width - The width to set the Rectangle to. - * @param {number} [height=width] - The height to set the Rectangle to. - * - * @return {this} This Rectangle object. - */ - setSize: function (width, height) - { - if (height === undefined) { height = width; } - - this.width = width; - this.height = height; - - return this; - }, - - /** - * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. - * - * @method Phaser.Geom.Rectangle#isEmpty - * @since 3.0.0 - * - * @return {boolean} `true` if the Rectangle is empty. A Rectangle object is empty if its width or height is less than or equal to 0. - */ - isEmpty: function () - { - return (this.width <= 0 || this.height <= 0); - }, - - /** - * Returns a Line object that corresponds to the top of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineA - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle. - */ - getLineA: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.y, this.right, this.y); - - return line; - }, - - /** - * Returns a Line object that corresponds to the right of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineB - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle. - */ - getLineB: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.y, this.right, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the bottom of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineC - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle. - */ - getLineC: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.bottom, this.x, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the left of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineD - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle. - */ - getLineD: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.bottom, this.x, this.y); - - return line; - }, - - /** - * The x coordinate of the left of the Rectangle. - * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. - * - * @name Phaser.Geom.Rectangle#left - * @type {number} - * @since 3.0.0 - */ - left: { - - get: function () - { - return this.x; - }, - - set: function (value) - { - if (value >= this.right) - { - this.width = 0; - } - else - { - this.width = this.right - value; - } - - this.x = value; - } - - }, - - /** - * The sum of the x and width properties. - * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. - * - * @name Phaser.Geom.Rectangle#right - * @type {number} - * @since 3.0.0 - */ - right: { - - get: function () - { - return this.x + this.width; - }, - - set: function (value) - { - if (value <= this.x) - { - this.width = 0; - } - else - { - this.width = value - this.x; - } - } - - }, - - /** - * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. - * However it does affect the height property, whereas changing the y value does not affect the height property. - * - * @name Phaser.Geom.Rectangle#top - * @type {number} - * @since 3.0.0 - */ - top: { - - get: function () - { - return this.y; - }, - - set: function (value) - { - if (value >= this.bottom) - { - this.height = 0; - } - else - { - this.height = (this.bottom - value); - } - - this.y = value; - } - - }, - - /** - * The sum of the y and height properties. - * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. - * - * @name Phaser.Geom.Rectangle#bottom - * @type {number} - * @since 3.0.0 - */ - bottom: { - - get: function () - { - return this.y + this.height; - }, - - set: function (value) - { - if (value <= this.y) - { - this.height = 0; - } - else - { - this.height = value - this.y; - } - } - - }, - - /** - * The x coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerX - * @type {number} - * @since 3.0.0 - */ - centerX: { - - get: function () - { - return this.x + (this.width / 2); - }, - - set: function (value) - { - this.x = value - (this.width / 2); - } - - }, - - /** - * The y coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerY - * @type {number} - * @since 3.0.0 - */ - centerY: { - - get: function () - { - return this.y + (this.height / 2); - }, - - set: function (value) - { - this.y = value - (this.height / 2); - } - - } - -}); - -module.exports = Rectangle; - - -/***/ }), -/* 30 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GEOM_CONST = { - - /** - * A Circle Geometry object type. - * - * @name Phaser.Geom.CIRCLE - * @type {number} - * @since 3.19.0 - */ - CIRCLE: 0, - - /** - * An Ellipse Geometry object type. - * - * @name Phaser.Geom.ELLIPSE - * @type {number} - * @since 3.19.0 - */ - ELLIPSE: 1, - - /** - * A Line Geometry object type. - * - * @name Phaser.Geom.LINE - * @type {number} - * @since 3.19.0 - */ - LINE: 2, - - /** - * A Point Geometry object type. - * - * @name Phaser.Geom.POINT - * @type {number} - * @since 3.19.0 - */ - POINT: 3, - - /** - * A Polygon Geometry object type. - * - * @name Phaser.Geom.POLYGON - * @type {number} - * @since 3.19.0 - */ - POLYGON: 4, - - /** - * A Rectangle Geometry object type. - * - * @name Phaser.Geom.RECTANGLE - * @type {number} - * @since 3.19.0 - */ - RECTANGLE: 5, - - /** - * A Triangle Geometry object type. - * - * @name Phaser.Geom.TRIANGLE - * @type {number} - * @since 3.19.0 - */ - TRIANGLE: 6 - -}; - -module.exports = GEOM_CONST; - - -/***/ }), -/* 31 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Find the angle of a segment from (x1, y1) -> (x2, y2). - * - * @function Phaser.Math.Angle.Between - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The angle in radians. - */ -var Between = function (x1, y1, x2, y2) -{ - return Math.atan2(y2 - y1, x2 - x1); -}; - -module.exports = Between; - - -/***/ }), -/* 32 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Normalize an angle to the [0, 2pi] range. - * - * @function Phaser.Math.Angle.Normalize - * @since 3.0.0 - * - * @param {number} angle - The angle to normalize, in radians. - * - * @return {number} The normalized angle, in radians. - */ -var Normalize = function (angle) -{ - angle = angle % (2 * Math.PI); - - if (angle >= 0) - { - return angle; - } - else - { - return angle + 2 * Math.PI; - } -}; - -module.exports = Normalize; - - -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MathWrap = __webpack_require__(6); - -/** - * Wrap an angle. - * - * Wraps the angle to a value in the range of -PI to PI. - * - * @function Phaser.Math.Angle.Wrap - * @since 3.0.0 - * - * @param {number} angle - The angle to wrap, in radians. - * - * @return {number} The wrapped angle, in radians. - */ -var Wrap = function (angle) -{ - return MathWrap(angle, -Math.PI, Math.PI); -}; - -module.exports = Wrap; - - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Wrap = __webpack_require__(6); - -/** - * Wrap an angle in degrees. - * - * Wraps the angle to a value in the range of -180 to 180. - * - * @function Phaser.Math.Angle.WrapDegrees - * @since 3.0.0 - * - * @param {number} angle - The angle to wrap, in degrees. - * - * @return {number} The wrapped angle, in degrees. - */ -var WrapDegrees = function (angle) -{ - return Wrap(angle, -180, 180); -}; - -module.exports = WrapDegrees; - - -/***/ }), -/* 35 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check whether the given values are fuzzily equal. - * - * Two numbers are fuzzily equal if their difference is less than `epsilon`. - * - * @function Phaser.Math.Fuzzy.Equal - * @since 3.0.0 - * - * @param {number} a - The first value. - * @param {number} b - The second value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`. - */ -var Equal = function (a, b, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return Math.abs(a - b) < epsilon; -}; - -module.exports = Equal; - - -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Factorial = __webpack_require__(37); - -/** - * Calculates the Bernstein basis from the three factorial coefficients. - * - * @function Phaser.Math.Bernstein - * @since 3.0.0 - * - * @param {number} n - The first value. - * @param {number} i - The second value. - * - * @return {number} The Bernstein basis of Factorial(n) / Factorial(i) / Factorial(n - i) - */ -var Bernstein = function (n, i) -{ - return Factorial(n) / Factorial(i) / Factorial(n - i); -}; - -module.exports = Bernstein; - - -/***/ }), -/* 37 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates the factorial of a given number for integer values greater than 0. - * - * @function Phaser.Math.Factorial - * @since 3.0.0 - * - * @param {number} value - A positive integer to calculate the factorial of. - * - * @return {number} The factorial of the given number. - */ -var Factorial = function (value) -{ - if (value === 0) - { - return 1; - } - - var res = value; - - while (--value) - { - res *= value; - } - - return res; -}; - -module.exports = Factorial; - - -/***/ }), -/* 38 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates a Catmull-Rom value from the given points, based on an alpha of 0.5. - * - * @function Phaser.Math.CatmullRom - * @since 3.0.0 - * - * @param {number} t - The amount to interpolate by. - * @param {number} p0 - The first control point. - * @param {number} p1 - The second control point. - * @param {number} p2 - The third control point. - * @param {number} p3 - The fourth control point. - * - * @return {number} The Catmull-Rom value. - */ -var CatmullRom = function (t, p0, p1, p2, p3) -{ - var v0 = (p2 - p0) * 0.5; - var v1 = (p3 - p1) * 0.5; - var t2 = t * t; - var t3 = t * t2; - - return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1; -}; - -module.exports = CatmullRom; - - -/***/ }), -/* 39 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates a linear (interpolation) value over t. - * - * @function Phaser.Math.Linear - * @since 3.0.0 - * - * @param {number} p0 - The first point. - * @param {number} p1 - The second point. - * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1. - * - * @return {number} The step t% of the way between p0 and p1. - */ -var Linear = function (p0, p1, t) -{ - return (p1 - p0) * t + p0; -}; - -module.exports = Linear; - - -/***/ }), -/* 40 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate a smooth interpolation percentage of `x` between `min` and `max`. - * - * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, - * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, - * between 0 and 1 otherwise. - * - * @function Phaser.Math.SmoothStep - * @since 3.0.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep} - * - * @param {number} x - The input value. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The percentage of interpolation, between 0 and 1. - */ -var SmoothStep = function (x, min, max) -{ - if (x <= min) - { - return 0; - } - - if (x >= max) - { - return 1; - } - - x = (x - min) / (max - min); - - return x * x * (3 - 2 * x); -}; - -module.exports = SmoothStep; - - -/***/ }), -/* 41 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate a smoother interpolation percentage of `x` between `min` and `max`. - * - * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, - * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, - * between 0 and 1 otherwise. - * - * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}. - * - * @function Phaser.Math.SmootherStep - * @since 3.0.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} - * - * @param {number} x - The input value. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The percentage of interpolation, between 0 and 1. - */ -var SmootherStep = function (x, min, max) -{ - x = Math.max(0, Math.min(1, (x - min) / (max - min))); - - return x * x * x * (x * (x * 6 - 15) + 10); -}; - -module.exports = SmootherStep; - - -/***/ }), -/* 42 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotate a `point` around `x` and `y` to the given `angle`, at the same distance. - * - * In polar notation, this maps a point from (r, t) to (r, angle), vs. the origin (x, y). - * - * @function Phaser.Math.RotateAround - * @since 3.0.0 - * - * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] - * - * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. - * @param {number} x - The horizontal coordinate to rotate around. - * @param {number} y - The vertical coordinate to rotate around. - * @param {number} angle - The angle of rotation in radians. - * - * @return {Phaser.Types.Math.Vector2Like} The given point. - */ -var RotateAround = function (point, x, y, angle) -{ - var c = Math.cos(angle); - var s = Math.sin(angle); - - var tx = point.x - x; - var ty = point.y - y; - - point.x = tx * c - ty * s + x; - point.y = tx * s + ty * c + y; - - return point; -}; - -module.exports = RotateAround; - - -/***/ }), -/* 43 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down. - * - * @function Phaser.Math.RoundAwayFromZero - * @since 3.0.0 - * - * @param {number} value - The number to round. - * - * @return {number} The rounded number, rounded away from zero. - */ -var RoundAwayFromZero = function (value) -{ - // "Opposite" of truncate. - return (value > 0) ? Math.ceil(value) : Math.floor(value); -}; - -module.exports = RoundAwayFromZero; - - -/***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Vector2 = __webpack_require__(3); - -/** - * Takes the `x` and `y` coordinates and transforms them into the same space as - * defined by the position, rotation and scale values. - * - * @function Phaser.Math.TransformXY - * @since 3.0.0 - * - * @param {number} x - The x coordinate to be transformed. - * @param {number} y - The y coordinate to be transformed. - * @param {number} positionX - Horizontal position of the transform point. - * @param {number} positionY - Vertical position of the transform point. - * @param {number} rotation - Rotation of the transform point, in radians. - * @param {number} scaleX - Horizontal scale of the transform point. - * @param {number} scaleY - Vertical scale of the transform point. - * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates. - * - * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point. - */ -var TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output) -{ - if (output === undefined) { output = new Vector2(); } - - var radianSin = Math.sin(rotation); - var radianCos = Math.cos(rotation); - - // Rotate and Scale - var a = radianCos * scaleX; - var b = radianSin * scaleX; - var c = -radianSin * scaleY; - var d = radianCos * scaleY; - - // Invert - var id = 1 / ((a * d) + (c * -b)); - - output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id); - output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id); - - return output; -}; - -module.exports = TransformXY; - - -/***/ }), -/* 45 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A three-dimensional matrix. - * - * Defaults to the identity matrix when instantiated. - * - * @class Matrix3 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from. - */ -var Matrix3 = new Class({ - - initialize: - - function Matrix3 (m) - { - /** - * The matrix values. - * - * @name Phaser.Math.Matrix3#val - * @type {Float32Array} - * @since 3.0.0 - */ - this.val = new Float32Array(9); - - if (m) - { - // Assume Matrix3 with val: - this.copy(m); - } - else - { - // Default to identity - this.identity(); - } - }, - - /** - * Make a clone of this Matrix3. - * - * @method Phaser.Math.Matrix3#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} A clone of this Matrix3. - */ - clone: function () - { - return new Matrix3(this); - }, - - /** - * This method is an alias for `Matrix3.copy`. - * - * @method Phaser.Math.Matrix3#set - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - set: function (src) - { - return this.copy(src); - }, - - /** - * Copy the values of a given Matrix into this Matrix. - * - * @method Phaser.Math.Matrix3#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - copy: function (src) - { - var out = this.val; - var a = src.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - - return this; - }, - - /** - * Copy the values of a given Matrix4 into this Matrix3. - * - * @method Phaser.Math.Matrix3#fromMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - fromMat4: function (m) - { - var a = m.val; - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[4]; - out[4] = a[5]; - out[5] = a[6]; - out[6] = a[8]; - out[7] = a[9]; - out[8] = a[10]; - - return this; - }, - - /** - * Set the values of this Matrix from the given array. - * - * @method Phaser.Math.Matrix3#fromArray - * @since 3.0.0 - * - * @param {array} a - The array to copy the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - fromArray: function (a) - { - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - - return this; - }, - - /** - * Reset this Matrix to an identity (default) matrix. - * - * @method Phaser.Math.Matrix3#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - identity: function () - { - var out = this.val; - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 1; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - - return this; - }, - - /** - * Transpose this Matrix. - * - * @method Phaser.Math.Matrix3#transpose - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - transpose: function () - { - var a = this.val; - var a01 = a[1]; - var a02 = a[2]; - var a12 = a[5]; - - a[1] = a[3]; - a[2] = a[6]; - a[3] = a01; - a[5] = a[7]; - a[6] = a02; - a[7] = a12; - - return this; - }, - - /** - * Invert this Matrix. - * - * @method Phaser.Math.Matrix3#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - invert: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - var b01 = a22 * a11 - a12 * a21; - var b11 = -a22 * a10 + a12 * a20; - var b21 = a21 * a10 - a11 * a20; - - // Calculate the determinant - var det = a00 * b01 + a01 * b11 + a02 * b21; - - if (!det) - { - return null; - } - - det = 1 / det; - - a[0] = b01 * det; - a[1] = (-a22 * a01 + a02 * a21) * det; - a[2] = (a12 * a01 - a02 * a11) * det; - a[3] = b11 * det; - a[4] = (a22 * a00 - a02 * a20) * det; - a[5] = (-a12 * a00 + a02 * a10) * det; - a[6] = b21 * det; - a[7] = (-a21 * a00 + a01 * a20) * det; - a[8] = (a11 * a00 - a01 * a10) * det; - - return this; - }, - - /** - * Calculate the adjoint, or adjugate, of this Matrix. - * - * @method Phaser.Math.Matrix3#adjoint - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - adjoint: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - a[0] = (a11 * a22 - a12 * a21); - a[1] = (a02 * a21 - a01 * a22); - a[2] = (a01 * a12 - a02 * a11); - a[3] = (a12 * a20 - a10 * a22); - a[4] = (a00 * a22 - a02 * a20); - a[5] = (a02 * a10 - a00 * a12); - a[6] = (a10 * a21 - a11 * a20); - a[7] = (a01 * a20 - a00 * a21); - a[8] = (a00 * a11 - a01 * a10); - - return this; - }, - - /** - * Calculate the determinant of this Matrix. - * - * @method Phaser.Math.Matrix3#determinant - * @since 3.0.0 - * - * @return {number} The determinant of this Matrix. - */ - determinant: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * @method Phaser.Math.Matrix3#multiply - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - multiply: function (src) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - var b = src.val; - - var b00 = b[0]; - var b01 = b[1]; - var b02 = b[2]; - var b10 = b[3]; - var b11 = b[4]; - var b12 = b[5]; - var b20 = b[6]; - var b21 = b[7]; - var b22 = b[8]; - - a[0] = b00 * a00 + b01 * a10 + b02 * a20; - a[1] = b00 * a01 + b01 * a11 + b02 * a21; - a[2] = b00 * a02 + b01 * a12 + b02 * a22; - - a[3] = b10 * a00 + b11 * a10 + b12 * a20; - a[4] = b10 * a01 + b11 * a11 + b12 * a21; - a[5] = b10 * a02 + b11 * a12 + b12 * a22; - - a[6] = b20 * a00 + b21 * a10 + b22 * a20; - a[7] = b20 * a01 + b21 * a11 + b22 * a21; - a[8] = b20 * a02 + b21 * a12 + b22 * a22; - - return this; - }, - - /** - * Translate this Matrix using the given Vector. - * - * @method Phaser.Math.Matrix3#translate - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - translate: function (v) - { - var a = this.val; - var x = v.x; - var y = v.y; - - a[6] = x * a[0] + y * a[3] + a[6]; - a[7] = x * a[1] + y * a[4] + a[7]; - a[8] = x * a[2] + y * a[5] + a[8]; - - return this; - }, - - /** - * Apply a rotation transformation to this Matrix. - * - * @method Phaser.Math.Matrix3#rotate - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - rotate: function (rad) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - - var s = Math.sin(rad); - var c = Math.cos(rad); - - a[0] = c * a00 + s * a10; - a[1] = c * a01 + s * a11; - a[2] = c * a02 + s * a12; - - a[3] = c * a10 - s * a00; - a[4] = c * a11 - s * a01; - a[5] = c * a12 - s * a02; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * Uses the `x` and `y` components of the given Vector to scale the Matrix. - * - * @method Phaser.Math.Matrix3#scale - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - scale: function (v) - { - var a = this.val; - var x = v.x; - var y = v.y; - - a[0] = x * a[0]; - a[1] = x * a[1]; - a[2] = x * a[2]; - - a[3] = y * a[3]; - a[4] = y * a[4]; - a[5] = y * a[5]; - - return this; - }, - - /** - * Set the values of this Matrix from the given Quaternion. - * - * @method Phaser.Math.Matrix3#fromQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - fromQuat: function (q) - { - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - var out = this.val; - - out[0] = 1 - (yy + zz); - out[3] = xy + wz; - out[6] = xz - wy; - - out[1] = xy - wz; - out[4] = 1 - (xx + zz); - out[7] = yz + wx; - - out[2] = xz + wy; - out[5] = yz - wx; - out[8] = 1 - (xx + yy); - - return this; - }, - - /** - * Set the values of this Matrix3 to be normalized from the given Matrix4. - * - * @method Phaser.Math.Matrix3#normalFromMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to normalize the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - normalFromMat4: function (m) - { - var a = m.val; - var out = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) - { - return null; - } - - det = 1 / det; - - out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - - out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - - out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - - return this; - } - -}); - -module.exports = Matrix3; - - -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); -var Matrix3 = __webpack_require__(45); -var NOOP = __webpack_require__(2); -var Vector3 = __webpack_require__(16); - -var EPSILON = 0.000001; - -// Some shared 'private' arrays -var siNext = new Int8Array([ 1, 2, 0 ]); -var tmp = new Float32Array([ 0, 0, 0 ]); - -var xUnitVec3 = new Vector3(1, 0, 0); -var yUnitVec3 = new Vector3(0, 1, 0); - -var tmpvec = new Vector3(); -var tmpMat3 = new Matrix3(); - -/** - * @classdesc - * A quaternion. - * - * @class Quaternion - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number} [x=0] - The x component. - * @param {number} [y=0] - The y component. - * @param {number} [z=0] - The z component. - * @param {number} [w=1] - The w component. - */ -var Quaternion = new Class({ - - initialize: - - function Quaternion (x, y, z, w) - { - /** - * The x component of this Quaternion. - * - * @name Phaser.Math.Quaternion#_x - * @type {number} - * @default 0 - * @private - * @since 3.50.0 - */ - - /** - * The y component of this Quaternion. - * - * @name Phaser.Math.Quaternion#_y - * @type {number} - * @default 0 - * @private - * @since 3.50.0 - */ - - /** - * The z component of this Quaternion. - * - * @name Phaser.Math.Quaternion#_z - * @type {number} - * @default 0 - * @private - * @since 3.50.0 - */ - - /** - * The w component of this Quaternion. - * - * @name Phaser.Math.Quaternion#_w - * @type {number} - * @default 0 - * @private - * @since 3.50.0 - */ - - /** - * This callback is invoked, if set, each time a value in this quaternion is changed. - * The callback is passed one argument, a reference to this quaternion. - * - * @name Phaser.Math.Quaternion#onChangeCallback - * @type {function} - * @since 3.50.0 - */ - this.onChangeCallback = NOOP; - - this.set(x, y, z, w); - }, - - /** - * The x component of this Quaternion. - * - * @name Phaser.Math.Quaternion#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - x: { - get: function () - { - return this._x; - }, - - set: function (value) - { - this._x = value; - - this.onChangeCallback(this); - } - }, - - /** - * The y component of this Quaternion. - * - * @name Phaser.Math.Quaternion#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - y: { - get: function () - { - return this._y; - }, - - set: function (value) - { - this._y = value; - - this.onChangeCallback(this); - } - }, - - /** - * The z component of this Quaternion. - * - * @name Phaser.Math.Quaternion#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - z: { - get: function () - { - return this._z; - }, - - set: function (value) - { - this._z = value; - - this.onChangeCallback(this); - } - }, - - /** - * The w component of this Quaternion. - * - * @name Phaser.Math.Quaternion#w - * @type {number} - * @default 0 - * @since 3.0.0 - */ - w: { - get: function () - { - return this._w; - }, - - set: function (value) - { - this._w = value; - - this.onChangeCallback(this); - } - }, - - /** - * Copy the components of a given Quaternion or Vector into this Quaternion. - * - * @method Phaser.Math.Quaternion#copy - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - copy: function (src) - { - return this.set(src); - }, - - /** - * Set the components of this Quaternion and optionally call the `onChangeCallback`. - * - * @method Phaser.Math.Quaternion#set - * @since 3.0.0 - * - * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components. - * @param {number} [y=0] - The y component. - * @param {number} [z=0] - The z component. - * @param {number} [w=0] - The w component. - * @param {boolean} [update=true] - Call the `onChangeCallback`? - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - set: function (x, y, z, w, update) - { - if (update === undefined) { update = true; } - - if (typeof x === 'object') - { - this._x = x.x || 0; - this._y = x.y || 0; - this._z = x.z || 0; - this._w = x.w || 0; - } - else - { - this._x = x || 0; - this._y = y || 0; - this._z = z || 0; - this._w = w || 0; - } - - if (update) - { - this.onChangeCallback(this); - } - - return this; - }, - - /** - * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise. - * - * @method Phaser.Math.Quaternion#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - add: function (v) - { - this._x += v.x; - this._y += v.y; - this._z += v.z; - this._w += v.w; - - this.onChangeCallback(this); - - return this; - }, - - /** - * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise. - * - * @method Phaser.Math.Quaternion#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - subtract: function (v) - { - this._x -= v.x; - this._y -= v.y; - this._z -= v.z; - this._w -= v.w; - - this.onChangeCallback(this); - - return this; - }, - - /** - * Scale this Quaternion by the given value. - * - * @method Phaser.Math.Quaternion#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Quaternion by. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - scale: function (scale) - { - this._x *= scale; - this._y *= scale; - this._z *= scale; - this._w *= scale; - - this.onChangeCallback(this); - - return this; - }, - - /** - * Calculate the length of this Quaternion. - * - * @method Phaser.Math.Quaternion#length - * @since 3.0.0 - * - * @return {number} The length of this Quaternion. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return Math.sqrt(x * x + y * y + z * z + w * w); - }, - - /** - * Calculate the length of this Quaternion squared. - * - * @method Phaser.Math.Quaternion#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Quaternion, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return x * x + y * y + z * z + w * w; - }, - - /** - * Normalize this Quaternion. - * - * @method Phaser.Math.Quaternion#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - var len = x * x + y * y + z * z + w * w; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this._x = x * len; - this._y = y * len; - this._z = z * len; - this._w = w * len; - } - - this.onChangeCallback(this); - - return this; - }, - - /** - * Calculate the dot product of this Quaternion and the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#dot - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion. - * - * @return {number} The dot product of this Quaternion and the given Quaternion or Vector. - */ - dot: function (v) - { - return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; - }, - - /** - * Linearly interpolate this Quaternion towards the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#lerp - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards. - * @param {number} [t=0] - The percentage of interpolation. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - lerp: function (v, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - return this.set( - ax + t * (v.x - ax), - ay + t * (v.y - ay), - az + t * (v.z - az), - aw + t * (v.w - aw) - ); - }, - - /** - * Rotates this Quaternion based on the two given vectors. - * - * @method Phaser.Math.Quaternion#rotationTo - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} a - The transform rotation vector. - * @param {Phaser.Math.Vector3} b - The target rotation vector. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotationTo: function (a, b) - { - var dot = a.x * b.x + a.y * b.y + a.z * b.z; - - if (dot < -0.999999) - { - if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON) - { - tmpvec.copy(yUnitVec3).cross(a); - } - - tmpvec.normalize(); - - return this.setAxisAngle(tmpvec, Math.PI); - - } - else if (dot > 0.999999) - { - return this.set(0, 0, 0, 1); - } - else - { - tmpvec.copy(a).cross(b); - - this._x = tmpvec.x; - this._y = tmpvec.y; - this._z = tmpvec.z; - this._w = 1 + dot; - - return this.normalize(); - } - }, - - /** - * Set the axes of this Quaternion. - * - * @method Phaser.Math.Quaternion#setAxes - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} view - The view axis. - * @param {Phaser.Math.Vector3} right - The right axis. - * @param {Phaser.Math.Vector3} up - The upwards axis. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setAxes: function (view, right, up) - { - var m = tmpMat3.val; - - m[0] = right.x; - m[3] = right.y; - m[6] = right.z; - - m[1] = up.x; - m[4] = up.y; - m[7] = up.z; - - m[2] = -view.x; - m[5] = -view.y; - m[8] = -view.z; - - return this.fromMat3(tmpMat3).normalize(); - }, - - /** - * Reset this Matrix to an identity (default) Quaternion. - * - * @method Phaser.Math.Quaternion#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - identity: function () - { - return this.set(0, 0, 0, 1); - }, - - /** - * Set the axis angle of this Quaternion. - * - * @method Phaser.Math.Quaternion#setAxisAngle - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} axis - The axis. - * @param {number} rad - The angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setAxisAngle: function (axis, rad) - { - rad = rad * 0.5; - - var s = Math.sin(rad); - - return this.set( - s * axis.x, - s * axis.y, - s * axis.z, - Math.cos(rad) - ); - }, - - /** - * Multiply this Quaternion by the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - multiply: function (b) - { - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bx = b.x; - var by = b.y; - var bz = b.z; - var bw = b.w; - - return this.set( - ax * bw + aw * bx + ay * bz - az * by, - ay * bw + aw * by + az * bx - ax * bz, - az * bw + aw * bz + ax * by - ay * bx, - aw * bw - ax * bx - ay * by - az * bz - ); - }, - - /** - * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#slerp - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards. - * @param {number} t - The percentage of interpolation. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - slerp: function (b, t) - { - // benchmarks: http://jsperf.com/quaternion-slerp-implementations - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bx = b.x; - var by = b.y; - var bz = b.z; - var bw = b.w; - - // calc cosine - var cosom = ax * bx + ay * by + az * bz + aw * bw; - - // adjust signs (if necessary) - if (cosom < 0) - { - cosom = -cosom; - bx = - bx; - by = - by; - bz = - bz; - bw = - bw; - } - - // "from" and "to" quaternions are very close - // ... so we can do a linear interpolation - var scale0 = 1 - t; - var scale1 = t; - - // calculate coefficients - if ((1 - cosom) > EPSILON) - { - // standard case (slerp) - var omega = Math.acos(cosom); - var sinom = Math.sin(omega); - - scale0 = Math.sin((1.0 - t) * omega) / sinom; - scale1 = Math.sin(t * omega) / sinom; - } - - // calculate final values - return this.set( - scale0 * ax + scale1 * bx, - scale0 * ay + scale1 * by, - scale0 * az + scale1 * bz, - scale0 * aw + scale1 * bw - ); - }, - - /** - * Invert this Quaternion. - * - * @method Phaser.Math.Quaternion#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - invert: function () - { - var a0 = this.x; - var a1 = this.y; - var a2 = this.z; - var a3 = this.w; - - var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; - var invDot = (dot) ? 1 / dot : 0; - - return this.set( - -a0 * invDot, - -a1 * invDot, - -a2 * invDot, - a3 * invDot - ); - }, - - /** - * Convert this Quaternion into its conjugate. - * - * Sets the x, y and z components. - * - * @method Phaser.Math.Quaternion#conjugate - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - conjugate: function () - { - this._x = -this.x; - this._y = -this.y; - this._z = -this.z; - - this.onChangeCallback(this); - - return this; - }, - - /** - * Rotate this Quaternion on the X axis. - * - * @method Phaser.Math.Quaternion#rotateX - * @since 3.0.0 - * - * @param {number} rad - The rotation angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotateX: function (rad) - { - rad *= 0.5; - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bx = Math.sin(rad); - var bw = Math.cos(rad); - - return this.set( - ax * bw + aw * bx, - ay * bw + az * bx, - az * bw - ay * bx, - aw * bw - ax * bx - ); - }, - - /** - * Rotate this Quaternion on the Y axis. - * - * @method Phaser.Math.Quaternion#rotateY - * @since 3.0.0 - * - * @param {number} rad - The rotation angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotateY: function (rad) - { - rad *= 0.5; - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var by = Math.sin(rad); - var bw = Math.cos(rad); - - return this.set( - ax * bw - az * by, - ay * bw + aw * by, - az * bw + ax * by, - aw * bw - ay * by - ); - }, - - /** - * Rotate this Quaternion on the Z axis. - * - * @method Phaser.Math.Quaternion#rotateZ - * @since 3.0.0 - * - * @param {number} rad - The rotation angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotateZ: function (rad) - { - rad *= 0.5; - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bz = Math.sin(rad); - var bw = Math.cos(rad); - - return this.set( - ax * bw + ay * bz, - ay * bw - ax * bz, - az * bw + aw * bz, - aw * bw - az * bz - ); - }, - - /** - * Create a unit (or rotation) Quaternion from its x, y, and z components. - * - * Sets the w component. - * - * @method Phaser.Math.Quaternion#calculateW - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - calculateW: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - this.w = -Math.sqrt(1.0 - x * x - y * y - z * z); - - return this; - }, - - /** - * Set this Quaternion from the given Euler, based on Euler order. - * - * @method Phaser.Math.Quaternion#setFromEuler - * @since 3.50.0 - * - * @param {Phaser.Math.Euler} euler - The Euler to convert from. - * @param {boolean} [update=true] - Run the `onChangeCallback`? - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setFromEuler: function (euler, update) - { - var x = euler.x / 2; - var y = euler.y / 2; - var z = euler.z / 2; - - var c1 = Math.cos(x); - var c2 = Math.cos(y); - var c3 = Math.cos(z); - - var s1 = Math.sin(x); - var s2 = Math.sin(y); - var s3 = Math.sin(z); - - switch (euler.order) - { - case 'XYZ': - { - this.set( - s1 * c2 * c3 + c1 * s2 * s3, - c1 * s2 * c3 - s1 * c2 * s3, - c1 * c2 * s3 + s1 * s2 * c3, - c1 * c2 * c3 - s1 * s2 * s3, - update - ); - - break; - } - - case 'YXZ': - { - this.set( - s1 * c2 * c3 + c1 * s2 * s3, - c1 * s2 * c3 - s1 * c2 * s3, - c1 * c2 * s3 - s1 * s2 * c3, - c1 * c2 * c3 + s1 * s2 * s3, - update - ); - - break; - } - - case 'ZXY': - { - this.set( - s1 * c2 * c3 - c1 * s2 * s3, - c1 * s2 * c3 + s1 * c2 * s3, - c1 * c2 * s3 + s1 * s2 * c3, - c1 * c2 * c3 - s1 * s2 * s3, - update - ); - - break; - } - - case 'ZYX': - { - this.set( - s1 * c2 * c3 - c1 * s2 * s3, - c1 * s2 * c3 + s1 * c2 * s3, - c1 * c2 * s3 - s1 * s2 * c3, - c1 * c2 * c3 + s1 * s2 * s3, - update - ); - - break; - } - - case 'YZX': - { - this.set( - s1 * c2 * c3 + c1 * s2 * s3, - c1 * s2 * c3 + s1 * c2 * s3, - c1 * c2 * s3 - s1 * s2 * c3, - c1 * c2 * c3 - s1 * s2 * s3, - update - ); - - break; - } - - case 'XZY': - { - this.set( - s1 * c2 * c3 - c1 * s2 * s3, - c1 * s2 * c3 - s1 * c2 * s3, - c1 * c2 * s3 + s1 * s2 * c3, - c1 * c2 * c3 + s1 * s2 * s3, - update - ); - - break; - } - } - - return this; - }, - - /** - * Sets the rotation of this Quaternion from the given Matrix4. - * - * @method Phaser.Math.Quaternion#setFromRotationMatrix - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to set the rotation from. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setFromRotationMatrix: function (mat4) - { - var m = mat4.val; - - var m11 = m[0]; - var m12 = m[4]; - var m13 = m[8]; - var m21 = m[1]; - var m22 = m[5]; - var m23 = m[9]; - var m31 = m[2]; - var m32 = m[6]; - var m33 = m[10]; - - var trace = m11 + m22 + m33; - var s; - - if (trace > 0) - { - s = 0.5 / Math.sqrt(trace + 1.0); - - this.set( - (m32 - m23) * s, - (m13 - m31) * s, - (m21 - m12) * s, - 0.25 / s - ); - } - else if (m11 > m22 && m11 > m33) - { - s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); - - this.set( - 0.25 * s, - (m12 + m21) / s, - (m13 + m31) / s, - (m32 - m23) / s - ); - } - else if (m22 > m33) - { - s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); - - this.set( - (m12 + m21) / s, - 0.25 * s, - (m23 + m32) / s, - (m13 - m31) / s - ); - } - else - { - s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); - - this.set( - (m13 + m31) / s, - (m23 + m32) / s, - 0.25 * s, - (m21 - m12) / s - ); - } - - return this; - }, - - /** - * Convert the given Matrix into this Quaternion. - * - * @method Phaser.Math.Quaternion#fromMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - fromMat3: function (mat) - { - // benchmarks: - // http://jsperf.com/typed-array-access-speed - // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion - - // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes - // article "Quaternion Calculus and Fast Animation". - var m = mat.val; - var fTrace = m[0] + m[4] + m[8]; - var fRoot; - - if (fTrace > 0) - { - // |w| > 1/2, may as well choose w > 1/2 - fRoot = Math.sqrt(fTrace + 1.0); // 2w - - this.w = 0.5 * fRoot; - - fRoot = 0.5 / fRoot; // 1/(4w) - - this._x = (m[7] - m[5]) * fRoot; - this._y = (m[2] - m[6]) * fRoot; - this._z = (m[3] - m[1]) * fRoot; - } - else - { - // |w| <= 1/2 - var i = 0; - - if (m[4] > m[0]) - { - i = 1; - } - - if (m[8] > m[i * 3 + i]) - { - i = 2; - } - - var j = siNext[i]; - var k = siNext[j]; - - // This isn't quite as clean without array access - fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); - tmp[i] = 0.5 * fRoot; - - fRoot = 0.5 / fRoot; - - tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; - tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; - - this._x = tmp[0]; - this._y = tmp[1]; - this._z = tmp[2]; - this._w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; - } - - this.onChangeCallback(this); - - return this; - } - -}); - -module.exports = Quaternion; - - -/***/ }), -/* 47 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Loader.Events - */ - -module.exports = { - - ADD: __webpack_require__(213), - COMPLETE: __webpack_require__(214), - FILE_COMPLETE: __webpack_require__(215), - FILE_KEY_COMPLETE: __webpack_require__(216), - FILE_LOAD_ERROR: __webpack_require__(217), - FILE_LOAD: __webpack_require__(218), - FILE_PROGRESS: __webpack_require__(219), - POST_PROCESS: __webpack_require__(220), - PROGRESS: __webpack_require__(221), - START: __webpack_require__(222) - -}; - - -/***/ }), -/* 48 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Given a File and a baseURL value this returns the URL the File will use to download from. - * - * @function Phaser.Loader.GetURL - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - The File object. - * @param {string} baseURL - A default base URL. - * - * @return {string} The URL the File will use. - */ -var GetURL = function (file, baseURL) -{ - if (!file.url) - { - return false; - } - - if (file.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)) - { - return file.url; - } - else - { - return baseURL + file.url; - } -}; - -module.exports = GetURL; - - -/***/ }), -/* 49 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Extend = __webpack_require__(19); -var XHRSettings = __webpack_require__(50); - -/** - * Takes two XHRSettings Objects and creates a new XHRSettings object from them. - * - * The new object is seeded by the values given in the global settings, but any setting in - * the local object overrides the global ones. - * - * @function Phaser.Loader.MergeXHRSettings - * @since 3.0.0 - * - * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object. - * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object. - * - * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object. - */ -var MergeXHRSettings = function (global, local) -{ - var output = (global === undefined) ? XHRSettings() : Extend({}, global); - - if (local) - { - for (var setting in local) - { - if (local[setting] !== undefined) - { - output[setting] = local[setting]; - } - } - } - - return output; -}; - -module.exports = MergeXHRSettings; - - -/***/ }), -/* 50 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Creates an XHRSettings Object with default values. - * - * @function Phaser.Loader.XHRSettings - * @since 3.0.0 - * - * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'. - * @param {boolean} [async=true] - Should the XHR request use async or not? - * @param {string} [user=''] - Optional username for the XHR request. - * @param {string} [password=''] - Optional password for the XHR request. - * @param {number} [timeout=0] - Optional XHR timeout value. - * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value. - * - * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. - */ -var XHRSettings = function (responseType, async, user, password, timeout, withCredentials) -{ - if (responseType === undefined) { responseType = ''; } - if (async === undefined) { async = true; } - if (user === undefined) { user = ''; } - if (password === undefined) { password = ''; } - if (timeout === undefined) { timeout = 0; } - if (withCredentials === undefined) { withCredentials = false; } - - // Before sending a request, set the xhr.responseType to "text", - // "arraybuffer", "blob", or "document", depending on your data needs. - // Note, setting xhr.responseType = '' (or omitting) will default the response to "text". - - return { - - // Ignored by the Loader, only used by File. - responseType: responseType, - - async: async, - - // credentials - user: user, - password: password, - - // timeout in ms (0 = no timeout) - timeout: timeout, - - // setRequestHeader - headers: undefined, - header: undefined, - headerValue: undefined, - requestedWith: false, - - // overrideMimeType - overrideMimeType: undefined, - - // withCredentials - withCredentials: withCredentials - - }; -}; - -module.exports = XHRSettings; - - -/***/ }), -/* 51 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for calculating and setting the size of a non-Frame based Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.ComputedSize - * @since 3.0.0 - */ - -var ComputedSize = { - - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - * - * @name Phaser.GameObjects.Components.ComputedSize#width - * @type {number} - * @since 3.0.0 - */ - width: 0, - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - * - * @name Phaser.GameObjects.Components.ComputedSize#height - * @type {number} - * @since 3.0.0 - */ - height: 0, - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.ComputedSize#displayWidth - * @type {number} - * @since 3.0.0 - */ - displayWidth: { - - get: function () - { - return this.scaleX * this.width; - }, - - set: function (value) - { - this.scaleX = value / this.width; - } - - }, - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.ComputedSize#displayHeight - * @type {number} - * @since 3.0.0 - */ - displayHeight: { - - get: function () - { - return this.scaleY * this.height; - }, - - set: function (value) - { - this.scaleY = value / this.height; - } - - }, - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * - * @method Phaser.GameObjects.Components.ComputedSize#setSize - * @since 3.4.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setSize: function (width, height) - { - this.width = width; - this.height = height; - - return this; - }, - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * - * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize - * @since 3.4.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setDisplaySize: function (width, height) - { - this.displayWidth = width; - this.displayHeight = height; - - return this; - } - -}; - -module.exports = ComputedSize; - - -/***/ }), -/* 52 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for setting the depth of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Depth - * @since 3.0.0 - */ - -var Depth = { - - /** - * Private internal value. Holds the depth of the Game Object. - * - * @name Phaser.GameObjects.Components.Depth#_depth - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - _depth: 0, - - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @name Phaser.GameObjects.Components.Depth#depth - * @type {number} - * @since 3.0.0 - */ - depth: { - - get: function () - { - return this._depth; - }, - - set: function (value) - { - if (this.displayList) - { - this.displayList.queueDepthSort(); - } - - this._depth = value; - } - - }, - - /** - * The depth of this Game Object within the Scene. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @method Phaser.GameObjects.Components.Depth#setDepth - * @since 3.0.0 - * - * @param {number} value - The depth of this Game Object. Ensure this value is only ever a number data-type. - * - * @return {this} This Game Object instance. - */ - setDepth: function (value) - { - if (value === undefined) { value = 0; } - - this.depth = value; - - return this; - } - -}; - -module.exports = Depth; - - -/***/ }), -/* 53 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for visually flipping a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Flip - * @since 3.0.0 - */ - -var Flip = { - - /** - * The horizontally flipped state of the Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @name Phaser.GameObjects.Components.Flip#flipX - * @type {boolean} - * @default false - * @since 3.0.0 - */ - flipX: false, - - /** - * The vertically flipped state of the Game Object. - * - * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @name Phaser.GameObjects.Components.Flip#flipY - * @type {boolean} - * @default false - * @since 3.0.0 - */ - flipY: false, - - /** - * Toggles the horizontal flipped state of this Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @method Phaser.GameObjects.Components.Flip#toggleFlipX - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - toggleFlipX: function () - { - this.flipX = !this.flipX; - - return this; - }, - - /** - * Toggles the vertical flipped state of this Game Object. - * - * @method Phaser.GameObjects.Components.Flip#toggleFlipY - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - toggleFlipY: function () - { - this.flipY = !this.flipY; - - return this; - }, - - /** - * Sets the horizontal flipped state of this Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @method Phaser.GameObjects.Components.Flip#setFlipX - * @since 3.0.0 - * - * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. - */ - setFlipX: function (value) - { - this.flipX = value; - - return this; - }, - - /** - * Sets the vertical flipped state of this Game Object. - * - * @method Phaser.GameObjects.Components.Flip#setFlipY - * @since 3.0.0 - * - * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. - */ - setFlipY: function (value) - { - this.flipY = value; - - return this; - }, - - /** - * Sets the horizontal and vertical flipped state of this Game Object. - * - * A Game Object that is flipped will render inversed on the flipped axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @method Phaser.GameObjects.Components.Flip#setFlip - * @since 3.0.0 - * - * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped. - * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. - */ - setFlip: function (x, y) - { - this.flipX = x; - this.flipY = y; - - return this; - }, - - /** - * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. - * - * @method Phaser.GameObjects.Components.Flip#resetFlip - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - resetFlip: function () - { - this.flipX = false; - this.flipY = false; - - return this; - } - -}; - -module.exports = Flip; - - -/***/ }), -/* 54 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for getting and setting the Scroll Factor of a Game Object. - * - * @namespace Phaser.GameObjects.Components.ScrollFactor - * @since 3.0.0 - */ - -var ScrollFactor = { - - /** - * The horizontal scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * - * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scrollFactorX: 1, - - /** - * The vertical scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * - * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scrollFactorY: 1, - - /** - * Sets the scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * - * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor - * @since 3.0.0 - * - * @param {number} x - The horizontal scroll factor of this Game Object. - * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. - * - * @return {this} This Game Object instance. - */ - setScrollFactor: function (x, y) - { - if (y === undefined) { y = x; } - - this.scrollFactorX = x; - this.scrollFactorY = y; - - return this; - } - -}; - -module.exports = ScrollFactor; - - -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MATH_CONST = __webpack_require__(4); -var TransformMatrix = __webpack_require__(26); -var TransformXY = __webpack_require__(44); -var WrapAngle = __webpack_require__(33); -var WrapAngleDegrees = __webpack_require__(34); -var Vector2 = __webpack_require__(3); - -// global bitmask flag for GameObject.renderMask (used by Scale) -var _FLAG = 4; // 0100 - -/** - * Provides methods used for getting and setting the position, scale and rotation of a Game Object. - * - * @namespace Phaser.GameObjects.Components.Transform - * @since 3.0.0 - */ - -var Transform = { - - /** - * A property indicating that a Game Object has this component. - * - * @name Phaser.GameObjects.Components.Transform#hasTransformComponent - * @type {boolean} - * @readonly - * @default true - * @since 3.60.0 - */ - hasTransformComponent: true, - - /** - * Private internal value. Holds the horizontal scale value. - * - * @name Phaser.GameObjects.Components.Transform#_scaleX - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _scaleX: 1, - - /** - * Private internal value. Holds the vertical scale value. - * - * @name Phaser.GameObjects.Components.Transform#_scaleY - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _scaleY: 1, - - /** - * Private internal value. Holds the rotation value in radians. - * - * @name Phaser.GameObjects.Components.Transform#_rotation - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - _rotation: 0, - - /** - * The x position of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - x: 0, - - /** - * The y position of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - y: 0, - - /** - * The z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#depth} instead. - * - * @name Phaser.GameObjects.Components.Transform#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - z: 0, - - /** - * The w position of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#w - * @type {number} - * @default 0 - * @since 3.0.0 - */ - w: 0, - - /** - * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object - * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * - * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this - * isn't the case, use the `scaleX` or `scaleY` properties instead. - * - * @name Phaser.GameObjects.Components.Transform#scale - * @type {number} - * @default 1 - * @since 3.18.0 - */ - scale: { - - get: function () - { - return (this._scaleX + this._scaleY) / 2; - }, - - set: function (value) - { - this._scaleX = value; - this._scaleY = value; - - if (value === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The horizontal scale of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#scaleX - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scaleX: { - - get: function () - { - return this._scaleX; - }, - - set: function (value) - { - this._scaleX = value; - - if (value === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The vertical scale of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#scaleY - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scaleY: { - - get: function () - { - return this._scaleY; - }, - - set: function (value) - { - this._scaleY = value; - - if (value === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The angle of this Game Object as expressed in degrees. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left - * and -90 is up. - * - * If you prefer to work in radians, see the `rotation` property instead. - * - * @name Phaser.GameObjects.Components.Transform#angle - * @type {number} - * @default 0 - * @since 3.0.0 - */ - angle: { - - get: function () - { - return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG); - }, - - set: function (value) - { - // value is in degrees - this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD; - } - }, - - /** - * The angle of this Game Object in radians. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left - * and -PI/2 is up. - * - * If you prefer to work in degrees, see the `angle` property instead. - * - * @name Phaser.GameObjects.Components.Transform#rotation - * @type {number} - * @default 1 - * @since 3.0.0 - */ - rotation: { - - get: function () - { - return this._rotation; - }, - - set: function (value) - { - // value is in radians - this._rotation = WrapAngle(value); - } - }, - - /** - * Sets the position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setPosition - * @since 3.0.0 - * - * @param {number} [x=0] - The x position of this Game Object. - * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value. - * @param {number} [z=0] - The z position of this Game Object. - * @param {number} [w=0] - The w position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setPosition: function (x, y, z, w) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = x; } - if (z === undefined) { z = 0; } - if (w === undefined) { w = 0; } - - this.x = x; - this.y = y; - this.z = z; - this.w = w; - - return this; - }, - - /** - * Copies an object's coordinates to this Game Object's position. - * - * @method Phaser.GameObjects.Components.Transform#copyPosition - * @since 3.50.0 - * - * @param {(Phaser.Types.Math.Vector2Like|Phaser.Types.Math.Vector3Like|Phaser.Types.Math.Vector4Like)} source - An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. - * - * @return {this} This Game Object instance. - */ - copyPosition: function (source) - { - if (source.x !== undefined) { this.x = source.x; } - if (source.y !== undefined) { this.y = source.y; } - if (source.z !== undefined) { this.z = source.z; } - if (source.w !== undefined) { this.w = source.w; } - - return this; - }, - - /** - * Sets the position of this Game Object to be a random position within the confines of - * the given area. - * - * If no area is specified a random position between 0 x 0 and the game width x height is used instead. - * - * The position does not factor in the size of this Game Object, meaning that only the origin is - * guaranteed to be within the area. - * - * @method Phaser.GameObjects.Components.Transform#setRandomPosition - * @since 3.8.0 - * - * @param {number} [x=0] - The x position of the top-left of the random area. - * @param {number} [y=0] - The y position of the top-left of the random area. - * @param {number} [width] - The width of the random area. - * @param {number} [height] - The height of the random area. - * - * @return {this} This Game Object instance. - */ - setRandomPosition: function (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = this.scene.sys.scale.width; } - if (height === undefined) { height = this.scene.sys.scale.height; } - - this.x = x + (Math.random() * width); - this.y = y + (Math.random() * height); - - return this; - }, - - /** - * Sets the rotation of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setRotation - * @since 3.0.0 - * - * @param {number} [radians=0] - The rotation of this Game Object, in radians. - * - * @return {this} This Game Object instance. - */ - setRotation: function (radians) - { - if (radians === undefined) { radians = 0; } - - this.rotation = radians; - - return this; - }, - - /** - * Sets the angle of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setAngle - * @since 3.0.0 - * - * @param {number} [degrees=0] - The rotation of this Game Object, in degrees. - * - * @return {this} This Game Object instance. - */ - setAngle: function (degrees) - { - if (degrees === undefined) { degrees = 0; } - - this.angle = degrees; - - return this; - }, - - /** - * Sets the scale of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setScale - * @since 3.0.0 - * - * @param {number} x - The horizontal scale of this Game Object. - * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value. - * - * @return {this} This Game Object instance. - */ - setScale: function (x, y) - { - if (x === undefined) { x = 1; } - if (y === undefined) { y = x; } - - this.scaleX = x; - this.scaleY = y; - - return this; - }, - - /** - * Sets the x position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setX - * @since 3.0.0 - * - * @param {number} [value=0] - The x position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setX: function (value) - { - if (value === undefined) { value = 0; } - - this.x = value; - - return this; - }, - - /** - * Sets the y position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setY - * @since 3.0.0 - * - * @param {number} [value=0] - The y position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setY: function (value) - { - if (value === undefined) { value = 0; } - - this.y = value; - - return this; - }, - - /** - * Sets the z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. - * - * @method Phaser.GameObjects.Components.Transform#setZ - * @since 3.0.0 - * - * @param {number} [value=0] - The z position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setZ: function (value) - { - if (value === undefined) { value = 0; } - - this.z = value; - - return this; - }, - - /** - * Sets the w position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setW - * @since 3.0.0 - * - * @param {number} [value=0] - The w position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setW: function (value) - { - if (value === undefined) { value = 0; } - - this.w = value; - - return this; - }, - - /** - * Gets the local transform matrix for this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix - * @since 3.4.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. - * - * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. - */ - getLocalTransformMatrix: function (tempMatrix) - { - if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } - - return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); - }, - - /** - * Gets the world transform matrix for this Game Object, factoring in any parent Containers. - * - * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix - * @since 3.4.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations. - * - * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. - */ - getWorldTransformMatrix: function (tempMatrix, parentMatrix) - { - if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } - if (parentMatrix === undefined) { parentMatrix = new TransformMatrix(); } - - var parent = this.parentContainer; - - if (!parent) - { - return this.getLocalTransformMatrix(tempMatrix); - } - - tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); - - while (parent) - { - parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY); - - parentMatrix.multiply(tempMatrix, tempMatrix); - - parent = parent.parentContainer; - } - - return tempMatrix; - }, - - /** - * Takes the given `x` and `y` coordinates and converts them into local space for this - * Game Object, taking into account parent and local transforms, and the Display Origin. - * - * The returned Vector2 contains the translated point in its properties. - * - * A Camera needs to be provided in order to handle modified scroll factors. If no - * camera is specified, it will use the `main` camera from the Scene to which this - * Game Object belongs. - * - * @method Phaser.GameObjects.Components.Transform#getLocalPoint - * @since 3.50.0 - * - * @param {number} x - The x position to translate. - * @param {number} y - The y position to translate. - * @param {Phaser.Math.Vector2} [point] - A Vector2, or point-like object, to store the results in. - * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera which is being tested against. If not given will use the Scene default camera. - * - * @return {Phaser.Math.Vector2} The translated point. - */ - getLocalPoint: function (x, y, point, camera) - { - if (!point) { point = new Vector2(); } - if (!camera) { camera = this.scene.sys.cameras.main; } - - var csx = camera.scrollX; - var csy = camera.scrollY; - - var px = x + (csx * this.scrollFactorX) - csx; - var py = y + (csy * this.scrollFactorY) - csy; - - if (this.parentContainer) - { - this.getWorldTransformMatrix().applyInverse(px, py, point); - } - else - { - TransformXY(px, py, this.x, this.y, this.rotation, this.scaleX, this.scaleY, point); - } - - // Normalize origin - if (this._originComponent) - { - point.x += this._displayOriginX; - point.y += this._displayOriginY; - } - - return point; - }, - - /** - * Gets the sum total rotation of all of this Game Objects parent Containers. - * - * The returned value is in radians and will be zero if this Game Object has no parent container. - * - * @method Phaser.GameObjects.Components.Transform#getParentRotation - * @since 3.18.0 - * - * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object. - */ - getParentRotation: function () - { - var rotation = 0; - - var parent = this.parentContainer; - - while (parent) - { - rotation += parent.rotation; - - parent = parent.parentContainer; - } - - return rotation; - } - -}; - -module.exports = Transform; - - -/***/ }), -/* 56 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// bitmask flag for GameObject.renderMask -var _FLAG = 1; // 0001 - -/** - * Provides methods used for setting the visibility of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Visible - * @since 3.0.0 - */ - -var Visible = { - - /** - * Private internal value. Holds the visible value. - * - * @name Phaser.GameObjects.Components.Visible#_visible - * @type {boolean} - * @private - * @default true - * @since 3.0.0 - */ - _visible: true, - - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * - * @name Phaser.GameObjects.Components.Visible#visible - * @type {boolean} - * @since 3.0.0 - */ - visible: { - - get: function () - { - return this._visible; - }, - - set: function (value) - { - if (value) - { - this._visible = true; - this.renderFlags |= _FLAG; - } - else - { - this._visible = false; - this.renderFlags &= ~_FLAG; - } - } - - }, - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * - * @method Phaser.GameObjects.Components.Visible#setVisible - * @since 3.0.0 - * - * @param {boolean} value - The visible state of the Game Object. - * - * @return {this} This Game Object instance. - */ - setVisible: function (value) - { - this.visible = value; - - return this; - } -}; - -module.exports = Visible; - - -/***/ }), -/* 57 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var ComponentsToJSON = __webpack_require__(58); -var DataManager = __webpack_require__(228); -var EventEmitter = __webpack_require__(235); -var Events = __webpack_require__(59); -var SceneEvents = __webpack_require__(23); - -/** - * @classdesc - * The base class that all Game Objects extend. - * You don't create GameObjects directly and they cannot be added to the display list. - * Instead, use them as the base for your own custom classes. - * - * @class GameObject - * @memberof Phaser.GameObjects - * @extends Phaser.Events.EventEmitter - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. - * @param {string} type - A textual representation of the type of Game Object, i.e. `sprite`. - */ -var GameObject = new Class({ - - Extends: EventEmitter, - - initialize: - - function GameObject (scene, type) - { - EventEmitter.call(this); - - /** - * A reference to the Scene to which this Game Object belongs. - * - * Game Objects can only belong to one Scene. - * - * You should consider this property as being read-only. You cannot move a - * Game Object to another Scene by simply changing it. - * - * @name Phaser.GameObjects.GameObject#scene - * @type {Phaser.Scene} - * @since 3.0.0 - */ - this.scene = scene; - - /** - * Holds a reference to the Display List that contains this Game Object. - * - * This is set automatically when this Game Object is added to a Scene or Layer. - * - * You should treat this property as being read-only. - * - * @name Phaser.GameObjects.GameObject#displayList - * @type {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} - * @default null - * @since 3.50.0 - */ - this.displayList = null; - - /** - * A textual representation of this Game Object, i.e. `sprite`. - * Used internally by Phaser but is available for your own custom classes to populate. - * - * @name Phaser.GameObjects.GameObject#type - * @type {string} - * @since 3.0.0 - */ - this.type = type; - - /** - * The current state of this Game Object. - * - * Phaser itself will never modify this value, although plugins may do so. - * - * Use this property to track the state of a Game Object during its lifetime. For example, it could change from - * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant - * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. - * If you need to store complex data about your Game Object, look at using the Data Component instead. - * - * @name Phaser.GameObjects.GameObject#state - * @type {(number|string)} - * @since 3.16.0 - */ - this.state = 0; - - /** - * The parent Container of this Game Object, if it has one. - * - * @name Phaser.GameObjects.GameObject#parentContainer - * @type {Phaser.GameObjects.Container} - * @since 3.4.0 - */ - this.parentContainer = null; - - /** - * The name of this Game Object. - * Empty by default and never populated by Phaser, this is left for developers to use. - * - * @name Phaser.GameObjects.GameObject#name - * @type {string} - * @default '' - * @since 3.0.0 - */ - this.name = ''; - - /** - * The active state of this Game Object. - * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. - * An active object is one which is having its logic and internal systems updated. - * - * @name Phaser.GameObjects.GameObject#active - * @type {boolean} - * @default true - * @since 3.0.0 - */ - this.active = true; - - /** - * The Tab Index of the Game Object. - * Reserved for future use by plugins and the Input Manager. - * - * @name Phaser.GameObjects.GameObject#tabIndex - * @type {number} - * @default -1 - * @since 3.0.0 - */ - this.tabIndex = -1; - - /** - * A Data Manager. - * It allows you to store, query and get key/value paired information specific to this Game Object. - * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. - * - * @name Phaser.GameObjects.GameObject#data - * @type {Phaser.Data.DataManager} - * @default null - * @since 3.0.0 - */ - this.data = null; - - /** - * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. - * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. - * If those components are not used by your custom class then you can use this bitmask as you wish. - * - * @name Phaser.GameObjects.GameObject#renderFlags - * @type {number} - * @default 15 - * @since 3.0.0 - */ - this.renderFlags = 15; - - /** - * A bitmask that controls if this Game Object is drawn by a Camera or not. - * Not usually set directly, instead call `Camera.ignore`, however you can - * set this property directly using the Camera.id property: - * - * @example - * this.cameraFilter |= camera.id - * - * @name Phaser.GameObjects.GameObject#cameraFilter - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.cameraFilter = 0; - - /** - * If this Game Object is enabled for input then this property will contain an InteractiveObject instance. - * Not usually set directly. Instead call `GameObject.setInteractive()`. - * - * @name Phaser.GameObjects.GameObject#input - * @type {?Phaser.Types.Input.InteractiveObject} - * @default null - * @since 3.0.0 - */ - this.input = null; - - /** - * If this Game Object is enabled for Arcade or Matter Physics then this property will contain a reference to a Physics Body. - * - * @name Phaser.GameObjects.GameObject#body - * @type {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|MatterJS.BodyType)} - * @default null - * @since 3.0.0 - */ - this.body = null; - - /** - * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`. - * This includes calls that may come from a Group, Container or the Scene itself. - * While it allows you to persist a Game Object across Scenes, please understand you are entirely - * responsible for managing references to and from this Game Object. - * - * @name Phaser.GameObjects.GameObject#ignoreDestroy - * @type {boolean} - * @default false - * @since 3.5.0 - */ - this.ignoreDestroy = false; - - this.on(Events.ADDED_TO_SCENE, this.addedToScene, this); - this.on(Events.REMOVED_FROM_SCENE, this.removedFromScene, this); - - // Tell the Scene to re-sort the children - scene.sys.queueDepthSort(); - }, - - /** - * Sets the `active` property of this Game Object and returns this Game Object for further chaining. - * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList. - * - * @method Phaser.GameObjects.GameObject#setActive - * @since 3.0.0 - * - * @param {boolean} value - True if this Game Object should be set as active, false if not. - * - * @return {this} This GameObject. - */ - setActive: function (value) - { - this.active = value; - - return this; - }, - - /** - * Sets the `name` property of this Game Object and returns this Game Object for further chaining. - * The `name` property is not populated by Phaser and is presented for your own use. - * - * @method Phaser.GameObjects.GameObject#setName - * @since 3.0.0 - * - * @param {string} value - The name to be given to this Game Object. - * - * @return {this} This GameObject. - */ - setName: function (value) - { - this.name = value; - - return this; - }, - - /** - * Sets the current state of this Game Object. - * - * Phaser itself will never modify the State of a Game Object, although plugins may do so. - * - * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. - * The state value should typically be an integer (ideally mapped to a constant - * in your game code), but could also be a string. It is recommended to keep it light and simple. - * If you need to store complex data about your Game Object, look at using the Data Component instead. - * - * @method Phaser.GameObjects.GameObject#setState - * @since 3.16.0 - * - * @param {(number|string)} value - The state of the Game Object. - * - * @return {this} This GameObject. - */ - setState: function (value) - { - this.state = value; - - return this; - }, - - /** - * Adds a Data Manager component to this Game Object. - * - * @method Phaser.GameObjects.GameObject#setDataEnabled - * @since 3.0.0 - * @see Phaser.Data.DataManager - * - * @return {this} This GameObject. - */ - setDataEnabled: function () - { - if (!this.data) - { - this.data = new DataManager(this); - } - - return this; - }, - - /** - * Allows you to store a key value pair within this Game Objects Data Manager. - * - * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled - * before setting the value. - * - * If the key doesn't already exist in the Data Manager then it is created. - * - * ```javascript - * sprite.setData('name', 'Red Gem Stone'); - * ``` - * - * You can also pass in an object of key value pairs as the first argument: - * - * ```javascript - * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); - * ``` - * - * To get a value back again you can call `getData`: - * - * ```javascript - * sprite.getData('gold'); - * ``` - * - * Or you can access the value directly via the `values` property, where it works like any other variable: - * - * ```javascript - * sprite.data.values.gold += 50; - * ``` - * - * When the value is first set, a `setdata` event is emitted from this Game Object. - * - * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. - * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. - * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. - * - * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. - * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. - * - * @method Phaser.GameObjects.GameObject#setData - * @since 3.0.0 - * - * @generic {any} T - * @genericUse {(string|T)} - [key] - * - * @param {(string|object)} key - The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. - * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored. - * - * @return {this} This GameObject. - */ - setData: function (key, value) - { - if (!this.data) - { - this.data = new DataManager(this); - } - - this.data.set(key, value); - - return this; - }, - - /** - * Increase a value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is increased from 0. - * - * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled - * before setting the value. - * - * If the key doesn't already exist in the Data Manager then it is created. - * - * When the value is first set, a `setdata` event is emitted from this Game Object. - * - * @method Phaser.GameObjects.GameObject#incData - * @since 3.23.0 - * - * @generic {any} T - * @genericUse {(string|T)} - [key] - * - * @param {(string|object)} key - The key to increase the value for. - * @param {*} [data] - The value to increase for the given key. - * - * @return {this} This GameObject. - */ - incData: function (key, value) - { - if (!this.data) - { - this.data = new DataManager(this); - } - - this.data.inc(key, value); - - return this; - }, - - /** - * Toggle a boolean value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is toggled from false. - * - * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled - * before setting the value. - * - * If the key doesn't already exist in the Data Manager then it is created. - * - * When the value is first set, a `setdata` event is emitted from this Game Object. - * - * @method Phaser.GameObjects.GameObject#toggleData - * @since 3.23.0 - * - * @generic {any} T - * @genericUse {(string|T)} - [key] - * - * @param {(string|object)} key - The key to toggle the value for. - * - * @return {this} This GameObject. - */ - toggleData: function (key) - { - if (!this.data) - { - this.data = new DataManager(this); - } - - this.data.toggle(key); - - return this; - }, - - /** - * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. - * - * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: - * - * ```javascript - * sprite.getData('gold'); - * ``` - * - * Or access the value directly: - * - * ```javascript - * sprite.data.values.gold; - * ``` - * - * You can also pass in an array of keys, in which case an array of values will be returned: - * - * ```javascript - * sprite.getData([ 'gold', 'armor', 'health' ]); - * ``` - * - * This approach is useful for destructuring arrays in ES6. - * - * @method Phaser.GameObjects.GameObject#getData - * @since 3.0.0 - * - * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys. - * - * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array. - */ - getData: function (key) - { - if (!this.data) - { - this.data = new DataManager(this); - } - - return this.data.get(key); - }, - - /** - * Pass this Game Object to the Input Manager to enable it for Input. - * - * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area - * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced - * input detection. - * - * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If - * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific - * shape for it to use. - * - * You can also provide an Input Configuration Object as the only argument to this method. - * - * @example - * sprite.setInteractive(); - * - * @example - * sprite.setInteractive(new Phaser.Geom.Circle(45, 46, 45), Phaser.Geom.Circle.Contains); - * - * @example - * graphics.setInteractive(new Phaser.Geom.Rectangle(0, 0, 128, 128), Phaser.Geom.Rectangle.Contains); - * - * @method Phaser.GameObjects.GameObject#setInteractive - * @since 3.0.0 - * - * @param {(Phaser.Types.Input.InputConfiguration|any)} [hitArea] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not given it will try to create a Rectangle based on the texture frame. - * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The callback that determines if the pointer is within the Hit Area shape or not. If you provide a shape you must also provide a callback. - * @param {boolean} [dropZone=false] - Should this Game Object be treated as a drop zone target? - * - * @return {this} This GameObject. - */ - setInteractive: function (hitArea, hitAreaCallback, dropZone) - { - this.scene.sys.input.enable(this, hitArea, hitAreaCallback, dropZone); - - return this; - }, - - /** - * If this Game Object has previously been enabled for input, this will disable it. - * - * An object that is disabled for input stops processing or being considered for - * input events, but can be turned back on again at any time by simply calling - * `setInteractive()` with no arguments provided. - * - * If want to completely remove interaction from this Game Object then use `removeInteractive` instead. - * - * @method Phaser.GameObjects.GameObject#disableInteractive - * @since 3.7.0 - * - * @return {this} This GameObject. - */ - disableInteractive: function () - { - this.scene.sys.input.disable(this); - - return this; - }, - - /** - * If this Game Object has previously been enabled for input, this will queue it - * for removal, causing it to no longer be interactive. The removal happens on - * the next game step, it is not immediate. - * - * The Interactive Object that was assigned to this Game Object will be destroyed, - * removed from the Input Manager and cleared from this Game Object. - * - * If you wish to re-enable this Game Object at a later date you will need to - * re-create its InteractiveObject by calling `setInteractive` again. - * - * If you wish to only temporarily stop an object from receiving input then use - * `disableInteractive` instead, as that toggles the interactive state, where-as - * this erases it completely. - * - * If you wish to resize a hit area, don't remove and then set it as being - * interactive. Instead, access the hitarea object directly and resize the shape - * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the - * shape is a Rectangle, which it is by default.) - * - * @method Phaser.GameObjects.GameObject#removeInteractive - * @since 3.7.0 - * - * @return {this} This GameObject. - */ - removeInteractive: function () - { - this.scene.sys.input.clear(this); - - this.input = undefined; - - return this; - }, - - /** - * This callback is invoked when this Game Object is added to a Scene. - * - * Can be overriden by custom Game Objects, but be aware of some Game Objects that - * will use this, such as Sprites, to add themselves into the Update List. - * - * You can also listen for the `ADDED_TO_SCENE` event from this Game Object. - * - * @method Phaser.GameObjects.GameObject#addedToScene - * @since 3.50.0 - */ - addedToScene: function () - { - }, - - /** - * This callback is invoked when this Game Object is removed from a Scene. - * - * Can be overriden by custom Game Objects, but be aware of some Game Objects that - * will use this, such as Sprites, to removed themselves from the Update List. - * - * You can also listen for the `REMOVED_FROM_SCENE` event from this Game Object. - * - * @method Phaser.GameObjects.GameObject#removedFromScene - * @since 3.50.0 - */ - removedFromScene: function () - { - }, - - /** - * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. - * - * @method Phaser.GameObjects.GameObject#update - * @since 3.0.0 - * - * @param {...*} [args] - args - */ - update: function () - { - }, - - /** - * Returns a JSON representation of the Game Object. - * - * @method Phaser.GameObjects.GameObject#toJSON - * @since 3.0.0 - * - * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. - */ - toJSON: function () - { - return ComponentsToJSON(this); - }, - - /** - * Compares the renderMask with the renderFlags to see if this Game Object will render or not. - * Also checks the Game Object against the given Cameras exclusion list. - * - * @method Phaser.GameObjects.GameObject#willRender - * @since 3.0.0 - * - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object. - * - * @return {boolean} True if the Game Object should be rendered, otherwise false. - */ - willRender: function (camera) - { - var listWillRender = (this.displayList && this.displayList.active) ? this.displayList.willRender(camera) : true; - - return !(!listWillRender || GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); - }, - - /** - * Returns an array containing the display list index of either this Game Object, or if it has one, - * its parent Container. It then iterates up through all of the parent containers until it hits the - * root of the display list (which is index 0 in the returned array). - * - * Used internally by the InputPlugin but also useful if you wish to find out the display depth of - * this Game Object and all of its ancestors. - * - * @method Phaser.GameObjects.GameObject#getIndexList - * @since 3.4.0 - * - * @return {number[]} An array of display list position indexes. - */ - getIndexList: function () - { - // eslint-disable-next-line consistent-this - var child = this; - var parent = this.parentContainer; - - var indexes = []; - - while (parent) - { - indexes.unshift(parent.getIndex(child)); - - child = parent; - - if (!parent.parentContainer) - { - break; - } - else - { - parent = parent.parentContainer; - } - } - - if (this.displayList) - { - indexes.unshift(this.displayList.getIndex(child)); - } - else - { - indexes.unshift(this.scene.sys.displayList.getIndex(child)); - } - - return indexes; - }, - - /** - * Adds this Game Object to the given Display List. - * - * If no Display List is specified, it will default to the Display List owned by the Scene to which - * this Game Object belongs. - * - * A Game Object can only exist on one Display List at any given time, but may move freely between them. - * - * If this Game Object is already on another Display List when this method is called, it will first - * be removed from it, before being added to the new list. - * - * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. - * - * If a Game Object isn't on any display list, it will not be rendered. If you just wish to temporarly - * disable it from rendering, consider using the `setVisible` method, instead. - * - * @method Phaser.GameObjects.GameObject#addToDisplayList - * @fires Phaser.Scenes.Events#ADDED_TO_SCENE - * @fires Phaser.GameObjects.Events#ADDED_TO_SCENE - * @since 3.53.0 - * - * @param {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} [displayList] - The Display List to add to. Defaults to the Scene Display List. - * - * @return {this} This Game Object. - */ - addToDisplayList: function (displayList) - { - if (displayList === undefined) { displayList = this.scene.sys.displayList; } - - if (this.displayList && this.displayList !== displayList) - { - this.removeFromDisplayList(); - } - - // Don't repeat if it's already on this list - if (!displayList.exists(this)) - { - this.displayList = displayList; - - displayList.add(this, true); - - displayList.queueDepthSort(); - - this.emit(Events.ADDED_TO_SCENE, this, this.scene); - - displayList.events.emit(SceneEvents.ADDED_TO_SCENE, this, this.scene); - } - - return this; - }, - - /** - * Adds this Game Object to the Update List belonging to the Scene. - * - * When a Game Object is added to the Update List it will have its `preUpdate` method called - * every game frame. This method is passed two parameters: `delta` and `time`. - * - * If you wish to run your own logic within `preUpdate` then you should always call - * `preUpdate.super(delta, time)` within it, or it may fail to process required operations, - * such as Sprite animations. - * - * @method Phaser.GameObjects.GameObject#addToUpdateList - * @since 3.53.0 - * - * @return {this} This Game Object. - */ - addToUpdateList: function () - { - if (this.scene && this.preUpdate) - { - this.scene.sys.updateList.add(this); - } - - return this; - }, - - /** - * Removes this Game Object from the Display List it is currently on. - * - * A Game Object can only exist on one Display List at any given time, but may move freely removed - * and added back at a later stage. - * - * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. - * - * If a Game Object isn't on any Display List, it will not be rendered. If you just wish to temporarly - * disable it from rendering, consider using the `setVisible` method, instead. - * - * @method Phaser.GameObjects.GameObject#removeFromDisplayList - * @fires Phaser.Scenes.Events#REMOVED_FROM_SCENE - * @fires Phaser.GameObjects.Events#REMOVED_FROM_SCENE - * @since 3.53.0 - * - * @return {this} This Game Object. - */ - removeFromDisplayList: function () - { - var displayList = this.displayList || this.scene.sys.displayList; - - if (displayList && displayList.exists(this)) - { - displayList.remove(this, true); - - displayList.queueDepthSort(); - - this.displayList = null; - - this.emit(Events.REMOVED_FROM_SCENE, this, this.scene); - - displayList.events.emit(SceneEvents.REMOVED_FROM_SCENE, this, this.scene); - } - - return this; - }, - - /** - * Removes this Game Object from the Scene's Update List. - * - * When a Game Object is on the Update List, it will have its `preUpdate` method called - * every game frame. Calling this method will remove it from the list, preventing this. - * - * Removing a Game Object from the Update List will stop most internal functions working. - * For example, removing a Sprite from the Update List will prevent it from being able to - * run animations. - * - * @method Phaser.GameObjects.GameObject#removeFromUpdateList - * @since 3.53.0 - * - * @return {this} This Game Object. - */ - removeFromUpdateList: function () - { - if (this.scene && this.preUpdate) - { - this.scene.sys.updateList.remove(this); - } - - return this; - }, - - /** - * Destroys this Game Object removing it from the Display List and Update List and - * severing all ties to parent resources. - * - * Also removes itself from the Input Manager and Physics Manager if previously enabled. - * - * Use this to remove a Game Object from your game if you don't ever plan to use it again. - * As long as no reference to it exists within your own code it should become free for - * garbage collection by the browser. - * - * If you just want to temporarily disable an object then look at using the - * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. - * - * @method Phaser.GameObjects.GameObject#destroy - * @fires Phaser.GameObjects.Events#DESTROY - * @since 3.0.0 - * - * @param {boolean} [fromScene=false] - `True` if this Game Object is being destroyed by the Scene, `false` if not. - */ - destroy: function (fromScene) - { - // This Game Object has already been destroyed - if (!this.scene || this.ignoreDestroy) - { - return; - } - - if (fromScene === undefined) { fromScene = false; } - - if (this.preDestroy) - { - this.preDestroy.call(this); - } - - this.emit(Events.DESTROY, this, fromScene); - - this.removeAllListeners(); - - if (this.postPipelines) - { - this.resetPostPipeline(true); - } - - this.removeFromDisplayList(); - this.removeFromUpdateList(); - - if (this.input) - { - this.scene.sys.input.clear(this); - - this.input = undefined; - } - - if (this.data) - { - this.data.destroy(); - - this.data = undefined; - } - - if (this.body) - { - this.body.destroy(); - - this.body = undefined; - } - - this.active = false; - this.visible = false; - - this.scene = undefined; - this.parentContainer = undefined; - } - -}); - -/** - * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. - * - * @constant {number} RENDER_MASK - * @memberof Phaser.GameObjects.GameObject - * @default - */ -GameObject.RENDER_MASK = 15; - -module.exports = GameObject; - - -/***/ }), -/* 58 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Build a JSON representation of the given Game Object. - * - * This is typically extended further by Game Object specific implementations. - * - * @method Phaser.GameObjects.Components.ToJSON - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON. - * - * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. - */ -var ToJSON = function (gameObject) -{ - var out = { - name: gameObject.name, - type: gameObject.type, - x: gameObject.x, - y: gameObject.y, - depth: gameObject.depth, - scale: { - x: gameObject.scaleX, - y: gameObject.scaleY - }, - origin: { - x: gameObject.originX, - y: gameObject.originY - }, - flipX: gameObject.flipX, - flipY: gameObject.flipY, - rotation: gameObject.rotation, - alpha: gameObject.alpha, - visible: gameObject.visible, - blendMode: gameObject.blendMode, - textureKey: '', - frameKey: '', - data: {} - }; - - if (gameObject.texture) - { - out.textureKey = gameObject.texture.key; - out.frameKey = gameObject.frame.name; - } - - return out; -}; - -module.exports = ToJSON; - - -/***/ }), -/* 59 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.GameObjects.Events - */ - -module.exports = { - - ADDED_TO_SCENE: __webpack_require__(236), - DESTROY: __webpack_require__(237), - REMOVED_FROM_SCENE: __webpack_require__(238), - VIDEO_COMPLETE: __webpack_require__(239), - VIDEO_CREATED: __webpack_require__(240), - VIDEO_ERROR: __webpack_require__(241), - VIDEO_LOOP: __webpack_require__(242), - VIDEO_PLAY: __webpack_require__(243), - VIDEO_SEEKED: __webpack_require__(244), - VIDEO_SEEKING: __webpack_require__(245), - VIDEO_STOP: __webpack_require__(246), - VIDEO_TIMEOUT: __webpack_require__(247), - VIDEO_UNLOCKED: __webpack_require__(248) - -}; - - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var TransformMatrix = __webpack_require__(26); - -var tempMatrix1 = new TransformMatrix(); -var tempMatrix2 = new TransformMatrix(); -var tempMatrix3 = new TransformMatrix(); - -var result = { camera: tempMatrix1, sprite: tempMatrix2, calc: tempMatrix3 }; - -/** - * Calculates the Transform Matrix of the given Game Object and Camera, factoring in - * the parent matrix if provided. - * - * Note that the object this results contains _references_ to the Transform Matrices, - * not new instances of them. Therefore, you should use their values immediately, or - * copy them to your own matrix, as they will be replaced as soon as another Game - * Object is rendered. - * - * @function Phaser.GameObjects.GetCalcMatrix - * @memberof Phaser.GameObjects - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} src - The Game Object to calculate the transform matrix for. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera being used to render the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - The transform matrix of the parent container, if any. - * - * @return {Phaser.Types.GameObjects.GetCalcMatrixResults} The results object containing the updated transform matrices. - */ -var GetCalcMatrix = function (src, camera, parentMatrix) -{ - var camMatrix = tempMatrix1; - var spriteMatrix = tempMatrix2; - var calcMatrix = tempMatrix3; - - spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - } - else - { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - - return result; -}; - -module.exports = GetCalcMatrix; - - -/***/ }), -/* 61 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Transposes the elements of the given matrix (array of arrays). - * - * The transpose of a matrix is a new matrix whose rows are the columns of the original. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.TransposeMatrix - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [array,$return] - * - * @param {T[][]} [array] - The array matrix to transpose. - * - * @return {T[][]} A new array matrix which is a transposed version of the given array. - */ -var TransposeMatrix = function (array) -{ - var sourceRowCount = array.length; - var sourceColCount = array[0].length; - - var result = new Array(sourceColCount); - - for (var i = 0; i < sourceColCount; i++) - { - result[i] = new Array(sourceRowCount); - - for (var j = sourceRowCount - 1; j > -1; j--) - { - result[i][j] = array[j][i]; - } - } - - return result; -}; - -module.exports = TransposeMatrix; - - -/***/ }), -/* 62 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the start of the array to the end, shifting all items in the process. - * The "rotation" happens to the left. - * - * @function Phaser.Utils.Array.RotateLeft - * @since 3.0.0 - * - * @param {array} array - The array to shift to the left. This array is modified in place. - * @param {number} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateLeft = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.shift(); - array.push(element); - } - - return element; -}; - -module.exports = RotateLeft; - - -/***/ }), -/* 63 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the end of the array to the start, shifting all items in the process. - * The "rotation" happens to the right. - * - * @function Phaser.Utils.Array.RotateRight - * @since 3.0.0 - * - * @param {array} array - The array to shift to the right. This array is modified in place. - * @param {number} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateRight = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.pop(); - array.unshift(element); - } - - return element; -}; - -module.exports = RotateRight; - - -/***/ }), -/* 64 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Shuffles the contents of the given array using the Fisher-Yates implementation. - * - * The original array is modified directly and returned. - * - * @function Phaser.Utils.Array.Shuffle - * @since 3.0.0 - * - * @generic T - * @genericUse {T[]} - [array,$return] - * - * @param {T[]} array - The array to shuffle. This array is modified in place. - * - * @return {T[]} The shuffled array. - */ -var Shuffle = function (array) -{ - for (var i = array.length - 1; i > 0; i--) - { - var j = Math.floor(Math.random() * (i + 1)); - var temp = array[i]; - array[i] = array[j]; - array[j] = temp; - } - - return array; -}; - -module.exports = Shuffle; - - -/***/ }), -/* 65 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(304); -var Smoothing = __webpack_require__(306); - -// The pool into which the canvas elements are placed. -var pool = []; - -// Automatically apply smoothing(false) to created Canvas elements -var _disableContextSmoothing = false; - -/** - * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. - * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, - * which is useless for some of the Phaser pipelines / renderer. - * - * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. - * Which means all instances of Phaser Games on the same page can share the one single pool. - * - * @namespace Phaser.Display.Canvas.CanvasPool - * @since 3.0.0 - */ -var CanvasPool = function () -{ - /** - * Creates a new Canvas DOM element, or pulls one from the pool if free. - * - * @function Phaser.Display.Canvas.CanvasPool.create - * @since 3.0.0 - * - * @param {*} parent - The parent of the Canvas object. - * @param {number} [width=1] - The width of the Canvas. - * @param {number} [height=1] - The height of the Canvas. - * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. - * @param {boolean} [selfParent=false] - Use the generated Canvas element as the parent? - * - * @return {HTMLCanvasElement} The canvas element that was created or pulled from the pool - */ - var create = function (parent, width, height, canvasType, selfParent) - { - if (width === undefined) { width = 1; } - if (height === undefined) { height = 1; } - if (canvasType === undefined) { canvasType = CONST.CANVAS; } - if (selfParent === undefined) { selfParent = false; } - - var canvas; - var container = first(canvasType); - - if (container === null) - { - container = { - parent: parent, - canvas: document.createElement('canvas'), - type: canvasType - }; - - if (canvasType === CONST.CANVAS) - { - pool.push(container); - } - - canvas = container.canvas; - } - else - { - container.parent = parent; - - canvas = container.canvas; - } - - if (selfParent) - { - container.parent = canvas; - } - - canvas.width = width; - canvas.height = height; - - if (_disableContextSmoothing && canvasType === CONST.CANVAS) - { - Smoothing.disable(canvas.getContext('2d')); - } - - return canvas; - }; - - /** - * Creates a new Canvas DOM element, or pulls one from the pool if free. - * - * @function Phaser.Display.Canvas.CanvasPool.create2D - * @since 3.0.0 - * - * @param {*} parent - The parent of the Canvas object. - * @param {number} [width=1] - The width of the Canvas. - * @param {number} [height=1] - The height of the Canvas. - * - * @return {HTMLCanvasElement} The created canvas. - */ - var create2D = function (parent, width, height) - { - return create(parent, width, height, CONST.CANVAS); - }; - - /** - * Creates a new Canvas DOM element, or pulls one from the pool if free. - * - * @function Phaser.Display.Canvas.CanvasPool.createWebGL - * @since 3.0.0 - * - * @param {*} parent - The parent of the Canvas object. - * @param {number} [width=1] - The width of the Canvas. - * @param {number} [height=1] - The height of the Canvas. - * - * @return {HTMLCanvasElement} The created WebGL canvas. - */ - var createWebGL = function (parent, width, height) - { - return create(parent, width, height, CONST.WEBGL); - }; - - /** - * Gets the first free canvas index from the pool. - * - * @function Phaser.Display.Canvas.CanvasPool.first - * @since 3.0.0 - * - * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. - * - * @return {HTMLCanvasElement} The first free canvas, or `null` if a WebGL canvas was requested or if the pool doesn't have free canvases. - */ - var first = function (canvasType) - { - if (canvasType === undefined) { canvasType = CONST.CANVAS; } - - if (canvasType === CONST.WEBGL) - { - return null; - } - - for (var i = 0; i < pool.length; i++) - { - var container = pool[i]; - - if (!container.parent && container.type === canvasType) - { - return container; - } - } - - return null; - }; - - /** - * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use. - * The canvas has its width and height set to 1, and its parent attribute nulled. - * - * @function Phaser.Display.Canvas.CanvasPool.remove - * @since 3.0.0 - * - * @param {*} parent - The canvas or the parent of the canvas to free. - */ - var remove = function (parent) - { - // Check to see if the parent is a canvas object - var isCanvas = parent instanceof HTMLCanvasElement; - - pool.forEach(function (container) - { - if ((isCanvas && container.canvas === parent) || (!isCanvas && container.parent === parent)) - { - container.parent = null; - container.canvas.width = 1; - container.canvas.height = 1; - } - }); - }; - - /** - * Gets the total number of used canvas elements in the pool. - * - * @function Phaser.Display.Canvas.CanvasPool.total - * @since 3.0.0 - * - * @return {number} The number of used canvases. - */ - var total = function () - { - var c = 0; - - pool.forEach(function (container) - { - if (container.parent) - { - c++; - } - }); - - return c; - }; - - /** - * Gets the total number of free canvas elements in the pool. - * - * @function Phaser.Display.Canvas.CanvasPool.free - * @since 3.0.0 - * - * @return {number} The number of free canvases. - */ - var free = function () - { - return pool.length - total(); - }; - - /** - * Disable context smoothing on any new Canvas element created. - * - * @function Phaser.Display.Canvas.CanvasPool.disableSmoothing - * @since 3.0.0 - */ - var disableSmoothing = function () - { - _disableContextSmoothing = true; - }; - - /** - * Enable context smoothing on any new Canvas element created. - * - * @function Phaser.Display.Canvas.CanvasPool.enableSmoothing - * @since 3.0.0 - */ - var enableSmoothing = function () - { - _disableContextSmoothing = false; - }; - - return { - create2D: create2D, - create: create, - createWebGL: createWebGL, - disableSmoothing: disableSmoothing, - enableSmoothing: enableSmoothing, - first: first, - free: free, - pool: pool, - remove: remove, - total: total - }; -}; - -// If we export the called function here, it'll only be invoked once (not every time it's required). -module.exports = CanvasPool(); - - -/***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Perimeter = __webpack_require__(67); -var Point = __webpack_require__(14); - -/** - * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * - * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * - * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. - * - * @function Phaser.Geom.Rectangle.GetPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [out,$return] - * - * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle to get the perimeter point from. - * @param {number} position - The normalized distance into the Rectangle's perimeter to return. - * @param {(Phaser.Geom.Point|object)} [out] - An object to update with the `x` and `y` coordinates of the point. - * - * @return {Phaser.Geom.Point} The updated `output` object, or a new Point if no `output` object was given. - */ -var GetPoint = function (rectangle, position, out) -{ - if (out === undefined) { out = new Point(); } - - if (position <= 0 || position >= 1) - { - out.x = rectangle.x; - out.y = rectangle.y; - - return out; - } - - var p = Perimeter(rectangle) * position; - - if (position > 0.5) - { - p -= (rectangle.width + rectangle.height); - - if (p <= rectangle.width) - { - // Face 3 - out.x = rectangle.right - p; - out.y = rectangle.bottom; - } - else - { - // Face 4 - out.x = rectangle.x; - out.y = rectangle.bottom - (p - rectangle.width); - } - } - else if (p <= rectangle.width) - { - // Face 1 - out.x = rectangle.x + p; - out.y = rectangle.y; - } - else - { - // Face 2 - out.x = rectangle.right; - out.y = rectangle.y + (p - rectangle.width); - } - - return out; -}; - -module.exports = GetPoint; - - -/***/ }), -/* 67 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates the perimeter of a Rectangle. - * - * @function Phaser.Geom.Rectangle.Perimeter - * @since 3.0.0 - * - * @param {Phaser.Geom.Rectangle} rect - The Rectangle to use. - * - * @return {number} The perimeter of the Rectangle, equal to `(width * 2) + (height * 2)`. - */ -var Perimeter = function (rect) -{ - return 2 * (rect.width + rect.height); -}; - -module.exports = Perimeter; - - -/***/ }), -/* 68 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Clamp = __webpack_require__(1); -var Extend = __webpack_require__(19); - -/** - * @classdesc - * A Frame is a section of a Texture. - * - * @class Frame - * @memberof Phaser.Textures - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Textures.Texture} texture - The Texture this Frame is a part of. - * @param {(number|string)} name - The name of this Frame. The name is unique within the Texture. - * @param {number} sourceIndex - The index of the TextureSource that this Frame is a part of. - * @param {number} x - The x coordinate of the top-left of this Frame. - * @param {number} y - The y coordinate of the top-left of this Frame. - * @param {number} width - The width of this Frame. - * @param {number} height - The height of this Frame. - */ -var Frame = new Class({ - - initialize: - - function Frame (texture, name, sourceIndex, x, y, width, height) - { - /** - * The Texture this Frame is a part of. - * - * @name Phaser.Textures.Frame#texture - * @type {Phaser.Textures.Texture} - * @since 3.0.0 - */ - this.texture = texture; - - /** - * The name of this Frame. - * The name is unique within the Texture. - * - * @name Phaser.Textures.Frame#name - * @type {string} - * @since 3.0.0 - */ - this.name = name; - - /** - * The TextureSource this Frame is part of. - * - * @name Phaser.Textures.Frame#source - * @type {Phaser.Textures.TextureSource} - * @since 3.0.0 - */ - this.source = texture.source[sourceIndex]; - - /** - * The index of the TextureSource in the Texture sources array. - * - * @name Phaser.Textures.Frame#sourceIndex - * @type {number} - * @since 3.0.0 - */ - this.sourceIndex = sourceIndex; - - /** - * A reference to the Texture Source WebGL Texture that this Frame is using. - * - * @name Phaser.Textures.Frame#glTexture - * @type {?WebGLTexture} - * @default null - * @since 3.11.0 - */ - this.glTexture = this.source.glTexture; - - /** - * X position within the source image to cut from. - * - * @name Phaser.Textures.Frame#cutX - * @type {number} - * @since 3.0.0 - */ - this.cutX; - - /** - * Y position within the source image to cut from. - * - * @name Phaser.Textures.Frame#cutY - * @type {number} - * @since 3.0.0 - */ - this.cutY; - - /** - * The width of the area in the source image to cut. - * - * @name Phaser.Textures.Frame#cutWidth - * @type {number} - * @since 3.0.0 - */ - this.cutWidth; - - /** - * The height of the area in the source image to cut. - * - * @name Phaser.Textures.Frame#cutHeight - * @type {number} - * @since 3.0.0 - */ - this.cutHeight; - - /** - * The X rendering offset of this Frame, taking trim into account. - * - * @name Phaser.Textures.Frame#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The Y rendering offset of this Frame, taking trim into account. - * - * @name Phaser.Textures.Frame#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - /** - * The rendering width of this Frame, taking trim into account. - * - * @name Phaser.Textures.Frame#width - * @type {number} - * @since 3.0.0 - */ - this.width; - - /** - * The rendering height of this Frame, taking trim into account. - * - * @name Phaser.Textures.Frame#height - * @type {number} - * @since 3.0.0 - */ - this.height; - - /** - * Half the width, floored. - * Precalculated for the renderer. - * - * @name Phaser.Textures.Frame#halfWidth - * @type {number} - * @since 3.0.0 - */ - this.halfWidth; - - /** - * Half the height, floored. - * Precalculated for the renderer. - * - * @name Phaser.Textures.Frame#halfHeight - * @type {number} - * @since 3.0.0 - */ - this.halfHeight; - - /** - * The x center of this frame, floored. - * - * @name Phaser.Textures.Frame#centerX - * @type {number} - * @since 3.0.0 - */ - this.centerX; - - /** - * The y center of this frame, floored. - * - * @name Phaser.Textures.Frame#centerY - * @type {number} - * @since 3.0.0 - */ - this.centerY; - - /** - * The horizontal pivot point of this Frame. - * - * @name Phaser.Textures.Frame#pivotX - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.pivotX = 0; - - /** - * The vertical pivot point of this Frame. - * - * @name Phaser.Textures.Frame#pivotY - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.pivotY = 0; - - /** - * Does this Frame have a custom pivot point? - * - * @name Phaser.Textures.Frame#customPivot - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.customPivot = false; - - /** - * **CURRENTLY UNSUPPORTED** - * - * Is this frame is rotated or not in the Texture? - * Rotation allows you to use rotated frames in texture atlas packing. - * It has nothing to do with Sprite rotation. - * - * @name Phaser.Textures.Frame#rotated - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.rotated = false; - - /** - * Over-rides the Renderer setting. - * -1 = use Renderer Setting - * 0 = No rounding - * 1 = Round - * - * @name Phaser.Textures.Frame#autoRound - * @type {number} - * @default -1 - * @since 3.0.0 - */ - this.autoRound = -1; - - /** - * Any Frame specific custom data can be stored here. - * - * @name Phaser.Textures.Frame#customData - * @type {object} - * @since 3.0.0 - */ - this.customData = {}; - - /** - * WebGL UV u0 value. - * - * @name Phaser.Textures.Frame#u0 - * @type {number} - * @default 0 - * @since 3.11.0 - */ - this.u0 = 0; - - /** - * WebGL UV v0 value. - * - * @name Phaser.Textures.Frame#v0 - * @type {number} - * @default 0 - * @since 3.11.0 - */ - this.v0 = 0; - - /** - * WebGL UV u1 value. - * - * @name Phaser.Textures.Frame#u1 - * @type {number} - * @default 0 - * @since 3.11.0 - */ - this.u1 = 0; - - /** - * WebGL UV v1 value. - * - * @name Phaser.Textures.Frame#v1 - * @type {number} - * @default 0 - * @since 3.11.0 - */ - this.v1 = 0; - - /** - * The un-modified source frame, trim and UV data. - * - * @name Phaser.Textures.Frame#data - * @type {object} - * @private - * @since 3.0.0 - */ - this.data = { - cut: { - x: 0, - y: 0, - w: 0, - h: 0, - r: 0, - b: 0 - }, - trim: false, - sourceSize: { - w: 0, - h: 0 - }, - spriteSourceSize: { - x: 0, - y: 0, - w: 0, - h: 0, - r: 0, - b: 0 - }, - radius: 0, - drawImage: { - x: 0, - y: 0, - width: 0, - height: 0 - } - }; - - this.setSize(width, height, x, y); - }, - - /** - * Sets the width, height, x and y of this Frame. - * - * This is called automatically by the constructor - * and should rarely be changed on-the-fly. - * - * @method Phaser.Textures.Frame#setSize - * @since 3.7.0 - * - * @param {number} width - The width of the frame before being trimmed. - * @param {number} height - The height of the frame before being trimmed. - * @param {number} [x=0] - The x coordinate of the top-left of this Frame. - * @param {number} [y=0] - The y coordinate of the top-left of this Frame. - * - * @return {this} This Frame object. - */ - setSize: function (width, height, x, y) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - - this.cutX = x; - this.cutY = y; - this.cutWidth = width; - this.cutHeight = height; - - this.width = width; - this.height = height; - - this.halfWidth = Math.floor(width * 0.5); - this.halfHeight = Math.floor(height * 0.5); - - this.centerX = Math.floor(width / 2); - this.centerY = Math.floor(height / 2); - - var data = this.data; - var cut = data.cut; - - cut.x = x; - cut.y = y; - cut.w = width; - cut.h = height; - cut.r = x + width; - cut.b = y + height; - - data.sourceSize.w = width; - data.sourceSize.h = height; - - data.spriteSourceSize.w = width; - data.spriteSourceSize.h = height; - - data.radius = 0.5 * Math.sqrt(width * width + height * height); - - var drawImage = data.drawImage; - - drawImage.x = x; - drawImage.y = y; - drawImage.width = width; - drawImage.height = height; - - return this.updateUVs(); - }, - - /** - * If the frame was trimmed when added to the Texture Atlas, this records the trim and source data. - * - * @method Phaser.Textures.Frame#setTrim - * @since 3.0.0 - * - * @param {number} actualWidth - The width of the frame before being trimmed. - * @param {number} actualHeight - The height of the frame before being trimmed. - * @param {number} destX - The destination X position of the trimmed frame for display. - * @param {number} destY - The destination Y position of the trimmed frame for display. - * @param {number} destWidth - The destination width of the trimmed frame for display. - * @param {number} destHeight - The destination height of the trimmed frame for display. - * - * @return {this} This Frame object. - */ - setTrim: function (actualWidth, actualHeight, destX, destY, destWidth, destHeight) - { - var data = this.data; - var ss = data.spriteSourceSize; - - // Store actual values - - data.trim = true; - - data.sourceSize.w = actualWidth; - data.sourceSize.h = actualHeight; - - ss.x = destX; - ss.y = destY; - ss.w = destWidth; - ss.h = destHeight; - ss.r = destX + destWidth; - ss.b = destY + destHeight; - - // Adjust properties - this.x = destX; - this.y = destY; - - this.width = destWidth; - this.height = destHeight; - - this.halfWidth = destWidth * 0.5; - this.halfHeight = destHeight * 0.5; - - this.centerX = Math.floor(destWidth / 2); - this.centerY = Math.floor(destHeight / 2); - - return this.updateUVs(); - }, - - /** - * Takes a crop data object and, based on the rectangular region given, calculates the - * required UV coordinates in order to crop this Frame for WebGL and Canvas rendering. - * - * This is called directly by the Game Object Texture Components `setCrop` method. - * Please use that method to crop a Game Object. - * - * @method Phaser.Textures.Frame#setCropUVs - * @since 3.11.0 - * - * @param {object} crop - The crop data object. This is the `GameObject._crop` property. - * @param {number} x - The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. - * @param {number} y - The y coordinate to start the crop from. Cannot be negative or exceed the Frame height. - * @param {number} width - The width of the crop rectangle. Cannot exceed the Frame width. - * @param {number} height - The height of the crop rectangle. Cannot exceed the Frame height. - * @param {boolean} flipX - Does the parent Game Object have flipX set? - * @param {boolean} flipY - Does the parent Game Object have flipY set? - * - * @return {object} The updated crop data object. - */ - setCropUVs: function (crop, x, y, width, height, flipX, flipY) - { - // Clamp the input values - - var cx = this.cutX; - var cy = this.cutY; - var cw = this.cutWidth; - var ch = this.cutHeight; - var rw = this.realWidth; - var rh = this.realHeight; - - x = Clamp(x, 0, rw); - y = Clamp(y, 0, rh); - - width = Clamp(width, 0, rw - x); - height = Clamp(height, 0, rh - y); - - var ox = cx + x; - var oy = cy + y; - var ow = width; - var oh = height; - - var data = this.data; - - if (data.trim) - { - var ss = data.spriteSourceSize; - - // Need to check for intersection between the cut area and the crop area - // If there is none, we set UV to be empty, otherwise set it to be the intersection area - - width = Clamp(width, 0, cw - x); - height = Clamp(height, 0, ch - y); - - var cropRight = x + width; - var cropBottom = y + height; - - var intersects = !(ss.r < x || ss.b < y || ss.x > cropRight || ss.y > cropBottom); - - if (intersects) - { - var ix = Math.max(ss.x, x); - var iy = Math.max(ss.y, y); - var iw = Math.min(ss.r, cropRight) - ix; - var ih = Math.min(ss.b, cropBottom) - iy; - - ow = iw; - oh = ih; - - if (flipX) - { - ox = cx + (cw - (ix - ss.x) - iw); - } - else - { - ox = cx + (ix - ss.x); - } - - if (flipY) - { - oy = cy + (ch - (iy - ss.y) - ih); - } - else - { - oy = cy + (iy - ss.y); - } - - x = ix; - y = iy; - - width = iw; - height = ih; - } - else - { - ox = 0; - oy = 0; - ow = 0; - oh = 0; - } - } - else - { - if (flipX) - { - ox = cx + (cw - x - width); - } - - if (flipY) - { - oy = cy + (ch - y - height); - } - } - - var tw = this.source.width; - var th = this.source.height; - - // Map the given coordinates into UV space, clamping to the 0-1 range. - - crop.u0 = Math.max(0, ox / tw); - crop.v0 = Math.max(0, oy / th); - crop.u1 = Math.min(1, (ox + ow) / tw); - crop.v1 = Math.min(1, (oy + oh) / th); - - crop.x = x; - crop.y = y; - - crop.cx = ox; - crop.cy = oy; - crop.cw = ow; - crop.ch = oh; - - crop.width = width; - crop.height = height; - - crop.flipX = flipX; - crop.flipY = flipY; - - return crop; - }, - - /** - * Takes a crop data object and recalculates the UVs based on the dimensions inside the crop object. - * Called automatically by `setFrame`. - * - * @method Phaser.Textures.Frame#updateCropUVs - * @since 3.11.0 - * - * @param {object} crop - The crop data object. This is the `GameObject._crop` property. - * @param {boolean} flipX - Does the parent Game Object have flipX set? - * @param {boolean} flipY - Does the parent Game Object have flipY set? - * - * @return {object} The updated crop data object. - */ - updateCropUVs: function (crop, flipX, flipY) - { - return this.setCropUVs(crop, crop.x, crop.y, crop.width, crop.height, flipX, flipY); - }, - - /** - * Directly sets the canvas and WebGL UV data for this frame. - * - * Use this if you need to override the values that are generated automatically - * when the Frame is created. - * - * @method Phaser.Textures.Frame#setUVs - * @since 3.50.0 - * - * @param {number} width - Width of this frame for the Canvas data. - * @param {number} height - Height of this frame for the Canvas data. - * @param {number} u0 - UV u0 value. - * @param {number} v0 - UV v0 value. - * @param {number} u1 - UV u1 value. - * @param {number} v1 - UV v1 value. - * - * @return {this} This Frame object. - */ - setUVs: function (width, height, u0, v0, u1, v1) - { - // Canvas data - - var cd = this.data.drawImage; - - cd.width = width; - cd.height = height; - - // WebGL data - - this.u0 = u0; - this.v0 = v0; - - this.u1 = u1; - this.v1 = v1; - - return this; - }, - - /** - * Updates the internal WebGL UV cache and the drawImage cache. - * - * @method Phaser.Textures.Frame#updateUVs - * @since 3.0.0 - * - * @return {this} This Frame object. - */ - updateUVs: function () - { - var cx = this.cutX; - var cy = this.cutY; - var cw = this.cutWidth; - var ch = this.cutHeight; - - // Canvas data - - var cd = this.data.drawImage; - - cd.width = cw; - cd.height = ch; - - // WebGL data - - var tw = this.source.width; - var th = this.source.height; - - this.u0 = cx / tw; - this.v0 = cy / th; - - this.u1 = (cx + cw) / tw; - this.v1 = (cy + ch) / th; - - return this; - }, - - /** - * Updates the internal WebGL UV cache. - * - * @method Phaser.Textures.Frame#updateUVsInverted - * @since 3.0.0 - * - * @return {this} This Frame object. - */ - updateUVsInverted: function () - { - var tw = this.source.width; - var th = this.source.height; - - this.u0 = (this.cutX + this.cutHeight) / tw; - this.v0 = this.cutY / th; - - this.u1 = this.cutX / tw; - this.v1 = (this.cutY + this.cutWidth) / th; - - return this; - }, - - /** - * Clones this Frame into a new Frame object. - * - * @method Phaser.Textures.Frame#clone - * @since 3.0.0 - * - * @return {Phaser.Textures.Frame} A clone of this Frame. - */ - clone: function () - { - var clone = new Frame(this.texture, this.name, this.sourceIndex); - - clone.cutX = this.cutX; - clone.cutY = this.cutY; - clone.cutWidth = this.cutWidth; - clone.cutHeight = this.cutHeight; - - clone.x = this.x; - clone.y = this.y; - - clone.width = this.width; - clone.height = this.height; - - clone.halfWidth = this.halfWidth; - clone.halfHeight = this.halfHeight; - - clone.centerX = this.centerX; - clone.centerY = this.centerY; - - clone.rotated = this.rotated; - - clone.data = Extend(true, clone.data, this.data); - - clone.updateUVs(); - - return clone; - }, - - /** - * Destroys this Frame by nulling its reference to the parent Texture and and data objects. - * - * @method Phaser.Textures.Frame#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.source = null; - this.texture = null; - this.glTexture = null; - this.customData = null; - this.data = null; - }, - - /** - * The width of the Frame in its un-trimmed, un-padded state, as prepared in the art package, - * before being packed. - * - * @name Phaser.Textures.Frame#realWidth - * @type {number} - * @readonly - * @since 3.0.0 - */ - realWidth: { - - get: function () - { - return this.data.sourceSize.w; - } - - }, - - /** - * The height of the Frame in its un-trimmed, un-padded state, as prepared in the art package, - * before being packed. - * - * @name Phaser.Textures.Frame#realHeight - * @type {number} - * @readonly - * @since 3.0.0 - */ - realHeight: { - - get: function () - { - return this.data.sourceSize.h; - } - - }, - - /** - * The radius of the Frame (derived from sqrt(w * w + h * h) / 2) - * - * @name Phaser.Textures.Frame#radius - * @type {number} - * @readonly - * @since 3.0.0 - */ - radius: { - - get: function () - { - return this.data.radius; - } - - }, - - /** - * Is the Frame trimmed or not? - * - * @name Phaser.Textures.Frame#trimmed - * @type {boolean} - * @readonly - * @since 3.0.0 - */ - trimmed: { - - get: function () - { - return this.data.trim; - } - - }, - - /** - * The Canvas drawImage data object. - * - * @name Phaser.Textures.Frame#canvasData - * @type {object} - * @readonly - * @since 3.0.0 - */ - canvasData: { - - get: function () - { - return this.data.drawImage; - } - - } - -}); - -module.exports = Frame; - - -/***/ }), -/* 69 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var BuildGameObject = __webpack_require__(70); -var Class = __webpack_require__(0); -var GetValue = __webpack_require__(10); -var ResizeEvent = __webpack_require__(184); -var ScenePlugin = __webpack_require__(185); -var SpineCanvas = __webpack_require__(209); -var SpineWebgl = __webpack_require__(210); -var Spine = { - canvas: SpineCanvas, - webgl: SpineWebgl -}; -var SpineFile = __webpack_require__(211); -var SpineGameObject = __webpack_require__(227); -var SpineContainer = __webpack_require__(260); -var NOOP = __webpack_require__(2); - -/** - * @classdesc - * The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game Objects. - * - * Find more details about Spine itself at http://esotericsoftware.com/. - * - * All rendering and object creation is handled via the official Spine Runtimes. This version of the plugin - * uses the Spine 3.8.95 runtimes. Please note that due to the way the Spine runtimes use semver, you will - * get breaking changes in point-releases. Therefore, files created in a different version of Spine may not - * work as a result, without you first updating the runtimes and rebuilding the plugin. - * - * Esoteric themselves recommend that you freeze your Spine editor version against the runtime versions. - * You can find more information about this here: http://esotericsoftware.com/spine-settings#Version - * - * Please note that you require a Spine license in order to use Spine Runtimes in your games. - * - * You can install this plugin into your Phaser game by either importing it, if you're using ES6: - * - * ```javascript - * import * as SpinePlugin from './SpinePlugin.js'; - * ``` - * - * and then adding it to your Phaser Game configuration: - * - * ```javascript - * plugins: { - * scene: [ - * { key: 'SpinePlugin', plugin: window.SpinePlugin, mapping: 'spine' } - * ] - * } - * ``` - * - * If you're using ES5 then you can load the Spine Plugin in a Scene files payload, _within_ your - * Game Configuration object, like this: - * - * ```javascript - * scene: { - * preload: preload, - * create: create, - * pack: { - * files: [ - * { type: 'scenePlugin', key: 'SpinePlugin', url: 'plugins/SpinePlugin.js', sceneKey: 'spine' } - * ] - * } - * } - * ``` - * - * Loading it like this allows you to then use commands such as `this.load.spine` from within the - * same Scene. Alternatively, you can use the method `this.load.plugin` to load the plugin via the normal - * Phaser Loader. However, doing so will not add it to the current Scene. It will be available from any - * subsequent Scenes. - * - * ## A note about inlined data: - * - * If you need to load Spine assets from inline / base64 encoded data, then you should not use the Loader - * at all. Instead, call the functions directly as required: - * - * scene.cache.json.add - * scene.cache.custom.spine.add - * scene.textures.addBase64 - * - * ## Using the plugin - * - * Assuming a default environment you access it from within a Scene by using the `this.spine` reference. - * - * When this plugin is installed into a Scene it will add a Loader File Type, allowing you to load - * Spine files directly, i.e.: - * - * ```javascript - * this.load.spine('stretchyman', 'stretchyman-pro.json', [ 'stretchyman-pma.atlas' ], true); - * ``` - * - * It also installs two Game Object Factory methods, allowing you to create Spine Game Objects - * and Spine Containers: - * - * ```javascript - * const man = this.add.spine(512, 650, 'stretchyman'); - * - * const container = this.add.spineContainer(); - * - * container.add(man); - * ``` - * - * The first argument is the key which you used when importing the Spine data. There are lots of - * things you can specify, such as the animation name, skeleton, slot attachments and more. Please - * see the respective documentation and examples for further details. - * - * Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary. - * The associated atlas files are scanned for any texture files present in them, which are then loaded. - * If you have exported your Spine data with preMultipliedAlpha set, then you should enable this in the - * load arguments, or you may see black outlines around skeleton textures. - * - * The Spine plugin is local to the Scene in which it is installed. This means a change to something, - * such as the Skeleton Debug Renderer, in this Scene, will not impact the renderer in any other Scene. - * The only exception to this is with the caches this plugin creates. Spine atlas and texture data are - * stored in their own caches, which are global, meaning they're accessible from any Scene in your - * game, regardless if the Scene loaded the Spine data or not. - * - * When destroying a Phaser Game instance, if you need to re-create it again on the same page without - * reloading, you must remember to remove the Spine Plugin as part of your tear-down process: - * - * ```javascript - * this.plugins.removeScenePlugin('SpinePlugin'); - * ``` - * - * For details about the Spine Runtime API see http://esotericsoftware.com/spine-api-reference - * - * @class SpinePlugin - * @extends Phaser.Plugins.ScenePlugin - * @constructor - * @since 3.19.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin. - * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Phaser Plugin Manager. - * @param {string} pluginKey - The key under which this plugin has been installed into the Scene Systems. - */ -var SpinePlugin = new Class({ - - Extends: ScenePlugin, - - initialize: - - function SpinePlugin (scene, pluginManager, pluginKey) - { - ScenePlugin.call(this, scene, pluginManager, pluginKey); - - var game = pluginManager.game; - - /** - * A read-only flag that indicates if the game is running under WebGL or Canvas. - * - * @name SpinePlugin#isWebGL - * @type {boolean} - * @readonly - * @since 3.19.0 - */ - this.isWebGL = (game.config.renderType === 2); - - /** - * A custom cache that stores the Spine atlas data. - * - * This cache is global across your game, allowing you to access Spine data loaded from other Scenes, - * no matter which Scene you are in. - * - * @name SpinePlugin#cache - * @type {Phaser.Cache.BaseCache} - * @since 3.19.0 - */ - this.cache = game.cache.addCustom('spine'); - - /** - * A custom cache that stores the Spine Textures. - * - * This cache is global across your game, allowing you to access Spine data loaded from other Scenes, - * no matter which Scene you are in. - * - * @name SpinePlugin#spineTextures - * @type {Phaser.Cache.BaseCache} - * @since 3.19.0 - */ - this.spineTextures = game.cache.addCustom('spineTextures'); - - /** - * A reference to the global JSON Cache. - * - * @name SpinePlugin#json - * @type {Phaser.Cache.BaseCache} - * @since 3.19.0 - */ - this.json = game.cache.json; - - /** - * A reference to the global Texture Manager. - * - * @name SpinePlugin#textures - * @type {Phaser.Textures.TextureManager} - * @since 3.19.0 - */ - this.textures = game.textures; - - /** - * A flag that sets if the Skeleton Renderers will render debug information over the top - * of the skeleton or not. - * - * @name SpinePlugin#drawDebug - * @type {boolean} - * @since 3.19.0 - */ - this.drawDebug = false; - - /** - * The underlying WebGL context of the Phaser renderer. - * - * Only set if running in WebGL mode. - * - * @name SpinePlugin#gl - * @type {WebGLRenderingContext} - * @since 3.19.0 - */ - this.gl; - - /** - * A reference to either the Canvas or WebGL Renderer that this Game is using. - * - * @name SpinePlugin#renderer - * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} - * @since 3.19.0 - */ - this.renderer; - - /** - * An instance of the Spine WebGL Scene Renderer. - * - * There is only one instance of the Scene Renderer shared across the whole plugin. - * - * Only set if running in WebGL mode. - * - * @name SpinePlugin#sceneRenderer - * @type {spine.webgl.SceneRenderer} - * @since 3.19.0 - */ - this.sceneRenderer; - - /** - * An instance of the Spine Skeleton Renderer. - * - * @name SpinePlugin#skeletonRenderer - * @type {(spine.canvas.SkeletonRenderer|spine.webgl.SkeletonRenderer)} - * @since 3.19.0 - */ - this.skeletonRenderer; - - /** - * An instance of the Spine Skeleton Debug Renderer. - * - * Only set if running in WebGL mode. - * - * @name SpinePlugin#skeletonDebugRenderer - * @type {spine.webgl.skeletonDebugRenderer} - * @since 3.19.0 - */ - this.skeletonDebugRenderer; - - /** - * A reference to the Spine runtime. - * This is the runtime created by Esoteric Software. - * - * @name SpinePlugin#plugin - * @type {spine} - * @since 3.19.0 - */ - this.plugin = Spine; - - /** - * An internal vector3 used by the screen to world method. - * - * @name SpinePlugin#temp1 - * @private - * @type {spine.webgl.Vector3} - * @since 3.19.0 - */ - this.temp1; - - /** - * An internal vector3 used by the screen to world method. - * - * @name SpinePlugin#temp2 - * @private - * @type {spine.webgl.Vector3} - * @since 3.19.0 - */ - this.temp2; - - if (this.isWebGL) - { - this.runtime = Spine.webgl; - - this.renderer = game.renderer; - this.gl = game.renderer.gl; - - this.getAtlas = this.getAtlasWebGL; - } - else - { - this.runtime = Spine.canvas; - - this.renderer = game.renderer; - - this.getAtlas = this.getAtlasCanvas; - } - - // Headless mode? - if (!this.renderer) - { - this.renderer = { - width: game.scale.width, - height: game.scale.height, - preRender: NOOP, - postRender: NOOP, - render: NOOP, - destroy: NOOP - }; - } - - var add = function (x, y, key, animationName, loop) - { - var spinePlugin = this.scene.sys[pluginKey]; - var spineGO = new SpineGameObject(this.scene, spinePlugin, x, y, key, animationName, loop); - - this.displayList.add(spineGO); - this.updateList.add(spineGO); - - return spineGO; - }; - - var make = function (config, addToScene) - { - if (config === undefined) { config = {}; } - - var key = GetValue(config, 'key', null); - var animationName = GetValue(config, 'animationName', null); - var loop = GetValue(config, 'loop', false); - - var spinePlugin = this.scene.sys[pluginKey]; - var spineGO = new SpineGameObject(this.scene, spinePlugin, 0, 0, key, animationName, loop); - - if (addToScene !== undefined) - { - config.add = addToScene; - } - - BuildGameObject(this.scene, spineGO, config); - - // Spine specific - var skinName = GetValue(config, 'skinName', false); - - if (skinName) - { - spineGO.setSkinByName(skinName); - } - - var slotName = GetValue(config, 'slotName', false); - var attachmentName = GetValue(config, 'attachmentName', null); - - if (slotName) - { - spineGO.setAttachment(slotName, attachmentName); - } - - return spineGO.refresh(); - }; - - var addContainer = function (x, y, children) - { - var spinePlugin = this.scene.sys[pluginKey]; - var spineGO = new SpineContainer(this.scene, spinePlugin, x, y, children); - - this.displayList.add(spineGO); - - return spineGO; - }; - - var makeContainer = function (config, addToScene) - { - if (config === undefined) { config = {}; } - - var x = GetValue(config, 'x', 0); - var y = GetValue(config, 'y', 0); - var children = GetValue(config, 'children', null); - - var spinePlugin = this.scene.sys[pluginKey]; - var container = new SpineContainer(this.scene, spinePlugin, x, y, children); - - if (addToScene !== undefined) - { - config.add = addToScene; - } - - BuildGameObject(this.scene, container, config); - - return container; - }; - - pluginManager.registerFileType('spine', this.spineFileCallback, scene); - pluginManager.registerGameObject('spine', add, make); - pluginManager.registerGameObject('spineContainer', addContainer, makeContainer); - }, - - /** - * Internal boot handler. - * - * @method SpinePlugin#boot - * @private - * @since 3.19.0 - */ - boot: function () - { - if (this.isWebGL) - { - this.bootWebGL(); - this.onResize(); - this.game.scale.on(ResizeEvent, this.onResize, this); - } - else - { - this.bootCanvas(); - } - - var eventEmitter = this.systems.events; - - eventEmitter.once('shutdown', this.shutdown, this); - eventEmitter.once('destroy', this.destroy, this); - - this.game.events.once('destroy', this.gameDestroy, this); - }, - - /** - * Internal boot handler for the Canvas Renderer. - * - * @method SpinePlugin#bootCanvas - * @private - * @since 3.19.0 - */ - bootCanvas: function () - { - this.skeletonRenderer = new Spine.canvas.SkeletonRenderer(this.scene.sys.context); - }, - - /** - * Internal boot handler for the WebGL Renderer. - * - * @method SpinePlugin#bootWebGL - * @private - * @since 3.19.0 - */ - bootWebGL: function () - { - var sceneRenderer = this.renderer.spineSceneRenderer; - - if (!sceneRenderer) - { - sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); - - this.renderer.spineSceneRenderer = sceneRenderer; - } - - // All scene share the same instance - this.sceneRenderer = sceneRenderer; - this.skeletonRenderer = sceneRenderer.skeletonRenderer; - this.skeletonDebugRenderer = sceneRenderer.skeletonDebugRenderer; - - this.temp1 = new Spine.webgl.Vector3(0, 0, 0); - this.temp2 = new Spine.webgl.Vector3(0, 0, 0); - }, - - /** - * Gets a loaded Spine Atlas from the cache and creates a new Spine Texture Atlas, - * then returns it. You do not normally need to invoke this method directly. - * - * @method SpinePlugin#getAtlasCanvas - * @since 3.19.0 - * - * @param {string} key - The key of the Spine Atlas to create. - * - * @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found. - */ - getAtlasCanvas: function (key) - { - var atlasEntry = this.cache.get(key); - - if (!atlasEntry) - { - console.warn('No atlas data for: ' + key); - return; - } - - var atlas; - var spineTextures = this.spineTextures; - - if (spineTextures.has(key)) - { - atlas = spineTextures.get(key); - } - else - { - var textures = this.textures; - - atlas = new this.runtime.TextureAtlas(atlasEntry.data, function (path) - { - return new Spine.canvas.CanvasTexture(textures.get(atlasEntry.prefix + path).getSourceImage()); - }); - } - - return atlas; - }, - - /** - * Gets a loaded Spine Atlas from the cache and creates a new Spine Texture Atlas, - * then returns it. You do not normally need to invoke this method directly. - * - * @method SpinePlugin#getAtlasWebGL - * @since 3.19.0 - * - * @param {string} key - The key of the Spine Atlas to create. - * - * @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found. - */ - getAtlasWebGL: function (key) - { - var atlasEntry = this.cache.get(key); - - if (!atlasEntry) - { - console.warn('No atlas data for: ' + key); - return; - } - - var atlas; - var spineTextures = this.spineTextures; - - if (spineTextures.has(key)) - { - atlas = spineTextures.get(key); - } - else - { - var textures = this.textures; - - var gl = this.sceneRenderer.context.gl; - - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); - - atlas = new this.runtime.TextureAtlas(atlasEntry.data, function (path) - { - return new Spine.webgl.GLTexture(gl, textures.get(atlasEntry.prefix + path).getSourceImage(), false); - }); - } - - return atlas; - }, - - /** - * Adds a Spine Skeleton and Atlas file, or array of files, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.spine('spineBoy', 'boy.json', 'boy.atlas', true); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring - * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. - * - * Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary. The associated - * atlas files are scanned for any texture files present in them, which are then loaded. If you have exported - * your Spine data with preMultipliedAlpha set, then you should enable this in the arguments, or you may see black - * outlines around skeleton textures. - * - * The key must be a unique String. It is used to add the file to the global Spine cache upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the Spine cache. - * Loading a file using a key that is already taken will result in a warning. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.spine({ - * key: 'mainmenu', - * jsonURL: 'boy.json', - * atlasURL: 'boy.atlas', - * preMultipliedAlpha: true - * }); - * ``` - * - * If you need to load multiple Spine atlas files, provide them as an array: - * - * ```javascript - * function preload () - * { - * this.load.spine('demos', 'demos.json', [ 'atlas1.atlas', 'atlas2.atlas' ], true); - * } - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.SpineFileConfig` for more details. - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and - * this is what you would use to retrieve the data from the Spine plugin. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" - * and no URL is given then the Loader will set the URL to be "alien.json". It will always add `.json` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * Note: The ability to load this type of file will only be available if the Spine Plugin has been built or loaded into Phaser. - * - * @method Phaser.Loader.LoaderPlugin#spine - * @fires Phaser.Loader.LoaderPlugin#ADD - * @since 3.19.0 - * - * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string} jsonURL - The absolute or relative URL to load the Spine json file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". - * @param {string|string[]} atlasURL - The absolute or relative URL to load the Spine atlas file from. If undefined or `null` it will be set to `.atlas`, i.e. if `key` was "alien" then the URL will be "alien.atlas". - * @param {boolean} [preMultipliedAlpha=false] - Do the texture files include pre-multiplied alpha or not? - * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the Spine json file. Used in replacement of the Loaders default XHR Settings. - * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the Spine atlas file. Used in replacement of the Loaders default XHR Settings. - * @param {object} [settings] - An external Settings configuration object { prefix: '' } - * @return {Phaser.Loader.LoaderPlugin} The Loader instance. - */ - spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings, settings) - { - var multifile; - settings = settings || {}; - - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - multifile = new SpineFile(this, key[i]); - - // Support prefix key - multifile.prefix = multifile.prefix || settings.prefix || ''; - - this.addFile(multifile.files); - } - } - else - { - multifile = new SpineFile(this, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings); - - // Support prefix key - multifile.prefix = multifile.prefix || settings.prefix || ''; - - this.addFile(multifile.files); - } - - return this; - }, - - /** - * Converts the given x and y screen coordinates into the world space of the given Skeleton. - * - * Only works in WebGL. - * - * @method SpinePlugin#worldToLocal - * @since 3.19.0 - * - * @param {number} x - The screen space x coordinate to convert. - * @param {number} y - The screen space y coordinate to convert. - * @param {spine.Skeleton} skeleton - The Spine Skeleton to convert into. - * @param {spine.Bone} [bone] - Optional bone of the Skeleton to convert into. - * - * @return {spine.Vector2} A Vector2 containing the translated point. - */ - worldToLocal: function (x, y, skeleton, bone) - { - var temp1 = this.temp1; - var temp2 = this.temp2; - var camera = this.sceneRenderer.camera; - - temp1.set(x + skeleton.x, y - skeleton.y, 0); - - var width = camera.viewportWidth; - var height = camera.viewportHeight; - - camera.screenToWorld(temp1, width, height); - - if (bone && bone.parent !== null) - { - bone.parent.worldToLocal(temp2.set(temp1.x - skeleton.x, temp1.y - skeleton.y, 0)); - - return new this.runtime.Vector2(temp2.x, temp2.y); - } - else if (bone) - { - return new this.runtime.Vector2(temp1.x - skeleton.x, temp1.y - skeleton.y); - } - else - { - return new this.runtime.Vector2(temp1.x, temp1.y); - } - }, - - /** - * Returns a Spine Vector2 based on the given x and y values. - * - * @method SpinePlugin#getVector2 - * @since 3.19.0 - * - * @param {number} x - The Vector x value. - * @param {number} y - The Vector y value. - * - * @return {spine.Vector2} A Spine Vector2 based on the given values. - */ - getVector2: function (x, y) - { - return new this.runtime.Vector2(x, y); - }, - - /** - * Returns a Spine Vector2 based on the given x, y and z values. - * - * Only works in WebGL. - * - * @method SpinePlugin#getVector3 - * @since 3.19.0 - * - * @param {number} x - The Vector x value. - * @param {number} y - The Vector y value. - * @param {number} z - The Vector z value. - * - * @return {spine.Vector2} A Spine Vector2 based on the given values. - */ - getVector3: function (x, y, z) - { - return new Spine.webgl.Vector3(x, y, z); - }, - - /** - * Sets `drawBones` in the Spine Skeleton Debug Renderer. - * - * Only works in WebGL. - * - * @method SpinePlugin#setDebugBones - * @since 3.19.0 - * - * @param {boolean} [value=true] - The value to set in the debug property. - * - * @return {this} This Spine Plugin. - */ - setDebugBones: function (value) - { - if (value === undefined) { value = true; } - - this.skeletonDebugRenderer.drawBones = value; - - return this; - }, - - /** - * Sets `drawRegionAttachments` in the Spine Skeleton Debug Renderer. - * - * Only works in WebGL. - * - * @method SpinePlugin#setDebugRegionAttachments - * @since 3.19.0 - * - * @param {boolean} [value=true] - The value to set in the debug property. - * - * @return {this} This Spine Plugin. - */ - setDebugRegionAttachments: function (value) - { - if (value === undefined) { value = true; } - - this.skeletonDebugRenderer.drawRegionAttachments = value; - - return this; - }, - - /** - * Sets `drawBoundingBoxes` in the Spine Skeleton Debug Renderer. - * - * Only works in WebGL. - * - * @method SpinePlugin#setDebugBoundingBoxes - * @since 3.19.0 - * - * @param {boolean} [value=true] - The value to set in the debug property. - * - * @return {this} This Spine Plugin. - */ - setDebugBoundingBoxes: function (value) - { - if (value === undefined) { value = true; } - - this.skeletonDebugRenderer.drawBoundingBoxes = value; - - return this; - }, - - /** - * Sets `drawMeshHull` in the Spine Skeleton Debug Renderer. - * - * Only works in WebGL. - * - * @method SpinePlugin#setDebugMeshHull - * @since 3.19.0 - * - * @param {boolean} [value=true] - The value to set in the debug property. - * - * @return {this} This Spine Plugin. - */ - setDebugMeshHull: function (value) - { - if (value === undefined) { value = true; } - - this.skeletonDebugRenderer.drawMeshHull = value; - - return this; - }, - - /** - * Sets `drawMeshTriangles` in the Spine Skeleton Debug Renderer. - * - * Only works in WebGL. - * - * @method SpinePlugin#setDebugMeshTriangles - * @since 3.19.0 - * - * @param {boolean} [value=true] - The value to set in the debug property. - * - * @return {this} This Spine Plugin. - */ - setDebugMeshTriangles: function (value) - { - if (value === undefined) { value = true; } - - this.skeletonDebugRenderer.drawMeshTriangles = value; - - return this; - }, - - /** - * Sets `drawPaths` in the Spine Skeleton Debug Renderer. - * - * Only works in WebGL. - * - * @method SpinePlugin#setDebugPaths - * @since 3.19.0 - * - * @param {boolean} [value=true] - The value to set in the debug property. - * - * @return {this} This Spine Plugin. - */ - setDebugPaths: function (value) - { - if (value === undefined) { value = true; } - - this.skeletonDebugRenderer.drawPaths = value; - - return this; - }, - - /** - * Sets `drawSkeletonXY` in the Spine Skeleton Debug Renderer. - * - * Only works in WebGL. - * - * @method SpinePlugin#setDebugSkeletonXY - * @since 3.19.0 - * - * @param {boolean} [value=true] - The value to set in the debug property. - * - * @return {this} This Spine Plugin. - */ - setDebugSkeletonXY: function (value) - { - if (value === undefined) { value = true; } - - this.skeletonDebugRenderer.drawSkeletonXY = value; - - return this; - }, - - /** - * Sets `drawClipping` in the Spine Skeleton Debug Renderer. - * - * Only works in WebGL. - * - * @method SpinePlugin#setDebugClipping - * @since 3.19.0 - * - * @param {boolean} [value=true] - The value to set in the debug property. - * - * @return {this} This Spine Plugin. - */ - setDebugClipping: function (value) - { - if (value === undefined) { value = true; } - - this.skeletonDebugRenderer.drawClipping = value; - - return this; - }, - - /** - * Sets the given vertex effect on the Spine Skeleton Renderer. - * - * Only works in WebGL. - * - * @method SpinePlugin#setEffect - * @since 3.19.0 - * - * @param {spine.VertexEffect} [effect] - The vertex effect to set on the Skeleton Renderer. - * - * @return {this} This Spine Plugin. - */ - setEffect: function (effect) - { - this.sceneRenderer.skeletonRenderer.vertexEffect = effect; - - return this; - }, - - /** - * Creates a Spine Skeleton based on the given key and optional Skeleton JSON data. - * - * The Skeleton data should have already been loaded before calling this method. - * - * @method SpinePlugin#createSkeleton - * @since 3.19.0 - * - * @param {string} key - The key of the Spine skeleton data, as loaded by the plugin. If the Spine JSON contains multiple skeletons, reference them with a period, i.e. `set.spineBoy`. - * @param {object} [skeletonJSON] - Optional Skeleton JSON data to use, instead of getting it from the cache. - * - * @return {(any|null)} This Spine Skeleton data object, or `null` if the key was invalid. - */ - createSkeleton: function (key, skeletonJSON) - { - var atlasKey = key; - var jsonKey = key; - var split = (key.indexOf('.') !== -1); - - if (split) - { - var parts = key.split('.'); - - atlasKey = parts.shift(); - jsonKey = parts.join('.'); - } - - var atlasData = this.cache.get(atlasKey); - var atlas = this.getAtlas(atlasKey); - - if (!atlas) - { - return null; - } - - if (!this.spineTextures.has(atlasKey)) - { - var gl = this.gl; - var i; - var atlasPage; - var realTextureKey; - - if (this.isWebGL) - { - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); - } - - for (i = 0; i < atlas.pages.length; i ++) - { - atlasPage = atlas.pages[i]; - realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name; - if (this.isWebGL) - { - atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false)); - } - else - { - atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage())); - } - } - - this.spineTextures.add(atlasKey, atlas); - } - - var preMultipliedAlpha = atlasData.preMultipliedAlpha; - - var atlasLoader = new this.runtime.AtlasAttachmentLoader(atlas); - - var skeletonJson = new this.runtime.SkeletonJson(atlasLoader); - - var data; - - if (skeletonJSON) - { - data = skeletonJSON; - } - else - { - var json = this.json.get(atlasKey); - - data = (split) ? GetValue(json, jsonKey) : json; - } - - if (data) - { - var skeletonData = skeletonJson.readSkeletonData(data); - - var skeleton = new this.runtime.Skeleton(skeletonData); - - return { skeletonData: skeletonData, skeleton: skeleton, preMultipliedAlpha: preMultipliedAlpha }; - } - else - { - return null; - } - }, - - /** - * Creates a new Animation State and Animation State Data for the given skeleton. - * - * The returned object contains two properties: `state` and `stateData` respectively. - * - * @method SpinePlugin#createAnimationState - * @since 3.19.0 - * - * @param {spine.Skeleton} skeleton - The Skeleton to create the Animation State for. - * - * @return {any} An object containing the Animation State and Animation State Data instances. - */ - createAnimationState: function (skeleton) - { - var stateData = new this.runtime.AnimationStateData(skeleton.data); - - var state = new this.runtime.AnimationState(stateData); - - return { stateData: stateData, state: state }; - }, - - /** - * Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose. - * - * The returned object contains two properties: `offset` and `size`: - * - * `offset` - The distance from the skeleton origin to the bottom left corner of the AABB. - * `size` - The width and height of the AABB. - * - * @method SpinePlugin#getBounds - * @since 3.19.0 - * - * @param {spine.Skeleton} skeleton - The Skeleton to get the bounds from. - * - * @return {any} The bounds object. - */ - getBounds: function (skeleton) - { - var offset = new this.runtime.Vector2(); - var size = new this.runtime.Vector2(); - - skeleton.getBounds(offset, size, []); - - return { offset: offset, size: size }; - }, - - /** - * Internal handler for when the renderer resizes. - * - * Only called if running in WebGL. - * - * @method SpinePlugin#onResize - * @since 3.19.0 - */ - onResize: function () - { - var renderer = this.renderer; - var sceneRenderer = this.sceneRenderer; - - var viewportWidth = renderer.width; - var viewportHeight = renderer.height; - - sceneRenderer.camera.position.x = viewportWidth / 2; - sceneRenderer.camera.position.y = viewportHeight / 2; - - sceneRenderer.camera.setViewport(viewportWidth, viewportHeight); - }, - - /** - * The Scene that owns this plugin is shutting down. - * - * We need to kill and reset all internal properties as well as stop listening to Scene events. - * - * @method SpinePlugin#shutdown - * @private - * @since 3.19.0 - */ - shutdown: function () - { - var eventEmitter = this.systems.events; - - eventEmitter.off('shutdown', this.shutdown, this); - - if (this.isWebGL) - { - this.game.scale.off(ResizeEvent, this.onResize, this); - } - }, - - /** - * The Scene that owns this plugin is being destroyed. - * - * We need to shutdown and then kill off all external references. - * - * @method SpinePlugin#destroy - * @private - * @since 3.19.0 - */ - destroy: function () - { - this.shutdown(); - - this.game = null; - this.scene = null; - this.systems = null; - - this.cache = null; - this.spineTextures = null; - this.json = null; - this.textures = null; - this.skeletonRenderer = null; - this.gl = null; - }, - - /** - * The Game that owns this plugin is being destroyed. - * - * Dispose of the Scene Renderer and remove the Game Objects. - * - * @method SpinePlugin#gameDestroy - * @private - * @since 3.50.0 - */ - gameDestroy: function () - { - this.pluginManager.removeGameObject('spine', true, true); - this.pluginManager.removeGameObject('spineContainer', true, true); - - this.pluginManager = null; - - var sceneRenderer = this.renderer.spineSceneRenderer; - - if (sceneRenderer) - { - sceneRenderer.dispose(); - } - - this.renderer.spineSceneRenderer = null; - this.sceneRenderer = null; - } - -}); - -SpinePlugin.SpineGameObject = SpineGameObject; -SpinePlugin.SpineContainer = SpineContainer; - -/** - * Creates a new Spine Game Object and adds it to the Scene. - * - * The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from - * skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects - * do not have a Phaser origin. - * - * If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period - * character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains - * multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference - * that. - * - * ```javascript - * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true); - * ``` - * - * The key is optional. If not passed here, you need to call `SpineGameObject.setSkeleton()` to use it. - * - * The animation name is also optional and can be set later via `SpineGameObject.setAnimation`. - * - * Should you wish for more control over the object creation, such as setting a slot attachment or skin - * name, then use `SpinePlugin.make` instead. - * - * @method SpinePlugin#add - * @since 3.19.0 - * - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} [key] - The key of the Spine Skeleton this Game Object will use, as stored in the Spine Plugin. - * @param {string} [animationName] - The name of the animation to set on this Skeleton. - * @param {boolean} [loop=false] - Should the animation playback be looped or not? - * - * @return {SpineGameObject} The Game Object that was created. - */ - -/** - * Creates a new Spine Game Object from the given configuration file and optionally adds it to the Scene. - * - * The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from - * skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects - * do not have a Phaser origin. - * - * If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period - * character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains - * multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference - * that. - * - * ```javascript - * let jelly = this.make.spine({ - * x: 500, y: 500, key: 'jelly', - * scale: 1.5, - * skinName: 'square_Green', - * animationName: 'jelly-idle', loop: true, - * slotName: 'hat', attachmentName: 'images/La_14' - * }); - * ``` - * - * @method SpinePlugin#make - * @since 3.19.0 - * - * @param {any} config - The configuration object this Game Object will use to create itself. - * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - * - * @return {SpineGameObject} The Game Object that was created. - */ - -module.exports = SpinePlugin; - - -/***/ }), -/* 70 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BlendModes = __webpack_require__(15); -var GetAdvancedValue = __webpack_require__(71); - -/** - * Builds a Game Object using the provided configuration object. - * - * @function Phaser.GameObjects.BuildGameObject - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene. - * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject. - * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with. - * - * @return {Phaser.GameObjects.GameObject} The built Game Object. - */ -var BuildGameObject = function (scene, gameObject, config) -{ - // Position - - gameObject.x = GetAdvancedValue(config, 'x', 0); - gameObject.y = GetAdvancedValue(config, 'y', 0); - gameObject.depth = GetAdvancedValue(config, 'depth', 0); - - // Flip - - gameObject.flipX = GetAdvancedValue(config, 'flipX', false); - gameObject.flipY = GetAdvancedValue(config, 'flipY', false); - - // Scale - // Either: { scale: 2 } or { scale: { x: 2, y: 2 }} - - var scale = GetAdvancedValue(config, 'scale', null); - - if (typeof scale === 'number') - { - gameObject.setScale(scale); - } - else if (scale !== null) - { - gameObject.scaleX = GetAdvancedValue(scale, 'x', 1); - gameObject.scaleY = GetAdvancedValue(scale, 'y', 1); - } - - // ScrollFactor - // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }} - - var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null); - - if (typeof scrollFactor === 'number') - { - gameObject.setScrollFactor(scrollFactor); - } - else if (scrollFactor !== null) - { - gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1); - gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1); - } - - // Rotation - - gameObject.rotation = GetAdvancedValue(config, 'rotation', 0); - - var angle = GetAdvancedValue(config, 'angle', null); - - if (angle !== null) - { - gameObject.angle = angle; - } - - // Alpha - - gameObject.alpha = GetAdvancedValue(config, 'alpha', 1); - - // Origin - // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }} - - var origin = GetAdvancedValue(config, 'origin', null); - - if (typeof origin === 'number') - { - gameObject.setOrigin(origin); - } - else if (origin !== null) - { - var ox = GetAdvancedValue(origin, 'x', 0.5); - var oy = GetAdvancedValue(origin, 'y', 0.5); - - gameObject.setOrigin(ox, oy); - } - - // BlendMode - - gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL); - - // Visible - - gameObject.visible = GetAdvancedValue(config, 'visible', true); - - // Add to Scene - - var add = GetAdvancedValue(config, 'add', true); - - if (add) - { - scene.sys.displayList.add(gameObject); - } - - if (gameObject.preUpdate) - { - scene.sys.updateList.add(gameObject); - } - - return gameObject; -}; - -module.exports = BuildGameObject; - - -/***/ }), -/* 71 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MATH = __webpack_require__(72); -var GetValue = __webpack_require__(10); - -/** - * Retrieves a value from an object. Allows for more advanced selection options, including: - * - * Allowed types: - * - * Implicit - * { - * x: 4 - * } - * - * From function - * { - * x: function () - * } - * - * Randomly pick one element from the array - * { - * x: [a, b, c, d, e, f] - * } - * - * Random integer between min and max: - * { - * x: { randInt: [min, max] } - * } - * - * Random float between min and max: - * { - * x: { randFloat: [min, max] } - * } - * - * - * @function Phaser.Utils.Objects.GetAdvancedValue - * @since 3.0.0 - * - * @param {object} source - The object to retrieve the value from. - * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. - * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. - * - * @return {*} The value of the requested key. - */ -var GetAdvancedValue = function (source, key, defaultValue) -{ - var value = GetValue(source, key, null); - - if (value === null) - { - return defaultValue; - } - else if (Array.isArray(value)) - { - return MATH.RND.pick(value); - } - else if (typeof value === 'object') - { - if (value.hasOwnProperty('randInt')) - { - return MATH.RND.integerInRange(value.randInt[0], value.randInt[1]); - } - else if (value.hasOwnProperty('randFloat')) - { - return MATH.RND.realInRange(value.randFloat[0], value.randFloat[1]); - } - } - else if (typeof value === 'function') - { - return value(key); - } - - return value; -}; - -module.exports = GetAdvancedValue; - - -/***/ }), -/* 72 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(4); -var Extend = __webpack_require__(19); - -/** - * @namespace Phaser.Math - */ - -var PhaserMath = { - - // Collections of functions - Angle: __webpack_require__(73), - Distance: __webpack_require__(82), - Easing: __webpack_require__(90), - Fuzzy: __webpack_require__(135), - Interpolation: __webpack_require__(140), - Pow2: __webpack_require__(148), - Snap: __webpack_require__(152), - - // Expose the RNG Class - RandomDataGenerator: __webpack_require__(156), - - // Single functions - Average: __webpack_require__(157), - Bernstein: __webpack_require__(36), - Between: __webpack_require__(158), - CatmullRom: __webpack_require__(38), - CeilTo: __webpack_require__(159), - Clamp: __webpack_require__(1), - DegToRad: __webpack_require__(21), - Difference: __webpack_require__(160), - Euler: __webpack_require__(161), - Factorial: __webpack_require__(37), - FloatBetween: __webpack_require__(20), - FloorTo: __webpack_require__(162), - FromPercent: __webpack_require__(163), - GetSpeed: __webpack_require__(164), - IsEven: __webpack_require__(165), - IsEvenStrict: __webpack_require__(166), - Linear: __webpack_require__(39), - LinearXY: __webpack_require__(167), - MaxAdd: __webpack_require__(168), - Median: __webpack_require__(169), - MinSub: __webpack_require__(170), - Percent: __webpack_require__(171), - RadToDeg: __webpack_require__(9), - RandomXY: __webpack_require__(172), - RandomXYZ: __webpack_require__(173), - RandomXYZW: __webpack_require__(174), - Rotate: __webpack_require__(175), - RotateAround: __webpack_require__(42), - RotateAroundDistance: __webpack_require__(176), - RotateTo: __webpack_require__(177), - RoundAwayFromZero: __webpack_require__(43), - RoundTo: __webpack_require__(178), - SinCosTableGenerator: __webpack_require__(179), - SmootherStep: __webpack_require__(41), - SmoothStep: __webpack_require__(40), - ToXY: __webpack_require__(180), - TransformXY: __webpack_require__(44), - Within: __webpack_require__(181), - Wrap: __webpack_require__(6), - - // Vector classes - Vector2: __webpack_require__(3), - Vector3: __webpack_require__(16), - Vector4: __webpack_require__(182), - Matrix3: __webpack_require__(45), - Matrix4: __webpack_require__(22), - Quaternion: __webpack_require__(46), - RotateVec3: __webpack_require__(183) - -}; - -// Merge in the consts - -PhaserMath = Extend(false, PhaserMath, CONST); - -// Export it - -module.exports = PhaserMath; - - -/***/ }), -/* 73 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Angle - */ - -module.exports = { - - Between: __webpack_require__(31), - BetweenPoints: __webpack_require__(74), - BetweenPointsY: __webpack_require__(75), - BetweenY: __webpack_require__(76), - CounterClockwise: __webpack_require__(8), - Normalize: __webpack_require__(32), - Random: __webpack_require__(77), - RandomDegrees: __webpack_require__(78), - Reverse: __webpack_require__(79), - RotateTo: __webpack_require__(80), - ShortestBetween: __webpack_require__(81), - Wrap: __webpack_require__(33), - WrapDegrees: __webpack_require__(34) - -}; - - -/***/ }), -/* 74 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). - * - * Calculates the angle of the vector from the first point to the second point. - * - * @function Phaser.Math.Angle.BetweenPoints - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} point1 - The first point. - * @param {Phaser.Types.Math.Vector2Like} point2 - The second point. - * - * @return {number} The angle in radians. - */ -var BetweenPoints = function (point1, point2) -{ - return Math.atan2(point2.y - point1.y, point2.x - point1.x); -}; - -module.exports = BetweenPoints; - - -/***/ }), -/* 75 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). - * - * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate - * travels down the screen. - * - * @function Phaser.Math.Angle.BetweenPointsY - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} point1 - The first point. - * @param {Phaser.Types.Math.Vector2Like} point2 - The second point. - * - * @return {number} The angle in radians. - */ -var BetweenPointsY = function (point1, point2) -{ - return Math.atan2(point2.x - point1.x, point2.y - point1.y); -}; - -module.exports = BetweenPointsY; - - -/***/ }), -/* 76 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Find the angle of a segment from (x1, y1) -> (x2, y2). - * - * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate - * travels down the screen. - * - * @function Phaser.Math.Angle.BetweenY - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The angle in radians. - */ -var BetweenY = function (x1, y1, x2, y2) -{ - return Math.atan2(x2 - x1, y2 - y1); -}; - -module.exports = BetweenY; - - -/***/ }), -/* 77 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var FloatBetween = __webpack_require__(20); - -/** - * Returns a random angle in the range [-pi, pi]. - * - * @function Phaser.Math.Angle.Random - * @since 3.23.0 - * - * @return {number} The angle, in radians. - */ -var Random = function () -{ - return FloatBetween(-Math.PI, Math.PI); -}; - -module.exports = Random; - - -/***/ }), -/* 78 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var FloatBetween = __webpack_require__(20); - -/** - * Returns a random angle in the range [-180, 180]. - * - * @function Phaser.Math.Angle.RandomDegrees - * @since 3.23.0 - * - * @return {number} The angle, in degrees. - */ -var RandomDegrees = function () -{ - return FloatBetween(-180, 180); -}; - -module.exports = RandomDegrees; - - -/***/ }), -/* 79 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Normalize = __webpack_require__(32); - -/** - * Reverse the given angle. - * - * @function Phaser.Math.Angle.Reverse - * @since 3.0.0 - * - * @param {number} angle - The angle to reverse, in radians. - * - * @return {number} The reversed angle, in radians. - */ -var Reverse = function (angle) -{ - return Normalize(angle + Math.PI); -}; - -module.exports = Reverse; - - -/***/ }), -/* 80 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MATH_CONST = __webpack_require__(4); - -/** - * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. - * - * @function Phaser.Math.Angle.RotateTo - * @since 3.0.0 - * - * @param {number} currentAngle - The current angle, in radians. - * @param {number} targetAngle - The target angle to rotate to, in radians. - * @param {number} [lerp=0.05] - The lerp value to add to the current angle. - * - * @return {number} The adjusted angle. - */ -var RotateTo = function (currentAngle, targetAngle, lerp) -{ - if (lerp === undefined) { lerp = 0.05; } - - if (currentAngle === targetAngle) - { - return currentAngle; - } - - if (Math.abs(targetAngle - currentAngle) <= lerp || Math.abs(targetAngle - currentAngle) >= (MATH_CONST.PI2 - lerp)) - { - currentAngle = targetAngle; - } - else - { - if (Math.abs(targetAngle - currentAngle) > Math.PI) - { - if (targetAngle < currentAngle) - { - targetAngle += MATH_CONST.PI2; - } - else - { - targetAngle -= MATH_CONST.PI2; - } - } - - if (targetAngle > currentAngle) - { - currentAngle += lerp; - } - else if (targetAngle < currentAngle) - { - currentAngle -= lerp; - } - } - - return currentAngle; -}; - -module.exports = RotateTo; - - -/***/ }), -/* 81 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Gets the shortest angle between `angle1` and `angle2`. - * - * Both angles must be in the range -180 to 180, which is the same clamped - * range that `sprite.angle` uses, so you can pass in two sprite angles to - * this method and get the shortest angle back between the two of them. - * - * The angle returned will be in the same range. If the returned angle is - * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's - * a clockwise rotation. - * - * @function Phaser.Math.Angle.ShortestBetween - * @since 3.0.0 - * - * @param {number} angle1 - The first angle in the range -180 to 180. - * @param {number} angle2 - The second angle in the range -180 to 180. - * - * @return {number} The shortest angle, in degrees. If greater than zero it's a counter-clockwise rotation. - */ -var ShortestBetween = function (angle1, angle2) -{ - var difference = angle2 - angle1; - - if (difference === 0) - { - return 0; - } - - var times = Math.floor((difference - (-180)) / 360); - - return difference - (times * 360); - -}; - -module.exports = ShortestBetween; - - -/***/ }), -/* 82 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Distance - */ - -module.exports = { - - Between: __webpack_require__(83), - BetweenPoints: __webpack_require__(84), - BetweenPointsSquared: __webpack_require__(85), - Chebyshev: __webpack_require__(86), - Power: __webpack_require__(87), - Snake: __webpack_require__(88), - Squared: __webpack_require__(89) - -}; - - -/***/ }), -/* 83 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the distance between two sets of coordinates (points). - * - * @function Phaser.Math.Distance.Between - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The distance between each point. - */ -var DistanceBetween = function (x1, y1, x2, y2) -{ - var dx = x1 - x2; - var dy = y1 - y2; - - return Math.sqrt(dx * dx + dy * dy); -}; - -module.exports = DistanceBetween; - - -/***/ }), -/* 84 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the distance between two points. - * - * @function Phaser.Math.Distance.BetweenPoints - * @since 3.22.0 - * - * @param {Phaser.Types.Math.Vector2Like} a - The first point. - * @param {Phaser.Types.Math.Vector2Like} b - The second point. - * - * @return {number} The distance between the points. - */ -var DistanceBetweenPoints = function (a, b) -{ - var dx = a.x - b.x; - var dy = a.y - b.y; - - return Math.sqrt(dx * dx + dy * dy); -}; - -module.exports = DistanceBetweenPoints; - - -/***/ }), -/* 85 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the squared distance between two points. - * - * @function Phaser.Math.Distance.BetweenPointsSquared - * @since 3.22.0 - * - * @param {Phaser.Types.Math.Vector2Like} a - The first point. - * @param {Phaser.Types.Math.Vector2Like} b - The second point. - * - * @return {number} The squared distance between the points. - */ -var DistanceBetweenPointsSquared = function (a, b) -{ - var dx = a.x - b.x; - var dy = a.y - b.y; - - return dx * dx + dy * dy; -}; - -module.exports = DistanceBetweenPointsSquared; - - -/***/ }), -/* 86 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the Chebyshev distance between two sets of coordinates (points). - * - * Chebyshev distance (or chessboard distance) is the maximum of the horizontal and vertical distances. - * It's the effective distance when movement can be horizontal, vertical, or diagonal. - * - * @function Phaser.Math.Distance.Chebyshev - * @since 3.22.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The distance between each point. - */ -var ChebyshevDistance = function (x1, y1, x2, y2) -{ - return Math.max(Math.abs(x1 - x2), Math.abs(y1 - y2)); -}; - -module.exports = ChebyshevDistance; - - -/***/ }), -/* 87 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the distance between two sets of coordinates (points) to the power of `pow`. - * - * @function Phaser.Math.Distance.Power - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * @param {number} pow - The exponent. - * - * @return {number} The distance between each point. - */ -var DistancePower = function (x1, y1, x2, y2, pow) -{ - if (pow === undefined) { pow = 2; } - - return Math.sqrt(Math.pow(x2 - x1, pow) + Math.pow(y2 - y1, pow)); -}; - -module.exports = DistancePower; - - -/***/ }), -/* 88 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the snake distance between two sets of coordinates (points). - * - * Snake distance (rectilinear distance, Manhattan distance) is the sum of the horizontal and vertical distances. - * It's the effective distance when movement is allowed only horizontally or vertically (but not both). - * - * @function Phaser.Math.Distance.Snake - * @since 3.22.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The distance between each point. - */ -var SnakeDistance = function (x1, y1, x2, y2) -{ - return Math.abs(x1 - x2) + Math.abs(y1 - y2); -}; - -module.exports = SnakeDistance; - - -/***/ }), -/* 89 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the distance between two sets of coordinates (points), squared. - * - * @function Phaser.Math.Distance.Squared - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The distance between each point, squared. - */ -var DistanceSquared = function (x1, y1, x2, y2) -{ - var dx = x1 - x2; - var dy = y1 - y2; - - return dx * dx + dy * dy; -}; - -module.exports = DistanceSquared; - - -/***/ }), -/* 90 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing - */ - -module.exports = { - - Back: __webpack_require__(91), - Bounce: __webpack_require__(95), - Circular: __webpack_require__(99), - Cubic: __webpack_require__(103), - Elastic: __webpack_require__(107), - Expo: __webpack_require__(111), - Linear: __webpack_require__(115), - Quadratic: __webpack_require__(117), - Quartic: __webpack_require__(121), - Quintic: __webpack_require__(125), - Sine: __webpack_require__(129), - Stepped: __webpack_require__(133) - -}; - - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Back - */ - -module.exports = { - - In: __webpack_require__(92), - Out: __webpack_require__(93), - InOut: __webpack_require__(94) - -}; - - -/***/ }), -/* 92 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Back ease-in. - * - * @function Phaser.Math.Easing.Back.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [overshoot=1.70158] - The overshoot amount. - * - * @return {number} The tweened value. - */ -var In = function (v, overshoot) -{ - if (overshoot === undefined) { overshoot = 1.70158; } - - return v * v * ((overshoot + 1) * v - overshoot); -}; - -module.exports = In; - - -/***/ }), -/* 93 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Back ease-out. - * - * @function Phaser.Math.Easing.Back.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [overshoot=1.70158] - The overshoot amount. - * - * @return {number} The tweened value. - */ -var Out = function (v, overshoot) -{ - if (overshoot === undefined) { overshoot = 1.70158; } - - return --v * v * ((overshoot + 1) * v + overshoot) + 1; -}; - -module.exports = Out; - - -/***/ }), -/* 94 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Back ease-in/out. - * - * @function Phaser.Math.Easing.Back.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [overshoot=1.70158] - The overshoot amount. - * - * @return {number} The tweened value. - */ -var InOut = function (v, overshoot) -{ - if (overshoot === undefined) { overshoot = 1.70158; } - - var s = overshoot * 1.525; - - if ((v *= 2) < 1) - { - return 0.5 * (v * v * ((s + 1) * v - s)); - } - else - { - return 0.5 * ((v -= 2) * v * ((s + 1) * v + s) + 2); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 95 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Bounce - */ - -module.exports = { - - In: __webpack_require__(96), - Out: __webpack_require__(97), - InOut: __webpack_require__(98) - -}; - - -/***/ }), -/* 96 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Bounce ease-in. - * - * @function Phaser.Math.Easing.Bounce.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - v = 1 - v; - - if (v < 1 / 2.75) - { - return 1 - (7.5625 * v * v); - } - else if (v < 2 / 2.75) - { - return 1 - (7.5625 * (v -= 1.5 / 2.75) * v + 0.75); - } - else if (v < 2.5 / 2.75) - { - return 1 - (7.5625 * (v -= 2.25 / 2.75) * v + 0.9375); - } - else - { - return 1 - (7.5625 * (v -= 2.625 / 2.75) * v + 0.984375); - } -}; - -module.exports = In; - - -/***/ }), -/* 97 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Bounce ease-out. - * - * @function Phaser.Math.Easing.Bounce.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - if (v < 1 / 2.75) - { - return 7.5625 * v * v; - } - else if (v < 2 / 2.75) - { - return 7.5625 * (v -= 1.5 / 2.75) * v + 0.75; - } - else if (v < 2.5 / 2.75) - { - return 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375; - } - else - { - return 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375; - } -}; - -module.exports = Out; - - -/***/ }), -/* 98 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Bounce ease-in/out. - * - * @function Phaser.Math.Easing.Bounce.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - var reverse = false; - - if (v < 0.5) - { - v = 1 - (v * 2); - reverse = true; - } - else - { - v = (v * 2) - 1; - } - - if (v < 1 / 2.75) - { - v = 7.5625 * v * v; - } - else if (v < 2 / 2.75) - { - v = 7.5625 * (v -= 1.5 / 2.75) * v + 0.75; - } - else if (v < 2.5 / 2.75) - { - v = 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375; - } - else - { - v = 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375; - } - - if (reverse) - { - return (1 - v) * 0.5; - } - else - { - return v * 0.5 + 0.5; - } -}; - -module.exports = InOut; - - -/***/ }), -/* 99 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Circular - */ - -module.exports = { - - In: __webpack_require__(100), - Out: __webpack_require__(101), - InOut: __webpack_require__(102) - -}; - - -/***/ }), -/* 100 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Circular ease-in. - * - * @function Phaser.Math.Easing.Circular.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return 1 - Math.sqrt(1 - v * v); -}; - -module.exports = In; - - -/***/ }), -/* 101 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Circular ease-out. - * - * @function Phaser.Math.Easing.Circular.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return Math.sqrt(1 - (--v * v)); -}; - -module.exports = Out; - - -/***/ }), -/* 102 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Circular ease-in/out. - * - * @function Phaser.Math.Easing.Circular.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return -0.5 * (Math.sqrt(1 - v * v) - 1); - } - else - { - return 0.5 * (Math.sqrt(1 - (v -= 2) * v) + 1); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 103 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Cubic - */ - -module.exports = { - - In: __webpack_require__(104), - Out: __webpack_require__(105), - InOut: __webpack_require__(106) - -}; - - -/***/ }), -/* 104 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Cubic ease-in. - * - * @function Phaser.Math.Easing.Cubic.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return v * v * v; -}; - -module.exports = In; - - -/***/ }), -/* 105 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Cubic ease-out. - * - * @function Phaser.Math.Easing.Cubic.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return --v * v * v + 1; -}; - -module.exports = Out; - - -/***/ }), -/* 106 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Cubic ease-in/out. - * - * @function Phaser.Math.Easing.Cubic.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return 0.5 * v * v * v; - } - else - { - return 0.5 * ((v -= 2) * v * v + 2); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 107 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Elastic - */ - -module.exports = { - - In: __webpack_require__(108), - Out: __webpack_require__(109), - InOut: __webpack_require__(110) - -}; - - -/***/ }), -/* 108 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Elastic ease-in. - * - * @function Phaser.Math.Easing.Elastic.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. - * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. - * - * @return {number} The tweened value. - */ -var In = function (v, amplitude, period) -{ - if (amplitude === undefined) { amplitude = 0.1; } - if (period === undefined) { period = 0.1; } - - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - var s = period / 4; - - if (amplitude < 1) - { - amplitude = 1; - } - else - { - s = period * Math.asin(1 / amplitude) / (2 * Math.PI); - } - - return -(amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period)); - } -}; - -module.exports = In; - - -/***/ }), -/* 109 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Elastic ease-out. - * - * @function Phaser.Math.Easing.Elastic.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. - * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. - * - * @return {number} The tweened value. - */ -var Out = function (v, amplitude, period) -{ - if (amplitude === undefined) { amplitude = 0.1; } - if (period === undefined) { period = 0.1; } - - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - var s = period / 4; - - if (amplitude < 1) - { - amplitude = 1; - } - else - { - s = period * Math.asin(1 / amplitude) / (2 * Math.PI); - } - - return (amplitude * Math.pow(2, -10 * v) * Math.sin((v - s) * (2 * Math.PI) / period) + 1); - } -}; - -module.exports = Out; - - -/***/ }), -/* 110 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Elastic ease-in/out. - * - * @function Phaser.Math.Easing.Elastic.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. - * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. - * - * @return {number} The tweened value. - */ -var InOut = function (v, amplitude, period) -{ - if (amplitude === undefined) { amplitude = 0.1; } - if (period === undefined) { period = 0.1; } - - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - var s = period / 4; - - if (amplitude < 1) - { - amplitude = 1; - } - else - { - s = period * Math.asin(1 / amplitude) / (2 * Math.PI); - } - - if ((v *= 2) < 1) - { - return -0.5 * (amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period)); - } - else - { - return amplitude * Math.pow(2, -10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period) * 0.5 + 1; - } - } -}; - -module.exports = InOut; - - -/***/ }), -/* 111 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Expo - */ - -module.exports = { - - In: __webpack_require__(112), - Out: __webpack_require__(113), - InOut: __webpack_require__(114) - -}; - - -/***/ }), -/* 112 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Exponential ease-in. - * - * @function Phaser.Math.Easing.Expo.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return Math.pow(2, 10 * (v - 1)) - 0.001; -}; - -module.exports = In; - - -/***/ }), -/* 113 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Exponential ease-out. - * - * @function Phaser.Math.Easing.Expo.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return 1 - Math.pow(2, -10 * v); -}; - -module.exports = Out; - - -/***/ }), -/* 114 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Exponential ease-in/out. - * - * @function Phaser.Math.Easing.Expo.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return 0.5 * Math.pow(2, 10 * (v - 1)); - } - else - { - return 0.5 * (2 - Math.pow(2, -10 * (v - 1))); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -module.exports = __webpack_require__(116); - - -/***/ }), -/* 116 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Linear easing (no variation). - * - * @function Phaser.Math.Easing.Linear - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Linear = function (v) -{ - return v; -}; - -module.exports = Linear; - - -/***/ }), -/* 117 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Quadratic - */ - -module.exports = { - - In: __webpack_require__(118), - Out: __webpack_require__(119), - InOut: __webpack_require__(120) - -}; - - -/***/ }), -/* 118 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quadratic ease-in. - * - * @function Phaser.Math.Easing.Quadratic.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return v * v; -}; - -module.exports = In; - - -/***/ }), -/* 119 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quadratic ease-out. - * - * @function Phaser.Math.Easing.Quadratic.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return v * (2 - v); -}; - -module.exports = Out; - - -/***/ }), -/* 120 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quadratic ease-in/out. - * - * @function Phaser.Math.Easing.Quadratic.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return 0.5 * v * v; - } - else - { - return -0.5 * (--v * (v - 2) - 1); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 121 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Quartic - */ - -module.exports = { - - In: __webpack_require__(122), - Out: __webpack_require__(123), - InOut: __webpack_require__(124) - -}; - - -/***/ }), -/* 122 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quartic ease-in. - * - * @function Phaser.Math.Easing.Quartic.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return v * v * v * v; -}; - -module.exports = In; - - -/***/ }), -/* 123 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quartic ease-out. - * - * @function Phaser.Math.Easing.Quartic.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return 1 - (--v * v * v * v); -}; - -module.exports = Out; - - -/***/ }), -/* 124 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quartic ease-in/out. - * - * @function Phaser.Math.Easing.Quartic.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return 0.5 * v * v * v * v; - } - else - { - return -0.5 * ((v -= 2) * v * v * v - 2); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Quintic - */ - -module.exports = { - - In: __webpack_require__(126), - Out: __webpack_require__(127), - InOut: __webpack_require__(128) - -}; - - -/***/ }), -/* 126 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quintic ease-in. - * - * @function Phaser.Math.Easing.Quintic.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return v * v * v * v * v; -}; - -module.exports = In; - - -/***/ }), -/* 127 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quintic ease-out. - * - * @function Phaser.Math.Easing.Quintic.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return --v * v * v * v * v + 1; -}; - -module.exports = Out; - - -/***/ }), -/* 128 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quintic ease-in/out. - * - * @function Phaser.Math.Easing.Quintic.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return 0.5 * v * v * v * v * v; - } - else - { - return 0.5 * ((v -= 2) * v * v * v * v + 2); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 129 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Sine - */ - -module.exports = { - - In: __webpack_require__(130), - Out: __webpack_require__(131), - InOut: __webpack_require__(132) - -}; - - -/***/ }), -/* 130 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Sinusoidal ease-in. - * - * @function Phaser.Math.Easing.Sine.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - return 1 - Math.cos(v * Math.PI / 2); - } -}; - -module.exports = In; - - -/***/ }), -/* 131 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Sinusoidal ease-out. - * - * @function Phaser.Math.Easing.Sine.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - return Math.sin(v * Math.PI / 2); - } -}; - -module.exports = Out; - - -/***/ }), -/* 132 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Sinusoidal ease-in/out. - * - * @function Phaser.Math.Easing.Sine.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - return 0.5 * (1 - Math.cos(Math.PI * v)); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 133 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Stepped - */ - -module.exports = __webpack_require__(134); - - -/***/ }), -/* 134 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Stepped easing. - * - * @function Phaser.Math.Easing.Stepped - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [steps=1] - The number of steps in the ease. - * - * @return {number} The tweened value. - */ -var Stepped = function (v, steps) -{ - if (steps === undefined) { steps = 1; } - - if (v <= 0) - { - return 0; - } - else if (v >= 1) - { - return 1; - } - else - { - return (((steps * v) | 0) + 1) * (1 / steps); - } -}; - -module.exports = Stepped; - - -/***/ }), -/* 135 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Fuzzy - */ - -module.exports = { - - Ceil: __webpack_require__(136), - Equal: __webpack_require__(35), - Floor: __webpack_require__(137), - GreaterThan: __webpack_require__(138), - LessThan: __webpack_require__(139) - -}; - - -/***/ }), -/* 136 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the fuzzy ceiling of the given value. - * - * @function Phaser.Math.Fuzzy.Ceil - * @since 3.0.0 - * - * @param {number} value - The value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {number} The fuzzy ceiling of the value. - */ -var Ceil = function (value, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return Math.ceil(value - epsilon); -}; - -module.exports = Ceil; - - -/***/ }), -/* 137 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the fuzzy floor of the given value. - * - * @function Phaser.Math.Fuzzy.Floor - * @since 3.0.0 - * - * @param {number} value - The value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {number} The floor of the value. - */ -var Floor = function (value, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return Math.floor(value + epsilon); -}; - -module.exports = Floor; - - -/***/ }), -/* 138 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check whether `a` is fuzzily greater than `b`. - * - * `a` is fuzzily greater than `b` if it is more than `b - epsilon`. - * - * @function Phaser.Math.Fuzzy.GreaterThan - * @since 3.0.0 - * - * @param {number} a - The first value. - * @param {number} b - The second value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {boolean} `true` if `a` is fuzzily greater than than `b`, otherwise `false`. - */ -var GreaterThan = function (a, b, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return a > b - epsilon; -}; - -module.exports = GreaterThan; - - -/***/ }), -/* 139 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check whether `a` is fuzzily less than `b`. - * - * `a` is fuzzily less than `b` if it is less than `b + epsilon`. - * - * @function Phaser.Math.Fuzzy.LessThan - * @since 3.0.0 - * - * @param {number} a - The first value. - * @param {number} b - The second value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {boolean} `true` if `a` is fuzzily less than `b`, otherwise `false`. - */ -var LessThan = function (a, b, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return a < b + epsilon; -}; - -module.exports = LessThan; - - -/***/ }), -/* 140 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Interpolation - */ - -module.exports = { - - Bezier: __webpack_require__(141), - CatmullRom: __webpack_require__(142), - CubicBezier: __webpack_require__(143), - Linear: __webpack_require__(144), - QuadraticBezier: __webpack_require__(145), - SmoothStep: __webpack_require__(146), - SmootherStep: __webpack_require__(147) - -}; - - -/***/ }), -/* 141 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Bernstein = __webpack_require__(36); - -/** - * A bezier interpolation method. - * - * @function Phaser.Math.Interpolation.Bezier - * @since 3.0.0 - * - * @param {number[]} v - The input array of values to interpolate between. - * @param {number} k - The percentage of interpolation, between 0 and 1. - * - * @return {number} The interpolated value. - */ -var BezierInterpolation = function (v, k) -{ - var b = 0; - var n = v.length - 1; - - for (var i = 0; i <= n; i++) - { - b += Math.pow(1 - k, n - i) * Math.pow(k, i) * v[i] * Bernstein(n, i); - } - - return b; -}; - -module.exports = BezierInterpolation; - - -/***/ }), -/* 142 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CatmullRom = __webpack_require__(38); - -/** - * A Catmull-Rom interpolation method. - * - * @function Phaser.Math.Interpolation.CatmullRom - * @since 3.0.0 - * - * @param {number[]} v - The input array of values to interpolate between. - * @param {number} k - The percentage of interpolation, between 0 and 1. - * - * @return {number} The interpolated value. - */ -var CatmullRomInterpolation = function (v, k) -{ - var m = v.length - 1; - var f = m * k; - var i = Math.floor(f); - - if (v[0] === v[m]) - { - if (k < 0) - { - i = Math.floor(f = m * (1 + k)); - } - - return CatmullRom(f - i, v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m]); - } - else - { - if (k < 0) - { - return v[0] - (CatmullRom(-f, v[0], v[0], v[1], v[1]) - v[0]); - } - - if (k > 1) - { - return v[m] - (CatmullRom(f - m, v[m], v[m], v[m - 1], v[m - 1]) - v[m]); - } - - return CatmullRom(f - i, v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2]); - } -}; - -module.exports = CatmullRomInterpolation; - - -/***/ }), -/* 143 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @ignore + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private */ -function P0 (t, p) -{ - var k = 1 - t; - - return k * k * k * p; +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; } /** - * @ignore - */ -function P1 (t, p) -{ - var k = 1 - t; - - return 3 * k * k * t * p; -} - -/** - * @ignore - */ -function P2 (t, p) -{ - return 3 * (1 - t) * t * t * p; -} - -/** - * @ignore - */ -function P3 (t, p) -{ - return t * t * t * p; -} - -/** - * A cubic bezier interpolation method. + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. * - * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a - * - * @function Phaser.Math.Interpolation.CubicBezier - * @since 3.0.0 - * - * @param {number} t - The percentage of interpolation, between 0 and 1. - * @param {number} p0 - The start point. - * @param {number} p1 - The first control point. - * @param {number} p2 - The second control point. - * @param {number} p3 - The end point. - * - * @return {number} The interpolated value. - */ -var CubicBezierInterpolation = function (t, p0, p1, p2, p3) -{ - return P0(t, p0) + P1(t, p1) + P2(t, p2) + P3(t, p3); -}; - -module.exports = CubicBezierInterpolation; - - -/***/ }), -/* 144 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Linear = __webpack_require__(39); - -/** - * A linear interpolation method. - * - * @function Phaser.Math.Interpolation.Linear - * @since 3.0.0 - * @see {@link https://en.wikipedia.org/wiki/Linear_interpolation} - * - * @param {number[]} v - The input array of values to interpolate between. - * @param {!number} k - The percentage of interpolation, between 0 and 1. - * - * @return {!number} The interpolated value. - */ -var LinearInterpolation = function (v, k) -{ - var m = v.length - 1; - var f = m * k; - var i = Math.floor(f); - - if (k < 0) - { - return Linear(v[0], v[1], f); - } - else if (k > 1) - { - return Linear(v[m], v[m - 1], m - f); - } - else - { - return Linear(v[i], v[(i + 1 > m) ? m : i + 1], f - i); - } -}; - -module.exports = LinearInterpolation; - - -/***/ }), -/* 145 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @ignore - */ -function P0 (t, p) -{ - var k = 1 - t; - - return k * k * p; -} - -/** - * @ignore - */ -function P1 (t, p) -{ - return 2 * (1 - t) * t * p; -} - -/** - * @ignore - */ -function P2 (t, p) -{ - return t * t * p; -} - -// https://github.com/mrdoob/three.js/blob/master/src/extras/core/Interpolations.js - -/** - * A quadratic bezier interpolation method. - * - * @function Phaser.Math.Interpolation.QuadraticBezier - * @since 3.2.0 - * - * @param {number} t - The percentage of interpolation, between 0 and 1. - * @param {number} p0 - The start point. - * @param {number} p1 - The control point. - * @param {number} p2 - The end point. - * - * @return {number} The interpolated value. - */ -var QuadraticBezierInterpolation = function (t, p0, p1, p2) -{ - return P0(t, p0) + P1(t, p1) + P2(t, p2); -}; - -module.exports = QuadraticBezierInterpolation; - - -/***/ }), -/* 146 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SmoothStep = __webpack_require__(40); - -/** - * A Smooth Step interpolation method. - * - * @function Phaser.Math.Interpolation.SmoothStep - * @since 3.9.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep} - * - * @param {number} t - The percentage of interpolation, between 0 and 1. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The interpolated value. - */ -var SmoothStepInterpolation = function (t, min, max) -{ - return min + (max - min) * SmoothStep(t, 0, 1); -}; - -module.exports = SmoothStepInterpolation; - - -/***/ }), -/* 147 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SmootherStep = __webpack_require__(41); - -/** - * A Smoother Step interpolation method. - * - * @function Phaser.Math.Interpolation.SmootherStep - * @since 3.9.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} - * - * @param {number} t - The percentage of interpolation, between 0 and 1. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The interpolated value. - */ -var SmootherStepInterpolation = function (t, min, max) -{ - return min + (max - min) * SmootherStep(t, 0, 1); -}; - -module.exports = SmootherStepInterpolation; - - -/***/ }), -/* 148 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Pow2 - */ - -module.exports = { - - GetNext: __webpack_require__(149), - IsSize: __webpack_require__(150), - IsValue: __webpack_require__(151) - -}; - - -/***/ }), -/* 149 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Returns the nearest power of 2 to the given `value`. - * - * @function Phaser.Math.Pow2.GetNext - * @since 3.0.0 - * - * @param {number} value - The value. - * - * @return {number} The nearest power of 2 to `value`. - */ -var GetPowerOfTwo = function (value) -{ - var index = Math.log(value) / 0.6931471805599453; - - return (1 << Math.ceil(index)); -}; - -module.exports = GetPowerOfTwo; - - -/***/ }), -/* 150 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if the given `width` and `height` are a power of two. - * Useful for checking texture dimensions. - * - * @function Phaser.Math.Pow2.IsSize - * @since 3.0.0 - * - * @param {number} width - The width. - * @param {number} height - The height. - * - * @return {boolean} `true` if `width` and `height` are a power of two, otherwise `false`. - */ -var IsSizePowerOfTwo = function (width, height) -{ - return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0); -}; - -module.exports = IsSizePowerOfTwo; - - -/***/ }), -/* 151 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Tests the value and returns `true` if it is a power of two. - * - * @function Phaser.Math.Pow2.IsValue - * @since 3.0.0 - * - * @param {number} value - The value to check if it's a power of two. - * - * @return {boolean} Returns `true` if `value` is a power of two, otherwise `false`. - */ -var IsValuePowerOfTwo = function (value) -{ - return (value > 0 && (value & (value - 1)) === 0); -}; - -module.exports = IsValuePowerOfTwo; - - -/***/ }), -/* 152 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Snap - */ - -module.exports = { - - Ceil: __webpack_require__(153), - Floor: __webpack_require__(154), - To: __webpack_require__(155) - -}; - - -/***/ }), -/* 153 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Snap a value to nearest grid slice, using ceil. - * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`. - * As will `14` snap to `15`... but `16` will snap to `20`. - * - * @function Phaser.Math.Snap.Ceil - * @since 3.0.0 - * - * @param {number} value - The value to snap. - * @param {number} gap - The interval gap of the grid. - * @param {number} [start=0] - Optional starting offset for gap. - * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. - * - * @return {number} The snapped value. - */ -var SnapCeil = function (value, gap, start, divide) -{ - if (start === undefined) { start = 0; } - - if (gap === 0) - { - return value; - } - - value -= start; - value = gap * Math.ceil(value / gap); - - return (divide) ? (start + value) / gap : start + value; -}; - -module.exports = SnapCeil; - - -/***/ }), -/* 154 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Snap a value to nearest grid slice, using floor. - * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`. - * As will `14` snap to `10`... but `16` will snap to `15`. - * - * @function Phaser.Math.Snap.Floor - * @since 3.0.0 - * - * @param {number} value - The value to snap. - * @param {number} gap - The interval gap of the grid. - * @param {number} [start=0] - Optional starting offset for gap. - * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. - * - * @return {number} The snapped value. - */ -var SnapFloor = function (value, gap, start, divide) -{ - if (start === undefined) { start = 0; } - - if (gap === 0) - { - return value; - } - - value -= start; - value = gap * Math.floor(value / gap); - - return (divide) ? (start + value) / gap : start + value; -}; - -module.exports = SnapFloor; - - -/***/ }), -/* 155 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Snap a value to nearest grid slice, using rounding. - * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10` whereas `14` will snap to `15`. - * - * @function Phaser.Math.Snap.To - * @since 3.0.0 - * - * @param {number} value - The value to snap. - * @param {number} gap - The interval gap of the grid. - * @param {number} [start=0] - Optional starting offset for gap. - * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. - * - * @return {number} The snapped value. - */ -var SnapTo = function (value, gap, start, divide) -{ - if (start === undefined) { start = 0; } - - if (gap === 0) - { - return value; - } - - value -= start; - value = gap * Math.round(value / gap); - - return (divide) ? (start + value) / gap : start + value; -}; - -module.exports = SnapTo; - - -/***/ }), -/* 156 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A seeded Random Data Generator. - * - * Access via `Phaser.Math.RND` which is an instance of this class pre-defined - * by Phaser. Or, create your own instance to use as you require. - * - * The `Math.RND` generator is seeded by the Game Config property value `seed`. - * If no such config property exists, a random number is used. - * - * If you create your own instance of this class you should provide a seed for it. - * If no seed is given it will use a 'random' one based on Date.now. - * - * @class RandomDataGenerator - * @memberof Phaser.Math * @constructor - * @since 3.0.0 - * - * @param {(string|string[])} [seeds] - The seeds to use for the random number generator. + * @public */ -var RandomDataGenerator = new Class({ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} - initialize: +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; - function RandomDataGenerator (seeds) - { - if (seeds === undefined) { seeds = [ (Date.now() * Math.random()).toString() ]; } + if (this._eventsCount === 0) return names; - /** - * Internal var. - * - * @name Phaser.Math.RandomDataGenerator#c - * @type {number} - * @default 1 - * @private - * @since 3.0.0 - */ - this.c = 1; + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } - /** - * Internal var. - * - * @name Phaser.Math.RandomDataGenerator#s0 - * @type {number} - * @default 0 - * @private - * @since 3.0.0 - */ - this.s0 = 0; + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } - /** - * Internal var. - * - * @name Phaser.Math.RandomDataGenerator#s1 - * @type {number} - * @default 0 - * @private - * @since 3.0.0 - */ - this.s1 = 0; + return names; +}; - /** - * Internal var. - * - * @name Phaser.Math.RandomDataGenerator#s2 - * @type {number} - * @default 0 - * @private - * @since 3.0.0 - */ - this.s2 = 0; +/** + * Return the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public + */ +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; - /** - * Internal var. - * - * @name Phaser.Math.RandomDataGenerator#n - * @type {number} - * @default 0 - * @private - * @since 3.2.0 - */ - this.n = 0; + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; - /** - * Signs to choose from. - * - * @name Phaser.Math.RandomDataGenerator#signs - * @type {number[]} - * @since 3.0.0 - */ - this.signs = [ -1, 1 ]; + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } - if (seeds) - { - this.init(seeds); - } - }, + return ee; +}; - /** - * Private random helper. - * - * @method Phaser.Math.RandomDataGenerator#rnd - * @since 3.0.0 - * @private - * - * @return {number} A random number. - */ - rnd: function () - { - var t = 2091639 * this.s0 + this.c * 2.3283064365386963e-10; // 2^-32 +/** + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public + */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; - this.c = t | 0; - this.s0 = this.s1; - this.s1 = this.s2; - this.s2 = t - this.c; + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; +}; - return this.s2; - }, +/** + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; - /** - * Internal method that creates a seed hash. - * - * @method Phaser.Math.RandomDataGenerator#hash - * @since 3.0.0 - * @private - * - * @param {string} data - The value to hash. - * - * @return {number} The hashed value. - */ - hash: function (data) - { - var h; - var n = this.n; + if (!this._events[evt]) return false; - data = data.toString(); + var listeners = this._events[evt] + , len = arguments.length + , args + , i; - for (var i = 0; i < data.length; i++) - { - n += data.charCodeAt(i); - h = 0.02519603282416938 * n; - n = h >>> 0; - h -= n; - h *= n; - n = h >>> 0; - h -= n; - n += h * 0x100000000;// 2^32 - } + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); - this.n = n; - - return (n >>> 0) * 2.3283064365386963e-10;// 2^-32 - }, - - /** - * Initialize the state of the random data generator. - * - * @method Phaser.Math.RandomDataGenerator#init - * @since 3.0.0 - * - * @param {(string|string[])} seeds - The seeds to initialize the random data generator with. - */ - init: function (seeds) - { - if (typeof seeds === 'string') - { - this.state(seeds); - } - else - { - this.sow(seeds); - } - }, - - /** - * Reset the seed of the random data generator. - * - * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present. - * - * @method Phaser.Math.RandomDataGenerator#sow - * @since 3.0.0 - * - * @param {string[]} seeds - The array of seeds: the `toString()` of each value is used. - */ - sow: function (seeds) - { - // Always reset to default seed - this.n = 0xefc8249d; - this.s0 = this.hash(' '); - this.s1 = this.hash(' '); - this.s2 = this.hash(' '); - this.c = 1; - - if (!seeds) - { - return; - } - - // Apply any seeds - for (var i = 0; i < seeds.length && (seeds[i] != null); i++) - { - var seed = seeds[i]; - - this.s0 -= this.hash(seed); - this.s0 += ~~(this.s0 < 0); - this.s1 -= this.hash(seed); - this.s1 += ~~(this.s1 < 0); - this.s2 -= this.hash(seed); - this.s2 += ~~(this.s2 < 0); - } - }, - - /** - * Returns a random integer between 0 and 2^32. - * - * @method Phaser.Math.RandomDataGenerator#integer - * @since 3.0.0 - * - * @return {number} A random integer between 0 and 2^32. - */ - integer: function () - { - // 2^32 - return this.rnd() * 0x100000000; - }, - - /** - * Returns a random real number between 0 and 1. - * - * @method Phaser.Math.RandomDataGenerator#frac - * @since 3.0.0 - * - * @return {number} A random real number between 0 and 1. - */ - frac: function () - { - // 2^-53 - return this.rnd() + (this.rnd() * 0x200000 | 0) * 1.1102230246251565e-16; - }, - - /** - * Returns a random real number between 0 and 2^32. - * - * @method Phaser.Math.RandomDataGenerator#real - * @since 3.0.0 - * - * @return {number} A random real number between 0 and 2^32. - */ - real: function () - { - return this.integer() + this.frac(); - }, - - /** - * Returns a random integer between and including min and max. - * - * @method Phaser.Math.RandomDataGenerator#integerInRange - * @since 3.0.0 - * - * @param {number} min - The minimum value in the range. - * @param {number} max - The maximum value in the range. - * - * @return {number} A random number between min and max. - */ - integerInRange: function (min, max) - { - return Math.floor(this.realInRange(0, max - min + 1) + min); - }, - - /** - * Returns a random integer between and including min and max. - * This method is an alias for RandomDataGenerator.integerInRange. - * - * @method Phaser.Math.RandomDataGenerator#between - * @since 3.0.0 - * - * @param {number} min - The minimum value in the range. - * @param {number} max - The maximum value in the range. - * - * @return {number} A random number between min and max. - */ - between: function (min, max) - { - return Math.floor(this.realInRange(0, max - min + 1) + min); - }, - - /** - * Returns a random real number between min and max. - * - * @method Phaser.Math.RandomDataGenerator#realInRange - * @since 3.0.0 - * - * @param {number} min - The minimum value in the range. - * @param {number} max - The maximum value in the range. - * - * @return {number} A random number between min and max. - */ - realInRange: function (min, max) - { - return this.frac() * (max - min) + min; - }, - - /** - * Returns a random real number between -1 and 1. - * - * @method Phaser.Math.RandomDataGenerator#normal - * @since 3.0.0 - * - * @return {number} A random real number between -1 and 1. - */ - normal: function () - { - return 1 - (2 * this.frac()); - }, - - /** - * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368 - * - * @method Phaser.Math.RandomDataGenerator#uuid - * @since 3.0.0 - * - * @return {string} A valid RFC4122 version4 ID hex string - */ - uuid: function () - { - var a = ''; - var b = ''; - - for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-') - { - // eslint-disable-next-line no-empty - } - - return b; - }, - - /** - * Returns a random element from within the given array. - * - * @method Phaser.Math.RandomDataGenerator#pick - * @since 3.0.0 - * - * @generic T - * @genericUse {T[]} - [array] - * @genericUse {T} - [$return] - * - * @param {T[]} array - The array to pick a random element from. - * - * @return {T} A random member of the array. - */ - pick: function (array) - { - return array[this.integerInRange(0, array.length - 1)]; - }, - - /** - * Returns a sign to be used with multiplication operator. - * - * @method Phaser.Math.RandomDataGenerator#sign - * @since 3.0.0 - * - * @return {number} -1 or +1. - */ - sign: function () - { - return this.pick(this.signs); - }, - - /** - * Returns a random element from within the given array, favoring the earlier entries. - * - * @method Phaser.Math.RandomDataGenerator#weightedPick - * @since 3.0.0 - * - * @generic T - * @genericUse {T[]} - [array] - * @genericUse {T} - [$return] - * - * @param {T[]} array - The array to pick a random element from. - * - * @return {T} A random member of the array. - */ - weightedPick: function (array) - { - return array[~~(Math.pow(this.frac(), 2) * (array.length - 1) + 0.5)]; - }, - - /** - * Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified. - * - * @method Phaser.Math.RandomDataGenerator#timestamp - * @since 3.0.0 - * - * @param {number} min - The minimum value in the range. - * @param {number} max - The maximum value in the range. - * - * @return {number} A random timestamp between min and max. - */ - timestamp: function (min, max) - { - return this.realInRange(min || 946684800000, max || 1577862000000); - }, - - /** - * Returns a random angle between -180 and 180. - * - * @method Phaser.Math.RandomDataGenerator#angle - * @since 3.0.0 - * - * @return {number} A random number between -180 and 180. - */ - angle: function () - { - return this.integerInRange(-180, 180); - }, - - /** - * Returns a random rotation in radians, between -3.141 and 3.141 - * - * @method Phaser.Math.RandomDataGenerator#rotation - * @since 3.0.0 - * - * @return {number} A random number between -3.141 and 3.141 - */ - rotation: function () - { - return this.realInRange(-3.1415926, 3.1415926); - }, - - /** - * Gets or Sets the state of the generator. This allows you to retain the values - * that the generator is using between games, i.e. in a game save file. - * - * To seed this generator with a previously saved state you can pass it as the - * `seed` value in your game config, or call this method directly after Phaser has booted. - * - * Call this method with no parameters to return the current state. - * - * If providing a state it should match the same format that this method - * returns, which is a string with a header `!rnd` followed by the `c`, - * `s0`, `s1` and `s2` values respectively, each comma-delimited. - * - * @method Phaser.Math.RandomDataGenerator#state - * @since 3.0.0 - * - * @param {string} [state] - Generator state to be set. - * - * @return {string} The current state of the generator. - */ - state: function (state) - { - if (typeof state === 'string' && state.match(/^!rnd/)) - { - state = state.split(','); - - this.c = parseFloat(state[1]); - this.s0 = parseFloat(state[2]); - this.s1 = parseFloat(state[3]); - this.s2 = parseFloat(state[4]); - } - - return [ '!rnd', this.c, this.s0, this.s1, this.s2 ].join(','); - }, - - /** - * Shuffles the given array, using the current seed. - * - * @method Phaser.Math.RandomDataGenerator#shuffle - * @since 3.7.0 - * - * @generic T - * @genericUse {T[]} - [array,$return] - * - * @param {T[]} [array] - The array to be shuffled. - * - * @return {T[]} The shuffled array. - */ - shuffle: function (array) - { - var len = array.length - 1; - - for (var i = len; i > 0; i--) - { - var randomIndex = Math.floor(this.frac() * (i + 1)); - var itemAtIndex = array[randomIndex]; - - array[randomIndex] = array[i]; - array[i] = itemAtIndex; - } - - return array; + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; } -}); - -module.exports = RandomDataGenerator; - - -/***/ }), -/* 157 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the mean average of the given values. - * - * @function Phaser.Math.Average - * @since 3.0.0 - * - * @param {number[]} values - The values to average. - * - * @return {number} The average value. - */ -var Average = function (values) -{ - var sum = 0; - - for (var i = 0; i < values.length; i++) - { - sum += (+values[i]); + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; } - return sum / values.length; + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; }; -module.exports = Average; - - -/***/ }), -/* 158 */ -/***/ (function(module, exports) { - /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} + * Add a listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public */ - -/** - * Compute a random integer between the `min` and `max` values, inclusive. - * - * @function Phaser.Math.Between - * @since 3.0.0 - * - * @param {number} min - The minimum value. - * @param {number} max - The maximum value. - * - * @return {number} The random integer. - */ -var Between = function (min, max) -{ - return Math.floor(Math.random() * (max - min + 1) + min); +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); }; -module.exports = Between; - - -/***/ }), -/* 159 */ -/***/ (function(module, exports) { - /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public */ - -/** - * Ceils to some place comparative to a `base`, default is 10 for decimal place. - * - * The `place` is represented by the power applied to `base` to get that place. - * - * @function Phaser.Math.CeilTo - * @since 3.0.0 - * - * @param {number} value - The value to round. - * @param {number} [place=0] - The place to round to. - * @param {number} [base=10] - The base to round in. Default is 10 for decimal. - * - * @return {number} The rounded value. - */ -var CeilTo = function (value, place, base) -{ - if (place === undefined) { place = 0; } - if (base === undefined) { base = 10; } - - var p = Math.pow(base, -place); - - return Math.ceil(value * p) / p; +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); }; -module.exports = CeilTo; - - -/***/ }), -/* 160 */ -/***/ (function(module, exports) { - /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; -/** - * Calculates the positive difference of two given numbers. - * - * @function Phaser.Math.Difference - * @since 3.0.0 - * - * @param {number} a - The first number in the calculation. - * @param {number} b - The second number in the calculation. - * - * @return {number} The positive difference of the two given numbers. - */ -var Difference = function (a, b) -{ - return Math.abs(a - b); -}; + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } -module.exports = Difference; + var listeners = this._events[evt]; - -/***/ }), -/* 161 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(1); -var Class = __webpack_require__(0); -var Matrix4 = __webpack_require__(22); -var NOOP = __webpack_require__(2); - -var tempMatrix = new Matrix4(); - -/** - * @classdesc - * - * @class Euler - * @memberof Phaser.Math - * @constructor - * @since 3.50.0 - * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - */ -var Euler = new Class({ - - initialize: - - function Euler (x, y, z, order) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (z === undefined) { z = 0; } - if (order === undefined) { order = Euler.DefaultOrder; } - - this._x = x; - this._y = y; - this._z = z; - this._order = order; - - this.onChangeCallback = NOOP; - }, - - x: { - get: function () - { - return this._x; - }, - - set: function (value) - { - this._x = value; - - this.onChangeCallback(this); - } - }, - - y: { - get: function () - { - return this._y; - }, - - set: function (value) - { - this._y = value; - - this.onChangeCallback(this); - } - }, - - z: { - get: function () - { - return this._z; - }, - - set: function (value) - { - this._z = value; - - this.onChangeCallback(this); - } - }, - - order: { - get: function () - { - return this._order; - }, - - set: function (value) - { - this._order = value; - - this.onChangeCallback(this); - } - }, - - set: function (x, y, z, order) - { - if (order === undefined) { order = this._order; } - - this._x = x; - this._y = y; - this._z = z; - this._order = order; - - this.onChangeCallback(this); - - return this; - }, - - copy: function (euler) - { - return this.set(euler.x, euler.y, euler.z, euler.order); - }, - - setFromQuaternion: function (quaternion, order, update) - { - if (order === undefined) { order = this._order; } - if (update === undefined) { update = false; } - - tempMatrix.fromQuat(quaternion); - - return this.setFromRotationMatrix(tempMatrix, order, update); - }, - - setFromRotationMatrix: function (matrix, order, update) - { - if (order === undefined) { order = this._order; } - if (update === undefined) { update = false; } - - var elements = matrix.val; - - // Upper 3x3 of matrix is un-scaled rotation matrix - var m11 = elements[0]; - var m12 = elements[4]; - var m13 = elements[8]; - var m21 = elements[1]; - var m22 = elements[5]; - var m23 = elements[9]; - var m31 = elements[2]; - var m32 = elements[6]; - var m33 = elements[10]; - - var x = 0; - var y = 0; - var z = 0; - var epsilon = 0.99999; - - switch (order) - { - case 'XYZ': - { - y = Math.asin(Clamp(m13, -1, 1)); - - if (Math.abs(m13) < epsilon) - { - x = Math.atan2(-m23, m33); - z = Math.atan2(-m12, m11); - } - else - { - x = Math.atan2(m32, m22); - } - - break; - } - - case 'YXZ': - { - x = Math.asin(-Clamp(m23, -1, 1)); - - if (Math.abs(m23) < epsilon) - { - y = Math.atan2(m13, m33); - z = Math.atan2(m21, m22); - } - else - { - y = Math.atan2(-m31, m11); - } - - break; - } - - case 'ZXY': - { - x = Math.asin(Clamp(m32, -1, 1)); - - if (Math.abs(m32) < epsilon) - { - y = Math.atan2(-m31, m33); - z = Math.atan2(-m12, m22); - } - else - { - z = Math.atan2(m21, m11); - } - - break; - } - - case 'ZYX': - { - y = Math.asin(-Clamp(m31, -1, 1)); - - if (Math.abs(m31) < epsilon) - { - x = Math.atan2(m32, m33); - z = Math.atan2(m21, m11); - } - else - { - z = Math.atan2(-m12, m22); - } - - break; - } - - case 'YZX': - { - z = Math.asin(Clamp(m21, -1, 1)); - - if (Math.abs(m21) < epsilon) - { - x = Math.atan2(-m23, m22); - y = Math.atan2(-m31, m11); - } - else - { - y = Math.atan2(m13, m33); - } - - break; - } - - case 'XZY': - { - z = Math.asin(-Clamp(m12, -1, 1)); - - if (Math.abs(m12) < epsilon) - { - x = Math.atan2(m32, m22); - y = Math.atan2(m13, m11); - } - else - { - x = Math.atan2(-m23, m33); - } - - break; - } - } - - this._x = x; - this._y = y; - this._z = z; - this._order = order; - - if (update) - { - this.onChangeCallback(this); - } - - return this; + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } } -}); + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } -Euler.RotationOrders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ]; - -Euler.DefaultOrder = 'XYZ'; - -module.exports = Euler; - - -/***/ }), -/* 162 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Floors to some place comparative to a `base`, default is 10 for decimal place. - * - * The `place` is represented by the power applied to `base` to get that place. - * - * @function Phaser.Math.FloorTo - * @since 3.0.0 - * - * @param {number} value - The value to round. - * @param {number} [place=0] - The place to round to. - * @param {number} [base=10] - The base to round in. Default is 10 for decimal. - * - * @return {number} The rounded value. - */ -var FloorTo = function (value, place, base) -{ - if (place === undefined) { place = 0; } - if (base === undefined) { base = 10; } - - var p = Math.pow(base, -place); - - return Math.floor(value * p) / p; + return this; }; -module.exports = FloorTo; - - -/***/ }), -/* 163 */ -/***/ (function(module, exports, __webpack_require__) { - /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; -var Clamp = __webpack_require__(1); + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } -/** - * Return a value based on the range between `min` and `max` and the percentage given. - * - * @function Phaser.Math.FromPercent - * @since 3.0.0 - * - * @param {number} percent - A value between 0 and 1 representing the percentage. - * @param {number} min - The minimum value. - * @param {number} [max] - The maximum value. - * - * @return {number} The value that is `percent` percent between `min` and `max`. - */ -var FromPercent = function (percent, min, max) -{ - percent = Clamp(percent, 0, 1); - - return (max - min) * percent + min; + return this; }; -module.exports = FromPercent; +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if (true) { + module.exports = EventEmitter; +} /***/ }), -/* 164 */ -/***/ (function(module, exports) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate a per-ms speed from a distance and time (given in seconds). - * - * @function Phaser.Math.GetSpeed - * @since 3.0.0 - * - * @param {number} distance - The distance. - * @param {number} time - The time, in seconds. - * - * @return {number} The speed, in distance per ms. - * - * @example - * // 400px over 1 second is 0.4 px/ms - * Phaser.Math.GetSpeed(400, 1) // -> 0.4 - */ -var GetSpeed = function (distance, time) -{ - return (distance / time) / 1000; -}; - -module.exports = GetSpeed; - - -/***/ }), -/* 165 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check if a given value is an even number. - * - * @function Phaser.Math.IsEven - * @since 3.0.0 - * - * @param {number} value - The number to perform the check with. - * - * @return {boolean} Whether the number is even or not. - */ -var IsEven = function (value) -{ - // Use abstract equality == for "is number" test - - // eslint-disable-next-line eqeqeq - return (value == parseFloat(value)) ? !(value % 2) : void 0; -}; - -module.exports = IsEven; - - -/***/ }), -/* 166 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check if a given value is an even number using a strict type check. - * - * @function Phaser.Math.IsEvenStrict - * @since 3.0.0 - * - * @param {number} value - The number to perform the check with. - * - * @return {boolean} Whether the number is even or not. - */ -var IsEvenStrict = function (value) -{ - // Use strict equality === for "is number" test - return (value === parseFloat(value)) ? !(value % 2) : void 0; -}; - -module.exports = IsEvenStrict; - - -/***/ }), -/* 167 */ -/***/ (function(module, exports) { - -/** - * @author Greg McLean - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Interpolates two given Vectors and returns a new Vector between them. - * - * Does not modify either of the passed Vectors. - * - * @function Phaser.Math.LinearXY - * @since 3.60.0 - * - * @param {Phaser.Math.Vector2} vector1 - Starting vector - * @param {Phaser.Math.Vector2} vector2 - Ending vector - * @param {number} [t=0] - The percentage between vector1 and vector2 to return, represented as a number between 0 and 1. - * - * @return {Phaser.Math.Vector2} The step t% of the way between vector1 and vector2. - */ -var LinearXY = function (vector1, vector2, t) -{ - if (t === undefined) { t = 0; } - - return vector1.clone().lerp(vector2, t); -}; - -module.exports = LinearXY; - - -/***/ }), -/* 168 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Add an `amount` to a `value`, limiting the maximum result to `max`. - * - * @function Phaser.Math.MaxAdd - * @since 3.0.0 - * - * @param {number} value - The value to add to. - * @param {number} amount - The amount to add. - * @param {number} max - The maximum value to return. - * - * @return {number} The resulting value. - */ -var MaxAdd = function (value, amount, max) -{ - return Math.min(value + amount, max); -}; - -module.exports = MaxAdd; - - -/***/ }), -/* 169 */ -/***/ (function(module, exports) { - -/** - * @author Vladislav Forsh - * @copyright 2021 RoboWhale - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the median of the given values. The values are sorted and the middle value is returned. - * In case of an even number of values, the average of the two middle values is returned. - * - * @function Phaser.Math.Median - * @since 3.54.0 - * - * @param {number[]} values - The values to average. - * - * @return {number} The median value. - */ -var Median = function (values) -{ - var valuesNum = values.length; - if (valuesNum === 0) - { - return 0; - } - - values.sort(function (a, b) { return a - b; }); - - var halfIndex = Math.floor(valuesNum / 2); - - return valuesNum % 2 === 0 - ? (values[halfIndex] + values[halfIndex - 1]) / 2 - : values[halfIndex]; -}; - -module.exports = Median; - - -/***/ }), -/* 170 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Subtract an `amount` from `value`, limiting the minimum result to `min`. - * - * @function Phaser.Math.MinSub - * @since 3.0.0 - * - * @param {number} value - The value to subtract from. - * @param {number} amount - The amount to subtract. - * @param {number} min - The minimum value to return. - * - * @return {number} The resulting value. - */ -var MinSub = function (value, amount, min) -{ - return Math.max(value - amount, min); -}; - -module.exports = MinSub; - - -/***/ }), -/* 171 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Work out what percentage `value` is of the range between `min` and `max`. - * If `max` isn't given then it will return the percentage of `value` to `min`. - * - * You can optionally specify an `upperMax` value, which is a mid-way point in the range that represents 100%, after which the % starts to go down to zero again. - * - * @function Phaser.Math.Percent - * @since 3.0.0 - * - * @param {number} value - The value to determine the percentage of. - * @param {number} min - The minimum value. - * @param {number} [max] - The maximum value. - * @param {number} [upperMax] - The mid-way point in the range that represents 100%. - * - * @return {number} A value between 0 and 1 representing the percentage. - */ -var Percent = function (value, min, max, upperMax) -{ - if (max === undefined) { max = min + 1; } - - var percentage = (value - min) / (max - min); - - if (percentage > 1) - { - if (upperMax !== undefined) - { - percentage = ((upperMax - value)) / (upperMax - max); - - if (percentage < 0) - { - percentage = 0; - } - } - else - { - percentage = 1; - } - } - else if (percentage < 0) - { - percentage = 0; - } - - return percentage; -}; - -module.exports = Percent; - - -/***/ }), -/* 172 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Compute a random unit vector. - * - * Computes random values for the given vector between -1 and 1 that can be used to represent a direction. - * - * Optionally accepts a scale value to scale the resulting vector by. - * - * @function Phaser.Math.RandomXY - * @since 3.0.0 - * - * @param {Phaser.Math.Vector2} vector - The Vector to compute random values for. - * @param {number} [scale=1] - The scale of the random values. - * - * @return {Phaser.Math.Vector2} The given Vector. - */ -var RandomXY = function (vector, scale) -{ - if (scale === undefined) { scale = 1; } - - var r = Math.random() * 2 * Math.PI; - - vector.x = Math.cos(r) * scale; - vector.y = Math.sin(r) * scale; - - return vector; -}; - -module.exports = RandomXY; - - -/***/ }), -/* 173 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Compute a random position vector in a spherical area, optionally defined by the given radius. - * - * @function Phaser.Math.RandomXYZ - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} vec3 - The Vector to compute random values for. - * @param {number} [radius=1] - The radius. - * - * @return {Phaser.Math.Vector3} The given Vector. - */ -var RandomXYZ = function (vec3, radius) -{ - if (radius === undefined) { radius = 1; } - - var r = Math.random() * 2 * Math.PI; - var z = (Math.random() * 2) - 1; - var zScale = Math.sqrt(1 - z * z) * radius; - - vec3.x = Math.cos(r) * zScale; - vec3.y = Math.sin(r) * zScale; - vec3.z = z * radius; - - return vec3; -}; - -module.exports = RandomXYZ; - - -/***/ }), -/* 174 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Compute a random four-dimensional vector. - * - * @function Phaser.Math.RandomXYZW - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} vec4 - The Vector to compute random values for. - * @param {number} [scale=1] - The scale of the random values. - * - * @return {Phaser.Math.Vector4} The given Vector. - */ -var RandomXYZW = function (vec4, scale) -{ - if (scale === undefined) { scale = 1; } - - vec4.x = (Math.random() * 2 - 1) * scale; - vec4.y = (Math.random() * 2 - 1) * scale; - vec4.z = (Math.random() * 2 - 1) * scale; - vec4.w = (Math.random() * 2 - 1) * scale; - - return vec4; -}; - -module.exports = RandomXYZW; - - -/***/ }), -/* 175 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotate a given point by a given angle around the origin (0, 0), in an anti-clockwise direction. - * - * @function Phaser.Math.Rotate - * @since 3.0.0 - * - * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. - * @param {number} angle - The angle to be rotated by in an anticlockwise direction. - * - * @return {Phaser.Geom.Point} The given point, rotated by the given angle in an anticlockwise direction. - */ -var Rotate = function (point, angle) -{ - var x = point.x; - var y = point.y; - - point.x = (x * Math.cos(angle)) - (y * Math.sin(angle)); - point.y = (x * Math.sin(angle)) + (y * Math.cos(angle)); - - return point; -}; - -module.exports = Rotate; - - -/***/ }), -/* 176 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotate a `point` around `x` and `y` by the given `angle` and `distance`. - * - * In polar notation, this maps a point from (r, t) to (distance, t + angle), vs. the origin (x, y). - * - * @function Phaser.Math.RotateAroundDistance - * @since 3.0.0 - * - * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] - * - * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. - * @param {number} x - The horizontal coordinate to rotate around. - * @param {number} y - The vertical coordinate to rotate around. - * @param {number} angle - The angle of rotation in radians. - * @param {number} distance - The distance from (x, y) to place the point at. - * - * @return {Phaser.Types.Math.Vector2Like} The given point. - */ -var RotateAroundDistance = function (point, x, y, angle, distance) -{ - var t = angle + Math.atan2(point.y - y, point.x - x); - - point.x = x + (distance * Math.cos(t)); - point.y = y + (distance * Math.sin(t)); - - return point; -}; - -module.exports = RotateAroundDistance; - - -/***/ }), -/* 177 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Position a `point` at the given `angle` and `distance` to (`x`, `y`). - * - * @function Phaser.Math.RotateTo - * @since 3.24.0 - * - * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] - * - * @param {Phaser.Types.Math.Vector2Like} point - The point to be positioned. - * @param {number} x - The horizontal coordinate to position from. - * @param {number} y - The vertical coordinate to position from. - * @param {number} angle - The angle of rotation in radians. - * @param {number} distance - The distance from (x, y) to place the point at. - * - * @return {Phaser.Types.Math.Vector2Like} The given point. - */ -var RotateTo = function (point, x, y, angle, distance) -{ - point.x = x + (distance * Math.cos(angle)); - point.y = y + (distance * Math.sin(angle)); - - return point; -}; - -module.exports = RotateTo; - - -/***/ }), -/* 178 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Round a value to the given precision. - * - * For example: - * - * ```javascript - * RoundTo(123.456, 0) = 123 - * RoundTo(123.456, 1) = 120 - * RoundTo(123.456, 2) = 100 - * ``` - * - * To round the decimal, i.e. to round to precision, pass in a negative `place`: - * - * ```javascript - * RoundTo(123.456789, 0) = 123 - * RoundTo(123.456789, -1) = 123.5 - * RoundTo(123.456789, -2) = 123.46 - * RoundTo(123.456789, -3) = 123.457 - * ``` - * - * @function Phaser.Math.RoundTo - * @since 3.0.0 - * - * @param {number} value - The value to round. - * @param {number} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. - * @param {number} [base=10] - The base to round in. Default is 10 for decimal. - * - * @return {number} The rounded value. - */ -var RoundTo = function (value, place, base) -{ - if (place === undefined) { place = 0; } - if (base === undefined) { base = 10; } - - var p = Math.pow(base, -place); - - return Math.round(value * p) / p; -}; - -module.exports = RoundTo; - - -/***/ }), -/* 179 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Generate a series of sine and cosine values. - * - * @function Phaser.Math.SinCosTableGenerator - * @since 3.0.0 - * - * @param {number} length - The number of values to generate. - * @param {number} [sinAmp=1] - The sine value amplitude. - * @param {number} [cosAmp=1] - The cosine value amplitude. - * @param {number} [frequency=1] - The frequency of the values. - * - * @return {Phaser.Types.Math.SinCosTable} The generated values. - */ -var SinCosTableGenerator = function (length, sinAmp, cosAmp, frequency) -{ - if (sinAmp === undefined) { sinAmp = 1; } - if (cosAmp === undefined) { cosAmp = 1; } - if (frequency === undefined) { frequency = 1; } - - frequency *= Math.PI / length; - - var cos = []; - var sin = []; - - for (var c = 0; c < length; c++) - { - cosAmp -= sinAmp * frequency; - sinAmp += cosAmp * frequency; - - cos[c] = cosAmp; - sin[c] = sinAmp; - } - - return { - sin: sin, - cos: cos, - length: length - }; -}; - -module.exports = SinCosTableGenerator; - - -/***/ }), -/* 180 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Vector2 = __webpack_require__(3); - -/** - * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid. - * - * For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2. - * - * If the given index is out of range an empty Vector2 is returned. - * - * @function Phaser.Math.ToXY - * @since 3.19.0 - * - * @param {number} index - The position within the grid to get the x/y value for. - * @param {number} width - The width of the grid. - * @param {number} height - The height of the grid. - * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created. - * - * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index. - */ -var ToXY = function (index, width, height, out) -{ - if (out === undefined) { out = new Vector2(); } - - var x = 0; - var y = 0; - var total = width * height; - - if (index > 0 && index <= total) - { - if (index > width - 1) - { - y = Math.floor(index / width); - x = index - (y * width); - } - else - { - x = index; - } - } - - return out.set(x, y); -}; - -module.exports = ToXY; - - -/***/ }), -/* 181 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if the two values are within the given `tolerance` of each other. - * - * @function Phaser.Math.Within - * @since 3.0.0 - * - * @param {number} a - The first value to use in the calculation. - * @param {number} b - The second value to use in the calculation. - * @param {number} tolerance - The tolerance. Anything equal to or less than this value is considered as being within range. - * - * @return {boolean} Returns `true` if `a` is less than or equal to the tolerance of `b`. - */ -var Within = function (a, b, tolerance) -{ - return (Math.abs(a - b) <= tolerance); -}; - -module.exports = Within; - - -/***/ }), -/* 182 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A representation of a vector in 4D space. - * - * A four-component vector. - * - * @class Vector4 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - * @param {number} [w] - The w component. - */ -var Vector4 = new Class({ - - initialize: - - function Vector4 (x, y, z, w) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector4#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector4#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - /** - * The z component of this Vector. - * - * @name Phaser.Math.Vector4#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.z = 0; - - /** - * The w component of this Vector. - * - * @name Phaser.Math.Vector4#w - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.w = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; - } - }, - - /** - * Make a clone of this Vector4. - * - * @method Phaser.Math.Vector4#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector4} A clone of this Vector4. - */ - clone: function () - { - return new Vector4(this.x, this.y, this.z, this.w); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector4#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - copy: function (src) - { - this.x = src.x; - this.y = src.y; - this.z = src.z || 0; - this.w = src.w || 0; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict quality check against each Vector's components. - * - * @method Phaser.Math.Vector4#equals - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} v - The vector to check equality with. - * - * @return {boolean} A boolean indicating whether the two Vectors are equal or not. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z) && (this.w === v.w)); - }, - - /** - * Set the `x`, `y`, `z` and `w` components of the this Vector to the given `x`, `y`, `z` and `w` values. - * - * @method Phaser.Math.Vector4#set - * @since 3.0.0 - * - * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y, z and w components. - * @param {number} y - The y value to set for this Vector. - * @param {number} z - The z value to set for this Vector. - * @param {number} w - The z value to set for this Vector. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - set: function (x, y, z, w) - { - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; - } - - return this; - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector4#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - add: function (v) - { - this.x += v.x; - this.y += v.y; - this.z += v.z || 0; - this.w += v.w || 0; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector4#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - subtract: function (v) - { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z || 0; - this.w -= v.w || 0; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector4#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - scale: function (scale) - { - this.x *= scale; - this.y *= scale; - this.z *= scale; - this.w *= scale; - - return this; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector4#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return Math.sqrt(x * x + y * y + z * z + w * w); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector4#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return x * x + y * y + z * z + w * w; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector4#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - var len = x * x + y * y + z * z + w * w; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - this.z = z * len; - this.w = w * len; - } - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector4#dot - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} v - The Vector4 to dot product with this Vector4. - * - * @return {number} The dot product of this Vector and the given Vector. - */ - dot: function (v) - { - return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector4#lerp - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} v - The Vector4 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - lerp: function (v, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - this.w = aw + t * (v.w - aw); - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector4#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - multiply: function (v) - { - this.x *= v.x; - this.y *= v.y; - this.z *= v.z || 1; - this.w *= v.w || 1; - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector4#divide - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - divide: function (v) - { - this.x /= v.x; - this.y /= v.y; - this.z /= v.z || 1; - this.w /= v.w || 1; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector4#distance - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - var dw = v.w - this.w || 0; - - return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector4#distanceSq - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - var dw = v.w - this.w || 0; - - return dx * dx + dy * dy + dz * dz + dw * dw; - }, - - /** - * Negate the `x`, `y`, `z` and `w` components of this Vector. - * - * @method Phaser.Math.Vector4#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; - this.w = -this.w; - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector4#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector4 with. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[8] * z + m[12] * w; - this.y = m[1] * x + m[5] * y + m[9] * z + m[13] * w; - this.z = m[2] * x + m[6] * y + m[10] * z + m[14] * w; - this.w = m[3] * x + m[7] * y + m[11] * z + m[15] * w; - - return this; - }, - - /** - * Transform this Vector with the given Quaternion. - * - * @method Phaser.Math.Vector4#transformQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - transformQuat: function (q) - { - var x = this.x; - var y = this.y; - var z = this.z; - var qx = q.x; - var qy = q.y; - var qz = q.z; - var qw = q.w; - - // calculate quat * vec - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = -qx * x - qy * y - qz * z; - - // calculate result * inverse quat - this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; - this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; - this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; - - return this; - }, - - /** - * Make this Vector the zero vector (0, 0, 0, 0). - * - * @method Phaser.Math.Vector4#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - reset: function () - { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 0; - - return this; - } - -}); - -Vector4.prototype.sub = Vector4.prototype.subtract; -Vector4.prototype.mul = Vector4.prototype.multiply; -Vector4.prototype.div = Vector4.prototype.divide; -Vector4.prototype.dist = Vector4.prototype.distance; -Vector4.prototype.distSq = Vector4.prototype.distanceSq; -Vector4.prototype.len = Vector4.prototype.length; -Vector4.prototype.lenSq = Vector4.prototype.lengthSq; - -module.exports = Vector4; - - -/***/ }), -/* 183 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Vector3 = __webpack_require__(16); -var Matrix4 = __webpack_require__(22); -var Quaternion = __webpack_require__(46); - -var tmpMat4 = new Matrix4(); -var tmpQuat = new Quaternion(); -var tmpVec3 = new Vector3(); - -/** - * Rotates a vector in place by axis angle. - * - * This is the same as transforming a point by an - * axis-angle quaternion, but it has higher precision. - * - * @function Phaser.Math.RotateVec3 - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} vec - The vector to be rotated. - * @param {Phaser.Math.Vector3} axis - The axis to rotate around. - * @param {number} radians - The angle of rotation in radians. - * - * @return {Phaser.Math.Vector3} The given vector. - */ -var RotateVec3 = function (vec, axis, radians) -{ - // Set the quaternion to our axis angle - tmpQuat.setAxisAngle(axis, radians); - - // Create a rotation matrix from the axis angle - tmpMat4.fromRotationTranslation(tmpQuat, tmpVec3.set(0, 0, 0)); - - // Multiply our vector by the rotation matrix - return vec.transformMat4(tmpMat4); -}; - -module.exports = RotateVec3; - - -/***/ }), -/* 184 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scale Manager Resize Event. - * - * This event is dispatched whenever the Scale Manager detects a resize event from the browser. - * It sends three parameters to the callback, each of them being Size components. You can read - * the `width`, `height`, `aspectRatio` and other properties of these components to help with - * scaling your own game content. - * - * @event Phaser.Scale.Events#RESIZE - * @type {string} - * @since 3.16.1 - * - * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas. - * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size. - * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode. - * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width. - * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height. - */ -module.exports = 'resize'; - - -/***/ }), -/* 185 */ -/***/ (function(module, exports, __webpack_require__) { - -/** -* @author Richard Davey -* @copyright 2013-2023 Photon Storm Ltd. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/ - -var BasePlugin = __webpack_require__(186); -var Class = __webpack_require__(0); -var SceneEvents = __webpack_require__(23); - -/** - * @classdesc - * A Scene Level Plugin is installed into every Scene and belongs to that Scene. - * It can listen for Scene events and respond to them. - * It can map itself to a Scene property, or into the Scene Systems, or both. - * - * @class ScenePlugin - * @memberof Phaser.Plugins - * @extends Phaser.Plugins.BasePlugin - * @constructor - * @since 3.8.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin. - * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager. - * @param {string} pluginKey - The key under which this plugin has been installed into the Scene Systems. - */ -var ScenePlugin = new Class({ - - Extends: BasePlugin, - - initialize: - - function ScenePlugin (scene, pluginManager, pluginKey) - { - BasePlugin.call(this, pluginManager); - - /** - * A reference to the Scene that has installed this plugin. - * Only set if it's a Scene Plugin, otherwise `null`. - * This property is only set when the plugin is instantiated and added to the Scene, not before. - * You can use it during the `boot` method. - * - * @name Phaser.Plugins.ScenePlugin#scene - * @type {?Phaser.Scene} - * @protected - * @since 3.8.0 - */ - this.scene = scene; - - /** - * A reference to the Scene Systems of the Scene that has installed this plugin. - * Only set if it's a Scene Plugin, otherwise `null`. - * This property is only set when the plugin is instantiated and added to the Scene, not before. - * You can use it during the `boot` method. - * - * @name Phaser.Plugins.ScenePlugin#systems - * @type {?Phaser.Scenes.Systems} - * @protected - * @since 3.8.0 - */ - this.systems = scene.sys; - - /** - * The key under which this plugin was installed into the Scene Systems. - * - * This property is only set when the plugin is instantiated and added to the Scene, not before. - * You can use it during the `boot` method. - * - * @name Phaser.Plugins.ScenePlugin#pluginKey - * @type {string} - * @readonly - * @since 3.54.0 - */ - this.pluginKey = pluginKey; - - scene.sys.events.once(SceneEvents.BOOT, this.boot, this); - }, - - /** - * This method is called when the Scene boots. It is only ever called once. - * - * By this point the plugin properties `scene` and `systems` will have already been set. - * - * In here you can listen for {@link Phaser.Scenes.Events Scene events} and set-up whatever you need for this plugin to run. - * Here are the Scene events you can listen to: - * - * - start - * - ready - * - preupdate - * - update - * - postupdate - * - resize - * - pause - * - resume - * - sleep - * - wake - * - transitioninit - * - transitionstart - * - transitioncomplete - * - transitionout - * - shutdown - * - destroy - * - * At the very least you should offer a destroy handler for when the Scene closes down, i.e: - * - * ```javascript - * var eventEmitter = this.systems.events; - * eventEmitter.once('destroy', this.sceneDestroy, this); - * ``` - * - * @method Phaser.Plugins.ScenePlugin#boot - * @since 3.8.0 - */ - boot: function () - { - }, - - /** - * Game instance has been destroyed. - * - * You must release everything in here, all references, all objects, free it all up. - * - * @method Phaser.Plugins.ScenePlugin#destroy - * @since 3.8.0 - */ - destroy: function () - { - this.pluginManager = null; - this.game = null; - this.scene = null; - this.systems = null; - } - -}); - -module.exports = ScenePlugin; - - -/***/ }), -/* 186 */ -/***/ (function(module, exports, __webpack_require__) { - -/** -* @author Richard Davey -* @copyright 2013-2023 Photon Storm Ltd. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/ - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A Global Plugin is installed just once into the Game owned Plugin Manager. - * It can listen for Game events and respond to them. - * - * @class BasePlugin - * @memberof Phaser.Plugins - * @constructor - * @since 3.8.0 - * - * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager. - */ -var BasePlugin = new Class({ - - initialize: - - function BasePlugin (pluginManager) - { - /** - * A handy reference to the Plugin Manager that is responsible for this plugin. - * Can be used as a route to gain access to game systems and events. - * - * @name Phaser.Plugins.BasePlugin#pluginManager - * @type {Phaser.Plugins.PluginManager} - * @protected - * @since 3.8.0 - */ - this.pluginManager = pluginManager; - - /** - * A reference to the Game instance this plugin is running under. - * - * @name Phaser.Plugins.BasePlugin#game - * @type {Phaser.Game} - * @protected - * @since 3.8.0 - */ - this.game = pluginManager.game; - }, - - /** - * The PluginManager calls this method on a Global Plugin when the plugin is first instantiated. - * It will never be called again on this instance. - * In here you can set-up whatever you need for this plugin to run. - * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this. - * On a Scene Plugin, this method is never called. Use {@link Phaser.Plugins.ScenePlugin#boot} instead. - * - * @method Phaser.Plugins.BasePlugin#init - * @since 3.8.0 - * - * @param {?any} [data] - A value specified by the user, if any, from the `data` property of the plugin's configuration object (if started at game boot) or passed in the PluginManager's `install` method (if started manually). - */ - init: function () - { - }, - - /** - * The PluginManager calls this method on a Global Plugin when the plugin is started. - * If a plugin is stopped, and then started again, this will get called again. - * Typically called immediately after `BasePlugin.init`. - * On a Scene Plugin, this method is never called. - * - * @method Phaser.Plugins.BasePlugin#start - * @since 3.8.0 - */ - start: function () - { - // Here are the game-level events you can listen to. - // At the very least you should offer a destroy handler for when the game closes down. - - // var eventEmitter = this.game.events; - - // eventEmitter.once('destroy', this.gameDestroy, this); - // eventEmitter.on('pause', this.gamePause, this); - // eventEmitter.on('resume', this.gameResume, this); - // eventEmitter.on('resize', this.gameResize, this); - // eventEmitter.on('prestep', this.gamePreStep, this); - // eventEmitter.on('step', this.gameStep, this); - // eventEmitter.on('poststep', this.gamePostStep, this); - // eventEmitter.on('prerender', this.gamePreRender, this); - // eventEmitter.on('postrender', this.gamePostRender, this); - }, - - /** - * The PluginManager calls this method on a Global Plugin when the plugin is stopped. - * The game code has requested that your plugin stop doing whatever it does. - * It is now considered as 'inactive' by the PluginManager. - * Handle that process here (i.e. stop listening for events, etc) - * If the plugin is started again then `BasePlugin.start` will be called again. - * On a Scene Plugin, this method is never called. - * - * @method Phaser.Plugins.BasePlugin#stop - * @since 3.8.0 - */ - stop: function () - { - }, - - /** - * Game instance has been destroyed. - * You must release everything in here, all references, all objects, free it all up. - * - * @method Phaser.Plugins.BasePlugin#destroy - * @since 3.8.0 - */ - destroy: function () - { - this.pluginManager = null; - this.game = null; - this.scene = null; - this.systems = null; - } - -}); - -module.exports = BasePlugin; - - -/***/ }), -/* 187 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Object Added to Scene Event. - * - * This event is dispatched when a Game Object is added to a Scene. - * - * Listen for it from a Scene using `this.events.on('addedtoscene', listener)`. - * - * @event Phaser.Scenes.Events#ADDED_TO_SCENE - * @type {string} - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene. - * @param {Phaser.Scene} scene - The Scene to which the Game Object was added. - */ -module.exports = 'addedtoscene'; - - -/***/ }), -/* 188 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Boot Event. - * - * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins. - * - * Listen to it from a Scene using `this.events.on('boot', listener)`. - * - * @event Phaser.Scenes.Events#BOOT - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - */ -module.exports = 'boot'; - - -/***/ }), -/* 189 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Create Event. - * - * This event is dispatched by a Scene after it has been created by the Scene Manager. - * - * If a Scene has a `create` method then this event is emitted _after_ that has run. - * - * If there is a transition, this event will be fired after the `TRANSITION_START` event. - * - * Listen to it from a Scene using `this.events.on('create', listener)`. - * - * @event Phaser.Scenes.Events#CREATE - * @type {string} - * @since 3.17.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event. - */ -module.exports = 'create'; - - -/***/ }), -/* 190 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Destroy Event. - * - * This event is dispatched by a Scene during the Scene Systems destroy process. - * - * Listen to it from a Scene using `this.events.on('destroy', listener)`. - * - * You should destroy any resources that may be in use by your Scene in this event handler. - * - * @event Phaser.Scenes.Events#DESTROY - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - */ -module.exports = 'destroy'; - - -/***/ }), -/* 191 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Pause Event. - * - * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an - * action from another Scene. - * - * Listen to it from a Scene using `this.events.on('pause', listener)`. - * - * @event Phaser.Scenes.Events#PAUSE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was paused. - */ -module.exports = 'pause'; - - -/***/ }), -/* 192 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Post Update Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('postupdate', listener)`. - * - * A Scene will only run its step if it is active. - * - * @event Phaser.Scenes.Events#POST_UPDATE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. - * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. - */ -module.exports = 'postupdate'; - - -/***/ }), -/* 193 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Pre-Render Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to this event from a Scene using `this.events.on('prerender', listener)`. - * - * A Scene will only render if it is visible. - * - * This event is dispatched after the Scene Display List is sorted and before the Scene is rendered. - * - * @event Phaser.Scenes.Events#PRE_RENDER - * @type {string} - * @since 3.53.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. - */ -module.exports = 'prerender'; - - -/***/ }), -/* 194 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Pre Update Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('preupdate', listener)`. - * - * A Scene will only run its step if it is active. - * - * @event Phaser.Scenes.Events#PRE_UPDATE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. - * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. - */ -module.exports = 'preupdate'; - - -/***/ }), -/* 195 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Ready Event. - * - * This event is dispatched by a Scene during the Scene Systems start process. - * By this point in the process the Scene is now fully active and rendering. - * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event. - * - * Listen to it from a Scene using `this.events.on('ready', listener)`. - * - * @event Phaser.Scenes.Events#READY - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was started. - */ -module.exports = 'ready'; - - -/***/ }), -/* 196 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Object Removed from Scene Event. - * - * This event is dispatched when a Game Object is removed from a Scene. - * - * Listen for it from a Scene using `this.events.on('removedfromscene', listener)`. - * - * @event Phaser.Scenes.Events#REMOVED_FROM_SCENE - * @type {string} - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene. - * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed. - */ -module.exports = 'removedfromscene'; - - -/***/ }), -/* 197 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Render Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('render', listener)`. - * - * A Scene will only render if it is visible. - * - * By the time this event is dispatched, the Scene will have already been rendered. - * - * @event Phaser.Scenes.Events#RENDER - * @type {string} - * @since 3.0.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. - */ -module.exports = 'render'; - - -/***/ }), -/* 198 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Resume Event. - * - * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method, - * or as an action from another Scene. - * - * Listen to it from a Scene using `this.events.on('resume', listener)`. - * - * @event Phaser.Scenes.Events#RESUME - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was resumed. - */ -module.exports = 'resume'; - - -/***/ }), -/* 199 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Shutdown Event. - * - * This event is dispatched by a Scene during the Scene Systems shutdown process. - * - * Listen to it from a Scene using `this.events.on('shutdown', listener)`. - * - * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding - * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not - * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources. - * - * @event Phaser.Scenes.Events#SHUTDOWN - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was shutdown. - */ -module.exports = 'shutdown'; - - -/***/ }), -/* 200 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Sleep Event. - * - * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method, - * or as an action from another Scene. - * - * Listen to it from a Scene using `this.events.on('sleep', listener)`. - * - * @event Phaser.Scenes.Events#SLEEP - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was sent to sleep. - */ -module.exports = 'sleep'; - - -/***/ }), -/* 201 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Start Event. - * - * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins. - * - * Listen to it from a Scene using `this.events.on('start', listener)`. - * - * @event Phaser.Scenes.Events#START - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - */ -module.exports = 'start'; - - -/***/ }), -/* 202 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Transition Complete Event. - * - * This event is dispatched by the Target Scene of a transition. - * - * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration - * of the transition. - * - * Listen to it from a Scene using `this.events.on('transitioncomplete', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - * - * @event Phaser.Scenes.Events#TRANSITION_COMPLETE - * @type {string} - * @since 3.5.0 - * - * @param {Phaser.Scene} scene -The Scene on which the transitioned completed. - */ -module.exports = 'transitioncomplete'; - - -/***/ }), -/* 203 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Transition Init Event. - * - * This event is dispatched by the Target Scene of a transition. - * - * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method, - * this event is not dispatched. - * - * Listen to it from a Scene using `this.events.on('transitioninit', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - * - * @event Phaser.Scenes.Events#TRANSITION_INIT - * @type {string} - * @since 3.5.0 - * - * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. - * @param {number} duration - The duration of the transition in ms. - */ -module.exports = 'transitioninit'; - - -/***/ }), -/* 204 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Transition Out Event. - * - * This event is dispatched by a Scene when it initiates a transition to another Scene. - * - * Listen to it from a Scene using `this.events.on('transitionout', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - * - * @event Phaser.Scenes.Events#TRANSITION_OUT - * @type {string} - * @since 3.5.0 - * - * @param {Phaser.Scene} target - A reference to the Scene that is being transitioned to. - * @param {number} duration - The duration of the transition in ms. - */ -module.exports = 'transitionout'; - - -/***/ }), -/* 205 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Transition Start Event. - * - * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep. - * - * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method, - * this event is dispatched anyway. - * - * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is - * dispatched instead of this event. - * - * Listen to it from a Scene using `this.events.on('transitionstart', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - * - * @event Phaser.Scenes.Events#TRANSITION_START - * @type {string} - * @since 3.5.0 - * - * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. - * @param {number} duration - The duration of the transition in ms. - */ -module.exports = 'transitionstart'; - - -/***/ }), -/* 206 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Transition Wake Event. - * - * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before - * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead. - * - * Listen to it from a Scene using `this.events.on('transitionwake', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - * - * @event Phaser.Scenes.Events#TRANSITION_WAKE - * @type {string} - * @since 3.5.0 - * - * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. - * @param {number} duration - The duration of the transition in ms. - */ -module.exports = 'transitionwake'; - - -/***/ }), -/* 207 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Update Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists and the Scene is in a Running state, otherwise this is skipped. - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('update', listener)`. - * - * A Scene will only run its step if it is active. - * - * @event Phaser.Scenes.Events#UPDATE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. - * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. - */ -module.exports = 'update'; - - -/***/ }), -/* 208 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Wake Event. - * - * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method, - * or as an action from another Scene. - * - * Listen to it from a Scene using `this.events.on('wake', listener)`. - * - * @event Phaser.Scenes.Events#WAKE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was woken up. - */ -module.exports = 'wake'; - - -/***/ }), -/* 209 */ -/***/ (function(module, exports) { +/***/ 5159: +/***/ ((module) => { /*** IMPORTS FROM imports-loader ***/ @@ -31415,8 +9895,9 @@ module.exports = spine; /***/ }), -/* 210 */ -/***/ (function(module, exports) { + +/***/ 7518: +/***/ ((module) => { /*** IMPORTS FROM imports-loader ***/ @@ -43452,8 +21933,9 @@ module.exports = spine; /***/ }), -/* 211 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 3524: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -43461,13 +21943,13 @@ module.exports = spine; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Class = __webpack_require__(0); -var GetFastValue = __webpack_require__(11); -var ImageFile = __webpack_require__(212); -var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(224); -var MultiFile = __webpack_require__(225); -var TextFile = __webpack_require__(226); +var Class = __webpack_require__(7473); +var GetFastValue = __webpack_require__(4597); +var ImageFile = __webpack_require__(6732); +var IsPlainObject = __webpack_require__(2482); +var JSONFile = __webpack_require__(704); +var MultiFile = __webpack_require__(3137); +var TextFile = __webpack_require__(1192); /** * @typedef {object} Phaser.Loader.FileTypes.SpineFileConfig @@ -43712,1484 +22194,9 @@ module.exports = SpineFile; /***/ }), -/* 212 */ -/***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(12); -var File = __webpack_require__(24); -var FileTypesManager = __webpack_require__(25); -var GetFastValue = __webpack_require__(11); -var IsPlainObject = __webpack_require__(7); -var GetURL = __webpack_require__(48); - -/** - * @classdesc - * A single Image File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image. - * - * @class ImageFile - * @extends Phaser.Loader.File - * @memberof Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets. - */ -var ImageFile = new Class({ - - Extends: File, - - initialize: - - function ImageFile (loader, key, url, xhrSettings, frameConfig) - { - var extension = 'png'; - var normalMapURL; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - normalMapURL = GetFastValue(config, 'normalMap'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - frameConfig = GetFastValue(config, 'frameConfig'); - } - - if (Array.isArray(url)) - { - normalMapURL = url[1]; - url = url[0]; - } - - var fileConfig = { - type: 'image', - cache: loader.textureManager, - extension: extension, - responseType: 'blob', - key: key, - url: url, - xhrSettings: xhrSettings, - config: frameConfig - }; - - File.call(this, loader, fileConfig); - - // Do we have a normal map to load as well? - if (normalMapURL) - { - var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig); - - normalMap.type = 'normalMap'; - - this.setLink(normalMap); - - loader.addFile(normalMap); - } - - this.useImageElementLoad = loader.imageLoadType === 'HTMLImageElement'; - - if (this.useImageElementLoad) - { - this.load = this.loadImage; - this.onProcess = this.onProcessImage; - } - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.ImageFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - this.state = CONST.FILE_PROCESSING; - - this.data = new Image(); - - this.data.crossOrigin = this.crossOrigin; - - var _this = this; - - this.data.onload = function () - { - File.revokeObjectURL(_this.data); - - _this.onProcessComplete(); - }; - - this.data.onerror = function () - { - File.revokeObjectURL(_this.data); - - _this.onProcessError(); - }; - - File.createObjectURL(this.data, this.xhrLoader.response, 'image/png'); - }, - - /** - * Handles image load processing. - * - * @method Phaser.Loader.FileTypes.ImageFile#onProcessImage - * @private - * @since 3.60.0 - */ - onProcessImage: function () - { - var result = this.state; - - this.state = CONST.FILE_PROCESSING; - - if (result === CONST.FILE_LOADED) - { - this.onProcessComplete(); - } - else - { - this.onProcessError(); - } - }, - - /** - * Loads the image using either XHR or an Image tag. - * - * @method Phaser.Loader.FileTypes.ImageFile#loadImage - * @private - * @since 3.60.0 - */ - loadImage: function () - { - this.state = CONST.FILE_LOADING; - - this.src = GetURL(this, this.loader.baseURL); - - if (this.src.indexOf('data:') === 0) - { - console.warn('Local data URIs are not supported: ' + this.key); - } - else - { - this.data = new Image(); - - this.data.crossOrigin = this.crossOrigin; - - var _this = this; - - this.data.onload = function () - { - _this.state = CONST.FILE_LOADED; - - _this.loader.nextFile(_this, true); - }; - - this.data.onerror = function () - { - _this.loader.nextFile(_this, false); - }; - - this.data.src = this.src; - } - }, - - /** - * Adds this file to its target cache upon successful loading and processing. - * - * @method Phaser.Loader.FileTypes.ImageFile#addToCache - * @since 3.7.0 - */ - addToCache: function () - { - // Check if we have a linked normal map - var linkFile = this.linkFile; - - if (linkFile) - { - // We do, but has it loaded? - if (linkFile.state >= CONST.FILE_COMPLETE) - { - // Both files have loaded - if (this.type === 'normalMap') - { - // linkFile.data = Image - // this.data = Normal Map - this.cache.addImage(this.key, linkFile.data, this.data); - } - else - { - // linkFile.data = Normal Map - // this.data = Image - this.cache.addImage(this.key, this.data, linkFile.data); - } - } - - // Nothing to do here, we'll use the linkFile `addToCache` call - // to process this pair - } - else - { - this.cache.addImage(this.key, this.data); - } - } - -}); - -/** - * Adds an Image, or array of Images, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.image('logo', 'images/phaserLogo.png'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. - * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback - * of animated gifs to Canvas elements. - * - * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the Texture Manager first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.image({ - * key: 'logo', - * url: 'images/AtariLogo.png' - * }); - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details. - * - * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: - * - * ```javascript - * this.load.image('logo', 'images/AtariLogo.png'); - * // and later in your game ... - * this.add.image(x, y, 'logo'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and - * this is what you would use to retrieve the image from the Texture Manager. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" - * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, - * then you can specify it by providing an array as the `url` where the second element is the normal map: - * - * ```javascript - * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]); - * ``` - * - * Or, if you are using a config object use the `normalMap` property: - * - * ```javascript - * this.load.image({ - * key: 'logo', - * url: 'images/AtariLogo.png', - * normalMap: 'images/AtariLogo-n.png' - * }); - * ``` - * - * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. - * Normal maps are a WebGL only feature. - * - * In Phaser 3.60 a new property was added that allows you to control how images are loaded. By default, images are loaded via XHR as Blobs. - * However, you can set `loader.imageLoadType: "HTMLImageElement"` in the Game Configuration and instead, the Loader will load all images - * via the Image tag instead. - * - * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#image - * @fires Phaser.Loader.LoaderPlugin#ADD - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig|Phaser.Types.Loader.FileTypes.ImageFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {this} The Loader instance. - */ -FileTypesManager.register('image', function (key, url, xhrSettings) -{ - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new ImageFile(this, key[i])); - } - } - else - { - this.addFile(new ImageFile(this, key, url, xhrSettings)); - } - - return this; -}); - -module.exports = ImageFile; - - -/***/ }), -/* 213 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Loader Plugin Add File Event. - * - * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue. - * - * Listen to it from a Scene using: `this.load.on('addfile', listener)`. - * - * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them. - * - * @event Phaser.Loader.Events#ADD - * @type {string} - * @since 3.0.0 - * - * @param {string} key - The unique key of the file that was added to the Loader. - * @param {string} type - The [file type]{@link Phaser.Loader.File#type} string of the file that was added to the Loader, i.e. `image`. - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - * @param {Phaser.Loader.File} file - A reference to the File which was added to the Loader. - */ -module.exports = 'addfile'; - - -/***/ }), -/* 214 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Loader Plugin Complete Event. - * - * This event is dispatched when the Loader has fully processed everything in the load queue. - * By this point every loaded file will now be in its associated cache and ready for use. - * - * Listen to it from a Scene using: `this.load.on('complete', listener)`. - * - * @event Phaser.Loader.Events#COMPLETE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - * @param {number} totalComplete - The total number of files that successfully loaded. - * @param {number} totalFailed - The total number of files that failed to load. - */ -module.exports = 'complete'; - - -/***/ }), -/* 215 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The File Load Complete Event. - * - * This event is dispatched by the Loader Plugin when _any_ file in the queue finishes loading. - * - * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`. - * - * Make sure you remove this listener when you have finished, or it will continue to fire if the Scene reloads. - * - * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. - * - * @event Phaser.Loader.Events#FILE_COMPLETE - * @type {string} - * @since 3.0.0 - * - * @param {string} key - The key of the file that just loaded and finished processing. - * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. - * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. - */ -module.exports = 'filecomplete'; - - -/***/ }), -/* 216 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The File Load Complete Event. - * - * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. - * - * It uses a special dynamic event name constructed from the key and type of the file. - * - * For example, if you have loaded an `image` with a key of `monster`, you can listen for it - * using the following: - * - * ```javascript - * this.load.on('filecomplete-image-monster', function (key, type, data) { - * // Your handler code - * }); - * ``` - * - * Or, if you have loaded a texture `atlas` with a key of `Level1`: - * - * ```javascript - * this.load.on('filecomplete-atlasjson-Level1', function (key, type, data) { - * // Your handler code - * }); - * ``` - * - * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`: - * - * ```javascript - * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) { - * // Your handler code - * }); - * ``` - * - * Make sure you remove your listeners when you have finished, or they will continue to fire if the Scene reloads. - * - * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event. - * - * @event Phaser.Loader.Events#FILE_KEY_COMPLETE - * @type {string} - * @since 3.0.0 - * - * @param {string} key - The key of the file that just loaded and finished processing. - * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. - * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. - */ -module.exports = 'filecomplete-'; - - -/***/ }), -/* 217 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The File Load Error Event. - * - * This event is dispatched by the Loader Plugin when a file fails to load. - * - * Listen to it from a Scene using: `this.load.on('loaderror', listener)`. - * - * @event Phaser.Loader.Events#FILE_LOAD_ERROR - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - A reference to the File which errored during load. - */ -module.exports = 'loaderror'; - - -/***/ }), -/* 218 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The File Load Event. - * - * This event is dispatched by the Loader Plugin when a file finishes loading, - * but _before_ it is processed and added to the internal Phaser caches. - * - * Listen to it from a Scene using: `this.load.on('load', listener)`. - * - * @event Phaser.Loader.Events#FILE_LOAD - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - A reference to the File which just finished loading. - */ -module.exports = 'load'; - - -/***/ }), -/* 219 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The File Load Progress Event. - * - * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and - * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen. - * - * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`. - * - * @event Phaser.Loader.Events#FILE_PROGRESS - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - A reference to the File which errored during load. - * @param {number} percentComplete - A value between 0 and 1 indicating how 'complete' this file is. - */ -module.exports = 'fileprogress'; - - -/***/ }), -/* 220 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Loader Plugin Post Process Event. - * - * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue. - * It is dispatched before the internal lists are cleared and each File is destroyed. - * - * Use this hook to perform any last minute processing of files that can only happen once the - * Loader has completed, but prior to it emitting the `complete` event. - * - * Listen to it from a Scene using: `this.load.on('postprocess', listener)`. - * - * @event Phaser.Loader.Events#POST_PROCESS - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - */ -module.exports = 'postprocess'; - - -/***/ }), -/* 221 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Loader Plugin Progress Event. - * - * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading. - * - * Listen to it from a Scene using: `this.load.on('progress', listener)`. - * - * @event Phaser.Loader.Events#PROGRESS - * @type {string} - * @since 3.0.0 - * - * @param {number} progress - The current progress of the load. A value between 0 and 1. - */ -module.exports = 'progress'; - - -/***/ }), -/* 222 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Loader Plugin Start Event. - * - * This event is dispatched when the Loader starts running. At this point load progress is zero. - * - * This event is dispatched even if there aren't any files in the load queue. - * - * Listen to it from a Scene using: `this.load.on('start', listener)`. - * - * @event Phaser.Loader.Events#START - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - */ -module.exports = 'start'; - - -/***/ }), -/* 223 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MergeXHRSettings = __webpack_require__(49); - -/** - * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings - * and starts the download of it. It uses the Files own XHRSettings and merges them - * with the global XHRSettings object to set the xhr values before download. - * - * @function Phaser.Loader.XHRLoader - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - The File to download. - * @param {Phaser.Types.Loader.XHRSettingsObject} globalXHRSettings - The global XHRSettings object. - * - * @return {XMLHttpRequest} The XHR object. - */ -var XHRLoader = function (file, globalXHRSettings) -{ - var config = MergeXHRSettings(globalXHRSettings, file.xhrSettings); - - var xhr = new XMLHttpRequest(); - - xhr.open('GET', file.src, config.async, config.user, config.password); - - xhr.responseType = file.xhrSettings.responseType; - xhr.timeout = config.timeout; - - if (config.headers) - { - for (var key in config.headers) - { - xhr.setRequestHeader(key, config.headers[key]); - } - } - - if (config.header && config.headerValue) - { - xhr.setRequestHeader(config.header, config.headerValue); - } - - if (config.requestedWith) - { - xhr.setRequestHeader('X-Requested-With', config.requestedWith); - } - - if (config.overrideMimeType) - { - xhr.overrideMimeType(config.overrideMimeType); - } - - if (config.withCredentials) - { - xhr.withCredentials = true; - } - - // After a successful request, the xhr.response property will contain the requested data as a DOMString, ArrayBuffer, Blob, or Document (depending on what was set for responseType.) - - xhr.onload = file.onLoad.bind(file, xhr); - xhr.onerror = file.onError.bind(file, xhr); - xhr.onprogress = file.onProgress.bind(file); - - // This is the only standard method, the ones above are browser additions (maybe not universal?) - // xhr.onreadystatechange - - xhr.send(); - - return xhr; -}; - -module.exports = XHRLoader; - - -/***/ }), -/* 224 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(12); -var File = __webpack_require__(24); -var FileTypesManager = __webpack_require__(25); -var GetFastValue = __webpack_require__(11); -var GetValue = __webpack_require__(10); -var IsPlainObject = __webpack_require__(7); - -/** - * @classdesc - * A single JSON File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. - * - * @class JSONFile - * @extends Phaser.Loader.File - * @memberof Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. - */ -var JSONFile = new Class({ - - Extends: File, - - initialize: - - // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object - // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing - - function JSONFile (loader, key, url, xhrSettings, dataKey) - { - var extension = 'json'; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - dataKey = GetFastValue(config, 'dataKey', dataKey); - } - - var fileConfig = { - type: 'json', - cache: loader.cacheManager.json, - extension: extension, - responseType: 'text', - key: key, - url: url, - xhrSettings: xhrSettings, - config: dataKey - }; - - File.call(this, loader, fileConfig); - - // A JSON object has been provided (instead of a URL), so we'll use it directly as the File.data. No need to load it. - if (IsPlainObject(url)) - { - if (dataKey) - { - this.data = GetValue(url, dataKey); - } - else - { - this.data = url; - } - - this.state = CONST.FILE_POPULATED; - } - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.JSONFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - if (this.state !== CONST.FILE_POPULATED) - { - this.state = CONST.FILE_PROCESSING; - - try - { - var json = JSON.parse(this.xhrLoader.responseText); - } - catch (e) - { - this.onProcessError(); - - throw e; - } - - var key = this.config; - - if (typeof key === 'string') - { - this.data = GetValue(json, key, json); - } - else - { - this.data = json; - } - } - - this.onProcessComplete(); - } - -}); - -/** - * Adds a JSON file, or array of JSON files, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.json('wavedata', 'files/AlienWaveData.json'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the JSON Cache first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.json({ - * key: 'wavedata', - * url: 'files/AlienWaveData.json' - * }); - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. - * - * Once the file has finished loading you can access it from its Cache using its key: - * - * ```javascript - * this.load.json('wavedata', 'files/AlienWaveData.json'); - * // and later in your game ... - * var data = this.cache.json.get('wavedata'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and - * this is what you would use to retrieve the text from the JSON Cache. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" - * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, - * rather than the whole file. For example, if your JSON data had a structure like this: - * - * ```json - * { - * "level1": { - * "baddies": { - * "aliens": {}, - * "boss": {} - * } - * }, - * "level2": {}, - * "level3": {} - * } - * ``` - * - * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. - * - * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#json - * @fires Phaser.Loader.LoaderPlugin#ADD - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {this} The Loader instance. - */ -FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) -{ - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new JSONFile(this, key[i])); - } - } - else - { - this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); - } - - return this; -}); - -module.exports = JSONFile; - - -/***/ }), -/* 225 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(12); -var Events = __webpack_require__(47); - -/** - * @classdesc - * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after - * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. - * - * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. - * - * @class MultiFile - * @memberof Phaser.Loader - * @constructor - * @since 3.7.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. - * @param {string} type - The file type string for sorting within the Loader. - * @param {string} key - The key of the file within the loader. - * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile. - */ -var MultiFile = new Class({ - - initialize: - - function MultiFile (loader, type, key, files) - { - var finalFiles = []; - - // Clean out any potential 'null' or 'undefined' file entries - files.forEach(function (file) - { - if (file) - { - finalFiles.push(file); - } - }); - - /** - * A reference to the Loader that is going to load this file. - * - * @name Phaser.Loader.MultiFile#loader - * @type {Phaser.Loader.LoaderPlugin} - * @since 3.7.0 - */ - this.loader = loader; - - /** - * The file type string for sorting within the Loader. - * - * @name Phaser.Loader.MultiFile#type - * @type {string} - * @since 3.7.0 - */ - this.type = type; - - /** - * Unique cache key (unique within its file type) - * - * @name Phaser.Loader.MultiFile#key - * @type {string} - * @since 3.7.0 - */ - this.key = key; - - /** - * The current index being used by multi-file loaders to avoid key clashes. - * - * @name Phaser.Loader.MultiFile#multiKeyIndex - * @type {number} - * @private - * @since 3.20.0 - */ - this.multiKeyIndex = loader.multiKeyIndex++; - - /** - * Array of files that make up this MultiFile. - * - * @name Phaser.Loader.MultiFile#files - * @type {Phaser.Loader.File[]} - * @since 3.7.0 - */ - this.files = finalFiles; - - /** - * The current state of the file. One of the FILE_CONST values. - * - * @name Phaser.Loader.MultiFile#state - * @type {number} - * @since 3.60.0 - */ - this.state = CONST.FILE_PENDING; - - /** - * The completion status of this MultiFile. - * - * @name Phaser.Loader.MultiFile#complete - * @type {boolean} - * @default false - * @since 3.7.0 - */ - this.complete = false; - - /** - * The number of files to load. - * - * @name Phaser.Loader.MultiFile#pending - * @type {number} - * @since 3.7.0 - */ - - this.pending = finalFiles.length; - - /** - * The number of files that failed to load. - * - * @name Phaser.Loader.MultiFile#failed - * @type {number} - * @default 0 - * @since 3.7.0 - */ - this.failed = 0; - - /** - * A storage container for transient data that the loading files need. - * - * @name Phaser.Loader.MultiFile#config - * @type {any} - * @since 3.7.0 - */ - this.config = {}; - - /** - * A reference to the Loaders baseURL at the time this MultiFile was created. - * Used to populate child-files. - * - * @name Phaser.Loader.MultiFile#baseURL - * @type {string} - * @since 3.20.0 - */ - this.baseURL = loader.baseURL; - - /** - * A reference to the Loaders path at the time this MultiFile was created. - * Used to populate child-files. - * - * @name Phaser.Loader.MultiFile#path - * @type {string} - * @since 3.20.0 - */ - this.path = loader.path; - - /** - * A reference to the Loaders prefix at the time this MultiFile was created. - * Used to populate child-files. - * - * @name Phaser.Loader.MultiFile#prefix - * @type {string} - * @since 3.20.0 - */ - this.prefix = loader.prefix; - - // Link the files - for (var i = 0; i < finalFiles.length; i++) - { - finalFiles[i].multiFile = this; - } - }, - - /** - * Checks if this MultiFile is ready to process its children or not. - * - * @method Phaser.Loader.MultiFile#isReadyToProcess - * @since 3.7.0 - * - * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`. - */ - isReadyToProcess: function () - { - return (this.pending === 0 && this.failed === 0 && !this.complete); - }, - - /** - * Adds another child to this MultiFile, increases the pending count and resets the completion status. - * - * @method Phaser.Loader.MultiFile#addToMultiFile - * @since 3.7.0 - * - * @param {Phaser.Loader.File} files - The File to add to this MultiFile. - * - * @return {Phaser.Loader.MultiFile} This MultiFile instance. - */ - addToMultiFile: function (file) - { - this.files.push(file); - - file.multiFile = this; - - this.pending++; - - this.complete = false; - - return this; - }, - - /** - * Called by each File when it finishes loading. - * - * @method Phaser.Loader.MultiFile#onFileComplete - * @since 3.7.0 - * - * @param {Phaser.Loader.File} file - The File that has completed processing. - */ - onFileComplete: function (file) - { - var index = this.files.indexOf(file); - - if (index !== -1) - { - this.pending--; - } - }, - - /** - * Called by each File that fails to load. - * - * @method Phaser.Loader.MultiFile#onFileFailed - * @since 3.7.0 - * - * @param {Phaser.Loader.File} file - The File that has failed to load. - */ - onFileFailed: function (file) - { - var index = this.files.indexOf(file); - - if (index !== -1) - { - this.failed++; - - // eslint-disable-next-line no-console - console.error('File failed: %s "%s" (via %s "%s")', this.type, this.key, file.type, file.key); - } - }, - - /** - * Called once all children of this multi file have been added to their caches and is now - * ready for deletion from the Loader. - * - * It will emit a `filecomplete` event from the LoaderPlugin. - * - * @method Phaser.Loader.MultiFile#pendingDestroy - * @fires Phaser.Loader.Events#FILE_COMPLETE - * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE - * @since 3.60.0 - */ - pendingDestroy: function () - { - if (this.state === CONST.FILE_PENDING_DESTROY) - { - return; - } - - var key = this.key; - var type = this.type; - - this.loader.emit(Events.FILE_COMPLETE, key, type); - this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type); - - this.loader.flagForRemoval(this); - - for (var i = 0; i < this.files.length; i++) - { - this.files[i].pendingDestroy(); - } - - this.state = CONST.FILE_PENDING_DESTROY; - }, - - /** - * Destroy this Multi File and any references it holds. - * - * @method Phaser.Loader.MultiFile#destroy - * @since 3.60.0 - */ - destroy: function () - { - this.loader = null; - this.files = null; - this.config = null; - } - -}); - -module.exports = MultiFile; - - -/***/ }), -/* 226 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(12); -var File = __webpack_require__(24); -var FileTypesManager = __webpack_require__(25); -var GetFastValue = __webpack_require__(11); -var IsPlainObject = __webpack_require__(7); - -/** - * @classdesc - * A single Text File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text. - * - * @class TextFile - * @extends Phaser.Loader.File - * @memberof Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - */ -var TextFile = new Class({ - - Extends: File, - - initialize: - - function TextFile (loader, key, url, xhrSettings) - { - var type = 'text'; - var extension = 'txt'; - var cache = loader.cacheManager.text; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - type = GetFastValue(config, 'type', type); - cache = GetFastValue(config, 'cache', cache); - } - - var fileConfig = { - type: type, - cache: cache, - extension: extension, - responseType: 'text', - key: key, - url: url, - xhrSettings: xhrSettings - }; - - File.call(this, loader, fileConfig); - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.TextFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - this.state = CONST.FILE_PROCESSING; - - this.data = this.xhrLoader.responseText; - - this.onProcessComplete(); - } - -}); - -/** - * Adds a Text file, or array of Text files, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.text('story', 'files/IntroStory.txt'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the Text Cache. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the Text Cache first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.text({ - * key: 'story', - * url: 'files/IntroStory.txt' - * }); - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details. - * - * Once the file has finished loading you can access it from its Cache using its key: - * - * ```javascript - * this.load.text('story', 'files/IntroStory.txt'); - * // and later in your game ... - * var data = this.cache.text.get('story'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and - * this is what you would use to retrieve the text from the Text Cache. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" - * and no URL is given then the Loader will set the URL to be "story.txt". It will always add `.txt` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#text - * @fires Phaser.Loader.LoaderPlugin#ADD - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig|Phaser.Types.Loader.FileTypes.TextFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {this} The Loader instance. - */ -FileTypesManager.register('text', function (key, url, xhrSettings) -{ - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new TextFile(this, key[i])); - } - } - else - { - this.addFile(new TextFile(this, key, url, xhrSettings)); - } - - return this; -}); - -module.exports = TextFile; - - -/***/ }), -/* 227 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 4513: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -45197,21 +22204,1794 @@ module.exports = TextFile; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var AngleBetween = __webpack_require__(31); -var Clamp = __webpack_require__(1); -var Class = __webpack_require__(0); -var ComponentsComputedSize = __webpack_require__(51); -var ComponentsDepth = __webpack_require__(52); -var ComponentsFlip = __webpack_require__(53); -var ComponentsScrollFactor = __webpack_require__(54); -var ComponentsTransform = __webpack_require__(55); -var ComponentsVisible = __webpack_require__(56); -var CounterClockwise = __webpack_require__(8); -var DegToRad = __webpack_require__(21); -var GameObject = __webpack_require__(57); -var RadToDeg = __webpack_require__(9); -var SpineEvents = __webpack_require__(249); -var SpineGameObjectRender = __webpack_require__(256); +var BuildGameObject = __webpack_require__(2494); +var Class = __webpack_require__(7473); +var GetValue = __webpack_require__(5851); +var ResizeEvent = __webpack_require__(3527); +var ScenePlugin = __webpack_require__(5722); +var SpineCanvas = __webpack_require__(5159); +var SpineWebgl = __webpack_require__(7518); +var Spine = { + canvas: SpineCanvas, + webgl: SpineWebgl +}; +var SpineFile = __webpack_require__(3524); +var SpineGameObject = __webpack_require__(8332); +var SpineContainer = __webpack_require__(5782); +var NOOP = __webpack_require__(1984); + +/** + * @classdesc + * The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game Objects. + * + * Find more details about Spine itself at http://esotericsoftware.com/. + * + * All rendering and object creation is handled via the official Spine Runtimes. This version of the plugin + * uses the Spine 3.8.95 runtimes. Please note that due to the way the Spine runtimes use semver, you will + * get breaking changes in point-releases. Therefore, files created in a different version of Spine may not + * work as a result, without you first updating the runtimes and rebuilding the plugin. + * + * Esoteric themselves recommend that you freeze your Spine editor version against the runtime versions. + * You can find more information about this here: http://esotericsoftware.com/spine-settings#Version + * + * Please note that you require a Spine license in order to use Spine Runtimes in your games. + * + * You can install this plugin into your Phaser game by either importing it, if you're using ES6: + * + * ```javascript + * import * as SpinePlugin from './SpinePlugin.js'; + * ``` + * + * and then adding it to your Phaser Game configuration: + * + * ```javascript + * plugins: { + * scene: [ + * { key: 'SpinePlugin', plugin: window.SpinePlugin, mapping: 'spine' } + * ] + * } + * ``` + * + * If you're using ES5 then you can load the Spine Plugin in a Scene files payload, _within_ your + * Game Configuration object, like this: + * + * ```javascript + * scene: { + * preload: preload, + * create: create, + * pack: { + * files: [ + * { type: 'scenePlugin', key: 'SpinePlugin', url: 'plugins/SpinePlugin.js', sceneKey: 'spine' } + * ] + * } + * } + * ``` + * + * Loading it like this allows you to then use commands such as `this.load.spine` from within the + * same Scene. Alternatively, you can use the method `this.load.plugin` to load the plugin via the normal + * Phaser Loader. However, doing so will not add it to the current Scene. It will be available from any + * subsequent Scenes. + * + * ## A note about inlined data: + * + * If you need to load Spine assets from inline / base64 encoded data, then you should not use the Loader + * at all. Instead, call the functions directly as required: + * + * scene.cache.json.add + * scene.cache.custom.spine.add + * scene.textures.addBase64 + * + * ## Using the plugin + * + * Assuming a default environment you access it from within a Scene by using the `this.spine` reference. + * + * When this plugin is installed into a Scene it will add a Loader File Type, allowing you to load + * Spine files directly, i.e.: + * + * ```javascript + * this.load.spine('stretchyman', 'stretchyman-pro.json', [ 'stretchyman-pma.atlas' ], true); + * ``` + * + * It also installs two Game Object Factory methods, allowing you to create Spine Game Objects + * and Spine Containers: + * + * ```javascript + * const man = this.add.spine(512, 650, 'stretchyman'); + * + * const container = this.add.spineContainer(); + * + * container.add(man); + * ``` + * + * The first argument is the key which you used when importing the Spine data. There are lots of + * things you can specify, such as the animation name, skeleton, slot attachments and more. Please + * see the respective documentation and examples for further details. + * + * Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary. + * The associated atlas files are scanned for any texture files present in them, which are then loaded. + * If you have exported your Spine data with preMultipliedAlpha set, then you should enable this in the + * load arguments, or you may see black outlines around skeleton textures. + * + * The Spine plugin is local to the Scene in which it is installed. This means a change to something, + * such as the Skeleton Debug Renderer, in this Scene, will not impact the renderer in any other Scene. + * The only exception to this is with the caches this plugin creates. Spine atlas and texture data are + * stored in their own caches, which are global, meaning they're accessible from any Scene in your + * game, regardless if the Scene loaded the Spine data or not. + * + * When destroying a Phaser Game instance, if you need to re-create it again on the same page without + * reloading, you must remember to remove the Spine Plugin as part of your tear-down process: + * + * ```javascript + * this.plugins.removeScenePlugin('SpinePlugin'); + * ``` + * + * For details about the Spine Runtime API see http://esotericsoftware.com/spine-api-reference + * + * @class SpinePlugin + * @extends Phaser.Plugins.ScenePlugin + * @constructor + * @since 3.19.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin. + * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Phaser Plugin Manager. + * @param {string} pluginKey - The key under which this plugin has been installed into the Scene Systems. + */ +var SpinePlugin = new Class({ + + Extends: ScenePlugin, + + initialize: + + function SpinePlugin (scene, pluginManager, pluginKey) + { + ScenePlugin.call(this, scene, pluginManager, pluginKey); + + var game = pluginManager.game; + + /** + * A read-only flag that indicates if the game is running under WebGL or Canvas. + * + * @name SpinePlugin#isWebGL + * @type {boolean} + * @readonly + * @since 3.19.0 + */ + this.isWebGL = (game.config.renderType === 2); + + /** + * A custom cache that stores the Spine atlas data. + * + * This cache is global across your game, allowing you to access Spine data loaded from other Scenes, + * no matter which Scene you are in. + * + * @name SpinePlugin#cache + * @type {Phaser.Cache.BaseCache} + * @since 3.19.0 + */ + this.cache = game.cache.addCustom('spine'); + + /** + * A custom cache that stores the Spine Textures. + * + * This cache is global across your game, allowing you to access Spine data loaded from other Scenes, + * no matter which Scene you are in. + * + * @name SpinePlugin#spineTextures + * @type {Phaser.Cache.BaseCache} + * @since 3.19.0 + */ + this.spineTextures = game.cache.addCustom('spineTextures'); + + /** + * A reference to the global JSON Cache. + * + * @name SpinePlugin#json + * @type {Phaser.Cache.BaseCache} + * @since 3.19.0 + */ + this.json = game.cache.json; + + /** + * A reference to the global Texture Manager. + * + * @name SpinePlugin#textures + * @type {Phaser.Textures.TextureManager} + * @since 3.19.0 + */ + this.textures = game.textures; + + /** + * A flag that sets if the Skeleton Renderers will render debug information over the top + * of the skeleton or not. + * + * @name SpinePlugin#drawDebug + * @type {boolean} + * @since 3.19.0 + */ + this.drawDebug = false; + + /** + * The underlying WebGL context of the Phaser renderer. + * + * Only set if running in WebGL mode. + * + * @name SpinePlugin#gl + * @type {WebGLRenderingContext} + * @since 3.19.0 + */ + this.gl; + + /** + * A reference to either the Canvas or WebGL Renderer that this Game is using. + * + * @name SpinePlugin#renderer + * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} + * @since 3.19.0 + */ + this.renderer; + + /** + * An instance of the Spine WebGL Scene Renderer. + * + * There is only one instance of the Scene Renderer shared across the whole plugin. + * + * Only set if running in WebGL mode. + * + * @name SpinePlugin#sceneRenderer + * @type {spine.webgl.SceneRenderer} + * @since 3.19.0 + */ + this.sceneRenderer; + + /** + * An instance of the Spine Skeleton Renderer. + * + * @name SpinePlugin#skeletonRenderer + * @type {(spine.canvas.SkeletonRenderer|spine.webgl.SkeletonRenderer)} + * @since 3.19.0 + */ + this.skeletonRenderer; + + /** + * An instance of the Spine Skeleton Debug Renderer. + * + * Only set if running in WebGL mode. + * + * @name SpinePlugin#skeletonDebugRenderer + * @type {spine.webgl.skeletonDebugRenderer} + * @since 3.19.0 + */ + this.skeletonDebugRenderer; + + /** + * A reference to the Spine runtime. + * This is the runtime created by Esoteric Software. + * + * @name SpinePlugin#plugin + * @type {spine} + * @since 3.19.0 + */ + this.plugin = Spine; + + /** + * An internal vector3 used by the screen to world method. + * + * @name SpinePlugin#temp1 + * @private + * @type {spine.webgl.Vector3} + * @since 3.19.0 + */ + this.temp1; + + /** + * An internal vector3 used by the screen to world method. + * + * @name SpinePlugin#temp2 + * @private + * @type {spine.webgl.Vector3} + * @since 3.19.0 + */ + this.temp2; + + if (this.isWebGL) + { + this.runtime = Spine.webgl; + + this.renderer = game.renderer; + this.gl = game.renderer.gl; + + this.getAtlas = this.getAtlasWebGL; + } + else + { + this.runtime = Spine.canvas; + + this.renderer = game.renderer; + + this.getAtlas = this.getAtlasCanvas; + } + + // Headless mode? + if (!this.renderer) + { + this.renderer = { + width: game.scale.width, + height: game.scale.height, + preRender: NOOP, + postRender: NOOP, + render: NOOP, + destroy: NOOP + }; + } + + var add = function (x, y, key, animationName, loop) + { + var spinePlugin = this.scene.sys[pluginKey]; + var spineGO = new SpineGameObject(this.scene, spinePlugin, x, y, key, animationName, loop); + + this.displayList.add(spineGO); + this.updateList.add(spineGO); + + return spineGO; + }; + + var make = function (config, addToScene) + { + if (config === undefined) { config = {}; } + + var key = GetValue(config, 'key', null); + var animationName = GetValue(config, 'animationName', null); + var loop = GetValue(config, 'loop', false); + + var spinePlugin = this.scene.sys[pluginKey]; + var spineGO = new SpineGameObject(this.scene, spinePlugin, 0, 0, key, animationName, loop); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, spineGO, config); + + // Spine specific + var skinName = GetValue(config, 'skinName', false); + + if (skinName) + { + spineGO.setSkinByName(skinName); + } + + var slotName = GetValue(config, 'slotName', false); + var attachmentName = GetValue(config, 'attachmentName', null); + + if (slotName) + { + spineGO.setAttachment(slotName, attachmentName); + } + + return spineGO.refresh(); + }; + + var addContainer = function (x, y, children) + { + var spinePlugin = this.scene.sys[pluginKey]; + var spineGO = new SpineContainer(this.scene, spinePlugin, x, y, children); + + this.displayList.add(spineGO); + + return spineGO; + }; + + var makeContainer = function (config, addToScene) + { + if (config === undefined) { config = {}; } + + var x = GetValue(config, 'x', 0); + var y = GetValue(config, 'y', 0); + var children = GetValue(config, 'children', null); + + var spinePlugin = this.scene.sys[pluginKey]; + var container = new SpineContainer(this.scene, spinePlugin, x, y, children); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, container, config); + + return container; + }; + + pluginManager.registerFileType('spine', this.spineFileCallback, scene); + pluginManager.registerGameObject('spine', add, make); + pluginManager.registerGameObject('spineContainer', addContainer, makeContainer); + }, + + /** + * Internal boot handler. + * + * @method SpinePlugin#boot + * @private + * @since 3.19.0 + */ + boot: function () + { + if (this.isWebGL) + { + this.bootWebGL(); + this.onResize(); + this.game.scale.on(ResizeEvent, this.onResize, this); + } + else + { + this.bootCanvas(); + } + + var eventEmitter = this.systems.events; + + eventEmitter.once('shutdown', this.shutdown, this); + eventEmitter.once('destroy', this.destroy, this); + + this.game.events.once('destroy', this.gameDestroy, this); + }, + + /** + * Internal boot handler for the Canvas Renderer. + * + * @method SpinePlugin#bootCanvas + * @private + * @since 3.19.0 + */ + bootCanvas: function () + { + this.skeletonRenderer = new Spine.canvas.SkeletonRenderer(this.scene.sys.context); + }, + + /** + * Internal boot handler for the WebGL Renderer. + * + * @method SpinePlugin#bootWebGL + * @private + * @since 3.19.0 + */ + bootWebGL: function () + { + var sceneRenderer = this.renderer.spineSceneRenderer; + + if (!sceneRenderer) + { + sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); + + this.renderer.spineSceneRenderer = sceneRenderer; + } + + // All scene share the same instance + this.sceneRenderer = sceneRenderer; + this.skeletonRenderer = sceneRenderer.skeletonRenderer; + this.skeletonDebugRenderer = sceneRenderer.skeletonDebugRenderer; + + this.temp1 = new Spine.webgl.Vector3(0, 0, 0); + this.temp2 = new Spine.webgl.Vector3(0, 0, 0); + }, + + /** + * Gets a loaded Spine Atlas from the cache and creates a new Spine Texture Atlas, + * then returns it. You do not normally need to invoke this method directly. + * + * @method SpinePlugin#getAtlasCanvas + * @since 3.19.0 + * + * @param {string} key - The key of the Spine Atlas to create. + * + * @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found. + */ + getAtlasCanvas: function (key) + { + var atlasEntry = this.cache.get(key); + + if (!atlasEntry) + { + console.warn('No atlas data for: ' + key); + return; + } + + var atlas; + var spineTextures = this.spineTextures; + + if (spineTextures.has(key)) + { + atlas = spineTextures.get(key); + } + else + { + var textures = this.textures; + + atlas = new this.runtime.TextureAtlas(atlasEntry.data, function (path) + { + return new Spine.canvas.CanvasTexture(textures.get(atlasEntry.prefix + path).getSourceImage()); + }); + } + + return atlas; + }, + + /** + * Gets a loaded Spine Atlas from the cache and creates a new Spine Texture Atlas, + * then returns it. You do not normally need to invoke this method directly. + * + * @method SpinePlugin#getAtlasWebGL + * @since 3.19.0 + * + * @param {string} key - The key of the Spine Atlas to create. + * + * @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found. + */ + getAtlasWebGL: function (key) + { + var atlasEntry = this.cache.get(key); + + if (!atlasEntry) + { + console.warn('No atlas data for: ' + key); + return; + } + + var atlas; + var spineTextures = this.spineTextures; + + if (spineTextures.has(key)) + { + atlas = spineTextures.get(key); + } + else + { + var textures = this.textures; + + var gl = this.sceneRenderer.context.gl; + + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + + atlas = new this.runtime.TextureAtlas(atlasEntry.data, function (path) + { + return new Spine.webgl.GLTexture(gl, textures.get(atlasEntry.prefix + path).getSourceImage(), false); + }); + } + + return atlas; + }, + + /** + * Adds a Spine Skeleton and Atlas file, or array of files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.spine('spineBoy', 'boy.json', 'boy.atlas', true); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary. The associated + * atlas files are scanned for any texture files present in them, which are then loaded. If you have exported + * your Spine data with preMultipliedAlpha set, then you should enable this in the arguments, or you may see black + * outlines around skeleton textures. + * + * The key must be a unique String. It is used to add the file to the global Spine cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Spine cache. + * Loading a file using a key that is already taken will result in a warning. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.spine({ + * key: 'mainmenu', + * jsonURL: 'boy.json', + * atlasURL: 'boy.atlas', + * preMultipliedAlpha: true + * }); + * ``` + * + * If you need to load multiple Spine atlas files, provide them as an array: + * + * ```javascript + * function preload () + * { + * this.load.spine('demos', 'demos.json', [ 'atlas1.atlas', 'atlas2.atlas' ], true); + * } + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.SpineFileConfig` for more details. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the data from the Spine plugin. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Spine Plugin has been built or loaded into Phaser. + * + * @method Phaser.Loader.LoaderPlugin#spine + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.19.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} jsonURL - The absolute or relative URL to load the Spine json file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {string|string[]} atlasURL - The absolute or relative URL to load the Spine atlas file from. If undefined or `null` it will be set to `.atlas`, i.e. if `key` was "alien" then the URL will be "alien.atlas". + * @param {boolean} [preMultipliedAlpha=false] - Do the texture files include pre-multiplied alpha or not? + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the Spine json file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the Spine atlas file. Used in replacement of the Loaders default XHR Settings. + * @param {object} [settings] - An external Settings configuration object { prefix: '' } + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ + spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings, settings) + { + var multifile; + settings = settings || {}; + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new SpineFile(this, key[i]); + + // Support prefix key + multifile.prefix = multifile.prefix || settings.prefix || ''; + + this.addFile(multifile.files); + } + } + else + { + multifile = new SpineFile(this, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings); + + // Support prefix key + multifile.prefix = multifile.prefix || settings.prefix || ''; + + this.addFile(multifile.files); + } + + return this; + }, + + /** + * Converts the given x and y screen coordinates into the world space of the given Skeleton. + * + * Only works in WebGL. + * + * @method SpinePlugin#worldToLocal + * @since 3.19.0 + * + * @param {number} x - The screen space x coordinate to convert. + * @param {number} y - The screen space y coordinate to convert. + * @param {spine.Skeleton} skeleton - The Spine Skeleton to convert into. + * @param {spine.Bone} [bone] - Optional bone of the Skeleton to convert into. + * + * @return {spine.Vector2} A Vector2 containing the translated point. + */ + worldToLocal: function (x, y, skeleton, bone) + { + var temp1 = this.temp1; + var temp2 = this.temp2; + var camera = this.sceneRenderer.camera; + + temp1.set(x + skeleton.x, y - skeleton.y, 0); + + var width = camera.viewportWidth; + var height = camera.viewportHeight; + + camera.screenToWorld(temp1, width, height); + + if (bone && bone.parent !== null) + { + bone.parent.worldToLocal(temp2.set(temp1.x - skeleton.x, temp1.y - skeleton.y, 0)); + + return new this.runtime.Vector2(temp2.x, temp2.y); + } + else if (bone) + { + return new this.runtime.Vector2(temp1.x - skeleton.x, temp1.y - skeleton.y); + } + else + { + return new this.runtime.Vector2(temp1.x, temp1.y); + } + }, + + /** + * Returns a Spine Vector2 based on the given x and y values. + * + * @method SpinePlugin#getVector2 + * @since 3.19.0 + * + * @param {number} x - The Vector x value. + * @param {number} y - The Vector y value. + * + * @return {spine.Vector2} A Spine Vector2 based on the given values. + */ + getVector2: function (x, y) + { + return new this.runtime.Vector2(x, y); + }, + + /** + * Returns a Spine Vector2 based on the given x, y and z values. + * + * Only works in WebGL. + * + * @method SpinePlugin#getVector3 + * @since 3.19.0 + * + * @param {number} x - The Vector x value. + * @param {number} y - The Vector y value. + * @param {number} z - The Vector z value. + * + * @return {spine.Vector2} A Spine Vector2 based on the given values. + */ + getVector3: function (x, y, z) + { + return new Spine.webgl.Vector3(x, y, z); + }, + + /** + * Sets `drawBones` in the Spine Skeleton Debug Renderer. + * + * Only works in WebGL. + * + * @method SpinePlugin#setDebugBones + * @since 3.19.0 + * + * @param {boolean} [value=true] - The value to set in the debug property. + * + * @return {this} This Spine Plugin. + */ + setDebugBones: function (value) + { + if (value === undefined) { value = true; } + + this.skeletonDebugRenderer.drawBones = value; + + return this; + }, + + /** + * Sets `drawRegionAttachments` in the Spine Skeleton Debug Renderer. + * + * Only works in WebGL. + * + * @method SpinePlugin#setDebugRegionAttachments + * @since 3.19.0 + * + * @param {boolean} [value=true] - The value to set in the debug property. + * + * @return {this} This Spine Plugin. + */ + setDebugRegionAttachments: function (value) + { + if (value === undefined) { value = true; } + + this.skeletonDebugRenderer.drawRegionAttachments = value; + + return this; + }, + + /** + * Sets `drawBoundingBoxes` in the Spine Skeleton Debug Renderer. + * + * Only works in WebGL. + * + * @method SpinePlugin#setDebugBoundingBoxes + * @since 3.19.0 + * + * @param {boolean} [value=true] - The value to set in the debug property. + * + * @return {this} This Spine Plugin. + */ + setDebugBoundingBoxes: function (value) + { + if (value === undefined) { value = true; } + + this.skeletonDebugRenderer.drawBoundingBoxes = value; + + return this; + }, + + /** + * Sets `drawMeshHull` in the Spine Skeleton Debug Renderer. + * + * Only works in WebGL. + * + * @method SpinePlugin#setDebugMeshHull + * @since 3.19.0 + * + * @param {boolean} [value=true] - The value to set in the debug property. + * + * @return {this} This Spine Plugin. + */ + setDebugMeshHull: function (value) + { + if (value === undefined) { value = true; } + + this.skeletonDebugRenderer.drawMeshHull = value; + + return this; + }, + + /** + * Sets `drawMeshTriangles` in the Spine Skeleton Debug Renderer. + * + * Only works in WebGL. + * + * @method SpinePlugin#setDebugMeshTriangles + * @since 3.19.0 + * + * @param {boolean} [value=true] - The value to set in the debug property. + * + * @return {this} This Spine Plugin. + */ + setDebugMeshTriangles: function (value) + { + if (value === undefined) { value = true; } + + this.skeletonDebugRenderer.drawMeshTriangles = value; + + return this; + }, + + /** + * Sets `drawPaths` in the Spine Skeleton Debug Renderer. + * + * Only works in WebGL. + * + * @method SpinePlugin#setDebugPaths + * @since 3.19.0 + * + * @param {boolean} [value=true] - The value to set in the debug property. + * + * @return {this} This Spine Plugin. + */ + setDebugPaths: function (value) + { + if (value === undefined) { value = true; } + + this.skeletonDebugRenderer.drawPaths = value; + + return this; + }, + + /** + * Sets `drawSkeletonXY` in the Spine Skeleton Debug Renderer. + * + * Only works in WebGL. + * + * @method SpinePlugin#setDebugSkeletonXY + * @since 3.19.0 + * + * @param {boolean} [value=true] - The value to set in the debug property. + * + * @return {this} This Spine Plugin. + */ + setDebugSkeletonXY: function (value) + { + if (value === undefined) { value = true; } + + this.skeletonDebugRenderer.drawSkeletonXY = value; + + return this; + }, + + /** + * Sets `drawClipping` in the Spine Skeleton Debug Renderer. + * + * Only works in WebGL. + * + * @method SpinePlugin#setDebugClipping + * @since 3.19.0 + * + * @param {boolean} [value=true] - The value to set in the debug property. + * + * @return {this} This Spine Plugin. + */ + setDebugClipping: function (value) + { + if (value === undefined) { value = true; } + + this.skeletonDebugRenderer.drawClipping = value; + + return this; + }, + + /** + * Sets the given vertex effect on the Spine Skeleton Renderer. + * + * Only works in WebGL. + * + * @method SpinePlugin#setEffect + * @since 3.19.0 + * + * @param {spine.VertexEffect} [effect] - The vertex effect to set on the Skeleton Renderer. + * + * @return {this} This Spine Plugin. + */ + setEffect: function (effect) + { + this.sceneRenderer.skeletonRenderer.vertexEffect = effect; + + return this; + }, + + /** + * Creates a Spine Skeleton based on the given key and optional Skeleton JSON data. + * + * The Skeleton data should have already been loaded before calling this method. + * + * @method SpinePlugin#createSkeleton + * @since 3.19.0 + * + * @param {string} key - The key of the Spine skeleton data, as loaded by the plugin. If the Spine JSON contains multiple skeletons, reference them with a period, i.e. `set.spineBoy`. + * @param {object} [skeletonJSON] - Optional Skeleton JSON data to use, instead of getting it from the cache. + * + * @return {(any|null)} This Spine Skeleton data object, or `null` if the key was invalid. + */ + createSkeleton: function (key, skeletonJSON) + { + var atlasKey = key; + var jsonKey = key; + var split = (key.indexOf('.') !== -1); + + if (split) + { + var parts = key.split('.'); + + atlasKey = parts.shift(); + jsonKey = parts.join('.'); + } + + var atlasData = this.cache.get(atlasKey); + var atlas = this.getAtlas(atlasKey); + + if (!atlas) + { + return null; + } + + if (!this.spineTextures.has(atlasKey)) + { + var gl = this.gl; + var i; + var atlasPage; + var realTextureKey; + + if (this.isWebGL) + { + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + } + + for (i = 0; i < atlas.pages.length; i ++) + { + atlasPage = atlas.pages[i]; + realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name; + if (this.isWebGL) + { + atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false)); + } + else + { + atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage())); + } + } + + this.spineTextures.add(atlasKey, atlas); + } + + var preMultipliedAlpha = atlasData.preMultipliedAlpha; + + var atlasLoader = new this.runtime.AtlasAttachmentLoader(atlas); + + var skeletonJson = new this.runtime.SkeletonJson(atlasLoader); + + var data; + + if (skeletonJSON) + { + data = skeletonJSON; + } + else + { + var json = this.json.get(atlasKey); + + data = (split) ? GetValue(json, jsonKey) : json; + } + + if (data) + { + var skeletonData = skeletonJson.readSkeletonData(data); + + var skeleton = new this.runtime.Skeleton(skeletonData); + + return { skeletonData: skeletonData, skeleton: skeleton, preMultipliedAlpha: preMultipliedAlpha }; + } + else + { + return null; + } + }, + + /** + * Creates a new Animation State and Animation State Data for the given skeleton. + * + * The returned object contains two properties: `state` and `stateData` respectively. + * + * @method SpinePlugin#createAnimationState + * @since 3.19.0 + * + * @param {spine.Skeleton} skeleton - The Skeleton to create the Animation State for. + * + * @return {any} An object containing the Animation State and Animation State Data instances. + */ + createAnimationState: function (skeleton) + { + var stateData = new this.runtime.AnimationStateData(skeleton.data); + + var state = new this.runtime.AnimationState(stateData); + + return { stateData: stateData, state: state }; + }, + + /** + * Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose. + * + * The returned object contains two properties: `offset` and `size`: + * + * `offset` - The distance from the skeleton origin to the bottom left corner of the AABB. + * `size` - The width and height of the AABB. + * + * @method SpinePlugin#getBounds + * @since 3.19.0 + * + * @param {spine.Skeleton} skeleton - The Skeleton to get the bounds from. + * + * @return {any} The bounds object. + */ + getBounds: function (skeleton) + { + var offset = new this.runtime.Vector2(); + var size = new this.runtime.Vector2(); + + skeleton.getBounds(offset, size, []); + + return { offset: offset, size: size }; + }, + + /** + * Internal handler for when the renderer resizes. + * + * Only called if running in WebGL. + * + * @method SpinePlugin#onResize + * @since 3.19.0 + */ + onResize: function () + { + var renderer = this.renderer; + var sceneRenderer = this.sceneRenderer; + + var viewportWidth = renderer.width; + var viewportHeight = renderer.height; + + sceneRenderer.camera.position.x = viewportWidth / 2; + sceneRenderer.camera.position.y = viewportHeight / 2; + + sceneRenderer.camera.setViewport(viewportWidth, viewportHeight); + }, + + /** + * The Scene that owns this plugin is shutting down. + * + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method SpinePlugin#shutdown + * @private + * @since 3.19.0 + */ + shutdown: function () + { + var eventEmitter = this.systems.events; + + eventEmitter.off('shutdown', this.shutdown, this); + + if (this.isWebGL) + { + this.game.scale.off(ResizeEvent, this.onResize, this); + } + }, + + /** + * The Scene that owns this plugin is being destroyed. + * + * We need to shutdown and then kill off all external references. + * + * @method SpinePlugin#destroy + * @private + * @since 3.19.0 + */ + destroy: function () + { + this.shutdown(); + + this.game = null; + this.scene = null; + this.systems = null; + + this.cache = null; + this.spineTextures = null; + this.json = null; + this.textures = null; + this.skeletonRenderer = null; + this.gl = null; + }, + + /** + * The Game that owns this plugin is being destroyed. + * + * Dispose of the Scene Renderer and remove the Game Objects. + * + * @method SpinePlugin#gameDestroy + * @private + * @since 3.50.0 + */ + gameDestroy: function () + { + this.pluginManager.removeGameObject('spine', true, true); + this.pluginManager.removeGameObject('spineContainer', true, true); + + this.pluginManager = null; + + var sceneRenderer = this.renderer.spineSceneRenderer; + + if (sceneRenderer) + { + sceneRenderer.dispose(); + } + + this.renderer.spineSceneRenderer = null; + this.sceneRenderer = null; + } + +}); + +SpinePlugin.SpineGameObject = SpineGameObject; +SpinePlugin.SpineContainer = SpineContainer; + +/** + * Creates a new Spine Game Object and adds it to the Scene. + * + * The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from + * skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects + * do not have a Phaser origin. + * + * If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period + * character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains + * multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference + * that. + * + * ```javascript + * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true); + * ``` + * + * The key is optional. If not passed here, you need to call `SpineGameObject.setSkeleton()` to use it. + * + * The animation name is also optional and can be set later via `SpineGameObject.setAnimation`. + * + * Should you wish for more control over the object creation, such as setting a slot attachment or skin + * name, then use `SpinePlugin.make` instead. + * + * @method SpinePlugin#add + * @since 3.19.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} [key] - The key of the Spine Skeleton this Game Object will use, as stored in the Spine Plugin. + * @param {string} [animationName] - The name of the animation to set on this Skeleton. + * @param {boolean} [loop=false] - Should the animation playback be looped or not? + * + * @return {SpineGameObject} The Game Object that was created. + */ + +/** + * Creates a new Spine Game Object from the given configuration file and optionally adds it to the Scene. + * + * The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from + * skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects + * do not have a Phaser origin. + * + * If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period + * character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains + * multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference + * that. + * + * ```javascript + * let jelly = this.make.spine({ + * x: 500, y: 500, key: 'jelly', + * scale: 1.5, + * skinName: 'square_Green', + * animationName: 'jelly-idle', loop: true, + * slotName: 'hat', attachmentName: 'images/La_14' + * }); + * ``` + * + * @method SpinePlugin#make + * @since 3.19.0 + * + * @param {any} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {SpineGameObject} The Game Object that was created. + */ + +module.exports = SpinePlugin; + + +/***/ }), + +/***/ 5782: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var Class = __webpack_require__(7473); +var Container = __webpack_require__(7361); +var SpineContainerRender = __webpack_require__(7738); + +/** + * @classdesc + * A Spine Container is a special kind of Container created specifically for Spine Game Objects. + * + * You have all of the same features of a standard Container, but the rendering functions are optimized specifically + * for Spine Game Objects. You must only add ever Spine Game Objects, or other Spine Containers, to this type of Container. + * Although Phaser will not prevent you from adding other types, they will not render and are likely to throw runtime errors. + * + * To create one in a Scene, use the factory methods: + * + * ```javascript + * this.add.spineContainer(); + * ``` + * + * or + * + * ```javascript + * this.make.spineContainer(); + * ``` + * + * Note that you should not nest Spine Containers inside regular Containers if you wish to use masks on the + * container children. You can, however, mask children of Spine Containers if they are embedded within other + * Spine Containers. In short, if you need masking, don't mix and match the types. + * + * See the Container documentation for further details about what Containers can do. + * + * @class SpineContainer + * @extends Phaser.GameObjects.Container + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene that this Game Object belongs to. + * @param {SpinePlugin} pluginManager - A reference to the Phaser Spine Plugin. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {SpineGameObject[]} [children] - An optional array of Spine Game Objects to add to this Container. + */ +var SpineContainer = new Class({ + + Extends: Container, + + Mixins: [ + SpineContainerRender + ], + + initialize: + + function SpineContainer (scene, plugin, x, y, children) + { + Container.call(this, scene, x, y, children); + + // Same as SpineGameObject, to prevent the renderer from mis-typing it when batching + this.type = 'Spine'; + + /** + * A reference to the Spine Plugin. + * + * @name SpineContainer#plugin + * @type {SpinePlugin} + * @since 3.50.0 + */ + this.plugin = plugin; + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method SpineContainer#preDestroy + * @protected + * @since 3.50.0 + */ + preDestroy: function () + { + this.removeAll(!!this.exclusive); + + this.localTransform.destroy(); + this.tempTransformMatrix.destroy(); + + this.list = []; + this._displayList = null; + this.plugin = null; + } + +}); + +module.exports = SpineContainer; + + +/***/ }), + +/***/ 8064: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Container#renderCanvas + * @since 3.4.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var SpineContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) +{ + var children = container.list; + + if (children.length === 0) + { + return; + } + + camera.addToRenderList(container); + + var transformMatrix = container.localTransform; + + if (parentMatrix) + { + transformMatrix.loadIdentity(); + transformMatrix.multiply(parentMatrix); + transformMatrix.translate(container.x, container.y); + transformMatrix.rotate(container.rotation); + transformMatrix.scale(container.scaleX, container.scaleY); + } + else + { + transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); + } + + var containerHasBlendMode = (container.blendMode !== -1); + + if (!containerHasBlendMode) + { + // If Container is SKIP_TEST then set blend mode to be Normal + renderer.setBlendMode(0); + } + + var alpha = container._alpha; + var scrollFactorX = container.scrollFactorX; + var scrollFactorY = container.scrollFactorY; + + if (container.mask) + { + container.mask.preRenderCanvas(renderer, null, camera); + } + + for (var i = 0; i < children.length; i++) + { + var child = children[i]; + + if (!child.willRender(camera)) + { + continue; + } + + var childAlpha = child.alpha; + var childScrollFactorX = child.scrollFactorX; + var childScrollFactorY = child.scrollFactorY; + + if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode) + { + // If Container doesn't have its own blend mode, then a child can have one + renderer.setBlendMode(child.blendMode); + } + + // Set parent values + child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); + child.setAlpha(childAlpha * alpha); + + // Render + child.renderCanvas(renderer, child, camera, transformMatrix); + + // Restore original values + child.setAlpha(childAlpha); + child.setScrollFactor(childScrollFactorX, childScrollFactorY); + } + + if (container.mask) + { + container.mask.postRenderCanvas(renderer); + } +}; + +module.exports = SpineContainerCanvasRenderer; + + +/***/ }), + +/***/ 7738: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1984); +var renderCanvas = __webpack_require__(1984); + +if (true) +{ + renderWebGL = __webpack_require__(434); +} + +if (true) +{ + renderCanvas = __webpack_require__(8064); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), + +/***/ 434: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method SpineContainerWebGLRenderer#renderWebGL + * @since 3.50.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {SpineContainer} container - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var SpineContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) +{ + var plugin = container.plugin; + var sceneRenderer = plugin.sceneRenderer; + var children = container.list; + + if (children.length === 0) + { + if (sceneRenderer.batcher.isDrawing && renderer.finalType) + { + sceneRenderer.end(); + + renderer.pipelines.rebind(); + } + + return; + } + + camera.addToRenderList(container); + + var transformMatrix = container.localTransform; + + if (parentMatrix) + { + transformMatrix.loadIdentity(); + transformMatrix.multiply(parentMatrix); + transformMatrix.translate(container.x, container.y); + transformMatrix.rotate(container.rotation); + transformMatrix.scale(container.scaleX, container.scaleY); + } + else + { + transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); + } + + if (renderer.newType) + { + // flush + clear if this is a new type + renderer.pipelines.clear(); + + sceneRenderer.begin(); + } + + var rendererNextType = renderer.nextTypeMatch; + + // Force these to avoid batch flushing during SpineGameObject.renderWebGL + renderer.nextTypeMatch = true; + renderer.newType = false; + + for (var i = 0; i < children.length; i++) + { + var child = children[i]; + + if (child.willRender(camera, container)) + { + var mask = child.mask; + + if (mask) + { + sceneRenderer.end(); + + renderer.pipelines.rebind(); + + mask.preRenderWebGL(renderer, child, camera); + + renderer.pipelines.clear(); + + sceneRenderer.begin(); + } + + child.renderWebGL(renderer, child, camera, transformMatrix, container); + + if (mask) + { + sceneRenderer.end(); + + renderer.pipelines.rebind(); + + mask.postRenderWebGL(renderer, camera); + + renderer.pipelines.clear(); + + sceneRenderer.begin(); + } + } + } + + renderer.nextTypeMatch = rendererNextType; + + if (!rendererNextType) + { + // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch + sceneRenderer.end(); + + // And rebind the previous pipeline + renderer.pipelines.rebind(); + } +}; + +module.exports = SpineContainerWebGLRenderer; + + +/***/ }), + +/***/ 6576: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#COMPLETE + * @since 3.19.0 + */ +module.exports = 'complete'; + + +/***/ }), + +/***/ 8621: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Dispose Event. + * + * @event SpinePluginEvents#DISPOSE + * @since 3.19.0 + */ +module.exports = 'dispose'; + + +/***/ }), + +/***/ 8944: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The End Event. + * + * @event SpinePluginEvents#END + * @since 3.19.0 + */ +module.exports = 'end'; + + +/***/ }), + +/***/ 7494: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Custom Event Event. + * + * @event SpinePluginEvents#EVENT + * @since 3.19.0 + */ +module.exports = 'event'; + + +/***/ }), + +/***/ 1908: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Interrupted Event. + * + * @event SpinePluginEvents#INTERRUPTED + * @since 3.19.0 + */ +module.exports = 'interrupted'; + + +/***/ }), + +/***/ 5591: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Start Event. + * + * @event SpinePluginEvents#START + * @since 3.19.0 + */ +module.exports = 'start'; + + +/***/ }), + +/***/ 5146: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace SpinePluginEvents + */ + +module.exports = { + + COMPLETE: __webpack_require__(6576), + DISPOSE: __webpack_require__(8621), + END: __webpack_require__(8944), + EVENT: __webpack_require__(7494), + INTERRUPTED: __webpack_require__(1908), + START: __webpack_require__(5591) + +}; + + +/***/ }), + +/***/ 8332: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var AngleBetween = __webpack_require__(6412); +var Clamp = __webpack_require__(2915); +var Class = __webpack_require__(7473); +var ComponentsComputedSize = __webpack_require__(1991); +var ComponentsDepth = __webpack_require__(3131); +var ComponentsFlip = __webpack_require__(9660); +var ComponentsScrollFactor = __webpack_require__(4627); +var ComponentsTransform = __webpack_require__(3212); +var ComponentsVisible = __webpack_require__(8414); +var CounterClockwise = __webpack_require__(3426); +var DegToRad = __webpack_require__(7149); +var GameObject = __webpack_require__(2273); +var RadToDeg = __webpack_require__(4208); +var SpineEvents = __webpack_require__(5146); +var SpineGameObjectRender = __webpack_require__(2762); /** * @classdesc @@ -46805,8 +25585,453 @@ module.exports = SpineGameObject; /***/ }), -/* 228 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 2753: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var CounterClockwise = __webpack_require__(3426); +var RadToDeg = __webpack_require__(4208); +var Wrap = __webpack_require__(8445); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method SpineGameObject#renderCanvas + * @since 3.19.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {SpineGameObject} src - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var SpineGameObjectCanvasRenderer = function (renderer, src, camera, parentMatrix) +{ + var context = renderer.currentContext; + + var plugin = src.plugin; + var skeleton = src.skeleton; + var skeletonRenderer = plugin.skeletonRenderer; + + var camMatrix = renderer._tempMatrix1; + var spriteMatrix = renderer._tempMatrix2; + var calcMatrix = renderer._tempMatrix3; + + camera.addToRenderList(src); + + spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY)); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = src.x; + spriteMatrix.f = src.y; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + else + { + spriteMatrix.e -= camera.scrollX * src.scrollFactorX; + spriteMatrix.f -= camera.scrollY * src.scrollFactorY; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + + skeleton.x = calcMatrix.tx; + skeleton.y = calcMatrix.ty; + + skeleton.scaleX = calcMatrix.scaleX; + + // Inverse or we get upside-down skeletons + skeleton.scaleY = calcMatrix.scaleY * -1; + + if (src.scaleX < 0) + { + skeleton.scaleX *= -1; + + src.root.rotation = RadToDeg(calcMatrix.rotationNormalized); + } + else + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360); + } + + if (src.scaleY < 0) + { + skeleton.scaleY *= -1; + + if (src.scaleX < 0) + { + src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2); + } + else + { + src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2); + } + } + + if (camera.renderToTexture) + { + skeleton.y = calcMatrix.ty; + skeleton.scaleY *= -1; + } + + skeleton.updateWorldTransform(); + + skeletonRenderer.ctx = context; + skeletonRenderer.debugRendering = (plugin.drawDebug || src.drawDebug); + + context.save(); + + skeletonRenderer.draw(skeleton); + + context.restore(); +}; + +module.exports = SpineGameObjectCanvasRenderer; + + +/***/ }), + +/***/ 2762: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var renderWebGL = __webpack_require__(1984); +var renderCanvas = __webpack_require__(1984); +var renderDirect = __webpack_require__(1984); + +if (true) +{ + renderWebGL = __webpack_require__(4290); + renderDirect = __webpack_require__(780); +} + +if (true) +{ + renderCanvas = __webpack_require__(2753); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas, + renderDirect: renderDirect + +}; + + +/***/ }), + +/***/ 780: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var Clamp = __webpack_require__(2915); +var CounterClockwise = __webpack_require__(3426); +var GetCalcMatrix = __webpack_require__(2208); +var RadToDeg = __webpack_require__(4208); +var Wrap = __webpack_require__(8445); + +/** + * Directly renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method SpineGameObject#renderDirect + * @since 3.50.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {SpineGameObject} src - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + * @param {SpineContainer} [container] - If this Spine object is in a Spine Container, this is a reference to it. + */ +var SpineGameObjectWebGLDirect = function (renderer, src, camera, parentMatrix, container) +{ + var plugin = src.plugin; + var skeleton = src.skeleton; + var sceneRenderer = plugin.sceneRenderer; + + // flush + clear previous pipeline if this is a new type + renderer.pipelines.clear(); + + sceneRenderer.begin(); + + var scrollFactorX = src.scrollFactorX; + var scrollFactorY = src.scrollFactorY; + var alpha = skeleton.color.a; + + if (container) + { + src.scrollFactorX = container.scrollFactorX; + src.scrollFactorY = container.scrollFactorY; + + skeleton.color.a = Clamp(alpha * container.alpha, 0, 1); + } + + camera.addToRenderList(src); + + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; + + var viewportHeight = renderer.height; + + skeleton.x = calcMatrix.tx; + skeleton.y = viewportHeight - calcMatrix.ty; + + skeleton.scaleX = calcMatrix.scaleX; + skeleton.scaleY = calcMatrix.scaleY; + + if (src.scaleX < 0) + { + skeleton.scaleX *= -1; + + // -180 degrees to account for the difference in Spine vs. Phaser rotation when inversely scaled + src.root.rotation = Wrap(RadToDeg(calcMatrix.rotationNormalized) - 180, 0, 360); + } + else + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360); + } + + if (src.scaleY < 0) + { + skeleton.scaleY *= -1; + + if (src.scaleX < 0) + { + src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2); + } + else + { + src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2); + } + } + + /* + if (renderer.currentFramebuffer !== null) + { + skeleton.y = calcMatrix.ty; + skeleton.scaleY *= -1; + } + */ + + skeleton.updateWorldTransform(); + + // Draw the current skeleton + + sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); + + if (container) + { + src.scrollFactorX = scrollFactorX; + src.scrollFactorY = scrollFactorY; + skeleton.color.a = alpha; + } + + if (plugin.drawDebug || src.drawDebug) + { + // Because if we don't, the bones render positions are completely wrong (*sigh*) + var oldX = skeleton.x; + var oldY = skeleton.y; + + skeleton.x = 0; + skeleton.y = 0; + + sceneRenderer.drawSkeletonDebug(skeleton, src.preMultipliedAlpha); + + skeleton.x = oldX; + skeleton.y = oldY; + } + + // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch + sceneRenderer.end(); + + // And rebind the previous pipeline + renderer.pipelines.rebind(); +}; + +module.exports = SpineGameObjectWebGLDirect; + + +/***/ }), + +/***/ 4290: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var Clamp = __webpack_require__(2915); +var CounterClockwise = __webpack_require__(3426); +var GetCalcMatrix = __webpack_require__(2208); +var RadToDeg = __webpack_require__(4208); +var Wrap = __webpack_require__(8445); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method SpineGameObject#renderWebGL + * @since 3.19.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {SpineGameObject} src - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + * @param {SpineContainer} [container] - If this Spine object is in a Spine Container, this is a reference to it. + */ +var SpineGameObjectWebGLRenderer = function (renderer, src, camera, parentMatrix, container) +{ + var plugin = src.plugin; + var skeleton = src.skeleton; + var sceneRenderer = plugin.sceneRenderer; + + if (renderer.newType) + { + // flush + clear previous pipeline if this is a new type + renderer.pipelines.clear(); + + sceneRenderer.begin(); + } + + var scrollFactorX = src.scrollFactorX; + var scrollFactorY = src.scrollFactorY; + var alpha = skeleton.color.a; + + if (container) + { + src.scrollFactorX = container.scrollFactorX; + src.scrollFactorY = container.scrollFactorY; + + skeleton.color.a = Clamp(alpha * container.alpha, 0, 1); + } + + camera.addToRenderList(src); + + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; + + var viewportHeight = renderer.height; + + skeleton.x = calcMatrix.tx; + skeleton.y = viewportHeight - calcMatrix.ty; + + skeleton.scaleX = calcMatrix.scaleX; + skeleton.scaleY = calcMatrix.scaleY; + + if (src.scaleX < 0) + { + skeleton.scaleX *= -1; + + // -180 degrees to account for the difference in Spine vs. Phaser rotation when inversely scaled + src.root.rotation = Wrap(RadToDeg(calcMatrix.rotationNormalized) - 180, 0, 360); + } + else + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360); + } + + if (src.scaleY < 0) + { + skeleton.scaleY *= -1; + + if (src.scaleX < 0) + { + src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2); + } + else + { + src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2); + } + } + + /* + if (renderer.currentFramebuffer !== null) + { + skeleton.y = calcMatrix.ty; + skeleton.scaleY *= -1; + } + */ + + skeleton.updateWorldTransform(); + + // Draw the current skeleton + + sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); + + if (container) + { + src.scrollFactorX = scrollFactorX; + src.scrollFactorY = scrollFactorY; + skeleton.color.a = alpha; + } + + if (plugin.drawDebug || src.drawDebug) + { + // Because if we don't, the bones render positions are completely wrong (*sigh*) + var oldX = skeleton.x; + var oldY = skeleton.y; + + skeleton.x = 0; + skeleton.y = 0; + + sceneRenderer.drawSkeletonDebug(skeleton, src.preMultipliedAlpha); + + skeleton.x = oldX; + skeleton.y = oldY; + } + + if (!renderer.nextTypeMatch) + { + // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch + sceneRenderer.end(); + + // And rebind the previous pipeline + renderer.pipelines.rebind(); + } +}; + +module.exports = SpineGameObjectWebGLRenderer; + + +/***/ }), + +/***/ 9454: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -46814,8 +26039,153 @@ module.exports = SpineGameObject; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); -var Events = __webpack_require__(229); +/** + * Global constants. + * + * @ignore + */ + +var CONST = { + + /** + * Phaser Release Version + * + * @name Phaser.VERSION + * @const + * @type {string} + * @since 3.0.0 + */ + VERSION: '3.60.0', + + BlendModes: __webpack_require__(8351), + + ScaleModes: __webpack_require__(8196), + + /** + * This setting will auto-detect if the browser is capable of suppporting WebGL. + * If it is, it will use the WebGL Renderer. If not, it will fall back to the Canvas Renderer. + * + * @name Phaser.AUTO + * @const + * @type {number} + * @since 3.0.0 + */ + AUTO: 0, + + /** + * Forces Phaser to only use the Canvas Renderer, regardless if the browser supports + * WebGL or not. + * + * @name Phaser.CANVAS + * @const + * @type {number} + * @since 3.0.0 + */ + CANVAS: 1, + + /** + * Forces Phaser to use the WebGL Renderer. If the browser does not support it, there is + * no fallback to Canvas with this setting, so you should trap it and display a suitable + * message to the user. + * + * @name Phaser.WEBGL + * @const + * @type {number} + * @since 3.0.0 + */ + WEBGL: 2, + + /** + * A Headless Renderer doesn't create either a Canvas or WebGL Renderer. However, it still + * absolutely relies on the DOM being present and available. This mode is meant for unit testing, + * not for running Phaser on the server, which is something you really shouldn't do. + * + * @name Phaser.HEADLESS + * @const + * @type {number} + * @since 3.0.0 + */ + HEADLESS: 3, + + /** + * In Phaser the value -1 means 'forever' in lots of cases, this const allows you to use it instead + * to help you remember what the value is doing in your code. + * + * @name Phaser.FOREVER + * @const + * @type {number} + * @since 3.0.0 + */ + FOREVER: -1, + + /** + * Direction constant. + * + * @name Phaser.NONE + * @const + * @type {number} + * @since 3.0.0 + */ + NONE: 4, + + /** + * Direction constant. + * + * @name Phaser.UP + * @const + * @type {number} + * @since 3.0.0 + */ + UP: 5, + + /** + * Direction constant. + * + * @name Phaser.DOWN + * @const + * @type {number} + * @since 3.0.0 + */ + DOWN: 6, + + /** + * Direction constant. + * + * @name Phaser.LEFT + * @const + * @type {number} + * @since 3.0.0 + */ + LEFT: 7, + + /** + * Direction constant. + * + * @name Phaser.RIGHT + * @const + * @type {number} + * @since 3.0.0 + */ + RIGHT: 8 + +}; + +module.exports = CONST; + + +/***/ }), + +/***/ 1081: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Events = __webpack_require__(6748); /** * @callback DataEachCallback @@ -47065,10 +26435,10 @@ var DataManager = new Class({ * @generic {any} T * @genericUse {(string|T)} - [key] * - * @param {(string|object)} key - The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored. - * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored. + * @param {(string|object)} key - The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. + * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ set: function (key, data) { @@ -47107,9 +26477,9 @@ var DataManager = new Class({ * @genericUse {(string|T)} - [key] * * @param {(string|object)} key - The key to increase the value for. - * @param {*} [data] - The value to increase for the given key. + * @param {number} [data=1] - The amount to increase the given key by. Pass a negative value to decrease the key. * - * @return {Phaser.Data.DataManager} This DataManager object. + * @return {this} This Data Manager instance. */ inc: function (key, data) { @@ -47124,6 +26494,7 @@ var DataManager = new Class({ } var value = this.get(key); + if (value === undefined) { value = 0; @@ -47150,7 +26521,7 @@ var DataManager = new Class({ * * @param {(string|object)} key - The key to toggle the value for. * - * @return {Phaser.Data.DataManager} This DataManager object. + * @return {this} This Data Manager instance. */ toggle: function (key) { @@ -47177,7 +26548,7 @@ var DataManager = new Class({ * @param {string} key - The key to set the value for. * @param {*} data - The value to set. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ setValue: function (key, data) { @@ -47241,7 +26612,7 @@ var DataManager = new Class({ * @param {*} [context] - Value to use as `this` when executing callback. * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ each: function (callback, context) { @@ -47278,7 +26649,7 @@ var DataManager = new Class({ * @param {Object.} data - The data to merge. * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ merge: function (data, overwrite) { @@ -47314,7 +26685,7 @@ var DataManager = new Class({ * * @param {(string|string[])} key - The key to remove, or an array of keys to remove. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ remove: function (key) { @@ -47348,7 +26719,7 @@ var DataManager = new Class({ * * @param {string} key - The key to set the value for. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ removeValue: function (key) { @@ -47420,7 +26791,7 @@ var DataManager = new Class({ * * @param {boolean} value - Whether to freeze or unfreeze the Data Manager. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ setFreeze: function (value) { @@ -47435,7 +26806,7 @@ var DataManager = new Class({ * @method Phaser.Data.DataManager#reset * @since 3.0.0 * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ reset: function () { @@ -47521,33 +26892,9 @@ module.exports = DataManager; /***/ }), -/* 229 */ -/***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Data.Events - */ - -module.exports = { - - CHANGE_DATA: __webpack_require__(230), - CHANGE_DATA_KEY: __webpack_require__(231), - DESTROY: __webpack_require__(232), - REMOVE_DATA: __webpack_require__(233), - SET_DATA: __webpack_require__(234) - -}; - - -/***/ }), -/* 230 */ -/***/ (function(module, exports) { +/***/ 9044: +/***/ ((module) => { /** * @author Richard Davey @@ -47579,8 +26926,9 @@ module.exports = 'changedata'; /***/ }), -/* 231 */ -/***/ (function(module, exports) { + +/***/ 7801: +/***/ ((module) => { /** * @author Richard Davey @@ -47610,8 +26958,9 @@ module.exports = 'changedata-'; /***/ }), -/* 232 */ -/***/ (function(module, exports) { + +/***/ 4873: +/***/ ((module) => { /** * @author Richard Davey @@ -47632,8 +26981,9 @@ module.exports = 'destroy'; /***/ }), -/* 233 */ -/***/ (function(module, exports) { + +/***/ 9966: +/***/ ((module) => { /** * @author Richard Davey @@ -47661,8 +27011,9 @@ module.exports = 'removedata'; /***/ }), -/* 234 */ -/***/ (function(module, exports) { + +/***/ 4586: +/***/ ((module) => { /** * @author Richard Davey @@ -47690,351 +27041,9 @@ module.exports = 'setdata'; /***/ }), -/* 235 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -var has = Object.prototype.hasOwnProperty - , prefix = '~'; - -/** - * Constructor to create a storage for our `EE` objects. - * An `Events` instance is a plain object whose properties are event names. - * - * @constructor - * @private - */ -function Events() {} - -// -// We try to not inherit from `Object.prototype`. In some engines creating an -// instance in this way is faster than calling `Object.create(null)` directly. -// If `Object.create(null)` is not supported we prefix the event names with a -// character to make sure that the built-in object properties are not -// overridden or used as an attack vector. -// -if (Object.create) { - Events.prototype = Object.create(null); - - // - // This hack is needed because the `__proto__` property is still inherited in - // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. - // - if (!new Events().__proto__) prefix = false; -} - -/** - * Representation of a single event listener. - * - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} [once=false] Specify if the listener is a one-time listener. - * @constructor - * @private - */ -function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; -} - -/** - * Add a listener for a given event. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} once Specify if the listener is a one-time listener. - * @returns {EventEmitter} - * @private - */ -function addListener(emitter, event, fn, context, once) { - if (typeof fn !== 'function') { - throw new TypeError('The listener must be a function'); - } - - var listener = new EE(fn, context || emitter, once) - , evt = prefix ? prefix + event : event; - - if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; - else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); - else emitter._events[evt] = [emitter._events[evt], listener]; - - return emitter; -} - -/** - * Clear event by name. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} evt The Event name. - * @private - */ -function clearEvent(emitter, evt) { - if (--emitter._eventsCount === 0) emitter._events = new Events(); - else delete emitter._events[evt]; -} - -/** - * Minimal `EventEmitter` interface that is molded against the Node.js - * `EventEmitter` interface. - * - * @constructor - * @public - */ -function EventEmitter() { - this._events = new Events(); - this._eventsCount = 0; -} - -/** - * Return an array listing the events for which the emitter has registered - * listeners. - * - * @returns {Array} - * @public - */ -EventEmitter.prototype.eventNames = function eventNames() { - var names = [] - , events - , name; - - if (this._eventsCount === 0) return names; - - for (name in (events = this._events)) { - if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); - } - - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events)); - } - - return names; -}; - -/** - * Return the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Array} The registered listeners. - * @public - */ -EventEmitter.prototype.listeners = function listeners(event) { - var evt = prefix ? prefix + event : event - , handlers = this._events[evt]; - - if (!handlers) return []; - if (handlers.fn) return [handlers.fn]; - - for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { - ee[i] = handlers[i].fn; - } - - return ee; -}; - -/** - * Return the number of listeners listening to a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Number} The number of listeners. - * @public - */ -EventEmitter.prototype.listenerCount = function listenerCount(event) { - var evt = prefix ? prefix + event : event - , listeners = this._events[evt]; - - if (!listeners) return 0; - if (listeners.fn) return 1; - return listeners.length; -}; - -/** - * Calls each of the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Boolean} `true` if the event had listeners, else `false`. - * @public - */ -EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return false; - - var listeners = this._events[evt] - , len = arguments.length - , args - , i; - - if (listeners.fn) { - if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); - - switch (len) { - case 1: return listeners.fn.call(listeners.context), true; - case 2: return listeners.fn.call(listeners.context, a1), true; - case 3: return listeners.fn.call(listeners.context, a1, a2), true; - case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } - - for (i = 1, args = new Array(len -1); i < len; i++) { - args[i - 1] = arguments[i]; - } - - listeners.fn.apply(listeners.context, args); - } else { - var length = listeners.length - , j; - - for (i = 0; i < length; i++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); - - switch (len) { - case 1: listeners[i].fn.call(listeners[i].context); break; - case 2: listeners[i].fn.call(listeners[i].context, a1); break; - case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; - case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; - default: - if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { - args[j - 1] = arguments[j]; - } - - listeners[i].fn.apply(listeners[i].context, args); - } - } - } - - return true; -}; - -/** - * Add a listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.on = function on(event, fn, context) { - return addListener(this, event, fn, context, false); -}; - -/** - * Add a one-time listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.once = function once(event, fn, context) { - return addListener(this, event, fn, context, true); -}; - -/** - * Remove the listeners of a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn Only remove the listeners that match this function. - * @param {*} context Only remove the listeners that have this context. - * @param {Boolean} once Only remove one-time listeners. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return this; - if (!fn) { - clearEvent(this, evt); - return this; - } - - var listeners = this._events[evt]; - - if (listeners.fn) { - if ( - listeners.fn === fn && - (!once || listeners.once) && - (!context || listeners.context === context) - ) { - clearEvent(this, evt); - } - } else { - for (var i = 0, events = [], length = listeners.length; i < length; i++) { - if ( - listeners[i].fn !== fn || - (once && !listeners[i].once) || - (context && listeners[i].context !== context) - ) { - events.push(listeners[i]); - } - } - - // - // Reset the array, or remove it completely if we have no more listeners. - // - if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; - else clearEvent(this, evt); - } - - return this; -}; - -/** - * Remove all listeners, or those of the specified event. - * - * @param {(String|Symbol)} [event] The event name. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { - var evt; - - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) clearEvent(this, evt); - } else { - this._events = new Events(); - this._eventsCount = 0; - } - - return this; -}; - -// -// Alias methods names because people roll like that. -// -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; -EventEmitter.prototype.addListener = EventEmitter.prototype.on; - -// -// Expose the prefix. -// -EventEmitter.prefixed = prefix; - -// -// Allow `EventEmitter` to be imported as module namespace. -// -EventEmitter.EventEmitter = EventEmitter; - -// -// Expose the module. -// -if (true) { - module.exports = EventEmitter; -} - - -/***/ }), -/* 236 */ -/***/ (function(module, exports) { +/***/ 6748: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -48043,25 +27052,24 @@ if (true) { */ /** - * The Game Object Added to Scene Event. - * - * This event is dispatched when a Game Object is added to a Scene. - * - * Listen for it on a Game Object instance using `GameObject.on('addedtoscene', listener)`. - * - * @event Phaser.GameObjects.Events#ADDED_TO_SCENE - * @type {string} - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene. - * @param {Phaser.Scene} scene - The Scene to which the Game Object was added. + * @namespace Phaser.Data.Events */ -module.exports = 'addedtoscene'; + +module.exports = { + + CHANGE_DATA: __webpack_require__(9044), + CHANGE_DATA_KEY: __webpack_require__(7801), + DESTROY: __webpack_require__(4873), + REMOVE_DATA: __webpack_require__(9966), + SET_DATA: __webpack_require__(4586) + +}; /***/ }), -/* 237 */ -/***/ (function(module, exports) { + +/***/ 3004: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -48069,26 +27077,563 @@ module.exports = 'addedtoscene'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var Browser = __webpack_require__(2776); + /** - * The Game Object Destroy Event. + * Determines the audio playback capabilities of the device running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.audio` from within any Scene. * - * This event is dispatched when a Game Object instance is being destroyed. - * - * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`. - * - * @event Phaser.GameObjects.Events#DESTROY - * @type {string} + * @typedef {object} Phaser.Device.Audio * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed. - * @param {boolean} fromScene - `True` if this Game Object is being destroyed by the Scene, `false` if not. + * @property {boolean} audioData - Can this device play HTML Audio tags? + * @property {boolean} dolby - Can this device play EC-3 Dolby Digital Plus files? + * @property {boolean} m4a - Can this device can play m4a files. + * @property {boolean} aac - Can this device can play aac files. + * @property {boolean} flac - Can this device can play flac files. + * @property {boolean} mp3 - Can this device play mp3 files? + * @property {boolean} ogg - Can this device play ogg files? + * @property {boolean} opus - Can this device play opus files? + * @property {boolean} wav - Can this device play wav files? + * @property {boolean} webAudio - Does this device have the Web Audio API? + * @property {boolean} webm - Can this device play webm files? */ -module.exports = 'destroy'; +var Audio = { + + flac: false, + aac: false, + audioData: false, + dolby: false, + m4a: false, + mp3: false, + ogg: false, + opus: false, + wav: false, + webAudio: false, + webm: false + +}; + +function init () +{ + if (typeof importScripts === 'function') + { + return Audio; + } + + Audio.audioData = !!(window['Audio']); + + Audio.webAudio = !!(window['AudioContext'] || window['webkitAudioContext']); + + var audioElement = document.createElement('audio'); + var result = !!audioElement.canPlayType; + + try + { + if (result) + { + var CanPlay = function (type1, type2) + { + var canPlayType1 = audioElement.canPlayType('audio/' + type1).replace(/^no$/, ''); + + if (type2) + { + return Boolean(canPlayType1 || audioElement.canPlayType('audio/' + type2).replace(/^no$/, '')); + } + else + { + return Boolean(canPlayType1); + } + }; + + // wav Mimetypes accepted: + // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements + + Audio.ogg = CanPlay('ogg; codecs="vorbis"'); + Audio.opus = CanPlay('ogg; codecs="opus"', 'opus'); + Audio.mp3 = CanPlay('mpeg'); + Audio.wav = CanPlay('wav'); + Audio.m4a = CanPlay('x-m4a'); + Audio.aac = CanPlay('aac'); + Audio.flac = CanPlay('flac', 'x-flac'); + Audio.webm = CanPlay('webm; codecs="vorbis"'); + + if (audioElement.canPlayType('audio/mp4; codecs="ec-3"') !== '') + { + if (Browser.edge) + { + Audio.dolby = true; + } + else if (Browser.safari && Browser.safariVersion >= 9) + { + if ((/Mac OS X (\d+)_(\d+)/).test(navigator.userAgent)) + { + var major = parseInt(RegExp.$1, 10); + var minor = parseInt(RegExp.$2, 10); + + if ((major === 10 && minor >= 11) || major > 10) + { + Audio.dolby = true; + } + } + } + } + } + } + catch (e) + { + // Nothing to do here + } + + return Audio; +} + +module.exports = init(); /***/ }), -/* 238 */ -/***/ (function(module, exports) { + +/***/ 2776: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var OS = __webpack_require__(5203); + +/** + * Determines the browser type and version running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.browser` from within any Scene. + * + * @typedef {object} Phaser.Device.Browser + * @since 3.0.0 + * + * @property {boolean} chrome - Set to true if running in Chrome. + * @property {boolean} edge - Set to true if running in Microsoft Edge browser. + * @property {boolean} firefox - Set to true if running in Firefox. + * @property {boolean} ie - Set to true if running in Internet Explorer 11 or less (not Edge). + * @property {boolean} mobileSafari - Set to true if running in Mobile Safari. + * @property {boolean} opera - Set to true if running in Opera. + * @property {boolean} safari - Set to true if running in Safari. + * @property {boolean} silk - Set to true if running in the Silk browser (as used on the Amazon Kindle) + * @property {boolean} trident - Set to true if running a Trident version of Internet Explorer (IE11+) + * @property {number} chromeVersion - If running in Chrome this will contain the major version number. + * @property {number} firefoxVersion - If running in Firefox this will contain the major version number. + * @property {number} ieVersion - If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Browser.trident and Browser.tridentVersion. + * @property {number} safariVersion - If running in Safari this will contain the major version number. + * @property {number} tridentVersion - If running in Internet Explorer 11 this will contain the major version number. See {@link http://msdn.microsoft.com/en-us/library/ie/ms537503(v=vs.85).aspx} + */ +var Browser = { + + chrome: false, + chromeVersion: 0, + edge: false, + firefox: false, + firefoxVersion: 0, + ie: false, + ieVersion: 0, + mobileSafari: false, + opera: false, + safari: false, + safariVersion: 0, + silk: false, + trident: false, + tridentVersion: 0, + es2019: false + +}; + +function init () +{ + var ua = navigator.userAgent; + + if ((/Edg\/\d+/).test(ua)) + { + Browser.edge = true; + Browser.es2019 = true; + } + else if ((/OPR/).test(ua)) + { + Browser.opera = true; + Browser.es2019 = true; + } + else if ((/Chrome\/(\d+)/).test(ua) && !OS.windowsPhone) + { + Browser.chrome = true; + Browser.chromeVersion = parseInt(RegExp.$1, 10); + Browser.es2019 = (Browser.chromeVersion > 69); + } + else if ((/Firefox\D+(\d+)/).test(ua)) + { + Browser.firefox = true; + Browser.firefoxVersion = parseInt(RegExp.$1, 10); + Browser.es2019 = (Browser.firefoxVersion > 10); + } + else if ((/AppleWebKit/).test(ua) && OS.iOS) + { + Browser.mobileSafari = true; + } + else if ((/MSIE (\d+\.\d+);/).test(ua)) + { + Browser.ie = true; + Browser.ieVersion = parseInt(RegExp.$1, 10); + } + else if ((/Version\/(\d+\.\d+) Safari/).test(ua) && !OS.windowsPhone) + { + Browser.safari = true; + Browser.safariVersion = parseInt(RegExp.$1, 10); + Browser.es2019 = (Browser.safariVersion > 10); + } + else if ((/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/).test(ua)) + { + Browser.ie = true; + Browser.trident = true; + Browser.tridentVersion = parseInt(RegExp.$1, 10); + Browser.ieVersion = parseInt(RegExp.$3, 10); + } + + // Silk gets its own if clause because its ua also contains 'Safari' + if ((/Silk/).test(ua)) + { + Browser.silk = true; + } + + return Browser; +} + +module.exports = init(); + + +/***/ }), + +/***/ 6505: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CanvasPool = __webpack_require__(8073); + +/** + * Determines the canvas features of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.canvasFeatures` from within any Scene. + * + * @typedef {object} Phaser.Device.CanvasFeatures + * @since 3.0.0 + * + * @property {boolean} supportInverseAlpha - Set to true if the browser supports inversed alpha. + * @property {boolean} supportNewBlendModes - Set to true if the browser supports new canvas blend modes. + */ +var CanvasFeatures = { + + supportInverseAlpha: false, + supportNewBlendModes: false + +}; + +function checkBlendMode () +{ + var pngHead = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/'; + var pngEnd = 'AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg=='; + + var magenta = new Image(); + + magenta.onload = function () + { + var yellow = new Image(); + + yellow.onload = function () + { + var canvas = CanvasPool.create2D(yellow, 6); + var context = canvas.getContext('2d', { willReadFrequently: true }); + + context.globalCompositeOperation = 'multiply'; + + context.drawImage(magenta, 0, 0); + context.drawImage(yellow, 2, 0); + + if (!context.getImageData(2, 0, 1, 1)) + { + return false; + } + + var data = context.getImageData(2, 0, 1, 1).data; + + CanvasPool.remove(yellow); + + CanvasFeatures.supportNewBlendModes = (data[0] === 255 && data[1] === 0 && data[2] === 0); + }; + + yellow.src = pngHead + '/wCKxvRF' + pngEnd; + }; + + magenta.src = pngHead + 'AP804Oa6' + pngEnd; + + return false; +} + +function checkInverseAlpha () +{ + var canvas = CanvasPool.create2D(this, 2); + var context = canvas.getContext('2d', { willReadFrequently: true }); + + context.fillStyle = 'rgba(10, 20, 30, 0.5)'; + + // Draw a single pixel + context.fillRect(0, 0, 1, 1); + + // Get the color values + var s1 = context.getImageData(0, 0, 1, 1); + + if (s1 === null) + { + return false; + } + + // Plot them to x2 + context.putImageData(s1, 1, 0); + + // Get those values + var s2 = context.getImageData(1, 0, 1, 1); + + var result = (s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]); + + CanvasPool.remove(this); + + // Compare and return + return result; +} + +function init () +{ + if (typeof importScripts !== 'function' && document !== undefined) + { + CanvasFeatures.supportNewBlendModes = checkBlendMode(); + CanvasFeatures.supportInverseAlpha = checkInverseAlpha(); + } + + return CanvasFeatures; +} + +module.exports = init(); + + +/***/ }), + +/***/ 6543: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var OS = __webpack_require__(5203); +var Browser = __webpack_require__(2776); +var CanvasPool = __webpack_require__(8073); + +/** + * Determines the features of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.features` from within any Scene. + * + * @typedef {object} Phaser.Device.Features + * @since 3.0.0 + * + * @property {boolean} canvas - Is canvas available? + * @property {?boolean} canvasBitBltShift - True if canvas supports a 'copy' bitblt onto itself when the source and destination regions overlap. + * @property {boolean} file - Is file available? + * @property {boolean} fileSystem - Is fileSystem available? + * @property {boolean} getUserMedia - Does the device support the getUserMedia API? + * @property {boolean} littleEndian - Is the device big or little endian? (only detected if the browser supports TypedArrays) + * @property {boolean} localStorage - Is localStorage available? + * @property {boolean} pointerLock - Is Pointer Lock available? + * @property {boolean} stableSort - Is Array.sort stable? + * @property {boolean} support32bit - Does the device context support 32bit pixel manipulation using array buffer views? + * @property {boolean} vibration - Does the device support the Vibration API? + * @property {boolean} webGL - Is webGL available? + * @property {boolean} worker - Is worker available? + */ +var Features = { + + canvas: false, + canvasBitBltShift: null, + file: false, + fileSystem: false, + getUserMedia: true, + littleEndian: false, + localStorage: false, + pointerLock: false, + stableSort: false, + support32bit: false, + vibration: false, + webGL: false, + worker: false + +}; + +// Check Little or Big Endian system. +// @author Matt DesLauriers (@mattdesl) +function checkIsLittleEndian () +{ + var a = new ArrayBuffer(4); + var b = new Uint8Array(a); + var c = new Uint32Array(a); + + b[0] = 0xa1; + b[1] = 0xb2; + b[2] = 0xc3; + b[3] = 0xd4; + + if (c[0] === 0xd4c3b2a1) + { + return true; + } + + if (c[0] === 0xa1b2c3d4) + { + return false; + } + else + { + // Could not determine endianness + return null; + } +} + +function init () +{ + if (typeof importScripts === 'function') + { + return Features; + } + + Features.canvas = !!window['CanvasRenderingContext2D']; + + try + { + Features.localStorage = !!localStorage.getItem; + } + catch (error) + { + Features.localStorage = false; + } + + Features.file = !!window['File'] && !!window['FileReader'] && !!window['FileList'] && !!window['Blob']; + Features.fileSystem = !!window['requestFileSystem']; + + var isUint8 = false; + + var testWebGL = function () + { + if (window['WebGLRenderingContext']) + { + try + { + var canvas = CanvasPool.createWebGL(this); + + var ctx = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); + + var canvas2D = CanvasPool.create2D(this); + + var ctx2D = canvas2D.getContext('2d', { willReadFrequently: true }); + + // Can't be done on a webgl context + var image = ctx2D.createImageData(1, 1); + + // Test to see if ImageData uses CanvasPixelArray or Uint8ClampedArray. + // @author Matt DesLauriers (@mattdesl) + isUint8 = image.data instanceof Uint8ClampedArray; + + CanvasPool.remove(canvas); + CanvasPool.remove(canvas2D); + + return !!ctx; + } + catch (e) + { + return false; + } + } + + return false; + }; + + Features.webGL = testWebGL(); + + Features.worker = !!window['Worker']; + + Features.pointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document; + + navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia; + + window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL; + + Features.getUserMedia = Features.getUserMedia && !!navigator.getUserMedia && !!window.URL; + + // Older versions of firefox (< 21) apparently claim support but user media does not actually work + if (Browser.firefox && Browser.firefoxVersion < 21) + { + Features.getUserMedia = false; + } + + // Excludes iOS versions as they generally wrap UIWebView (eg. Safari WebKit) and it + // is safer to not try and use the fast copy-over method. + if (!OS.iOS && (Browser.ie || Browser.firefox || Browser.chrome)) + { + Features.canvasBitBltShift = true; + } + + // Known not to work + if (Browser.safari || Browser.mobileSafari) + { + Features.canvasBitBltShift = false; + } + + navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate; + + if (navigator.vibrate) + { + Features.vibration = true; + } + + if (typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint32Array !== 'undefined') + { + Features.littleEndian = checkIsLittleEndian(); + } + + Features.support32bit = ( + typeof ArrayBuffer !== 'undefined' && + typeof Uint8ClampedArray !== 'undefined' && + typeof Int32Array !== 'undefined' && + Features.littleEndian !== null && + isUint8 + ); + + return Features; +} + +module.exports = init(); + + +/***/ }), + +/***/ 3922: +/***/ ((module) => { /** * @author Richard Davey @@ -48097,25 +27642,189 @@ module.exports = 'destroy'; */ /** - * The Game Object Removed from Scene Event. + * Determines the full screen support of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.fullscreen` from within any Scene. * - * This event is dispatched when a Game Object is removed from a Scene. + * @typedef {object} Phaser.Device.Fullscreen + * @since 3.0.0 * - * Listen for it on a Game Object instance using `GameObject.on('removedfromscene', listener)`. - * - * @event Phaser.GameObjects.Events#REMOVED_FROM_SCENE - * @type {string} - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene. - * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed. + * @property {boolean} available - Does the browser support the Full Screen API? + * @property {boolean} keyboard - Does the browser support access to the Keyboard during Full Screen mode? + * @property {string} cancel - If the browser supports the Full Screen API this holds the call you need to use to cancel it. + * @property {string} request - If the browser supports the Full Screen API this holds the call you need to use to activate it. */ -module.exports = 'removedfromscene'; +var Fullscreen = { + + available: false, + cancel: '', + keyboard: false, + request: '' + +}; + +/** +* Checks for support of the Full Screen API. +* +* @ignore +*/ +function init () +{ + if (typeof importScripts === 'function') + { + return Fullscreen; + } + + var i; + + var suffix1 = 'Fullscreen'; + var suffix2 = 'FullScreen'; + + var fs = [ + 'request' + suffix1, + 'request' + suffix2, + 'webkitRequest' + suffix1, + 'webkitRequest' + suffix2, + 'msRequest' + suffix1, + 'msRequest' + suffix2, + 'mozRequest' + suffix2, + 'mozRequest' + suffix1 + ]; + + for (i = 0; i < fs.length; i++) + { + if (document.documentElement[fs[i]]) + { + Fullscreen.available = true; + Fullscreen.request = fs[i]; + break; + } + } + + var cfs = [ + 'cancel' + suffix2, + 'exit' + suffix1, + 'webkitCancel' + suffix2, + 'webkitExit' + suffix1, + 'msCancel' + suffix2, + 'msExit' + suffix1, + 'mozCancel' + suffix2, + 'mozExit' + suffix1 + ]; + + if (Fullscreen.available) + { + for (i = 0; i < cfs.length; i++) + { + if (document[cfs[i]]) + { + Fullscreen.cancel = cfs[i]; + break; + } + } + } + + // Keyboard Input? + // Safari 5.1 says it supports fullscreen keyboard, but is lying. + if (window['Element'] && Element['ALLOW_KEYBOARD_INPUT'] && !(/ Version\/5\.1(?:\.\d+)? Safari\//).test(navigator.userAgent)) + { + Fullscreen.keyboard = true; + } + + Object.defineProperty(Fullscreen, 'active', { get: function () { return !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement); } }); + + return Fullscreen; +} + +module.exports = init(); /***/ }), -/* 239 */ -/***/ (function(module, exports) { + +/***/ 1454: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Browser = __webpack_require__(2776); + +/** + * Determines the input support of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.input` from within any Scene. + * + * @typedef {object} Phaser.Device.Input + * @since 3.0.0 + * + * @property {?string} wheelType - The newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll' + * @property {boolean} gamepads - Is navigator.getGamepads available? + * @property {boolean} mspointer - Is mspointer available? + * @property {boolean} touch - Is touch available? + */ +var Input = { + + gamepads: false, + mspointer: false, + touch: false, + wheelEvent: null + +}; + +function init () +{ + if (typeof importScripts === 'function') + { + return Input; + } + + if ('ontouchstart' in document.documentElement || (navigator.maxTouchPoints && navigator.maxTouchPoints >= 1)) + { + Input.touch = true; + } + + if (navigator.msPointerEnabled || navigator.pointerEnabled) + { + Input.mspointer = true; + } + + if (navigator.getGamepads) + { + Input.gamepads = true; + } + + // See https://developer.mozilla.org/en-US/docs/Web/Events/wheel + if ('onwheel' in window || (Browser.ie && 'WheelEvent' in window)) + { + // DOM3 Wheel Event: FF 17+, IE 9+, Chrome 31+, Safari 7+ + Input.wheelEvent = 'wheel'; + } + else if ('onmousewheel' in window) + { + // Non-FF legacy: IE 6-9, Chrome 1-31, Safari 5-7. + Input.wheelEvent = 'mousewheel'; + } + else if (Browser.firefox && 'MouseScrollEvent' in window) + { + // FF prior to 17. This should probably be scrubbed. + Input.wheelEvent = 'DOMMouseScroll'; + } + + return Input; +} + +module.exports = init(); + + +/***/ }), + +/***/ 5203: +/***/ ((module) => { /** * @author Richard Davey @@ -48124,31 +27833,191 @@ module.exports = 'removedfromscene'; */ /** - * The Video Game Object Complete Event. + * Determines the operating system of the device running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.os` from within any Scene. * - * This event is dispatched when a Video finishes playback by reaching the end of its duration. It - * is also dispatched if a video marker sequence is being played and reaches the end. + * @typedef {object} Phaser.Device.OS + * @since 3.0.0 * - * Note that not all videos can fire this event. Live streams, for example, have no fixed duration, - * so never technically 'complete'. - * - * If a video is stopped from playback, via the `Video.stop` method, it will emit the - * `VIDEO_STOP` event instead of this one. - * - * Listen for it from a Video Game Object instance using `Video.on('complete', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_COMPLETE - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed playback. + * @property {boolean} android - Is running on android? + * @property {boolean} chromeOS - Is running on chromeOS? + * @property {boolean} cordova - Is the game running under Apache Cordova? + * @property {boolean} crosswalk - Is the game running under the Intel Crosswalk XDK? + * @property {boolean} desktop - Is running on a desktop? + * @property {boolean} ejecta - Is the game running under Ejecta? + * @property {boolean} electron - Is the game running under GitHub Electron? + * @property {boolean} iOS - Is running on iOS? + * @property {boolean} iPad - Is running on iPad? + * @property {boolean} iPhone - Is running on iPhone? + * @property {boolean} kindle - Is running on an Amazon Kindle? + * @property {boolean} linux - Is running on linux? + * @property {boolean} macOS - Is running on macOS? + * @property {boolean} node - Is the game running under Node.js? + * @property {boolean} nodeWebkit - Is the game running under Node-Webkit? + * @property {boolean} webApp - Set to true if running as a WebApp, i.e. within a WebView + * @property {boolean} windows - Is running on windows? + * @property {boolean} windowsPhone - Is running on a Windows Phone? + * @property {number} iOSVersion - If running in iOS this will contain the major version number. + * @property {number} pixelRatio - PixelRatio of the host device? */ -module.exports = 'complete'; +var OS = { + + android: false, + chromeOS: false, + cordova: false, + crosswalk: false, + desktop: false, + ejecta: false, + electron: false, + iOS: false, + iOSVersion: 0, + iPad: false, + iPhone: false, + kindle: false, + linux: false, + macOS: false, + node: false, + nodeWebkit: false, + pixelRatio: 1, + webApp: false, + windows: false, + windowsPhone: false + +}; + +function init () +{ + if (typeof importScripts === 'function') + { + return OS; + } + + var ua = navigator.userAgent; + + if ((/Windows/).test(ua)) + { + OS.windows = true; + } + else if ((/Mac OS/).test(ua) && !((/like Mac OS/).test(ua))) + { + // Because iOS 13 identifies as Mac OS: + if (navigator.maxTouchPoints && navigator.maxTouchPoints > 2) + { + OS.iOS = true; + OS.iPad = true; + + (navigator.appVersion).match(/Version\/(\d+)/); + + OS.iOSVersion = parseInt(RegExp.$1, 10); + } + else + { + OS.macOS = true; + } + } + else if ((/Android/).test(ua)) + { + OS.android = true; + } + else if ((/Linux/).test(ua)) + { + OS.linux = true; + } + else if ((/iP[ao]d|iPhone/i).test(ua)) + { + OS.iOS = true; + + (navigator.appVersion).match(/OS (\d+)/); + + OS.iOSVersion = parseInt(RegExp.$1, 10); + + OS.iPhone = ua.toLowerCase().indexOf('iphone') !== -1; + OS.iPad = ua.toLowerCase().indexOf('ipad') !== -1; + } + else if ((/Kindle/).test(ua) || (/\bKF[A-Z][A-Z]+/).test(ua) || (/Silk.*Mobile Safari/).test(ua)) + { + OS.kindle = true; + + // This will NOT detect early generations of Kindle Fire, I think there is no reliable way... + // E.g. "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true" + } + else if ((/CrOS/).test(ua)) + { + OS.chromeOS = true; + } + + if ((/Windows Phone/i).test(ua) || (/IEMobile/i).test(ua)) + { + OS.android = false; + OS.iOS = false; + OS.macOS = false; + OS.windows = true; + OS.windowsPhone = true; + } + + var silk = (/Silk/).test(ua); + + if (OS.windows || OS.macOS || (OS.linux && !silk) || OS.chromeOS) + { + OS.desktop = true; + } + + // Windows Phone / Table reset + if (OS.windowsPhone || (((/Windows NT/i).test(ua)) && ((/Touch/i).test(ua)))) + { + OS.desktop = false; + } + + // WebApp mode in iOS + if (navigator.standalone) + { + OS.webApp = true; + } + + if (typeof importScripts !== 'function') + { + if (window.cordova !== undefined) + { + OS.cordova = true; + } + + if (window.ejecta !== undefined) + { + OS.ejecta = true; + } + } + + if (typeof process !== 'undefined' && process.versions && process.versions.node) + { + OS.node = true; + } + + if (OS.node && typeof process.versions === 'object') + { + OS.nodeWebkit = !!process.versions['node-webkit']; + + OS.electron = !!process.versions.electron; + } + + if ((/Crosswalk/).test(ua)) + { + OS.crosswalk = true; + } + + OS.pixelRatio = window['devicePixelRatio'] || 1; + + return OS; +} + +module.exports = init(); /***/ }), -/* 240 */ -/***/ (function(module, exports) { + +/***/ 2131: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -48156,29 +28025,155 @@ module.exports = 'complete'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var GetFastValue = __webpack_require__(4597); + /** - * The Video Game Object Created Event. + * Determines the video support of the browser running this Phaser Game instance. * - * This event is dispatched when the texture for a Video has been created. This happens - * when enough of the video source has been loaded that the browser is able to render a - * frame from it. + * These values are read-only and populated during the boot sequence of the game. * - * Listen for it from a Video Game Object instance using `Video.on('created', listener)`. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.video` from within any Scene. * - * @event Phaser.GameObjects.Events#VIDEO_CREATED - * @type {string} - * @since 3.20.0 + * In Phaser 3.20 the properties were renamed to drop the 'Video' suffix. * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. - * @param {number} width - The width of the video. - * @param {number} height - The height of the video. + * @typedef {object} Phaser.Device.Video + * @since 3.0.0 + * + * @property {boolean} h264 - Can this device play h264 mp4 video files? + * @property {boolean} hls - Can this device play hls video files? + * @property {boolean} mp4 - Can this device play h264 mp4 video files? + * @property {boolean} m4v - Can this device play m4v (typically mp4) video files? + * @property {boolean} ogg - Can this device play ogg video files? + * @property {boolean} vp9 - Can this device play vp9 video files? + * @property {boolean} webm - Can this device play webm video files? + * @property {function} getVideoURL - Returns the first video URL that can be played by this browser. */ -module.exports = 'created'; +var Video = { + + h264: false, + hls: false, + mp4: false, + m4v: false, + ogg: false, + vp9: false, + webm: false, + hasRequestVideoFrame: false + +}; + +function init () +{ + if (typeof importScripts === 'function') + { + return Video; + } + + var videoElement = document.createElement('video'); + var result = !!videoElement.canPlayType; + var no = /^no$/; + + try + { + if (result) + { + if (videoElement.canPlayType('video/ogg; codecs="theora"').replace(no, '')) + { + Video.ogg = true; + } + + if (videoElement.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(no, '')) + { + // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546 + Video.h264 = true; + Video.mp4 = true; + } + + if (videoElement.canPlayType('video/x-m4v').replace(no, '')) + { + Video.m4v = true; + } + + if (videoElement.canPlayType('video/webm; codecs="vp8, vorbis"').replace(no, '')) + { + Video.webm = true; + } + + if (videoElement.canPlayType('video/webm; codecs="vp9"').replace(no, '')) + { + Video.vp9 = true; + } + + if (videoElement.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(no, '')) + { + Video.hls = true; + } + } + } + catch (e) + { + // Nothing to do + } + + if (videoElement.parentNode) + { + videoElement.parentNode.removeChild(videoElement); + } + + Video.getVideoURL = function (urls) + { + if (!Array.isArray(urls)) + { + urls = [ urls ]; + } + + for (var i = 0; i < urls.length; i++) + { + var url = GetFastValue(urls[i], 'url', urls[i]); + + if (url.indexOf('blob:') === 0) + { + return { + url: url, + type: '' + }; + } + + var videoType; + + if (url.indexOf('data:') === 0) + { + videoType = url.split(',')[0].match(/\/(.*?);/); + } + else + { + videoType = url.match(/\.([a-zA-Z0-9]+)($|\?)/); + } + + videoType = GetFastValue(urls[i], 'type', (videoType) ? videoType[1] : '').toLowerCase(); + + if (Video[videoType]) + { + return { + url: url, + type: videoType + }; + } + } + + return null; + }; + + return Video; +} + +module.exports = init(); /***/ }), -/* 241 */ -/***/ (function(module, exports) { + +/***/ 9356: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -48186,720 +28181,5213 @@ module.exports = 'created'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * The Video Game Object Error Event. - * - * This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type. - * - * Listen for it from a Video Game Object instance using `Video.on('error', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_ERROR - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. - * @param {Event} event - The native DOM event the browser raised during playback. - */ -module.exports = 'error'; - - -/***/ }), -/* 242 */ -/***/ (function(module, exports) { +// This singleton is instantiated as soon as Phaser loads, +// before a Phaser.Game instance has even been created. +// Which means all instances of Phaser Games can share it, +// without having to re-poll the device all over again /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} + * @namespace Phaser.Device + * @since 3.0.0 */ /** - * The Video Game Object Loop Event. + * @typedef {object} Phaser.DeviceConf * - * This event is dispatched when a Video that is currently playing has looped. This only - * happens if the `loop` parameter was specified, or the `setLoop` method was called, - * and if the video has a fixed duration. Video streams, for example, cannot loop, as - * they have no duration. - * - * Looping is based on the result of the Video `timeupdate` event. This event is not - * frame-accurate, due to the way browsers work, so please do not rely on this loop - * event to be time or frame precise. - * - * Listen for it from a Video Game Object instance using `Video.on('loop', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_LOOP - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which has looped. - */ -module.exports = 'loop'; - - -/***/ }), -/* 243 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Play Event. - * - * This event is dispatched when a Video begins playback. For videos that do not require - * interaction unlocking, this is usually as soon as the `Video.play` method is called. - * However, for videos that require unlocking, it is fired once playback begins after - * they've been unlocked. - * - * Listen for it from a Video Game Object instance using `Video.on('play', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_PLAY - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. - */ -module.exports = 'play'; - - -/***/ }), -/* 244 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Seeked Event. - * - * This event is dispatched when a Video completes seeking to a new point in its timeline. - * - * Listen for it from a Video Game Object instance using `Video.on('seeked', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_SEEKED - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed seeking. - */ -module.exports = 'seeked'; - - -/***/ }), -/* 245 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Seeking Event. - * - * This event is dispatched when a Video _begins_ seeking to a new point in its timeline. - * When the seek is complete, it will dispatch the `VIDEO_SEEKED` event to conclude. - * - * Listen for it from a Video Game Object instance using `Video.on('seeking', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_SEEKING - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which started seeking. - */ -module.exports = 'seeking'; - - -/***/ }), -/* 246 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Stopped Event. - * - * This event is dispatched when a Video is stopped from playback via a call to the `Video.stop` method, - * either directly via game code, or indirectly as the result of changing a video source or destroying it. - * - * Listen for it from a Video Game Object instance using `Video.on('stop', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_STOP - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which stopped playback. - */ -module.exports = 'stop'; - - -/***/ }), -/* 247 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Timeout Event. - * - * This event is dispatched when a Video has exhausted its allocated time while trying to connect to a video - * source to start playback. - * - * Listen for it from a Video Game Object instance using `Video.on('timeout', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_TIMEOUT - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which timed out. - */ -module.exports = 'timeout'; - - -/***/ }), -/* 248 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Unlocked Event. - * - * This event is dispatched when a Video that was prevented from playback due to the browsers - * Media Engagement Interaction policy, is unlocked by a user gesture. - * - * Listen for it from a Video Game Object instance using `Video.on('unlocked', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_UNLOCKED - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. - */ -module.exports = 'unlocked'; - - -/***/ }), -/* 249 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace SpinePluginEvents + * @property {Phaser.Device.OS} os - The OS Device functions. + * @property {Phaser.Device.Browser} browser - The Browser Device functions. + * @property {Phaser.Device.Features} features - The Features Device functions. + * @property {Phaser.Device.Input} input - The Input Device functions. + * @property {Phaser.Device.Audio} audio - The Audio Device functions. + * @property {Phaser.Device.Video} video - The Video Device functions. + * @property {Phaser.Device.Fullscreen} fullscreen - The Fullscreen Device functions. + * @property {Phaser.Device.CanvasFeatures} canvasFeatures - The Canvas Device functions. */ module.exports = { - COMPLETE: __webpack_require__(250), - DISPOSE: __webpack_require__(251), - END: __webpack_require__(252), - EVENT: __webpack_require__(253), - INTERRUPTED: __webpack_require__(254), - START: __webpack_require__(255) + os: __webpack_require__(5203), + browser: __webpack_require__(2776), + features: __webpack_require__(6543), + input: __webpack_require__(1454), + audio: __webpack_require__(3004), + video: __webpack_require__(2131), + fullscreen: __webpack_require__(3922), + canvasFeatures: __webpack_require__(6505) }; /***/ }), -/* 250 */ -/***/ (function(module, exports) { + +/***/ 5686: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. + * @copyright 2013-2023 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var Class = __webpack_require__(7473); + +var tempMatrix = new Float32Array(20); + /** - * The Complete Event. + * @classdesc + * The ColorMatrix class creates a 5x4 matrix that can be used in shaders and graphics + * operations. It provides methods required to modify the color values, such as adjusting + * the brightness, setting a sepia tone, hue rotation and more. * - * @event SpinePluginEvents#COMPLETE - * @since 3.19.0 - */ -module.exports = 'complete'; - - -/***/ }), -/* 251 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Dispose Event. + * Use the method `getData` to return a Float32Array containing the current color values. * - * @event SpinePluginEvents#DISPOSE - * @since 3.19.0 - */ -module.exports = 'dispose'; - - -/***/ }), -/* 252 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The End Event. - * - * @event SpinePluginEvents#END - * @since 3.19.0 - */ -module.exports = 'end'; - - -/***/ }), -/* 253 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Custom Event Event. - * - * @event SpinePluginEvents#EVENT - * @since 3.19.0 - */ -module.exports = 'event'; - - -/***/ }), -/* 254 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Interrupted Event. - * - * @event SpinePluginEvents#INTERRUPTED - * @since 3.19.0 - */ -module.exports = 'interrupted'; - - -/***/ }), -/* 255 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Start Event. - * - * @event SpinePluginEvents#START - * @since 3.19.0 - */ -module.exports = 'start'; - - -/***/ }), -/* 256 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var renderWebGL = __webpack_require__(2); -var renderCanvas = __webpack_require__(2); -var renderDirect = __webpack_require__(2); - -if (true) -{ - renderWebGL = __webpack_require__(257); - renderDirect = __webpack_require__(258); -} - -if (true) -{ - renderCanvas = __webpack_require__(259); -} - -module.exports = { - - renderWebGL: renderWebGL, - renderCanvas: renderCanvas, - renderDirect: renderDirect - -}; - - -/***/ }), -/* 257 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var Clamp = __webpack_require__(1); -var CounterClockwise = __webpack_require__(8); -var GetCalcMatrix = __webpack_require__(60); -var RadToDeg = __webpack_require__(9); -var Wrap = __webpack_require__(6); - -/** - * Renders this Game Object with the WebGL Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * @method SpineGameObject#renderWebGL - * @since 3.19.0 - * @private - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {SpineGameObject} src - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - * @param {SpineContainer} [container] - If this Spine object is in a Spine Container, this is a reference to it. - */ -var SpineGameObjectWebGLRenderer = function (renderer, src, camera, parentMatrix, container) -{ - var plugin = src.plugin; - var skeleton = src.skeleton; - var sceneRenderer = plugin.sceneRenderer; - - if (renderer.newType) - { - // flush + clear previous pipeline if this is a new type - renderer.pipelines.clear(); - - sceneRenderer.begin(); - } - - var scrollFactorX = src.scrollFactorX; - var scrollFactorY = src.scrollFactorY; - var alpha = skeleton.color.a; - - if (container) - { - src.scrollFactorX = container.scrollFactorX; - src.scrollFactorY = container.scrollFactorY; - - skeleton.color.a = Clamp(alpha * container.alpha, 0, 1); - } - - camera.addToRenderList(src); - - var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; - - var viewportHeight = renderer.height; - - skeleton.x = calcMatrix.tx; - skeleton.y = viewportHeight - calcMatrix.ty; - - skeleton.scaleX = calcMatrix.scaleX; - skeleton.scaleY = calcMatrix.scaleY; - - if (src.scaleX < 0) - { - skeleton.scaleX *= -1; - - // -180 degrees to account for the difference in Spine vs. Phaser rotation when inversely scaled - src.root.rotation = Wrap(RadToDeg(calcMatrix.rotationNormalized) - 180, 0, 360); - } - else - { - // +90 degrees to account for the difference in Spine vs. Phaser rotation - src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360); - } - - if (src.scaleY < 0) - { - skeleton.scaleY *= -1; - - if (src.scaleX < 0) - { - src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2); - } - else - { - src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2); - } - } - - /* - if (renderer.currentFramebuffer !== null) - { - skeleton.y = calcMatrix.ty; - skeleton.scaleY *= -1; - } - */ - - skeleton.updateWorldTransform(); - - // Draw the current skeleton - - sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); - - if (container) - { - src.scrollFactorX = scrollFactorX; - src.scrollFactorY = scrollFactorY; - skeleton.color.a = alpha; - } - - if (plugin.drawDebug || src.drawDebug) - { - // Because if we don't, the bones render positions are completely wrong (*sigh*) - var oldX = skeleton.x; - var oldY = skeleton.y; - - skeleton.x = 0; - skeleton.y = 0; - - sceneRenderer.drawSkeletonDebug(skeleton, src.preMultipliedAlpha); - - skeleton.x = oldX; - skeleton.y = oldY; - } - - if (!renderer.nextTypeMatch) - { - // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch - sceneRenderer.end(); - - // And rebind the previous pipeline - renderer.pipelines.rebind(); - } -}; - -module.exports = SpineGameObjectWebGLRenderer; - - -/***/ }), -/* 258 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var Clamp = __webpack_require__(1); -var CounterClockwise = __webpack_require__(8); -var GetCalcMatrix = __webpack_require__(60); -var RadToDeg = __webpack_require__(9); -var Wrap = __webpack_require__(6); - -/** - * Directly renders this Game Object with the WebGL Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * @method SpineGameObject#renderDirect + * @class ColorMatrix + * @memberof Phaser.Display + * @constructor * @since 3.50.0 - * @private - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {SpineGameObject} src - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - * @param {SpineContainer} [container] - If this Spine object is in a Spine Container, this is a reference to it. */ -var SpineGameObjectWebGLDirect = function (renderer, src, camera, parentMatrix, container) -{ - var plugin = src.plugin; - var skeleton = src.skeleton; - var sceneRenderer = plugin.sceneRenderer; +var ColorMatrix = new Class({ - // flush + clear previous pipeline if this is a new type - renderer.pipelines.clear(); + initialize: - sceneRenderer.begin(); - - var scrollFactorX = src.scrollFactorX; - var scrollFactorY = src.scrollFactorY; - var alpha = skeleton.color.a; - - if (container) + function ColorMatrix () { - src.scrollFactorX = container.scrollFactorX; - src.scrollFactorY = container.scrollFactorY; + /** + * Internal ColorMatrix array. + * + * @name Phaser.Display.ColorMatrix#_matrix + * @type {Float32Array} + * @private + * @since 3.50.0 + */ + this._matrix = new Float32Array(20); - skeleton.color.a = Clamp(alpha * container.alpha, 0, 1); - } + /** + * The value that determines how much of the original color is used + * when mixing the colors. A value between 0 (all original) and 1 (all final) + * + * @name Phaser.Display.ColorMatrix#alpha + * @type {number} + * @since 3.50.0 + */ + this.alpha = 1; - camera.addToRenderList(src); + /** + * Is the ColorMatrix array dirty? + * + * @name Phaser.Display.ColorMatrix#_dirty + * @type {boolean} + * @private + * @since 3.50.0 + */ + this._dirty = true; - var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; + /** + * The matrix data as a Float32Array. + * + * Returned by the `getData` method. + * + * @name Phaser.Display.ColorMatrix#data + * @type {Float32Array} + * @private + * @since 3.50.0 + */ + this._data = new Float32Array(20); - var viewportHeight = renderer.height; + this.reset(); + }, - skeleton.x = calcMatrix.tx; - skeleton.y = viewportHeight - calcMatrix.ty; - - skeleton.scaleX = calcMatrix.scaleX; - skeleton.scaleY = calcMatrix.scaleY; - - if (src.scaleX < 0) + /** + * Sets this ColorMatrix from the given array of color values. + * + * @method Phaser.Display.ColorMatrix#set + * @since 3.50.0 + * + * @param {(number[]|Float32Array)} value - The ColorMatrix values to set. Must have 20 elements. + * + * @return {this} This ColorMatrix instance. + */ + set: function (value) { - skeleton.scaleX *= -1; + this._matrix.set(value); - // -180 degrees to account for the difference in Spine vs. Phaser rotation when inversely scaled - src.root.rotation = Wrap(RadToDeg(calcMatrix.rotationNormalized) - 180, 0, 360); - } - else + this._dirty = true; + + return this; + }, + + /** + * Resets the ColorMatrix to default values and also resets + * the `alpha` property back to 1. + * + * @method Phaser.Display.ColorMatrix#reset + * @since 3.50.0 + * + * @return {this} This ColorMatrix instance. + */ + reset: function () { - // +90 degrees to account for the difference in Spine vs. Phaser rotation - src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360); - } + var m = this._matrix; - if (src.scaleY < 0) + m.fill(0); + + m[0] = 1; + m[6] = 1; + m[12] = 1; + m[18] = 1; + + this.alpha = 1; + + this._dirty = true; + + return this; + }, + + /** + * Gets the ColorMatrix as a Float32Array. + * + * Can be used directly as a 1fv shader uniform value. + * + * @method Phaser.Display.ColorMatrix#getData + * @since 3.50.0 + * + * @return {Float32Array} The ColorMatrix as a Float32Array. + */ + getData: function () { - skeleton.scaleY *= -1; + var data = this._data; - if (src.scaleX < 0) + if (this._dirty) { - src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2); + data.set(this._matrix); + + data[4] /= 255; + data[9] /= 255; + data[14] /= 255; + data[19] /= 255; + + this._dirty = false; } - else + + return data; + }, + + /** + * Changes the brightness of this ColorMatrix by the given amount. + * + * @method Phaser.Display.ColorMatrix#brightness + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of brightness to apply to this ColorMatrix. Between 0 (black) and 1. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + brightness: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var b = value; + + return this.multiply([ + b, 0, 0, 0, 0, + 0, b, 0, 0, 0, + 0, 0, b, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Changes the saturation of this ColorMatrix by the given amount. + * + * @method Phaser.Display.ColorMatrix#saturate + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of saturation to apply to this ColorMatrix. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + saturate: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var x = (value * 2 / 3) + 1; + var y = ((x - 1) * -0.5); + + return this.multiply([ + x, y, y, 0, 0, + y, x, y, 0, 0, + y, y, x, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Desaturates this ColorMatrix (removes color from it). + * + * @method Phaser.Display.ColorMatrix#saturation + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + desaturate: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.saturate(-1, multiply); + }, + + /** + * Rotates the hues of this ColorMatrix by the value given. + * + * @method Phaser.Display.ColorMatrix#hue + * @since 3.50.0 + * + * @param {number} [rotation=0] - The amount of hue rotation to apply to this ColorMatrix, in degrees. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + hue: function (rotation, multiply) + { + if (rotation === undefined) { rotation = 0; } + if (multiply === undefined) { multiply = false; } + + rotation = rotation / 180 * Math.PI; + + var cos = Math.cos(rotation); + var sin = Math.sin(rotation); + var lumR = 0.213; + var lumG = 0.715; + var lumB = 0.072; + + return this.multiply([ + lumR + cos * (1 - lumR) + sin * (-lumR),lumG + cos * (-lumG) + sin * (-lumG),lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0, + lumR + cos * (-lumR) + sin * (0.143),lumG + cos * (1 - lumG) + sin * (0.140),lumB + cos * (-lumB) + sin * (-0.283), 0, 0, + lumR + cos * (-lumR) + sin * (-(1 - lumR)),lumG + cos * (-lumG) + sin * (lumG),lumB + cos * (1 - lumB) + sin * (lumB), 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Sets this ColorMatrix to be grayscale. + * + * @method Phaser.Display.ColorMatrix#grayscale + * @since 3.50.0 + * + * @param {number} [value=1] - The grayscale scale (0 is black). + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + grayscale: function (value, multiply) + { + if (value === undefined) { value = 1; } + if (multiply === undefined) { multiply = false; } + + return this.saturate(-value, multiply); + }, + + /** + * Sets this ColorMatrix to be black and white. + * + * @method Phaser.Display.ColorMatrix#blackWhite + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + blackWhite: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.BLACK_WHITE, multiply); + }, + + /** + * Change the contrast of this ColorMatrix by the amount given. + * + * @method Phaser.Display.ColorMatrix#contrast + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of contrast to apply to this ColorMatrix. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + contrast: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var v = value + 1; + var o = -0.5 * (v - 1); + + return this.multiply([ + v, 0, 0, 0, o, + 0, v, 0, 0, o, + 0, 0, v, 0, o, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Converts this ColorMatrix to have negative values. + * + * @method Phaser.Display.ColorMatrix#negative + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + negative: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.NEGATIVE, multiply); + }, + + /** + * Apply a desaturated luminance to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#desaturateLuminance + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + desaturateLuminance: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.DESATURATE_LUMINANCE, multiply); + }, + + /** + * Applies a sepia tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#sepia + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + sepia: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.SEPIA, multiply); + }, + + /** + * Applies a night vision tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#night + * @since 3.50.0 + * + * @param {number} [intensity=0.1] - The intensity of this effect. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + night: function (intensity, multiply) + { + if (intensity === undefined) { intensity = 0.1; } + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + intensity * (-2.0), -intensity, 0, 0, 0, + -intensity, 0, intensity, 0, 0, + 0, intensity, intensity * 2.0, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a trippy color tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#lsd + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + lsd: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.LSD, multiply); + }, + + /** + * Applies a brown tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#brown + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + brown: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.BROWN, multiply); + }, + + /** + * Applies a vintage pinhole color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#vintagePinhole + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + vintagePinhole: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.VINTAGE, multiply); + }, + + /** + * Applies a kodachrome color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#kodachrome + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + kodachrome: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.KODACHROME, multiply); + }, + + /** + * Applies a technicolor color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#technicolor + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + technicolor: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.TECHNICOLOR, multiply); + }, + + /** + * Applies a polaroid color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#polaroid + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + polaroid: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.POLAROID, multiply); + }, + + /** + * Shifts the values of this ColorMatrix into BGR order. + * + * @method Phaser.Display.ColorMatrix#shiftToBGR + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + shiftToBGR: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.SHIFT_BGR, multiply); + }, + + /** + * Multiplies the two given matrices. + * + * @method Phaser.Display.ColorMatrix#multiply + * @since 3.50.0 + * + * @param {number[]} a - The 5x4 array to multiply with ColorMatrix._matrix. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + multiply: function (a, multiply) + { + if (multiply === undefined) { multiply = false; } + + // Duplicate _matrix into c + + if (!multiply) { - src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2); + this.reset(); } + + var m = this._matrix; + var c = tempMatrix; + + // copy _matrix to tempMatrox + c.set(m); + + m.set([ + // R + (c[0] * a[0]) + (c[1] * a[5]) + (c[2] * a[10]) + (c[3] * a[15]), + (c[0] * a[1]) + (c[1] * a[6]) + (c[2] * a[11]) + (c[3] * a[16]), + (c[0] * a[2]) + (c[1] * a[7]) + (c[2] * a[12]) + (c[3] * a[17]), + (c[0] * a[3]) + (c[1] * a[8]) + (c[2] * a[13]) + (c[3] * a[18]), + (c[0] * a[4]) + (c[1] * a[9]) + (c[2] * a[14]) + (c[3] * a[19]) + c[4], + + // G + (c[5] * a[0]) + (c[6] * a[5]) + (c[7] * a[10]) + (c[8] * a[15]), + (c[5] * a[1]) + (c[6] * a[6]) + (c[7] * a[11]) + (c[8] * a[16]), + (c[5] * a[2]) + (c[6] * a[7]) + (c[7] * a[12]) + (c[8] * a[17]), + (c[5] * a[3]) + (c[6] * a[8]) + (c[7] * a[13]) + (c[8] * a[18]), + (c[5] * a[4]) + (c[6] * a[9]) + (c[7] * a[14]) + (c[8] * a[19]) + c[9], + + // B + (c[10] * a[0]) + (c[11] * a[5]) + (c[12] * a[10]) + (c[13] * a[15]), + (c[10] * a[1]) + (c[11] * a[6]) + (c[12] * a[11]) + (c[13] * a[16]), + (c[10] * a[2]) + (c[11] * a[7]) + (c[12] * a[12]) + (c[13] * a[17]), + (c[10] * a[3]) + (c[11] * a[8]) + (c[12] * a[13]) + (c[13] * a[18]), + (c[10] * a[4]) + (c[11] * a[9]) + (c[12] * a[14]) + (c[13] * a[19]) + c[14], + + // A + (c[15] * a[0]) + (c[16] * a[5]) + (c[17] * a[10]) + (c[18] * a[15]), + (c[15] * a[1]) + (c[16] * a[6]) + (c[17] * a[11]) + (c[18] * a[16]), + (c[15] * a[2]) + (c[16] * a[7]) + (c[17] * a[12]) + (c[18] * a[17]), + (c[15] * a[3]) + (c[16] * a[8]) + (c[17] * a[13]) + (c[18] * a[18]), + (c[15] * a[4]) + (c[16] * a[9]) + (c[17] * a[14]) + (c[18] * a[19]) + c[19] + + ]); + + this._dirty = true; + + return this; } - /* - if (renderer.currentFramebuffer !== null) - { - skeleton.y = calcMatrix.ty; - skeleton.scaleY *= -1; - } - */ +}); - skeleton.updateWorldTransform(); +/** + * A constant array used by the ColorMatrix class for black_white operations. + * + * @name Phaser.Display.ColorMatrix.BLACK_WHITE + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.BLACK_WHITE = [ 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0, 0, 0, 1, 0 ]; - // Draw the current skeleton +/** + * A constant array used by the ColorMatrix class for negative operations. + * + * @name Phaser.Display.ColorMatrix.NEGATIVE + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.NEGATIVE = [ -1, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0 ]; - sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); +/** + * A constant array used by the ColorMatrix class for desatured luminance operations. + * + * @name Phaser.Display.ColorMatrix.DESATURATE_LUMINANCE + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.DESATURATE_LUMINANCE = [ 0.2764723, 0.9297080, 0.0938197, 0, -37.1, 0.2764723, 0.9297080, 0.0938197, 0, -37.1, 0.2764723, 0.9297080, 0.0938197, 0, -37.1, 0, 0, 0, 1, 0 ]; - if (container) - { - src.scrollFactorX = scrollFactorX; - src.scrollFactorY = scrollFactorY; - skeleton.color.a = alpha; - } +/** + * A constant array used by the ColorMatrix class for sepia operations. + * + * @name Phaser.Display.ColorMatrix.SEPIA + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.SEPIA = [ 0.393, 0.7689999, 0.18899999, 0, 0, 0.349, 0.6859999, 0.16799999, 0, 0, 0.272, 0.5339999, 0.13099999, 0, 0, 0, 0, 0, 1, 0 ]; - if (plugin.drawDebug || src.drawDebug) - { - // Because if we don't, the bones render positions are completely wrong (*sigh*) - var oldX = skeleton.x; - var oldY = skeleton.y; +/** + * A constant array used by the ColorMatrix class for lsd operations. + * + * @name Phaser.Display.ColorMatrix.LSD + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.LSD = [ 2, -0.4, 0.5, 0, 0, -0.5, 2, -0.4, 0, 0, -0.4, -0.5, 3, 0, 0, 0, 0, 0, 1, 0 ]; - skeleton.x = 0; - skeleton.y = 0; +/** + * A constant array used by the ColorMatrix class for brown operations. + * + * @name Phaser.Display.ColorMatrix.BROWN + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.BROWN = [ 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873, -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127, 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283, 0, 0, 0, 1, 0 ]; - sceneRenderer.drawSkeletonDebug(skeleton, src.preMultipliedAlpha); +/** + * A constant array used by the ColorMatrix class for vintage pinhole operations. + * + * @name Phaser.Display.ColorMatrix.VINTAGE + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.VINTAGE = [ 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123, 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591, 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296, 0, 0, 0, 1, 0 ]; - skeleton.x = oldX; - skeleton.y = oldY; - } +/** + * A constant array used by the ColorMatrix class for kodachrome operations. + * + * @name Phaser.Display.ColorMatrix.KODACHROME + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.KODACHROME = [ 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502, -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203, -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, 0, 0, 0, 1, 0 ]; - // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch - sceneRenderer.end(); +/** + * A constant array used by the ColorMatrix class for technicolor operations. + * + * @name Phaser.Display.ColorMatrix.TECHNICOLOR + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.TECHNICOLOR = [ 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337, -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398, -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138, 0, 0, 0, 1, 0 ]; - // And rebind the previous pipeline - renderer.pipelines.rebind(); -}; +/** + * A constant array used by the ColorMatrix class for polaroid shift operations. + * + * @name Phaser.Display.ColorMatrix.POLAROID + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.POLAROID = [ 1.438, -0.062, -0.062, 0, 0, -0.122, 1.378, -0.122, 0, 0, -0.016, -0.016, 1.483, 0, 0, 0, 0, 0, 1, 0 ]; -module.exports = SpineGameObjectWebGLDirect; +/** + * A constant array used by the ColorMatrix class for shift BGR operations. + * + * @name Phaser.Display.ColorMatrix.SHIFT_BGR + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.SHIFT_BGR = [ 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 ]; + +module.exports = ColorMatrix; /***/ }), -/* 259 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8073: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CounterClockwise = __webpack_require__(8); -var RadToDeg = __webpack_require__(9); -var Wrap = __webpack_require__(6); +var CONST = __webpack_require__(9454); +var Smoothing = __webpack_require__(2150); + +// The pool into which the canvas elements are placed. +var pool = []; + +// Automatically apply smoothing(false) to created Canvas elements +var _disableContextSmoothing = false; /** - * Renders this Game Object with the Canvas Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. + * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. + * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, + * which is useless for some of the Phaser pipelines / renderer. * - * @method SpineGameObject#renderCanvas - * @since 3.19.0 - * @private + * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. + * Which means all instances of Phaser Games on the same page can share the one single pool. * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {SpineGameObject} src - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + * @namespace Phaser.Display.Canvas.CanvasPool + * @since 3.0.0 */ -var SpineGameObjectCanvasRenderer = function (renderer, src, camera, parentMatrix) +var CanvasPool = function () { - var context = renderer.currentContext; + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.create + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. + * @param {boolean} [selfParent=false] - Use the generated Canvas element as the parent? + * + * @return {HTMLCanvasElement} The canvas element that was created or pulled from the pool + */ + var create = function (parent, width, height, canvasType, selfParent) + { + if (width === undefined) { width = 1; } + if (height === undefined) { height = 1; } + if (canvasType === undefined) { canvasType = CONST.CANVAS; } + if (selfParent === undefined) { selfParent = false; } - var plugin = src.plugin; - var skeleton = src.skeleton; - var skeletonRenderer = plugin.skeletonRenderer; + var canvas; + var container = first(canvasType); - var camMatrix = renderer._tempMatrix1; - var spriteMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; + if (container === null) + { + container = { + parent: parent, + canvas: document.createElement('canvas'), + type: canvasType + }; - camera.addToRenderList(src); + if (canvasType === CONST.CANVAS) + { + pool.push(container); + } - spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY)); + canvas = container.canvas; + } + else + { + container.parent = parent; + + canvas = container.canvas; + } + + if (selfParent) + { + container.parent = canvas; + } + + canvas.width = width; + canvas.height = height; + + if (_disableContextSmoothing && canvasType === CONST.CANVAS) + { + Smoothing.disable(canvas.getContext('2d', { willReadFrequently: false })); + } + + return canvas; + }; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.create2D + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * + * @return {HTMLCanvasElement} The created canvas. + */ + var create2D = function (parent, width, height) + { + return create(parent, width, height, CONST.CANVAS); + }; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.createWebGL + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * + * @return {HTMLCanvasElement} The created WebGL canvas. + */ + var createWebGL = function (parent, width, height) + { + return create(parent, width, height, CONST.WEBGL); + }; + + /** + * Gets the first free canvas index from the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.first + * @since 3.0.0 + * + * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. + * + * @return {HTMLCanvasElement} The first free canvas, or `null` if a WebGL canvas was requested or if the pool doesn't have free canvases. + */ + var first = function (canvasType) + { + if (canvasType === undefined) { canvasType = CONST.CANVAS; } + + if (canvasType === CONST.WEBGL) + { + return null; + } + + for (var i = 0; i < pool.length; i++) + { + var container = pool[i]; + + if (!container.parent && container.type === canvasType) + { + return container; + } + } + + return null; + }; + + /** + * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use. + * The canvas has its width and height set to 1, and its parent attribute nulled. + * + * @function Phaser.Display.Canvas.CanvasPool.remove + * @since 3.0.0 + * + * @param {*} parent - The canvas or the parent of the canvas to free. + */ + var remove = function (parent) + { + // Check to see if the parent is a canvas object + var isCanvas = parent instanceof HTMLCanvasElement; + + pool.forEach(function (container) + { + if ((isCanvas && container.canvas === parent) || (!isCanvas && container.parent === parent)) + { + container.parent = null; + container.canvas.width = 1; + container.canvas.height = 1; + } + }); + }; + + /** + * Gets the total number of used canvas elements in the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.total + * @since 3.0.0 + * + * @return {number} The number of used canvases. + */ + var total = function () + { + var c = 0; + + pool.forEach(function (container) + { + if (container.parent) + { + c++; + } + }); + + return c; + }; + + /** + * Gets the total number of free canvas elements in the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.free + * @since 3.0.0 + * + * @return {number} The number of free canvases. + */ + var free = function () + { + return pool.length - total(); + }; + + /** + * Disable context smoothing on any new Canvas element created. + * + * @function Phaser.Display.Canvas.CanvasPool.disableSmoothing + * @since 3.0.0 + */ + var disableSmoothing = function () + { + _disableContextSmoothing = true; + }; + + /** + * Enable context smoothing on any new Canvas element created. + * + * @function Phaser.Display.Canvas.CanvasPool.enableSmoothing + * @since 3.0.0 + */ + var enableSmoothing = function () + { + _disableContextSmoothing = false; + }; + + return { + create2D: create2D, + create: create, + createWebGL: createWebGL, + disableSmoothing: disableSmoothing, + enableSmoothing: enableSmoothing, + first: first, + free: free, + pool: pool, + remove: remove, + total: total + }; +}; + +// If we export the called function here, it'll only be invoked once (not every time it's required). +module.exports = CanvasPool(); + + +/***/ }), + +/***/ 2150: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Browser specific prefix, so not going to change between contexts, only between browsers +var prefix = ''; + +/** + * @namespace Phaser.Display.Canvas.Smoothing + * @since 3.0.0 + */ +var Smoothing = function () +{ + /** + * Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set. + * + * @function Phaser.Display.Canvas.Smoothing.getPrefix + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The canvas context to check. + * + * @return {string} The name of the property on the context which controls image smoothing (either `imageSmoothingEnabled` or a vendor-prefixed version thereof), or `null` if not supported. + */ + var getPrefix = function (context) + { + var vendors = [ 'i', 'webkitI', 'msI', 'mozI', 'oI' ]; + + for (var i = 0; i < vendors.length; i++) + { + var s = vendors[i] + 'mageSmoothingEnabled'; + + if (s in context) + { + return s; + } + } + + return null; + }; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * + * @function Phaser.Display.Canvas.Smoothing.enable + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to enable smoothing. + * + * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. + */ + var enable = function (context) + { + if (prefix === '') + { + prefix = getPrefix(context); + } + + if (prefix) + { + context[prefix] = true; + } + + return context; + }; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * + * @function Phaser.Display.Canvas.Smoothing.disable + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to disable smoothing. + * + * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. + */ + var disable = function (context) + { + if (prefix === '') + { + prefix = getPrefix(context); + } + + if (prefix) + { + context[prefix] = false; + } + + return context; + }; + + /** + * Returns `true` if the given context has image smoothing enabled, otherwise returns `false`. + * Returns null if no smoothing prefix is available. + * + * @function Phaser.Display.Canvas.Smoothing.isEnabled + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context to check. + * + * @return {?boolean} `true` if smoothing is enabled on the context, otherwise `false`. `null` if not supported. + */ + var isEnabled = function (context) + { + return (prefix !== null) ? context[prefix] : null; + }; + + return { + disable: disable, + enable: enable, + getPrefix: getPrefix, + isEnabled: isEnabled + }; + +}; + +module.exports = Smoothing(); + + +/***/ }), + +/***/ 7499: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var GameObjectFactory = __webpack_require__(3649); + +/** + * @classdesc + * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. + * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask, + * not a clipping path. It is only available when using the WebGL Renderer. + * + * A Bitmap Mask can use any Game Object or Dynamic Texture to determine the alpha of each pixel of the masked Game Object(s). + * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha + * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the + * Bitmap Mask doesn't matter. + * + * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an + * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means + * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects. + * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the + * corresponding pixel in the mask. + * + * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, + * combine Geometry Masks and Blend Modes together. + * + * The Bitmap Mask's location matches the location of its Game Object, not the location of the + * masked objects. Moving or transforming the underlying Game Object will change the mask + * (and affect the visibility of any masked objects), whereas moving or transforming a masked object + * will not affect the mask. + * + * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a + * Scene's display list, it will only be used for the mask and its full texture will not be directly + * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will + * render as a normal Game Object and will also serve as a mask. + * + * @class BitmapMask + * @memberof Phaser.Display.Masks + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this mask is being added. + * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Dynamic Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. + * @param {number} [x] - If creating a Game Object, the horizontal position in the world. + * @param {number} [y] - If creating a Game Object, the vertical position in the world. + * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. + */ +var BitmapMask = new Class({ + + initialize: + + function BitmapMask (scene, maskObject, x, y, texture, frame) + { + if (!maskObject) + { + maskObject = scene.sys.make.image({ x: x, y: y, key: texture, frame: frame, add: false }); + } + + /** + * The Game Object that is used as the mask. Must use a texture, such as a Sprite. + * + * @name Phaser.Display.Masks.BitmapMask#bitmapMask + * @type {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} + * @since 3.0.0 + */ + this.bitmapMask = maskObject; + + /** + * Whether to invert the masks alpha. + * + * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. + * + * Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. + * + * @name Phaser.Display.Masks.BitmapMask#invertAlpha + * @type {boolean} + * @since 3.1.2 + */ + this.invertAlpha = false; + + /** + * Is this mask a stencil mask? This is false by default and should not be changed. + * + * @name Phaser.Display.Masks.BitmapMask#isStencil + * @type {boolean} + * @readonly + * @since 3.17.0 + */ + this.isStencil = false; + }, + + /** + * Sets a new Game Object or Dynamic Texture for this Bitmap Mask to use. + * + * If a Game Object it must have a texture, such as a Sprite. + * + * You can update the source of the mask as often as you like. + * + * @method Phaser.Display.Masks.BitmapMask#setBitmap + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} maskObject - The Game Object or Dynamic Texture that will be used as the mask. If a Game Object, it must have a texture, such as a Sprite. + */ + setBitmap: function (maskObject) + { + this.bitmapMask = maskObject; + }, + + /** + * Prepares the WebGL Renderer to render a Game Object with this mask applied. + * + * This renders the masking Game Object to the mask framebuffer and switches to the main framebuffer so that the masked Game Object will be rendered to it instead of being rendered directly to the frame. + * + * @method Phaser.Display.Masks.BitmapMask#preRenderWebGL + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to prepare. + * @param {Phaser.GameObjects.GameObject} maskedObject - The masked Game Object which will be drawn. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. + */ + preRenderWebGL: function (renderer, maskedObject, camera) + { + renderer.pipelines.BITMAPMASK_PIPELINE.beginMask(this, maskedObject, camera); + }, + + /** + * Finalizes rendering of a masked Game Object. + * + * This resets the previously bound framebuffer and switches the WebGL Renderer to the Bitmap Mask Pipeline, which uses a special fragment shader to apply the masking effect. + * + * @method Phaser.Display.Masks.BitmapMask#postRenderWebGL + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to clean up. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. + * @param {Phaser.Renderer.WebGL.RenderTarget} [renderTarget] - Optional WebGL RenderTarget. + */ + postRenderWebGL: function (renderer, camera, renderTarget) + { + renderer.pipelines.BITMAPMASK_PIPELINE.endMask(this, camera, renderTarget); + }, + + /** + * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * + * @method Phaser.Display.Masks.BitmapMask#preRenderCanvas + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to. + * @param {Phaser.GameObjects.GameObject} mask - The masked Game Object which would be rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. + */ + preRenderCanvas: function () + { + // NOOP + }, + + /** + * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * + * @method Phaser.Display.Masks.BitmapMask#postRenderCanvas + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to. + */ + postRenderCanvas: function () + { + // NOOP + }, + + /** + * Destroys this BitmapMask and nulls any references it holds. + * + * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, + * so be sure to call `clearMask` on any Game Object using it, before destroying it. + * + * @method Phaser.Display.Masks.BitmapMask#destroy + * @since 3.7.0 + */ + destroy: function () + { + this.bitmapMask = null; + } + +}); + +/** + * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. + * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask, + * not a clipping path. It is only available when using the WebGL Renderer. + * + * A Bitmap Mask can use any Game Object, or Dynamic Texture, to determine the alpha of each pixel of the masked Game Object(s). + * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha + * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the + * Bitmap Mask doesn't matter. + * + * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an + * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means + * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects + * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the + * corresponding pixel in the mask. + * + * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, + * combine Geometry Masks and Blend Modes together. + * + * The Bitmap Mask's location matches the location of its Game Object, not the location of the + * masked objects. Moving or transforming the underlying Game Object will change the mask + * (and affect the visibility of any masked objects), whereas moving or transforming a masked object + * will not affect the mask. + * + * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a + * Scene's display list, it will only be used for the mask and its full texture will not be directly + * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will + * render as a normal Game Object and will also serve as a mask. + * + * @method Phaser.GameObjects.GameObjectFactory#bitmapMask + * @since 3.60.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. + * @param {number} [x] - If creating a Game Object, the horizontal position in the world. + * @param {number} [y] - If creating a Game Object, the vertical position in the world. + * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.Display.Masks.BitmapMask} The Bitmap Mask that was created. + */ +GameObjectFactory.register('bitmapMask', function (maskObject, x, y, key, frame) +{ + return new BitmapMask(this.scene, maskObject, x, y, key, frame); +}); + +module.exports = BitmapMask; + + +/***/ }), + +/***/ 6726: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect + * a visible pixel from the geometry mask. The mask is essentially a clipping path which can only + * make a masked pixel fully visible or fully invisible without changing its alpha (opacity). + * + * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) + * should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed + * if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and + * alpha of the pixel from the Geometry Mask do not matter. + * + * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. + * Moving or transforming the underlying Graphics object will change the mask (and affect the visibility + * of any masked objects), whereas moving or transforming a masked object will not affect the mask. + * You can think of the Geometry Mask (or rather, of its Graphics object) as an invisible curtain placed + * in front of all masked objects which has its own visual properties and, naturally, respects the camera's + * visual properties, but isn't affected by and doesn't follow the masked objects by itself. + * + * @class GeometryMask + * @memberof Phaser.Display.Masks + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - This parameter is not used. + * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List. + */ +var GeometryMask = new Class({ + + initialize: + + function GeometryMask (scene, graphicsGeometry) + { + /** + * The Graphics object which describes the Geometry Mask. + * + * @name Phaser.Display.Masks.GeometryMask#geometryMask + * @type {Phaser.GameObjects.Graphics} + * @since 3.0.0 + */ + this.geometryMask = graphicsGeometry; + + /** + * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels + * drawn to the Geometry Mask. + * + * This is a WebGL only feature. + * + * @name Phaser.Display.Masks.GeometryMask#invertAlpha + * @type {boolean} + * @since 3.16.0 + */ + this.invertAlpha = false; + + /** + * Is this mask a stencil mask? + * + * @name Phaser.Display.Masks.GeometryMask#isStencil + * @type {boolean} + * @readonly + * @since 3.17.0 + */ + this.isStencil = true; + + /** + * The current stencil level. This can change dynamically at runtime + * and is set in the applyStencil method. + * + * @name Phaser.Display.Masks.GeometryMask#level + * @type {boolean} + * @since 3.17.0 + */ + this.level = 0; + }, + + /** + * Sets a new Graphics object for the Geometry Mask. + * + * @method Phaser.Display.Masks.GeometryMask#setShape + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. + * + * @return {this} This Geometry Mask + */ + setShape: function (graphicsGeometry) + { + this.geometryMask = graphicsGeometry; + + return this; + }, + + /** + * Sets the `invertAlpha` property of this Geometry Mask. + * + * Inverting the alpha essentially flips the way the mask works. + * + * This is a WebGL only feature. + * + * @method Phaser.Display.Masks.GeometryMask#setInvertAlpha + * @since 3.17.0 + * + * @param {boolean} [value=true] - Invert the alpha of this mask? + * + * @return {this} This Geometry Mask + */ + setInvertAlpha: function (value) + { + if (value === undefined) { value = true; } + + this.invertAlpha = value; + + return this; + }, + + /** + * Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask. + * + * @method Phaser.Display.Masks.GeometryMask#preRenderWebGL + * @since 3.0.0 + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. + * @param {Phaser.GameObjects.GameObject} child - The Game Object being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. + */ + preRenderWebGL: function (renderer, child, camera) + { + var gl = renderer.gl; + + // Force flushing before drawing to stencil buffer + renderer.flush(); + + if (renderer.maskStack.length === 0) + { + gl.enable(gl.STENCIL_TEST); + gl.clear(gl.STENCIL_BUFFER_BIT); + + renderer.maskCount = 0; + } + + if (renderer.currentCameraMask.mask !== this) + { + renderer.currentMask.mask = this; + } + + renderer.maskStack.push({ mask: this, camera: camera }); + + this.applyStencil(renderer, camera, true); + + renderer.maskCount++; + }, + + /** + * Applies the current stencil mask to the renderer. + * + * @method Phaser.Display.Masks.GeometryMask#applyStencil + * @since 3.17.0 + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. + * @param {boolean} inc - Is this an INCR stencil or a DECR stencil? + */ + applyStencil: function (renderer, camera, inc) + { + var gl = renderer.gl; + var geometryMask = this.geometryMask; + var level = renderer.maskCount; + var mask = 0xff; + + gl.colorMask(false, false, false, false); + + if (inc) + { + gl.stencilFunc(gl.EQUAL, level, mask); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR); + + // Do this _after_ we set the stencilFunc + level++; + } + else + { + gl.stencilFunc(gl.EQUAL, level + 1, mask); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR); + } + + this.level = level; + + // Write stencil buffer + geometryMask.renderWebGL(renderer, geometryMask, camera); + + renderer.flush(); + + gl.colorMask(true, true, true, true); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + + if (this.invertAlpha) + { + gl.stencilFunc(gl.NOTEQUAL, level, mask); + } + else + { + gl.stencilFunc(gl.EQUAL, level, mask); + } + }, + + /** + * Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it. + * + * @method Phaser.Display.Masks.GeometryMask#postRenderWebGL + * @since 3.0.0 + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw flush. + */ + postRenderWebGL: function (renderer) + { + var gl = renderer.gl; + + renderer.maskStack.pop(); + + renderer.maskCount--; + + // Force flush before disabling stencil test + renderer.flush(); + + var current = renderer.currentMask; + + if (renderer.maskStack.length === 0) + { + // If this is the only mask in the stack, flush and disable + current.mask = null; + + gl.disable(gl.STENCIL_TEST); + } + else + { + var prev = renderer.maskStack[renderer.maskStack.length - 1]; + + prev.mask.applyStencil(renderer, prev.camera, false); + + if (renderer.currentCameraMask.mask !== prev.mask) + { + current.mask = prev.mask; + current.camera = prev.camera; + } + else + { + current.mask = null; + } + } + }, + + /** + * Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object. + * + * @method Phaser.Display.Masks.GeometryMask#preRenderCanvas + * @since 3.0.0 + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance to set the clipping path on. + * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. + */ + preRenderCanvas: function (renderer, mask, camera) + { + var geometryMask = this.geometryMask; + + renderer.currentContext.save(); + + geometryMask.renderCanvas(renderer, geometryMask, camera, null, null, true); + + renderer.currentContext.clip(); + }, + + /** + * Restore the canvas context's previous clipping path, thus turning off the mask for it. + * + * @method Phaser.Display.Masks.GeometryMask#postRenderCanvas + * @since 3.0.0 + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance being restored. + */ + postRenderCanvas: function (renderer) + { + renderer.currentContext.restore(); + }, + + /** + * Destroys this GeometryMask and nulls any references it holds. + * + * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, + * so be sure to call `clearMask` on any Game Object using it, before destroying it. + * + * @method Phaser.Display.Masks.GeometryMask#destroy + * @since 3.7.0 + */ + destroy: function () + { + this.geometryMask = null; + } + +}); + +module.exports = GeometryMask; + + +/***/ }), + +/***/ 7340: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Barrel FX Controller. + * + * This FX controller manages the barrel distortion effect for a Game Object. + * + * A barrel effect allows you to apply either a 'pinch' or 'expand' distortion to + * a Game Object. The amount of the effect can be modified in real-time. + * + * A Barrel effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBarrel(); + * sprite.postFX.addBarrel(); + * ``` + * + * @class Barrel + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [amount=1] - The amount of distortion applied to the barrel effect. A value of 1 is no distortion. Typically keep this within +- 1. + */ +var Barrel = new Class({ + + Extends: Controller, + + initialize: + + function Barrel (gameObject, amount) + { + if (amount === undefined) { amount = 1; } + + Controller.call(this, FX_CONST.BARREL, gameObject); + + /** + * The amount of distortion applied to the barrel effect. + * + * Typically keep this within the range 1 (no distortion) to +- 1. + * + * @name Phaser.FX.Barrel#amount + * @type {number} + * @since 3.60.0 + */ + this.amount = amount; + } + +}); + +module.exports = Barrel; + + +/***/ }), + +/***/ 5170: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Bloom FX Controller. + * + * This FX controller manages the bloom effect for a Game Object. + * + * Bloom is an effect used to reproduce an imaging artifact of real-world cameras. + * The effect produces fringes of light extending from the borders of bright areas in an image, + * contributing to the illusion of an extremely bright light overwhelming the + * camera or eye capturing the scene. + * + * A Bloom effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBloom(); + * sprite.postFX.addBloom(); + * ``` + * + * @class Bloom + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [color=0xffffff] - The color of the Bloom, as a hex value. + * @param {number} [offsetX=1] - The horizontal offset of the bloom effect. + * @param {number} [offsetY=1] - The vertical offset of the bloom effect. + * @param {number} [blurStrength=1] - The strength of the blur process of the bloom effect. + * @param {number} [strength=1] - The strength of the blend process of the bloom effect. + * @param {number} [steps=4] - The number of steps to run the Bloom effect for. This value should always be an integer. + */ +var Bloom = new Class({ + + Extends: Controller, + + initialize: + + function Bloom (gameObject, color, offsetX, offsetY, blurStrength, strength, steps) + { + if (offsetX === undefined) { offsetX = 1; } + if (offsetY === undefined) { offsetY = 1; } + if (blurStrength === undefined) { blurStrength = 1; } + if (strength === undefined) { strength = 1; } + if (steps === undefined) { steps = 4; } + + Controller.call(this, FX_CONST.BLOOM, gameObject); + + /** + * The number of steps to run the Bloom effect for. + * + * This value should always be an integer. + * + * It defaults to 4. The higher the value, the smoother the Bloom, + * but at the cost of exponentially more gl operations. + * + * Keep this to the lowest possible number you can have it, while + * still looking correct for your game. + * + * @name Phaser.FX.Bloom#steps + * @type {number} + * @since 3.60.0 + */ + this.steps = steps; + + /** + * The horizontal offset of the bloom effect. + * + * @name Phaser.FX.Bloom#offsetX + * @type {number} + * @since 3.60.0 + */ + this.offsetX = offsetX; + + /** + * The vertical offset of the bloom effect. + * + * @name Phaser.FX.Bloom#offsetY + * @type {number} + * @since 3.60.0 + */ + this.offsetY = offsetY; + + /** + * The strength of the blur process of the bloom effect. + * + * @name Phaser.FX.Bloom#blurStrength + * @type {number} + * @since 3.60.0 + */ + this.blurStrength = blurStrength; + + /** + * The strength of the blend process of the bloom effect. + * + * @name Phaser.FX.Bloom#strength + * @type {number} + * @since 3.60.0 + */ + this.strength = strength; + + /** + * The internal gl color array. + * + * @name Phaser.FX.Bloom#glcolor + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor = [ 1, 1, 1 ]; + + if (color !== undefined && color !== null) + { + this.color = color; + } + }, + + /** + * The color of the bloom as a number value. + * + * @name Phaser.FX.Bloom#color + * @type {number} + * @since 3.60.0 + */ + color: { + + get: function () + { + var color = this.glcolor; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + } + +}); + +module.exports = Bloom; + + +/***/ }), + +/***/ 4199: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Blur FX Controller. + * + * This FX controller manages the blur effect for a Game Object. + * + * A Gaussian blur is the result of blurring an image by a Gaussian function. It is a widely used effect, + * typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a + * smooth blur resembling that of viewing the image through a translucent screen, distinctly different + * from the bokeh effect produced by an out-of-focus lens or the shadow of an object under usual illumination. + * + * A Blur effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBlur(); + * sprite.postFX.addBlur(); + * ``` + * + * @class Blur + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [quality=0] - The quality of the blur effect. Can be either 0 for Low Quality, 1 for Medium Quality or 2 for High Quality. + * @param {number} [x=2] - The horizontal offset of the blur effect. + * @param {number} [y=2] - The vertical offset of the blur effect. + * @param {number} [strength=1] - The strength of the blur effect. + * @param {number} [color=0xffffff] - The color of the blur, as a hex value. + * @param {number} [steps=4] - The number of steps to run the blur effect for. This value should always be an integer. + */ +var Blur = new Class({ + + Extends: Controller, + + initialize: + + function Blur (gameObject, quality, x, y, strength, color, steps) + { + if (quality === undefined) { quality = 0; } + if (x === undefined) { x = 2; } + if (y === undefined) { y = 2; } + if (strength === undefined) { strength = 1; } + if (steps === undefined) { steps = 4; } + + Controller.call(this, FX_CONST.BLUR, gameObject); + + /** + * The quality of the blur effect. + * + * This can be: + * + * 0 for Low Quality + * 1 for Medium Quality + * 2 for High Quality + * + * The higher the quality, the more complex shader is used + * and the more processing time is spent on the GPU calculating + * the final blur. This value is used in conjunction with the + * `steps` value, as one has a direct impact on the other. + * + * Keep this value as low as you can, while still achieving the + * desired effect you need for your game. + * + * @name Phaser.FX.Blur#quality + * @type {number} + * @since 3.60.0 + */ + this.quality = 0; + + /** + * The horizontal offset of the blur effect. + * + * @name Phaser.FX.Blur#x + * @type {number} + * @since 3.60.0 + */ + this.x = x; + + /** + * The vertical offset of the blur effect. + * + * @name Phaser.FX.Blur#y + * @type {number} + * @since 3.60.0 + */ + this.y = y; + + /** + * The number of steps to run the Blur effect for. + * + * This value should always be an integer. + * + * It defaults to 4. The higher the value, the smoother the blur, + * but at the cost of exponentially more gl operations. + * + * Keep this to the lowest possible number you can have it, while + * still looking correct for your game. + * + * @name Phaser.FX.Blur#steps + * @type {number} + * @since 3.60.0 + */ + this.steps = steps; + + /** + * The strength of the blur effect. + * + * @name Phaser.FX.Blur#strength + * @type {number} + * @since 3.60.0 + */ + this.strength = strength; + + /** + * The internal gl color array. + * + * @name Phaser.FX.Blur#glcolor + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor = [ 1, 1, 1 ]; + + if (color !== undefined && color !== null) + { + this.color = color; + } + }, + + /** + * The color of the blur as a number value. + * + * @name Phaser.FX.Blur#color + * @type {number} + * @since 3.60.0 + */ + color: { + + get: function () + { + var color = this.glcolor; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + } + +}); + +module.exports = Blur; + + +/***/ }), + +/***/ 3132: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Bokeh FX Controller. + * + * This FX controller manages the bokeh effect for a Game Object. + * + * Bokeh refers to a visual effect that mimics the photographic technique of creating a shallow depth of field. + * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground + * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering + * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. + * + * This effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature + * effect by blurring everything except a small area of the image. This effect is achieved by blurring the + * top and bottom elements, while keeping the center area in focus. + * + * A Bokeh effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBokeh(); + * sprite.postFX.addBokeh(); + * ``` + * + * @class Bokeh + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [radius=0.5] - The radius of the bokeh effect. + * @param {number} [amount=1] - The amount of the bokeh effect. + * @param {number} [contrast=0.2] - The color contrast of the bokeh effect. + * @param {boolean} [isTiltShift=false] - Is this a bokeh or Tile Shift effect? + * @param {number} [blurX=1] - If Tilt Shift, the amount of horizontal blur. + * @param {number} [blurY=1] - If Tilt Shift, the amount of vertical blur. + * @param {number} [strength=1] - If Tilt Shift, the strength of the blur. + */ +var Bokeh = new Class({ + + Extends: Controller, + + initialize: + + function Bokeh (gameObject, radius, amount, contrast, isTiltShift, blurX, blurY, strength) + { + if (radius === undefined) { radius = 0.5; } + if (amount === undefined) { amount = 1; } + if (contrast === undefined) { contrast = 0.2; } + if (isTiltShift === undefined) { isTiltShift = false; } + if (blurX === undefined) { blurX = 1; } + if (blurY === undefined) { blurY = 1; } + if (strength === undefined) { strength = 1; } + + Controller.call(this, FX_CONST.BOKEH, gameObject); + + /** + * The radius of the bokeh effect. + * + * This is a float value, where a radius of 0 will result in no effect being applied, + * and a radius of 1 will result in a strong bokeh. However, you can exceed this value + * for even stronger effects. + * + * @name Phaser.FX.Bokeh#radius + * @type {number} + * @since 3.60.0 + */ + this.radius = radius; + + /** + * The amount, or strength, of the bokeh effect. Defaults to 1. + * + * @name Phaser.FX.Bokeh#amount + * @type {number} + * @since 3.60.0 + */ + this.amount = amount; + + /** + * The color contrast, or brightness, of the bokeh effect. Defaults to 0.2. + * + * @name Phaser.FX.Bokeh#contrast + * @type {number} + * @since 3.60.0 + */ + this.contrast = contrast; + + /** + * Is this a Tilt Shift effect or a standard bokeh effect? + * + * @name Phaser.FX.Bokeh#isTiltShift + * @type {boolean} + * @since 3.60.0 + */ + this.isTiltShift = isTiltShift; + + /** + * If a Tilt Shift effect this controls the strength of the blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#strength + * @type {number} + * @since 3.60.0 + */ + this.strength = strength; + + /** + * If a Tilt Shift effect this controls the amount of horizontal blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#blurX + * @type {number} + * @since 3.60.0 + */ + this.blurX = blurX; + + /** + * If a Tilt Shift effect this controls the amount of vertical blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#blurY + * @type {number} + * @since 3.60.0 + */ + this.blurY = blurY; + } + +}); + +module.exports = Bokeh; + + +/***/ }), + +/***/ 6610: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Circle FX Controller. + * + * This FX controller manages the circle effect for a Game Object. + * + * This effect will draw a circle around the texture of the Game Object, effectively masking off + * any area outside of the circle without the need for an actual mask. You can control the thickness + * of the circle, the color of the circle and the color of the background, should the texture be + * transparent. You can also control the feathering applied to the circle, allowing for a harsh or soft edge. + * + * Please note that adding this effect to a Game Object will not change the input area or physics body of + * the Game Object, should it have one. + * + * A Circle effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addCircle(); + * sprite.postFX.addCircle(); + * ``` + * + * @class Circle + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [thickness=8] - The width of the circle around the texture, in pixels. + * @param {number} [color=0xfeedb6] - The color of the circular ring, given as a number value. + * @param {number} [backgroundColor=0xff0000] - The color of the background, behind the texture, given as a number value. + * @param {number} [scale=1] - The scale of the circle. The default scale is 1, which is a circle the full size of the underlying texture. + * @param {number} [feather=0.005] - The amount of feathering to apply to the circle from the ring. + */ +var Circle = new Class({ + + Extends: Controller, + + initialize: + + function Circle (gameObject, thickness, color, backgroundColor, scale, feather) + { + if (thickness === undefined) { thickness = 8; } + if (scale === undefined) { scale = 1; } + if (feather === undefined) { feather = 0.005; } + + Controller.call(this, FX_CONST.CIRCLE, gameObject); + + /** + * The scale of the circle. The default scale is 1, which is a circle + * the full size of the underlying texture. Reduce this value to create + * a smaller circle, or increase it to create a circle that extends off + * the edges of the texture. + * + * @name Phaser.FX.Circle#scale + * @type {number} + * @since 3.60.0 + */ + this.scale = scale; + + /** + * The amount of feathering to apply to the circle from the ring, + * extending into the middle of the circle. The default is 0.005, + * which is a very low amount of feathering just making sure the ring + * has a smooth edge. Increase this amount to a value such as 0.5 + * or 0.025 for larger amounts of feathering. + * + * @name Phaser.FX.Circle#feather + * @type {number} + * @since 3.60.0 + */ + this.feather = feather; + + /** + * The width of the circle around the texture, in pixels. This value + * doesn't factor in the feather, which can extend the thickness + * internally depending on its value. + * + * @name Phaser.FX.Circle#thickness + * @type {number} + * @since 3.60.0 + */ + this.thickness = thickness; + + /** + * The internal gl color array for the ring color. + * + * @name Phaser.FX.Circle#glcolor + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor = [ 1, 0.2, 0.7 ]; + + /** + * The internal gl color array for the background color. + * + * @name Phaser.FX.Circle#glcolor2 + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor2 = [ 1, 0, 0, 0.4 ]; + + if (color !== undefined && color !== null) + { + this.color = color; + } + + if (backgroundColor !== undefined && backgroundColor !== null) + { + this.backgroundColor = backgroundColor; + } + }, + + /** + * The color of the circular ring, given as a number value. + * + * @name Phaser.FX.Circle#color + * @type {number} + * @since 3.60.0 + */ + color: { + + get: function () + { + var color = this.glcolor; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + }, + + /** + * The color of the background, behind the texture, given as a number value. + * + * @name Phaser.FX.Circle#backgroundColor + * @type {number} + * @since 3.60.0 + */ + backgroundColor: { + + get: function () + { + var color = this.glcolor2; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor2; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + } + +}); + +module.exports = Circle; + + +/***/ }), + +/***/ 4931: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var BaseColorMatrix = __webpack_require__(5686); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The ColorMatrix FX Controller. + * + * This FX controller manages the color matrix effect for a Game Object. + * + * The color matrix effect is a visual technique that involves manipulating the colors of an image + * or scene using a mathematical matrix. This process can adjust hue, saturation, brightness, and contrast, + * allowing developers to create various stylistic appearances or mood settings within the game. + * Common applications include simulating different lighting conditions, applying color filters, + * or achieving a specific visual style. + * + * A ColorMatrix effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addColorMatrix(); + * sprite.postFX.addColorMatrix(); + * ``` + * + * @class ColorMatrix + * @extends Phaser.Display.ColorMatrix + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + */ +var ColorMatrix = new Class({ + + Extends: BaseColorMatrix, + + initialize: + + function ColorMatrix (gameObject) + { + BaseColorMatrix.call(this); + + /** + * The FX_CONST type of this effect. + * + * @name Phaser.FX.ColorMatrix#type + * @type {number} + * @since 3.60.0 + */ + this.type = FX_CONST.COLOR_MATRIX; + + /** + * A reference to the Game Object that owns this effect. + * + * @name Phaser.FX.ColorMatrix#gameObject + * @type {Phaser.GameObjects.GameObject} + * @since 3.60.0 + */ + this.gameObject = gameObject; + + /** + * Toggle this boolean to enable or disable this effect, + * without removing and adding it from the Game Object. + * + * @name Phaser.FX.ColorMatrix#active + * @type {boolean} + * @since 3.60.0 + */ + this.active = true; + }, + + destroy: function () + { + this.gameObject = null; + this._matrix = null; + this._data = null; + } + +}); + +module.exports = ColorMatrix; + + +/***/ }), + +/***/ 6128: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * FX Controller is the base class that all built-in FX use. + * + * You should not normally create an instance of this class directly, but instead use one of the built-in FX that extend it. + * + * @class Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {number} type - The FX Type constant. + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + */ +var Controller = new Class({ + + initialize: + + function Controller (type, gameObject) + { + /** + * The FX_CONST type of this effect. + * + * @name Phaser.FX.Controller#type + * @type {number} + * @since 3.60.0 + */ + this.type = type; + + /** + * A reference to the Game Object that owns this effect. + * + * @name Phaser.FX.Controller#gameObject + * @type {Phaser.GameObjects.GameObject} + * @since 3.60.0 + */ + this.gameObject = gameObject; + + /** + * Toggle this boolean to enable or disable this effect, + * without removing and adding it from the Game Object. + * + * Only works for Pre FX. + * + * Post FX are always active. + * + * @name Phaser.FX.Controller#active + * @type {boolean} + * @since 3.60.0 + */ + this.active = true; + }, + + /** + * Sets the active state of this FX Controller. + * + * A disabled FX Controller will not be updated. + * + * @method Phaser.FX.Controller#setActive + * @since 3.60.0 + * + * @param {boolean} value - `true` to enable this FX Controller, or `false` to disable it. + * + * @return {this} This FX Controller instance. + */ + setActive: function (value) + { + this.active = value; + + return this; + }, + + /** + * Destroys this FX Controller. + * + * @method Phaser.FX.Controller#destroy + * @since 3.60.0 + */ + destroy: function () + { + this.gameObject = null; + this.active = false; + } + +}); + +module.exports = Controller; + + +/***/ }), + +/***/ 9195: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Displacement FX Controller. + * + * This FX controller manages the displacement effect for a Game Object. + * + * The displacement effect is a visual technique that alters the position of pixels in an image + * or texture based on the values of a displacement map. This effect is used to create the illusion + * of depth, surface irregularities, or distortion in otherwise flat elements. It can be applied to + * characters, objects, or backgrounds to enhance realism, convey movement, or achieve various + * stylistic appearances. + * + * A Displacement effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addDisplacement(); + * sprite.postFX.addDisplacement(); + * ``` + * + * @class Displacement + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * @param {number} [x=0.005] - The amount of horizontal displacement to apply. A very small float number, such as 0.005. + * @param {number} [y=0.005] - The amount of vertical displacement to apply. A very small float number, such as 0.005. + */ +var Displacement = new Class({ + + Extends: Controller, + + initialize: + + function Displacement (gameObject, texture, x, y) + { + if (texture === undefined) { texture = '__WHITE'; } + if (x === undefined) { x = 0.005; } + if (y === undefined) { y = 0.005; } + + Controller.call(this, FX_CONST.DISPLACEMENT, gameObject); + + /** + * The amount of horizontal displacement to apply. + * + * @name Phaser.FX.Displacement#x + * @type {number} + * @since 3.60.0 + */ + this.x = x; + + /** + * The amount of vertical displacement to apply. + * + * @name Phaser.FX.Displacement#y + * @type {number} + * @since 3.60.0 + */ + this.y = y; + + /** + * The underlying WebGLTexture used for displacement. + * + * @name Phaser.FX.Displacement#glTexture + * @type {WebGLTexture} + * @since 3.60.0 + */ + this.glTexture; + + this.setTexture(texture); + }, + + /** + * Sets the Texture to be used for the displacement effect. + * + * You can only use a whole texture, not a frame from a texture atlas or sprite sheet. + * + * @method Phaser.GameObjects.Components.FX#setTexture + * @since 3.60.0 + * + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * + * @return {this} This FX Controller. + */ + setTexture: function (texture) + { + var phaserTexture = this.gameObject.scene.sys.textures.getFrame(texture); + + if (phaserTexture) + { + this.glTexture = phaserTexture.glTexture; + } + + return this; + } + +}); + +module.exports = Displacement; + + +/***/ }), + +/***/ 445: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Glow FX Controller. + * + * This FX controller manages the glow effect for a Game Object. + * + * The glow effect is a visual technique that creates a soft, luminous halo around game objects, + * characters, or UI elements. This effect is used to emphasize importance, enhance visual appeal, + * or convey a sense of energy, magic, or otherworldly presence. The effect can also be set on + * the inside of the Game Object. The color and strength of the glow can be modified. + * + * A Glow effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addGlow(); + * sprite.postFX.addGlow(); + * ``` + * + * @class Glow + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [color=0xffffff] - The color of the glow effect as a number value. + * @param {number} [outerStrength=4] - The strength of the glow outward from the edge of the Sprite. + * @param {number} [innerStrength=0] - The strength of the glow inward from the edge of the Sprite. + * @param {boolean} [knockout=false] - If `true` only the glow is drawn, not the texture itself. + */ +var Glow = new Class({ + + Extends: Controller, + + initialize: + + function Glow (gameObject, color, outerStrength, innerStrength, knockout) + { + if (outerStrength === undefined) { outerStrength = 4; } + if (innerStrength === undefined) { innerStrength = 0; } + if (knockout === undefined) { knockout = false; } + + Controller.call(this, FX_CONST.GLOW, gameObject); + + /** + * The strength of the glow outward from the edge of the Sprite. + * + * @name Phaser.FX.Glow#outerStrength + * @type {number} + * @since 3.60.0 + */ + this.outerStrength = outerStrength; + + /** + * The strength of the glow inward from the edge of the Sprite. + * + * @name Phaser.FX.Glow#innerStrength + * @type {number} + * @since 3.60.0 + */ + this.innerStrength = innerStrength; + + /** + * If `true` only the glow is drawn, not the texture itself. + * + * @name Phaser.FX.Glow#knockout + * @type {number} + * @since 3.60.0 + */ + this.knockout = knockout; + + /** + * A 4 element array of gl color values. + * + * @name Phaser.FX.Glow#glcolor + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor = [ 1, 1, 1, 1 ]; + + if (color !== undefined) + { + this.color = color; + } + }, + + /** + * The color of the glow as a number value. + * + * @name Phaser.FX.Glow#color + * @type {number} + * @since 3.60.0 + */ + color: { + + get: function () + { + var color = this.glcolor; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + } + +}); + +module.exports = Glow; + + +/***/ }), + +/***/ 7724: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Gradient FX Controller. + * + * This FX controller manages the gradient effect for a Game Object. + * + * The gradient overlay effect is a visual technique where a smooth color transition is applied over Game Objects, + * such as sprites or UI components. This effect is used to enhance visual appeal, emphasize depth, or create + * stylistic and atmospheric variations. It can also be utilized to convey information, such as representing + * progress or health status through color changes. + * + * A Gradient effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addGradient(); + * sprite.postFX.addGradient(); + * ``` + * + * @class Gradient + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [color1=0xff0000] - The first gradient color, given as a number value. + * @param {number} [color2=0x00ff00] - The second gradient color, given as a number value. + * @param {number} [alpha=0.2] - The alpha value of the gradient effect. + * @param {number} [fromX=0] - The horizontal position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [fromY=0] - The vertical position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [toX=0] - The horizontal position the gradient will end at. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [toY=1] - The vertical position the gradient will end at. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [size=0] - How many 'chunks' the gradient is divided in to, as spread over the entire height of the texture. Leave this at zero for a smooth gradient, or set higher for a more retro chunky effect. + */ +var Gradient = new Class({ + + Extends: Controller, + + initialize: + + function Gradient (gameObject, color1, color2, alpha, fromX, fromY, toX, toY, size) + { + if (alpha === undefined) { alpha = 0.2; } + if (fromX === undefined) { fromX = 0; } + if (fromY === undefined) { fromY = 0; } + if (toX === undefined) { toX = 0; } + if (toY === undefined) { toY = 1; } + if (size === undefined) { size = 0; } + + Controller.call(this, FX_CONST.GRADIENT, gameObject); + + /** + * The alpha value of the gradient effect. + * + * @name Phaser.FX.Gradient#alpha + * @type {number} + * @since 3.60.0 + */ + this.alpha = alpha; + + /** + * Sets how many 'chunks' the gradient is divided in to, as spread over the + * entire height of the texture. Leave this at zero for a smooth gradient, + * or set to a higher number to split the gradient into that many sections, giving + * a more banded 'retro' effect. + * + * @name Phaser.FX.Gradient#size + * @type {number} + * @since 3.60.0 + */ + this.size = size; + + /** + * The horizontal position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * + * @name Phaser.FX.Gradient#fromX + * @type {number} + * @since 3.60.0 + */ + this.fromX = fromX; + + /** + * The vertical position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * + * @name Phaser.FX.Gradient#fromY + * @type {number} + * @since 3.60.0 + */ + this.fromY = fromY; + + /** + * The horizontal position the gradient will end. This value is noralized, between 0 and 1 and is not in pixels. + * + * @name Phaser.FX.Gradient#toX + * @type {number} + * @since 3.60.0 + */ + this.toX = toX; + + /** + * The vertical position the gradient will end. This value is noralized, between 0 and 1 and is not in pixels. + * + * @name Phaser.FX.Gradient#toY + * @type {number} + * @since 3.60.0 + */ + this.toY = toY; + + /** + * The internal gl color array for the starting color. + * + * @name Phaser.FX.Gradient#glcolor1 + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor1 = [ 255, 0, 0 ]; + + /** + * The internal gl color array for the ending color. + * + * @name Phaser.FX.Gradient#glcolor2 + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor2 = [ 0, 255, 0 ]; + + if (color1 !== undefined && color1 !== null) + { + this.color1 = color1; + } + + if (color2 !== undefined && color2 !== null) + { + this.color2 = color2; + } + }, + + /** + * The first gradient color, given as a number value. + * + * @name Phaser.FX.Gradient#color1 + * @type {number} + * @since 3.60.0 + */ + color1: { + + get: function () + { + var color = this.glcolor1; + + return (((color[0]) << 16) + ((color[1]) << 8) + (color[2] | 0)); + }, + + set: function (value) + { + var color = this.glcolor1; + + color[0] = ((value >> 16) & 0xFF); + color[1] = ((value >> 8) & 0xFF); + color[2] = (value & 0xFF); + } + + }, + + /** + * The second gradient color, given as a number value. + * + * @name Phaser.FX.Gradient#color2 + * @type {number} + * @since 3.60.0 + */ + color2: { + + get: function () + { + var color = this.glcolor2; + + return (((color[0]) << 16) + ((color[1]) << 8) + (color[2] | 0)); + }, + + set: function (value) + { + var color = this.glcolor2; + + color[0] = ((value >> 16) & 0xFF); + color[1] = ((value >> 8) & 0xFF); + color[2] = (value & 0xFF); + } + + } + +}); + +module.exports = Gradient; + + +/***/ }), + +/***/ 4412: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Pixelate FX Controller. + * + * This FX controller manages the pixelate effect for a Game Object. + * + * The pixelate effect is a visual technique that deliberately reduces the resolution or detail of an image, + * creating a blocky or mosaic appearance composed of large, visible pixels. This effect can be used for stylistic + * purposes, as a homage to retro gaming, or as a means to obscure certain elements within the game, such as + * during a transition or to censor specific content. + * + * A Pixelate effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addPixelate(); + * sprite.postFX.addPixelate(); + * ``` + * + * @class Pixelate + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [amount=1] - The amount of pixelation to apply. + */ +var Pixelate = new Class({ + + Extends: Controller, + + initialize: + + function Pixelate (gameObject, amount) + { + if (amount === undefined) { amount = 1; } + + Controller.call(this, FX_CONST.PIXELATE, gameObject); + + /** + * The amount of pixelation to apply. + * + * @name Phaser.FX.Pixelate#amount + * @type {number} + * @since 3.60.0 + */ + this.amount = amount; + } + +}); + +module.exports = Pixelate; + + +/***/ }), + +/***/ 75: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Shadow FX Controller. + * + * This FX controller manages the shadow effect for a Game Object. + * + * The shadow effect is a visual technique used to create the illusion of depth and realism by adding darker, + * offset silhouettes or shapes beneath game objects, characters, or environments. These simulated shadows + * help to enhance the visual appeal and immersion, making the 2D game world appear more dynamic and three-dimensional. + * + * A Shadow effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addShadow(); + * sprite.postFX.addShadow(); + * ``` + * + * @class Shadow + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [x=0] - The horizontal offset of the shadow effect. + * @param {number} [y=0] - The vertical offset of the shadow effect. + * @param {number} [decay=0.1] - The amount of decay for shadow effect. + * @param {number} [power=1] - The power of the shadow effect. + * @param {number} [color=0x000000] - The color of the shadow. + * @param {number} [samples=6] - The number of samples that the shadow effect will run for. An integer between 1 and 12. + * @param {number} [intensity=1] - The intensity of the shadow effect. + */ +var Shadow = new Class({ + + Extends: Controller, + + initialize: + + function Shadow (gameObject, x, y, decay, power, color, samples, intensity) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (decay === undefined) { decay = 0.1; } + if (power === undefined) { power = 1; } + if (samples === undefined) { samples = 6; } + if (intensity === undefined) { intensity = 1; } + + Controller.call(this, FX_CONST.SHADOW, gameObject); + + /** + * The horizontal offset of the shadow effect. + * + * @name Phaser.FX.Shadow#x + * @type {number} + * @since 3.60.0 + */ + this.x = x; + + /** + * The vertical offset of the shadow effect. + * + * @name Phaser.FX.Shadow#y + * @type {number} + * @since 3.60.0 + */ + this.y = y; + + /** + * The amount of decay for the shadow effect. + * + * @name Phaser.FX.Shadow#decay + * @type {number} + * @since 3.60.0 + */ + this.decay = decay; + + /** + * The power of the shadow effect. + * + * @name Phaser.FX.Shadow#power + * @type {number} + * @since 3.60.0 + */ + this.power = power; + + /** + * The internal gl color array. + * + * @name Phaser.FX.Shadow#glcolor + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor = [ 0, 0, 0, 1 ]; + + /** + * The number of samples that the shadow effect will run for. + * + * This should be an integer with a minimum value of 1 and a maximum of 12. + * + * @name Phaser.FX.Shadow#samples + * @type {number} + * @since 3.60.0 + */ + this.samples = samples; + + /** + * The intensity of the shadow effect. + * + * @name Phaser.FX.Shadow#intensity + * @type {number} + * @since 3.60.0 + */ + this.intensity = intensity; + + if (color !== undefined) + { + this.color = color; + } + }, + + /** + * The color of the shadow. + * + * @name Phaser.FX.Shadow#color + * @type {number} + * @since 3.60.0 + */ + color: { + + get: function () + { + var color = this.glcolor; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + } + +}); + +module.exports = Shadow; + + +/***/ }), + +/***/ 8734: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Shine FX Controller. + * + * This FX controller manages the shift effect for a Game Object. + * + * The shine effect is a visual technique that simulates the appearance of reflective + * or glossy surfaces by passing a light beam across a Game Object. This effect is used to + * enhance visual appeal, emphasize certain features, and create a sense of depth or + * material properties. + * + * A Shine effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addShine(); + * sprite.postFX.addShine(); + * ``` + * + * @class Shine + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [speed=0.5] - The speed of the Shine effect. + * @param {number} [lineWidth=0.5] - The line width of the Shine effect. + * @param {number} [gradient=3] - The gradient of the Shine effect. + * @param {boolean} [reveal=false] - Does this Shine effect reveal or get added to its target? + */ +var Shine = new Class({ + + Extends: Controller, + + initialize: + + function Shine (gameObject, speed, lineWidth, gradient, reveal) + { + if (speed === undefined) { speed = 0.5; } + if (lineWidth === undefined) { lineWidth = 0.5; } + if (gradient === undefined) { gradient = 3; } + if (reveal === undefined) { reveal = false; } + + Controller.call(this, FX_CONST.SHINE, gameObject); + + /** + * The speed of the Shine effect. + * + * @name Phaser.FX.Shine#speed + * @type {number} + * @since 3.60.0 + */ + this.speed = speed; + + /** + * The line width of the Shine effect. + * + * @name Phaser.FX.Shine#lineWidth + * @type {number} + * @since 3.60.0 + */ + this.lineWidth = lineWidth; + + /** + * The gradient of the Shine effect. + * + * @name Phaser.FX.Shine#gradient + * @type {number} + * @since 3.60.0 + */ + this.gradient = gradient; + + /** + * Does this Shine effect reveal or get added to its target? + * + * @name Phaser.FX.Shine#reveal + * @type {boolean} + * @since 3.60.0 + */ + this.reveal = reveal; + } + +}); + +module.exports = Shine; + + +/***/ }), + +/***/ 2437: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Vignette FX Controller. + * + * This FX controller manages the vignette effect for a Game Object. + * + * The vignette effect is a visual technique where the edges of the screen, or a Game Object, gradually darken or blur, + * creating a frame-like appearance. This effect is used to draw the player's focus towards the central action or subject, + * enhance immersion, and provide a cinematic or artistic quality to the game's visuals. + * + * A Vignette effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addVignette(); + * sprite.postFX.addVignette(); + * ``` + * + * @class Vignette + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [x=0.5] - The horizontal offset of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [y=0.5] - The vertical offset of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [radius=0.5] - The radius of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [strength=0.5] - The strength of the vignette effect. + */ +var Vignette = new Class({ + + Extends: Controller, + + initialize: + + function Vignette (gameObject, x, y, radius, strength) + { + if (x === undefined) { x = 0.5; } + if (y === undefined) { y = 0.5; } + if (radius === undefined) { radius = 0.5; } + if (strength === undefined) { strength = 0.5; } + + Controller.call(this, FX_CONST.VIGNETTE, gameObject); + + /** + * The horizontal offset of the vignette effect. This value is normalized to the range 0 to 1. + * + * @name Phaser.FX.Vignette#x + * @type {number} + * @since 3.60.0 + */ + this.x = x; + + /** + * The vertical offset of the vignette effect. This value is normalized to the range 0 to 1. + * + * @name Phaser.FX.Vignette#y + * @type {number} + * @since 3.60.0 + */ + this.y = y; + + /** + * The radius of the vignette effect. This value is normalized to the range 0 to 1. + * + * @name Phaser.FX.Vignette#radius + * @type {number} + * @since 3.60.0 + */ + this.radius = radius; + + /** + * The strength of the vignette effect. + * + * @name Phaser.FX.Vignette#strength + * @type {number} + * @since 3.60.0 + */ + this.strength = strength; + } + +}); + +module.exports = Vignette; + + +/***/ }), + +/***/ 5984: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Wipe FX Controller. + * + * This FX controller manages the wipe effect for a Game Object. + * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * + * A Wipe effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addWipe(); + * sprite.postFX.addWipe(); + * sprite.preFX.addReveal(); + * sprite.postFX.addReveal(); + * ``` + * + * @class Wipe + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [wipeWidth=0.1] - The width of the wipe effect. This value is normalized in the range 0 to 1. + * @param {number} [direction=0] - The direction of the wipe effect. Either 0 or 1. Set in conjunction with the axis property. + * @param {number} [axis=0] - The axis of the wipe effect. Either 0 or 1. Set in conjunction with the direction property. + * @param {boolean} [reveal=false] - Is this a reveal (true) or a fade (false) effect? + */ +var Wipe = new Class({ + + Extends: Controller, + + initialize: + + function Wipe (gameObject, wipeWidth, direction, axis, reveal) + { + if (wipeWidth === undefined) { wipeWidth = 0.1; } + if (direction === undefined) { direction = 0; } + if (axis === undefined) { axis = 0; } + if (reveal === undefined) { reveal = false; } + + Controller.call(this, FX_CONST.WIPE, gameObject); + + /** + * The progress of the Wipe effect. This value is normalized to the range 0 to 1. + * + * Adjust this value to make the wipe transition (i.e. via a Tween) + * + * @name Phaser.FX.Wipe#progress + * @type {number} + * @since 3.60.0 + */ + this.progress = 0; + + /** + * The width of the wipe effect. This value is normalized in the range 0 to 1. + * + * @name Phaser.FX.Wipe#wipeWidth + * @type {number} + * @since 3.60.0 + */ + this.wipeWidth = wipeWidth; + + /** + * The direction of the wipe effect. Either 0 or 1. Set in conjunction with the axis property. + * + * @name Phaser.FX.Wipe#direction + * @type {number} + * @since 3.60.0 + */ + this.direction = direction; + + /** + * The axis of the wipe effect. Either 0 or 1. Set in conjunction with the direction property. + * + * @name Phaser.FX.Wipe#axis + * @type {number} + * @since 3.60.0 + */ + this.axis = axis; + + /** + * Is this a reveal (true) or a fade (false) effect? + * + * @name Phaser.FX.Wipe#reveal + * @type {boolean} + * @since 3.60.0 + */ + this.reveal = reveal; + } + +}); + +module.exports = Wipe; + + +/***/ }), + +/***/ 1571: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FX_CONST = { + + /** + * The Glow FX. + * + * @name Phaser.FX.GLOW + * @type {number} + * @const + * @since 3.60.0 + */ + GLOW: 4, + + /** + * The Shadow FX. + * + * @name Phaser.FX.SHADOW + * @type {number} + * @const + * @since 3.60.0 + */ + SHADOW: 5, + + /** + * The Pixelate FX. + * + * @name Phaser.FX.PIXELATE + * @type {number} + * @const + * @since 3.60.0 + */ + PIXELATE: 6, + + /** + * The Vignette FX. + * + * @name Phaser.FX.VIGNETTE + * @type {number} + * @const + * @since 3.60.0 + */ + VIGNETTE: 7, + + /** + * The Shine FX. + * + * @name Phaser.FX.SHINE + * @type {number} + * @const + * @since 3.60.0 + */ + SHINE: 8, + + /** + * The Blur FX. + * + * @name Phaser.FX.BLUR + * @type {number} + * @const + * @since 3.60.0 + */ + BLUR: 9, // uses 3 shaders, slots 9, 10 and 11 + + /** + * The Gradient FX. + * + * @name Phaser.FX.GRADIENT + * @type {number} + * @const + * @since 3.60.0 + */ + GRADIENT: 12, + + /** + * The Bloom FX. + * + * @name Phaser.FX.BLOOM + * @type {number} + * @const + * @since 3.60.0 + */ + BLOOM: 13, + + /** + * The Color Matrix FX. + * + * @name Phaser.FX.COLOR_MATRIX + * @type {number} + * @const + * @since 3.60.0 + */ + COLOR_MATRIX: 14, + + /** + * The Circle FX. + * + * @name Phaser.FX.CIRCLE + * @type {number} + * @const + * @since 3.60.0 + */ + CIRCLE: 15, + + /** + * The Barrel FX. + * + * @name Phaser.FX.BARREL + * @type {number} + * @const + * @since 3.60.0 + */ + BARREL: 16, + + /** + * The Displacement FX. + * + * @name Phaser.FX.DISPLACEMENT + * @type {number} + * @const + * @since 3.60.0 + */ + DISPLACEMENT: 17, + + /** + * The Wipe FX. + * + * @name Phaser.FX.WIPE + * @type {number} + * @const + * @since 3.60.0 + */ + WIPE: 18, + + /** + * The Bokeh and Tilt Shift FX. + * + * @name Phaser.FX.BOKEH + * @type {number} + * @const + * @since 3.60.0 + */ + BOKEH: 19 + +}; + +module.exports = FX_CONST; + + +/***/ }), + +/***/ 7347: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(1030); +var FX_CONST = __webpack_require__(1571); + +/** + * @namespace Phaser.FX + */ + +var FX = { + + Barrel: __webpack_require__(7340), + Controller: __webpack_require__(6128), + Bloom: __webpack_require__(5170), + Blur: __webpack_require__(4199), + Bokeh: __webpack_require__(3132), + Circle: __webpack_require__(6610), + ColorMatrix: __webpack_require__(4931), + Displacement: __webpack_require__(9195), + Glow: __webpack_require__(445), + Gradient: __webpack_require__(7724), + Pixelate: __webpack_require__(4412), + Shadow: __webpack_require__(75), + Shine: __webpack_require__(8734), + Vignette: __webpack_require__(2437), + Wipe: __webpack_require__(5984) + +}; + +FX = Extend(false, FX, FX_CONST); + +module.exports = FX; + + +/***/ }), + +/***/ 2494: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(8351); +var GetAdvancedValue = __webpack_require__(8361); + +/** + * Builds a Game Object using the provided configuration object. + * + * @function Phaser.GameObjects.BuildGameObject + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene. + * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject. + * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with. + * + * @return {Phaser.GameObjects.GameObject} The built Game Object. + */ +var BuildGameObject = function (scene, gameObject, config) +{ + // Position + + gameObject.x = GetAdvancedValue(config, 'x', 0); + gameObject.y = GetAdvancedValue(config, 'y', 0); + gameObject.depth = GetAdvancedValue(config, 'depth', 0); + + // Flip + + gameObject.flipX = GetAdvancedValue(config, 'flipX', false); + gameObject.flipY = GetAdvancedValue(config, 'flipY', false); + + // Scale + // Either: { scale: 2 } or { scale: { x: 2, y: 2 }} + + var scale = GetAdvancedValue(config, 'scale', null); + + if (typeof scale === 'number') + { + gameObject.setScale(scale); + } + else if (scale !== null) + { + gameObject.scaleX = GetAdvancedValue(scale, 'x', 1); + gameObject.scaleY = GetAdvancedValue(scale, 'y', 1); + } + + // ScrollFactor + // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }} + + var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null); + + if (typeof scrollFactor === 'number') + { + gameObject.setScrollFactor(scrollFactor); + } + else if (scrollFactor !== null) + { + gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1); + gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1); + } + + // Rotation + + gameObject.rotation = GetAdvancedValue(config, 'rotation', 0); + + var angle = GetAdvancedValue(config, 'angle', null); + + if (angle !== null) + { + gameObject.angle = angle; + } + + // Alpha + + gameObject.alpha = GetAdvancedValue(config, 'alpha', 1); + + // Origin + // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }} + + var origin = GetAdvancedValue(config, 'origin', null); + + if (typeof origin === 'number') + { + gameObject.setOrigin(origin); + } + else if (origin !== null) + { + var ox = GetAdvancedValue(origin, 'x', 0.5); + var oy = GetAdvancedValue(origin, 'y', 0.5); + + gameObject.setOrigin(ox, oy); + } + + // BlendMode + + gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL); + + // Visible + + gameObject.visible = GetAdvancedValue(config, 'visible', true); + + // Add to Scene + + var add = GetAdvancedValue(config, 'add', true); + + if (add) + { + scene.sys.displayList.add(gameObject); + } + + if (gameObject.preUpdate) + { + scene.sys.updateList.add(gameObject); + } + + return gameObject; +}; + +module.exports = BuildGameObject; + + +/***/ }), + +/***/ 2273: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var ComponentsToJSON = __webpack_require__(6125); +var DataManager = __webpack_require__(1081); +var EventEmitter = __webpack_require__(4399); +var Events = __webpack_require__(3389); +var SceneEvents = __webpack_require__(204); + +/** + * @classdesc + * The base class that all Game Objects extend. + * You don't create GameObjects directly and they cannot be added to the display list. + * Instead, use them as the base for your own custom classes. + * + * @class GameObject + * @memberof Phaser.GameObjects + * @extends Phaser.Events.EventEmitter + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. + * @param {string} type - A textual representation of the type of Game Object, i.e. `sprite`. + */ +var GameObject = new Class({ + + Extends: EventEmitter, + + initialize: + + function GameObject (scene, type) + { + EventEmitter.call(this); + + /** + * A reference to the Scene to which this Game Object belongs. + * + * Game Objects can only belong to one Scene. + * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. + * + * @name Phaser.GameObjects.GameObject#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * Holds a reference to the Display List that contains this Game Object. + * + * This is set automatically when this Game Object is added to a Scene or Layer. + * + * You should treat this property as being read-only. + * + * @name Phaser.GameObjects.GameObject#displayList + * @type {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} + * @default null + * @since 3.50.0 + */ + this.displayList = null; + + /** + * A textual representation of this Game Object, i.e. `sprite`. + * Used internally by Phaser but is available for your own custom classes to populate. + * + * @name Phaser.GameObjects.GameObject#type + * @type {string} + * @since 3.0.0 + */ + this.type = type; + + /** + * The current state of this Game Object. + * + * Phaser itself will never modify this value, although plugins may do so. + * + * Use this property to track the state of a Game Object during its lifetime. For example, it could change from + * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant + * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * + * @name Phaser.GameObjects.GameObject#state + * @type {(number|string)} + * @since 3.16.0 + */ + this.state = 0; + + /** + * The parent Container of this Game Object, if it has one. + * + * @name Phaser.GameObjects.GameObject#parentContainer + * @type {Phaser.GameObjects.Container} + * @since 3.4.0 + */ + this.parentContainer = null; + + /** + * The name of this Game Object. + * Empty by default and never populated by Phaser, this is left for developers to use. + * + * @name Phaser.GameObjects.GameObject#name + * @type {string} + * @default '' + * @since 3.0.0 + */ + this.name = ''; + + /** + * The active state of this Game Object. + * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. + * An active object is one which is having its logic and internal systems updated. + * + * @name Phaser.GameObjects.GameObject#active + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.active = true; + + /** + * The Tab Index of the Game Object. + * Reserved for future use by plugins and the Input Manager. + * + * @name Phaser.GameObjects.GameObject#tabIndex + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.tabIndex = -1; + + /** + * A Data Manager. + * It allows you to store, query and get key/value paired information specific to this Game Object. + * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. + * + * @name Phaser.GameObjects.GameObject#data + * @type {Phaser.Data.DataManager} + * @default null + * @since 3.0.0 + */ + this.data = null; + + /** + * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. + * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. + * If those components are not used by your custom class then you can use this bitmask as you wish. + * + * @name Phaser.GameObjects.GameObject#renderFlags + * @type {number} + * @default 15 + * @since 3.0.0 + */ + this.renderFlags = 15; + + /** + * A bitmask that controls if this Game Object is drawn by a Camera or not. + * Not usually set directly, instead call `Camera.ignore`, however you can + * set this property directly using the Camera.id property: + * + * @example + * this.cameraFilter |= camera.id + * + * @name Phaser.GameObjects.GameObject#cameraFilter + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.cameraFilter = 0; + + /** + * If this Game Object is enabled for input then this property will contain an InteractiveObject instance. + * Not usually set directly. Instead call `GameObject.setInteractive()`. + * + * @name Phaser.GameObjects.GameObject#input + * @type {?Phaser.Types.Input.InteractiveObject} + * @default null + * @since 3.0.0 + */ + this.input = null; + + /** + * If this Game Object is enabled for Arcade or Matter Physics then this property will contain a reference to a Physics Body. + * + * @name Phaser.GameObjects.GameObject#body + * @type {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|MatterJS.BodyType)} + * @default null + * @since 3.0.0 + */ + this.body = null; + + /** + * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`. + * This includes calls that may come from a Group, Container or the Scene itself. + * While it allows you to persist a Game Object across Scenes, please understand you are entirely + * responsible for managing references to and from this Game Object. + * + * @name Phaser.GameObjects.GameObject#ignoreDestroy + * @type {boolean} + * @default false + * @since 3.5.0 + */ + this.ignoreDestroy = false; + + this.on(Events.ADDED_TO_SCENE, this.addedToScene, this); + this.on(Events.REMOVED_FROM_SCENE, this.removedFromScene, this); + + // Tell the Scene to re-sort the children + scene.sys.queueDepthSort(); + }, + + /** + * Sets the `active` property of this Game Object and returns this Game Object for further chaining. + * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList. + * + * @method Phaser.GameObjects.GameObject#setActive + * @since 3.0.0 + * + * @param {boolean} value - True if this Game Object should be set as active, false if not. + * + * @return {this} This GameObject. + */ + setActive: function (value) + { + this.active = value; + + return this; + }, + + /** + * Sets the `name` property of this Game Object and returns this Game Object for further chaining. + * The `name` property is not populated by Phaser and is presented for your own use. + * + * @method Phaser.GameObjects.GameObject#setName + * @since 3.0.0 + * + * @param {string} value - The name to be given to this Game Object. + * + * @return {this} This GameObject. + */ + setName: function (value) + { + this.name = value; + + return this; + }, + + /** + * Sets the current state of this Game Object. + * + * Phaser itself will never modify the State of a Game Object, although plugins may do so. + * + * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. + * The state value should typically be an integer (ideally mapped to a constant + * in your game code), but could also be a string. It is recommended to keep it light and simple. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * + * @method Phaser.GameObjects.GameObject#setState + * @since 3.16.0 + * + * @param {(number|string)} value - The state of the Game Object. + * + * @return {this} This GameObject. + */ + setState: function (value) + { + this.state = value; + + return this; + }, + + /** + * Adds a Data Manager component to this Game Object. + * + * @method Phaser.GameObjects.GameObject#setDataEnabled + * @since 3.0.0 + * @see Phaser.Data.DataManager + * + * @return {this} This GameObject. + */ + setDataEnabled: function () + { + if (!this.data) + { + this.data = new DataManager(this); + } + + return this; + }, + + /** + * Allows you to store a key value pair within this Game Objects Data Manager. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * sprite.setData('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `getData`: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * sprite.data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * + * @method Phaser.GameObjects.GameObject#setData + * @since 3.0.0 + * + * @generic {any} T + * @genericUse {(string|T)} - [key] + * + * @param {(string|object)} key - The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. + * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored. + * + * @return {this} This GameObject. + */ + setData: function (key, value) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.set(key, value); + + return this; + }, + + /** + * Increase a value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is increased from 0. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * @method Phaser.GameObjects.GameObject#incData + * @since 3.23.0 + * + * @generic {any} T + * @genericUse {(string|T)} - [key] + * + * @param {(string|object)} key - The key to increase the value for. + * @param {*} [data] - The value to increase for the given key. + * + * @return {this} This GameObject. + */ + incData: function (key, value) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.inc(key, value); + + return this; + }, + + /** + * Toggle a boolean value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is toggled from false. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * @method Phaser.GameObjects.GameObject#toggleData + * @since 3.23.0 + * + * @generic {any} T + * @genericUse {(string|T)} - [key] + * + * @param {(string|object)} key - The key to toggle the value for. + * + * @return {this} This GameObject. + */ + toggleData: function (key) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.toggle(key); + + return this; + }, + + /** + * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * sprite.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * sprite.getData([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.GameObjects.GameObject#getData + * @since 3.0.0 + * + * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys. + * + * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array. + */ + getData: function (key) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + return this.data.get(key); + }, + + /** + * Pass this Game Object to the Input Manager to enable it for Input. + * + * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area + * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced + * input detection. + * + * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If + * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific + * shape for it to use. + * + * You can also provide an Input Configuration Object as the only argument to this method. + * + * @example + * sprite.setInteractive(); + * + * @example + * sprite.setInteractive(new Phaser.Geom.Circle(45, 46, 45), Phaser.Geom.Circle.Contains); + * + * @example + * graphics.setInteractive(new Phaser.Geom.Rectangle(0, 0, 128, 128), Phaser.Geom.Rectangle.Contains); + * + * @method Phaser.GameObjects.GameObject#setInteractive + * @since 3.0.0 + * + * @param {(Phaser.Types.Input.InputConfiguration|any)} [hitArea] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not given it will try to create a Rectangle based on the texture frame. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The callback that determines if the pointer is within the Hit Area shape or not. If you provide a shape you must also provide a callback. + * @param {boolean} [dropZone=false] - Should this Game Object be treated as a drop zone target? + * + * @return {this} This GameObject. + */ + setInteractive: function (hitArea, hitAreaCallback, dropZone) + { + this.scene.sys.input.enable(this, hitArea, hitAreaCallback, dropZone); + + return this; + }, + + /** + * If this Game Object has previously been enabled for input, this will disable it. + * + * An object that is disabled for input stops processing or being considered for + * input events, but can be turned back on again at any time by simply calling + * `setInteractive()` with no arguments provided. + * + * If want to completely remove interaction from this Game Object then use `removeInteractive` instead. + * + * @method Phaser.GameObjects.GameObject#disableInteractive + * @since 3.7.0 + * + * @return {this} This GameObject. + */ + disableInteractive: function () + { + this.scene.sys.input.disable(this); + + return this; + }, + + /** + * If this Game Object has previously been enabled for input, this will queue it + * for removal, causing it to no longer be interactive. The removal happens on + * the next game step, it is not immediate. + * + * The Interactive Object that was assigned to this Game Object will be destroyed, + * removed from the Input Manager and cleared from this Game Object. + * + * If you wish to re-enable this Game Object at a later date you will need to + * re-create its InteractiveObject by calling `setInteractive` again. + * + * If you wish to only temporarily stop an object from receiving input then use + * `disableInteractive` instead, as that toggles the interactive state, where-as + * this erases it completely. + * + * If you wish to resize a hit area, don't remove and then set it as being + * interactive. Instead, access the hitarea object directly and resize the shape + * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the + * shape is a Rectangle, which it is by default.) + * + * @method Phaser.GameObjects.GameObject#removeInteractive + * @since 3.7.0 + * + * @return {this} This GameObject. + */ + removeInteractive: function () + { + this.scene.sys.input.clear(this); + + this.input = undefined; + + return this; + }, + + /** + * This callback is invoked when this Game Object is added to a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to add themselves into the Update List. + * + * You can also listen for the `ADDED_TO_SCENE` event from this Game Object. + * + * @method Phaser.GameObjects.GameObject#addedToScene + * @since 3.50.0 + */ + addedToScene: function () + { + }, + + /** + * This callback is invoked when this Game Object is removed from a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to removed themselves from the Update List. + * + * You can also listen for the `REMOVED_FROM_SCENE` event from this Game Object. + * + * @method Phaser.GameObjects.GameObject#removedFromScene + * @since 3.50.0 + */ + removedFromScene: function () + { + }, + + /** + * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. + * + * @method Phaser.GameObjects.GameObject#update + * @since 3.0.0 + * + * @param {...*} [args] - args + */ + update: function () + { + }, + + /** + * Returns a JSON representation of the Game Object. + * + * @method Phaser.GameObjects.GameObject#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ + toJSON: function () + { + return ComponentsToJSON(this); + }, + + /** + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * Also checks the Game Object against the given Cameras exclusion list. + * + * @method Phaser.GameObjects.GameObject#willRender + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object. + * + * @return {boolean} True if the Game Object should be rendered, otherwise false. + */ + willRender: function (camera) + { + var listWillRender = (this.displayList && this.displayList.active) ? this.displayList.willRender(camera) : true; + + return !(!listWillRender || GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); + }, + + /** + * Returns an array containing the display list index of either this Game Object, or if it has one, + * its parent Container. It then iterates up through all of the parent containers until it hits the + * root of the display list (which is index 0 in the returned array). + * + * Used internally by the InputPlugin but also useful if you wish to find out the display depth of + * this Game Object and all of its ancestors. + * + * @method Phaser.GameObjects.GameObject#getIndexList + * @since 3.4.0 + * + * @return {number[]} An array of display list position indexes. + */ + getIndexList: function () + { + // eslint-disable-next-line consistent-this + var child = this; + var parent = this.parentContainer; + + var indexes = []; + + while (parent) + { + indexes.unshift(parent.getIndex(child)); + + child = parent; + + if (!parent.parentContainer) + { + break; + } + else + { + parent = parent.parentContainer; + } + } + + if (this.displayList) + { + indexes.unshift(this.displayList.getIndex(child)); + } + else + { + indexes.unshift(this.scene.sys.displayList.getIndex(child)); + } + + return indexes; + }, + + /** + * Adds this Game Object to the given Display List. + * + * If no Display List is specified, it will default to the Display List owned by the Scene to which + * this Game Object belongs. + * + * A Game Object can only exist on one Display List at any given time, but may move freely between them. + * + * If this Game Object is already on another Display List when this method is called, it will first + * be removed from it, before being added to the new list. + * + * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. + * + * If a Game Object isn't on any display list, it will not be rendered. If you just wish to temporarly + * disable it from rendering, consider using the `setVisible` method, instead. + * + * @method Phaser.GameObjects.GameObject#addToDisplayList + * @fires Phaser.Scenes.Events#ADDED_TO_SCENE + * @fires Phaser.GameObjects.Events#ADDED_TO_SCENE + * @since 3.53.0 + * + * @param {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} [displayList] - The Display List to add to. Defaults to the Scene Display List. + * + * @return {this} This Game Object. + */ + addToDisplayList: function (displayList) + { + if (displayList === undefined) { displayList = this.scene.sys.displayList; } + + if (this.displayList && this.displayList !== displayList) + { + this.removeFromDisplayList(); + } + + // Don't repeat if it's already on this list + if (!displayList.exists(this)) + { + this.displayList = displayList; + + displayList.add(this, true); + + displayList.queueDepthSort(); + + this.emit(Events.ADDED_TO_SCENE, this, this.scene); + + displayList.events.emit(SceneEvents.ADDED_TO_SCENE, this, this.scene); + } + + return this; + }, + + /** + * Adds this Game Object to the Update List belonging to the Scene. + * + * When a Game Object is added to the Update List it will have its `preUpdate` method called + * every game frame. This method is passed two parameters: `delta` and `time`. + * + * If you wish to run your own logic within `preUpdate` then you should always call + * `super.preUpdate(delta, time)` within it, or it may fail to process required operations, + * such as Sprite animations. + * + * @method Phaser.GameObjects.GameObject#addToUpdateList + * @since 3.53.0 + * + * @return {this} This Game Object. + */ + addToUpdateList: function () + { + if (this.scene && this.preUpdate) + { + this.scene.sys.updateList.add(this); + } + + return this; + }, + + /** + * Removes this Game Object from the Display List it is currently on. + * + * A Game Object can only exist on one Display List at any given time, but may move freely removed + * and added back at a later stage. + * + * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. + * + * If a Game Object isn't on any Display List, it will not be rendered. If you just wish to temporarly + * disable it from rendering, consider using the `setVisible` method, instead. + * + * @method Phaser.GameObjects.GameObject#removeFromDisplayList + * @fires Phaser.Scenes.Events#REMOVED_FROM_SCENE + * @fires Phaser.GameObjects.Events#REMOVED_FROM_SCENE + * @since 3.53.0 + * + * @return {this} This Game Object. + */ + removeFromDisplayList: function () + { + var displayList = this.displayList || this.scene.sys.displayList; + + if (displayList && displayList.exists(this)) + { + displayList.remove(this, true); + + displayList.queueDepthSort(); + + this.displayList = null; + + this.emit(Events.REMOVED_FROM_SCENE, this, this.scene); + + displayList.events.emit(SceneEvents.REMOVED_FROM_SCENE, this, this.scene); + } + + return this; + }, + + /** + * Removes this Game Object from the Scene's Update List. + * + * When a Game Object is on the Update List, it will have its `preUpdate` method called + * every game frame. Calling this method will remove it from the list, preventing this. + * + * Removing a Game Object from the Update List will stop most internal functions working. + * For example, removing a Sprite from the Update List will prevent it from being able to + * run animations. + * + * @method Phaser.GameObjects.GameObject#removeFromUpdateList + * @since 3.53.0 + * + * @return {this} This Game Object. + */ + removeFromUpdateList: function () + { + if (this.scene && this.preUpdate) + { + this.scene.sys.updateList.remove(this); + } + + return this; + }, + + /** + * Destroys this Game Object removing it from the Display List and Update List and + * severing all ties to parent resources. + * + * Also removes itself from the Input Manager and Physics Manager if previously enabled. + * + * Use this to remove a Game Object from your game if you don't ever plan to use it again. + * As long as no reference to it exists within your own code it should become free for + * garbage collection by the browser. + * + * If you just want to temporarily disable an object then look at using the + * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. + * + * @method Phaser.GameObjects.GameObject#destroy + * @fires Phaser.GameObjects.Events#DESTROY + * @since 3.0.0 + * + * @param {boolean} [fromScene=false] - `True` if this Game Object is being destroyed by the Scene, `false` if not. + */ + destroy: function (fromScene) + { + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) + { + return; + } + + if (fromScene === undefined) { fromScene = false; } + + if (this.preDestroy) + { + this.preDestroy.call(this); + } + + this.emit(Events.DESTROY, this, fromScene); + + this.removeAllListeners(); + + if (this.postPipelines) + { + this.resetPostPipeline(true); + } + + this.removeFromDisplayList(); + this.removeFromUpdateList(); + + if (this.input) + { + this.scene.sys.input.clear(this); + + this.input = undefined; + } + + if (this.data) + { + this.data.destroy(); + + this.data = undefined; + } + + if (this.body) + { + this.body.destroy(); + + this.body = undefined; + } + + if (this.preFX) + { + this.preFX.destroy(); + + this.preFX = undefined; + } + + if (this.postFX) + { + this.postFX.destroy(); + + this.postFX = undefined; + } + + this.active = false; + this.visible = false; + + this.scene = undefined; + this.parentContainer = undefined; + } + +}); + +/** + * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. + * + * @constant {number} RENDER_MASK + * @memberof Phaser.GameObjects.GameObject + * @default + */ +GameObject.RENDER_MASK = 15; + +module.exports = GameObject; + + +/***/ }), + +/***/ 3649: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var PluginCache = __webpack_require__(8456); +var SceneEvents = __webpack_require__(204); + +/** + * @classdesc + * The Game Object Factory is a Scene plugin that allows you to quickly create many common + * types of Game Objects and have them automatically registered with the Scene. + * + * Game Objects directly register themselves with the Factory and inject their own creation + * methods into the class. + * + * @class GameObjectFactory + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object Factory belongs. + */ +var GameObjectFactory = new Class({ + + initialize: + + function GameObjectFactory (scene) + { + /** + * The Scene to which this Game Object Factory belongs. + * + * @name Phaser.GameObjects.GameObjectFactory#scene + * @type {Phaser.Scene} + * @protected + * @since 3.0.0 + */ + this.scene = scene; + + /** + * A reference to the Scene.Systems. + * + * @name Phaser.GameObjects.GameObjectFactory#systems + * @type {Phaser.Scenes.Systems} + * @protected + * @since 3.0.0 + */ + this.systems = scene.sys; + + /** + * A reference to the Scene Event Emitter. + * + * @name Phaser.GameObjects.GameObjectFactory#events + * @type {Phaser.Events.EventEmitter} + * @protected + * @since 3.50.0 + */ + this.events = scene.sys.events; + + /** + * A reference to the Scene Display List. + * + * @name Phaser.GameObjects.GameObjectFactory#displayList + * @type {Phaser.GameObjects.DisplayList} + * @protected + * @since 3.0.0 + */ + this.displayList; + + /** + * A reference to the Scene Update List. + * + * @name Phaser.GameObjects.GameObjectFactory#updateList + * @type {Phaser.GameObjects.UpdateList} + * @protected + * @since 3.0.0 + */ + this.updateList; + + this.events.once(SceneEvents.BOOT, this.boot, this); + this.events.on(SceneEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.GameObjects.GameObjectFactory#boot + * @private + * @since 3.5.1 + */ + boot: function () + { + this.displayList = this.systems.displayList; + this.updateList = this.systems.updateList; + + this.events.once(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.GameObjects.GameObjectFactory#start + * @private + * @since 3.5.0 + */ + start: function () + { + this.events.once(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * Adds an existing Game Object to this Scene. + * + * If the Game Object renders, it will be added to the Display List. + * If it has a `preUpdate` method, it will be added to the Update List. + * + * @method Phaser.GameObjects.GameObjectFactory#existing + * @since 3.0.0 + * + * @generic {(Phaser.GameObjects.GameObject|Phaser.GameObjects.Group|Phaser.GameObjects.Layer)} G - [child,$return] + * + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.Group|Phaser.GameObjects.Layer)} child - The child to be added to this Scene. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was added. + */ + existing: function (child) + { + if (child.renderCanvas || child.renderWebGL) + { + this.displayList.add(child); + } + + // For when custom objects have overridden `preUpdate` but don't hook into the ADDED_TO_SCENE event: + // Adding to the list multiple times is safe, as it won't add duplicates into the list anyway. + if (child.preUpdate) + { + this.updateList.add(child); + } + + return child; + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.GameObjects.GameObjectFactory#shutdown + * @private + * @since 3.0.0 + */ + shutdown: function () + { + this.events.off(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.GameObjects.GameObjectFactory#destroy + * @private + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.events.off(SceneEvents.START, this.start, this); + + this.scene = null; + this.systems = null; + this.events = null; + + this.displayList = null; + this.updateList = null; + } + +}); + +/** + * Static method called directly by the Game Object factory functions. + * With this method you can register a custom GameObject factory in the GameObjectFactory, + * providing a name (`factoryType`) and the constructor (`factoryFunction`) in order + * to be called when you call to Phaser.Scene.add[ factoryType ] method. + * + * @method Phaser.GameObjects.GameObjectFactory.register + * @static + * @since 3.0.0 + * + * @param {string} factoryType - The key of the factory that you will use to call to Phaser.Scene.add[ factoryType ] method. + * @param {function} factoryFunction - The constructor function to be called when you invoke to the Phaser.Scene.add method. + */ +GameObjectFactory.register = function (factoryType, factoryFunction) +{ + if (!GameObjectFactory.prototype.hasOwnProperty(factoryType)) + { + GameObjectFactory.prototype[factoryType] = factoryFunction; + } +}; + +/** + * Static method called directly by the Game Object factory functions. + * With this method you can remove a custom GameObject factory registered in the GameObjectFactory, + * providing a its `factoryType`. + * + * @method Phaser.GameObjects.GameObjectFactory.remove + * @static + * @since 3.0.0 + * + * @param {string} factoryType - The key of the factory that you want to remove from the GameObjectFactory. + */ +GameObjectFactory.remove = function (factoryType) +{ + if (GameObjectFactory.prototype.hasOwnProperty(factoryType)) + { + delete GameObjectFactory.prototype[factoryType]; + } +}; + +PluginCache.register('GameObjectFactory', GameObjectFactory, 'add'); + +module.exports = GameObjectFactory; + + +/***/ }), + +/***/ 2208: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var TransformMatrix = __webpack_require__(4227); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); + +var result = { camera: tempMatrix1, sprite: tempMatrix2, calc: tempMatrix3 }; + +/** + * Calculates the Transform Matrix of the given Game Object and Camera, factoring in + * the parent matrix if provided. + * + * Note that the object this results contains _references_ to the Transform Matrices, + * not new instances of them. Therefore, you should use their values immediately, or + * copy them to your own matrix, as they will be replaced as soon as another Game + * Object is rendered. + * + * @function Phaser.GameObjects.GetCalcMatrix + * @memberof Phaser.GameObjects + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} src - The Game Object to calculate the transform matrix for. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera being used to render the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - The transform matrix of the parent container, if any. + * + * @return {Phaser.Types.GameObjects.GetCalcMatrixResults} The results object containing the updated transform matrices. + */ +var GetCalcMatrix = function (src, camera, parentMatrix) +{ + var camMatrix = tempMatrix1; + var spriteMatrix = tempMatrix2; + var calcMatrix = tempMatrix3; + + spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); camMatrix.copyFrom(camera.matrix); @@ -48911,179 +33399,6537 @@ var SpineGameObjectCanvasRenderer = function (renderer, src, camera, parentMatri // Undo the camera scroll spriteMatrix.e = src.x; spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); } else { spriteMatrix.e -= camera.scrollX * src.scrollFactorX; spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); } - skeleton.x = calcMatrix.tx; - skeleton.y = calcMatrix.ty; + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); - skeleton.scaleX = calcMatrix.scaleX; - - // Inverse or we get upside-down skeletons - skeleton.scaleY = calcMatrix.scaleY * -1; - - if (src.scaleX < 0) - { - skeleton.scaleX *= -1; - - src.root.rotation = RadToDeg(calcMatrix.rotationNormalized); - } - else - { - // +90 degrees to account for the difference in Spine vs. Phaser rotation - src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360); - } - - if (src.scaleY < 0) - { - skeleton.scaleY *= -1; - - if (src.scaleX < 0) - { - src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2); - } - else - { - src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2); - } - } - - if (camera.renderToTexture) - { - skeleton.y = calcMatrix.ty; - skeleton.scaleY *= -1; - } - - skeleton.updateWorldTransform(); - - skeletonRenderer.ctx = context; - skeletonRenderer.debugRendering = (plugin.drawDebug || src.drawDebug); - - context.save(); - - skeletonRenderer.draw(skeleton); - - context.restore(); + return result; }; -module.exports = SpineGameObjectCanvasRenderer; +module.exports = GetCalcMatrix; /***/ }), -/* 260 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 4344: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); -var Container = __webpack_require__(261); -var SpineContainerRender = __webpack_require__(347); +var Clamp = __webpack_require__(2915); + +// bitmask flag for GameObject.renderMask +var _FLAG = 2; // 0010 /** - * @classdesc - * A Spine Container is a special kind of Container created specifically for Spine Game Objects. + * Provides methods used for setting the alpha properties of a Game Object. + * Should be applied as a mixin and not used directly. * - * You have all of the same features of a standard Container, but the rendering functions are optimized specifically - * for Spine Game Objects. You must only add ever Spine Game Objects, or other Spine Containers, to this type of Container. - * Although Phaser will not prevent you from adding other types, they will not render and are likely to throw runtime errors. - * - * To create one in a Scene, use the factory methods: - * - * ```javascript - * this.add.spineContainer(); - * ``` - * - * or - * - * ```javascript - * this.make.spineContainer(); - * ``` - * - * Note that you should not nest Spine Containers inside regular Containers if you wish to use masks on the - * container children. You can, however, mask children of Spine Containers if they are embedded within other - * Spine Containers. In short, if you need masking, don't mix and match the types. - * - * See the Container documentation for further details about what Containers can do. - * - * @class SpineContainer - * @extends Phaser.GameObjects.Container - * @constructor - * @since 3.50.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene that this Game Object belongs to. - * @param {SpinePlugin} pluginManager - A reference to the Phaser Spine Plugin. - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {SpineGameObject[]} [children] - An optional array of Spine Game Objects to add to this Container. + * @namespace Phaser.GameObjects.Components.Alpha + * @since 3.0.0 */ -var SpineContainer = new Class({ - Extends: Container, +var Alpha = { - Mixins: [ - SpineContainerRender - ], + /** + * Private internal value. Holds the global alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alpha + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alpha: 1, - initialize: + /** + * Private internal value. Holds the top-left alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaTL + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaTL: 1, - function SpineContainer (scene, plugin, x, y, children) + /** + * Private internal value. Holds the top-right alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaTR + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaTR: 1, + + /** + * Private internal value. Holds the bottom-left alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaBL + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaBL: 1, + + /** + * Private internal value. Holds the bottom-right alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaBR + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaBR: 1, + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + * + * @method Phaser.GameObjects.Components.Alpha#clearAlpha + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + clearAlpha: function () { - Container.call(this, scene, x, y, children); - - // Same as SpineGameObject, to prevent the renderer from mis-typing it when batching - this.type = 'Spine'; - - /** - * A reference to the Spine Plugin. - * - * @name SpineContainer#plugin - * @type {SpinePlugin} - * @since 3.50.0 - */ - this.plugin = plugin; + return this.setAlpha(1); }, /** - * Internal destroy handler, called as part of the destroy process. + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. * - * @method SpineContainer#preDestroy - * @protected - * @since 3.50.0 + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * + * @method Phaser.GameObjects.Components.Alpha#setAlpha + * @since 3.0.0 + * + * @param {number} [topLeft=1] - The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. + * @param {number} [topRight] - The alpha value used for the top-right of the Game Object. WebGL only. + * @param {number} [bottomLeft] - The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param {number} [bottomRight] - The alpha value used for the bottom-right of the Game Object. WebGL only. + * + * @return {this} This Game Object instance. */ - preDestroy: function () + setAlpha: function (topLeft, topRight, bottomLeft, bottomRight) { - this.removeAll(!!this.exclusive); + if (topLeft === undefined) { topLeft = 1; } - this.localTransform.destroy(); - this.tempTransformMatrix.destroy(); + // Treat as if there is only one alpha value for the whole Game Object + if (topRight === undefined) + { + this.alpha = topLeft; + } + else + { + this._alphaTL = Clamp(topLeft, 0, 1); + this._alphaTR = Clamp(topRight, 0, 1); + this._alphaBL = Clamp(bottomLeft, 0, 1); + this._alphaBR = Clamp(bottomRight, 0, 1); + } + return this; + }, + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + * + * @name Phaser.GameObjects.Components.Alpha#alpha + * @type {number} + * @since 3.0.0 + */ + alpha: { + + get: function () + { + return this._alpha; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alpha = v; + this._alphaTL = v; + this._alphaTR = v; + this._alphaBL = v; + this._alphaBR = v; + + if (v === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaTopLeft + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaTopLeft: { + + get: function () + { + return this._alphaTL; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaTL = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaTopRight + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaTopRight: { + + get: function () + { + return this._alphaTR; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaTR = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaBottomLeft + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaBottomLeft: { + + get: function () + { + return this._alphaBL; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaBL = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaBottomRight + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaBottomRight: { + + get: function () + { + return this._alphaBR; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaBR = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + } + +}; + +module.exports = Alpha; + + +/***/ }), + +/***/ 4518: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(2915); + +// bitmask flag for GameObject.renderMask +var _FLAG = 2; // 0010 + +/** + * Provides methods used for setting the alpha property of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.AlphaSingle + * @since 3.22.0 + */ + +var AlphaSingle = { + + /** + * Private internal value. Holds the global alpha value. + * + * @name Phaser.GameObjects.Components.AlphaSingle#_alpha + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alpha: 1, + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + * + * @method Phaser.GameObjects.Components.AlphaSingle#clearAlpha + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + clearAlpha: function () + { + return this.setAlpha(1); + }, + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * @method Phaser.GameObjects.Components.AlphaSingle#setAlpha + * @since 3.0.0 + * + * @param {number} [value=1] - The alpha value applied across the whole Game Object. + * + * @return {this} This Game Object instance. + */ + setAlpha: function (value) + { + if (value === undefined) { value = 1; } + + this.alpha = value; + + return this; + }, + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + * + * @name Phaser.GameObjects.Components.AlphaSingle#alpha + * @type {number} + * @since 3.0.0 + */ + alpha: { + + get: function () + { + return this._alpha; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alpha = v; + + if (v === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + } + +}; + +module.exports = AlphaSingle; + + +/***/ }), + +/***/ 5173: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(8351); + +/** + * Provides methods used for setting the blend mode of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.BlendMode + * @since 3.0.0 + */ + +var BlendMode = { + + /** + * Private internal value. Holds the current blend mode. + * + * @name Phaser.GameObjects.Components.BlendMode#_blendMode + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + _blendMode: BlendModes.NORMAL, + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * NORMAL + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + * + * @name Phaser.GameObjects.Components.BlendMode#blendMode + * @type {(Phaser.BlendModes|string|number)} + * @since 3.0.0 + */ + blendMode: { + + get: function () + { + return this._blendMode; + }, + + set: function (value) + { + if (typeof value === 'string') + { + value = BlendModes[value]; + } + + value |= 0; + + if (value >= -1) + { + this._blendMode = value; + } + } + + }, + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * NORMAL + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * + * @method Phaser.GameObjects.Components.BlendMode#setBlendMode + * @since 3.0.0 + * + * @param {(string|Phaser.BlendModes|number)} value - The BlendMode value. Either a string, a CONST or a number. + * + * @return {this} This Game Object instance. + */ + setBlendMode: function (value) + { + this.blendMode = value; + + return this; + } + +}; + +module.exports = BlendMode; + + +/***/ }), + +/***/ 1991: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for calculating and setting the size of a non-Frame based Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.ComputedSize + * @since 3.0.0 + */ + +var ComputedSize = { + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + * + * @name Phaser.GameObjects.Components.ComputedSize#width + * @type {number} + * @since 3.0.0 + */ + width: 0, + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + * + * @name Phaser.GameObjects.Components.ComputedSize#height + * @type {number} + * @since 3.0.0 + */ + height: 0, + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.ComputedSize#displayWidth + * @type {number} + * @since 3.0.0 + */ + displayWidth: { + + get: function () + { + return this.scaleX * this.width; + }, + + set: function (value) + { + this.scaleX = value / this.width; + } + + }, + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.ComputedSize#displayHeight + * @type {number} + * @since 3.0.0 + */ + displayHeight: { + + get: function () + { + return this.scaleY * this.height; + }, + + set: function (value) + { + this.scaleY = value / this.height; + } + + }, + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Components.ComputedSize#setSize + * @since 3.4.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setSize: function (width, height) + { + this.width = width; + this.height = height; + + return this; + }, + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * + * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize + * @since 3.4.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDisplaySize: function (width, height) + { + this.displayWidth = width; + this.displayHeight = height; + + return this; + } + +}; + +module.exports = ComputedSize; + + +/***/ }), + +/***/ 8305: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the texture of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Crop + * @since 3.12.0 + */ + +var Crop = { + + /** + * The Texture this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Crop#texture + * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} + * @since 3.0.0 + */ + texture: null, + + /** + * The Texture Frame this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Crop#frame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + frame: null, + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + * + * @name Phaser.GameObjects.Components.Crop#isCropped + * @type {boolean} + * @since 3.11.0 + */ + isCropped: false, + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * + * @method Phaser.GameObjects.Components.Crop#setCrop + * @since 3.11.0 + * + * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param {number} [y] - The y coordinate to start the crop from. + * @param {number} [width] - The width of the crop rectangle in pixels. + * @param {number} [height] - The height of the crop rectangle in pixels. + * + * @return {this} This Game Object instance. + */ + setCrop: function (x, y, width, height) + { + if (x === undefined) + { + this.isCropped = false; + } + else if (this.frame) + { + if (typeof x === 'number') + { + this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY); + } + else + { + var rect = x; + + this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY); + } + + this.isCropped = true; + } + + return this; + }, + + /** + * Internal method that returns a blank, well-formed crop object for use by a Game Object. + * + * @method Phaser.GameObjects.Components.Crop#resetCropObject + * @private + * @since 3.12.0 + * + * @return {object} The crop object. + */ + resetCropObject: function () + { + return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 }; + } + +}; + +module.exports = Crop; + + +/***/ }), + +/***/ 3131: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the depth of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Depth + * @since 3.0.0 + */ + +var Depth = { + + /** + * Private internal value. Holds the depth of the Game Object. + * + * @name Phaser.GameObjects.Components.Depth#_depth + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + _depth: 0, + + /** + * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * + * @name Phaser.GameObjects.Components.Depth#depth + * @type {number} + * @since 3.0.0 + */ + depth: { + + get: function () + { + return this._depth; + }, + + set: function (value) + { + if (this.displayList) + { + this.displayList.queueDepthSort(); + } + + this._depth = value; + } + + }, + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * + * @method Phaser.GameObjects.Components.Depth#setDepth + * @since 3.0.0 + * + * @param {number} value - The depth of this Game Object. Ensure this value is only ever a number data-type. + * + * @return {this} This Game Object instance. + */ + setDepth: function (value) + { + if (value === undefined) { value = 0; } + + this.depth = value; + + return this; + } + +}; + +module.exports = Depth; + + +/***/ }), + +/***/ 1626: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Effects = __webpack_require__(7347); +var SpliceOne = __webpack_require__(8935); + +/** + * @classdesc + * The FX Component features a set of methods used for applying a range of special built-in effects to a Game Object. + * + * The effects include the following: + * + * * Barrel Distortion + * * Bloom + * * Blur + * * Bokeh / Tilt Shift + * * Circle Outline + * * Color Matrix + * * Glow + * * Displacement + * * Gradient + * * Pixelate + * * Shine + * * Shadow + * * Vignette + * * Wipe / Reveal + * + * All Game Objects support Post FX. These are effects applied after the Game Object has been rendered. + * + * Texture-based Game Objects also support Pre FX, including: + * + * * Image + * * Sprite + * * TileSprite + * * Text + * * RenderTexture + * * Video + * + * And any Game Object that extends the above. + * + * The difference between Pre FX and Post FX are that all Post FX take place in a canvas (renderer) sized frame buffer, + * after the Game Object has been rendered. Pre FX, however, take place in a texture sized frame buffer, which is sized + * based on the Game Object itself. The end result is then composited back to the main game canvas. For intensive effects, + * such as blur, bloom or glow, which can require many iterations, this is a much more efficient way to apply the effect, + * as only it only has to work on a Game Object sized texture and not all pixels in the canvas. + * + * In short, you should always try and use a Pre FX if you can. + * + * Due to the way that FX work they can be stacked-up. For example, you can apply a blur to a Game Object, then apply + * a bloom effect to the same Game Object. The bloom effect will be applied to the blurred texture, not the original. + * Keep the order in mind when stacking effects. + * + * All effects are WebGL only and do not have canvas counterparts. + * + * As you can appreciate, some effects are more expensive than others. For example, a bloom effect is going to be more + * expensive than a simple color matrix effect, so please consider using them wisely and performance test your target + * platforms early on in production. + * + * This component is created automatically by the `PostPipeline` class and does not need to be instantiated directly. + * + * @class FX + * @memberof Phaser.GameObjects.Components + * @constructor + * @since 3.60.0 + * @webglOnly + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that owns this FX Component. + * @param {boolean} isPost - Is this a Pre or Post FX Component? + */ +var FX = new Class({ + + initialize: + + function FX (gameObject, isPost) + { + /** + * A reference to the Game Object that owns this FX Component. + * + * @name Phaser.GameObjects.Components.FX#gameObject + * @type {Phaser.GameObjects.GameObject} + * @readonly + * @since 3.60.0 + */ + this.gameObject = gameObject; + + /** + * Is this a Post FX Controller? or a Pre FX Controller? + * + * @name Phaser.GameObjects.Components.FX#isPost + * @type {boolean} + * @readonly + * @since 3.60.0 + */ + this.isPost = isPost; + + /** + * Has this FX Component been enabled? + * + * You should treat this property as read-only, although it is toggled + * automaticaly during internal use. + * + * @name Phaser.GameObjects.Components.FX#enabled + * @type {boolean} + * @since 3.60.0 + */ + this.enabled = false; + + /** + * An array containing all of the Pre FX Controllers that + * have been added to this FX Component. They are processed in + * the order they are added. + * + * This array is empty if this is a Post FX Component. + * + * @name Phaser.GameObjects.Components.FX#list + * @type {Phaser.FX.Controller[]} + * @since 3.60.0 + */ this.list = []; - this._displayList = null; - this.plugin = null; + + /** + * The amount of extra padding to be applied to this Game Object + * when it is being rendered by a PreFX Pipeline. + * + * Lots of FX require additional spacing added to the texture the + * Game Object uses, for example a glow or shadow effect, and this + * method allows you to control how much extra padding is included + * in addition to the texture size. + * + * You do not need to set this if you're only using Post FX. + * + * @name Phaser.GameObjects.Components.FX#padding + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.padding = 0; + }, + + /** + * Sets the amount of extra padding to be applied to this Game Object + * when it is being rendered by a PreFX Pipeline. + * + * Lots of FX require additional spacing added to the texture the + * Game Object uses, for example a glow or shadow effect, and this + * method allows you to control how much extra padding is included + * in addition to the texture size. + * + * You do not need to set this if you're only using Post FX. + * + * @method Phaser.GameObjects.Components.FX#setPadding + * @webglOnly + * @since 3.60.0 + * + * @param {number} [padding=0] - The amount of padding to add to this Game Object. + * + * @return {this} This Game Object instance. + */ + setPadding: function (padding) + { + if (padding === undefined) { padding = 0; } + + this.padding = padding; + + return this.gameObject; + }, + + /** + * This callback is invoked when this Game Object is copied by a PreFX Pipeline. + * + * This happens when the pipeline uses its `copySprite` method. + * + * It's invoked prior to the copy, allowing you to set shader uniforms, etc on the pipeline. + * + * @method Phaser.GameObjects.Components.FX#onFXCopy + * @since 3.60.0 + * + * @param {Phaser.Renderer.WebGL.Pipelines.PreFXPipeline} pipeline - The PreFX Pipeline that invoked this callback. + */ + onFXCopy: function () + { + }, + + /** + * This callback is invoked when this Game Object is rendered by a PreFX Pipeline. + * + * This happens when the pipeline uses its `drawSprite` method. + * + * It's invoked prior to the draw, allowing you to set shader uniforms, etc on the pipeline. + * + * @method Phaser.GameObjects.Components.FX#onFX + * @since 3.60.0 + * + * @param {Phaser.Renderer.WebGL.Pipelines.PreFXPipeline} pipeline - The PreFX Pipeline that invoked this callback. + */ + onFX: function () + { + }, + + /** + * Enables this FX Component and applies the FXPipeline to the parent Game Object. + * + * This is called automatically whenever you call a method such as `addBloom`, etc. + * + * You can check the `enabled` property to see if the Game Object is already enabled, or not. + * + * This only applies to Pre FX. Post FX are always enabled. + * + * @method Phaser.GameObjects.Components.FX#enable + * @since 3.60.0 + * + * @param {number} [padding=0] - The amount of padding to add to this Game Object. + */ + enable: function (padding) + { + if (this.isPost) + { + return; + } + + var renderer = this.gameObject.scene.sys.renderer; + + if (renderer && renderer.pipelines) + { + this.gameObject.pipeline = renderer.pipelines.FX_PIPELINE; + + if (padding !== undefined) + { + this.padding = padding; + } + + this.enabled = true; + } + else + { + this.enabled = false; + } + }, + + /** + * Destroys and removes all FX Controllers that are part of this FX Component, + * then disables it. + * + * If this is a Pre FX Component it will only remove Pre FX. + * If this is a Post FX Component it will only remove Post FX. + * + * To remove both at once use the `GameObject.clearFX` method instead. + * + * @method Phaser.GameObjects.Components.FX#clear + * @since 3.60.0 + * + * @return {this} This Game Object instance. + */ + clear: function () + { + if (this.isPost) + { + this.gameObject.resetPostPipeline(true); + } + else + { + var list = this.list; + + for (var i = 0; i < list.length; i++) + { + list[i].destroy(); + } + + this.list = []; + } + + this.enabled = false; + + return this.gameObject; + }, + + /** + * Searches for the given FX Controller within this FX Component. + * + * If found, the controller is removed from this component and then destroyed. + * + * @method Phaser.GameObjects.Components.FX#remove + * @since 3.60.0 + * + * @generic {Phaser.FX.Controller} T + * @genericUse {T} - [fx] + * + * @param {Phaser.FX.Controller} fx - The FX Controller to remove from this FX Component. + * + * @return {this} This Game Object instance. + */ + remove: function (fx) + { + var i; + + if (this.isPost) + { + var pipelines = this.gameObject.getPostPipeline(String(fx.type)); + + if (!Array.isArray(pipelines)) + { + pipelines = [ pipelines ]; + } + + for (i = 0; i < pipelines.length; i++) + { + var pipeline = pipelines[i]; + + if (pipeline.controller === fx) + { + this.gameObject.removePostPipeline(pipeline); + + fx.destroy(); + + break; + } + } + } + else + { + var list = this.list; + + for (i = 0; i < list.length; i++) + { + if (list[i] === fx) + { + SpliceOne(list, i); + + fx.destroy(); + } + } + } + + return this.gameObject; + }, + + /** + * Disables this FX Component. + * + * This will reset the pipeline on the Game Object that owns this component back to its + * default and flag this component as disabled. + * + * You can re-enable it again by calling `enable` for Pre FX or by adding an FX for Post FX. + * + * Optionally, set `clear` to destroy all current FX Controllers. + * + * @method Phaser.GameObjects.Components.FX#disable + * @since 3.60.0 + * + * @param {boolean} [clear=false] - Destroy and remove all FX Controllers that are part of this component. + * + * @return {this} This Game Object instance. + */ + disable: function (clear) + { + if (clear === undefined) { clear = false; } + + if (!this.isPost) + { + this.gameObject.resetPipeline(); + } + + this.enabled = false; + + if (clear) + { + this.clear(); + } + + return this.gameObject; + }, + + /** + * Adds the given FX Controler to this FX Component. + * + * Note that adding an FX Controller does not remove any existing FX. They all stack-up + * on-top of each other. If you don't want this, make sure to call either `remove` or + * `clear` first. + * + * @method Phaser.GameObjects.Components.FX#add + * @since 3.60.0 + * + * @generic {Phaser.FX.Controller} T + * @genericUse {T} - [fx] + * + * @param {Phaser.FX.Controller} fx - The FX Controller to add to this FX Component. + * @param {object} [config] - Optional configuration object that is passed to the pipeline during instantiation. + * + * @return {Phaser.FX.Controller} The FX Controller. + */ + add: function (fx, config) + { + if (this.isPost) + { + var type = String(fx.type); + + this.gameObject.setPostPipeline(type, config); + + var pipeline = this.gameObject.getPostPipeline(type); + + if (pipeline) + { + if (Array.isArray(pipeline)) + { + pipeline = pipeline.pop(); + } + + pipeline.controller = fx; + + return fx; + } + } + else + { + if (!this.enabled) + { + this.enable(); + } + + this.list.push(fx); + + return fx; + } + }, + + /** + * Adds a Glow effect. + * + * The glow effect is a visual technique that creates a soft, luminous halo around game objects, + * characters, or UI elements. This effect is used to emphasize importance, enhance visual appeal, + * or convey a sense of energy, magic, or otherworldly presence. The effect can also be set on + * the inside of the Game Object. The color and strength of the glow can be modified. + * + * @method Phaser.GameObjects.Components.FX#addGlow + * @since 3.60.0 + * + * @param {number} [color=0xffffff] - The color of the glow effect as a number value. + * @param {number} [outerStrength=4] - The strength of the glow outward from the edge of the Sprite. + * @param {number} [innerStrength=0] - The strength of the glow inward from the edge of the Sprite. + * @param {boolean} [knockout=false] - If `true` only the glow is drawn, not the texture itself. + * @param {number} [quality=0.1] - Only available for PostFX. Sets the quality of this Glow effect. Default is 0.1. Cannot be changed post-creation. + * @param {number} [distance=10] - Only available for PostFX. Sets the distance of this Glow effect. Default is 10. Cannot be changed post-creation. + * + * @return {Phaser.FX.Glow} The Glow FX Controller. + */ + addGlow: function (color, outerStrength, innerStrength, knockout, quality, distance) + { + return this.add(new Effects.Glow(this.gameObject, color, outerStrength, innerStrength, knockout), { quality: quality, distance: distance }); + }, + + /** + * Adds a Shadow effect. + * + * The shadow effect is a visual technique used to create the illusion of depth and realism by adding darker, + * offset silhouettes or shapes beneath game objects, characters, or environments. These simulated shadows + * help to enhance the visual appeal and immersion, making the 2D game world appear more dynamic and three-dimensional. + * + * @method Phaser.GameObjects.Components.FX#addShadow + * @since 3.60.0 + * + * @param {number} [x=0] - The horizontal offset of the shadow effect. + * @param {number} [y=0] - The vertical offset of the shadow effect. + * @param {number} [decay=0.1] - The amount of decay for shadow effect. + * @param {number} [power=1] - The power of the shadow effect. + * @param {number} [color=0x000000] - The color of the shadow. + * @param {number} [samples=6] - The number of samples that the shadow effect will run for. An integer between 1 and 12. + * @param {number} [intensity=1] - The intensity of the shadow effect. + * + * @return {Phaser.FX.Shadow} The Shadow FX Controller. + */ + addShadow: function (x, y, decay, power, color, samples, intensity) + { + return this.add(new Effects.Shadow(this.gameObject, x, y, decay, power, color, samples, intensity)); + }, + + /** + * Adds a Pixelate effect. + * + * The pixelate effect is a visual technique that deliberately reduces the resolution or detail of an image, + * creating a blocky or mosaic appearance composed of large, visible pixels. This effect can be used for stylistic + * purposes, as a homage to retro gaming, or as a means to obscure certain elements within the game, such as + * during a transition or to censor specific content. + * + * @method Phaser.GameObjects.Components.FX#addPixelate + * @since 3.60.0 + * + * @param {number} [amount=1] - The amount of pixelation to apply. + * + * @return {Phaser.FX.Pixelate} The Pixelate FX Controller. + */ + addPixelate: function (amount) + { + return this.add(new Effects.Pixelate(this.gameObject, amount)); + }, + + /** + * Adds a Vignette effect. + * + * The vignette effect is a visual technique where the edges of the screen, or a Game Object, gradually darken or blur, + * creating a frame-like appearance. This effect is used to draw the player's focus towards the central action or subject, + * enhance immersion, and provide a cinematic or artistic quality to the game's visuals. + * + * @method Phaser.GameObjects.Components.FX#addVignette + * @since 3.60.0 + * + * @param {number} [x=0.5] - The horizontal offset of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [y=0.5] - The vertical offset of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [radius=0.5] - The radius of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [strength=0.5] - The strength of the vignette effect. + * + * @return {Phaser.FX.Vignette} The Vignette FX Controller. + */ + addVignette: function (x, y, radius, strength) + { + return this.add(new Effects.Vignette(this.gameObject, x, y, radius, strength)); + }, + + /** + * Adds a Shine effect. + * + * The shine effect is a visual technique that simulates the appearance of reflective + * or glossy surfaces by passing a light beam across a Game Object. This effect is used to + * enhance visual appeal, emphasize certain features, and create a sense of depth or + * material properties. + * + * @method Phaser.GameObjects.Components.FX#addShine + * @since 3.60.0 + * + * @param {number} [speed=0.5] - The speed of the Shine effect. + * @param {number} [lineWidth=0.5] - The line width of the Shine effect. + * @param {number} [gradient=3] - The gradient of the Shine effect. + * @param {boolean} [reveal=false] - Does this Shine effect reveal or get added to its target? + * + * @return {Phaser.FX.Shine} The Shine FX Controller. + */ + addShine: function (speed, lineWidth, gradient, reveal) + { + return this.add(new Effects.Shine(this.gameObject, speed, lineWidth, gradient, reveal)); + }, + + /** + * Adds a Blur effect. + * + * A Gaussian blur is the result of blurring an image by a Gaussian function. It is a widely used effect, + * typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a + * smooth blur resembling that of viewing the image through a translucent screen, distinctly different + * from the bokeh effect produced by an out-of-focus lens or the shadow of an object under usual illumination. + * + * @method Phaser.GameObjects.Components.FX#addBlur + * @since 3.60.0 + * + * @param {number} [quality=0] - The quality of the blur effect. Can be either 0 for Low Quality, 1 for Medium Quality or 2 for High Quality. + * @param {number} [x=2] - The horizontal offset of the blur effect. + * @param {number} [y=2] - The vertical offset of the blur effect. + * @param {number} [strength=1] - The strength of the blur effect. + * @param {number} [color=0xffffff] - The color of the blur, as a hex value. + * @param {number} [steps=4] - The number of steps to run the blur effect for. This value should always be an integer. + * + * @return {Phaser.FX.Blur} The Blur FX Controller. + */ + addBlur: function (quality, x, y, strength, color, steps) + { + return this.add(new Effects.Blur(this.gameObject, quality, x, y, strength, color, steps)); + }, + + /** + * Adds a Gradient effect. + * + * The gradient overlay effect is a visual technique where a smooth color transition is applied over Game Objects, + * such as sprites or UI components. This effect is used to enhance visual appeal, emphasize depth, or create + * stylistic and atmospheric variations. It can also be utilized to convey information, such as representing + * progress or health status through color changes. + * + * @method Phaser.GameObjects.Components.FX#addGradient + * @since 3.60.0 + * + * @param {number} [color1=0xff0000] - The first gradient color, given as a number value. + * @param {number} [color2=0x00ff00] - The second gradient color, given as a number value. + * @param {number} [alpha=0.2] - The alpha value of the gradient effect. + * @param {number} [fromX=0] - The horizontal position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [fromY=0] - The vertical position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [toX=0] - The horizontal position the gradient will end at. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [toY=1] - The vertical position the gradient will end at. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [size=0] - How many 'chunks' the gradient is divided in to, as spread over the entire height of the texture. Leave this at zero for a smooth gradient, or set higher for a more retro chunky effect. + * + * @return {Phaser.FX.Gradient} The Gradient FX Controller. + */ + addGradient: function (color1, color2, alpha, fromX, fromY, toX, toY, size) + { + return this.add(new Effects.Gradient(this.gameObject, color1, color2, alpha, fromX, fromY, toX, toY, size)); + }, + + /** + * Adds a Bloom effect. + * + * Bloom is an effect used to reproduce an imaging artifact of real-world cameras. + * The effect produces fringes of light extending from the borders of bright areas in an image, + * contributing to the illusion of an extremely bright light overwhelming the + * camera or eye capturing the scene. + * + * @method Phaser.GameObjects.Components.FX#addBloom + * @since 3.60.0 + * + * @param {number} [color] - The color of the Bloom, as a hex value. + * @param {number} [offsetX=1] - The horizontal offset of the bloom effect. + * @param {number} [offsetY=1] - The vertical offset of the bloom effect. + * @param {number} [blurStrength=1] - The strength of the blur process of the bloom effect. + * @param {number} [strength=1] - The strength of the blend process of the bloom effect. + * @param {number} [steps=4] - The number of steps to run the Bloom effect for. This value should always be an integer. + * + * @return {Phaser.FX.Bloom} The Bloom FX Controller. + */ + addBloom: function (color, offsetX, offsetY, blurStrength, strength, steps) + { + return this.add(new Effects.Bloom(this.gameObject, color, offsetX, offsetY, blurStrength, strength, steps)); + }, + + /** + * Adds a ColorMatrix effect. + * + * The color matrix effect is a visual technique that involves manipulating the colors of an image + * or scene using a mathematical matrix. This process can adjust hue, saturation, brightness, and contrast, + * allowing developers to create various stylistic appearances or mood settings within the game. + * Common applications include simulating different lighting conditions, applying color filters, + * or achieving a specific visual style. + * + * @method Phaser.GameObjects.Components.FX#addColorMatrix + * @since 3.60.0 + * + * @return {Phaser.FX.ColorMatrix} The ColorMatrix FX Controller. + */ + addColorMatrix: function () + { + return this.add(new Effects.ColorMatrix(this.gameObject)); + }, + + /** + * Adds a Circle effect. + * + * This effect will draw a circle around the texture of the Game Object, effectively masking off + * any area outside of the circle without the need for an actual mask. You can control the thickness + * of the circle, the color of the circle and the color of the background, should the texture be + * transparent. You can also control the feathering applied to the circle, allowing for a harsh or soft edge. + * + * Please note that adding this effect to a Game Object will not change the input area or physics body of + * the Game Object, should it have one. + * + * @method Phaser.GameObjects.Components.FX#addCircle + * @since 3.60.0 + * + * @param {number} [thickness=8] - The width of the circle around the texture, in pixels. + * @param {number} [color=0xfeedb6] - The color of the circular ring, given as a number value. + * @param {number} [backgroundColor=0xff0000] - The color of the background, behind the texture, given as a number value. + * @param {number} [scale=1] - The scale of the circle. The default scale is 1, which is a circle the full size of the underlying texture. + * @param {number} [feather=0.005] - The amount of feathering to apply to the circle from the ring. + * + * @return {Phaser.FX.Circle} The Circle FX Controller. + */ + addCircle: function (thickness, color, backgroundColor, scale, feather) + { + return this.add(new Effects.Circle(this.gameObject, thickness, color, backgroundColor, scale, feather)); + }, + + /** + * Adds a Barrel effect. + * + * A barrel effect allows you to apply either a 'pinch' or 'expand' distortion to + * a Game Object. The amount of the effect can be modified in real-time. + * + * @method Phaser.GameObjects.Components.FX#addBarrel + * @since 3.60.0 + * + * @param {number} [amount=1] - The amount of distortion applied to the barrel effect. A value of 1 is no distortion. Typically keep this within +- 1. + * + * @return {Phaser.FX.Barrel} The Barrel FX Controller. + */ + addBarrel: function (amount) + { + return this.add(new Effects.Barrel(this.gameObject, amount)); + }, + + /** + * Adds a Displacement effect. + * + * The displacement effect is a visual technique that alters the position of pixels in an image + * or texture based on the values of a displacement map. This effect is used to create the illusion + * of depth, surface irregularities, or distortion in otherwise flat elements. It can be applied to + * characters, objects, or backgrounds to enhance realism, convey movement, or achieve various + * stylistic appearances. + * + * @method Phaser.GameObjects.Components.FX#addDisplacement + * @since 3.60.0 + * + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * @param {number} [x=0.005] - The amount of horizontal displacement to apply. A very small float number, such as 0.005. + * @param {number} [y=0.005] - The amount of vertical displacement to apply. A very small float number, such as 0.005. + * + * @return {Phaser.FX.Displacement} The Displacement FX Controller. + */ + addDisplacement: function (texture, x, y) + { + return this.add(new Effects.Displacement(this.gameObject, texture, x, y)); + }, + + /** + * Adds a Wipe effect. + * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * + * @method Phaser.GameObjects.Components.FX#addWipe + * @since 3.60.0 + * + * @param {number} [wipeWidth=0.1] - The width of the wipe effect. This value is normalized in the range 0 to 1. + * @param {number} [direction=0] - The direction of the wipe effect. Either 0 or 1. Set in conjunction with the axis property. + * @param {number} [axis=0] - The axis of the wipe effect. Either 0 or 1. Set in conjunction with the direction property. + * + * @return {Phaser.FX.Wipe} The Wipe FX Controller. + */ + addWipe: function (wipeWidth, direction, axis) + { + return this.add(new Effects.Wipe(this.gameObject, wipeWidth, direction, axis)); + }, + + /** + * Adds a Reveal Wipe effect. + * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * + * @method Phaser.GameObjects.Components.FX#addReveal + * @since 3.60.0 + * + * @param {number} [wipeWidth=0.1] - The width of the wipe effect. This value is normalized in the range 0 to 1. + * @param {number} [direction=0] - The direction of the wipe effect. Either 0 or 1. Set in conjunction with the axis property. + * @param {number} [axis=0] - The axis of the wipe effect. Either 0 or 1. Set in conjunction with the direction property. + * + * @return {Phaser.FX.Wipe} The Wipe FX Controller. + */ + addReveal: function (wipeWidth, direction, axis) + { + return this.add(new Effects.Wipe(this.gameObject, wipeWidth, direction, axis, true)); + }, + + /** + * Adds a Bokeh effect. + * + * Bokeh refers to a visual effect that mimics the photographic technique of creating a shallow depth of field. + * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground + * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering + * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. + * + * See also Tilt Shift. + * + * @method Phaser.GameObjects.Components.FX#addBokeh + * @since 3.60.0 + * + * @param {number} [radius=0.5] - The radius of the bokeh effect. + * @param {number} [amount=1] - The amount of the bokeh effect. + * @param {number} [contrast=0.2] - The color contrast of the bokeh effect. + * + * @return {Phaser.FX.Bokeh} The Bokeh FX Controller. + */ + addBokeh: function (radius, amount, contrast) + { + return this.add(new Effects.Bokeh(this.gameObject, radius, amount, contrast)); + }, + + /** + * Adds a Tilt Shift effect. + * + * This Bokeh effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature + * effect by blurring everything except a small area of the image. This effect is achieved by blurring the + * top and bottom elements, while keeping the center area in focus. + * + * See also Bokeh. + * + * @method Phaser.GameObjects.Components.FX#addTiltShift + * @since 3.60.0 + * + * @param {number} [radius=0.5] - The radius of the bokeh effect. + * @param {number} [amount=1] - The amount of the bokeh effect. + * @param {number} [contrast=0.2] - The color contrast of the bokeh effect. + * @param {number} [blurX=1] - The amount of horizontal blur. + * @param {number} [blurY=1] - The amount of vertical blur. + * @param {number} [strength=1] - The strength of the blur. + * + * @return {Phaser.FX.Bokeh} The Bokeh TiltShift FX Controller. + */ + addTiltShift: function (radius, amount, contrast, blurX, blurY, strength) + { + return this.add(new Effects.Bokeh(this.gameObject, radius, amount, contrast, true, blurX, blurY, strength)); + }, + + /** + * Destroys this FX Component. + * + * Called automatically when Game Objects are destroyed. + * + * @method Phaser.GameObjects.Components.FX#destroy + * @since 3.60.0 + */ + destroy: function () + { + this.clear(); + + this.gameObject = null; } }); -module.exports = SpineContainer; +module.exports = FX; /***/ }), -/* 261 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 9660: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for visually flipping a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Flip + * @since 3.0.0 + */ + +var Flip = { + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @name Phaser.GameObjects.Components.Flip#flipX + * @type {boolean} + * @default false + * @since 3.0.0 + */ + flipX: false, + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @name Phaser.GameObjects.Components.Flip#flipY + * @type {boolean} + * @default false + * @since 3.0.0 + */ + flipY: false, + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#toggleFlipX + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + toggleFlipX: function () + { + this.flipX = !this.flipX; + + return this; + }, + + /** + * Toggles the vertical flipped state of this Game Object. + * + * @method Phaser.GameObjects.Components.Flip#toggleFlipY + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + toggleFlipY: function () + { + this.flipY = !this.flipY; + + return this; + }, + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#setFlipX + * @since 3.0.0 + * + * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlipX: function (value) + { + this.flipX = value; + + return this; + }, + + /** + * Sets the vertical flipped state of this Game Object. + * + * @method Phaser.GameObjects.Components.Flip#setFlipY + * @since 3.0.0 + * + * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlipY: function (value) + { + this.flipY = value; + + return this; + }, + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#setFlip + * @since 3.0.0 + * + * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlip: function (x, y) + { + this.flipX = x; + this.flipY = y; + + return this; + }, + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + * + * @method Phaser.GameObjects.Components.Flip#resetFlip + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + resetFlip: function () + { + this.flipX = false; + this.flipY = false; + + return this; + } + +}; + +module.exports = Flip; + + +/***/ }), + +/***/ 3671: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(1392); +var RotateAround = __webpack_require__(9876); +var Vector2 = __webpack_require__(2529); + +/** + * Provides methods used for obtaining the bounds of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.GetBounds + * @since 3.0.0 + */ + +var GetBounds = { + + /** + * Processes the bounds output vector before returning it. + * + * @method Phaser.GameObjects.Components.GetBounds#prepareBoundsOutput + * @private + * @since 3.18.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} output - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + prepareBoundsOutput: function (output, includeParent) + { + if (includeParent === undefined) { includeParent = false; } + + if (this.rotation !== 0) + { + RotateAround(output, this.x, this.y, this.rotation); + } + + if (includeParent && this.parentContainer) + { + var parentMatrix = this.parentContainer.getBoundsTransformMatrix(); + + parentMatrix.transformPoint(output.x, output.y, output); + } + + return output; + }, + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getCenter + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getCenter: function (output, includeParent) + { + if (output === undefined) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX) + (this.displayWidth / 2); + output.y = this.y - (this.displayHeight * this.originY) + (this.displayHeight / 2); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getTopLeft + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getTopLeft: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX); + output.y = this.y - (this.displayHeight * this.originY); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getTopCenter + * @since 3.18.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getTopCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2); + output.y = this.y - (this.displayHeight * this.originY); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getTopRight + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getTopRight: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; + output.y = this.y - (this.displayHeight * this.originY); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getLeftCenter + * @since 3.18.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getLeftCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX); + output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getRightCenter + * @since 3.18.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getRightCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; + output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getBottomLeft + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getBottomLeft: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX); + output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getBottomCenter + * @since 3.18.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getBottomCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2); + output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getBottomRight + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getBottomRight: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; + output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bounds of this Game Object, regardless of origin. + * + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * + * @method Phaser.GameObjects.Components.GetBounds#getBounds + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [output,$return] + * + * @param {(Phaser.Geom.Rectangle|object)} [output] - An object to store the values in. If not provided a new Rectangle will be created. + * + * @return {(Phaser.Geom.Rectangle|object)} The values stored in the output object. + */ + getBounds: function (output) + { + if (output === undefined) { output = new Rectangle(); } + + // We can use the output object to temporarily store the x/y coords in: + + var TLx, TLy, TRx, TRy, BLx, BLy, BRx, BRy; + + // Instead of doing a check if parent container is + // defined per corner we only do it once. + if (this.parentContainer) + { + var parentMatrix = this.parentContainer.getBoundsTransformMatrix(); + + this.getTopLeft(output); + parentMatrix.transformPoint(output.x, output.y, output); + + TLx = output.x; + TLy = output.y; + + this.getTopRight(output); + parentMatrix.transformPoint(output.x, output.y, output); + + TRx = output.x; + TRy = output.y; + + this.getBottomLeft(output); + parentMatrix.transformPoint(output.x, output.y, output); + + BLx = output.x; + BLy = output.y; + + this.getBottomRight(output); + parentMatrix.transformPoint(output.x, output.y, output); + + BRx = output.x; + BRy = output.y; + } + else + { + this.getTopLeft(output); + + TLx = output.x; + TLy = output.y; + + this.getTopRight(output); + + TRx = output.x; + TRy = output.y; + + this.getBottomLeft(output); + + BLx = output.x; + BLy = output.y; + + this.getBottomRight(output); + + BRx = output.x; + BRy = output.y; + } + + output.x = Math.min(TLx, TRx, BLx, BRx); + output.y = Math.min(TLy, TRy, BLy, BRy); + output.width = Math.max(TLx, TRx, BLx, BRx) - output.x; + output.height = Math.max(TLy, TRy, BLy, BRy) - output.y; + + return output; + } + +}; + +module.exports = GetBounds; + + +/***/ }), + +/***/ 2246: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BitmapMask = __webpack_require__(7499); +var GeometryMask = __webpack_require__(6726); + +/** + * Provides methods used for getting and setting the mask of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Mask + * @since 3.0.0 + */ + +var Mask = { + + /** + * The Mask this Game Object is using during render. + * + * @name Phaser.GameObjects.Components.Mask#mask + * @type {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} + * @since 3.0.0 + */ + mask: null, + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * + * @method Phaser.GameObjects.Components.Mask#setMask + * @since 3.6.2 + * + * @param {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} mask - The mask this Game Object will use when rendering. + * + * @return {this} This Game Object instance. + */ + setMask: function (mask) + { + this.mask = mask; + + return this; + }, + + /** + * Clears the mask that this Game Object was using. + * + * @method Phaser.GameObjects.Components.Mask#clearMask + * @since 3.6.2 + * + * @param {boolean} [destroyMask=false] - Destroy the mask before clearing it? + * + * @return {this} This Game Object instance. + */ + clearMask: function (destroyMask) + { + if (destroyMask === undefined) { destroyMask = false; } + + if (destroyMask && this.mask) + { + this.mask.destroy(); + } + + this.mask = null; + + return this; + }, + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one, or a Dynamic Texture. + * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable texture-based Game Object. + * + * @method Phaser.GameObjects.Components.Mask#createBitmapMask + * @since 3.6.2 + * + * @generic {Phaser.GameObjects.GameObject} G + * @generic {Phaser.Textures.DynamicTexture} T + * @genericUse {(G|T|null)} [maskObject] + * + * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Dynamic Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. + * @param {number} [x] - If creating a Game Object, the horizontal position in the world. + * @param {number} [y] - If creating a Game Object, the vertical position in the world. + * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created. + */ + createBitmapMask: function (maskObject, x, y, texture, frame) + { + if (maskObject === undefined && (this.texture || this.shader || this.geom)) + { + // eslint-disable-next-line consistent-this + maskObject = this; + } + + return new BitmapMask(this.scene, maskObject, x, y, texture, frame); + }, + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * + * @method Phaser.GameObjects.Components.Mask#createGeometryMask + * @since 3.6.2 + * + * @generic {Phaser.GameObjects.Graphics} G + * @generic {Phaser.GameObjects.Shape} S + * @genericUse {(G|S)} [graphics] + * + * @param {Phaser.GameObjects.Graphics|Phaser.GameObjects.Shape} [graphics] - A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask. + * + * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. + */ + createGeometryMask: function (graphics) + { + if (graphics === undefined && (this.type === 'Graphics' || this.geom)) + { + // eslint-disable-next-line consistent-this + graphics = this; + } + + return new GeometryMask(this.scene, graphics); + } + +}; + +module.exports = Mask; + + +/***/ }), + +/***/ 5085: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the origin of a Game Object. + * Values are normalized, given in the range 0 to 1. + * Display values contain the calculated pixel values. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Origin + * @since 3.0.0 + */ + +var Origin = { + + /** + * A property indicating that a Game Object has this component. + * + * @name Phaser.GameObjects.Components.Origin#_originComponent + * @type {boolean} + * @private + * @default true + * @since 3.2.0 + */ + _originComponent: true, + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + * Set this value with `setOrigin()`. + * + * @name Phaser.GameObjects.Components.Origin#originX + * @type {number} + * @readonly + * @default 0.5 + * @since 3.0.0 + */ + originX: 0.5, + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + * Set this value with `setOrigin()`. + * + * @name Phaser.GameObjects.Components.Origin#originY + * @type {number} + * @readonly + * @default 0.5 + * @since 3.0.0 + */ + originY: 0.5, + + // private + read only + _displayOriginX: 0, + _displayOriginY: 0, + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + * + * @name Phaser.GameObjects.Components.Origin#displayOriginX + * @type {number} + * @since 3.0.0 + */ + displayOriginX: { + + get: function () + { + return this._displayOriginX; + }, + + set: function (value) + { + this._displayOriginX = value; + this.originX = value / this.width; + } + + }, + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + * + * @name Phaser.GameObjects.Components.Origin#displayOriginY + * @type {number} + * @since 3.0.0 + */ + displayOriginY: { + + get: function () + { + return this._displayOriginY; + }, + + set: function (value) + { + this._displayOriginY = value; + this.originY = value / this.height; + } + + }, + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * + * @method Phaser.GameObjects.Components.Origin#setOrigin + * @since 3.0.0 + * + * @param {number} [x=0.5] - The horizontal origin value. + * @param {number} [y=x] - The vertical origin value. If not defined it will be set to the value of `x`. + * + * @return {this} This Game Object instance. + */ + setOrigin: function (x, y) + { + if (x === undefined) { x = 0.5; } + if (y === undefined) { y = x; } + + this.originX = x; + this.originY = y; + + return this.updateDisplayOrigin(); + }, + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + * + * @method Phaser.GameObjects.Components.Origin#setOriginFromFrame + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + setOriginFromFrame: function () + { + if (!this.frame || !this.frame.customPivot) + { + return this.setOrigin(); + } + else + { + this.originX = this.frame.pivotX; + this.originY = this.frame.pivotY; + } + + return this.updateDisplayOrigin(); + }, + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * + * @method Phaser.GameObjects.Components.Origin#setDisplayOrigin + * @since 3.0.0 + * + * @param {number} [x=0] - The horizontal display origin value. + * @param {number} [y=x] - The vertical display origin value. If not defined it will be set to the value of `x`. + * + * @return {this} This Game Object instance. + */ + setDisplayOrigin: function (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + + this.displayOriginX = x; + this.displayOriginY = y; + + return this; + }, + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + * + * @method Phaser.GameObjects.Components.Origin#updateDisplayOrigin + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + updateDisplayOrigin: function () + { + this._displayOriginX = this.originX * this.width; + this._displayOriginY = this.originY * this.height; + + return this; + } + +}; + +module.exports = Origin; + + +/***/ }), + +/***/ 77: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DegToRad = __webpack_require__(7149); +var GetBoolean = __webpack_require__(1864); +var GetValue = __webpack_require__(5851); +var TWEEN_CONST = __webpack_require__(3747); +var Vector2 = __webpack_require__(2529); + +/** + * Provides methods used for managing a Game Object following a Path. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.PathFollower + * @since 3.17.0 + */ + +var PathFollower = { + + /** + * The Path this PathFollower is following. It can only follow one Path at a time. + * + * @name Phaser.GameObjects.Components.PathFollower#path + * @type {Phaser.Curves.Path} + * @since 3.0.0 + */ + path: null, + + /** + * Should the PathFollower automatically rotate to point in the direction of the Path? + * + * @name Phaser.GameObjects.Components.PathFollower#rotateToPath + * @type {boolean} + * @default false + * @since 3.0.0 + */ + rotateToPath: false, + + /** + * If the PathFollower is rotating to match the Path (@see Phaser.GameObjects.PathFollower#rotateToPath) + * this value is added to the rotation value. This allows you to rotate objects to a path but control + * the angle of the rotation as well. + * + * @name Phaser.GameObjects.PathFollower#pathRotationOffset + * @type {number} + * @default 0 + * @since 3.0.0 + */ + pathRotationOffset: 0, + + /** + * An additional vector to add to the PathFollowers position, allowing you to offset it from the + * Path coordinates. + * + * @name Phaser.GameObjects.PathFollower#pathOffset + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + pathOffset: null, + + /** + * A Vector2 that stores the current point of the path the follower is on. + * + * @name Phaser.GameObjects.PathFollower#pathVector + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + pathVector: null, + + /** + * The distance the follower has traveled from the previous point to the current one, at the last update. + * + * @name Phaser.GameObjects.PathFollower#pathDelta + * @type {Phaser.Math.Vector2} + * @since 3.23.0 + */ + pathDelta: null, + + /** + * The Tween used for following the Path. + * + * @name Phaser.GameObjects.PathFollower#pathTween + * @type {Phaser.Tweens.Tween} + * @since 3.0.0 + */ + pathTween: null, + + /** + * Settings for the PathFollower. + * + * @name Phaser.GameObjects.PathFollower#pathConfig + * @type {?Phaser.Types.GameObjects.PathFollower.PathConfig} + * @default null + * @since 3.0.0 + */ + pathConfig: null, + + /** + * Records the direction of the follower so it can change direction. + * + * @name Phaser.GameObjects.PathFollower#_prevDirection + * @type {number} + * @private + * @since 3.0.0 + */ + _prevDirection: TWEEN_CONST.PLAYING_FORWARD, + + /** + * Set the Path that this PathFollower should follow. + * + * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings. + * + * @method Phaser.GameObjects.Components.PathFollower#setPath + * @since 3.0.0 + * + * @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time. + * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config] - Settings for the PathFollower. + * + * @return {this} This Game Object. + */ + setPath: function (path, config) + { + if (config === undefined) { config = this.pathConfig; } + + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.stop(); + } + + this.path = path; + + if (config) + { + this.startFollow(config); + } + + return this; + }, + + /** + * Set whether the PathFollower should automatically rotate to point in the direction of the Path. + * + * @method Phaser.GameObjects.Components.PathFollower#setRotateToPath + * @since 3.0.0 + * + * @param {boolean} value - Whether the PathFollower should automatically rotate to point in the direction of the Path. + * @param {number} [offset=0] - Rotation offset in degrees. + * + * @return {this} This Game Object. + */ + setRotateToPath: function (value, offset) + { + if (offset === undefined) { offset = 0; } + + this.rotateToPath = value; + + this.pathRotationOffset = offset; + + return this; + }, + + /** + * Is this PathFollower actively following a Path or not? + * + * To be considered as `isFollowing` it must be currently moving on a Path, and not paused. + * + * @method Phaser.GameObjects.Components.PathFollower#isFollowing + * @since 3.0.0 + * + * @return {boolean} `true` is this PathFollower is actively following a Path, otherwise `false`. + */ + isFollowing: function () + { + var tween = this.pathTween; + + return (tween && tween.isPlaying()); + }, + + /** + * Starts this PathFollower following its given Path. + * + * @method Phaser.GameObjects.Components.PathFollower#startFollow + * @since 3.3.0 + * + * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config={}] - The duration of the follow, or a PathFollower config object. + * @param {number} [startAt=0] - Optional start position of the follow, between 0 and 1. + * + * @return {this} This Game Object. + */ + startFollow: function (config, startAt) + { + if (config === undefined) { config = {}; } + if (startAt === undefined) { startAt = 0; } + + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.stop(); + } + + if (typeof config === 'number') + { + config = { duration: config }; + } + + // Override in case they've been specified in the config + config.from = GetValue(config, 'from', 0); + config.to = GetValue(config, 'to', 1); + + var positionOnPath = GetBoolean(config, 'positionOnPath', false); + + this.rotateToPath = GetBoolean(config, 'rotateToPath', false); + this.pathRotationOffset = GetValue(config, 'rotationOffset', 0); + + // This works, but it's not an ideal way of doing it as the follower jumps position + var seek = GetValue(config, 'startAt', startAt); + + if (seek) + { + config.onStart = function (tween) + { + var tweenData = tween.data[0]; + tweenData.progress = seek; + tweenData.elapsed = tweenData.duration * seek; + var v = tweenData.ease(tweenData.progress); + tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); + tweenData.setTargetValue(); + }; + } + + if (!this.pathOffset) + { + this.pathOffset = new Vector2(this.x, this.y); + } + + if (!this.pathVector) + { + this.pathVector = new Vector2(); + } + + if (!this.pathDelta) + { + this.pathDelta = new Vector2(); + } + + this.pathDelta.reset(); + + config.persist = true; + + this.pathTween = this.scene.sys.tweens.addCounter(config); + + // The starting point of the path, relative to this follower + this.path.getStartPoint(this.pathOffset); + + if (positionOnPath) + { + this.x = this.pathOffset.x; + this.y = this.pathOffset.y; + } + + this.pathOffset.x = this.x - this.pathOffset.x; + this.pathOffset.y = this.y - this.pathOffset.y; + + this._prevDirection = TWEEN_CONST.PLAYING_FORWARD; + + if (this.rotateToPath) + { + // Set the rotation now (in case the tween has a delay on it, etc) + var nextPoint = this.path.getPoint(0.1); + + this.rotation = Math.atan2(nextPoint.y - this.y, nextPoint.x - this.x) + DegToRad(this.pathRotationOffset); + } + + this.pathConfig = config; + + return this; + }, + + /** + * Pauses this PathFollower. It will still continue to render, but it will remain motionless at the + * point on the Path at which you paused it. + * + * @method Phaser.GameObjects.Components.PathFollower#pauseFollow + * @since 3.3.0 + * + * @return {this} This Game Object. + */ + pauseFollow: function () + { + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.pause(); + } + + return this; + }, + + /** + * Resumes a previously paused PathFollower. + * + * If the PathFollower was not paused this has no effect. + * + * @method Phaser.GameObjects.Components.PathFollower#resumeFollow + * @since 3.3.0 + * + * @return {this} This Game Object. + */ + resumeFollow: function () + { + var tween = this.pathTween; + + if (tween && tween.isPaused()) + { + tween.resume(); + } + + return this; + }, + + /** + * Stops this PathFollower from following the path any longer. + * + * This will invoke any 'stop' conditions that may exist on the Path, or for the follower. + * + * @method Phaser.GameObjects.Components.PathFollower#stopFollow + * @since 3.3.0 + * + * @return {this} This Game Object. + */ + stopFollow: function () + { + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.stop(); + } + + return this; + }, + + /** + * Internal update handler that advances this PathFollower along the path. + * + * Called automatically by the Scene step, should not typically be called directly. + * + * @method Phaser.GameObjects.Components.PathFollower#pathUpdate + * @since 3.17.0 + */ + pathUpdate: function () + { + var tween = this.pathTween; + + if (tween) + { + var tweenData = tween.data[0]; + var pathDelta = this.pathDelta; + var pathVector = this.pathVector; + + pathDelta.copy(pathVector).negate(); + + if (tweenData.state === TWEEN_CONST.COMPLETE) + { + this.path.getPoint(tweenData.end, pathVector); + + pathDelta.add(pathVector); + pathVector.add(this.pathOffset); + + this.setPosition(pathVector.x, pathVector.y); + + return; + } + else if (tweenData.state !== TWEEN_CONST.PLAYING_FORWARD && tweenData.state !== TWEEN_CONST.PLAYING_BACKWARD) + { + // If delayed, etc then bail out + return; + } + + this.path.getPoint(tween.getValue(), pathVector); + + pathDelta.add(pathVector); + pathVector.add(this.pathOffset); + + var oldX = this.x; + var oldY = this.y; + + this.setPosition(pathVector.x, pathVector.y); + + var speedX = this.x - oldX; + var speedY = this.y - oldY; + + if (speedX === 0 && speedY === 0) + { + // Bail out early + return; + } + + if (tweenData.state !== this._prevDirection) + { + // We've changed direction, so don't do a rotate this frame + this._prevDirection = tweenData.state; + + return; + } + + if (this.rotateToPath) + { + this.rotation = Math.atan2(speedY, speedX) + DegToRad(this.pathRotationOffset); + } + } + } + +}; + +module.exports = PathFollower; + + +/***/ }), + +/***/ 986: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DeepCopy = __webpack_require__(3911); + +/** + * Provides methods used for setting the WebGL rendering pipeline of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Pipeline + * @webglOnly + * @since 3.0.0 + */ + +var Pipeline = { + + /** + * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. + * + * @name Phaser.GameObjects.Components.Pipeline#defaultPipeline + * @type {Phaser.Renderer.WebGL.WebGLPipeline} + * @default null + * @webglOnly + * @since 3.0.0 + */ + defaultPipeline: null, + + /** + * The current WebGL pipeline of this Game Object. + * + * @name Phaser.GameObjects.Components.Pipeline#pipeline + * @type {Phaser.Renderer.WebGL.WebGLPipeline} + * @default null + * @webglOnly + * @since 3.0.0 + */ + pipeline: null, + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + * + * @name Phaser.GameObjects.Components.Pipeline#pipelineData + * @type {object} + * @webglOnly + * @since 3.50.0 + */ + pipelineData: null, + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * + * @method Phaser.GameObjects.Components.Pipeline#initPipeline + * @webglOnly + * @since 3.0.0 + * + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - Either the string-based name of the pipeline, or a pipeline instance to set. + * + * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. + */ + initPipeline: function (pipeline) + { + this.pipelineData = {}; + + var renderer = this.scene.sys.renderer; + + if (!renderer) + { + return false; + } + + var pipelines = renderer.pipelines; + + if (pipelines) + { + if (pipeline === undefined) + { + pipeline = pipelines.default; + } + + var instance = pipelines.get(pipeline); + + if (instance) + { + this.defaultPipeline = instance; + this.pipeline = instance; + + return true; + } + } + + return false; + }, + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * @method Phaser.GameObjects.Components.Pipeline#setPipeline + * @webglOnly + * @since 3.0.0 + * + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set. + * @param {object} [pipelineData] - Optional pipeline data object that is set in to the `pipelineData` property of this Game Object. + * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. + * + * @return {this} This Game Object instance. + */ + setPipeline: function (pipeline, pipelineData, copyData) + { + var renderer = this.scene.sys.renderer; + + if (!renderer) + { + return this; + } + + var pipelines = renderer.pipelines; + + if (pipelines) + { + var instance = pipelines.get(pipeline); + + if (instance) + { + this.pipeline = instance; + } + + if (pipelineData) + { + this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; + } + } + + return this; + }, + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * @method Phaser.GameObjects.Components.Pipeline#setPipelineData + * @webglOnly + * @since 3.50.0 + * + * @param {string} key - The key of the pipeline data to set, update, or delete. + * @param {any} [value] - The value to be set with the key. If `undefined` then `key` will be deleted from the object. + * + * @return {this} This Game Object instance. + */ + setPipelineData: function (key, value) + { + var data = this.pipelineData; + + if (value === undefined) + { + delete data[key]; + } + else + { + data[key] = value; + } + + return this; + }, + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * + * @method Phaser.GameObjects.Components.Pipeline#resetPipeline + * @webglOnly + * @since 3.0.0 + * + * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? + * + * @return {boolean} `true` if the pipeline was reset successfully, otherwise `false`. + */ + resetPipeline: function (resetData) + { + if (resetData === undefined) { resetData = false; } + + this.pipeline = this.defaultPipeline; + + if (resetData) + { + this.pipelineData = {}; + } + + return (this.pipeline !== null); + }, + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + * + * @method Phaser.GameObjects.Components.Pipeline#getPipelineName + * @webglOnly + * @since 3.0.0 + * + * @return {string} The string-based name of the pipeline being used by this Game Object. + */ + getPipelineName: function () + { + return this.pipeline.name; + } + +}; + +module.exports = Pipeline; + + +/***/ }), + +/***/ 4461: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DeepCopy = __webpack_require__(3911); +var FX = __webpack_require__(1626); +var SpliceOne = __webpack_require__(8935); + +/** + * Provides methods used for setting the WebGL rendering post pipeline of a Game Object. + * + * @namespace Phaser.GameObjects.Components.PostPipeline + * @webglOnly + * @since 3.60.0 + */ + +var PostPipeline = { + + /** + * Does this Game Object have any Post Pipelines set? + * + * @name Phaser.GameObjects.Components.PostPipeline#hasPostPipeline + * @type {boolean} + * @webglOnly + * @since 3.60.0 + */ + hasPostPipeline: false, + + /** + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. + * + * @name Phaser.GameObjects.Components.PostPipeline#postPipelines + * @type {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]} + * @webglOnly + * @since 3.60.0 + */ + postPipelines: null, + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + * + * @name Phaser.GameObjects.Components.PostPipeline#postPipelineData + * @type {object} + * @webglOnly + * @since 3.60.0 + */ + postPipelineData: null, + + /** + * The Pre FX component of this Game Object. + * + * This component allows you to apply a variety of built-in effects to this Game Object, such + * as glow, blur, bloom, displacements, vignettes and more. You access them via this property, + * for example: + * + * ```js + * const player = this.add.sprite(); + * player.preFX.addBloom(); + * ``` + * + * Only the following Game Objects support Pre FX: + * + * * Image + * * Sprite + * * TileSprite + * * Text + * * RenderTexture + * * Video + * + * All FX are WebGL only and do not have Canvas counterparts. + * + * Please see the FX Class for more details and available methods. + * + * @name Phaser.GameObjects.Components.PostPipeline#preFX + * @type {?Phaser.GameObjects.Components.FX} + * @webglOnly + * @since 3.60.0 + */ + preFX: null, + + /** + * The Post FX component of this Game Object. + * + * This component allows you to apply a variety of built-in effects to this Game Object, such + * as glow, blur, bloom, displacements, vignettes and more. You access them via this property, + * for example: + * + * ```js + * const player = this.add.sprite(); + * player.postFX.addBloom(); + * ``` + * + * All FX are WebGL only and do not have Canvas counterparts. + * + * Please see the FX Class for more details and available methods. + * + * This property is always `null` until the `initPostPipeline` method is called. + * + * @name Phaser.GameObjects.Components.PostPipeline#postFX + * @type {Phaser.GameObjects.Components.FX} + * @webglOnly + * @since 3.60.0 + */ + postFX: null, + + /** + * This should only be called during the instantiation of the Game Object. + * + * It is called by default by all core Game Objects and doesn't need + * calling again. + * + * After that, use `setPostPipeline`. + * + * @method Phaser.GameObjects.Components.PostPipeline#initPostPipeline + * @webglOnly + * @since 3.60.0 + * + * @param {boolean} [preFX=false] - Does this Game Object support Pre FX? + */ + initPostPipeline: function (preFX) + { + this.postPipelines = []; + this.postPipelineData = {}; + + this.postFX = new FX(this, true); + + if (preFX) + { + this.preFX = new FX(this, false); + } + }, + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also set the `postPipelineData` property, if the parameter is given. + * + * @method Phaser.GameObjects.Components.PostPipeline#setPostPipeline + * @webglOnly + * @since 3.60.0 + * + * @param {(string|string[]|function|function[]|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} pipelines - Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param {object} [pipelineData] - Optional pipeline data object that is set in to the `postPipelineData` property of this Game Object. + * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `postPipelineData` property of this Game Object? If `false` it will be set by reference instead. + * + * @return {this} This Game Object instance. + */ + setPostPipeline: function (pipelines, pipelineData, copyData) + { + var renderer = this.scene.sys.renderer; + + if (!renderer) + { + return this; + } + + var pipelineManager = renderer.pipelines; + + if (pipelineManager) + { + if (!Array.isArray(pipelines)) + { + pipelines = [ pipelines ]; + } + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelineManager.getPostPipeline(pipelines[i], this, pipelineData); + + if (instance) + { + this.postPipelines.push(instance); + } + } + + if (pipelineData) + { + this.postPipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; + } + } + + this.hasPostPipeline = (this.postPipelines.length > 0); + + return this; + }, + + /** + * Adds an entry to the `postPipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * @method Phaser.GameObjects.Components.PostPipeline#setPostPipelineData + * @webglOnly + * @since 3.60.0 + * + * @param {string} key - The key of the pipeline data to set, update, or delete. + * @param {any} [value] - The value to be set with the key. If `undefined` then `key` will be deleted from the object. + * + * @return {this} This Game Object instance. + */ + setPostPipelineData: function (key, value) + { + var data = this.postPipelineData; + + if (value === undefined) + { + delete data[key]; + } + else + { + data[key] = value; + } + + return this; + }, + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * + * @method Phaser.GameObjects.Components.PostPipeline#getPostPipeline + * @webglOnly + * @since 3.60.0 + * + * @param {(string|function|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline)} pipeline - The string-based name of the pipeline, or a pipeline class. + * + * @return {(Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} An array of all the Post Pipelines matching the name. This array will be empty if there was no match. If there was only one single match, that pipeline is returned directly, not in an array. + */ + getPostPipeline: function (pipeline) + { + var isString = (typeof pipeline === 'string'); + + var pipelines = this.postPipelines; + + var results = []; + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelines[i]; + + if ((isString && instance.name === pipeline) || (!isString && instance instanceof pipeline)) + { + results.push(instance); + } + } + + return (results.length === 1) ? results[0] : results; + }, + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * + * @method Phaser.GameObjects.Components.PostPipeline#resetPostPipeline + * @webglOnly + * @since 3.60.0 + * + * @param {boolean} [resetData=false] - Reset the `postPipelineData` object to being an empty object? + */ + resetPostPipeline: function (resetData) + { + if (resetData === undefined) { resetData = false; } + + var pipelines = this.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + pipelines[i].destroy(); + } + + this.postPipelines = []; + this.hasPostPipeline = false; + + if (resetData) + { + this.postPipelineData = {}; + } + }, + + /** + * Removes a type of Post Pipeline instances from this Game Object, based on the given name, and destroys them. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * + * @method Phaser.GameObjects.Components.PostPipeline#removePostPipeline + * @webglOnly + * @since 3.60.0 + * + * @param {string|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} pipeline - The string-based name of the pipeline, or a pipeline class. + * + * @return {this} This Game Object. + */ + removePostPipeline: function (pipeline) + { + var isString = (typeof pipeline === 'string'); + + var pipelines = this.postPipelines; + + for (var i = pipelines.length - 1; i >= 0; i--) + { + var instance = pipelines[i]; + + if ( + (isString && instance.name === pipeline) || + (!isString && instance === pipeline)) + { + instance.destroy(); + + SpliceOne(pipelines, i); + } + } + + this.hasPostPipeline = (this.postPipelines.length > 0); + + return this; + }, + + /** + * Removes all Pre and Post FX Controllers from this Game Object. + * + * If you wish to remove a single controller, use the `preFX.remove(fx)` or `postFX.remove(fx)` methods instead. + * + * If you wish to clear a single controller, use the `preFX.clear()` or `postFX.clear()` methods instead. + * + * @method Phaser.GameObjects.Components.PostPipeline#clearFX + * @webglOnly + * @since 3.60.0 + * + * @return {this} This Game Object. + */ + clearFX: function () + { + if (this.preFX) + { + this.preFX.clear(); + } + + if (this.postFX) + { + this.postFX.clear(); + } + + return this; + } + +}; + +module.exports = PostPipeline; + + +/***/ }), + +/***/ 4627: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the Scroll Factor of a Game Object. + * + * @namespace Phaser.GameObjects.Components.ScrollFactor + * @since 3.0.0 + */ + +var ScrollFactor = { + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scrollFactorX: 1, + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scrollFactorY: 1, + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor + * @since 3.0.0 + * + * @param {number} x - The horizontal scroll factor of this Game Object. + * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. + * + * @return {this} This Game Object instance. + */ + setScrollFactor: function (x, y) + { + if (y === undefined) { y = x; } + + this.scrollFactorX = x; + this.scrollFactorY = y; + + return this; + } + +}; + +module.exports = ScrollFactor; + + +/***/ }), + +/***/ 1868: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the size of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Size + * @since 3.0.0 + */ + +var Size = { + + /** + * A property indicating that a Game Object has this component. + * + * @name Phaser.GameObjects.Components.Size#_sizeComponent + * @type {boolean} + * @private + * @default true + * @since 3.2.0 + */ + _sizeComponent: true, + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + * + * @name Phaser.GameObjects.Components.Size#width + * @type {number} + * @since 3.0.0 + */ + width: 0, + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + * + * @name Phaser.GameObjects.Components.Size#height + * @type {number} + * @since 3.0.0 + */ + height: 0, + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.Size#displayWidth + * @type {number} + * @since 3.0.0 + */ + displayWidth: { + + get: function () + { + return Math.abs(this.scaleX * this.frame.realWidth); + }, + + set: function (value) + { + this.scaleX = value / this.frame.realWidth; + } + + }, + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.Size#displayHeight + * @type {number} + * @since 3.0.0 + */ + displayHeight: { + + get: function () + { + return Math.abs(this.scaleY * this.frame.realHeight); + }, + + set: function (value) + { + this.scaleY = value / this.frame.realHeight; + } + + }, + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Components.Size#setSizeToFrame + * @since 3.0.0 + * + * @param {Phaser.Textures.Frame|boolean} [frame] - The frame to base the size of this Game Object on. + * + * @return {this} This Game Object instance. + */ + setSizeToFrame: function (frame) + { + if (!frame) { frame = this.frame; } + + this.width = frame.realWidth; + this.height = frame.realHeight; + + var input = this.input; + + if (input && !input.customHitArea) + { + input.hitArea.width = this.width; + input.hitArea.height = this.height; + } + + return this; + }, + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Components.Size#setSize + * @since 3.0.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setSize: function (width, height) + { + this.width = width; + this.height = height; + + return this; + }, + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * + * @method Phaser.GameObjects.Components.Size#setDisplaySize + * @since 3.0.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDisplaySize: function (width, height) + { + this.displayWidth = width; + this.displayHeight = height; + + return this; + } + +}; + +module.exports = Size; + + +/***/ }), + +/***/ 4976: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Frame = __webpack_require__(2362); + +// bitmask flag for GameObject.renderMask +var _FLAG = 8; // 1000 + +/** + * Provides methods used for getting and setting the texture of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Texture + * @since 3.0.0 + */ + +var Texture = { + + /** + * The Texture this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Texture#texture + * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} + * @since 3.0.0 + */ + texture: null, + + /** + * The Texture Frame this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Texture#frame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + frame: null, + + /** + * Internal flag. Not to be set by this Game Object. + * + * @name Phaser.GameObjects.Components.Texture#isCropped + * @type {boolean} + * @private + * @since 3.11.0 + */ + isCropped: false, + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * @method Phaser.GameObjects.Components.Texture#setTexture + * @since 3.0.0 + * + * @param {(string|Phaser.Textures.Texture)} key - The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. + * + * @return {this} This Game Object instance. + */ + setTexture: function (key, frame) + { + this.texture = this.scene.sys.textures.get(key); + + return this.setFrame(frame); + }, + + /** + * Sets the frame this Game Object will use to render with. + * + * If you pass a string or index then the Frame has to belong to the current Texture being used + * by this Game Object. + * + * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * + * @method Phaser.GameObjects.Components.Texture#setFrame + * @since 3.0.0 + * + * @param {(string|number|Phaser.Textures.Frame)} frame - The name or index of the frame within the Texture, or a Frame instance. + * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? + * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? + * + * @return {this} This Game Object instance. + */ + setFrame: function (frame, updateSize, updateOrigin) + { + if (updateSize === undefined) { updateSize = true; } + if (updateOrigin === undefined) { updateOrigin = true; } + + if (frame instanceof Frame) + { + this.texture = this.scene.sys.textures.get(frame.texture.key); + + this.frame = frame; + } + else + { + this.frame = this.texture.get(frame); + } + + if (!this.frame.cutWidth || !this.frame.cutHeight) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + + if (this._sizeComponent && updateSize) + { + this.setSizeToFrame(); + } + + if (this._originComponent && updateOrigin) + { + if (this.frame.customPivot) + { + this.setOrigin(this.frame.pivotX, this.frame.pivotY); + } + else + { + this.updateDisplayOrigin(); + } + } + + return this; + } + +}; + +module.exports = Texture; + + +/***/ }), + +/***/ 9243: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Frame = __webpack_require__(2362); + +// bitmask flag for GameObject.renderMask +var _FLAG = 8; // 1000 + +/** + * Provides methods used for getting and setting the texture of a Game Object. + * + * @namespace Phaser.GameObjects.Components.TextureCrop + * @since 3.0.0 + */ + +var TextureCrop = { + + /** + * The Texture this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.TextureCrop#texture + * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} + * @since 3.0.0 + */ + texture: null, + + /** + * The Texture Frame this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.TextureCrop#frame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + frame: null, + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + * + * @name Phaser.GameObjects.Components.TextureCrop#isCropped + * @type {boolean} + * @since 3.11.0 + */ + isCropped: false, + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * + * @method Phaser.GameObjects.Components.TextureCrop#setCrop + * @since 3.11.0 + * + * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param {number} [y] - The y coordinate to start the crop from. + * @param {number} [width] - The width of the crop rectangle in pixels. + * @param {number} [height] - The height of the crop rectangle in pixels. + * + * @return {this} This Game Object instance. + */ + setCrop: function (x, y, width, height) + { + if (x === undefined) + { + this.isCropped = false; + } + else if (this.frame) + { + if (typeof x === 'number') + { + this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY); + } + else + { + var rect = x; + + this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY); + } + + this.isCropped = true; + } + + return this; + }, + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * @method Phaser.GameObjects.Components.TextureCrop#setTexture + * @since 3.0.0 + * + * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. + * + * @return {this} This Game Object instance. + */ + setTexture: function (key, frame) + { + this.texture = this.scene.sys.textures.get(key); + + return this.setFrame(frame); + }, + + /** + * Sets the frame this Game Object will use to render with. + * + * If you pass a string or index then the Frame has to belong to the current Texture being used + * by this Game Object. + * + * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * + * @method Phaser.GameObjects.Components.TextureCrop#setFrame + * @since 3.0.0 + * + * @param {(string|number|Phaser.Textures.Frame)} frame - The name or index of the frame within the Texture, or a Frame instance. + * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? + * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? + * + * @return {this} This Game Object instance. + */ + setFrame: function (frame, updateSize, updateOrigin) + { + if (updateSize === undefined) { updateSize = true; } + if (updateOrigin === undefined) { updateOrigin = true; } + + if (frame instanceof Frame) + { + this.texture = this.scene.sys.textures.get(frame.texture.key); + + this.frame = frame; + } + else + { + this.frame = this.texture.get(frame); + } + + if (!this.frame.cutWidth || !this.frame.cutHeight) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + + if (this._sizeComponent && updateSize) + { + this.setSizeToFrame(); + } + + if (this._originComponent && updateOrigin) + { + if (this.frame.customPivot) + { + this.setOrigin(this.frame.pivotX, this.frame.pivotY); + } + else + { + this.updateDisplayOrigin(); + } + } + + if (this.isCropped) + { + this.frame.updateCropUVs(this._crop, this.flipX, this.flipY); + } + + return this; + }, + + /** + * Internal method that returns a blank, well-formed crop object for use by a Game Object. + * + * @method Phaser.GameObjects.Components.TextureCrop#resetCropObject + * @private + * @since 3.12.0 + * + * @return {object} The crop object. + */ + resetCropObject: function () + { + return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 }; + } + +}; + +module.exports = TextureCrop; + + +/***/ }), + +/***/ 5693: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the tint of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Tint + * @webglOnly + * @since 3.0.0 + */ + +var Tint = { + + /** + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + * + * @name Phaser.GameObjects.Components.Tint#tintTopLeft + * @type {number} + * @default 0xffffff + * @since 3.0.0 + */ + tintTopLeft: 0xffffff, + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + * + * @name Phaser.GameObjects.Components.Tint#tintTopRight + * @type {number} + * @default 0xffffff + * @since 3.0.0 + */ + tintTopRight: 0xffffff, + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + * + * @name Phaser.GameObjects.Components.Tint#tintBottomLeft + * @type {number} + * @default 0xffffff + * @since 3.0.0 + */ + tintBottomLeft: 0xffffff, + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + * + * @name Phaser.GameObjects.Components.Tint#tintBottomRight + * @type {number} + * @default 0xffffff + * @since 3.0.0 + */ + tintBottomRight: 0xffffff, + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. + * + * @name Phaser.GameObjects.Components.Tint#tintFill + * @type {boolean} + * @default false + * @since 3.11.0 + */ + tintFill: false, + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + * + * @method Phaser.GameObjects.Components.Tint#clearTint + * @webglOnly + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + clearTint: function () + { + this.setTint(0xffffff); + + return this; + }, + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * + * @method Phaser.GameObjects.Components.Tint#setTint + * @webglOnly + * @since 3.0.0 + * + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. + * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * + * @return {this} This Game Object instance. + */ + setTint: function (topLeft, topRight, bottomLeft, bottomRight) + { + if (topLeft === undefined) { topLeft = 0xffffff; } + + if (topRight === undefined) + { + topRight = topLeft; + bottomLeft = topLeft; + bottomRight = topLeft; + } + + this.tintTopLeft = topLeft; + this.tintTopRight = topRight; + this.tintBottomLeft = bottomLeft; + this.tintBottomRight = bottomRight; + + this.tintFill = false; + + return this; + }, + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * + * @method Phaser.GameObjects.Components.Tint#setTintFill + * @webglOnly + * @since 3.11.0 + * + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. + * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * + * @return {this} This Game Object instance. + */ + setTintFill: function (topLeft, topRight, bottomLeft, bottomRight) + { + this.setTint(topLeft, topRight, bottomLeft, bottomRight); + + this.tintFill = true; + + return this; + }, + + /** + * The tint value being applied to the whole of the Game Object. + * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. + * + * @name Phaser.GameObjects.Components.Tint#tint + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + tint: { + + set: function (value) + { + this.setTint(value, value, value, value); + } + }, + + /** + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. + * + * @name Phaser.GameObjects.Components.Tint#isTinted + * @type {boolean} + * @webglOnly + * @readonly + * @since 3.11.0 + */ + isTinted: { + + get: function () + { + var white = 0xffffff; + + return ( + this.tintFill || + this.tintTopLeft !== white || + this.tintTopRight !== white || + this.tintBottomLeft !== white || + this.tintBottomRight !== white + ); + } + + } + +}; + +module.exports = Tint; + + +/***/ }), + +/***/ 6125: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Build a JSON representation of the given Game Object. + * + * This is typically extended further by Game Object specific implementations. + * + * @method Phaser.GameObjects.Components.ToJSON + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON. + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ +var ToJSON = function (gameObject) +{ + var out = { + name: gameObject.name, + type: gameObject.type, + x: gameObject.x, + y: gameObject.y, + depth: gameObject.depth, + scale: { + x: gameObject.scaleX, + y: gameObject.scaleY + }, + origin: { + x: gameObject.originX, + y: gameObject.originY + }, + flipX: gameObject.flipX, + flipY: gameObject.flipY, + rotation: gameObject.rotation, + alpha: gameObject.alpha, + visible: gameObject.visible, + blendMode: gameObject.blendMode, + textureKey: '', + frameKey: '', + data: {} + }; + + if (gameObject.texture) + { + out.textureKey = gameObject.texture.key; + out.frameKey = gameObject.frame.name; + } + + return out; +}; + +module.exports = ToJSON; + + +/***/ }), + +/***/ 3212: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(7425); +var TransformMatrix = __webpack_require__(4227); +var TransformXY = __webpack_require__(7556); +var WrapAngle = __webpack_require__(3692); +var WrapAngleDegrees = __webpack_require__(2820); +var Vector2 = __webpack_require__(2529); + +// global bitmask flag for GameObject.renderMask (used by Scale) +var _FLAG = 4; // 0100 + +/** + * Provides methods used for getting and setting the position, scale and rotation of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Transform + * @since 3.0.0 + */ + +var Transform = { + + /** + * A property indicating that a Game Object has this component. + * + * @name Phaser.GameObjects.Components.Transform#hasTransformComponent + * @type {boolean} + * @readonly + * @default true + * @since 3.60.0 + */ + hasTransformComponent: true, + + /** + * Private internal value. Holds the horizontal scale value. + * + * @name Phaser.GameObjects.Components.Transform#_scaleX + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _scaleX: 1, + + /** + * Private internal value. Holds the vertical scale value. + * + * @name Phaser.GameObjects.Components.Transform#_scaleY + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _scaleY: 1, + + /** + * Private internal value. Holds the rotation value in radians. + * + * @name Phaser.GameObjects.Components.Transform#_rotation + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + _rotation: 0, + + /** + * The x position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: 0, + + /** + * The y position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: 0, + + /** + * The z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#depth} instead. + * + * @name Phaser.GameObjects.Components.Transform#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: 0, + + /** + * The w position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: 0, + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + * + * @name Phaser.GameObjects.Components.Transform#scale + * @type {number} + * @default 1 + * @since 3.18.0 + */ + scale: { + + get: function () + { + return (this._scaleX + this._scaleY) / 2; + }, + + set: function (value) + { + this._scaleX = value; + this._scaleY = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The horizontal scale of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#scaleX + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scaleX: { + + get: function () + { + return this._scaleX; + }, + + set: function (value) + { + this._scaleX = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else if (this._scaleY !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The vertical scale of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#scaleY + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scaleY: { + + get: function () + { + return this._scaleY; + }, + + set: function (value) + { + this._scaleY = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else if (this._scaleX !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The angle of this Game Object as expressed in degrees. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left + * and -90 is up. + * + * If you prefer to work in radians, see the `rotation` property instead. + * + * @name Phaser.GameObjects.Components.Transform#angle + * @type {number} + * @default 0 + * @since 3.0.0 + */ + angle: { + + get: function () + { + return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG); + }, + + set: function (value) + { + // value is in degrees + this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD; + } + }, + + /** + * The angle of this Game Object in radians. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left + * and -PI/2 is up. + * + * If you prefer to work in degrees, see the `angle` property instead. + * + * @name Phaser.GameObjects.Components.Transform#rotation + * @type {number} + * @default 1 + * @since 3.0.0 + */ + rotation: { + + get: function () + { + return this._rotation; + }, + + set: function (value) + { + // value is in radians + this._rotation = WrapAngle(value); + } + }, + + /** + * Sets the position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setPosition + * @since 3.0.0 + * + * @param {number} [x=0] - The x position of this Game Object. + * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value. + * @param {number} [z=0] - The z position of this Game Object. + * @param {number} [w=0] - The w position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setPosition: function (x, y, z, w) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + if (z === undefined) { z = 0; } + if (w === undefined) { w = 0; } + + this.x = x; + this.y = y; + this.z = z; + this.w = w; + + return this; + }, + + /** + * Copies an object's coordinates to this Game Object's position. + * + * @method Phaser.GameObjects.Components.Transform#copyPosition + * @since 3.50.0 + * + * @param {(Phaser.Types.Math.Vector2Like|Phaser.Types.Math.Vector3Like|Phaser.Types.Math.Vector4Like)} source - An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + * + * @return {this} This Game Object instance. + */ + copyPosition: function (source) + { + if (source.x !== undefined) { this.x = source.x; } + if (source.y !== undefined) { this.y = source.y; } + if (source.z !== undefined) { this.z = source.z; } + if (source.w !== undefined) { this.w = source.w; } + + return this; + }, + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * + * @method Phaser.GameObjects.Components.Transform#setRandomPosition + * @since 3.8.0 + * + * @param {number} [x=0] - The x position of the top-left of the random area. + * @param {number} [y=0] - The y position of the top-left of the random area. + * @param {number} [width] - The width of the random area. + * @param {number} [height] - The height of the random area. + * + * @return {this} This Game Object instance. + */ + setRandomPosition: function (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.scene.sys.scale.width; } + if (height === undefined) { height = this.scene.sys.scale.height; } + + this.x = x + (Math.random() * width); + this.y = y + (Math.random() * height); + + return this; + }, + + /** + * Sets the rotation of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setRotation + * @since 3.0.0 + * + * @param {number} [radians=0] - The rotation of this Game Object, in radians. + * + * @return {this} This Game Object instance. + */ + setRotation: function (radians) + { + if (radians === undefined) { radians = 0; } + + this.rotation = radians; + + return this; + }, + + /** + * Sets the angle of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setAngle + * @since 3.0.0 + * + * @param {number} [degrees=0] - The rotation of this Game Object, in degrees. + * + * @return {this} This Game Object instance. + */ + setAngle: function (degrees) + { + if (degrees === undefined) { degrees = 0; } + + this.angle = degrees; + + return this; + }, + + /** + * Sets the scale of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setScale + * @since 3.0.0 + * + * @param {number} [x=1] - The horizontal scale of this Game Object. + * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value. + * + * @return {this} This Game Object instance. + */ + setScale: function (x, y) + { + if (x === undefined) { x = 1; } + if (y === undefined) { y = x; } + + this.scaleX = x; + this.scaleY = y; + + return this; + }, + + /** + * Sets the x position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setX + * @since 3.0.0 + * + * @param {number} [value=0] - The x position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setX: function (value) + { + if (value === undefined) { value = 0; } + + this.x = value; + + return this; + }, + + /** + * Sets the y position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setY + * @since 3.0.0 + * + * @param {number} [value=0] - The y position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setY: function (value) + { + if (value === undefined) { value = 0; } + + this.y = value; + + return this; + }, + + /** + * Sets the z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. + * + * @method Phaser.GameObjects.Components.Transform#setZ + * @since 3.0.0 + * + * @param {number} [value=0] - The z position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setZ: function (value) + { + if (value === undefined) { value = 0; } + + this.z = value; + + return this; + }, + + /** + * Sets the w position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setW + * @since 3.0.0 + * + * @param {number} [value=0] - The w position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setW: function (value) + { + if (value === undefined) { value = 0; } + + this.w = value; + + return this; + }, + + /** + * Gets the local transform matrix for this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix + * @since 3.4.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. + * + * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. + */ + getLocalTransformMatrix: function (tempMatrix) + { + if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } + + return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); + }, + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * + * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix + * @since 3.4.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations. + * + * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. + */ + getWorldTransformMatrix: function (tempMatrix, parentMatrix) + { + if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } + + var parent = this.parentContainer; + + if (!parent) + { + return this.getLocalTransformMatrix(tempMatrix); + } + + if (!parentMatrix) + { + parentMatrix = new TransformMatrix(); + } + + tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); + + while (parent) + { + parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY); + + parentMatrix.multiply(tempMatrix, tempMatrix); + + parent = parent.parentContainer; + } + + return tempMatrix; + }, + + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * + * @method Phaser.GameObjects.Components.Transform#getLocalPoint + * @since 3.50.0 + * + * @param {number} x - The x position to translate. + * @param {number} y - The y position to translate. + * @param {Phaser.Math.Vector2} [point] - A Vector2, or point-like object, to store the results in. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera which is being tested against. If not given will use the Scene default camera. + * + * @return {Phaser.Math.Vector2} The translated point. + */ + getLocalPoint: function (x, y, point, camera) + { + if (!point) { point = new Vector2(); } + if (!camera) { camera = this.scene.sys.cameras.main; } + + var csx = camera.scrollX; + var csy = camera.scrollY; + + var px = x + (csx * this.scrollFactorX) - csx; + var py = y + (csy * this.scrollFactorY) - csy; + + if (this.parentContainer) + { + this.getWorldTransformMatrix().applyInverse(px, py, point); + } + else + { + TransformXY(px, py, this.x, this.y, this.rotation, this.scaleX, this.scaleY, point); + } + + // Normalize origin + if (this._originComponent) + { + point.x += this._displayOriginX; + point.y += this._displayOriginY; + } + + return point; + }, + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + * + * @method Phaser.GameObjects.Components.Transform#getParentRotation + * @since 3.18.0 + * + * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object. + */ + getParentRotation: function () + { + var rotation = 0; + + var parent = this.parentContainer; + + while (parent) + { + rotation += parent.rotation; + + parent = parent.parentContainer; + } + + return rotation; + } + +}; + +module.exports = Transform; + + +/***/ }), + +/***/ 4227: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var MATH_CONST = __webpack_require__(7425); +var Vector2 = __webpack_require__(2529); + +/** + * @classdesc + * A Matrix used for display transformations for rendering. + * + * It is represented like so: + * + * ``` + * | a | c | tx | + * | b | d | ty | + * | 0 | 0 | 1 | + * ``` + * + * @class TransformMatrix + * @memberof Phaser.GameObjects.Components + * @constructor + * @since 3.0.0 + * + * @param {number} [a=1] - The Scale X value. + * @param {number} [b=0] - The Skew Y value. + * @param {number} [c=0] - The Skew X value. + * @param {number} [d=1] - The Scale Y value. + * @param {number} [tx=0] - The Translate X value. + * @param {number} [ty=0] - The Translate Y value. + */ +var TransformMatrix = new Class({ + + initialize: + + function TransformMatrix (a, b, c, d, tx, ty) + { + if (a === undefined) { a = 1; } + if (b === undefined) { b = 0; } + if (c === undefined) { c = 0; } + if (d === undefined) { d = 1; } + if (tx === undefined) { tx = 0; } + if (ty === undefined) { ty = 0; } + + /** + * The matrix values. + * + * @name Phaser.GameObjects.Components.TransformMatrix#matrix + * @type {Float32Array} + * @since 3.0.0 + */ + this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]); + + /** + * The decomposed matrix. + * + * @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix + * @type {object} + * @since 3.0.0 + */ + this.decomposedMatrix = { + translateX: 0, + translateY: 0, + scaleX: 1, + scaleY: 1, + rotation: 0 + }; + + /** + * The temporary quad value cache. + * + * @name Phaser.GameObjects.Components.TransformMatrix#quad + * @type {Float32Array} + * @since 3.60.0 + */ + this.quad = new Float32Array(8); + }, + + /** + * The Scale X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#a + * @type {number} + * @since 3.4.0 + */ + a: { + + get: function () + { + return this.matrix[0]; + }, + + set: function (value) + { + this.matrix[0] = value; + } + + }, + + /** + * The Skew Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#b + * @type {number} + * @since 3.4.0 + */ + b: { + + get: function () + { + return this.matrix[1]; + }, + + set: function (value) + { + this.matrix[1] = value; + } + + }, + + /** + * The Skew X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#c + * @type {number} + * @since 3.4.0 + */ + c: { + + get: function () + { + return this.matrix[2]; + }, + + set: function (value) + { + this.matrix[2] = value; + } + + }, + + /** + * The Scale Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#d + * @type {number} + * @since 3.4.0 + */ + d: { + + get: function () + { + return this.matrix[3]; + }, + + set: function (value) + { + this.matrix[3] = value; + } + + }, + + /** + * The Translate X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#e + * @type {number} + * @since 3.11.0 + */ + e: { + + get: function () + { + return this.matrix[4]; + }, + + set: function (value) + { + this.matrix[4] = value; + } + + }, + + /** + * The Translate Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#f + * @type {number} + * @since 3.11.0 + */ + f: { + + get: function () + { + return this.matrix[5]; + }, + + set: function (value) + { + this.matrix[5] = value; + } + + }, + + /** + * The Translate X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#tx + * @type {number} + * @since 3.4.0 + */ + tx: { + + get: function () + { + return this.matrix[4]; + }, + + set: function (value) + { + this.matrix[4] = value; + } + + }, + + /** + * The Translate Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#ty + * @type {number} + * @since 3.4.0 + */ + ty: { + + get: function () + { + return this.matrix[5]; + }, + + set: function (value) + { + this.matrix[5] = value; + } + + }, + + /** + * The rotation of the Matrix. Value is in radians. + * + * @name Phaser.GameObjects.Components.TransformMatrix#rotation + * @type {number} + * @readonly + * @since 3.4.0 + */ + rotation: { + + get: function () + { + return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1); + } + + }, + + /** + * The rotation of the Matrix, normalized to be within the Phaser right-handed + * clockwise rotation space. Value is in radians. + * + * @name Phaser.GameObjects.Components.TransformMatrix#rotationNormalized + * @type {number} + * @readonly + * @since 3.19.0 + */ + rotationNormalized: { + + get: function () + { + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + + if (a || b) + { + // var r = Math.sqrt(a * a + b * b); + + return (b > 0) ? Math.acos(a / this.scaleX) : -Math.acos(a / this.scaleX); + } + else if (c || d) + { + // var s = Math.sqrt(c * c + d * d); + + return MATH_CONST.TAU - ((d > 0) ? Math.acos(-c / this.scaleY) : -Math.acos(c / this.scaleY)); + } + else + { + return 0; + } + } + + }, + + /** + * The decomposed horizontal scale of the Matrix. This value is always positive. + * + * @name Phaser.GameObjects.Components.TransformMatrix#scaleX + * @type {number} + * @readonly + * @since 3.4.0 + */ + scaleX: { + + get: function () + { + return Math.sqrt((this.a * this.a) + (this.b * this.b)); + } + + }, + + /** + * The decomposed vertical scale of the Matrix. This value is always positive. + * + * @name Phaser.GameObjects.Components.TransformMatrix#scaleY + * @type {number} + * @readonly + * @since 3.4.0 + */ + scaleY: { + + get: function () + { + return Math.sqrt((this.c * this.c) + (this.d * this.d)); + } + + }, + + /** + * Reset the Matrix to an identity matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity + * @since 3.0.0 + * + * @return {this} This TransformMatrix. + */ + loadIdentity: function () + { + var matrix = this.matrix; + + matrix[0] = 1; + matrix[1] = 0; + matrix[2] = 0; + matrix[3] = 1; + matrix[4] = 0; + matrix[5] = 0; + + return this; + }, + + /** + * Translate the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#translate + * @since 3.0.0 + * + * @param {number} x - The horizontal translation value. + * @param {number} y - The vertical translation value. + * + * @return {this} This TransformMatrix. + */ + translate: function (x, y) + { + var matrix = this.matrix; + + matrix[4] = matrix[0] * x + matrix[2] * y + matrix[4]; + matrix[5] = matrix[1] * x + matrix[3] * y + matrix[5]; + + return this; + }, + + /** + * Scale the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#scale + * @since 3.0.0 + * + * @param {number} x - The horizontal scale value. + * @param {number} y - The vertical scale value. + * + * @return {this} This TransformMatrix. + */ + scale: function (x, y) + { + var matrix = this.matrix; + + matrix[0] *= x; + matrix[1] *= x; + matrix[2] *= y; + matrix[3] *= y; + + return this; + }, + + /** + * Rotate the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#rotate + * @since 3.0.0 + * + * @param {number} angle - The angle of rotation in radians. + * + * @return {this} This TransformMatrix. + */ + rotate: function (angle) + { + var sin = Math.sin(angle); + var cos = Math.cos(angle); + + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + + matrix[0] = a * cos + c * sin; + matrix[1] = b * cos + d * sin; + matrix[2] = a * -sin + c * cos; + matrix[3] = b * -sin + d * cos; + + return this; + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * If an `out` Matrix is given then the results will be stored in it. + * If it is not given, this matrix will be updated in place instead. + * Use an `out` Matrix if you do not wish to mutate this matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#multiply + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} rhs - The Matrix to multiply by. + * @param {Phaser.GameObjects.Components.TransformMatrix} [out] - An optional Matrix to store the results in. + * + * @return {(this|Phaser.GameObjects.Components.TransformMatrix)} Either this TransformMatrix, or the `out` Matrix, if given in the arguments. + */ + multiply: function (rhs, out) + { + var matrix = this.matrix; + var source = rhs.matrix; + + var localA = matrix[0]; + var localB = matrix[1]; + var localC = matrix[2]; + var localD = matrix[3]; + var localE = matrix[4]; + var localF = matrix[5]; + + var sourceA = source[0]; + var sourceB = source[1]; + var sourceC = source[2]; + var sourceD = source[3]; + var sourceE = source[4]; + var sourceF = source[5]; + + var destinationMatrix = (out === undefined) ? matrix : out.matrix; + + destinationMatrix[0] = (sourceA * localA) + (sourceB * localC); + destinationMatrix[1] = (sourceA * localB) + (sourceB * localD); + destinationMatrix[2] = (sourceC * localA) + (sourceD * localC); + destinationMatrix[3] = (sourceC * localB) + (sourceD * localD); + destinationMatrix[4] = (sourceE * localA) + (sourceF * localC) + localE; + destinationMatrix[5] = (sourceE * localB) + (sourceF * localD) + localF; + + return destinationMatrix; + }, + + /** + * Multiply this Matrix by the matrix given, including the offset. + * + * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`. + * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#multiplyWithOffset + * @since 3.11.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from. + * @param {number} offsetX - Horizontal offset to factor in to the multiplication. + * @param {number} offsetY - Vertical offset to factor in to the multiplication. + * + * @return {this} This TransformMatrix. + */ + multiplyWithOffset: function (src, offsetX, offsetY) + { + var matrix = this.matrix; + var otherMatrix = src.matrix; + + var a0 = matrix[0]; + var b0 = matrix[1]; + var c0 = matrix[2]; + var d0 = matrix[3]; + var tx0 = matrix[4]; + var ty0 = matrix[5]; + + var pse = offsetX * a0 + offsetY * c0 + tx0; + var psf = offsetX * b0 + offsetY * d0 + ty0; + + var a1 = otherMatrix[0]; + var b1 = otherMatrix[1]; + var c1 = otherMatrix[2]; + var d1 = otherMatrix[3]; + var tx1 = otherMatrix[4]; + var ty1 = otherMatrix[5]; + + matrix[0] = a1 * a0 + b1 * c0; + matrix[1] = a1 * b0 + b1 * d0; + matrix[2] = c1 * a0 + d1 * c0; + matrix[3] = c1 * b0 + d1 * d0; + matrix[4] = tx1 * a0 + ty1 * c0 + pse; + matrix[5] = tx1 * b0 + ty1 * d0 + psf; + + return this; + }, + + /** + * Transform the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#transform + * @since 3.0.0 + * + * @param {number} a - The Scale X value. + * @param {number} b - The Shear Y value. + * @param {number} c - The Shear X value. + * @param {number} d - The Scale Y value. + * @param {number} tx - The Translate X value. + * @param {number} ty - The Translate Y value. + * + * @return {this} This TransformMatrix. + */ + transform: function (a, b, c, d, tx, ty) + { + var matrix = this.matrix; + + var a0 = matrix[0]; + var b0 = matrix[1]; + var c0 = matrix[2]; + var d0 = matrix[3]; + var tx0 = matrix[4]; + var ty0 = matrix[5]; + + matrix[0] = a * a0 + b * c0; + matrix[1] = a * b0 + b * d0; + matrix[2] = c * a0 + d * c0; + matrix[3] = c * b0 + d * d0; + matrix[4] = tx * a0 + ty * c0 + tx0; + matrix[5] = tx * b0 + ty * d0 + ty0; + + return this; + }, + + /** + * Transform a point in to the local space of this Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint + * @since 3.0.0 + * + * @param {number} x - The x coordinate of the point to transform. + * @param {number} y - The y coordinate of the point to transform. + * @param {Phaser.Types.Math.Vector2Like} [point] - Optional Point object to store the transformed coordinates in. + * + * @return {Phaser.Types.Math.Vector2Like} The Point containing the transformed coordinates. + */ + transformPoint: function (x, y, point) + { + if (point === undefined) { point = { x: 0, y: 0 }; } + + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + var tx = matrix[4]; + var ty = matrix[5]; + + point.x = x * a + y * c + tx; + point.y = x * b + y * d + ty; + + return point; + }, + + /** + * Invert the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#invert + * @since 3.0.0 + * + * @return {this} This TransformMatrix. + */ + invert: function () + { + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + var tx = matrix[4]; + var ty = matrix[5]; + + var n = a * d - b * c; + + matrix[0] = d / n; + matrix[1] = -b / n; + matrix[2] = -c / n; + matrix[3] = a / n; + matrix[4] = (c * ty - d * tx) / n; + matrix[5] = -(a * ty - b * tx) / n; + + return this; + }, + + /** + * Set the values of this Matrix to copy those of the matrix given. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyFrom + * @since 3.11.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from. + * + * @return {this} This TransformMatrix. + */ + copyFrom: function (src) + { + var matrix = this.matrix; + + matrix[0] = src.a; + matrix[1] = src.b; + matrix[2] = src.c; + matrix[3] = src.d; + matrix[4] = src.e; + matrix[5] = src.f; + + return this; + }, + + /** + * Set the values of this Matrix to copy those of the array given. + * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyFromArray + * @since 3.11.0 + * + * @param {array} src - The array of values to set into this matrix. + * + * @return {this} This TransformMatrix. + */ + copyFromArray: function (src) + { + var matrix = this.matrix; + + matrix[0] = src[0]; + matrix[1] = src[1]; + matrix[2] = src[2]; + matrix[3] = src[3]; + matrix[4] = src[4]; + matrix[5] = src[5]; + + return this; + }, + + /** + * Copy the values from this Matrix to the given Canvas Rendering Context. + * This will use the Context.transform method. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyToContext + * @since 3.12.0 + * + * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to. + * + * @return {CanvasRenderingContext2D} The Canvas Rendering Context. + */ + copyToContext: function (ctx) + { + var matrix = this.matrix; + + ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); + + return ctx; + }, + + /** + * Copy the values from this Matrix to the given Canvas Rendering Context. + * This will use the Context.setTransform method. + * + * @method Phaser.GameObjects.Components.TransformMatrix#setToContext + * @since 3.12.0 + * + * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to. + * + * @return {CanvasRenderingContext2D} The Canvas Rendering Context. + */ + setToContext: function (ctx) + { + var matrix = this.matrix; + + ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); + + return ctx; + }, + + /** + * Copy the values in this Matrix to the array given. + * + * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray + * @since 3.12.0 + * + * @param {array} [out] - The array to copy the matrix values in to. + * + * @return {array} An array where elements 0 to 5 contain the values from this matrix. + */ + copyToArray: function (out) + { + var matrix = this.matrix; + + if (out === undefined) + { + out = [ matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] ]; + } + else + { + out[0] = matrix[0]; + out[1] = matrix[1]; + out[2] = matrix[2]; + out[3] = matrix[3]; + out[4] = matrix[4]; + out[5] = matrix[5]; + } + + return out; + }, + + /** + * Set the values of this Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#setTransform + * @since 3.0.0 + * + * @param {number} a - The Scale X value. + * @param {number} b - The Shear Y value. + * @param {number} c - The Shear X value. + * @param {number} d - The Scale Y value. + * @param {number} tx - The Translate X value. + * @param {number} ty - The Translate Y value. + * + * @return {this} This TransformMatrix. + */ + setTransform: function (a, b, c, d, tx, ty) + { + var matrix = this.matrix; + + matrix[0] = a; + matrix[1] = b; + matrix[2] = c; + matrix[3] = d; + matrix[4] = tx; + matrix[5] = ty; + + return this; + }, + + /** + * Decompose this Matrix into its translation, scale and rotation values using QR decomposition. + * + * The result must be applied in the following order to reproduce the current matrix: + * + * translate -> rotate -> scale + * + * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix + * @since 3.0.0 + * + * @return {Phaser.Types.GameObjects.DecomposeMatrixResults} The decomposed Matrix. + */ + decomposeMatrix: function () + { + var decomposedMatrix = this.decomposedMatrix; + + var matrix = this.matrix; + + // a = scale X (1) + // b = shear Y (0) + // c = shear X (0) + // d = scale Y (1) + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + + var determ = a * d - b * c; + + decomposedMatrix.translateX = matrix[4]; + decomposedMatrix.translateY = matrix[5]; + + if (a || b) + { + var r = Math.sqrt(a * a + b * b); + + decomposedMatrix.rotation = (b > 0) ? Math.acos(a / r) : -Math.acos(a / r); + decomposedMatrix.scaleX = r; + decomposedMatrix.scaleY = determ / r; + } + else if (c || d) + { + var s = Math.sqrt(c * c + d * d); + + decomposedMatrix.rotation = Math.PI * 0.5 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s)); + decomposedMatrix.scaleX = determ / s; + decomposedMatrix.scaleY = s; + } + else + { + decomposedMatrix.rotation = 0; + decomposedMatrix.scaleX = 0; + decomposedMatrix.scaleY = 0; + } + + return decomposedMatrix; + }, + + /** + * Apply the identity, translate, rotate and scale operations on the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#applyITRS + * @since 3.0.0 + * + * @param {number} x - The horizontal translation. + * @param {number} y - The vertical translation. + * @param {number} rotation - The angle of rotation in radians. + * @param {number} scaleX - The horizontal scale. + * @param {number} scaleY - The vertical scale. + * + * @return {this} This TransformMatrix. + */ + applyITRS: function (x, y, rotation, scaleX, scaleY) + { + var matrix = this.matrix; + + var radianSin = Math.sin(rotation); + var radianCos = Math.cos(rotation); + + // Translate + matrix[4] = x; + matrix[5] = y; + + // Rotate and Scale + matrix[0] = radianCos * scaleX; + matrix[1] = radianSin * scaleX; + matrix[2] = -radianSin * scaleY; + matrix[3] = radianCos * scaleY; + + return this; + }, + + /** + * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of + * the current matrix with its transformation applied. + * + * Can be used to translate points from world to local space. + * + * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse + * @since 3.12.0 + * + * @param {number} x - The x position to translate. + * @param {number} y - The y position to translate. + * @param {Phaser.Math.Vector2} [output] - A Vector2, or point-like object, to store the results in. + * + * @return {Phaser.Math.Vector2} The coordinates, inverse-transformed through this matrix. + */ + applyInverse: function (x, y, output) + { + if (output === undefined) { output = new Vector2(); } + + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + var tx = matrix[4]; + var ty = matrix[5]; + + var id = 1 / ((a * d) + (c * -b)); + + output.x = (d * id * x) + (-c * id * y) + (((ty * c) - (tx * d)) * id); + output.y = (a * id * y) + (-b * id * x) + (((-ty * a) + (tx * b)) * id); + + return output; + }, + + /** + * Performs the 8 calculations required to create the vertices of + * a quad based on this matrix and the given x/y/xw/yh values. + * + * The result is stored in `TransformMatrix.quad`, which is returned + * from this method. + * + * @method Phaser.GameObjects.Components.TransformMatrix#setQuad + * @since 3.60.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {number} xw - The xw value. + * @param {number} yh - The yh value. + * @param {boolean} roundPixels - Pass the results via Math.round? + * @param {Float32Array} [quad] - Optional Float32Array to store the results in. Otherwises uses the local quad array. + * + * @return {Float32Array} The quad Float32Array. + */ + setQuad: function (x, y, xw, yh, roundPixels, quad) + { + if (quad === undefined) { quad = this.quad; } + + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + var e = matrix[4]; + var f = matrix[5]; + + quad[0] = x * a + y * c + e; + quad[1] = x * b + y * d + f; + + quad[2] = x * a + yh * c + e; + quad[3] = x * b + yh * d + f; + + quad[4] = xw * a + yh * c + e; + quad[5] = xw * b + yh * d + f; + + quad[6] = xw * a + y * c + e; + quad[7] = xw * b + y * d + f; + + if (roundPixels) + { + quad.forEach(function (value, index) + { + quad[index] = Math.round(value); + }); + } + + return quad; + }, + + /** + * Returns the X component of this matrix multiplied by the given values. + * This is the same as `x * a + y * c + e`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getX + * @since 3.12.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * + * @return {number} The calculated x value. + */ + getX: function (x, y) + { + return x * this.a + y * this.c + this.e; + }, + + /** + * Returns the Y component of this matrix multiplied by the given values. + * This is the same as `x * b + y * d + f`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getY + * @since 3.12.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * + * @return {number} The calculated y value. + */ + getY: function (x, y) + { + return x * this.b + y * this.d + this.f; + }, + + /** + * Returns the X component of this matrix multiplied by the given values. + * + * This is the same as `x * a + y * c + e`, optionally passing via `Math.round`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getXRound + * @since 3.50.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {boolean} [round=false] - Math.round the resulting value? + * + * @return {number} The calculated x value. + */ + getXRound: function (x, y, round) + { + var v = this.getX(x, y); + + if (round) + { + v = Math.round(v); + } + + return v; + }, + + /** + * Returns the Y component of this matrix multiplied by the given values. + * + * This is the same as `x * b + y * d + f`, optionally passing via `Math.round`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getYRound + * @since 3.50.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {boolean} [round=false] - Math.round the resulting value? + * + * @return {number} The calculated y value. + */ + getYRound: function (x, y, round) + { + var v = this.getY(x, y); + + if (round) + { + v = Math.round(v); + } + + return v; + }, + + /** + * Returns a string that can be used in a CSS Transform call as a `matrix` property. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix + * @since 3.12.0 + * + * @return {string} A string containing the CSS Transform matrix values. + */ + getCSSMatrix: function () + { + var m = this.matrix; + + return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')'; + }, + + /** + * Destroys this Transform Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#destroy + * @since 3.4.0 + */ + destroy: function () + { + this.matrix = null; + this.quad = null; + this.decomposedMatrix = null; + } + +}); + +module.exports = TransformMatrix; + + +/***/ }), + +/***/ 8414: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// bitmask flag for GameObject.renderMask +var _FLAG = 1; // 0001 + +/** + * Provides methods used for setting the visibility of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Visible + * @since 3.0.0 + */ + +var Visible = { + + /** + * Private internal value. Holds the visible value. + * + * @name Phaser.GameObjects.Components.Visible#_visible + * @type {boolean} + * @private + * @default true + * @since 3.0.0 + */ + _visible: true, + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * + * @name Phaser.GameObjects.Components.Visible#visible + * @type {boolean} + * @since 3.0.0 + */ + visible: { + + get: function () + { + return this._visible; + }, + + set: function (value) + { + if (value) + { + this._visible = true; + this.renderFlags |= _FLAG; + } + else + { + this._visible = false; + this.renderFlags &= ~_FLAG; + } + } + + }, + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * + * @method Phaser.GameObjects.Components.Visible#setVisible + * @since 3.0.0 + * + * @param {boolean} value - The visible state of the Game Object. + * + * @return {this} This Game Object instance. + */ + setVisible: function (value) + { + this.visible = value; + + return this; + } +}; + +module.exports = Visible; + + +/***/ }), + +/***/ 4286: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Components + */ + +module.exports = { + + Alpha: __webpack_require__(4344), + AlphaSingle: __webpack_require__(4518), + BlendMode: __webpack_require__(5173), + ComputedSize: __webpack_require__(1991), + Crop: __webpack_require__(8305), + Depth: __webpack_require__(3131), + Flip: __webpack_require__(9660), + FX: __webpack_require__(1626), + GetBounds: __webpack_require__(3671), + Mask: __webpack_require__(2246), + Origin: __webpack_require__(5085), + PathFollower: __webpack_require__(77), + Pipeline: __webpack_require__(986), + PostPipeline: __webpack_require__(4461), + ScrollFactor: __webpack_require__(4627), + Size: __webpack_require__(1868), + Texture: __webpack_require__(4976), + TextureCrop: __webpack_require__(9243), + Tint: __webpack_require__(5693), + ToJSON: __webpack_require__(6125), + Transform: __webpack_require__(3212), + TransformMatrix: __webpack_require__(4227), + Visible: __webpack_require__(8414) + +}; + + +/***/ }), + +/***/ 7361: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -49092,16 +39938,16 @@ module.exports = SpineContainer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(262); -var BlendModes = __webpack_require__(15); -var Class = __webpack_require__(0); -var Components = __webpack_require__(313); -var Events = __webpack_require__(59); -var GameObject = __webpack_require__(57); -var Rectangle = __webpack_require__(29); -var Render = __webpack_require__(343); -var Union = __webpack_require__(346); -var Vector2 = __webpack_require__(3); +var ArrayUtils = __webpack_require__(1953); +var BlendModes = __webpack_require__(8351); +var Class = __webpack_require__(7473); +var Components = __webpack_require__(4286); +var Events = __webpack_require__(3389); +var GameObject = __webpack_require__(2273); +var Rectangle = __webpack_require__(1392); +var Render = __webpack_require__(3232); +var Union = __webpack_require__(9422); +var Vector2 = __webpack_require__(2529); /** * @classdesc @@ -49157,7 +40003,7 @@ var Vector2 = __webpack_require__(3); * @extends Phaser.GameObjects.Components.ComputedSize * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Mask - * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.PostPipeline * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible * @@ -49176,7 +40022,7 @@ var Container = new Class({ Components.ComputedSize, Components.Depth, Components.Mask, - Components.Pipeline, + Components.PostPipeline, Components.Transform, Components.Visible, Render @@ -49331,12 +40177,10 @@ var Container = new Class({ */ this.scrollFactorY = 1; - this.initPipeline(); + this.initPostPipeline(); this.setPosition(x, y); - this.clearAlpha(); - this.setBlendMode(BlendModes.SKIP_CHECK); if (children) @@ -50549,266 +41393,305 @@ module.exports = Container; /***/ }), -/* 262 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 2840: +/***/ ((module) => { /** * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> * @copyright 2013-2023 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * @namespace Phaser.Utils.Array + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Container#renderCanvas + * @since 3.4.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ +var ContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) +{ + camera.addToRenderList(container); + + var children = container.list; + + if (children.length === 0) + { + return; + } + + var transformMatrix = container.localTransform; + + if (parentMatrix) + { + transformMatrix.loadIdentity(); + transformMatrix.multiply(parentMatrix); + transformMatrix.translate(container.x, container.y); + transformMatrix.rotate(container.rotation); + transformMatrix.scale(container.scaleX, container.scaleY); + } + else + { + transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); + } + + var containerHasBlendMode = (container.blendMode !== -1); + + if (!containerHasBlendMode) + { + // If Container is SKIP_TEST then set blend mode to be Normal + renderer.setBlendMode(0); + } + + var alpha = container._alpha; + var scrollFactorX = container.scrollFactorX; + var scrollFactorY = container.scrollFactorY; + + if (container.mask) + { + container.mask.preRenderCanvas(renderer, null, camera); + } + + for (var i = 0; i < children.length; i++) + { + var child = children[i]; + + if (!child.willRender(camera)) + { + continue; + } + + var childAlpha = child.alpha; + var childScrollFactorX = child.scrollFactorX; + var childScrollFactorY = child.scrollFactorY; + + if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode) + { + // If Container doesn't have its own blend mode, then a child can have one + renderer.setBlendMode(child.blendMode); + } + + // Set parent values + child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); + child.setAlpha(childAlpha * alpha); + + // Render + child.renderCanvas(renderer, child, camera, transformMatrix); + + // Restore original values + child.setAlpha(childAlpha); + child.setScrollFactor(childScrollFactorX, childScrollFactorY); + } + + if (container.mask) + { + container.mask.postRenderCanvas(renderer); + } +}; + +module.exports = ContainerCanvasRenderer; + + +/***/ }), + +/***/ 3232: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var NOOP = __webpack_require__(1984); +var renderWebGL = NOOP; +var renderCanvas = NOOP; + +if (true) +{ + renderWebGL = __webpack_require__(4343); +} + +if (true) +{ + renderCanvas = __webpack_require__(2840); +} module.exports = { - Matrix: __webpack_require__(263), - - Add: __webpack_require__(272), - AddAt: __webpack_require__(273), - BringToTop: __webpack_require__(274), - CountAllMatching: __webpack_require__(275), - Each: __webpack_require__(276), - EachInRange: __webpack_require__(277), - FindClosestInSorted: __webpack_require__(278), - Flatten: __webpack_require__(279), - GetAll: __webpack_require__(280), - GetFirst: __webpack_require__(281), - GetRandom: __webpack_require__(282), - MoveDown: __webpack_require__(283), - MoveTo: __webpack_require__(284), - MoveUp: __webpack_require__(285), - MoveAbove: __webpack_require__(286), - MoveBelow: __webpack_require__(287), - NumberArray: __webpack_require__(288), - NumberArrayStep: __webpack_require__(289), - QuickSelect: __webpack_require__(290), - Range: __webpack_require__(291), - Remove: __webpack_require__(292), - RemoveAt: __webpack_require__(293), - RemoveBetween: __webpack_require__(294), - RemoveRandomElement: __webpack_require__(295), - Replace: __webpack_require__(296), - RotateLeft: __webpack_require__(62), - RotateRight: __webpack_require__(63), - SafeRange: __webpack_require__(5), - SendToBack: __webpack_require__(297), - SetAll: __webpack_require__(298), - Shuffle: __webpack_require__(64), - SortByDigits: __webpack_require__(299), - SpliceOne: __webpack_require__(13), - StableSort: __webpack_require__(300), - Swap: __webpack_require__(312) + renderWebGL: renderWebGL, + renderCanvas: renderCanvas }; /***/ }), -/* 263 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 4343: +/***/ ((module) => { /** * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> * @copyright 2013-2023 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * @namespace Phaser.Utils.Array.Matrix + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Container#renderWebGL + * @since 3.4.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ - -module.exports = { - - CheckMatrix: __webpack_require__(27), - MatrixToString: __webpack_require__(264), - ReverseColumns: __webpack_require__(266), - ReverseRows: __webpack_require__(267), - Rotate180: __webpack_require__(268), - RotateLeft: __webpack_require__(269), - RotateMatrix: __webpack_require__(17), - RotateRight: __webpack_require__(270), - Translate: __webpack_require__(271), - TransposeMatrix: __webpack_require__(61) - -}; - - -/***/ }), -/* 264 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Pad = __webpack_require__(265); -var CheckMatrix = __webpack_require__(27); - -/** - * Generates a string (which you can pass to console.log) from the given Array Matrix. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.MatrixToString - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix] - * - * @param {T[][]} [matrix] - A 2-dimensional array. - * - * @return {string} A string representing the matrix. - */ -var MatrixToString = function (matrix) +var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) { - var str = ''; + camera.addToRenderList(container); - if (!CheckMatrix(matrix)) + var children = container.list; + var childCount = children.length; + + if (childCount === 0) { - return str; + return; } - for (var r = 0; r < matrix.length; r++) + var transformMatrix = container.localTransform; + + if (parentMatrix) { - for (var c = 0; c < matrix[r].length; c++) + transformMatrix.loadIdentity(); + transformMatrix.multiply(parentMatrix); + transformMatrix.translate(container.x, container.y); + transformMatrix.rotate(container.rotation); + transformMatrix.scale(container.scaleX, container.scaleY); + } + else + { + transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); + } + + renderer.pipelines.preBatch(container); + + var containerHasBlendMode = (container.blendMode !== -1); + + if (!containerHasBlendMode) + { + // If Container is SKIP_TEST then set blend mode to be Normal + renderer.setBlendMode(0); + } + + var alpha = container.alpha; + + var scrollFactorX = container.scrollFactorX; + var scrollFactorY = container.scrollFactorY; + + for (var i = 0; i < childCount; i++) + { + var child = children[i]; + + if (!child.willRender(camera)) { - var cell = matrix[r][c].toString(); - - if (cell !== 'undefined') - { - str += Pad(cell, 2); - } - else - { - str += '?'; - } - - if (c < matrix[r].length - 1) - { - str += ' |'; - } + continue; } - if (r < matrix.length - 1) + var childAlphaTopLeft; + var childAlphaTopRight; + var childAlphaBottomLeft; + var childAlphaBottomRight; + + if (child.alphaTopLeft !== undefined) { - str += '\n'; + childAlphaTopLeft = child.alphaTopLeft; + childAlphaTopRight = child.alphaTopRight; + childAlphaBottomLeft = child.alphaBottomLeft; + childAlphaBottomRight = child.alphaBottomRight; + } + else + { + var childAlpha = child.alpha; - for (var i = 0; i < matrix[r].length; i++) - { - str += '---'; - - if (i < matrix[r].length - 1) - { - str += '+'; - } - } - - str += '\n'; + childAlphaTopLeft = childAlpha; + childAlphaTopRight = childAlpha; + childAlphaBottomLeft = childAlpha; + childAlphaBottomRight = childAlpha; } - } + var childScrollFactorX = child.scrollFactorX; + var childScrollFactorY = child.scrollFactorY; - return str; -}; - -module.exports = MatrixToString; - - -/***/ }), -/* 265 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Takes the given string and pads it out, to the length required, using the character - * specified. For example if you need a string to be 6 characters long, you can call: - * - * `pad('bob', 6, '-', 2)` - * - * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right. - * - * You can also use it to pad numbers (they are always returned as strings): - * - * `pad(512, 6, '0', 1)` - * - * Would return: `000512` with the string padded to the left. - * - * If you don't specify a direction it'll pad to both sides: - * - * `pad('c64', 7, '*')` - * - * Would return: `**c64**` - * - * @function Phaser.Utils.String.Pad - * @since 3.0.0 - * - * @param {string|number|object} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. - * @param {number} [len=0] - The number of characters to be added. - * @param {string} [pad=" "] - The string to pad it out with (defaults to a space). - * @param {number} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). - * - * @return {string} The padded string. - */ -var Pad = function (str, len, pad, dir) -{ - if (len === undefined) { len = 0; } - if (pad === undefined) { pad = ' '; } - if (dir === undefined) { dir = 3; } - - str = str.toString(); - - var padlen = 0; - - if (len + 1 >= str.length) - { - switch (dir) + if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode) { - case 1: - str = new Array(len + 1 - str.length).join(pad) + str; - break; - - case 3: - var right = Math.ceil((padlen = len - str.length) / 2); - var left = padlen - right; - str = new Array(left + 1).join(pad) + str + new Array(right + 1).join(pad); - break; - - default: - str = str + new Array(len + 1 - str.length).join(pad); - break; + // If Container doesn't have its own blend mode, then a child can have one + renderer.setBlendMode(child.blendMode); } + + var mask = child.mask; + + if (mask) + { + mask.preRenderWebGL(renderer, child, camera); + } + + var type = child.type; + + if (type !== renderer.currentType) + { + renderer.newType = true; + renderer.currentType = type; + } + + renderer.nextTypeMatch = (i < childCount - 1) ? (children[i + 1].type === renderer.currentType) : false; + + // Set parent values + child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); + + child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha); + + // Render + child.renderWebGL(renderer, child, camera, transformMatrix, container); + + // Restore original values + + child.setAlpha(childAlphaTopLeft, childAlphaTopRight, childAlphaBottomLeft, childAlphaBottomRight); + + child.setScrollFactor(childScrollFactorX, childScrollFactorY); + + if (mask) + { + mask.postRenderWebGL(renderer, camera); + } + + renderer.newType = false; } - return str; + renderer.pipelines.postBatch(container); }; -module.exports = Pad; +module.exports = ContainerWebGLRenderer; /***/ }), -/* 266 */ -/***/ (function(module, exports) { + +/***/ 6608: +/***/ ((module) => { /** * @author Richard Davey @@ -50817,323 +41700,26 @@ module.exports = Pad; */ /** - * Reverses the columns in the given Array Matrix. + * The Game Object Added to Scene Event. * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: + * This event is dispatched when a Game Object is added to a Scene. * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` + * Listen for it on a Game Object instance using `GameObject.on('addedtoscene', listener)`. * - * @function Phaser.Utils.Array.Matrix.ReverseColumns - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array matrix to reverse the columns for. - * - * @return {T[][]} The column reversed matrix. - */ -var ReverseColumns = function (matrix) -{ - return matrix.reverse(); -}; - -module.exports = ReverseColumns; - - -/***/ }), -/* 267 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Reverses the rows in the given Array Matrix. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.ReverseRows - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array matrix to reverse the rows for. - * - * @return {T[][]} The column reversed matrix. - */ -var ReverseRows = function (matrix) -{ - for (var i = 0; i < matrix.length; i++) - { - matrix[i].reverse(); - } - - return matrix; -}; - -module.exports = ReverseRows; - - -/***/ }), -/* 268 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var RotateMatrix = __webpack_require__(17); - -/** - * Rotates the array matrix 180 degrees. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.Rotate180 - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array to rotate. - * - * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. - */ -var Rotate180 = function (matrix) -{ - return RotateMatrix(matrix, 180); -}; - -module.exports = Rotate180; - - -/***/ }), -/* 269 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var RotateMatrix = __webpack_require__(17); - -/** - * Rotates the array matrix to the left (or 90 degrees) - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.RotateLeft - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array to rotate. - * - * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. - */ -var RotateLeft = function (matrix) -{ - return RotateMatrix(matrix, 90); -}; - -module.exports = RotateLeft; - - -/***/ }), -/* 270 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var RotateMatrix = __webpack_require__(17); - -/** - * Rotates the array matrix to the left (or -90 degrees) - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.RotateRight - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array to rotate. - * - * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. - */ -var RotateRight = function (matrix) -{ - return RotateMatrix(matrix, -90); -}; - -module.exports = RotateRight; - - -/***/ }), -/* 271 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var RotateLeft = __webpack_require__(62); -var RotateRight = __webpack_require__(63); - -/** - * Translates the given Array Matrix by shifting each column and row the - * amount specified. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.Translate + * @event Phaser.GameObjects.Events#ADDED_TO_SCENE + * @type {string} * @since 3.50.0 * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array matrix to translate. - * @param {number} [x=0] - The amount to horizontally translate the matrix by. - * @param {number} [y=0] - The amount to vertically translate the matrix by. - * - * @return {T[][]} The translated matrix. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene. + * @param {Phaser.Scene} scene - The Scene to which the Game Object was added. */ -var TranslateMatrix = function (matrix, x, y) -{ - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - - // Vertical translation - - if (y !== 0) - { - if (y < 0) - { - // Shift Up - RotateLeft(matrix, Math.abs(y)); - } - else - { - // Shift Down - RotateRight(matrix, y); - } - } - - // Horizontal translation - - if (x !== 0) - { - for (var i = 0; i < matrix.length; i++) - { - var row = matrix[i]; - - if (x < 0) - { - RotateLeft(row, Math.abs(x)); - } - else - { - RotateRight(row, x); - } - } - } - - return matrix; -}; - -module.exports = TranslateMatrix; +module.exports = 'addedtoscene'; /***/ }), -/* 272 */ -/***/ (function(module, exports) { + +/***/ 4265: +/***/ ((module) => { /** * @author Richard Davey @@ -51142,513 +41728,26 @@ module.exports = TranslateMatrix; */ /** - * Adds the given item, or array of items, to the array. + * The Game Object Destroy Event. * - * Each item must be unique within the array. + * This event is dispatched when a Game Object instance is being destroyed. * - * The array is modified in-place and returned. + * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`. * - * You can optionally specify a limit to the maximum size of the array. If the quantity of items being - * added will take the array length over this limit, it will stop adding once the limit is reached. - * - * You can optionally specify a callback to be invoked for each item successfully added to the array. - * - * @function Phaser.Utils.Array.Add - * @since 3.4.0 - * - * @param {array} array - The array to be added to. - * @param {any|any[]} item - The item, or array of items, to add to the array. Each item must be unique within the array. - * @param {number} [limit] - Optional limit which caps the size of the array. - * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {array} The input array. - */ -var Add = function (array, item, limit, callback, context) -{ - if (context === undefined) { context = array; } - - if (limit > 0) - { - var remaining = limit - array.length; - - // There's nothing more we can do here, the array is full - if (remaining <= 0) - { - return null; - } - } - - // Fast path to avoid array mutation and iteration - if (!Array.isArray(item)) - { - if (array.indexOf(item) === -1) - { - array.push(item); - - if (callback) - { - callback.call(context, item); - } - - return item; - } - else - { - return null; - } - } - - // If we got this far, we have an array of items to insert - - // Ensure all the items are unique - var itemLength = item.length - 1; - - while (itemLength >= 0) - { - if (array.indexOf(item[itemLength]) !== -1) - { - // Already exists in array, so remove it - item.splice(itemLength, 1); - } - - itemLength--; - } - - // Anything left? - itemLength = item.length; - - if (itemLength === 0) - { - return null; - } - - if (limit > 0 && itemLength > remaining) - { - item.splice(remaining); - - itemLength = remaining; - } - - for (var i = 0; i < itemLength; i++) - { - var entry = item[i]; - - array.push(entry); - - if (callback) - { - callback.call(context, entry); - } - } - - return item; -}; - -module.exports = Add; - - -/***/ }), -/* 273 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Adds the given item, or array of items, to the array starting at the index specified. - * - * Each item must be unique within the array. - * - * Existing elements in the array are shifted up. - * - * The array is modified in-place and returned. - * - * You can optionally specify a limit to the maximum size of the array. If the quantity of items being - * added will take the array length over this limit, it will stop adding once the limit is reached. - * - * You can optionally specify a callback to be invoked for each item successfully added to the array. - * - * @function Phaser.Utils.Array.AddAt - * @since 3.4.0 - * - * @param {array} array - The array to be added to. - * @param {any|any[]} item - The item, or array of items, to add to the array. - * @param {number} [index=0] - The index in the array where the item will be inserted. - * @param {number} [limit] - Optional limit which caps the size of the array. - * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {array} The input array. - */ -var AddAt = function (array, item, index, limit, callback, context) -{ - if (index === undefined) { index = 0; } - if (context === undefined) { context = array; } - - if (limit > 0) - { - var remaining = limit - array.length; - - // There's nothing more we can do here, the array is full - if (remaining <= 0) - { - return null; - } - } - - // Fast path to avoid array mutation and iteration - if (!Array.isArray(item)) - { - if (array.indexOf(item) === -1) - { - array.splice(index, 0, item); - - if (callback) - { - callback.call(context, item); - } - - return item; - } - else - { - return null; - } - } - - // If we got this far, we have an array of items to insert - - // Ensure all the items are unique - var itemLength = item.length - 1; - - while (itemLength >= 0) - { - if (array.indexOf(item[itemLength]) !== -1) - { - // Already exists in array, so remove it - item.pop(); - } - - itemLength--; - } - - // Anything left? - itemLength = item.length; - - if (itemLength === 0) - { - return null; - } - - // Truncate to the limit - if (limit > 0 && itemLength > remaining) - { - item.splice(remaining); - - itemLength = remaining; - } - - for (var i = itemLength - 1; i >= 0; i--) - { - var entry = item[i]; - - array.splice(index, 0, entry); - - if (callback) - { - callback.call(context, entry); - } - } - - return item; -}; - -module.exports = AddAt; - - -/***/ }), -/* 274 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given element to the top of the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.BringToTop - * @since 3.4.0 - * - * @param {array} array - The array. - * @param {*} item - The element to move. - * - * @return {*} The element that was moved. - */ -var BringToTop = function (array, item) -{ - var currentIndex = array.indexOf(item); - - if (currentIndex !== -1 && currentIndex < array.length) - { - array.splice(currentIndex, 1); - array.push(item); - } - - return item; -}; - -module.exports = BringToTop; - - -/***/ }), -/* 275 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Returns the total number of elements in the array which have a property matching the given value. - * - * @function Phaser.Utils.Array.CountAllMatching - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {string} property - The property to test on each array element. - * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {number} [startIndex] - An optional start index to search from. - * @param {number} [endIndex] - An optional end index to search to. - * - * @return {number} The total number of elements with properties matching the given value. - */ -var CountAllMatching = function (array, property, value, startIndex, endIndex) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - - var total = 0; - - if (SafeRange(array, startIndex, endIndex)) - { - for (var i = startIndex; i < endIndex; i++) - { - var child = array[i]; - - if (child[property] === value) - { - total++; - } - } - } - - return total; -}; - -module.exports = CountAllMatching; - - -/***/ }), -/* 276 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Passes each element in the array to the given callback. - * - * @function Phaser.Utils.Array.Each - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {function} callback - A callback to be invoked for each item in the array. - * @param {object} context - The context in which the callback is invoked. - * @param {...*} [args] - Additional arguments that will be passed to the callback, after the current array item. - * - * @return {array} The input array. - */ -var Each = function (array, callback, context) -{ - var i; - var args = [ null ]; - - for (i = 3; i < arguments.length; i++) - { - args.push(arguments[i]); - } - - for (i = 0; i < array.length; i++) - { - args[0] = array[i]; - - callback.apply(context, args); - } - - return array; -}; - -module.exports = Each; - - -/***/ }), -/* 277 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Passes each element in the array, between the start and end indexes, to the given callback. - * - * @function Phaser.Utils.Array.EachInRange - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {function} callback - A callback to be invoked for each item in the array. - * @param {object} context - The context in which the callback is invoked. - * @param {number} startIndex - The start index to search from. - * @param {number} endIndex - The end index to search to. - * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. - * - * @return {array} The input array. - */ -var EachInRange = function (array, callback, context, startIndex, endIndex) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - - if (SafeRange(array, startIndex, endIndex)) - { - var i; - var args = [ null ]; - - for (i = 5; i < arguments.length; i++) - { - args.push(arguments[i]); - } - - for (i = startIndex; i < endIndex; i++) - { - args[0] = array[i]; - - callback.apply(context, args); - } - } - - return array; -}; - -module.exports = EachInRange; - - -/***/ }), -/* 278 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Searches a pre-sorted array for the closet value to the given number. - * - * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, - * and will check for the closest value of those to the given number. - * - * @function Phaser.Utils.Array.FindClosestInSorted + * @event Phaser.GameObjects.Events#DESTROY + * @type {string} * @since 3.0.0 * - * @param {number} value - The value to search for in the array. - * @param {array} array - The array to search, which must be sorted. - * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. - * - * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed. + * @param {boolean} fromScene - `True` if this Game Object is being destroyed by the Scene, `false` if not. */ -var FindClosestInSorted = function (value, array, key) -{ - if (!array.length) - { - return NaN; - } - else if (array.length === 1) - { - return array[0]; - } - - var i = 1; - var low; - var high; - - if (key) - { - if (value < array[0][key]) - { - return array[0]; - } - - while (array[i][key] < value) - { - i++; - } - } - else - { - while (array[i] < value) - { - i++; - } - } - - if (i > array.length) - { - i = array.length; - } - - if (key) - { - low = array[i - 1][key]; - high = array[i][key]; - - return ((high - value) <= (value - low)) ? array[i] : array[i - 1]; - } - else - { - low = array[i - 1]; - high = array[i]; - - return ((high - value) <= (value - low)) ? high : low; - } -}; - -module.exports = FindClosestInSorted; +module.exports = 'destroy'; /***/ }), -/* 279 */ -/***/ (function(module, exports) { + +/***/ 8671: +/***/ ((module) => { /** * @author Richard Davey @@ -51657,162 +41756,151 @@ module.exports = FindClosestInSorted; */ /** - * Takes an array and flattens it, returning a shallow-copy flattened array. + * The Game Object Removed from Scene Event. * - * @function Phaser.Utils.Array.Flatten + * This event is dispatched when a Game Object is removed from a Scene. + * + * Listen for it on a Game Object instance using `GameObject.on('removedfromscene', listener)`. + * + * @event Phaser.GameObjects.Events#REMOVED_FROM_SCENE + * @type {string} + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene. + * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed. + */ +module.exports = 'removedfromscene'; + + +/***/ }), + +/***/ 3420: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Complete Event. + * + * This event is dispatched when a Video finishes playback by reaching the end of its duration. It + * is also dispatched if a video marker sequence is being played and reaches the end. + * + * Note that not all videos can fire this event. Live streams, for example, have no fixed duration, + * so never technically 'complete'. + * + * If a video is stopped from playback, via the `Video.stop` method, it will emit the + * `VIDEO_STOP` event instead of this one. + * + * Listen for it from a Video Game Object instance using `Video.on('complete', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_COMPLETE + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed playback. + */ +module.exports = 'complete'; + + +/***/ }), + +/***/ 601: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Created Event. + * + * This event is dispatched when the texture for a Video has been created. This happens + * when enough of the video source has been loaded that the browser is able to render a + * frame from it. + * + * Listen for it from a Video Game Object instance using `Video.on('created', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_CREATED + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. + * @param {number} width - The width of the video. + * @param {number} height - The height of the video. + */ +module.exports = 'created'; + + +/***/ }), + +/***/ 7919: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Error Event. + * + * This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type. + * + * Listen for it from a Video Game Object instance using `Video.on('error', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_ERROR + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. + * @param {DOMException|string} event - The native DOM event the browser raised during playback. + */ +module.exports = 'error'; + + +/***/ }), + +/***/ 6231: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Locked Event. + * + * This event is dispatched when a Video was attempted to be played, but the browser prevented it + * from doing so due to the Media Engagement Interaction policy. + * + * If you get this event you will need to wait for the user to interact with the browser before + * the video will play. This is a browser security measure to prevent autoplaying videos with + * audio. An interaction includes a mouse click, a touch, or a key press. + * + * Listen for it from a Video Game Object instance using `Video.on('locked', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_LOCKED + * @type {string} * @since 3.60.0 * - * @param {array} array - The array to flatten. - * @param {array} [output] - An array to hold the results in. - * - * @return {array} The flattened output array. + * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. */ -var Flatten = function (array, output) -{ - if (output === undefined) { output = []; } - - for (var i = 0; i < array.length; i++) - { - if (Array.isArray(array[i])) - { - Flatten(array[i], output); - } - else - { - output.push(array[i]); - } - } - - return output; -}; - -module.exports = Flatten; +module.exports = 'locked'; /***/ }), -/* 280 */ -/***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Returns all elements in the array. - * - * You can optionally specify a matching criteria using the `property` and `value` arguments. - * - * For example: `getAll('visible', true)` would return only elements that have their visible property set. - * - * Optionally you can specify a start and end index. For example if the array had 100 elements, - * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only - * the first 50 elements. - * - * @function Phaser.Utils.Array.GetAll - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {string} [property] - The property to test on each array element. - * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {number} [startIndex] - An optional start index to search from. - * @param {number} [endIndex] - An optional end index to search to. - * - * @return {array} All matching elements from the array. - */ -var GetAll = function (array, property, value, startIndex, endIndex) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - - var output = []; - - if (SafeRange(array, startIndex, endIndex)) - { - for (var i = startIndex; i < endIndex; i++) - { - var child = array[i]; - - if (!property || - (property && value === undefined && child.hasOwnProperty(property)) || - (property && value !== undefined && child[property] === value)) - { - output.push(child); - } - } - } - - return output; -}; - -module.exports = GetAll; - - -/***/ }), -/* 281 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Returns the first element in the array. - * - * You can optionally specify a matching criteria using the `property` and `value` arguments. - * - * For example: `getAll('visible', true)` would return the first element that had its `visible` property set. - * - * Optionally you can specify a start and end index. For example if the array had 100 elements, - * and you set `startIndex` to 0 and `endIndex` to 50, it would search only the first 50 elements. - * - * @function Phaser.Utils.Array.GetFirst - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {string} [property] - The property to test on each array element. - * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {number} [startIndex=0] - An optional start index to search from. - * @param {number} [endIndex=array.length] - An optional end index to search up to (but not included) - * - * @return {object} The first matching element from the array, or `null` if no element could be found in the range given. - */ -var GetFirst = function (array, property, value, startIndex, endIndex) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - - if (SafeRange(array, startIndex, endIndex)) - { - for (var i = startIndex; i < endIndex; i++) - { - var child = array[i]; - - if (!property || - (property && value === undefined && child.hasOwnProperty(property)) || - (property && value !== undefined && child[property] === value)) - { - return child; - } - } - } - - return null; -}; - -module.exports = GetFirst; - - -/***/ }), -/* 282 */ -/***/ (function(module, exports) { +/***/ 5241: +/***/ ((module) => { /** * @author Richard Davey @@ -51821,722 +41909,464 @@ module.exports = GetFirst; */ /** - * Returns a Random element from the array. + * The Video Game Object Loop Event. * - * @function Phaser.Utils.Array.GetRandom + * This event is dispatched when a Video that is currently playing has looped. This only + * happens if the `loop` parameter was specified, or the `setLoop` method was called, + * and if the video has a fixed duration. Video streams, for example, cannot loop, as + * they have no duration. + * + * Looping is based on the result of the Video `timeupdate` event. This event is not + * frame-accurate, due to the way browsers work, so please do not rely on this loop + * event to be time or frame precise. + * + * Listen for it from a Video Game Object instance using `Video.on('loop', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_LOOP + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which has looped. + */ +module.exports = 'loop'; + + +/***/ }), + +/***/ 8325: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Playing Event. + * + * The playing event is fired after playback is first started, + * and whenever it is restarted. For example it is fired when playback + * resumes after having been paused or delayed due to lack of data. + * + * Listen for it from a Video Game Object instance using `Video.on('playing', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_PLAYING + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. + */ +module.exports = 'playing'; + + +/***/ }), + +/***/ 3356: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Play Event. + * + * This event is dispatched when a Video begins playback. For videos that do not require + * interaction unlocking, this is usually as soon as the `Video.play` method is called. + * However, for videos that require unlocking, it is fired once playback begins after + * they've been unlocked. + * + * Listen for it from a Video Game Object instance using `Video.on('play', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_PLAY + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. + */ +module.exports = 'play'; + + +/***/ }), + +/***/ 7513: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Seeked Event. + * + * This event is dispatched when a Video completes seeking to a new point in its timeline. + * + * Listen for it from a Video Game Object instance using `Video.on('seeked', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_SEEKED + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed seeking. + */ +module.exports = 'seeked'; + + +/***/ }), + +/***/ 5788: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Seeking Event. + * + * This event is dispatched when a Video _begins_ seeking to a new point in its timeline. + * When the seek is complete, it will dispatch the `VIDEO_SEEKED` event to conclude. + * + * Listen for it from a Video Game Object instance using `Video.on('seeking', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_SEEKING + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started seeking. + */ +module.exports = 'seeking'; + + +/***/ }), + +/***/ 7111: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Stalled Event. + * + * This event is dispatched by a Video Game Object when the video playback stalls. + * + * This can happen if the video is buffering. + * + * If will fire for any of the following native DOM events: + * + * `stalled` + * `suspend` + * `waiting` + * + * Listen for it from a Video Game Object instance using `Video.on('stalled', listener)`. + * + * Note that being stalled isn't always a negative thing. A video can be stalled if it + * has downloaded enough data in to its buffer to not need to download any more until + * the current batch of frames have rendered. + * + * @event Phaser.GameObjects.Events#VIDEO_STALLED + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. + * @param {Event} event - The native DOM event the browser raised during playback. + */ +module.exports = 'stalled'; + + +/***/ }), + +/***/ 8118: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Stopped Event. + * + * This event is dispatched when a Video is stopped from playback via a call to the `Video.stop` method, + * either directly via game code, or indirectly as the result of changing a video source or destroying it. + * + * Listen for it from a Video Game Object instance using `Video.on('stop', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_STOP + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which stopped playback. + */ +module.exports = 'stop'; + + +/***/ }), + +/***/ 9184: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Texture Ready Event. + * + * This event is dispatched by a Video Game Object when it has finished creating its texture. + * + * This happens when the video has finished loading enough data for its first frame. + * + * If you wish to use the Video texture elsewhere in your game, such as as a Sprite texture, + * then you should listen for this event first, before creating the Sprites that use it. + * + * Listen for it from a Video Game Object instance using `Video.on('textureready', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_TEXTURE + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object that emitted the event. + * @param {Phaser.Textures.Texture} texture - The Texture that was created. + */ +module.exports = 'textureready'; + + +/***/ }), + +/***/ 4287: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Unlocked Event. + * + * This event is dispatched when a Video that was prevented from playback due to the browsers + * Media Engagement Interaction policy, is unlocked by a user gesture. + * + * Listen for it from a Video Game Object instance using `Video.on('unlocked', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_UNLOCKED + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. + */ +module.exports = 'unlocked'; + + +/***/ }), + +/***/ 857: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Unsupported Event. + * + * This event is dispatched by a Video Game Object if the media source + * (which may be specified as a MediaStream, MediaSource, Blob, or File, + * for example) doesn't represent a supported media format. + * + * Listen for it from a Video Game Object instance using `Video.on('unsupported', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_UNSUPPORTED + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. + * @param {DOMException|string} event - The native DOM event the browser raised during playback. + */ +module.exports = 'unsupported'; + + +/***/ }), + +/***/ 3389: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Events + */ + +module.exports = { + + ADDED_TO_SCENE: __webpack_require__(6608), + DESTROY: __webpack_require__(4265), + REMOVED_FROM_SCENE: __webpack_require__(8671), + VIDEO_COMPLETE: __webpack_require__(3420), + VIDEO_CREATED: __webpack_require__(601), + VIDEO_ERROR: __webpack_require__(7919), + VIDEO_LOCKED: __webpack_require__(6231), + VIDEO_LOOP: __webpack_require__(5241), + VIDEO_PLAY: __webpack_require__(3356), + VIDEO_PLAYING: __webpack_require__(8325), + VIDEO_SEEKED: __webpack_require__(7513), + VIDEO_SEEKING: __webpack_require__(5788), + VIDEO_STALLED: __webpack_require__(7111), + VIDEO_STOP: __webpack_require__(8118), + VIDEO_TEXTURE: __webpack_require__(9184), + VIDEO_UNLOCKED: __webpack_require__(4287), + VIDEO_UNSUPPORTED: __webpack_require__(857) + +}; + + +/***/ }), + +/***/ 1643: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GEOM_CONST = { + + /** + * A Circle Geometry object type. + * + * @name Phaser.Geom.CIRCLE + * @type {number} + * @since 3.19.0 + */ + CIRCLE: 0, + + /** + * An Ellipse Geometry object type. + * + * @name Phaser.Geom.ELLIPSE + * @type {number} + * @since 3.19.0 + */ + ELLIPSE: 1, + + /** + * A Line Geometry object type. + * + * @name Phaser.Geom.LINE + * @type {number} + * @since 3.19.0 + */ + LINE: 2, + + /** + * A Point Geometry object type. + * + * @name Phaser.Geom.POINT + * @type {number} + * @since 3.19.0 + */ + POINT: 3, + + /** + * A Polygon Geometry object type. + * + * @name Phaser.Geom.POLYGON + * @type {number} + * @since 3.19.0 + */ + POLYGON: 4, + + /** + * A Rectangle Geometry object type. + * + * @name Phaser.Geom.RECTANGLE + * @type {number} + * @since 3.19.0 + */ + RECTANGLE: 5, + + /** + * A Triangle Geometry object type. + * + * @name Phaser.Geom.TRIANGLE + * @type {number} + * @since 3.19.0 + */ + TRIANGLE: 6 + +}; + +module.exports = GEOM_CONST; + + +/***/ }), + +/***/ 8881: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(7655); + +/** + * Get a point on a line that's a given percentage along its length. + * + * @function Phaser.Geom.Line.GetPoint * @since 3.0.0 * - * @param {array} array - The array to select the random entry from. - * @param {number} [startIndex=0] - An optional start index. - * @param {number} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from. + * @generic {Phaser.Geom.Point} O - [out,$return] * - * @return {*} A random element from the array, or `null` if no element could be found in the range given. + * @param {Phaser.Geom.Line} line - The line. + * @param {number} position - A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line. + * @param {(Phaser.Geom.Point|object)} [out] - An optional point, or point-like object, to store the coordinates of the point on the line. + * + * @return {(Phaser.Geom.Point|object)} The point on the line. */ -var GetRandom = function (array, startIndex, length) +var GetPoint = function (line, position, out) { - if (startIndex === undefined) { startIndex = 0; } - if (length === undefined) { length = array.length; } + if (out === undefined) { out = new Point(); } - var randomIndex = startIndex + Math.floor(Math.random() * length); - - return (array[randomIndex] === undefined) ? null : array[randomIndex]; -}; - -module.exports = GetRandom; - - -/***/ }), -/* 283 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given array element down one place in the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.MoveDown - * @since 3.4.0 - * - * @param {array} array - The input array. - * @param {*} item - The element to move down the array. - * - * @return {array} The input array. - */ -var MoveDown = function (array, item) -{ - var currentIndex = array.indexOf(item); - - if (currentIndex > 0) - { - var item2 = array[currentIndex - 1]; - - var index2 = array.indexOf(item2); - - array[currentIndex] = item2; - array[index2] = item; - } - - return array; -}; - -module.exports = MoveDown; - - -/***/ }), -/* 284 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves an element in an array to a new position within the same array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.MoveTo - * @since 3.4.0 - * - * @param {array} array - The array. - * @param {*} item - The element to move. - * @param {number} index - The new index that the element will be moved to. - * - * @return {*} The element that was moved. - */ -var MoveTo = function (array, item, index) -{ - var currentIndex = array.indexOf(item); - - if (currentIndex === -1 || index < 0 || index >= array.length) - { - throw new Error('Supplied index out of bounds'); - } - - if (currentIndex !== index) - { - // Remove - array.splice(currentIndex, 1); - - // Add in new location - array.splice(index, 0, item); - } - - return item; -}; - -module.exports = MoveTo; - - -/***/ }), -/* 285 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given array element up one place in the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.MoveUp - * @since 3.4.0 - * - * @param {array} array - The input array. - * @param {*} item - The element to move up the array. - * - * @return {array} The input array. - */ -var MoveUp = function (array, item) -{ - var currentIndex = array.indexOf(item); - - if (currentIndex !== -1 && currentIndex < array.length - 1) - { - // The element one above `item` in the array - var item2 = array[currentIndex + 1]; - var index2 = array.indexOf(item2); - - array[currentIndex] = item2; - array[index2] = item; - } - - return array; -}; - -module.exports = MoveUp; - - -/***/ }), -/* 286 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given array element above another one in the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.MoveAbove - * @since 3.55.0 - * - * @param {array} array - The input array. - * @param {*} item1 - The element to move above base element. - * @param {*} item2 - The base element. - * - * - * @return {array} The input array. - */ -var MoveAbove = function (array, item1, item2) -{ - if (item1 === item2) - { - return array; - } - - var currentIndex = array.indexOf(item1); - var baseIndex = array.indexOf(item2); - - if (currentIndex < 0 || baseIndex < 0) - { - throw new Error('Supplied items must be elements of the same array'); - } - - if (currentIndex > baseIndex) - { - // item1 is already above item2 - return array; - } - - // Remove - array.splice(currentIndex, 1); - - // Add in new location - if (baseIndex === array.length - 1) - { - array.push(item1); - } - else - { - array.splice(baseIndex, 0, item1); - } - - return array; -}; - -module.exports = MoveAbove; - - -/***/ }), -/* 287 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given array element below another one in the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.MoveBelow - * @since 3.55.0 - * - * @param {array} array - The input array. - * @param {*} item1 - The element to move below base element. - * @param {*} item2 - The base element. - * - * - * @return {array} The input array. - */ -var MoveBelow = function (array, item1, item2) -{ - if (item1 === item2) - { - return array; - } - - var currentIndex = array.indexOf(item1); - var baseIndex = array.indexOf(item2); - - if (currentIndex < 0 || baseIndex < 0) - { - throw new Error('Supplied items must be elements of the same array'); - } - - if (currentIndex < baseIndex) - { - // item1 is already below item2 - return array; - } - - // Remove - array.splice(currentIndex, 1); - - // Add in new location - if (baseIndex === 0) - { - array.unshift(item1); - } - else - { - array.splice(baseIndex, 0, item1); - } - - return array; -}; - -module.exports = MoveBelow; - - -/***/ }), -/* 288 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Create an array representing the range of numbers (usually integers), between, and inclusive of, - * the given `start` and `end` arguments. For example: - * - * `var array = Phaser.Utils.Array.NumberArray(2, 4); // array = [2, 3, 4]` - * `var array = Phaser.Utils.Array.NumberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` - * `var array = Phaser.Utils.Array.NumberArray(8, 2); // array = [8, 7, 6, 5, 4, 3, 2]` - * - * This is equivalent to `Phaser.Utils.Array.NumberArrayStep(start, end, 1)`. - * - * You can optionally provide a prefix and / or suffix string. If given the array will contain - * strings, not integers. For example: - * - * `var array = Phaser.Utils.Array.NumberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` - * `var array = Phaser.Utils.Array.NumberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` - * - * @function Phaser.Utils.Array.NumberArray - * @since 3.0.0 - * - * @param {number} start - The minimum value the array starts with. - * @param {number} end - The maximum value the array contains. - * @param {string} [prefix] - Optional prefix to place before the number. If provided the array will contain strings, not integers. - * @param {string} [suffix] - Optional suffix to place after the number. If provided the array will contain strings, not integers. - * - * @return {(number[]|string[])} The array of number values, or strings if a prefix or suffix was provided. - */ -var NumberArray = function (start, end, prefix, suffix) -{ - var result = []; - - var i; - var asString = false; - - if (prefix || suffix) - { - asString = true; - - if (!prefix) - { - prefix = ''; - } - - if (!suffix) - { - suffix = ''; - } - } - - if (end < start) - { - for (i = start; i >= end; i--) - { - if (asString) - { - result.push(prefix + i.toString() + suffix); - } - else - { - result.push(i); - } - } - } - else - { - for (i = start; i <= end; i++) - { - if (asString) - { - result.push(prefix + i.toString() + suffix); - } - else - { - result.push(i); - } - } - } - - return result; -}; - -module.exports = NumberArray; - - -/***/ }), -/* 289 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var RoundAwayFromZero = __webpack_require__(43); - -/** - * Create an array of numbers (positive and/or negative) progressing from `start` - * up to but not including `end` by advancing by `step`. - * - * If `start` is less than `end` a zero-length range is created unless a negative `step` is specified. - * - * Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0; - * for forward compatibility make sure to pass in actual numbers. - * - * @example - * NumberArrayStep(4); - * // => [0, 1, 2, 3] - * - * NumberArrayStep(1, 5); - * // => [1, 2, 3, 4] - * - * NumberArrayStep(0, 20, 5); - * // => [0, 5, 10, 15] - * - * NumberArrayStep(0, -4, -1); - * // => [0, -1, -2, -3] - * - * NumberArrayStep(1, 4, 0); - * // => [1, 1, 1] - * - * NumberArrayStep(0); - * // => [] - * - * @function Phaser.Utils.Array.NumberArrayStep - * @since 3.0.0 - * - * @param {number} [start=0] - The start of the range. - * @param {number} [end=null] - The end of the range. - * @param {number} [step=1] - The value to increment or decrement by. - * - * @return {number[]} The array of number values. - */ -var NumberArrayStep = function (start, end, step) -{ - if (start === undefined) { start = 0; } - if (end === undefined) { end = null; } - if (step === undefined) { step = 1; } - - if (end === null) - { - end = start; - start = 0; - } - - var result = []; - - var total = Math.max(RoundAwayFromZero((end - start) / (step || 1)), 0); - - for (var i = 0; i < total; i++) - { - result.push(start); - start += step; - } - - return result; -}; - -module.exports = NumberArrayStep; - - -/***/ }), -/* 290 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @ignore - */ -function swap (arr, i, j) -{ - var tmp = arr[i]; - arr[i] = arr[j]; - arr[j] = tmp; -} - -/** - * @ignore - */ -function defaultCompare (a, b) -{ - return a < b ? -1 : a > b ? 1 : 0; -} - -/** - * A [Floyd-Rivest](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm) quick selection algorithm. - * - * Rearranges the array items so that all items in the [left, k] range are smaller than all items in [k, right]; - * The k-th element will have the (k - left + 1)th smallest value in [left, right]. - * - * The array is modified in-place. - * - * Based on code by [Vladimir Agafonkin](https://www.npmjs.com/~mourner) - * - * @function Phaser.Utils.Array.QuickSelect - * @since 3.0.0 - * - * @param {array} arr - The array to sort. - * @param {number} k - The k-th element index. - * @param {number} [left=0] - The index of the left part of the range. - * @param {number} [right] - The index of the right part of the range. - * @param {function} [compare] - An optional comparison function. Is passed two elements and should return 0, 1 or -1. - */ -var QuickSelect = function (arr, k, left, right, compare) -{ - if (left === undefined) { left = 0; } - if (right === undefined) { right = arr.length - 1; } - if (compare === undefined) { compare = defaultCompare; } - - while (right > left) - { - if (right - left > 600) - { - var n = right - left + 1; - var m = k - left + 1; - var z = Math.log(n); - var s = 0.5 * Math.exp(2 * z / 3); - var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1); - var newLeft = Math.max(left, Math.floor(k - m * s / n + sd)); - var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd)); - - QuickSelect(arr, k, newLeft, newRight, compare); - } - - var t = arr[k]; - var i = left; - var j = right; - - swap(arr, left, k); - - if (compare(arr[right], t) > 0) - { - swap(arr, left, right); - } - - while (i < j) - { - swap(arr, i, j); - - i++; - j--; - - while (compare(arr[i], t) < 0) - { - i++; - } - - while (compare(arr[j], t) > 0) - { - j--; - } - } - - if (compare(arr[left], t) === 0) - { - swap(arr, left, j); - } - else - { - j++; - swap(arr, j, right); - } - - if (j <= k) - { - left = j + 1; - } - - if (k <= j) - { - right = j - 1; - } - } -}; - -module.exports = QuickSelect; - - -/***/ }), -/* 291 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GetValue = __webpack_require__(10); -var Shuffle = __webpack_require__(64); - -var BuildChunk = function (a, b, qty) -{ - var out = []; - - for (var aIndex = 0; aIndex < a.length; aIndex++) - { - for (var bIndex = 0; bIndex < b.length; bIndex++) - { - for (var i = 0; i < qty; i++) - { - out.push({ a: a[aIndex], b: b[bIndex] }); - } - } - } + out.x = line.x1 + (line.x2 - line.x1) * position; + out.y = line.y1 + (line.y2 - line.y1) * position; return out; }; -/** - * Creates an array populated with a range of values, based on the given arguments and configuration object. - * - * Range ([a,b,c], [1,2,3]) = - * a1, a2, a3, b1, b2, b3, c1, c2, c3 - * - * Range ([a,b], [1,2,3], qty = 3) = - * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3 - * - * Range ([a,b,c], [1,2,3], repeat x1) = - * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3 - * - * Range ([a,b], [1,2], repeat -1 = endless, max = 14) = - * Maybe if max is set then repeat goes to -1 automatically? - * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements) - * - * Range ([a], [1,2,3,4,5], random = true) = - * a4, a1, a5, a2, a3 - * - * Range ([a, b], [1,2,3], random = true) = - * b3, a2, a1, b1, a3, b2 - * - * Range ([a, b, c], [1,2,3], randomB = true) = - * a3, a1, a2, b2, b3, b1, c1, c3, c2 - * - * Range ([a], [1,2,3,4,5], yoyo = true) = - * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1 - * - * Range ([a, b], [1,2,3], yoyo = true) = - * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1 - * - * @function Phaser.Utils.Array.Range - * @since 3.0.0 - * - * @param {array} a - The first array of range elements. - * @param {array} b - The second array of range elements. - * @param {object} [options] - A range configuration object. Can contain: repeat, random, randomB, yoyo, max, qty. - * - * @return {array} An array of arranged elements. - */ -var Range = function (a, b, options) -{ - var max = GetValue(options, 'max', 0); - var qty = GetValue(options, 'qty', 1); - var random = GetValue(options, 'random', false); - var randomB = GetValue(options, 'randomB', false); - var repeat = GetValue(options, 'repeat', 0); - var yoyo = GetValue(options, 'yoyo', false); - - var out = []; - - if (randomB) - { - Shuffle(b); - } - - // Endless repeat, so limit by max - if (repeat === -1) - { - if (max === 0) - { - repeat = 0; - } - else - { - // Work out how many repeats we need - var total = (a.length * b.length) * qty; - - if (yoyo) - { - total *= 2; - } - - repeat = Math.ceil(max / total); - } - } - - for (var i = 0; i <= repeat; i++) - { - var chunk = BuildChunk(a, b, qty); - - if (random) - { - Shuffle(chunk); - } - - out = out.concat(chunk); - - if (yoyo) - { - chunk.reverse(); - - out = out.concat(chunk); - } - } - - if (max) - { - out.splice(max); - } - - return out; -}; - -module.exports = Range; +module.exports = GetPoint; /***/ }), -/* 292 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 4479: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -52544,3183 +42374,53 @@ module.exports = Range; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(13); +var Length = __webpack_require__(4771); +var Point = __webpack_require__(7655); /** - * Removes the given item, or array of items, from the array. + * Get a number of points along a line's length. * - * The array is modified in-place. + * Provide a `quantity` to get an exact number of points along the line. * - * You can optionally specify a callback to be invoked for each item successfully removed from the array. + * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when + * providing a `stepRate`. * - * @function Phaser.Utils.Array.Remove - * @since 3.4.0 - * - * @param {array} array - The array to be modified. - * @param {*|Array.<*>} item - The item, or array of items, to be removed from the array. - * @param {function} [callback] - A callback to be invoked for each item successfully removed from the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {*|Array.<*>} The item, or array of items, that were successfully removed from the array. - */ -var Remove = function (array, item, callback, context) -{ - if (context === undefined) { context = array; } - - var index; - - // Fast path to avoid array mutation and iteration - if (!Array.isArray(item)) - { - index = array.indexOf(item); - - if (index !== -1) - { - SpliceOne(array, index); - - if (callback) - { - callback.call(context, item); - } - - return item; - } - else - { - return null; - } - } - - // If we got this far, we have an array of items to remove - - var itemLength = item.length - 1; - var removed = []; - - while (itemLength >= 0) - { - var entry = item[itemLength]; - - index = array.indexOf(entry); - - if (index !== -1) - { - SpliceOne(array, index); - - removed.push(entry); - - if (callback) - { - callback.call(context, entry); - } - } - - itemLength--; - } - - return removed; -}; - -module.exports = Remove; - - -/***/ }), -/* 293 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SpliceOne = __webpack_require__(13); - -/** - * Removes the item from the given position in the array. - * - * The array is modified in-place. - * - * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array. - * - * @function Phaser.Utils.Array.RemoveAt - * @since 3.4.0 - * - * @param {array} array - The array to be modified. - * @param {number} index - The array index to remove the item from. The index must be in bounds or it will throw an error. - * @param {function} [callback] - A callback to be invoked for the item removed from the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {*} The item that was removed. - */ -var RemoveAt = function (array, index, callback, context) -{ - if (context === undefined) { context = array; } - - if (index < 0 || index > array.length - 1) - { - throw new Error('Index out of bounds'); - } - - var item = SpliceOne(array, index); - - if (callback) - { - callback.call(context, item); - } - - return item; -}; - -module.exports = RemoveAt; - - -/***/ }), -/* 294 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Removes the item within the given range in the array. - * - * The array is modified in-place. - * - * You can optionally specify a callback to be invoked for the item/s successfully removed from the array. - * - * @function Phaser.Utils.Array.RemoveBetween - * @since 3.4.0 - * - * @param {array} array - The array to be modified. - * @param {number} startIndex - The start index to remove from. - * @param {number} endIndex - The end index to remove to. - * @param {function} [callback] - A callback to be invoked for the item removed from the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {Array.<*>} An array of items that were removed. - */ -var RemoveBetween = function (array, startIndex, endIndex, callback, context) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - if (context === undefined) { context = array; } - - if (SafeRange(array, startIndex, endIndex)) - { - var size = endIndex - startIndex; - - var removed = array.splice(startIndex, size); - - if (callback) - { - for (var i = 0; i < removed.length; i++) - { - var entry = removed[i]; - - callback.call(context, entry); - } - } - - return removed; - } - else - { - return []; - } -}; - -module.exports = RemoveBetween; - - -/***/ }), -/* 295 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SpliceOne = __webpack_require__(13); - -/** - * Removes a random object from the given array and returns it. - * Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index. - * - * @function Phaser.Utils.Array.RemoveRandomElement - * @since 3.0.0 - * - * @param {array} array - The array to removed a random element from. - * @param {number} [start=0] - The array index to start the search from. - * @param {number} [length=array.length] - Optional restriction on the number of elements to randomly select from. - * - * @return {object} The random element that was removed, or `null` if there were no array elements that fell within the given range. - */ -var RemoveRandomElement = function (array, start, length) -{ - if (start === undefined) { start = 0; } - if (length === undefined) { length = array.length; } - - var randomIndex = start + Math.floor(Math.random() * length); - - return SpliceOne(array, randomIndex); -}; - -module.exports = RemoveRandomElement; - - -/***/ }), -/* 296 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Replaces an element of the array with the new element. - * The new element cannot already be a member of the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.Replace - * @since 3.4.0 - * - * @param {array} array - The array to search within. - * @param {*} oldChild - The element in the array that will be replaced. - * @param {*} newChild - The element to be inserted into the array at the position of `oldChild`. - * - * @return {boolean} Returns true if the oldChild was successfully replaced, otherwise returns false. - */ -var Replace = function (array, oldChild, newChild) -{ - var index1 = array.indexOf(oldChild); - var index2 = array.indexOf(newChild); - - if (index1 !== -1 && index2 === -1) - { - array[index1] = newChild; - - return true; - } - else - { - return false; - } -}; - -module.exports = Replace; - - -/***/ }), -/* 297 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given element to the bottom of the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.SendToBack - * @since 3.4.0 - * - * @param {array} array - The array. - * @param {*} item - The element to move. - * - * @return {*} The element that was moved. - */ -var SendToBack = function (array, item) -{ - var currentIndex = array.indexOf(item); - - if (currentIndex !== -1 && currentIndex > 0) - { - array.splice(currentIndex, 1); - array.unshift(item); - } - - return item; -}; - -module.exports = SendToBack; - - -/***/ }), -/* 298 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Scans the array for elements with the given property. If found, the property is set to the `value`. - * - * For example: `SetAll('visible', true)` would set all elements that have a `visible` property to `false`. - * - * Optionally you can specify a start and end index. For example if the array had 100 elements, - * and you set `startIndex` to 0 and `endIndex` to 50, it would update only the first 50 elements. - * - * @function Phaser.Utils.Array.SetAll - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {string} property - The property to test for on each array element. - * @param {*} value - The value to set the property to. - * @param {number} [startIndex] - An optional start index to search from. - * @param {number} [endIndex] - An optional end index to search to. - * - * @return {array} The input array. - */ -var SetAll = function (array, property, value, startIndex, endIndex) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - - if (SafeRange(array, startIndex, endIndex)) - { - for (var i = startIndex; i < endIndex; i++) - { - var entry = array[i]; - - if (entry.hasOwnProperty(property)) - { - entry[property] = value; - } - } - } - - return array; -}; - -module.exports = SetAll; - - -/***/ }), -/* 299 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Takes the given array and runs a numeric sort on it, ignoring any non-digits that - * may be in the entries. - * - * You should only run this on arrays containing strings. - * - * @function Phaser.Utils.Array.SortByDigits - * @since 3.50.0 - * - * @param {string[]} array - The input array of strings. - * - * @return {string[]} The sorted input array. - */ -var SortByDigits = function (array) -{ - var re = /\D/g; - - array.sort(function (a, b) - { - return (parseInt(a.replace(re, ''), 10) - parseInt(b.replace(re, ''), 10)); - }); - - return array; -}; - -module.exports = SortByDigits; - - -/***/ }), -/* 300 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author Angry Bytes (and contributors) - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Device = __webpack_require__(301); - -/** - * The comparator function. - * - * @ignore - * - * @param {*} a - The first item to test. - * @param {*} b - The second itemt to test. - * - * @return {boolean} True if they localCompare, otherwise false. - */ -function Compare (a, b) -{ - return String(a).localeCompare(b); -} - -/** - * Process the array contents. - * - * @ignore - * - * @param {array} array - The array to process. - * @param {function} compare - The comparison function. - * - * @return {array} - The processed array. - */ -function Process (array, compare) -{ - // Short-circuit when there's nothing to sort. - var len = array.length; - - if (len <= 1) - { - return array; - } - - // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. - // Chunks are the size of the left or right hand in merge sort. - // Stop when the left-hand covers all of the array. - var buffer = new Array(len); - - for (var chk = 1; chk < len; chk *= 2) - { - RunPass(array, compare, chk, buffer); - - var tmp = array; - - array = buffer; - - buffer = tmp; - } - - return array; -} - -/** - * Run a single pass with the given chunk size. - * - * @ignore - * - * @param {array} arr - The array to run the pass on. - * @param {function} comp - The comparison function. - * @param {number} chk - The number of iterations. - * @param {array} result - The array to store the result in. - */ -function RunPass (arr, comp, chk, result) -{ - var len = arr.length; - var i = 0; - - // Step size / double chunk size. - var dbl = chk * 2; - - // Bounds of the left and right chunks. - var l, r, e; - - // Iterators over the left and right chunk. - var li, ri; - - // Iterate over pairs of chunks. - for (l = 0; l < len; l += dbl) - { - r = l + chk; - e = r + chk; - - if (r > len) - { - r = len; - } - - if (e > len) - { - e = len; - } - - // Iterate both chunks in parallel. - li = l; - ri = r; - - while (true) - { - // Compare the chunks. - if (li < r && ri < e) - { - // This works for a regular `sort()` compatible comparator, - // but also for a simple comparator like: `a > b` - if (comp(arr[li], arr[ri]) <= 0) - { - result[i++] = arr[li++]; - } - else - { - result[i++] = arr[ri++]; - } - } - else if (li < r) - { - // Nothing to compare, just flush what's left. - result[i++] = arr[li++]; - } - else if (ri < e) - { - result[i++] = arr[ri++]; - } - else - { - // Both iterators are at the chunk ends. - break; - } - } - } -} - -/** - * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. - * - * This is an implementation of merge sort, without recursion. - * - * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable - * - * @function Phaser.Utils.Array.StableSort - * @since 3.0.0 - * - * @param {array} array - The input array to be sorted. - * @param {function} [compare] - The comparison function. - * - * @return {array} The sorted result. - */ -var StableSort = function (array, compare) -{ - if (compare === undefined) { compare = Compare; } - - // Short-circuit when there's nothing to sort. - if (!array || array.length < 2) - { - return array; - } - - if (Device.features.stableSort) - { - return array.sort(compare); - } - - var result = Process(array, compare); - - // This simply copies back if the result isn't in the original array, which happens on an odd number of passes. - if (result !== array) - { - RunPass(result, null, array.length, array); - } - - return array; -}; - -module.exports = StableSort; - - -/***/ }), -/* 301 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// This singleton is instantiated as soon as Phaser loads, -// before a Phaser.Game instance has even been created. -// Which means all instances of Phaser Games can share it, -// without having to re-poll the device all over again - -/** - * @namespace Phaser.Device - * @since 3.0.0 - */ - -/** - * @typedef {object} Phaser.DeviceConf - * - * @property {Phaser.Device.OS} os - The OS Device functions. - * @property {Phaser.Device.Browser} browser - The Browser Device functions. - * @property {Phaser.Device.Features} features - The Features Device functions. - * @property {Phaser.Device.Input} input - The Input Device functions. - * @property {Phaser.Device.Audio} audio - The Audio Device functions. - * @property {Phaser.Device.Video} video - The Video Device functions. - * @property {Phaser.Device.Fullscreen} fullscreen - The Fullscreen Device functions. - * @property {Phaser.Device.CanvasFeatures} canvasFeatures - The Canvas Device functions. - */ - -module.exports = { - - os: __webpack_require__(28), - browser: __webpack_require__(18), - features: __webpack_require__(303), - input: __webpack_require__(307), - audio: __webpack_require__(308), - video: __webpack_require__(309), - fullscreen: __webpack_require__(310), - canvasFeatures: __webpack_require__(311) - -}; - - -/***/ }), -/* 302 */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), -/* 303 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var OS = __webpack_require__(28); -var Browser = __webpack_require__(18); -var CanvasPool = __webpack_require__(65); - -/** - * Determines the features of the browser running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.features` from within any Scene. - * - * @typedef {object} Phaser.Device.Features - * @since 3.0.0 - * - * @property {boolean} canvas - Is canvas available? - * @property {?boolean} canvasBitBltShift - True if canvas supports a 'copy' bitblt onto itself when the source and destination regions overlap. - * @property {boolean} file - Is file available? - * @property {boolean} fileSystem - Is fileSystem available? - * @property {boolean} getUserMedia - Does the device support the getUserMedia API? - * @property {boolean} littleEndian - Is the device big or little endian? (only detected if the browser supports TypedArrays) - * @property {boolean} localStorage - Is localStorage available? - * @property {boolean} pointerLock - Is Pointer Lock available? - * @property {boolean} stableSort - Is Array.sort stable? - * @property {boolean} support32bit - Does the device context support 32bit pixel manipulation using array buffer views? - * @property {boolean} vibration - Does the device support the Vibration API? - * @property {boolean} webGL - Is webGL available? - * @property {boolean} worker - Is worker available? - */ -var Features = { - - canvas: false, - canvasBitBltShift: null, - file: false, - fileSystem: false, - getUserMedia: true, - littleEndian: false, - localStorage: false, - pointerLock: false, - stableSort: false, - support32bit: false, - vibration: false, - webGL: false, - worker: false - -}; - -// Check Little or Big Endian system. -// @author Matt DesLauriers (@mattdesl) -function checkIsLittleEndian () -{ - var a = new ArrayBuffer(4); - var b = new Uint8Array(a); - var c = new Uint32Array(a); - - b[0] = 0xa1; - b[1] = 0xb2; - b[2] = 0xc3; - b[3] = 0xd4; - - if (c[0] === 0xd4c3b2a1) - { - return true; - } - - if (c[0] === 0xa1b2c3d4) - { - return false; - } - else - { - // Could not determine endianness - return null; - } -} - -function init () -{ - if (typeof importScripts === 'function') - { - return Features; - } - - Features.canvas = !!window['CanvasRenderingContext2D']; - - try - { - Features.localStorage = !!localStorage.getItem; - } - catch (error) - { - Features.localStorage = false; - } - - Features.file = !!window['File'] && !!window['FileReader'] && !!window['FileList'] && !!window['Blob']; - Features.fileSystem = !!window['requestFileSystem']; - - var isUint8 = false; - - var testWebGL = function () - { - if (window['WebGLRenderingContext']) - { - try - { - var canvas = CanvasPool.createWebGL(this); - - var ctx = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); - - var canvas2D = CanvasPool.create2D(this); - - var ctx2D = canvas2D.getContext('2d', { willReadFrequently: true }); - - // Can't be done on a webgl context - var image = ctx2D.createImageData(1, 1); - - // Test to see if ImageData uses CanvasPixelArray or Uint8ClampedArray. - // @author Matt DesLauriers (@mattdesl) - isUint8 = image.data instanceof Uint8ClampedArray; - - CanvasPool.remove(canvas); - CanvasPool.remove(canvas2D); - - return !!ctx; - } - catch (e) - { - return false; - } - } - - return false; - }; - - Features.webGL = testWebGL(); - - Features.worker = !!window['Worker']; - - Features.pointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document; - - navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia; - - window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL; - - Features.getUserMedia = Features.getUserMedia && !!navigator.getUserMedia && !!window.URL; - - // Older versions of firefox (< 21) apparently claim support but user media does not actually work - if (Browser.firefox && Browser.firefoxVersion < 21) - { - Features.getUserMedia = false; - } - - // Excludes iOS versions as they generally wrap UIWebView (eg. Safari WebKit) and it - // is safer to not try and use the fast copy-over method. - if (!OS.iOS && (Browser.ie || Browser.firefox || Browser.chrome)) - { - Features.canvasBitBltShift = true; - } - - // Known not to work - if (Browser.safari || Browser.mobileSafari) - { - Features.canvasBitBltShift = false; - } - - navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate; - - if (navigator.vibrate) - { - Features.vibration = true; - } - - if (typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint32Array !== 'undefined') - { - Features.littleEndian = checkIsLittleEndian(); - } - - Features.support32bit = ( - typeof ArrayBuffer !== 'undefined' && - typeof Uint8ClampedArray !== 'undefined' && - typeof Int32Array !== 'undefined' && - Features.littleEndian !== null && - isUint8 - ); - - return Features; -} - -module.exports = init(); - - -/***/ }), -/* 304 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Global constants. - * - * @ignore - */ - -var CONST = { - - /** - * Phaser Release Version - * - * @name Phaser.VERSION - * @const - * @type {string} - * @since 3.0.0 - */ - VERSION: '3.60.0-beta.18', - - BlendModes: __webpack_require__(15), - - ScaleModes: __webpack_require__(305), - - /** - * This setting will auto-detect if the browser is capable of suppporting WebGL. - * If it is, it will use the WebGL Renderer. If not, it will fall back to the Canvas Renderer. - * - * @name Phaser.AUTO - * @const - * @type {number} - * @since 3.0.0 - */ - AUTO: 0, - - /** - * Forces Phaser to only use the Canvas Renderer, regardless if the browser supports - * WebGL or not. - * - * @name Phaser.CANVAS - * @const - * @type {number} - * @since 3.0.0 - */ - CANVAS: 1, - - /** - * Forces Phaser to use the WebGL Renderer. If the browser does not support it, there is - * no fallback to Canvas with this setting, so you should trap it and display a suitable - * message to the user. - * - * @name Phaser.WEBGL - * @const - * @type {number} - * @since 3.0.0 - */ - WEBGL: 2, - - /** - * A Headless Renderer doesn't create either a Canvas or WebGL Renderer. However, it still - * absolutely relies on the DOM being present and available. This mode is meant for unit testing, - * not for running Phaser on the server, which is something you really shouldn't do. - * - * @name Phaser.HEADLESS - * @const - * @type {number} - * @since 3.0.0 - */ - HEADLESS: 3, - - /** - * In Phaser the value -1 means 'forever' in lots of cases, this const allows you to use it instead - * to help you remember what the value is doing in your code. - * - * @name Phaser.FOREVER - * @const - * @type {number} - * @since 3.0.0 - */ - FOREVER: -1, - - /** - * Direction constant. - * - * @name Phaser.NONE - * @const - * @type {number} - * @since 3.0.0 - */ - NONE: 4, - - /** - * Direction constant. - * - * @name Phaser.UP - * @const - * @type {number} - * @since 3.0.0 - */ - UP: 5, - - /** - * Direction constant. - * - * @name Phaser.DOWN - * @const - * @type {number} - * @since 3.0.0 - */ - DOWN: 6, - - /** - * Direction constant. - * - * @name Phaser.LEFT - * @const - * @type {number} - * @since 3.0.0 - */ - LEFT: 7, - - /** - * Direction constant. - * - * @name Phaser.RIGHT - * @const - * @type {number} - * @since 3.0.0 - */ - RIGHT: 8 - -}; - -module.exports = CONST; - - -/***/ }), -/* 305 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Phaser Scale Modes. - * - * @namespace Phaser.ScaleModes - * @since 3.0.0 - */ - -var ScaleModes = { - - /** - * Default Scale Mode (Linear). - * - * @name Phaser.ScaleModes.DEFAULT - * @type {number} - * @readonly - * @since 3.0.0 - */ - DEFAULT: 0, - - /** - * Linear Scale Mode. - * - * @name Phaser.ScaleModes.LINEAR - * @type {number} - * @readonly - * @since 3.0.0 - */ - LINEAR: 0, - - /** - * Nearest Scale Mode. - * - * @name Phaser.ScaleModes.NEAREST - * @type {number} - * @readonly - * @since 3.0.0 - */ - NEAREST: 1 - -}; - -module.exports = ScaleModes; - - -/***/ }), -/* 306 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Browser specific prefix, so not going to change between contexts, only between browsers -var prefix = ''; - -/** - * @namespace Phaser.Display.Canvas.Smoothing - * @since 3.0.0 - */ -var Smoothing = function () -{ - /** - * Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set. - * - * @function Phaser.Display.Canvas.Smoothing.getPrefix - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The canvas context to check. - * - * @return {string} The name of the property on the context which controls image smoothing (either `imageSmoothingEnabled` or a vendor-prefixed version thereof), or `null` if not supported. - */ - var getPrefix = function (context) - { - var vendors = [ 'i', 'webkitI', 'msI', 'mozI', 'oI' ]; - - for (var i = 0; i < vendors.length; i++) - { - var s = vendors[i] + 'mageSmoothingEnabled'; - - if (s in context) - { - return s; - } - } - - return null; - }; - - /** - * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. - * By default browsers have image smoothing enabled, which isn't always what you visually want, especially - * when using pixel art in a game. Note that this sets the property on the context itself, so that any image - * drawn to the context will be affected. This sets the property across all current browsers but support is - * patchy on earlier browsers, especially on mobile. - * - * @function Phaser.Display.Canvas.Smoothing.enable - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to enable smoothing. - * - * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. - */ - var enable = function (context) - { - if (prefix === '') - { - prefix = getPrefix(context); - } - - if (prefix) - { - context[prefix] = true; - } - - return context; - }; - - /** - * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. - * By default browsers have image smoothing enabled, which isn't always what you visually want, especially - * when using pixel art in a game. Note that this sets the property on the context itself, so that any image - * drawn to the context will be affected. This sets the property across all current browsers but support is - * patchy on earlier browsers, especially on mobile. - * - * @function Phaser.Display.Canvas.Smoothing.disable - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to disable smoothing. - * - * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. - */ - var disable = function (context) - { - if (prefix === '') - { - prefix = getPrefix(context); - } - - if (prefix) - { - context[prefix] = false; - } - - return context; - }; - - /** - * Returns `true` if the given context has image smoothing enabled, otherwise returns `false`. - * Returns null if no smoothing prefix is available. - * - * @function Phaser.Display.Canvas.Smoothing.isEnabled - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context to check. - * - * @return {?boolean} `true` if smoothing is enabled on the context, otherwise `false`. `null` if not supported. - */ - var isEnabled = function (context) - { - return (prefix !== null) ? context[prefix] : null; - }; - - return { - disable: disable, - enable: enable, - getPrefix: getPrefix, - isEnabled: isEnabled - }; - -}; - -module.exports = Smoothing(); - - -/***/ }), -/* 307 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Browser = __webpack_require__(18); - -/** - * Determines the input support of the browser running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.input` from within any Scene. - * - * @typedef {object} Phaser.Device.Input - * @since 3.0.0 - * - * @property {?string} wheelType - The newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll' - * @property {boolean} gamepads - Is navigator.getGamepads available? - * @property {boolean} mspointer - Is mspointer available? - * @property {boolean} touch - Is touch available? - */ -var Input = { - - gamepads: false, - mspointer: false, - touch: false, - wheelEvent: null - -}; - -function init () -{ - if (typeof importScripts === 'function') - { - return Input; - } - - if ('ontouchstart' in document.documentElement || (navigator.maxTouchPoints && navigator.maxTouchPoints >= 1)) - { - Input.touch = true; - } - - if (navigator.msPointerEnabled || navigator.pointerEnabled) - { - Input.mspointer = true; - } - - if (navigator.getGamepads) - { - Input.gamepads = true; - } - - // See https://developer.mozilla.org/en-US/docs/Web/Events/wheel - if ('onwheel' in window || (Browser.ie && 'WheelEvent' in window)) - { - // DOM3 Wheel Event: FF 17+, IE 9+, Chrome 31+, Safari 7+ - Input.wheelEvent = 'wheel'; - } - else if ('onmousewheel' in window) - { - // Non-FF legacy: IE 6-9, Chrome 1-31, Safari 5-7. - Input.wheelEvent = 'mousewheel'; - } - else if (Browser.firefox && 'MouseScrollEvent' in window) - { - // FF prior to 17. This should probably be scrubbed. - Input.wheelEvent = 'DOMMouseScroll'; - } - - return Input; -} - -module.exports = init(); - - -/***/ }), -/* 308 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Browser = __webpack_require__(18); - -/** - * Determines the audio playback capabilities of the device running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.audio` from within any Scene. - * - * @typedef {object} Phaser.Device.Audio - * @since 3.0.0 - * - * @property {boolean} audioData - Can this device play HTML Audio tags? - * @property {boolean} dolby - Can this device play EC-3 Dolby Digital Plus files? - * @property {boolean} m4a - Can this device can play m4a files. - * @property {boolean} aac - Can this device can play aac files. - * @property {boolean} flac - Can this device can play flac files. - * @property {boolean} mp3 - Can this device play mp3 files? - * @property {boolean} ogg - Can this device play ogg files? - * @property {boolean} opus - Can this device play opus files? - * @property {boolean} wav - Can this device play wav files? - * @property {boolean} webAudio - Does this device have the Web Audio API? - * @property {boolean} webm - Can this device play webm files? - */ -var Audio = { - - flac: false, - aac: false, - audioData: false, - dolby: false, - m4a: false, - mp3: false, - ogg: false, - opus: false, - wav: false, - webAudio: false, - webm: false - -}; - -function init () -{ - if (typeof importScripts === 'function') - { - return Audio; - } - - Audio.audioData = !!(window['Audio']); - - Audio.webAudio = !!(window['AudioContext'] || window['webkitAudioContext']); - - var audioElement = document.createElement('audio'); - var result = !!audioElement.canPlayType; - - try - { - if (result) - { - var CanPlay = function (type1, type2) - { - var canPlayType1 = audioElement.canPlayType('audio/' + type1).replace(/^no$/, ''); - - if (type2) - { - return Boolean(canPlayType1 || audioElement.canPlayType('audio/' + type2).replace(/^no$/, '')); - } - else - { - return Boolean(canPlayType1); - } - }; - - // wav Mimetypes accepted: - // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements - - Audio.ogg = CanPlay('ogg; codecs="vorbis"'); - Audio.opus = CanPlay('ogg; codecs="opus"', 'opus'); - Audio.mp3 = CanPlay('mpeg'); - Audio.wav = CanPlay('wav'); - Audio.m4a = CanPlay('x-m4a'); - Audio.aac = CanPlay('aac'); - Audio.flac = CanPlay('flac', 'x-flac'); - Audio.webm = CanPlay('webm; codecs="vorbis"'); - - if (audioElement.canPlayType('audio/mp4; codecs="ec-3"') !== '') - { - if (Browser.edge) - { - Audio.dolby = true; - } - else if (Browser.safari && Browser.safariVersion >= 9) - { - if ((/Mac OS X (\d+)_(\d+)/).test(navigator.userAgent)) - { - var major = parseInt(RegExp.$1, 10); - var minor = parseInt(RegExp.$2, 10); - - if ((major === 10 && minor >= 11) || major > 10) - { - Audio.dolby = true; - } - } - } - } - } - } - catch (e) - { - // Nothing to do here - } - - return Audio; -} - -module.exports = init(); - - -/***/ }), -/* 309 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Determines the video support of the browser running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.video` from within any Scene. - * - * In Phaser 3.20 the properties were renamed to drop the 'Video' suffix. - * - * @typedef {object} Phaser.Device.Video - * @since 3.0.0 - * - * @property {boolean} h264 - Can this device play h264 mp4 video files? - * @property {boolean} hls - Can this device play hls video files? - * @property {boolean} mp4 - Can this device play h264 mp4 video files? - * @property {boolean} m4v - Can this device play m4v (typically mp4) video files? - * @property {boolean} ogg - Can this device play ogg video files? - * @property {boolean} vp9 - Can this device play vp9 video files? - * @property {boolean} webm - Can this device play webm video files? - */ -var Video = { - - h264: false, - hls: false, - mp4: false, - m4v: false, - ogg: false, - vp9: false, - webm: false - -}; - -function init () -{ - if (typeof importScripts === 'function') - { - return Video; - } - - var videoElement = document.createElement('video'); - var result = !!videoElement.canPlayType; - var no = /^no$/; - - try - { - if (result) - { - if (videoElement.canPlayType('video/ogg; codecs="theora"').replace(no, '')) - { - Video.ogg = true; - } - - if (videoElement.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(no, '')) - { - // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546 - Video.h264 = true; - Video.mp4 = true; - } - - if (videoElement.canPlayType('video/x-m4v').replace(no, '')) - { - Video.m4v = true; - } - - if (videoElement.canPlayType('video/webm; codecs="vp8, vorbis"').replace(no, '')) - { - Video.webm = true; - } - - if (videoElement.canPlayType('video/webm; codecs="vp9"').replace(no, '')) - { - Video.vp9 = true; - } - - if (videoElement.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(no, '')) - { - Video.hls = true; - } - } - } - catch (e) - { - // Nothing to do - } - - return Video; -} - -module.exports = init(); - - -/***/ }), -/* 310 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Determines the full screen support of the browser running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.fullscreen` from within any Scene. - * - * @typedef {object} Phaser.Device.Fullscreen - * @since 3.0.0 - * - * @property {boolean} available - Does the browser support the Full Screen API? - * @property {boolean} keyboard - Does the browser support access to the Keyboard during Full Screen mode? - * @property {string} cancel - If the browser supports the Full Screen API this holds the call you need to use to cancel it. - * @property {string} request - If the browser supports the Full Screen API this holds the call you need to use to activate it. - */ -var Fullscreen = { - - available: false, - cancel: '', - keyboard: false, - request: '' - -}; - -/** -* Checks for support of the Full Screen API. -* -* @ignore -*/ -function init () -{ - if (typeof importScripts === 'function') - { - return Fullscreen; - } - - var i; - - var suffix1 = 'Fullscreen'; - var suffix2 = 'FullScreen'; - - var fs = [ - 'request' + suffix1, - 'request' + suffix2, - 'webkitRequest' + suffix1, - 'webkitRequest' + suffix2, - 'msRequest' + suffix1, - 'msRequest' + suffix2, - 'mozRequest' + suffix2, - 'mozRequest' + suffix1 - ]; - - for (i = 0; i < fs.length; i++) - { - if (document.documentElement[fs[i]]) - { - Fullscreen.available = true; - Fullscreen.request = fs[i]; - break; - } - } - - var cfs = [ - 'cancel' + suffix2, - 'exit' + suffix1, - 'webkitCancel' + suffix2, - 'webkitExit' + suffix1, - 'msCancel' + suffix2, - 'msExit' + suffix1, - 'mozCancel' + suffix2, - 'mozExit' + suffix1 - ]; - - if (Fullscreen.available) - { - for (i = 0; i < cfs.length; i++) - { - if (document[cfs[i]]) - { - Fullscreen.cancel = cfs[i]; - break; - } - } - } - - // Keyboard Input? - // Safari 5.1 says it supports fullscreen keyboard, but is lying. - if (window['Element'] && Element['ALLOW_KEYBOARD_INPUT'] && !(/ Version\/5\.1(?:\.\d+)? Safari\//).test(navigator.userAgent)) - { - Fullscreen.keyboard = true; - } - - Object.defineProperty(Fullscreen, 'active', { get: function () { return !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement); } }); - - return Fullscreen; -} - -module.exports = init(); - - -/***/ }), -/* 311 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CanvasPool = __webpack_require__(65); - -/** - * Determines the canvas features of the browser running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.canvasFeatures` from within any Scene. - * - * @typedef {object} Phaser.Device.CanvasFeatures - * @since 3.0.0 - * - * @property {boolean} supportInverseAlpha - Set to true if the browser supports inversed alpha. - * @property {boolean} supportNewBlendModes - Set to true if the browser supports new canvas blend modes. - */ -var CanvasFeatures = { - - supportInverseAlpha: false, - supportNewBlendModes: false - -}; - -function checkBlendMode () -{ - var pngHead = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/'; - var pngEnd = 'AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg=='; - - var magenta = new Image(); - - magenta.onload = function () - { - var yellow = new Image(); - - yellow.onload = function () - { - var canvas = CanvasPool.create2D(yellow, 6); - var context = canvas.getContext('2d', { willReadFrequently: true }); - - context.globalCompositeOperation = 'multiply'; - - context.drawImage(magenta, 0, 0); - context.drawImage(yellow, 2, 0); - - if (!context.getImageData(2, 0, 1, 1)) - { - return false; - } - - var data = context.getImageData(2, 0, 1, 1).data; - - CanvasPool.remove(yellow); - - CanvasFeatures.supportNewBlendModes = (data[0] === 255 && data[1] === 0 && data[2] === 0); - }; - - yellow.src = pngHead + '/wCKxvRF' + pngEnd; - }; - - magenta.src = pngHead + 'AP804Oa6' + pngEnd; - - return false; -} - -function checkInverseAlpha () -{ - var canvas = CanvasPool.create2D(this, 2); - var context = canvas.getContext('2d', { willReadFrequently: true }); - - context.fillStyle = 'rgba(10, 20, 30, 0.5)'; - - // Draw a single pixel - context.fillRect(0, 0, 1, 1); - - // Get the color values - var s1 = context.getImageData(0, 0, 1, 1); - - if (s1 === null) - { - return false; - } - - // Plot them to x2 - context.putImageData(s1, 1, 0); - - // Get those values - var s2 = context.getImageData(1, 0, 1, 1); - - var result = (s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]); - - CanvasPool.remove(this); - - // Compare and return - return result; -} - -function init () -{ - if (typeof importScripts !== 'function' && document !== undefined) - { - CanvasFeatures.supportNewBlendModes = checkBlendMode(); - CanvasFeatures.supportInverseAlpha = checkInverseAlpha(); - } - - return CanvasFeatures; -} - -module.exports = init(); - - -/***/ }), -/* 312 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Swaps the position of two elements in the given array. - * The elements must exist in the same array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.Swap - * @since 3.4.0 - * - * @param {array} array - The input array. - * @param {*} item1 - The first element to swap. - * @param {*} item2 - The second element to swap. - * - * @return {array} The input array. - */ -var Swap = function (array, item1, item2) -{ - if (item1 === item2) - { - return array; - } - - var index1 = array.indexOf(item1); - var index2 = array.indexOf(item2); - - if (index1 < 0 || index2 < 0) - { - throw new Error('Supplied items must be elements of the same array'); - } - - array[index1] = item2; - array[index2] = item1; - - return array; -}; - -module.exports = Swap; - - -/***/ }), -/* 313 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.GameObjects.Components - */ - -module.exports = { - - Alpha: __webpack_require__(314), - AlphaSingle: __webpack_require__(315), - BlendMode: __webpack_require__(316), - ComputedSize: __webpack_require__(51), - Crop: __webpack_require__(317), - Depth: __webpack_require__(52), - Flip: __webpack_require__(53), - FX: __webpack_require__(318), - GetBounds: __webpack_require__(319), - Mask: __webpack_require__(328), - Origin: __webpack_require__(333), - PathFollower: __webpack_require__(334), - Pipeline: __webpack_require__(337), - ScrollFactor: __webpack_require__(54), - Size: __webpack_require__(339), - Texture: __webpack_require__(340), - TextureCrop: __webpack_require__(341), - Tint: __webpack_require__(342), - ToJSON: __webpack_require__(58), - Transform: __webpack_require__(55), - TransformMatrix: __webpack_require__(26), - Visible: __webpack_require__(56) - -}; - - -/***/ }), -/* 314 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(1); - -// bitmask flag for GameObject.renderMask -var _FLAG = 2; // 0010 - -/** - * Provides methods used for setting the alpha properties of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Alpha - * @since 3.0.0 - */ - -var Alpha = { - - /** - * Private internal value. Holds the global alpha value. - * - * @name Phaser.GameObjects.Components.Alpha#_alpha - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alpha: 1, - - /** - * Private internal value. Holds the top-left alpha value. - * - * @name Phaser.GameObjects.Components.Alpha#_alphaTL - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alphaTL: 1, - - /** - * Private internal value. Holds the top-right alpha value. - * - * @name Phaser.GameObjects.Components.Alpha#_alphaTR - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alphaTR: 1, - - /** - * Private internal value. Holds the bottom-left alpha value. - * - * @name Phaser.GameObjects.Components.Alpha#_alphaBL - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alphaBL: 1, - - /** - * Private internal value. Holds the bottom-right alpha value. - * - * @name Phaser.GameObjects.Components.Alpha#_alphaBR - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alphaBR: 1, - - /** - * Clears all alpha values associated with this Game Object. - * - * Immediately sets the alpha levels back to 1 (fully opaque). - * - * @method Phaser.GameObjects.Components.Alpha#clearAlpha - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - clearAlpha: function () - { - return this.setAlpha(1); - }, - - /** - * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. - * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * - * If your game is running under WebGL you can optionally specify four different alpha values, each of which - * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. - * - * @method Phaser.GameObjects.Components.Alpha#setAlpha - * @since 3.0.0 - * - * @param {number} [topLeft=1] - The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. - * @param {number} [topRight] - The alpha value used for the top-right of the Game Object. WebGL only. - * @param {number} [bottomLeft] - The alpha value used for the bottom-left of the Game Object. WebGL only. - * @param {number} [bottomRight] - The alpha value used for the bottom-right of the Game Object. WebGL only. - * - * @return {this} This Game Object instance. - */ - setAlpha: function (topLeft, topRight, bottomLeft, bottomRight) - { - if (topLeft === undefined) { topLeft = 1; } - - // Treat as if there is only one alpha value for the whole Game Object - if (topRight === undefined) - { - this.alpha = topLeft; - } - else - { - this._alphaTL = Clamp(topLeft, 0, 1); - this._alphaTR = Clamp(topRight, 0, 1); - this._alphaBL = Clamp(bottomLeft, 0, 1); - this._alphaBR = Clamp(bottomRight, 0, 1); - } - - return this; - }, - - /** - * The alpha value of the Game Object. - * - * This is a global value, impacting the entire Game Object, not just a region of it. - * - * @name Phaser.GameObjects.Components.Alpha#alpha - * @type {number} - * @since 3.0.0 - */ - alpha: { - - get: function () - { - return this._alpha; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alpha = v; - this._alphaTL = v; - this._alphaTR = v; - this._alphaBL = v; - this._alphaBR = v; - - if (v === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The alpha value starting from the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Alpha#alphaTopLeft - * @type {number} - * @webglOnly - * @since 3.0.0 - */ - alphaTopLeft: { - - get: function () - { - return this._alphaTL; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alphaTL = v; - - if (v !== 0) - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The alpha value starting from the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Alpha#alphaTopRight - * @type {number} - * @webglOnly - * @since 3.0.0 - */ - alphaTopRight: { - - get: function () - { - return this._alphaTR; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alphaTR = v; - - if (v !== 0) - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The alpha value starting from the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Alpha#alphaBottomLeft - * @type {number} - * @webglOnly - * @since 3.0.0 - */ - alphaBottomLeft: { - - get: function () - { - return this._alphaBL; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alphaBL = v; - - if (v !== 0) - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The alpha value starting from the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Alpha#alphaBottomRight - * @type {number} - * @webglOnly - * @since 3.0.0 - */ - alphaBottomRight: { - - get: function () - { - return this._alphaBR; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alphaBR = v; - - if (v !== 0) - { - this.renderFlags |= _FLAG; - } - } - - } - -}; - -module.exports = Alpha; - - -/***/ }), -/* 315 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(1); - -// bitmask flag for GameObject.renderMask -var _FLAG = 2; // 0010 - -/** - * Provides methods used for setting the alpha property of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.AlphaSingle - * @since 3.22.0 - */ - -var AlphaSingle = { - - /** - * Private internal value. Holds the global alpha value. - * - * @name Phaser.GameObjects.Components.AlphaSingle#_alpha - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alpha: 1, - - /** - * Clears all alpha values associated with this Game Object. - * - * Immediately sets the alpha levels back to 1 (fully opaque). - * - * @method Phaser.GameObjects.Components.AlphaSingle#clearAlpha - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - clearAlpha: function () - { - return this.setAlpha(1); - }, - - /** - * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. - * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * - * @method Phaser.GameObjects.Components.AlphaSingle#setAlpha - * @since 3.0.0 - * - * @param {number} [value=1] - The alpha value applied across the whole Game Object. - * - * @return {this} This Game Object instance. - */ - setAlpha: function (value) - { - if (value === undefined) { value = 1; } - - this.alpha = value; - - return this; - }, - - /** - * The alpha value of the Game Object. - * - * This is a global value, impacting the entire Game Object, not just a region of it. - * - * @name Phaser.GameObjects.Components.AlphaSingle#alpha - * @type {number} - * @since 3.0.0 - */ - alpha: { - - get: function () - { - return this._alpha; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alpha = v; - - if (v === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - } - -}; - -module.exports = AlphaSingle; - - -/***/ }), -/* 316 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BlendModes = __webpack_require__(15); - -/** - * Provides methods used for setting the blend mode of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.BlendMode - * @since 3.0.0 - */ - -var BlendMode = { - - /** - * Private internal value. Holds the current blend mode. - * - * @name Phaser.GameObjects.Components.BlendMode#_blendMode - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - _blendMode: BlendModes.NORMAL, - - /** - * Sets the Blend Mode being used by this Game Object. - * - * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * - * Under WebGL only the following Blend Modes are available: - * - * * NORMAL - * * ADD - * * MULTIPLY - * * SCREEN - * * ERASE - * - * Canvas has more available depending on browser support. - * - * You can also create your own custom Blend Modes in WebGL. - * - * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending - * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these - * reasons try to be careful about the construction of your Scene and the frequency of which blend modes - * are used. - * - * @name Phaser.GameObjects.Components.BlendMode#blendMode - * @type {(Phaser.BlendModes|string|number)} - * @since 3.0.0 - */ - blendMode: { - - get: function () - { - return this._blendMode; - }, - - set: function (value) - { - if (typeof value === 'string') - { - value = BlendModes[value]; - } - - value |= 0; - - if (value >= -1) - { - this._blendMode = value; - } - } - - }, - - /** - * Sets the Blend Mode being used by this Game Object. - * - * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * - * Under WebGL only the following Blend Modes are available: - * - * * NORMAL - * * ADD - * * MULTIPLY - * * SCREEN - * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * - * Canvas has more available depending on browser support. - * - * You can also create your own custom Blend Modes in WebGL. - * - * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending - * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these - * reasons try to be careful about the construction of your Scene and the frequency in which blend modes - * are used. - * - * @method Phaser.GameObjects.Components.BlendMode#setBlendMode - * @since 3.0.0 - * - * @param {(string|Phaser.BlendModes|number)} value - The BlendMode value. Either a string, a CONST or a number. - * - * @return {this} This Game Object instance. - */ - setBlendMode: function (value) - { - this.blendMode = value; - - return this; - } - -}; - -module.exports = BlendMode; - - -/***/ }), -/* 317 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for getting and setting the texture of a Game Object. - * - * @namespace Phaser.GameObjects.Components.Crop - * @since 3.12.0 - */ - -var Crop = { - - /** - * The Texture this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.Crop#texture - * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} - * @since 3.0.0 - */ - texture: null, - - /** - * The Texture Frame this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.Crop#frame - * @type {Phaser.Textures.Frame} - * @since 3.0.0 - */ - frame: null, - - /** - * A boolean flag indicating if this Game Object is being cropped or not. - * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. - * Equally, calling `setCrop` with no arguments will reset the crop and disable it. - * - * @name Phaser.GameObjects.Components.Crop#isCropped - * @type {boolean} - * @since 3.11.0 - */ - isCropped: false, - - /** - * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * - * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * - * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just - * changes what is shown when rendered. - * - * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * - * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left - * half of it, you could call `setCrop(0, 0, 400, 600)`. - * - * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop - * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * - * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * - * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * - * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow - * the renderer to skip several internal calculations. - * - * @method Phaser.GameObjects.Components.Crop#setCrop - * @since 3.11.0 - * - * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. - * @param {number} [y] - The y coordinate to start the crop from. - * @param {number} [width] - The width of the crop rectangle in pixels. - * @param {number} [height] - The height of the crop rectangle in pixels. - * - * @return {this} This Game Object instance. - */ - setCrop: function (x, y, width, height) - { - if (x === undefined) - { - this.isCropped = false; - } - else if (this.frame) - { - if (typeof x === 'number') - { - this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY); - } - else - { - var rect = x; - - this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY); - } - - this.isCropped = true; - } - - return this; - }, - - /** - * Internal method that returns a blank, well-formed crop object for use by a Game Object. - * - * @method Phaser.GameObjects.Components.Crop#resetCropObject - * @private - * @since 3.12.0 - * - * @return {object} The crop object. - */ - resetCropObject: function () - { - return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 }; - } - -}; - -module.exports = Crop; - - -/***/ }), -/* 318 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for setting the FX values of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.FX - * @webglOnly - * @since 3.60.0 - */ - -var FX = { - - /** - * The amount of extra padding to be applied to this Game Object - * when it is being rendered by a SpriteFX Pipeline. - * - * Lots of FX require additional spacing added to the texture the - * Game Object uses, for example a glow or shadow effect, and this - * method allows you to control how much extra padding is included - * in addition to the texture size. - * - * @name Phaser.GameObjects.Components.FX#fxPadding - * @type {number} - * @default 0 - * @since 3.60.0 - */ - fxPadding: 0, - - /** - * Sets the amount of extra padding to be applied to this Game Object - * when it is being rendered by a SpriteFX Pipeline. - * - * Lots of FX require additional spacing added to the texture the - * Game Object uses, for example a glow or shadow effect, and this - * method allows you to control how much extra padding is included - * in addition to the texture size. - * - * @method Phaser.GameObjects.Components.FX#setFXPadding - * @webglOnly - * @since 3.60.0 - * - * @param {number} [padding=0] - The amount of padding to add to the texture. - * - * @return {this} This Game Object instance. - */ - setFXPadding: function (padding) - { - if (padding === undefined) { padding = 0; } - - this.fxPadding = padding; - - return this; - }, - - /** - * This callback is invoked when this Game Object is copied by a SpriteFX Pipeline. - * - * This happens when the pipeline uses its `copySprite` method. - * - * It's invoked prior to the copy, allowing you to set shader uniforms, etc on the pipeline. - * - * @method Phaser.GameObjects.Components.FX#onFXCopy - * @webglOnly - * @since 3.60.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline} pipeline - The SpriteFX Pipeline that invoked this callback. - */ - onFXCopy: function () - { - }, - - /** - * This callback is invoked when this Game Object is rendered by a SpriteFX Pipeline. - * - * This happens when the pipeline uses its `drawSprite` method. - * - * It's invoked prior to the draw, allowing you to set shader uniforms, etc on the pipeline. - * - * @method Phaser.GameObjects.Components.FX#onFX - * @webglOnly - * @since 3.60.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline} pipeline - The SpriteFX Pipeline that invoked this callback. - */ - onFX: function () - { - } - -}; - -module.exports = FX; - - -/***/ }), -/* 319 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Rectangle = __webpack_require__(29); -var RotateAround = __webpack_require__(42); -var Vector2 = __webpack_require__(3); - -/** - * Provides methods used for obtaining the bounds of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.GetBounds - * @since 3.0.0 - */ - -var GetBounds = { - - /** - * Processes the bounds output vector before returning it. - * - * @method Phaser.GameObjects.Components.GetBounds#prepareBoundsOutput - * @private - * @since 3.18.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} output - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - prepareBoundsOutput: function (output, includeParent) - { - if (includeParent === undefined) { includeParent = false; } - - if (this.rotation !== 0) - { - RotateAround(output, this.x, this.y, this.rotation); - } - - if (includeParent && this.parentContainer) - { - var parentMatrix = this.parentContainer.getBoundsTransformMatrix(); - - parentMatrix.transformPoint(output.x, output.y, output); - } - - return output; - }, - - /** - * Gets the center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getCenter - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getCenter: function (output) - { - if (output === undefined) { output = new Vector2(); } - - output.x = this.x - (this.displayWidth * this.originX) + (this.displayWidth / 2); - output.y = this.y - (this.displayHeight * this.originY) + (this.displayHeight / 2); - - return output; - }, - - /** - * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getTopLeft - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getTopLeft: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = this.x - (this.displayWidth * this.originX); - output.y = this.y - (this.displayHeight * this.originY); - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the top-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getTopCenter - * @since 3.18.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getTopCenter: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2); - output.y = this.y - (this.displayHeight * this.originY); - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getTopRight - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getTopRight: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; - output.y = this.y - (this.displayHeight * this.originY); - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the left-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getLeftCenter - * @since 3.18.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getLeftCenter: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = this.x - (this.displayWidth * this.originX); - output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2); - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the right-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getRightCenter - * @since 3.18.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getRightCenter: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; - output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2); - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getBottomLeft - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getBottomLeft: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = this.x - (this.displayWidth * this.originX); - output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getBottomCenter - * @since 3.18.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getBottomCenter: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2); - output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getBottomRight - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getBottomRight: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; - output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the bounds of this Game Object, regardless of origin. - * The values are stored and returned in a Rectangle, or Rectangle-like, object. - * - * @method Phaser.GameObjects.Components.GetBounds#getBounds - * @since 3.0.0 - * - * @generic {Phaser.Geom.Rectangle} O - [output,$return] - * - * @param {(Phaser.Geom.Rectangle|object)} [output] - An object to store the values in. If not provided a new Rectangle will be created. - * - * @return {(Phaser.Geom.Rectangle|object)} The values stored in the output object. - */ - getBounds: function (output) - { - if (output === undefined) { output = new Rectangle(); } - - // We can use the output object to temporarily store the x/y coords in: - - var TLx, TLy, TRx, TRy, BLx, BLy, BRx, BRy; - - // Instead of doing a check if parent container is - // defined per corner we only do it once. - if (this.parentContainer) - { - var parentMatrix = this.parentContainer.getBoundsTransformMatrix(); - - this.getTopLeft(output); - parentMatrix.transformPoint(output.x, output.y, output); - - TLx = output.x; - TLy = output.y; - - this.getTopRight(output); - parentMatrix.transformPoint(output.x, output.y, output); - - TRx = output.x; - TRy = output.y; - - this.getBottomLeft(output); - parentMatrix.transformPoint(output.x, output.y, output); - - BLx = output.x; - BLy = output.y; - - this.getBottomRight(output); - parentMatrix.transformPoint(output.x, output.y, output); - - BRx = output.x; - BRy = output.y; - } - else - { - this.getTopLeft(output); - - TLx = output.x; - TLy = output.y; - - this.getTopRight(output); - - TRx = output.x; - TRy = output.y; - - this.getBottomLeft(output); - - BLx = output.x; - BLy = output.y; - - this.getBottomRight(output); - - BRx = output.x; - BRy = output.y; - } - - output.x = Math.min(TLx, TRx, BLx, BRx); - output.y = Math.min(TLy, TRy, BLy, BRy); - output.width = Math.max(TLx, TRx, BLx, BRx) - output.x; - output.height = Math.max(TLy, TRy, BLy, BRy) - output.y; - - return output; - } - -}; - -module.exports = GetBounds; - - -/***/ }), -/* 320 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if a given point is inside a Rectangle's bounds. - * - * @function Phaser.Geom.Rectangle.Contains - * @since 3.0.0 - * - * @param {Phaser.Geom.Rectangle} rect - The Rectangle to check. - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. - * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ -var Contains = function (rect, x, y) -{ - if (rect.width <= 0 || rect.height <= 0) - { - return false; - } - - return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); -}; - -module.exports = Contains; - - -/***/ }), -/* 321 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GetPoint = __webpack_require__(66); -var Perimeter = __webpack_require__(67); - -/** - * Return an array of points from the perimeter of the rectangle, each spaced out based on the quantity or step required. - * - * @function Phaser.Geom.Rectangle.GetPoints + * @function Phaser.Geom.Line.GetPoints * @since 3.0.0 * * @generic {Phaser.Geom.Point[]} O - [out,$return] * - * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from. - * @param {number} step - Step between points. Used to calculate the number of points to return when quantity is falsey. Ignored if quantity is positive. - * @param {number} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points. - * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in. + * @param {Phaser.Geom.Line} line - The line. + * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. + * @param {(array|Phaser.Geom.Point[])} [out] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. * - * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle. + * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line. */ -var GetPoints = function (rectangle, quantity, stepRate, out) +var GetPoints = function (line, quantity, stepRate, out) { if (out === undefined) { out = []; } // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead. if (!quantity && stepRate > 0) { - quantity = Perimeter(rectangle) / stepRate; + quantity = Length(line) / stepRate; } + var x1 = line.x1; + var y1 = line.y1; + + var x2 = line.x2; + var y2 = line.y2; + for (var i = 0; i < quantity; i++) { var position = i / quantity; - out.push(GetPoint(rectangle, position)); + var x = x1 + (x2 - x1) * position; + var y = y1 + (y2 - y1) * position; + + out.push(new Point(x, y)); } return out; @@ -55730,8 +42430,9 @@ module.exports = GetPoints; /***/ }), -/* 322 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 4771: +/***/ ((module) => { /** * @author Richard Davey @@ -55739,12 +42440,41 @@ module.exports = GetPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); -var GetPoint = __webpack_require__(323); -var GetPoints = __webpack_require__(324); -var GEOM_CONST = __webpack_require__(30); -var Random = __webpack_require__(326); -var Vector2 = __webpack_require__(3); +/** + * Calculate the length of the given line. + * + * @function Phaser.Geom.Line.Length + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line to calculate the length of. + * + * @return {number} The length of the line. + */ +var Length = function (line) +{ + return Math.sqrt((line.x2 - line.x1) * (line.x2 - line.x1) + (line.y2 - line.y1) * (line.y2 - line.y1)); +}; + +module.exports = Length; + + +/***/ }), + +/***/ 284: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var GetPoint = __webpack_require__(8881); +var GetPoints = __webpack_require__(4479); +var GEOM_CONST = __webpack_require__(1643); +var Random = __webpack_require__(3915); +var Vector2 = __webpack_require__(2529); /** * @classdesc @@ -56067,8 +42797,9 @@ module.exports = Line; /***/ }), -/* 323 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 3915: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -56076,139 +42807,7 @@ module.exports = Line; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(14); - -/** - * Get a point on a line that's a given percentage along its length. - * - * @function Phaser.Geom.Line.GetPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [out,$return] - * - * @param {Phaser.Geom.Line} line - The line. - * @param {number} position - A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line. - * @param {(Phaser.Geom.Point|object)} [out] - An optional point, or point-like object, to store the coordinates of the point on the line. - * - * @return {(Phaser.Geom.Point|object)} The point on the line. - */ -var GetPoint = function (line, position, out) -{ - if (out === undefined) { out = new Point(); } - - out.x = line.x1 + (line.x2 - line.x1) * position; - out.y = line.y1 + (line.y2 - line.y1) * position; - - return out; -}; - -module.exports = GetPoint; - - -/***/ }), -/* 324 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Length = __webpack_require__(325); -var Point = __webpack_require__(14); - -/** - * Get a number of points along a line's length. - * - * Provide a `quantity` to get an exact number of points along the line. - * - * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when - * providing a `stepRate`. - * - * @function Phaser.Geom.Line.GetPoints - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point[]} O - [out,$return] - * - * @param {Phaser.Geom.Line} line - The line. - * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. - * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. - * @param {(array|Phaser.Geom.Point[])} [out] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. - * - * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line. - */ -var GetPoints = function (line, quantity, stepRate, out) -{ - if (out === undefined) { out = []; } - - // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead. - if (!quantity && stepRate > 0) - { - quantity = Length(line) / stepRate; - } - - var x1 = line.x1; - var y1 = line.y1; - - var x2 = line.x2; - var y2 = line.y2; - - for (var i = 0; i < quantity; i++) - { - var position = i / quantity; - - var x = x1 + (x2 - x1) * position; - var y = y1 + (y2 - y1) * position; - - out.push(new Point(x, y)); - } - - return out; -}; - -module.exports = GetPoints; - - -/***/ }), -/* 325 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the length of the given line. - * - * @function Phaser.Geom.Line.Length - * @since 3.0.0 - * - * @param {Phaser.Geom.Line} line - The line to calculate the length of. - * - * @return {number} The length of the line. - */ -var Length = function (line) -{ - return Math.sqrt((line.x2 - line.x1) * (line.x2 - line.x1) + (line.y2 - line.y1) * (line.y2 - line.y1)); -}; - -module.exports = Length; - - -/***/ }), -/* 326 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Point = __webpack_require__(14); +var Point = __webpack_require__(7655); /** * Returns a random point on a given Line. @@ -56239,8 +42838,9 @@ module.exports = Random; /***/ }), -/* 327 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 7655: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -56248,7 +42848,300 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(14); +var Class = __webpack_require__(7473); +var GEOM_CONST = __webpack_require__(1643); + +/** + * @classdesc + * Defines a Point in 2D space, with an x and y component. + * + * @class Point + * @memberof Phaser.Geom + * @constructor + * @since 3.0.0 + * + * @param {number} [x=0] - The x coordinate of this Point. + * @param {number} [y=x] - The y coordinate of this Point. + */ +var Point = new Class({ + + initialize: + + function Point (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + + /** + * The geometry constant type of this object: `GEOM_CONST.POINT`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Point#type + * @type {number} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.POINT; + + /** + * The x coordinate of this Point. + * + * @name Phaser.Geom.Point#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = x; + + /** + * The y coordinate of this Point. + * + * @name Phaser.Geom.Point#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = y; + }, + + /** + * Set the x and y coordinates of the point to the given values. + * + * @method Phaser.Geom.Point#setTo + * @since 3.0.0 + * + * @param {number} [x=0] - The x coordinate of this Point. + * @param {number} [y=x] - The y coordinate of this Point. + * + * @return {this} This Point object. + */ + setTo: function (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + } + +}); + +module.exports = Point; + + +/***/ }), + +/***/ 5956: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if a given point is inside a Rectangle's bounds. + * + * @function Phaser.Geom.Rectangle.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to check. + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. + * + * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. + */ +var Contains = function (rect, x, y) +{ + if (rect.width <= 0 || rect.height <= 0) + { + return false; + } + + return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); +}; + +module.exports = Contains; + + +/***/ }), + +/***/ 716: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Perimeter = __webpack_require__(7120); +var Point = __webpack_require__(7655); + +/** + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * + * @function Phaser.Geom.Rectangle.GetPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle to get the perimeter point from. + * @param {number} position - The normalized distance into the Rectangle's perimeter to return. + * @param {(Phaser.Geom.Point|object)} [out] - An object to update with the `x` and `y` coordinates of the point. + * + * @return {Phaser.Geom.Point} The updated `output` object, or a new Point if no `output` object was given. + */ +var GetPoint = function (rectangle, position, out) +{ + if (out === undefined) { out = new Point(); } + + if (position <= 0 || position >= 1) + { + out.x = rectangle.x; + out.y = rectangle.y; + + return out; + } + + var p = Perimeter(rectangle) * position; + + if (position > 0.5) + { + p -= (rectangle.width + rectangle.height); + + if (p <= rectangle.width) + { + // Face 3 + out.x = rectangle.right - p; + out.y = rectangle.bottom; + } + else + { + // Face 4 + out.x = rectangle.x; + out.y = rectangle.bottom - (p - rectangle.width); + } + } + else if (p <= rectangle.width) + { + // Face 1 + out.x = rectangle.x + p; + out.y = rectangle.y; + } + else + { + // Face 2 + out.x = rectangle.right; + out.y = rectangle.y + (p - rectangle.width); + } + + return out; +}; + +module.exports = GetPoint; + + +/***/ }), + +/***/ 8151: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetPoint = __webpack_require__(716); +var Perimeter = __webpack_require__(7120); + +/** + * Return an array of points from the perimeter of the rectangle, each spaced out based on the quantity or step required. + * + * @function Phaser.Geom.Rectangle.GetPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point[]} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from. + * @param {number} step - Step between points. Used to calculate the number of points to return when quantity is falsey. Ignored if quantity is positive. + * @param {number} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points. + * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in. + * + * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle. + */ +var GetPoints = function (rectangle, quantity, stepRate, out) +{ + if (out === undefined) { out = []; } + + // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead. + if (!quantity && stepRate > 0) + { + quantity = Perimeter(rectangle) / stepRate; + } + + for (var i = 0; i < quantity; i++) + { + var position = i / quantity; + + out.push(GetPoint(rectangle, position)); + } + + return out; +}; + +module.exports = GetPoints; + + +/***/ }), + +/***/ 7120: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the perimeter of a Rectangle. + * + * @function Phaser.Geom.Rectangle.Perimeter + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to use. + * + * @return {number} The perimeter of the Rectangle, equal to `(width * 2) + (height * 2)`. + */ +var Perimeter = function (rect) +{ + return 2 * (rect.width + rect.height); +}; + +module.exports = Perimeter; + + +/***/ }), + +/***/ 2161: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(7655); /** * Returns a random point within a Rectangle. @@ -56277,8 +43170,9 @@ module.exports = Random; /***/ }), -/* 328 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 1392: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -56286,402 +43180,1123 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapMask = __webpack_require__(329); -var GeometryMask = __webpack_require__(332); - -/** - * Provides methods used for getting and setting the mask of a Game Object. - * - * @namespace Phaser.GameObjects.Components.Mask - * @since 3.0.0 - */ - -var Mask = { - - /** - * The Mask this Game Object is using during render. - * - * @name Phaser.GameObjects.Components.Mask#mask - * @type {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} - * @since 3.0.0 - */ - mask: null, - - /** - * Sets the mask that this Game Object will use to render with. - * - * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. - * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. - * - * If a mask is already set on this Game Object it will be immediately replaced. - * - * Masks are positioned in global space and are not relative to the Game Object to which they - * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * - * Masks have no impact on physics or input detection. They are purely a rendering component - * that allows you to limit what is visible during the render pass. - * - * @method Phaser.GameObjects.Components.Mask#setMask - * @since 3.6.2 - * - * @param {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} mask - The mask this Game Object will use when rendering. - * - * @return {this} This Game Object instance. - */ - setMask: function (mask) - { - this.mask = mask; - - return this; - }, - - /** - * Clears the mask that this Game Object was using. - * - * @method Phaser.GameObjects.Components.Mask#clearMask - * @since 3.6.2 - * - * @param {boolean} [destroyMask=false] - Destroy the mask before clearing it? - * - * @return {this} This Game Object instance. - */ - clearMask: function (destroyMask) - { - if (destroyMask === undefined) { destroyMask = false; } - - if (destroyMask && this.mask) - { - this.mask.destroy(); - } - - this.mask = null; - - return this; - }, - - /** - * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, - * including this one, or a Dynamic Texture. - * - * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. - * - * To create the mask you need to pass in a reference to a renderable Game Object. - * A renderable Game Object is one that uses a texture to render with, such as an - * Image, Sprite, Render Texture or BitmapText. - * - * If you do not provide a renderable object, and this Game Object has a texture, - * it will use itself as the object. This means you can call this method to create - * a Bitmap Mask from any renderable texture-based Game Object. - * - * @method Phaser.GameObjects.Components.Mask#createBitmapMask - * @since 3.6.2 - * - * @generic {Phaser.GameObjects.GameObject} G - * @generic {Phaser.Textures.DynamicTexture} T - * @genericUse {(G|T|null)} [maskObject] - * - * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Dynamic Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. - * @param {number} [x] - If creating a Game Object, the horizontal position in the world. - * @param {number} [y] - If creating a Game Object, the vertical position in the world. - * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. - * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. - * - * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created. - */ - createBitmapMask: function (maskObject, x, y, texture, frame) - { - if (maskObject === undefined && (this.texture || this.shader || this.geom)) - { - // eslint-disable-next-line consistent-this - maskObject = this; - } - - return new BitmapMask(this.scene, maskObject, x, y, texture, frame); - }, - - /** - * Creates and returns a Geometry Mask. This mask can be used by any Game Object, - * including this one. - * - * To create the mask you need to pass in a reference to a Graphics Game Object. - * - * If you do not provide a graphics object, and this Game Object is an instance - * of a Graphics object, then it will use itself to create the mask. - * - * This means you can call this method to create a Geometry Mask from any Graphics Game Object. - * - * @method Phaser.GameObjects.Components.Mask#createGeometryMask - * @since 3.6.2 - * - * @generic {Phaser.GameObjects.Graphics} G - * @generic {Phaser.GameObjects.Shape} S - * @genericUse {(G|S)} [graphics] - * - * @param {Phaser.GameObjects.Graphics|Phaser.GameObjects.Shape} [graphics] - A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask. - * - * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. - */ - createGeometryMask: function (graphics) - { - if (graphics === undefined && (this.type === 'Graphics' || this.geom)) - { - // eslint-disable-next-line consistent-this - graphics = this; - } - - return new GeometryMask(this.scene, graphics); - } - -}; - -module.exports = Mask; - - -/***/ }), -/* 329 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var GameObjectFactory = __webpack_require__(330); +var Class = __webpack_require__(7473); +var Contains = __webpack_require__(5956); +var GetPoint = __webpack_require__(716); +var GetPoints = __webpack_require__(8151); +var GEOM_CONST = __webpack_require__(1643); +var Line = __webpack_require__(284); +var Random = __webpack_require__(2161); /** * @classdesc - * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. - * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask, - * not a clipping path. It is only available when using the WebGL Renderer. + * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height) * - * A Bitmap Mask can use any Game Object or Dynamic Texture to determine the alpha of each pixel of the masked Game Object(s). - * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha - * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the - * Bitmap Mask doesn't matter. - * - * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an - * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means - * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects - * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the - * corresponding pixel in the mask. - * - * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, - * combine Geometry Masks and Blend Modes together. - * - * The Bitmap Mask's location matches the location of its Game Object, not the location of the - * masked objects. Moving or transforming the underlying Game Object will change the mask - * (and affect the visibility of any masked objects), whereas moving or transforming a masked object - * will not affect the mask. - * - * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a - * Scene's display list, it will only be used for the mask and its full texture will not be directly - * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will - * render as a normal Game Object and will also serve as a mask. - * - * @class BitmapMask - * @memberof Phaser.Display.Masks + * @class Rectangle + * @memberof Phaser.Geom * @constructor * @since 3.0.0 * - * @param {Phaser.Scene} scene - The Scene to which this mask is being added. - * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Dynamic Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. - * @param {number} [x] - If creating a Game Object, the horizontal position in the world. - * @param {number} [y] - If creating a Game Object, the vertical position in the world. - * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. - * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. + * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. + * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. + * @param {number} [width=0] - The width of the Rectangle. + * @param {number} [height=0] - The height of the Rectangle. */ -var BitmapMask = new Class({ +var Rectangle = new Class({ initialize: - function BitmapMask (scene, maskObject, x, y, texture, frame) + function Rectangle (x, y, width, height) { - if (!maskObject) + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = 0; } + if (height === undefined) { height = 0; } + + /** + * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Rectangle#type + * @type {number} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.RECTANGLE; + + /** + * The X coordinate of the top left corner of the Rectangle. + * + * @name Phaser.Geom.Rectangle#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = x; + + /** + * The Y coordinate of the top left corner of the Rectangle. + * + * @name Phaser.Geom.Rectangle#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = y; + + /** + * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. + * + * @name Phaser.Geom.Rectangle#width + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.width = width; + + /** + * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. + * + * @name Phaser.Geom.Rectangle#height + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.height = height; + }, + + /** + * Checks if the given point is inside the Rectangle's bounds. + * + * @method Phaser.Geom.Rectangle#contains + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. + * + * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. + */ + contains: function (x, y) + { + return Contains(this, x, y); + }, + + /** + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * + * @method Phaser.Geom.Rectangle#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [output,$return] + * + * @param {number} position - The normalized distance into the Rectangle's perimeter to return. + * @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point. + * + * @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given. + */ + getPoint: function (position, output) + { + return GetPoint(this, position, output); + }, + + /** + * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. + * + * @method Phaser.Geom.Rectangle#getPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point[]} O - [output,$return] + * + * @param {number} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. + * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points. + * + * @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided. + */ + getPoints: function (quantity, stepRate, output) + { + return GetPoints(this, quantity, stepRate, output); + }, + + /** + * Returns a random point within the Rectangle's bounds. + * + * @method Phaser.Geom.Rectangle#getRandomPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [point,$return] + * + * @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point. + * + * @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided. + */ + getRandomPoint: function (point) + { + return Random(this, point); + }, + + /** + * Sets the position, width, and height of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setTo + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the top left corner of the Rectangle. + * @param {number} y - The Y coordinate of the top left corner of the Rectangle. + * @param {number} width - The width of the Rectangle. + * @param {number} height - The height of the Rectangle. + * + * @return {this} This Rectangle object. + */ + setTo: function (x, y, width, height) + { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + + return this; + }, + + /** + * Resets the position, width, and height of the Rectangle to 0. + * + * @method Phaser.Geom.Rectangle#setEmpty + * @since 3.0.0 + * + * @return {this} This Rectangle object. + */ + setEmpty: function () + { + return this.setTo(0, 0, 0, 0); + }, + + /** + * Sets the position of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setPosition + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the top left corner of the Rectangle. + * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. + * + * @return {this} This Rectangle object. + */ + setPosition: function (x, y) + { + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + }, + + /** + * Sets the width and height of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setSize + * @since 3.0.0 + * + * @param {number} width - The width to set the Rectangle to. + * @param {number} [height=width] - The height to set the Rectangle to. + * + * @return {this} This Rectangle object. + */ + setSize: function (width, height) + { + if (height === undefined) { height = width; } + + this.width = width; + this.height = height; + + return this; + }, + + /** + * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. + * + * @method Phaser.Geom.Rectangle#isEmpty + * @since 3.0.0 + * + * @return {boolean} `true` if the Rectangle is empty. A Rectangle object is empty if its width or height is less than or equal to 0. + */ + isEmpty: function () + { + return (this.width <= 0 || this.height <= 0); + }, + + /** + * Returns a Line object that corresponds to the top of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineA + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle. + */ + getLineA: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.x, this.y, this.right, this.y); + + return line; + }, + + /** + * Returns a Line object that corresponds to the right of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineB + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle. + */ + getLineB: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.right, this.y, this.right, this.bottom); + + return line; + }, + + /** + * Returns a Line object that corresponds to the bottom of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineC + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle. + */ + getLineC: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.right, this.bottom, this.x, this.bottom); + + return line; + }, + + /** + * Returns a Line object that corresponds to the left of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineD + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle. + */ + getLineD: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.x, this.bottom, this.x, this.y); + + return line; + }, + + /** + * The x coordinate of the left of the Rectangle. + * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. + * + * @name Phaser.Geom.Rectangle#left + * @type {number} + * @since 3.0.0 + */ + left: { + + get: function () { - maskObject = scene.sys.make.image({ x: x, y: y, key: texture, frame: frame, add: false }); + return this.x; + }, + + set: function (value) + { + if (value >= this.right) + { + this.width = 0; + } + else + { + this.width = this.right - value; + } + + this.x = value; + } + + }, + + /** + * The sum of the x and width properties. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. + * + * @name Phaser.Geom.Rectangle#right + * @type {number} + * @since 3.0.0 + */ + right: { + + get: function () + { + return this.x + this.width; + }, + + set: function (value) + { + if (value <= this.x) + { + this.width = 0; + } + else + { + this.width = value - this.x; + } + } + + }, + + /** + * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. + * However it does affect the height property, whereas changing the y value does not affect the height property. + * + * @name Phaser.Geom.Rectangle#top + * @type {number} + * @since 3.0.0 + */ + top: { + + get: function () + { + return this.y; + }, + + set: function (value) + { + if (value >= this.bottom) + { + this.height = 0; + } + else + { + this.height = (this.bottom - value); + } + + this.y = value; + } + + }, + + /** + * The sum of the y and height properties. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. + * + * @name Phaser.Geom.Rectangle#bottom + * @type {number} + * @since 3.0.0 + */ + bottom: { + + get: function () + { + return this.y + this.height; + }, + + set: function (value) + { + if (value <= this.y) + { + this.height = 0; + } + else + { + this.height = value - this.y; + } + } + + }, + + /** + * The x coordinate of the center of the Rectangle. + * + * @name Phaser.Geom.Rectangle#centerX + * @type {number} + * @since 3.0.0 + */ + centerX: { + + get: function () + { + return this.x + (this.width / 2); + }, + + set: function (value) + { + this.x = value - (this.width / 2); + } + + }, + + /** + * The y coordinate of the center of the Rectangle. + * + * @name Phaser.Geom.Rectangle#centerY + * @type {number} + * @since 3.0.0 + */ + centerY: { + + get: function () + { + return this.y + (this.height / 2); + }, + + set: function (value) + { + this.y = value - (this.height / 2); + } + + } + +}); + +module.exports = Rectangle; + + +/***/ }), + +/***/ 9422: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(1392); + +/** + * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union. + * + * @function Phaser.Geom.Rectangle.Union + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to use. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to use. + * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the union in. + * + * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided. + */ +var Union = function (rectA, rectB, out) +{ + if (out === undefined) { out = new Rectangle(); } + + // Cache vars so we can use one of the input rects as the output rect + var x = Math.min(rectA.x, rectB.x); + var y = Math.min(rectA.y, rectB.y); + var w = Math.max(rectA.right, rectB.right) - x; + var h = Math.max(rectA.bottom, rectB.bottom) - y; + + return out.setTo(x, y, w, h); +}; + +module.exports = Union; + + +/***/ }), + +/***/ 1593: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var CONST = __webpack_require__(4359); +var Events = __webpack_require__(1179); +var GetFastValue = __webpack_require__(4597); +var GetURL = __webpack_require__(5593); +var MergeXHRSettings = __webpack_require__(7410); +var XHRLoader = __webpack_require__(5874); +var XHRSettings = __webpack_require__(707); + +/** + * @classdesc + * The base File class used by all File Types that the Loader can support. + * You shouldn't create an instance of a File directly, but should extend it with your own class, setting a custom type and processing methods. + * + * @class File + * @memberof Phaser.Loader + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. + * @param {Phaser.Types.Loader.FileConfig} fileConfig - The file configuration object, as created by the file type. + */ +var File = new Class({ + + initialize: + + function File (loader, fileConfig) + { + /** + * A reference to the Loader that is going to load this file. + * + * @name Phaser.Loader.File#loader + * @type {Phaser.Loader.LoaderPlugin} + * @since 3.0.0 + */ + this.loader = loader; + + /** + * A reference to the Cache, or Texture Manager, that is going to store this file if it loads. + * + * @name Phaser.Loader.File#cache + * @type {(Phaser.Cache.BaseCache|Phaser.Textures.TextureManager)} + * @since 3.7.0 + */ + this.cache = GetFastValue(fileConfig, 'cache', false); + + /** + * The file type string (image, json, etc) for sorting within the Loader. + * + * @name Phaser.Loader.File#type + * @type {string} + * @since 3.0.0 + */ + this.type = GetFastValue(fileConfig, 'type', false); + + if (!this.type) + { + throw new Error('Invalid File type: ' + this.type); } /** - * The Game Object that is used as the mask. Must use a texture, such as a Sprite. + * Unique cache key (unique within its file type) * - * @name Phaser.Display.Masks.BitmapMask#bitmapMask - * @type {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} + * @name Phaser.Loader.File#key + * @type {string} * @since 3.0.0 */ - this.bitmapMask = maskObject; + this.key = GetFastValue(fileConfig, 'key', false); + + var loadKey = this.key; + + if (loader.prefix && loader.prefix !== '') + { + this.key = loader.prefix + loadKey; + } + + if (!this.key) + { + throw new Error('Invalid File key: ' + this.key); + } + + var url = GetFastValue(fileConfig, 'url'); + + if (url === undefined) + { + url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); + } + else if (typeof url === 'string' && !url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)) + { + url = loader.path + url; + } /** - * Whether to invert the masks alpha. + * The URL of the file, not including baseURL. * - * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. + * Automatically has Loader.path prepended to it if a string. * - * Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. + * Can also be a JavaScript Object, such as the results of parsing JSON data. * - * @name Phaser.Display.Masks.BitmapMask#invertAlpha - * @type {boolean} - * @since 3.1.2 + * @name Phaser.Loader.File#url + * @type {object|string} + * @since 3.0.0 */ - this.invertAlpha = false; + this.url = url; /** - * Is this mask a stencil mask? This is false by default and should not be changed. + * The final URL this file will load from, including baseURL and path. + * Set automatically when the Loader calls 'load' on this file. * - * @name Phaser.Display.Masks.BitmapMask#isStencil - * @type {boolean} - * @readonly - * @since 3.17.0 + * @name Phaser.Loader.File#src + * @type {string} + * @since 3.0.0 */ - this.isStencil = false; + this.src = ''; + + /** + * The merged XHRSettings for this file. + * + * @name Phaser.Loader.File#xhrSettings + * @type {Phaser.Types.Loader.XHRSettingsObject} + * @since 3.0.0 + */ + this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined)); + + if (GetFastValue(fileConfig, 'xhrSettings', false)) + { + this.xhrSettings = MergeXHRSettings(this.xhrSettings, GetFastValue(fileConfig, 'xhrSettings', {})); + } + + /** + * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File. + * + * @name Phaser.Loader.File#xhrLoader + * @type {?XMLHttpRequest} + * @since 3.0.0 + */ + this.xhrLoader = null; + + /** + * The current state of the file. One of the FILE_CONST values. + * + * @name Phaser.Loader.File#state + * @type {number} + * @since 3.0.0 + */ + this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING; + + /** + * The total size of this file. + * Set by onProgress and only if loading via XHR. + * + * @name Phaser.Loader.File#bytesTotal + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.bytesTotal = 0; + + /** + * Updated as the file loads. + * Only set if loading via XHR. + * + * @name Phaser.Loader.File#bytesLoaded + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.bytesLoaded = -1; + + /** + * A percentage value between 0 and 1 indicating how much of this file has loaded. + * Only set if loading via XHR. + * + * @name Phaser.Loader.File#percentComplete + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.percentComplete = -1; + + /** + * For CORs based loading. + * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set) + * + * @name Phaser.Loader.File#crossOrigin + * @type {(string|undefined)} + * @since 3.0.0 + */ + this.crossOrigin = undefined; + + /** + * The processed file data, stored here after the file has loaded. + * + * @name Phaser.Loader.File#data + * @type {*} + * @since 3.0.0 + */ + this.data = undefined; + + /** + * A config object that can be used by file types to store transitional data. + * + * @name Phaser.Loader.File#config + * @type {*} + * @since 3.0.0 + */ + this.config = GetFastValue(fileConfig, 'config', {}); + + /** + * If this is a multipart file, i.e. an atlas and its json together, then this is a reference + * to the parent MultiFile. Set and used internally by the Loader or specific file types. + * + * @name Phaser.Loader.File#multiFile + * @type {?Phaser.Loader.MultiFile} + * @since 3.7.0 + */ + this.multiFile; + + /** + * Does this file have an associated linked file? Such as an image and a normal map. + * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't + * actually bound by data, where-as a linkFile is. + * + * @name Phaser.Loader.File#linkFile + * @type {?Phaser.Loader.File} + * @since 3.7.0 + */ + this.linkFile; }, /** - * Sets a new Game Object or Dynamic Texture for this Bitmap Mask to use. + * Links this File with another, so they depend upon each other for loading and processing. * - * If a Game Object it must have a texture, such as a Sprite. + * @method Phaser.Loader.File#setLink + * @since 3.7.0 * - * You can update the source of the mask as often as you like. + * @param {Phaser.Loader.File} fileB - The file to link to this one. + */ + setLink: function (fileB) + { + this.linkFile = fileB; + + fileB.linkFile = this; + }, + + /** + * Resets the XHRLoader instance this file is using. * - * @method Phaser.Display.Masks.BitmapMask#setBitmap + * @method Phaser.Loader.File#resetXHR + * @since 3.0.0 + */ + resetXHR: function () + { + if (this.xhrLoader) + { + this.xhrLoader.onload = undefined; + this.xhrLoader.onerror = undefined; + this.xhrLoader.onprogress = undefined; + } + }, + + /** + * Called by the Loader, starts the actual file downloading. + * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. + * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. + * + * @method Phaser.Loader.File#load + * @since 3.0.0 + */ + load: function () + { + if (this.state === CONST.FILE_POPULATED) + { + // Can happen for example in a JSONFile if they've provided a JSON object instead of a URL + this.loader.nextFile(this, true); + } + else + { + this.state = CONST.FILE_LOADING; + + this.src = GetURL(this, this.loader.baseURL); + + if (this.src.indexOf('data:') === 0) + { + console.warn('Local data URIs are not supported: ' + this.key); + } + else + { + // The creation of this XHRLoader starts the load process going. + // It will automatically call the following, based on the load outcome: + // + // xhr.onload = this.onLoad + // xhr.onerror = this.onError + // xhr.onprogress = this.onProgress + + this.xhrLoader = XHRLoader(this, this.loader.xhr); + } + } + }, + + /** + * Called when the file finishes loading, is sent a DOM ProgressEvent. + * + * @method Phaser.Loader.File#onLoad * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} maskObject - The Game Object or Dynamic Texture that will be used as the mask. If a Game Object, it must have a texture, such as a Sprite. + * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event. + * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load. */ - setBitmap: function (maskObject) + onLoad: function (xhr, event) { - this.bitmapMask = maskObject; + var isLocalFile = xhr.responseURL && this.loader.localSchemes.some(function (scheme) + { + return xhr.responseURL.indexOf(scheme) === 0; + }); + + var localFileOk = (isLocalFile && event.target.status === 0); + + var success = !(event.target && event.target.status !== 200) || localFileOk; + + // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called. + if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599) + { + success = false; + } + + this.state = CONST.FILE_LOADED; + + this.resetXHR(); + + this.loader.nextFile(this, success); }, /** - * Prepares the WebGL Renderer to render a Game Object with this mask applied. + * Called if the file errors while loading, is sent a DOM ProgressEvent. * - * This renders the masking Game Object to the mask framebuffer and switches to the main framebuffer so that the masked Game Object will be rendered to it instead of being rendered directly to the frame. - * - * @method Phaser.Display.Masks.BitmapMask#preRenderWebGL + * @method Phaser.Loader.File#onError * @since 3.0.0 * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to prepare. - * @param {Phaser.GameObjects.GameObject} maskedObject - The masked Game Object which will be drawn. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. + * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event. + * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this error. */ - preRenderWebGL: function (renderer, maskedObject, camera) + onError: function () { - renderer.pipelines.BITMAPMASK_PIPELINE.beginMask(this, maskedObject, camera); + this.resetXHR(); + + this.loader.nextFile(this, false); }, /** - * Finalizes rendering of a masked Game Object. + * Called during the file load progress. Is sent a DOM ProgressEvent. * - * This resets the previously bound framebuffer and switches the WebGL Renderer to the Bitmap Mask Pipeline, which uses a special fragment shader to apply the masking effect. - * - * @method Phaser.Display.Masks.BitmapMask#postRenderWebGL + * @method Phaser.Loader.File#onProgress + * @fires Phaser.Loader.Events#FILE_PROGRESS * @since 3.0.0 * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to clean up. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. - * @param {Phaser.Renderer.WebGL.RenderTarget} [renderTarget] - Optional WebGL RenderTarget. + * @param {ProgressEvent} event - The DOM ProgressEvent. */ - postRenderWebGL: function (renderer, camera, renderTarget) + onProgress: function (event) { - renderer.pipelines.BITMAPMASK_PIPELINE.endMask(this, camera, renderTarget); + if (event.lengthComputable) + { + this.bytesLoaded = event.loaded; + this.bytesTotal = event.total; + + this.percentComplete = Math.min((this.bytesLoaded / this.bytesTotal), 1); + + this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete); + } }, /** - * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * Usually overridden by the FileTypes and is called by Loader.nextFile. + * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage. * - * @method Phaser.Display.Masks.BitmapMask#preRenderCanvas + * @method Phaser.Loader.File#onProcess * @since 3.0.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to. - * @param {Phaser.GameObjects.GameObject} mask - The masked Game Object which would be rendered. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. */ - preRenderCanvas: function () + onProcess: function () { - // NOOP + this.state = CONST.FILE_PROCESSING; + + this.onProcessComplete(); }, /** - * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * Called when the File has completed processing. + * Checks on the state of its multifile, if set. * - * @method Phaser.Display.Masks.BitmapMask#postRenderCanvas - * @since 3.0.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to. + * @method Phaser.Loader.File#onProcessComplete + * @since 3.7.0 */ - postRenderCanvas: function () + onProcessComplete: function () { - // NOOP + this.state = CONST.FILE_COMPLETE; + + if (this.multiFile) + { + this.multiFile.onFileComplete(this); + } + + this.loader.fileProcessComplete(this); }, /** - * Destroys this BitmapMask and nulls any references it holds. + * Called when the File has completed processing but it generated an error. + * Checks on the state of its multifile, if set. * - * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, - * so be sure to call `clearMask` on any Game Object using it, before destroying it. + * @method Phaser.Loader.File#onProcessError + * @since 3.7.0 + */ + onProcessError: function () + { + // eslint-disable-next-line no-console + console.error('Failed to process file: %s "%s"', this.type, this.key); + + this.state = CONST.FILE_ERRORED; + + if (this.multiFile) + { + this.multiFile.onFileFailed(this); + } + + this.loader.fileProcessComplete(this); + }, + + /** + * Checks if a key matching the one used by this file exists in the target Cache or not. + * This is called automatically by the LoaderPlugin to decide if the file can be safely + * loaded or will conflict. * - * @method Phaser.Display.Masks.BitmapMask#destroy + * @method Phaser.Loader.File#hasCacheConflict + * @since 3.7.0 + * + * @return {boolean} `true` if adding this file will cause a conflict, otherwise `false`. + */ + hasCacheConflict: function () + { + return (this.cache && this.cache.exists(this.key)); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * This method is often overridden by specific file types. + * + * @method Phaser.Loader.File#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + if (this.cache && this.data) + { + this.cache.add(this.key, this.data); + } + }, + + /** + * Called once the file has been added to its cache and is now ready for deletion from the Loader. + * It will emit a `filecomplete` event from the LoaderPlugin. + * + * @method Phaser.Loader.File#pendingDestroy + * @fires Phaser.Loader.Events#FILE_COMPLETE + * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE + * @since 3.7.0 + */ + pendingDestroy: function (data) + { + if (this.state === CONST.FILE_PENDING_DESTROY) + { + return; + } + + if (data === undefined) { data = this.data; } + + var key = this.key; + var type = this.type; + + this.loader.emit(Events.FILE_COMPLETE, key, type, data); + this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data); + + this.loader.flagForRemoval(this); + + this.state = CONST.FILE_PENDING_DESTROY; + }, + + /** + * Destroy this File and any references it holds. + * + * @method Phaser.Loader.File#destroy * @since 3.7.0 */ destroy: function () { - this.bitmapMask = null; + this.loader = null; + this.cache = null; + this.xhrSettings = null; + this.multiFile = null; + this.linkFile = null; + this.data = null; } }); /** - * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. - * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask, - * not a clipping path. It is only available when using the WebGL Renderer. + * Static method for creating object URL using URL API and setting it as image 'src' attribute. + * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader. * - * A Bitmap Mask can use any Game Object, or Dynamic Texture, to determine the alpha of each pixel of the masked Game Object(s). - * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha - * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the - * Bitmap Mask doesn't matter. + * @method Phaser.Loader.File.createObjectURL + * @static + * @since 3.7.0 * - * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an - * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means - * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects - * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the - * corresponding pixel in the mask. - * - * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, - * combine Geometry Masks and Blend Modes together. - * - * The Bitmap Mask's location matches the location of its Game Object, not the location of the - * masked objects. Moving or transforming the underlying Game Object will change the mask - * (and affect the visibility of any masked objects), whereas moving or transforming a masked object - * will not affect the mask. - * - * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a - * Scene's display list, it will only be used for the mask and its full texture will not be directly - * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will - * render as a normal Game Object and will also serve as a mask. - * - * @method Phaser.GameObjects.GameObjectFactory#bitmapMask - * @since 3.60.0 - * - * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. - * @param {number} [x] - If creating a Game Object, the horizontal position in the world. - * @param {number} [y] - If creating a Game Object, the vertical position in the world. - * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. - * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. - * - * @return {Phaser.Display.Masks.BitmapMask} The Bitmap Mask that was created. + * @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL. + * @param {Blob} blob - A Blob object to create an object URL for. + * @param {string} defaultType - Default mime type used if blob type is not available. */ -GameObjectFactory.register('bitmapMask', function (maskObject, x, y, key, frame) +File.createObjectURL = function (image, blob, defaultType) { - return new BitmapMask(this.scene, maskObject, x, y, key, frame); -}); + if (typeof URL === 'function') + { + image.src = URL.createObjectURL(blob); + } + else + { + var reader = new FileReader(); -module.exports = BitmapMask; + reader.onload = function () + { + image.removeAttribute('crossOrigin'); + image.src = 'data:' + (blob.type || defaultType) + ';base64,' + reader.result.split(',')[1]; + }; + + reader.onerror = image.onerror; + + reader.readAsDataURL(blob); + } +}; + +/** + * Static method for releasing an existing object URL which was previously created + * by calling {@link File#createObjectURL} method. + * + * @method Phaser.Loader.File.revokeObjectURL + * @static + * @since 3.7.0 + * + * @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked. + */ +File.revokeObjectURL = function (image) +{ + if (typeof URL === 'function') + { + URL.revokeObjectURL(image.src); + } +}; + +module.exports = File; /***/ }), -/* 330 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 9845: +/***/ ((module) => { /** * @author Richard Davey @@ -56689,232 +44304,13484 @@ module.exports = BitmapMask; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(331); -var SceneEvents = __webpack_require__(23); +var types = {}; /** - * @classdesc - * The Game Object Factory is a Scene plugin that allows you to quickly create many common - * types of Game Objects and have them automatically registered with the Scene. - * - * Game Objects directly register themselves with the Factory and inject their own creation - * methods into the class. - * - * @class GameObjectFactory - * @memberof Phaser.GameObjects - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object Factory belongs. + * @namespace Phaser.Loader.FileTypesManager */ -var GameObjectFactory = new Class({ - initialize: - - function GameObjectFactory (scene) - { - /** - * The Scene to which this Game Object Factory belongs. - * - * @name Phaser.GameObjects.GameObjectFactory#scene - * @type {Phaser.Scene} - * @protected - * @since 3.0.0 - */ - this.scene = scene; - - /** - * A reference to the Scene.Systems. - * - * @name Phaser.GameObjects.GameObjectFactory#systems - * @type {Phaser.Scenes.Systems} - * @protected - * @since 3.0.0 - */ - this.systems = scene.sys; - - /** - * A reference to the Scene Event Emitter. - * - * @name Phaser.GameObjects.GameObjectFactory#events - * @type {Phaser.Events.EventEmitter} - * @protected - * @since 3.50.0 - */ - this.events = scene.sys.events; - - /** - * A reference to the Scene Display List. - * - * @name Phaser.GameObjects.GameObjectFactory#displayList - * @type {Phaser.GameObjects.DisplayList} - * @protected - * @since 3.0.0 - */ - this.displayList; - - /** - * A reference to the Scene Update List. - * - * @name Phaser.GameObjects.GameObjectFactory#updateList - * @type {Phaser.GameObjects.UpdateList} - * @protected - * @since 3.0.0 - */ - this.updateList; - - this.events.once(SceneEvents.BOOT, this.boot, this); - this.events.on(SceneEvents.START, this.start, this); - }, +var FileTypesManager = { /** - * This method is called automatically, only once, when the Scene is first created. - * Do not invoke it directly. + * Static method called when a LoaderPlugin is created. * - * @method Phaser.GameObjects.GameObjectFactory#boot - * @private - * @since 3.5.1 - */ - boot: function () - { - this.displayList = this.systems.displayList; - this.updateList = this.systems.updateList; - - this.events.once(SceneEvents.DESTROY, this.destroy, this); - }, - - /** - * This method is called automatically by the Scene when it is starting up. - * It is responsible for creating local systems, properties and listening for Scene events. - * Do not invoke it directly. + * Loops through the local types object and injects all of them as + * properties into the LoaderPlugin instance. * - * @method Phaser.GameObjects.GameObjectFactory#start - * @private - * @since 3.5.0 - */ - start: function () - { - this.events.once(SceneEvents.SHUTDOWN, this.shutdown, this); - }, - - /** - * Adds an existing Game Object to this Scene. - * - * If the Game Object renders, it will be added to the Display List. - * If it has a `preUpdate` method, it will be added to the Update List. - * - * @method Phaser.GameObjects.GameObjectFactory#existing + * @method Phaser.Loader.FileTypesManager.install * @since 3.0.0 * - * @generic {(Phaser.GameObjects.GameObject|Phaser.GameObjects.Group|Phaser.GameObjects.Layer)} G - [child,$return] - * - * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.Group|Phaser.GameObjects.Layer)} child - The child to be added to this Scene. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that was added. + * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into. */ - existing: function (child) + install: function (loader) { - if (child.renderCanvas || child.renderWebGL) + for (var key in types) { - this.displayList.add(child); + loader[key] = types[key]; } - - // For when custom objects have overridden `preUpdate` but don't hook into the ADDED_TO_SCENE event: - // Adding to the list multiple times is safe, as it won't add duplicates into the list anyway. - if (child.preUpdate) - { - this.updateList.add(child); - } - - return child; }, /** - * The Scene that owns this plugin is shutting down. - * We need to kill and reset all internal properties as well as stop listening to Scene events. + * Static method called directly by the File Types. * - * @method Phaser.GameObjects.GameObjectFactory#shutdown - * @private + * The key is a reference to the function used to load the files via the Loader, i.e. `image`. + * + * @method Phaser.Loader.FileTypesManager.register * @since 3.0.0 + * + * @param {string} key - The key that will be used as the method name in the LoaderPlugin. + * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked. */ - shutdown: function () + register: function (key, factoryFunction) { - this.events.off(SceneEvents.SHUTDOWN, this.shutdown, this); + types[key] = factoryFunction; }, /** - * The Scene that owns this plugin is being destroyed. - * We need to shutdown and then kill off all external references. + * Removed all associated file types. * - * @method Phaser.GameObjects.GameObjectFactory#destroy - * @private + * @method Phaser.Loader.FileTypesManager.destroy * @since 3.0.0 */ destroy: function () { - this.shutdown(); + types = {}; + } - this.events.off(SceneEvents.START, this.start, this); +}; - this.scene = null; - this.systems = null; - this.events = null; +module.exports = FileTypesManager; - this.displayList = null; - this.updateList = null; + +/***/ }), + +/***/ 5593: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Given a File and a baseURL value this returns the URL the File will use to download from. + * + * @function Phaser.Loader.GetURL + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - The File object. + * @param {string} baseURL - A default base URL. + * + * @return {string} The URL the File will use. + */ +var GetURL = function (file, baseURL) +{ + if (!file.url) + { + return false; + } + + if (file.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)) + { + return file.url; + } + else + { + return baseURL + file.url; + } +}; + +module.exports = GetURL; + + +/***/ }), + +/***/ 7410: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(1030); +var XHRSettings = __webpack_require__(707); + +/** + * Takes two XHRSettings Objects and creates a new XHRSettings object from them. + * + * The new object is seeded by the values given in the global settings, but any setting in + * the local object overrides the global ones. + * + * @function Phaser.Loader.MergeXHRSettings + * @since 3.0.0 + * + * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object. + * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object. + */ +var MergeXHRSettings = function (global, local) +{ + var output = (global === undefined) ? XHRSettings() : Extend({}, global); + + if (local) + { + for (var setting in local) + { + if (local[setting] !== undefined) + { + output[setting] = local[setting]; + } + } + } + + return output; +}; + +module.exports = MergeXHRSettings; + + +/***/ }), + +/***/ 3137: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var CONST = __webpack_require__(4359); +var Events = __webpack_require__(1179); + +/** + * @classdesc + * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after + * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. + * + * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. + * + * @class MultiFile + * @memberof Phaser.Loader + * @constructor + * @since 3.7.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. + * @param {string} type - The file type string for sorting within the Loader. + * @param {string} key - The key of the file within the loader. + * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile. + */ +var MultiFile = new Class({ + + initialize: + + function MultiFile (loader, type, key, files) + { + var finalFiles = []; + + // Clean out any potential 'null' or 'undefined' file entries + files.forEach(function (file) + { + if (file) + { + finalFiles.push(file); + } + }); + + /** + * A reference to the Loader that is going to load this file. + * + * @name Phaser.Loader.MultiFile#loader + * @type {Phaser.Loader.LoaderPlugin} + * @since 3.7.0 + */ + this.loader = loader; + + /** + * The file type string for sorting within the Loader. + * + * @name Phaser.Loader.MultiFile#type + * @type {string} + * @since 3.7.0 + */ + this.type = type; + + /** + * Unique cache key (unique within its file type) + * + * @name Phaser.Loader.MultiFile#key + * @type {string} + * @since 3.7.0 + */ + this.key = key; + + /** + * The current index being used by multi-file loaders to avoid key clashes. + * + * @name Phaser.Loader.MultiFile#multiKeyIndex + * @type {number} + * @private + * @since 3.20.0 + */ + this.multiKeyIndex = loader.multiKeyIndex++; + + /** + * Array of files that make up this MultiFile. + * + * @name Phaser.Loader.MultiFile#files + * @type {Phaser.Loader.File[]} + * @since 3.7.0 + */ + this.files = finalFiles; + + /** + * The current state of the file. One of the FILE_CONST values. + * + * @name Phaser.Loader.MultiFile#state + * @type {number} + * @since 3.60.0 + */ + this.state = CONST.FILE_PENDING; + + /** + * The completion status of this MultiFile. + * + * @name Phaser.Loader.MultiFile#complete + * @type {boolean} + * @default false + * @since 3.7.0 + */ + this.complete = false; + + /** + * The number of files to load. + * + * @name Phaser.Loader.MultiFile#pending + * @type {number} + * @since 3.7.0 + */ + + this.pending = finalFiles.length; + + /** + * The number of files that failed to load. + * + * @name Phaser.Loader.MultiFile#failed + * @type {number} + * @default 0 + * @since 3.7.0 + */ + this.failed = 0; + + /** + * A storage container for transient data that the loading files need. + * + * @name Phaser.Loader.MultiFile#config + * @type {any} + * @since 3.7.0 + */ + this.config = {}; + + /** + * A reference to the Loaders baseURL at the time this MultiFile was created. + * Used to populate child-files. + * + * @name Phaser.Loader.MultiFile#baseURL + * @type {string} + * @since 3.20.0 + */ + this.baseURL = loader.baseURL; + + /** + * A reference to the Loaders path at the time this MultiFile was created. + * Used to populate child-files. + * + * @name Phaser.Loader.MultiFile#path + * @type {string} + * @since 3.20.0 + */ + this.path = loader.path; + + /** + * A reference to the Loaders prefix at the time this MultiFile was created. + * Used to populate child-files. + * + * @name Phaser.Loader.MultiFile#prefix + * @type {string} + * @since 3.20.0 + */ + this.prefix = loader.prefix; + + // Link the files + for (var i = 0; i < finalFiles.length; i++) + { + finalFiles[i].multiFile = this; + } + }, + + /** + * Checks if this MultiFile is ready to process its children or not. + * + * @method Phaser.Loader.MultiFile#isReadyToProcess + * @since 3.7.0 + * + * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`. + */ + isReadyToProcess: function () + { + return (this.pending === 0 && this.failed === 0 && !this.complete); + }, + + /** + * Adds another child to this MultiFile, increases the pending count and resets the completion status. + * + * @method Phaser.Loader.MultiFile#addToMultiFile + * @since 3.7.0 + * + * @param {Phaser.Loader.File} files - The File to add to this MultiFile. + * + * @return {Phaser.Loader.MultiFile} This MultiFile instance. + */ + addToMultiFile: function (file) + { + this.files.push(file); + + file.multiFile = this; + + this.pending++; + + this.complete = false; + + return this; + }, + + /** + * Called by each File when it finishes loading. + * + * @method Phaser.Loader.MultiFile#onFileComplete + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The File that has completed processing. + */ + onFileComplete: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.pending--; + } + }, + + /** + * Called by each File that fails to load. + * + * @method Phaser.Loader.MultiFile#onFileFailed + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The File that has failed to load. + */ + onFileFailed: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.failed++; + + // eslint-disable-next-line no-console + console.error('File failed: %s "%s" (via %s "%s")', this.type, this.key, file.type, file.key); + } + }, + + /** + * Called once all children of this multi file have been added to their caches and is now + * ready for deletion from the Loader. + * + * It will emit a `filecomplete` event from the LoaderPlugin. + * + * @method Phaser.Loader.MultiFile#pendingDestroy + * @fires Phaser.Loader.Events#FILE_COMPLETE + * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE + * @since 3.60.0 + */ + pendingDestroy: function () + { + if (this.state === CONST.FILE_PENDING_DESTROY) + { + return; + } + + var key = this.key; + var type = this.type; + + this.loader.emit(Events.FILE_COMPLETE, key, type); + this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type); + + this.loader.flagForRemoval(this); + + for (var i = 0; i < this.files.length; i++) + { + this.files[i].pendingDestroy(); + } + + this.state = CONST.FILE_PENDING_DESTROY; + }, + + /** + * Destroy this Multi File and any references it holds. + * + * @method Phaser.Loader.MultiFile#destroy + * @since 3.60.0 + */ + destroy: function () + { + this.loader = null; + this.files = null; + this.config = null; + } + +}); + +module.exports = MultiFile; + + +/***/ }), + +/***/ 5874: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MergeXHRSettings = __webpack_require__(7410); + +/** + * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings + * and starts the download of it. It uses the Files own XHRSettings and merges them + * with the global XHRSettings object to set the xhr values before download. + * + * @function Phaser.Loader.XHRLoader + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - The File to download. + * @param {Phaser.Types.Loader.XHRSettingsObject} globalXHRSettings - The global XHRSettings object. + * + * @return {XMLHttpRequest} The XHR object. + */ +var XHRLoader = function (file, globalXHRSettings) +{ + var config = MergeXHRSettings(globalXHRSettings, file.xhrSettings); + + var xhr = new XMLHttpRequest(); + + xhr.open('GET', file.src, config.async, config.user, config.password); + + xhr.responseType = file.xhrSettings.responseType; + xhr.timeout = config.timeout; + + if (config.headers) + { + for (var key in config.headers) + { + xhr.setRequestHeader(key, config.headers[key]); + } + } + + if (config.header && config.headerValue) + { + xhr.setRequestHeader(config.header, config.headerValue); + } + + if (config.requestedWith) + { + xhr.setRequestHeader('X-Requested-With', config.requestedWith); + } + + if (config.overrideMimeType) + { + xhr.overrideMimeType(config.overrideMimeType); + } + + if (config.withCredentials) + { + xhr.withCredentials = true; + } + + // After a successful request, the xhr.response property will contain the requested data as a DOMString, ArrayBuffer, Blob, or Document (depending on what was set for responseType.) + + xhr.onload = file.onLoad.bind(file, xhr); + xhr.onerror = file.onError.bind(file, xhr); + xhr.onprogress = file.onProgress.bind(file); + + // This is the only standard method, the ones above are browser additions (maybe not universal?) + // xhr.onreadystatechange + + xhr.send(); + + return xhr; +}; + +module.exports = XHRLoader; + + +/***/ }), + +/***/ 707: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Creates an XHRSettings Object with default values. + * + * @function Phaser.Loader.XHRSettings + * @since 3.0.0 + * + * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'. + * @param {boolean} [async=true] - Should the XHR request use async or not? + * @param {string} [user=''] - Optional username for the XHR request. + * @param {string} [password=''] - Optional password for the XHR request. + * @param {number} [timeout=0] - Optional XHR timeout value. + * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. + */ +var XHRSettings = function (responseType, async, user, password, timeout, withCredentials) +{ + if (responseType === undefined) { responseType = ''; } + if (async === undefined) { async = true; } + if (user === undefined) { user = ''; } + if (password === undefined) { password = ''; } + if (timeout === undefined) { timeout = 0; } + if (withCredentials === undefined) { withCredentials = false; } + + // Before sending a request, set the xhr.responseType to "text", + // "arraybuffer", "blob", or "document", depending on your data needs. + // Note, setting xhr.responseType = '' (or omitting) will default the response to "text". + + return { + + // Ignored by the Loader, only used by File. + responseType: responseType, + + async: async, + + // credentials + user: user, + password: password, + + // timeout in ms (0 = no timeout) + timeout: timeout, + + // setRequestHeader + headers: undefined, + header: undefined, + headerValue: undefined, + requestedWith: false, + + // overrideMimeType + overrideMimeType: undefined, + + // withCredentials + withCredentials: withCredentials + + }; +}; + +module.exports = XHRSettings; + + +/***/ }), + +/***/ 4359: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FILE_CONST = { + + /** + * The Loader is idle. + * + * @name Phaser.Loader.LOADER_IDLE + * @type {number} + * @since 3.0.0 + */ + LOADER_IDLE: 0, + + /** + * The Loader is actively loading. + * + * @name Phaser.Loader.LOADER_LOADING + * @type {number} + * @since 3.0.0 + */ + LOADER_LOADING: 1, + + /** + * The Loader is processing files is has loaded. + * + * @name Phaser.Loader.LOADER_PROCESSING + * @type {number} + * @since 3.0.0 + */ + LOADER_PROCESSING: 2, + + /** + * The Loader has completed loading and processing. + * + * @name Phaser.Loader.LOADER_COMPLETE + * @type {number} + * @since 3.0.0 + */ + LOADER_COMPLETE: 3, + + /** + * The Loader is shutting down. + * + * @name Phaser.Loader.LOADER_SHUTDOWN + * @type {number} + * @since 3.0.0 + */ + LOADER_SHUTDOWN: 4, + + /** + * The Loader has been destroyed. + * + * @name Phaser.Loader.LOADER_DESTROYED + * @type {number} + * @since 3.0.0 + */ + LOADER_DESTROYED: 5, + + /** + * File is in the load queue but not yet started. + * + * @name Phaser.Loader.FILE_PENDING + * @type {number} + * @since 3.0.0 + */ + FILE_PENDING: 10, + + /** + * File has been started to load by the loader (onLoad called) + * + * @name Phaser.Loader.FILE_LOADING + * @type {number} + * @since 3.0.0 + */ + FILE_LOADING: 11, + + /** + * File has loaded successfully, awaiting processing. + * + * @name Phaser.Loader.FILE_LOADED + * @type {number} + * @since 3.0.0 + */ + FILE_LOADED: 12, + + /** + * File failed to load. + * + * @name Phaser.Loader.FILE_FAILED + * @type {number} + * @since 3.0.0 + */ + FILE_FAILED: 13, + + /** + * File is being processed (onProcess callback) + * + * @name Phaser.Loader.FILE_PROCESSING + * @type {number} + * @since 3.0.0 + */ + FILE_PROCESSING: 14, + + /** + * The File has errored somehow during processing. + * + * @name Phaser.Loader.FILE_ERRORED + * @type {number} + * @since 3.0.0 + */ + FILE_ERRORED: 16, + + /** + * File has finished processing. + * + * @name Phaser.Loader.FILE_COMPLETE + * @type {number} + * @since 3.0.0 + */ + FILE_COMPLETE: 17, + + /** + * File has been destroyed. + * + * @name Phaser.Loader.FILE_DESTROYED + * @type {number} + * @since 3.0.0 + */ + FILE_DESTROYED: 18, + + /** + * File was populated from local data and doesn't need an HTTP request. + * + * @name Phaser.Loader.FILE_POPULATED + * @type {number} + * @since 3.0.0 + */ + FILE_POPULATED: 19, + + /** + * File is pending being destroyed. + * + * @name Phaser.Loader.FILE_PENDING_DESTROY + * @type {number} + * @since 3.60.0 + */ + FILE_PENDING_DESTROY: 20 + +}; + +module.exports = FILE_CONST; + + +/***/ }), + +/***/ 462: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Add File Event. + * + * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue. + * + * Listen to it from a Scene using: `this.load.on('addfile', listener)`. + * + * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them. + * + * @event Phaser.Loader.Events#ADD + * @type {string} + * @since 3.0.0 + * + * @param {string} key - The unique key of the file that was added to the Loader. + * @param {string} type - The [file type]{@link Phaser.Loader.File#type} string of the file that was added to the Loader, i.e. `image`. + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @param {Phaser.Loader.File} file - A reference to the File which was added to the Loader. + */ +module.exports = 'addfile'; + + +/***/ }), + +/***/ 7297: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Complete Event. + * + * This event is dispatched when the Loader has fully processed everything in the load queue. + * By this point every loaded file will now be in its associated cache and ready for use. + * + * Listen to it from a Scene using: `this.load.on('complete', listener)`. + * + * @event Phaser.Loader.Events#COMPLETE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @param {number} totalComplete - The total number of files that successfully loaded. + * @param {number} totalFailed - The total number of files that failed to load. + */ +module.exports = 'complete'; + + +/***/ }), + +/***/ 8660: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Complete Event. + * + * This event is dispatched by the Loader Plugin when _any_ file in the queue finishes loading. + * + * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`. + * + * Make sure you remove this listener when you have finished, or it will continue to fire if the Scene reloads. + * + * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. + * + * @event Phaser.Loader.Events#FILE_COMPLETE + * @type {string} + * @since 3.0.0 + * + * @param {string} key - The key of the file that just loaded and finished processing. + * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. + * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. + */ +module.exports = 'filecomplete'; + + +/***/ }), + +/***/ 6484: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Complete Event. + * + * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. + * + * It uses a special dynamic event name constructed from the key and type of the file. + * + * For example, if you have loaded an `image` with a key of `monster`, you can listen for it + * using the following: + * + * ```javascript + * this.load.on('filecomplete-image-monster', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Or, if you have loaded a texture `atlas` with a key of `Level1`: + * + * ```javascript + * this.load.on('filecomplete-atlasjson-Level1', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`: + * + * ```javascript + * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Make sure you remove your listeners when you have finished, or they will continue to fire if the Scene reloads. + * + * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event. + * + * @event Phaser.Loader.Events#FILE_KEY_COMPLETE + * @type {string} + * @since 3.0.0 + * + * @param {string} key - The key of the file that just loaded and finished processing. + * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. + * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. + */ +module.exports = 'filecomplete-'; + + +/***/ }), + +/***/ 7972: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Error Event. + * + * This event is dispatched by the Loader Plugin when a file fails to load. + * + * Listen to it from a Scene using: `this.load.on('loaderror', listener)`. + * + * @event Phaser.Loader.Events#FILE_LOAD_ERROR + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + */ +module.exports = 'loaderror'; + + +/***/ }), + +/***/ 1906: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Event. + * + * This event is dispatched by the Loader Plugin when a file finishes loading, + * but _before_ it is processed and added to the internal Phaser caches. + * + * Listen to it from a Scene using: `this.load.on('load', listener)`. + * + * @event Phaser.Loader.Events#FILE_LOAD + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which just finished loading. + */ +module.exports = 'load'; + + +/***/ }), + +/***/ 1441: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Progress Event. + * + * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and + * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen. + * + * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`. + * + * @event Phaser.Loader.Events#FILE_PROGRESS + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + * @param {number} percentComplete - A value between 0 and 1 indicating how 'complete' this file is. + */ +module.exports = 'fileprogress'; + + +/***/ }), + +/***/ 1072: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Post Process Event. + * + * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue. + * It is dispatched before the internal lists are cleared and each File is destroyed. + * + * Use this hook to perform any last minute processing of files that can only happen once the + * Loader has completed, but prior to it emitting the `complete` event. + * + * Listen to it from a Scene using: `this.load.on('postprocess', listener)`. + * + * @event Phaser.Loader.Events#POST_PROCESS + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'postprocess'; + + +/***/ }), + +/***/ 1927: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Progress Event. + * + * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading. + * + * Listen to it from a Scene using: `this.load.on('progress', listener)`. + * + * @event Phaser.Loader.Events#PROGRESS + * @type {string} + * @since 3.0.0 + * + * @param {number} progress - The current progress of the load. A value between 0 and 1. + */ +module.exports = 'progress'; + + +/***/ }), + +/***/ 6597: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Start Event. + * + * This event is dispatched when the Loader starts running. At this point load progress is zero. + * + * This event is dispatched even if there aren't any files in the load queue. + * + * Listen to it from a Scene using: `this.load.on('start', listener)`. + * + * @event Phaser.Loader.Events#START + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'start'; + + +/***/ }), + +/***/ 1179: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Loader.Events + */ + +module.exports = { + + ADD: __webpack_require__(462), + COMPLETE: __webpack_require__(7297), + FILE_COMPLETE: __webpack_require__(8660), + FILE_KEY_COMPLETE: __webpack_require__(6484), + FILE_LOAD_ERROR: __webpack_require__(7972), + FILE_LOAD: __webpack_require__(1906), + FILE_PROGRESS: __webpack_require__(1441), + POST_PROCESS: __webpack_require__(1072), + PROGRESS: __webpack_require__(1927), + START: __webpack_require__(6597) + +}; + + +/***/ }), + +/***/ 6732: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var CONST = __webpack_require__(4359); +var File = __webpack_require__(1593); +var FileTypesManager = __webpack_require__(9845); +var GetFastValue = __webpack_require__(4597); +var IsPlainObject = __webpack_require__(2482); +var GetURL = __webpack_require__(5593); + +/** + * @classdesc + * A single Image File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image. + * + * @class ImageFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets. + */ +var ImageFile = new Class({ + + Extends: File, + + initialize: + + function ImageFile (loader, key, url, xhrSettings, frameConfig) + { + var extension = 'png'; + var normalMapURL; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + normalMapURL = GetFastValue(config, 'normalMap'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + frameConfig = GetFastValue(config, 'frameConfig'); + } + + if (Array.isArray(url)) + { + normalMapURL = url[1]; + url = url[0]; + } + + var fileConfig = { + type: 'image', + cache: loader.textureManager, + extension: extension, + responseType: 'blob', + key: key, + url: url, + xhrSettings: xhrSettings, + config: frameConfig + }; + + File.call(this, loader, fileConfig); + + // Do we have a normal map to load as well? + if (normalMapURL) + { + var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig); + + normalMap.type = 'normalMap'; + + this.setLink(normalMap); + + loader.addFile(normalMap); + } + + this.useImageElementLoad = loader.imageLoadType === 'HTMLImageElement'; + + if (this.useImageElementLoad) + { + this.load = this.loadImage; + this.onProcess = this.onProcessImage; + } + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.ImageFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = new Image(); + + this.data.crossOrigin = this.crossOrigin; + + var _this = this; + + this.data.onload = function () + { + File.revokeObjectURL(_this.data); + + _this.onProcessComplete(); + }; + + this.data.onerror = function () + { + File.revokeObjectURL(_this.data); + + _this.onProcessError(); + }; + + File.createObjectURL(this.data, this.xhrLoader.response, 'image/png'); + }, + + /** + * Handles image load processing. + * + * @method Phaser.Loader.FileTypes.ImageFile#onProcessImage + * @private + * @since 3.60.0 + */ + onProcessImage: function () + { + var result = this.state; + + this.state = CONST.FILE_PROCESSING; + + if (result === CONST.FILE_LOADED) + { + this.onProcessComplete(); + } + else + { + this.onProcessError(); + } + }, + + /** + * Loads the image using either XHR or an Image tag. + * + * @method Phaser.Loader.FileTypes.ImageFile#loadImage + * @private + * @since 3.60.0 + */ + loadImage: function () + { + this.state = CONST.FILE_LOADING; + + this.src = GetURL(this, this.loader.baseURL); + + if (this.src.indexOf('data:') === 0) + { + console.warn('Local data URIs are not supported: ' + this.key); + } + else + { + this.data = new Image(); + + this.data.crossOrigin = this.crossOrigin; + + var _this = this; + + this.data.onload = function () + { + _this.state = CONST.FILE_LOADED; + + _this.loader.nextFile(_this, true); + }; + + this.data.onerror = function () + { + _this.loader.nextFile(_this, false); + }; + + this.data.src = this.src; + } + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.ImageFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + // Check if we have a linked normal map + var linkFile = this.linkFile; + + if (linkFile) + { + // We do, but has it loaded? + if (linkFile.state >= CONST.FILE_COMPLETE) + { + // Both files have loaded + if (this.type === 'normalMap') + { + // linkFile.data = Image + // this.data = Normal Map + this.cache.addImage(this.key, linkFile.data, this.data); + } + else + { + // linkFile.data = Normal Map + // this.data = Image + this.cache.addImage(this.key, this.data, linkFile.data); + } + } + + // Nothing to do here, we'll use the linkFile `addToCache` call + // to process this pair + } + else + { + this.cache.addImage(this.key, this.data); + } } }); /** - * Static method called directly by the Game Object factory functions. - * With this method you can register a custom GameObject factory in the GameObjectFactory, - * providing a name (`factoryType`) and the constructor (`factoryFunction`) in order - * to be called when you call to Phaser.Scene.add[ factoryType ] method. + * Adds an Image, or array of Images, to the current load queue. * - * @method Phaser.GameObjects.GameObjectFactory.register - * @static + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.image('logo', 'images/phaserLogo.png'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback + * of animated gifs to Canvas elements. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.image('logo', 'images/AtariLogo.png'); + * // and later in your game ... + * this.add.image(x, y, 'logo'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png', + * normalMap: 'images/AtariLogo-n.png' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * In Phaser 3.60 a new property was added that allows you to control how images are loaded. By default, images are loaded via XHR as Blobs. + * However, you can set `loader.imageLoadType: "HTMLImageElement"` in the Game Configuration and instead, the Loader will load all images + * via the Image tag instead. + * + * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#image + * @fires Phaser.Loader.LoaderPlugin#ADD * @since 3.0.0 * - * @param {string} factoryType - The key of the factory that you will use to call to Phaser.Scene.add[ factoryType ] method. - * @param {function} factoryFunction - The constructor function to be called when you invoke to the Phaser.Scene.add method. - */ -GameObjectFactory.register = function (factoryType, factoryFunction) -{ - if (!GameObjectFactory.prototype.hasOwnProperty(factoryType)) - { - GameObjectFactory.prototype[factoryType] = factoryFunction; - } -}; - -/** - * Static method called directly by the Game Object factory functions. - * With this method you can remove a custom GameObject factory registered in the GameObjectFactory, - * providing a its `factoryType`. + * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig|Phaser.Types.Loader.FileTypes.ImageFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * - * @method Phaser.GameObjects.GameObjectFactory.remove - * @static - * @since 3.0.0 - * - * @param {string} factoryType - The key of the factory that you want to remove from the GameObjectFactory. + * @return {this} The Loader instance. */ -GameObjectFactory.remove = function (factoryType) +FileTypesManager.register('image', function (key, url, xhrSettings) { - if (GameObjectFactory.prototype.hasOwnProperty(factoryType)) + if (Array.isArray(key)) { - delete GameObjectFactory.prototype[factoryType]; + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new ImageFile(this, key[i])); + } + } + else + { + this.addFile(new ImageFile(this, key, url, xhrSettings)); } -}; -PluginCache.register('GameObjectFactory', GameObjectFactory, 'add'); + return this; +}); -module.exports = GameObjectFactory; +module.exports = ImageFile; /***/ }), -/* 331 */ -/***/ (function(module, exports) { + +/***/ 704: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var CONST = __webpack_require__(4359); +var File = __webpack_require__(1593); +var FileTypesManager = __webpack_require__(9845); +var GetFastValue = __webpack_require__(4597); +var GetValue = __webpack_require__(5851); +var IsPlainObject = __webpack_require__(2482); + +/** + * @classdesc + * A single JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. + * + * @class JSONFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + */ +var JSONFile = new Class({ + + Extends: File, + + initialize: + + // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object + // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing + + function JSONFile (loader, key, url, xhrSettings, dataKey) + { + var extension = 'json'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + dataKey = GetFastValue(config, 'dataKey', dataKey); + } + + var fileConfig = { + type: 'json', + cache: loader.cacheManager.json, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings, + config: dataKey + }; + + File.call(this, loader, fileConfig); + + // A JSON object has been provided (instead of a URL), so we'll use it directly as the File.data. No need to load it. + if (IsPlainObject(url)) + { + if (dataKey) + { + this.data = GetValue(url, dataKey); + } + else + { + this.data = url; + } + + this.state = CONST.FILE_POPULATED; + } + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.JSONFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + if (this.state !== CONST.FILE_POPULATED) + { + this.state = CONST.FILE_PROCESSING; + + try + { + var json = JSON.parse(this.xhrLoader.responseText); + } + catch (e) + { + this.onProcessError(); + + throw e; + } + + var key = this.config; + + if (typeof key === 'string') + { + this.data = GetValue(json, key, json); + } + else + { + this.data = json; + } + } + + this.onProcessComplete(); + } + +}); + +/** + * Adds a JSON file, or array of JSON files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.json({ + * key: 'wavedata', + * url: 'files/AlienWaveData.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * // and later in your game ... + * var data = this.cache.json.get('wavedata'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#json + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {this} The Loader instance. + */ +FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new JSONFile(this, key[i])); + } + } + else + { + this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); + } + + return this; +}); + +module.exports = JSONFile; + + +/***/ }), + +/***/ 1192: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var CONST = __webpack_require__(4359); +var File = __webpack_require__(1593); +var FileTypesManager = __webpack_require__(9845); +var GetFastValue = __webpack_require__(4597); +var IsPlainObject = __webpack_require__(2482); + +/** + * @classdesc + * A single Text File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text. + * + * @class TextFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var TextFile = new Class({ + + Extends: File, + + initialize: + + function TextFile (loader, key, url, xhrSettings) + { + var type = 'text'; + var extension = 'txt'; + var cache = loader.cacheManager.text; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + type = GetFastValue(config, 'type', type); + cache = GetFastValue(config, 'cache', cache); + } + + var fileConfig = { + type: type, + cache: cache, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.TextFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = this.xhrLoader.responseText; + + this.onProcessComplete(); + } + +}); + +/** + * Adds a Text file, or array of Text files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.text('story', 'files/IntroStory.txt'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Text Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.text({ + * key: 'story', + * url: 'files/IntroStory.txt' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.text('story', 'files/IntroStory.txt'); + * // and later in your game ... + * var data = this.cache.text.get('story'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Text Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.txt". It will always add `.txt` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#text + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig|Phaser.Types.Loader.FileTypes.TextFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {this} The Loader instance. + */ +FileTypesManager.register('text', function (key, url, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new TextFile(this, key[i])); + } + } + else + { + this.addFile(new TextFile(this, key, url, xhrSettings)); + } + + return this; +}); + +module.exports = TextFile; + + +/***/ }), + +/***/ 3136: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the mean average of the given values. + * + * @function Phaser.Math.Average + * @since 3.0.0 + * + * @param {number[]} values - The values to average. + * + * @return {number} The average value. + */ +var Average = function (values) +{ + var sum = 0; + + for (var i = 0; i < values.length; i++) + { + sum += (+values[i]); + } + + return sum / values.length; +}; + +module.exports = Average; + + +/***/ }), + +/***/ 785: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Factorial = __webpack_require__(3916); + +/** + * Calculates the Bernstein basis from the three factorial coefficients. + * + * @function Phaser.Math.Bernstein + * @since 3.0.0 + * + * @param {number} n - The first value. + * @param {number} i - The second value. + * + * @return {number} The Bernstein basis of Factorial(n) / Factorial(i) / Factorial(n - i) + */ +var Bernstein = function (n, i) +{ + return Factorial(n) / Factorial(i) / Factorial(n - i); +}; + +module.exports = Bernstein; + + +/***/ }), + +/***/ 7025: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random integer between the `min` and `max` values, inclusive. + * + * @function Phaser.Math.Between + * @since 3.0.0 + * + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. + * + * @return {number} The random integer. + */ +var Between = function (min, max) +{ + return Math.floor(Math.random() * (max - min + 1) + min); +}; + +module.exports = Between; + + +/***/ }), + +/***/ 48: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a Catmull-Rom value from the given points, based on an alpha of 0.5. + * + * @function Phaser.Math.CatmullRom + * @since 3.0.0 + * + * @param {number} t - The amount to interpolate by. + * @param {number} p0 - The first control point. + * @param {number} p1 - The second control point. + * @param {number} p2 - The third control point. + * @param {number} p3 - The fourth control point. + * + * @return {number} The Catmull-Rom value. + */ +var CatmullRom = function (t, p0, p1, p2, p3) +{ + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + var t2 = t * t; + var t3 = t * t2; + + return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1; +}; + +module.exports = CatmullRom; + + +/***/ }), + +/***/ 5035: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Ceils to some place comparative to a `base`, default is 10 for decimal place. + * + * The `place` is represented by the power applied to `base` to get that place. + * + * @function Phaser.Math.CeilTo + * @since 3.0.0 + * + * @param {number} value - The value to round. + * @param {number} [place=0] - The place to round to. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. + * + * @return {number} The rounded value. + */ +var CeilTo = function (value, place, base) +{ + if (place === undefined) { place = 0; } + if (base === undefined) { base = 10; } + + var p = Math.pow(base, -place); + + return Math.ceil(value * p) / p; +}; + +module.exports = CeilTo; + + +/***/ }), + +/***/ 2915: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Force a value within the boundaries by clamping it to the range `min`, `max`. + * + * @function Phaser.Math.Clamp + * @since 3.0.0 + * + * @param {number} value - The value to be clamped. + * @param {number} min - The minimum bounds. + * @param {number} max - The maximum bounds. + * + * @return {number} The clamped value. + */ +var Clamp = function (value, min, max) +{ + return Math.max(min, Math.min(max, value)); +}; + +module.exports = Clamp; + + +/***/ }), + +/***/ 7149: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(7425); + +/** + * Convert the given angle from degrees, to the equivalent angle in radians. + * + * @function Phaser.Math.DegToRad + * @since 3.0.0 + * + * @param {number} degrees - The angle (in degrees) to convert to radians. + * + * @return {number} The given angle converted to radians. + */ +var DegToRad = function (degrees) +{ + return degrees * CONST.DEG_TO_RAD; +}; + +module.exports = DegToRad; + + +/***/ }), + +/***/ 2975: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the positive difference of two given numbers. + * + * @function Phaser.Math.Difference + * @since 3.0.0 + * + * @param {number} a - The first number in the calculation. + * @param {number} b - The second number in the calculation. + * + * @return {number} The positive difference of the two given numbers. + */ +var Difference = function (a, b) +{ + return Math.abs(a - b); +}; + +module.exports = Difference; + + +/***/ }), + +/***/ 2107: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(2915); +var Class = __webpack_require__(7473); +var Matrix4 = __webpack_require__(9652); +var NOOP = __webpack_require__(1984); + +var tempMatrix = new Matrix4(); + +/** + * @classdesc + * + * @class Euler + * @memberof Phaser.Math + * @constructor + * @since 3.50.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Euler = new Class({ + + initialize: + + function Euler (x, y, z, order) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (z === undefined) { z = 0; } + if (order === undefined) { order = Euler.DefaultOrder; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback = NOOP; + }, + + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + order: { + get: function () + { + return this._order; + }, + + set: function (value) + { + this._order = value; + + this.onChangeCallback(this); + } + }, + + set: function (x, y, z, order) + { + if (order === undefined) { order = this._order; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback(this); + + return this; + }, + + copy: function (euler) + { + return this.set(euler.x, euler.y, euler.z, euler.order); + }, + + setFromQuaternion: function (quaternion, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + tempMatrix.fromQuat(quaternion); + + return this.setFromRotationMatrix(tempMatrix, order, update); + }, + + setFromRotationMatrix: function (matrix, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + var elements = matrix.val; + + // Upper 3x3 of matrix is un-scaled rotation matrix + var m11 = elements[0]; + var m12 = elements[4]; + var m13 = elements[8]; + var m21 = elements[1]; + var m22 = elements[5]; + var m23 = elements[9]; + var m31 = elements[2]; + var m32 = elements[6]; + var m33 = elements[10]; + + var x = 0; + var y = 0; + var z = 0; + var epsilon = 0.99999; + + switch (order) + { + case 'XYZ': + { + y = Math.asin(Clamp(m13, -1, 1)); + + if (Math.abs(m13) < epsilon) + { + x = Math.atan2(-m23, m33); + z = Math.atan2(-m12, m11); + } + else + { + x = Math.atan2(m32, m22); + } + + break; + } + + case 'YXZ': + { + x = Math.asin(-Clamp(m23, -1, 1)); + + if (Math.abs(m23) < epsilon) + { + y = Math.atan2(m13, m33); + z = Math.atan2(m21, m22); + } + else + { + y = Math.atan2(-m31, m11); + } + + break; + } + + case 'ZXY': + { + x = Math.asin(Clamp(m32, -1, 1)); + + if (Math.abs(m32) < epsilon) + { + y = Math.atan2(-m31, m33); + z = Math.atan2(-m12, m22); + } + else + { + z = Math.atan2(m21, m11); + } + + break; + } + + case 'ZYX': + { + y = Math.asin(-Clamp(m31, -1, 1)); + + if (Math.abs(m31) < epsilon) + { + x = Math.atan2(m32, m33); + z = Math.atan2(m21, m11); + } + else + { + z = Math.atan2(-m12, m22); + } + + break; + } + + case 'YZX': + { + z = Math.asin(Clamp(m21, -1, 1)); + + if (Math.abs(m21) < epsilon) + { + x = Math.atan2(-m23, m22); + y = Math.atan2(-m31, m11); + } + else + { + y = Math.atan2(m13, m33); + } + + break; + } + + case 'XZY': + { + z = Math.asin(-Clamp(m12, -1, 1)); + + if (Math.abs(m12) < epsilon) + { + x = Math.atan2(m32, m22); + y = Math.atan2(m13, m11); + } + else + { + x = Math.atan2(-m23, m33); + } + + break; + } + } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + if (update) + { + this.onChangeCallback(this); + } + + return this; + } + +}); + +Euler.RotationOrders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ]; + +Euler.DefaultOrder = 'XYZ'; + +module.exports = Euler; + + +/***/ }), + +/***/ 3916: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the factorial of a given number for integer values greater than 0. + * + * @function Phaser.Math.Factorial + * @since 3.0.0 + * + * @param {number} value - A positive integer to calculate the factorial of. + * + * @return {number} The factorial of the given number. + */ +var Factorial = function (value) +{ + if (value === 0) + { + return 1; + } + + var res = value; + + while (--value) + { + res *= value; + } + + return res; +}; + +module.exports = Factorial; + + +/***/ }), + +/***/ 104: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Generate a random floating point number between the two given bounds, minimum inclusive, maximum exclusive. + * + * @function Phaser.Math.FloatBetween + * @since 3.0.0 + * + * @param {number} min - The lower bound for the float, inclusive. + * @param {number} max - The upper bound for the float exclusive. + * + * @return {number} A random float within the given range. + */ +var FloatBetween = function (min, max) +{ + return Math.random() * (max - min) + min; +}; + +module.exports = FloatBetween; + + +/***/ }), + +/***/ 4941: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Floors to some place comparative to a `base`, default is 10 for decimal place. + * + * The `place` is represented by the power applied to `base` to get that place. + * + * @function Phaser.Math.FloorTo + * @since 3.0.0 + * + * @param {number} value - The value to round. + * @param {number} [place=0] - The place to round to. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. + * + * @return {number} The rounded value. + */ +var FloorTo = function (value, place, base) +{ + if (place === undefined) { place = 0; } + if (base === undefined) { base = 10; } + + var p = Math.pow(base, -place); + + return Math.floor(value * p) / p; +}; + +module.exports = FloorTo; + + +/***/ }), + +/***/ 1555: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(2915); + +/** + * Return a value based on the range between `min` and `max` and the percentage given. + * + * @function Phaser.Math.FromPercent + * @since 3.0.0 + * + * @param {number} percent - A value between 0 and 1 representing the percentage. + * @param {number} min - The minimum value. + * @param {number} [max] - The maximum value. + * + * @return {number} The value that is `percent` percent between `min` and `max`. + */ +var FromPercent = function (percent, min, max) +{ + percent = Clamp(percent, 0, 1); + + return (max - min) * percent + min; +}; + +module.exports = FromPercent; + + +/***/ }), + +/***/ 5005: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate a per-ms speed from a distance and time (given in seconds). + * + * @function Phaser.Math.GetSpeed + * @since 3.0.0 + * + * @param {number} distance - The distance. + * @param {number} time - The time, in seconds. + * + * @return {number} The speed, in distance per ms. + * + * @example + * // 400px over 1 second is 0.4 px/ms + * Phaser.Math.GetSpeed(400, 1) // -> 0.4 + */ +var GetSpeed = function (distance, time) +{ + return (distance / time) / 1000; +}; + +module.exports = GetSpeed; + + +/***/ }), + +/***/ 3702: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check if a given value is an even number. + * + * @function Phaser.Math.IsEven + * @since 3.0.0 + * + * @param {number} value - The number to perform the check with. + * + * @return {boolean} Whether the number is even or not. + */ +var IsEven = function (value) +{ + // Use abstract equality == for "is number" test + + // eslint-disable-next-line eqeqeq + return (value == parseFloat(value)) ? !(value % 2) : void 0; +}; + +module.exports = IsEven; + + +/***/ }), + +/***/ 8820: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check if a given value is an even number using a strict type check. + * + * @function Phaser.Math.IsEvenStrict + * @since 3.0.0 + * + * @param {number} value - The number to perform the check with. + * + * @return {boolean} Whether the number is even or not. + */ +var IsEvenStrict = function (value) +{ + // Use strict equality === for "is number" test + return (value === parseFloat(value)) ? !(value % 2) : void 0; +}; + +module.exports = IsEvenStrict; + + +/***/ }), + +/***/ 1743: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a linear (interpolation) value over t. + * + * @function Phaser.Math.Linear + * @since 3.0.0 + * + * @param {number} p0 - The first point. + * @param {number} p1 - The second point. + * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1. + * + * @return {number} The step t% of the way between p0 and p1. + */ +var Linear = function (p0, p1, t) +{ + return (p1 - p0) * t + p0; +}; + +module.exports = Linear; + + +/***/ }), + +/***/ 3416: +/***/ ((module) => { + +/** + * @author Greg McLean + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Interpolates two given Vectors and returns a new Vector between them. + * + * Does not modify either of the passed Vectors. + * + * @function Phaser.Math.LinearXY + * @since 3.60.0 + * + * @param {Phaser.Math.Vector2} vector1 - Starting vector + * @param {Phaser.Math.Vector2} vector2 - Ending vector + * @param {number} [t=0] - The percentage between vector1 and vector2 to return, represented as a number between 0 and 1. + * + * @return {Phaser.Math.Vector2} The step t% of the way between vector1 and vector2. + */ +var LinearXY = function (vector1, vector2, t) +{ + if (t === undefined) { t = 0; } + + return vector1.clone().lerp(vector2, t); +}; + +module.exports = LinearXY; + + +/***/ }), + +/***/ 2149: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A three-dimensional matrix. + * + * Defaults to the identity matrix when instantiated. + * + * @class Matrix3 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from. + */ +var Matrix3 = new Class({ + + initialize: + + function Matrix3 (m) + { + /** + * The matrix values. + * + * @name Phaser.Math.Matrix3#val + * @type {Float32Array} + * @since 3.0.0 + */ + this.val = new Float32Array(9); + + if (m) + { + // Assume Matrix3 with val: + this.copy(m); + } + else + { + // Default to identity + this.identity(); + } + }, + + /** + * Make a clone of this Matrix3. + * + * @method Phaser.Math.Matrix3#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} A clone of this Matrix3. + */ + clone: function () + { + return new Matrix3(this); + }, + + /** + * This method is an alias for `Matrix3.copy`. + * + * @method Phaser.Math.Matrix3#set + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * Copy the values of a given Matrix into this Matrix. + * + * @method Phaser.Math.Matrix3#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + copy: function (src) + { + var out = this.val; + var a = src.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + + return this; + }, + + /** + * Copy the values of a given Matrix4 into this Matrix3. + * + * @method Phaser.Math.Matrix3#fromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromMat4: function (m) + { + var a = m.val; + var out = this.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + + return this; + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix3#fromArray + * @since 3.0.0 + * + * @param {array} a - The array to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromArray: function (a) + { + var out = this.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix3#identity + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + identity: function () + { + var out = this.val; + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + + return this; + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix3#transpose + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + transpose: function () + { + var a = this.val; + var a01 = a[1]; + var a02 = a[2]; + var a12 = a[5]; + + a[1] = a[3]; + a[2] = a[6]; + a[3] = a01; + a[5] = a[7]; + a[6] = a02; + a[7] = a12; + + return this; + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix3#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + var b01 = a22 * a11 - a12 * a21; + var b11 = -a22 * a10 + a12 * a20; + var b21 = a21 * a10 - a11 * a20; + + // Calculate the determinant + var det = a00 * b01 + a01 * b11 + a02 * b21; + + if (!det) + { + return null; + } + + det = 1 / det; + + a[0] = b01 * det; + a[1] = (-a22 * a01 + a02 * a21) * det; + a[2] = (a12 * a01 - a02 * a11) * det; + a[3] = b11 * det; + a[4] = (a22 * a00 - a02 * a20) * det; + a[5] = (-a12 * a00 + a02 * a10) * det; + a[6] = b21 * det; + a[7] = (-a21 * a00 + a01 * a20) * det; + a[8] = (a11 * a00 - a01 * a10) * det; + + return this; + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix3#adjoint + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + a[0] = (a11 * a22 - a12 * a21); + a[1] = (a02 * a21 - a01 * a22); + a[2] = (a01 * a12 - a02 * a11); + a[3] = (a12 * a20 - a10 * a22); + a[4] = (a00 * a22 - a02 * a20); + a[5] = (a02 * a10 - a00 * a12); + a[6] = (a10 * a21 - a11 * a20); + a[7] = (a01 * a20 - a00 * a21); + a[8] = (a00 * a11 - a01 * a10); + + return this; + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix3#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix3#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + var b = src.val; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b10 = b[3]; + var b11 = b[4]; + var b12 = b[5]; + var b20 = b[6]; + var b21 = b[7]; + var b22 = b[8]; + + a[0] = b00 * a00 + b01 * a10 + b02 * a20; + a[1] = b00 * a01 + b01 * a11 + b02 * a21; + a[2] = b00 * a02 + b01 * a12 + b02 * a22; + + a[3] = b10 * a00 + b11 * a10 + b12 * a20; + a[4] = b10 * a01 + b11 * a11 + b12 * a21; + a[5] = b10 * a02 + b11 * a12 + b12 * a22; + + a[6] = b20 * a00 + b21 * a10 + b22 * a20; + a[7] = b20 * a01 + b21 * a11 + b22 * a21; + a[8] = b20 * a02 + b21 * a12 + b22 * a22; + + return this; + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix3#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + translate: function (v) + { + var a = this.val; + var x = v.x; + var y = v.y; + + a[6] = x * a[0] + y * a[3] + a[6]; + a[7] = x * a[1] + y * a[4] + a[7]; + a[8] = x * a[2] + y * a[5] + a[8]; + + return this; + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix3#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + rotate: function (rad) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + + var s = Math.sin(rad); + var c = Math.cos(rad); + + a[0] = c * a00 + s * a10; + a[1] = c * a01 + s * a11; + a[2] = c * a02 + s * a12; + + a[3] = c * a10 - s * a00; + a[4] = c * a11 - s * a01; + a[5] = c * a12 - s * a02; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x` and `y` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix3#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + scale: function (v) + { + var a = this.val; + var x = v.x; + var y = v.y; + + a[0] = x * a[0]; + a[1] = x * a[1]; + a[2] = x * a[2]; + + a[3] = y * a[3]; + a[4] = y * a[4]; + a[5] = y * a[5]; + + return this; + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix3#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromQuat: function (q) + { + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + var out = this.val; + + out[0] = 1 - (yy + zz); + out[3] = xy + wz; + out[6] = xz - wy; + + out[1] = xy - wz; + out[4] = 1 - (xx + zz); + out[7] = yz + wx; + + out[2] = xz + wy; + out[5] = yz - wx; + out[8] = 1 - (xx + yy); + + return this; + }, + + /** + * Set the values of this Matrix3 to be normalized from the given Matrix4. + * + * @method Phaser.Math.Matrix3#normalFromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to normalize the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + normalFromMat4: function (m) + { + var a = m.val; + var out = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) + { + return null; + } + + det = 1 / det; + + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + + return this; + } + +}); + +module.exports = Matrix3; + + +/***/ }), + +/***/ 9652: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Vector3 = __webpack_require__(5689); + +/** + * @ignore + */ +var EPSILON = 0.000001; + +/** + * @classdesc + * A four-dimensional matrix. + * + * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji + * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + * + * @class Matrix4 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. + */ +var Matrix4 = new Class({ + + initialize: + + function Matrix4 (m) + { + /** + * The matrix values. + * + * @name Phaser.Math.Matrix4#val + * @type {Float32Array} + * @since 3.0.0 + */ + this.val = new Float32Array(16); + + if (m) + { + // Assume Matrix4 with val: + this.copy(m); + } + else + { + // Default to identity + this.identity(); + } + }, + + /** + * Make a clone of this Matrix4. + * + * @method Phaser.Math.Matrix4#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} A clone of this Matrix4. + */ + clone: function () + { + return new Matrix4(this); + }, + + /** + * This method is an alias for `Matrix4.copy`. + * + * @method Phaser.Math.Matrix4#set + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. + * + * @return {this} This Matrix4. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * Sets all values of this Matrix4. + * + * @method Phaser.Math.Matrix4#setValues + * @since 3.50.0 + * + * @param {number} m00 - The m00 value. + * @param {number} m01 - The m01 value. + * @param {number} m02 - The m02 value. + * @param {number} m03 - The m03 value. + * @param {number} m10 - The m10 value. + * @param {number} m11 - The m11 value. + * @param {number} m12 - The m12 value. + * @param {number} m13 - The m13 value. + * @param {number} m20 - The m20 value. + * @param {number} m21 - The m21 value. + * @param {number} m22 - The m22 value. + * @param {number} m23 - The m23 value. + * @param {number} m30 - The m30 value. + * @param {number} m31 - The m31 value. + * @param {number} m32 - The m32 value. + * @param {number} m33 - The m33 value. + * + * @return {this} This Matrix4 instance. + */ + setValues: function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) + { + var out = this.val; + + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + + return this; + }, + + /** + * Copy the values of a given Matrix into this Matrix. + * + * @method Phaser.Math.Matrix4#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. + * + * @return {this} This Matrix4. + */ + copy: function (src) + { + var a = src.val; + + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix4#fromArray + * @since 3.0.0 + * + * @param {number[]} a - The array to copy the values from. Must have at least 16 elements. + * + * @return {this} This Matrix4. + */ + fromArray: function (a) + { + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Reset this Matrix. + * + * Sets all values to `0`. + * + * @method Phaser.Math.Matrix4#zero + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + zero: function () + { + return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + }, + + /** + * Generates a transform matrix based on the given position, scale and rotation. + * + * @method Phaser.Math.Matrix4#transform + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {Phaser.Math.Vector3} scale - The scale vector. + * @param {Phaser.Math.Quaternion} rotation - The rotation quaternion. + * + * @return {this} This Matrix4. + */ + transform: function (position, scale, rotation) + { + var rotMatrix = _tempMat1.fromQuat(rotation); + + var rm = rotMatrix.val; + + var sx = scale.x; + var sy = scale.y; + var sz = scale.z; + + return this.setValues( + rm[0] * sx, + rm[1] * sx, + rm[2] * sx, + 0, + + rm[4] * sy, + rm[5] * sy, + rm[6] * sy, + 0, + + rm[8] * sz, + rm[9] * sz, + rm[10] * sz, + 0, + + position.x, + position.y, + position.z, + 1 + ); + }, + + /** + * Set the `x`, `y` and `z` values of this Matrix. + * + * @method Phaser.Math.Matrix4#xyz + * @since 3.0.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {number} z - The z value. + * + * @return {this} This Matrix4. + */ + xyz: function (x, y, z) + { + this.identity(); + + var out = this.val; + + out[12] = x; + out[13] = y; + out[14] = z; + + return this; + }, + + /** + * Set the scaling values of this Matrix. + * + * @method Phaser.Math.Matrix4#scaling + * @since 3.0.0 + * + * @param {number} x - The x scaling value. + * @param {number} y - The y scaling value. + * @param {number} z - The z scaling value. + * + * @return {this} This Matrix4. + */ + scaling: function (x, y, z) + { + this.zero(); + + var out = this.val; + + out[0] = x; + out[5] = y; + out[10] = z; + out[15] = 1; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix4#identity + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + identity: function () + { + return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix4#transpose + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + transpose: function () + { + var a = this.val; + + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a12 = a[6]; + var a13 = a[7]; + var a23 = a[11]; + + a[1] = a[4]; + a[2] = a[8]; + a[3] = a[12]; + a[4] = a01; + a[6] = a[9]; + a[7] = a[13]; + a[8] = a02; + a[9] = a12; + a[11] = a[14]; + a[12] = a03; + a[13] = a13; + a[14] = a23; + + return this; + }, + + /** + * Copies the given Matrix4 into this Matrix and then inverses it. + * + * @method Phaser.Math.Matrix4#getInverse + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to invert into this Matrix4. + * + * @return {this} This Matrix4. + */ + getInverse: function (m) + { + this.copy(m); + + return this.invert(); + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix4#invert + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) + { + return this; + } + + det = 1 / det; + + return this.setValues( + (a11 * b11 - a12 * b10 + a13 * b09) * det, + (a02 * b10 - a01 * b11 - a03 * b09) * det, + (a31 * b05 - a32 * b04 + a33 * b03) * det, + (a22 * b04 - a21 * b05 - a23 * b03) * det, + (a12 * b08 - a10 * b11 - a13 * b07) * det, + (a00 * b11 - a02 * b08 + a03 * b07) * det, + (a32 * b02 - a30 * b05 - a33 * b01) * det, + (a20 * b05 - a22 * b02 + a23 * b01) * det, + (a10 * b10 - a11 * b08 + a13 * b06) * det, + (a01 * b08 - a00 * b10 - a03 * b06) * det, + (a30 * b04 - a31 * b02 + a33 * b00) * det, + (a21 * b02 - a20 * b04 - a23 * b00) * det, + (a11 * b07 - a10 * b09 - a12 * b06) * det, + (a00 * b09 - a01 * b07 + a02 * b06) * det, + (a31 * b01 - a30 * b03 - a32 * b00) * det, + (a20 * b03 - a21 * b01 + a22 * b00) * det + ); + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix4#adjoint + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + return this.setValues( + (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)), + -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), + (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)), + -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), + -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)), + (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)), + -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)), + (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)), + (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)), + -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)), + (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)), + -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)), + -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)), + (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)), + -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)), + (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)) + ); + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix4#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix4#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. + * + * @return {this} This Matrix4. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b = src.val; + + // Cache only the current line of the second matrix + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + + a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + + a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + + a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + + a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + return this; + }, + + /** + * Multiply the values of this Matrix4 by those given in the `src` argument. + * + * @method Phaser.Math.Matrix4#multiplyLocal + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. + * + * @return {this} This Matrix4. + */ + multiplyLocal: function (src) + { + var a = this.val; + var b = src.val; + + return this.setValues( + a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12], + a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13], + a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14], + a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15], + + a[4] * b[0] + a[5] * b[4] + a[6] * b[8] + a[7] * b[12], + a[4] * b[1] + a[5] * b[5] + a[6] * b[9] + a[7] * b[13], + a[4] * b[2] + a[5] * b[6] + a[6] * b[10] + a[7] * b[14], + a[4] * b[3] + a[5] * b[7] + a[6] * b[11] + a[7] * b[15], + + a[8] * b[0] + a[9] * b[4] + a[10] * b[8] + a[11] * b[12], + a[8] * b[1] + a[9] * b[5] + a[10] * b[9] + a[11] * b[13], + a[8] * b[2] + a[9] * b[6] + a[10] * b[10] + a[11] * b[14], + a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11] * b[15], + + a[12] * b[0] + a[13] * b[4] + a[14] * b[8] + a[15] * b[12], + a[12] * b[1] + a[13] * b[5] + a[14] * b[9] + a[15] * b[13], + a[12] * b[2] + a[13] * b[6] + a[14] * b[10] + a[15] * b[14], + a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15] + ); + }, + + /** + * Multiplies the given Matrix4 object with this Matrix. + * + * This is the same as calling `multiplyMatrices(m, this)`. + * + * @method Phaser.Math.Matrix4#premultiply + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to multiply with this one. + * + * @return {this} This Matrix4. + */ + premultiply: function (m) + { + return this.multiplyMatrices(m, this); + }, + + /** + * Multiplies the two given Matrix4 objects and stores the results in this Matrix. + * + * @method Phaser.Math.Matrix4#multiplyMatrices + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} a - The first Matrix4 to multiply. + * @param {Phaser.Math.Matrix4} b - The second Matrix4 to multiply. + * + * @return {this} This Matrix4. + */ + multiplyMatrices: function (a, b) + { + var am = a.val; + var bm = b.val; + + var a11 = am[0]; + var a12 = am[4]; + var a13 = am[8]; + var a14 = am[12]; + var a21 = am[1]; + var a22 = am[5]; + var a23 = am[9]; + var a24 = am[13]; + var a31 = am[2]; + var a32 = am[6]; + var a33 = am[10]; + var a34 = am[14]; + var a41 = am[3]; + var a42 = am[7]; + var a43 = am[11]; + var a44 = am[15]; + + var b11 = bm[0]; + var b12 = bm[4]; + var b13 = bm[8]; + var b14 = bm[12]; + var b21 = bm[1]; + var b22 = bm[5]; + var b23 = bm[9]; + var b24 = bm[13]; + var b31 = bm[2]; + var b32 = bm[6]; + var b33 = bm[10]; + var b34 = bm[14]; + var b41 = bm[3]; + var b42 = bm[7]; + var b43 = bm[11]; + var b44 = bm[15]; + + return this.setValues( + a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41, + a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41, + a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41, + a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41, + a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42, + a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42, + a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42, + a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42, + a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43, + a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43, + a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43, + a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43, + a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44, + a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44, + a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44, + a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44 + ); + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix4#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {this} This Matrix4. + */ + translate: function (v) + { + return this.translateXYZ(v.x, v.y, v.z); + }, + + /** + * Translate this Matrix using the given values. + * + * @method Phaser.Math.Matrix4#translateXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + translateXYZ: function (x, y, z) + { + var a = this.val; + + a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix4#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {this} This Matrix4. + */ + scale: function (v) + { + return this.scaleXYZ(v.x, v.y, v.z); + }, + + /** + * Apply a scale transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#scaleXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + scaleXYZ: function (x, y, z) + { + var a = this.val; + + a[0] = a[0] * x; + a[1] = a[1] * x; + a[2] = a[2] * x; + a[3] = a[3] * x; + + a[4] = a[4] * y; + a[5] = a[5] * y; + a[6] = a[6] * y; + a[7] = a[7] * y; + + a[8] = a[8] * z; + a[9] = a[9] * z; + a[10] = a[10] * z; + a[11] = a[11] * z; + + return this; + }, + + /** + * Derive a rotation matrix around the given axis. + * + * @method Phaser.Math.Matrix4#makeRotationAxis + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. + * @param {number} angle - The rotation angle in radians. + * + * @return {this} This Matrix4. + */ + makeRotationAxis: function (axis, angle) + { + // Based on http://www.gamedev.net/reference/articles/article1199.asp + + var c = Math.cos(angle); + var s = Math.sin(angle); + var t = 1 - c; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var tx = t * x; + var ty = t * y; + + return this.setValues( + tx * x + c, tx * y - s * z, tx * z + s * y, 0, + tx * y + s * z, ty * y + c, ty * z - s * x, 0, + tx * z - s * y, ty * z + s * x, t * z * z + c, 0, + 0, 0, 0, 1 + ); + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. + * + * @return {this} This Matrix4. + */ + rotate: function (rad, axis) + { + var a = this.val; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var len = Math.sqrt(x * x + y * y + z * z); + + if (Math.abs(len) < EPSILON) + { + return this; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + + var s = Math.sin(rad); + var c = Math.cos(rad); + var t = 1 - c; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + // Construct the elements of the rotation matrix + var b00 = x * x * t + c; + var b01 = y * x * t + z * s; + var b02 = z * x * t - y * s; + + var b10 = x * y * t - z * s; + var b11 = y * y * t + c; + var b12 = z * y * t + x * s; + + var b20 = x * z * t + y * s; + var b21 = y * z * t - x * s; + var b22 = z * z * t + c; + + // Perform rotation-specific matrix multiplication + return this.setValues( + a00 * b00 + a10 * b01 + a20 * b02, + a01 * b00 + a11 * b01 + a21 * b02, + a02 * b00 + a12 * b01 + a22 * b02, + a03 * b00 + a13 * b01 + a23 * b02, + a00 * b10 + a10 * b11 + a20 * b12, + a01 * b10 + a11 * b11 + a21 * b12, + a02 * b10 + a12 * b11 + a22 * b12, + a03 * b10 + a13 * b11 + a23 * b12, + a00 * b20 + a10 * b21 + a20 * b22, + a01 * b20 + a11 * b21 + a21 * b22, + a02 * b20 + a12 * b21 + a22 * b22, + a03 * b20 + a13 * b21 + a23 * b22, + a30, a31, a32, a33 + ); + }, + + /** + * Rotate this matrix on its X axis. + * + * @method Phaser.Math.Matrix4#rotateX + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {this} This Matrix4. + */ + rotateX: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[4] = a10 * c + a20 * s; + a[5] = a11 * c + a21 * s; + a[6] = a12 * c + a22 * s; + a[7] = a13 * c + a23 * s; + a[8] = a20 * c - a10 * s; + a[9] = a21 * c - a11 * s; + a[10] = a22 * c - a12 * s; + a[11] = a23 * c - a13 * s; + + return this; + }, + + /** + * Rotate this matrix on its Y axis. + * + * @method Phaser.Math.Matrix4#rotateY + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateY: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c - a20 * s; + a[1] = a01 * c - a21 * s; + a[2] = a02 * c - a22 * s; + a[3] = a03 * c - a23 * s; + a[8] = a00 * s + a20 * c; + a[9] = a01 * s + a21 * c; + a[10] = a02 * s + a22 * c; + a[11] = a03 * s + a23 * c; + + return this; + }, + + /** + * Rotate this matrix on its Z axis. + * + * @method Phaser.Math.Matrix4#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateZ: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c + a10 * s; + a[1] = a01 * c + a11 * s; + a[2] = a02 * c + a12 * s; + a[3] = a03 * c + a13 * s; + a[4] = a10 * c - a00 * s; + a[5] = a11 * c - a01 * s; + a[6] = a12 * c - a02 * s; + a[7] = a13 * c - a03 * s; + + return this; + }, + + /** + * Set the values of this Matrix from the given rotation Quaternion and translation Vector. + * + * @method Phaser.Math.Matrix4#fromRotationTranslation + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. + * @param {Phaser.Math.Vector3} v - The Vector to set translation from. + * + * @return {this} This Matrix4. + */ + fromRotationTranslation: function (q, v) + { + // Quaternion math + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + v.x, + v.y, + v.z, + 1 + ); + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix4#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {this} This Matrix4. + */ + fromQuat: function (q) + { + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + 0, + 0, + 0, + 1 + ); + }, + + /** + * Generate a frustum matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#frustum + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + frustum: function (left, right, bottom, top, near, far) + { + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + + return this.setValues( + (near * 2) * rl, + 0, + 0, + 0, + + 0, + (near * 2) * tb, + 0, + 0, + + (right + left) * rl, + (top + bottom) * tb, + (far + near) * nf, + -1, + + 0, + 0, + (far * near * 2) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspective + * @since 3.0.0 + * + * @param {number} fovy - Vertical field of view in radians + * @param {number} aspect - Aspect ratio. Typically viewport width /height. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspective: function (fovy, aspect, near, far) + { + var f = 1.0 / Math.tan(fovy / 2); + var nf = 1 / (near - far); + + return this.setValues( + f / aspect, + 0, + 0, + 0, + + 0, + f, + 0, + 0, + + 0, + 0, + (far + near) * nf, + -1, + + 0, + 0, + (2 * far * near) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspectiveLH + * @since 3.0.0 + * + * @param {number} width - The width of the frustum. + * @param {number} height - The height of the frustum. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspectiveLH: function (width, height, near, far) + { + return this.setValues( + (2 * near) / width, + 0, + 0, + 0, + + 0, + (2 * near) / height, + 0, + 0, + + 0, + 0, + -far / (near - far), + 1, + + 0, + 0, + (near * far) / (near - far), + 0 + ); + }, + + /** + * Generate an orthogonal projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#ortho + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + ortho: function (left, right, bottom, top, near, far) + { + var lr = left - right; + var bt = bottom - top; + var nf = near - far; + + // Avoid division by zero + lr = (lr === 0) ? lr : 1 / lr; + bt = (bt === 0) ? bt : 1 / bt; + nf = (nf === 0) ? nf : 1 / nf; + + return this.setValues( + -2 * lr, + 0, + 0, + 0, + + 0, + -2 * bt, + 0, + 0, + + 0, + 0, + 2 * nf, + 0, + + (left + right) * lr, + (top + bottom) * bt, + (far + near) * nf, + 1 + ); + }, + + /** + * Generate a right-handed look-at matrix with the given eye position, target and up axis. + * + * @method Phaser.Math.Matrix4#lookAtRH + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer. + * @param {Phaser.Math.Vector3} target - Point the viewer is looking at. + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAtRH: function (eye, target, up) + { + var m = this.val; + + _z.subVectors(eye, target); + + if (_z.getLengthSquared() === 0) + { + // eye and target are in the same position + _z.z = 1; + } + + _z.normalize(); + _x.crossVectors(up, _z); + + if (_x.getLengthSquared() === 0) + { + // up and z are parallel + + if (Math.abs(up.z) === 1) + { + _z.x += 0.0001; + } + else + { + _z.z += 0.0001; + } + + _z.normalize(); + _x.crossVectors(up, _z); + } + + _x.normalize(); + _y.crossVectors(_z, _x); + + m[0] = _x.x; + m[1] = _x.y; + m[2] = _x.z; + m[4] = _y.x; + m[5] = _y.y; + m[6] = _y.z; + m[8] = _z.x; + m[9] = _z.y; + m[10] = _z.z; + + return this; + }, + + /** + * Generate a look-at matrix with the given eye position, focal point, and up axis. + * + * @method Phaser.Math.Matrix4#lookAt + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer + * @param {Phaser.Math.Vector3} center - Point the viewer is looking at + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAt: function (eye, center, up) + { + var eyex = eye.x; + var eyey = eye.y; + var eyez = eye.z; + + var upx = up.x; + var upy = up.y; + var upz = up.z; + + var centerx = center.x; + var centery = center.y; + var centerz = center.z; + + if (Math.abs(eyex - centerx) < EPSILON && + Math.abs(eyey - centery) < EPSILON && + Math.abs(eyez - centerz) < EPSILON) + { + return this.identity(); + } + + var z0 = eyex - centerx; + var z1 = eyey - centery; + var z2 = eyez - centerz; + + var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + + z0 *= len; + z1 *= len; + z2 *= len; + + var x0 = upy * z2 - upz * z1; + var x1 = upz * z0 - upx * z2; + var x2 = upx * z1 - upy * z0; + + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + + if (!len) + { + x0 = 0; + x1 = 0; + x2 = 0; + } + else + { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + var y0 = z1 * x2 - z2 * x1; + var y1 = z2 * x0 - z0 * x2; + var y2 = z0 * x1 - z1 * x0; + + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + + if (!len) + { + y0 = 0; + y1 = 0; + y2 = 0; + } + else + { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + return this.setValues( + x0, + y0, + z0, + 0, + + x1, + y1, + z1, + 0, + + x2, + y2, + z2, + 0, + + -(x0 * eyex + x1 * eyey + x2 * eyez), + -(y0 * eyex + y1 * eyey + y2 * eyez), + -(z0 * eyex + z1 * eyey + z2 * eyez), + 1 + ); + }, + + /** + * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. + * + * @method Phaser.Math.Matrix4#yawPitchRoll + * @since 3.0.0 + * + * @param {number} yaw - The yaw value. + * @param {number} pitch - The pitch value. + * @param {number} roll - The roll value. + * + * @return {this} This Matrix4. + */ + yawPitchRoll: function (yaw, pitch, roll) + { + this.zero(); + _tempMat1.zero(); + _tempMat2.zero(); + + var m0 = this.val; + var m1 = _tempMat1.val; + var m2 = _tempMat2.val; + + // Rotate Z + var s = Math.sin(roll); + var c = Math.cos(roll); + + m0[10] = 1; + m0[15] = 1; + m0[0] = c; + m0[1] = s; + m0[4] = -s; + m0[5] = c; + + // Rotate X + s = Math.sin(pitch); + c = Math.cos(pitch); + + m1[0] = 1; + m1[15] = 1; + m1[5] = c; + m1[10] = c; + m1[9] = -s; + m1[6] = s; + + // Rotate Y + s = Math.sin(yaw); + c = Math.cos(yaw); + + m2[5] = 1; + m2[15] = 1; + m2[0] = c; + m2[2] = -s; + m2[8] = s; + m2[10] = c; + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + return this; + }, + + /** + * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. + * + * @method Phaser.Math.Matrix4#setWorldMatrix + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. + * @param {Phaser.Math.Vector3} position - The position of the world matrix. + * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. + * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. + * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. + * + * @return {this} This Matrix4. + */ + setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) + { + this.yawPitchRoll(rotation.y, rotation.x, rotation.z); + + _tempMat1.scaling(scale.x, scale.y, scale.z); + _tempMat2.xyz(position.x, position.y, position.z); + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + if (viewMatrix) + { + this.multiplyLocal(viewMatrix); + } + + if (projectionMatrix) + { + this.multiplyLocal(projectionMatrix); + } + + return this; + }, + + /** + * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. + * + * @method Phaser.Math.Matrix4#multiplyToMat4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix4 to multiply with this one. + * @param {Phaser.Math.Matrix4} out - The receiving Matrix. + * + * @return {Phaser.Math.Matrix4} This `out` Matrix4. + */ + multiplyToMat4: function (src, out) + { + var a = this.val; + var b = src.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b03 = b[3]; + var b10 = b[4]; + var b11 = b[5]; + var b12 = b[6]; + var b13 = b[7]; + var b20 = b[8]; + var b21 = b[9]; + var b22 = b[10]; + var b23 = b[11]; + var b30 = b[12]; + var b31 = b[13]; + var b32 = b[14]; + var b33 = b[15]; + + return out.setValues( + b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, + b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31, + b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32, + b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33, + + b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, + b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, + b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, + b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, + + b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, + b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, + b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, + b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, + + b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, + b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, + b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, + b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 + ); + }, + + /** + * Takes the rotation and position vectors and builds this Matrix4 from them. + * + * @method Phaser.Math.Matrix4#fromRotationXYTranslation + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation vector. + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {boolean} translateFirst - Should the operation translate then rotate (`true`), or rotate then translate? (`false`) + * + * @return {this} This Matrix4. + */ + fromRotationXYTranslation: function (rotation, position, translateFirst) + { + var x = position.x; + var y = position.y; + var z = position.z; + + var sx = Math.sin(rotation.x); + var cx = Math.cos(rotation.x); + + var sy = Math.sin(rotation.y); + var cy = Math.cos(rotation.y); + + var a30 = x; + var a31 = y; + var a32 = z; + + // Rotate X + + var b21 = -sx; + + // Rotate Y + + var c01 = 0 - b21 * sy; + + var c02 = 0 - cx * sy; + + var c21 = b21 * cy; + + var c22 = cx * cy; + + // Translate + if (!translateFirst) + { + // a30 = cy * x + 0 * y + sy * z; + a30 = cy * x + sy * z; + a31 = c01 * x + cx * y + c21 * z; + a32 = c02 * x + sx * y + c22 * z; + } + + return this.setValues( + cy, + c01, + c02, + 0, + 0, + cx, + sx, + 0, + sy, + c21, + c22, + 0, + a30, + a31, + a32, + 1 + ); + }, + + /** + * Returns the maximum axis scale from this Matrix4. + * + * @method Phaser.Math.Matrix4#getMaxScaleOnAxis + * @since 3.50.0 + * + * @return {number} The maximum axis scale. + */ + getMaxScaleOnAxis: function () + { + var m = this.val; + + var scaleXSq = m[0] * m[0] + m[1] * m[1] + m[2] * m[2]; + var scaleYSq = m[4] * m[4] + m[5] * m[5] + m[6] * m[6]; + var scaleZSq = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; + + return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); + } + +}); + +/** + * @ignore + */ +var _tempMat1 = new Matrix4(); + +/** + * @ignore + */ +var _tempMat2 = new Matrix4(); + +/** + * @ignore + */ +var _x = new Vector3(); + +/** + * @ignore + */ +var _y = new Vector3(); + +/** + * @ignore + */ +var _z = new Vector3(); + +module.exports = Matrix4; + + +/***/ }), + +/***/ 3733: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Add an `amount` to a `value`, limiting the maximum result to `max`. + * + * @function Phaser.Math.MaxAdd + * @since 3.0.0 + * + * @param {number} value - The value to add to. + * @param {number} amount - The amount to add. + * @param {number} max - The maximum value to return. + * + * @return {number} The resulting value. + */ +var MaxAdd = function (value, amount, max) +{ + return Math.min(value + amount, max); +}; + +module.exports = MaxAdd; + + +/***/ }), + +/***/ 44: +/***/ ((module) => { + +/** + * @author Vladislav Forsh + * @copyright 2021 RoboWhale + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the median of the given values. The values are sorted and the middle value is returned. + * In case of an even number of values, the average of the two middle values is returned. + * + * @function Phaser.Math.Median + * @since 3.54.0 + * + * @param {number[]} values - The values to average. + * + * @return {number} The median value. + */ +var Median = function (values) +{ + var valuesNum = values.length; + if (valuesNum === 0) + { + return 0; + } + + values.sort(function (a, b) { return a - b; }); + + var halfIndex = Math.floor(valuesNum / 2); + + return valuesNum % 2 === 0 + ? (values[halfIndex] + values[halfIndex - 1]) / 2 + : values[halfIndex]; +}; + +module.exports = Median; + + +/***/ }), + +/***/ 5385: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Subtract an `amount` from `value`, limiting the minimum result to `min`. + * + * @function Phaser.Math.MinSub + * @since 3.0.0 + * + * @param {number} value - The value to subtract from. + * @param {number} amount - The amount to subtract. + * @param {number} min - The minimum value to return. + * + * @return {number} The resulting value. + */ +var MinSub = function (value, amount, min) +{ + return Math.max(value - amount, min); +}; + +module.exports = MinSub; + + +/***/ }), + +/***/ 8585: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Work out what percentage `value` is of the range between `min` and `max`. + * If `max` isn't given then it will return the percentage of `value` to `min`. + * + * You can optionally specify an `upperMax` value, which is a mid-way point in the range that represents 100%, after which the % starts to go down to zero again. + * + * @function Phaser.Math.Percent + * @since 3.0.0 + * + * @param {number} value - The value to determine the percentage of. + * @param {number} min - The minimum value. + * @param {number} [max] - The maximum value. + * @param {number} [upperMax] - The mid-way point in the range that represents 100%. + * + * @return {number} A value between 0 and 1 representing the percentage. + */ +var Percent = function (value, min, max, upperMax) +{ + if (max === undefined) { max = min + 1; } + + var percentage = (value - min) / (max - min); + + if (percentage > 1) + { + if (upperMax !== undefined) + { + percentage = ((upperMax - value)) / (upperMax - max); + + if (percentage < 0) + { + percentage = 0; + } + } + else + { + percentage = 1; + } + } + else if (percentage < 0) + { + percentage = 0; + } + + return percentage; +}; + +module.exports = Percent; + + +/***/ }), + +/***/ 372: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(7473); +var Matrix3 = __webpack_require__(2149); +var NOOP = __webpack_require__(1984); +var Vector3 = __webpack_require__(5689); + +var EPSILON = 0.000001; + +// Some shared 'private' arrays +var siNext = new Int8Array([ 1, 2, 0 ]); +var tmp = new Float32Array([ 0, 0, 0 ]); + +var xUnitVec3 = new Vector3(1, 0, 0); +var yUnitVec3 = new Vector3(0, 1, 0); + +var tmpvec = new Vector3(); +var tmpMat3 = new Matrix3(); + +/** + * @classdesc + * A quaternion. + * + * @class Quaternion + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x=0] - The x component. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=1] - The w component. + */ +var Quaternion = new Class({ + + initialize: + + function Quaternion (x, y, z, w) + { + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_x + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_y + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_z + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_w + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * This callback is invoked, if set, each time a value in this quaternion is changed. + * The callback is passed one argument, a reference to this quaternion. + * + * @name Phaser.Math.Quaternion#onChangeCallback + * @type {function} + * @since 3.50.0 + */ + this.onChangeCallback = NOOP; + + this.set(x, y, z, w); + }, + + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: { + get: function () + { + return this._w; + }, + + set: function (value) + { + this._w = value; + + this.onChangeCallback(this); + } + }, + + /** + * Copy the components of a given Quaternion or Vector into this Quaternion. + * + * @method Phaser.Math.Quaternion#copy + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + copy: function (src) + { + return this.set(src); + }, + + /** + * Set the components of this Quaternion and optionally call the `onChangeCallback`. + * + * @method Phaser.Math.Quaternion#set + * @since 3.0.0 + * + * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=0] - The w component. + * @param {boolean} [update=true] - Call the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + set: function (x, y, z, w, update) + { + if (update === undefined) { update = true; } + + if (typeof x === 'object') + { + this._x = x.x || 0; + this._y = x.y || 0; + this._z = x.z || 0; + this._w = x.w || 0; + } + else + { + this._x = x || 0; + this._y = y || 0; + this._z = z || 0; + this._w = w || 0; + } + + if (update) + { + this.onChangeCallback(this); + } + + return this; + }, + + /** + * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise. + * + * @method Phaser.Math.Quaternion#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + add: function (v) + { + this._x += v.x; + this._y += v.y; + this._z += v.z; + this._w += v.w; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise. + * + * @method Phaser.Math.Quaternion#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + subtract: function (v) + { + this._x -= v.x; + this._y -= v.y; + this._z -= v.z; + this._w -= v.w; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Scale this Quaternion by the given value. + * + * @method Phaser.Math.Quaternion#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Quaternion by. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + scale: function (scale) + { + this._x *= scale; + this._y *= scale; + this._z *= scale; + this._w *= scale; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Calculate the length of this Quaternion. + * + * @method Phaser.Math.Quaternion#length + * @since 3.0.0 + * + * @return {number} The length of this Quaternion. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return Math.sqrt(x * x + y * y + z * z + w * w); + }, + + /** + * Calculate the length of this Quaternion squared. + * + * @method Phaser.Math.Quaternion#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Quaternion, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return x * x + y * y + z * z + w * w; + }, + + /** + * Normalize this Quaternion. + * + * @method Phaser.Math.Quaternion#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + var len = x * x + y * y + z * z + w * w; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this._x = x * len; + this._y = y * len; + this._z = z * len; + this._w = w * len; + } + + this.onChangeCallback(this); + + return this; + }, + + /** + * Calculate the dot product of this Quaternion and the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#dot + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion. + * + * @return {number} The dot product of this Quaternion and the given Quaternion or Vector. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; + }, + + /** + * Linearly interpolate this Quaternion towards the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#lerp + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards. + * @param {number} [t=0] - The percentage of interpolation. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + return this.set( + ax + t * (v.x - ax), + ay + t * (v.y - ay), + az + t * (v.z - az), + aw + t * (v.w - aw) + ); + }, + + /** + * Rotates this Quaternion based on the two given vectors. + * + * @method Phaser.Math.Quaternion#rotationTo + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - The transform rotation vector. + * @param {Phaser.Math.Vector3} b - The target rotation vector. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotationTo: function (a, b) + { + var dot = a.x * b.x + a.y * b.y + a.z * b.z; + + if (dot < -0.999999) + { + if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON) + { + tmpvec.copy(yUnitVec3).cross(a); + } + + tmpvec.normalize(); + + return this.setAxisAngle(tmpvec, Math.PI); + + } + else if (dot > 0.999999) + { + return this.set(0, 0, 0, 1); + } + else + { + tmpvec.copy(a).cross(b); + + this._x = tmpvec.x; + this._y = tmpvec.y; + this._z = tmpvec.z; + this._w = 1 + dot; + + return this.normalize(); + } + }, + + /** + * Set the axes of this Quaternion. + * + * @method Phaser.Math.Quaternion#setAxes + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} view - The view axis. + * @param {Phaser.Math.Vector3} right - The right axis. + * @param {Phaser.Math.Vector3} up - The upwards axis. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setAxes: function (view, right, up) + { + var m = tmpMat3.val; + + m[0] = right.x; + m[3] = right.y; + m[6] = right.z; + + m[1] = up.x; + m[4] = up.y; + m[7] = up.z; + + m[2] = -view.x; + m[5] = -view.y; + m[8] = -view.z; + + return this.fromMat3(tmpMat3).normalize(); + }, + + /** + * Reset this Matrix to an identity (default) Quaternion. + * + * @method Phaser.Math.Quaternion#identity + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + identity: function () + { + return this.set(0, 0, 0, 1); + }, + + /** + * Set the axis angle of this Quaternion. + * + * @method Phaser.Math.Quaternion#setAxisAngle + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} axis - The axis. + * @param {number} rad - The angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setAxisAngle: function (axis, rad) + { + rad = rad * 0.5; + + var s = Math.sin(rad); + + return this.set( + s * axis.x, + s * axis.y, + s * axis.z, + Math.cos(rad) + ); + }, + + /** + * Multiply this Quaternion by the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + multiply: function (b) + { + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = b.x; + var by = b.y; + var bz = b.z; + var bw = b.w; + + return this.set( + ax * bw + aw * bx + ay * bz - az * by, + ay * bw + aw * by + az * bx - ax * bz, + az * bw + aw * bz + ax * by - ay * bx, + aw * bw - ax * bx - ay * by - az * bz + ); + }, + + /** + * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#slerp + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards. + * @param {number} t - The percentage of interpolation. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + slerp: function (b, t) + { + // benchmarks: http://jsperf.com/quaternion-slerp-implementations + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = b.x; + var by = b.y; + var bz = b.z; + var bw = b.w; + + // calc cosine + var cosom = ax * bx + ay * by + az * bz + aw * bw; + + // adjust signs (if necessary) + if (cosom < 0) + { + cosom = -cosom; + bx = - bx; + by = - by; + bz = - bz; + bw = - bw; + } + + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + var scale0 = 1 - t; + var scale1 = t; + + // calculate coefficients + if ((1 - cosom) > EPSILON) + { + // standard case (slerp) + var omega = Math.acos(cosom); + var sinom = Math.sin(omega); + + scale0 = Math.sin((1.0 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } + + // calculate final values + return this.set( + scale0 * ax + scale1 * bx, + scale0 * ay + scale1 * by, + scale0 * az + scale1 * bz, + scale0 * aw + scale1 * bw + ); + }, + + /** + * Invert this Quaternion. + * + * @method Phaser.Math.Quaternion#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + invert: function () + { + var a0 = this.x; + var a1 = this.y; + var a2 = this.z; + var a3 = this.w; + + var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + var invDot = (dot) ? 1 / dot : 0; + + return this.set( + -a0 * invDot, + -a1 * invDot, + -a2 * invDot, + a3 * invDot + ); + }, + + /** + * Convert this Quaternion into its conjugate. + * + * Sets the x, y and z components. + * + * @method Phaser.Math.Quaternion#conjugate + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + conjugate: function () + { + this._x = -this.x; + this._y = -this.y; + this._z = -this.z; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Rotate this Quaternion on the X axis. + * + * @method Phaser.Math.Quaternion#rotateX + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateX: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = Math.sin(rad); + var bw = Math.cos(rad); + + return this.set( + ax * bw + aw * bx, + ay * bw + az * bx, + az * bw - ay * bx, + aw * bw - ax * bx + ); + }, + + /** + * Rotate this Quaternion on the Y axis. + * + * @method Phaser.Math.Quaternion#rotateY + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateY: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var by = Math.sin(rad); + var bw = Math.cos(rad); + + return this.set( + ax * bw - az * by, + ay * bw + aw * by, + az * bw + ax * by, + aw * bw - ay * by + ); + }, + + /** + * Rotate this Quaternion on the Z axis. + * + * @method Phaser.Math.Quaternion#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateZ: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bz = Math.sin(rad); + var bw = Math.cos(rad); + + return this.set( + ax * bw + ay * bz, + ay * bw - ax * bz, + az * bw + aw * bz, + aw * bw - az * bz + ); + }, + + /** + * Create a unit (or rotation) Quaternion from its x, y, and z components. + * + * Sets the w component. + * + * @method Phaser.Math.Quaternion#calculateW + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + calculateW: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + this.w = -Math.sqrt(1.0 - x * x - y * y - z * z); + + return this; + }, + + /** + * Set this Quaternion from the given Euler, based on Euler order. + * + * @method Phaser.Math.Quaternion#setFromEuler + * @since 3.50.0 + * + * @param {Phaser.Math.Euler} euler - The Euler to convert from. + * @param {boolean} [update=true] - Run the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromEuler: function (euler, update) + { + var x = euler.x / 2; + var y = euler.y / 2; + var z = euler.z / 2; + + var c1 = Math.cos(x); + var c2 = Math.cos(y); + var c3 = Math.cos(z); + + var s1 = Math.sin(x); + var s2 = Math.sin(y); + var s3 = Math.sin(z); + + switch (euler.order) + { + case 'XYZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'YXZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'ZXY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'ZYX': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'YZX': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'XZY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + } + + return this; + }, + + /** + * Sets the rotation of this Quaternion from the given Matrix4. + * + * @method Phaser.Math.Quaternion#setFromRotationMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to set the rotation from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromRotationMatrix: function (mat4) + { + var m = mat4.val; + + var m11 = m[0]; + var m12 = m[4]; + var m13 = m[8]; + var m21 = m[1]; + var m22 = m[5]; + var m23 = m[9]; + var m31 = m[2]; + var m32 = m[6]; + var m33 = m[10]; + + var trace = m11 + m22 + m33; + var s; + + if (trace > 0) + { + s = 0.5 / Math.sqrt(trace + 1.0); + + this.set( + (m32 - m23) * s, + (m13 - m31) * s, + (m21 - m12) * s, + 0.25 / s + ); + } + else if (m11 > m22 && m11 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); + + this.set( + 0.25 * s, + (m12 + m21) / s, + (m13 + m31) / s, + (m32 - m23) / s + ); + } + else if (m22 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); + + this.set( + (m12 + m21) / s, + 0.25 * s, + (m23 + m32) / s, + (m13 - m31) / s + ); + } + else + { + s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); + + this.set( + (m13 + m31) / s, + (m23 + m32) / s, + 0.25 * s, + (m21 - m12) / s + ); + } + + return this; + }, + + /** + * Convert the given Matrix into this Quaternion. + * + * @method Phaser.Math.Quaternion#fromMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + fromMat3: function (mat) + { + // benchmarks: + // http://jsperf.com/typed-array-access-speed + // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion + + // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes + // article "Quaternion Calculus and Fast Animation". + var m = mat.val; + var fTrace = m[0] + m[4] + m[8]; + var fRoot; + + if (fTrace > 0) + { + // |w| > 1/2, may as well choose w > 1/2 + fRoot = Math.sqrt(fTrace + 1.0); // 2w + + this.w = 0.5 * fRoot; + + fRoot = 0.5 / fRoot; // 1/(4w) + + this._x = (m[7] - m[5]) * fRoot; + this._y = (m[2] - m[6]) * fRoot; + this._z = (m[3] - m[1]) * fRoot; + } + else + { + // |w| <= 1/2 + var i = 0; + + if (m[4] > m[0]) + { + i = 1; + } + + if (m[8] > m[i * 3 + i]) + { + i = 2; + } + + var j = siNext[i]; + var k = siNext[j]; + + // This isn't quite as clean without array access + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); + tmp[i] = 0.5 * fRoot; + + fRoot = 0.5 / fRoot; + + tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + + this._x = tmp[0]; + this._y = tmp[1]; + this._z = tmp[2]; + this._w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; + } + + this.onChangeCallback(this); + + return this; + } + +}); + +module.exports = Quaternion; + + +/***/ }), + +/***/ 4208: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(7425); + +/** + * Convert the given angle in radians, to the equivalent angle in degrees. + * + * @function Phaser.Math.RadToDeg + * @since 3.0.0 + * + * @param {number} radians - The angle in radians to convert ot degrees. + * + * @return {number} The given angle converted to degrees. + */ +var RadToDeg = function (radians) +{ + return radians * CONST.RAD_TO_DEG; +}; + +module.exports = RadToDeg; + + +/***/ }), + +/***/ 1705: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random unit vector. + * + * Computes random values for the given vector between -1 and 1 that can be used to represent a direction. + * + * Optionally accepts a scale value to scale the resulting vector by. + * + * @function Phaser.Math.RandomXY + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} vector - The Vector to compute random values for. + * @param {number} [scale=1] - The scale of the random values. + * + * @return {Phaser.Math.Vector2} The given Vector. + */ +var RandomXY = function (vector, scale) +{ + if (scale === undefined) { scale = 1; } + + var r = Math.random() * 2 * Math.PI; + + vector.x = Math.cos(r) * scale; + vector.y = Math.sin(r) * scale; + + return vector; +}; + +module.exports = RandomXY; + + +/***/ }), + +/***/ 6650: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random position vector in a spherical area, optionally defined by the given radius. + * + * @function Phaser.Math.RandomXYZ + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} vec3 - The Vector to compute random values for. + * @param {number} [radius=1] - The radius. + * + * @return {Phaser.Math.Vector3} The given Vector. + */ +var RandomXYZ = function (vec3, radius) +{ + if (radius === undefined) { radius = 1; } + + var r = Math.random() * 2 * Math.PI; + var z = (Math.random() * 2) - 1; + var zScale = Math.sqrt(1 - z * z) * radius; + + vec3.x = Math.cos(r) * zScale; + vec3.y = Math.sin(r) * zScale; + vec3.z = z * radius; + + return vec3; +}; + +module.exports = RandomXYZ; + + +/***/ }), + +/***/ 2037: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random four-dimensional vector. + * + * @function Phaser.Math.RandomXYZW + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} vec4 - The Vector to compute random values for. + * @param {number} [scale=1] - The scale of the random values. + * + * @return {Phaser.Math.Vector4} The given Vector. + */ +var RandomXYZW = function (vec4, scale) +{ + if (scale === undefined) { scale = 1; } + + vec4.x = (Math.random() * 2 - 1) * scale; + vec4.y = (Math.random() * 2 - 1) * scale; + vec4.z = (Math.random() * 2 - 1) * scale; + vec4.w = (Math.random() * 2 - 1) * scale; + + return vec4; +}; + +module.exports = RandomXYZW; + + +/***/ }), + +/***/ 6283: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a given point by a given angle around the origin (0, 0), in an anti-clockwise direction. + * + * @function Phaser.Math.Rotate + * @since 3.0.0 + * + * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. + * @param {number} angle - The angle to be rotated by in an anticlockwise direction. + * + * @return {Phaser.Geom.Point} The given point, rotated by the given angle in an anticlockwise direction. + */ +var Rotate = function (point, angle) +{ + var x = point.x; + var y = point.y; + + point.x = (x * Math.cos(angle)) - (y * Math.sin(angle)); + point.y = (x * Math.sin(angle)) + (y * Math.cos(angle)); + + return point; +}; + +module.exports = Rotate; + + +/***/ }), + +/***/ 9876: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` to the given `angle`, at the same distance. + * + * In polar notation, this maps a point from (r, t) to (r, angle), vs. the origin (x, y). + * + * @function Phaser.Math.RotateAround + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] + * + * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. + * @param {number} x - The horizontal coordinate to rotate around. + * @param {number} y - The vertical coordinate to rotate around. + * @param {number} angle - The angle of rotation in radians. + * + * @return {Phaser.Types.Math.Vector2Like} The given point. + */ +var RotateAround = function (point, x, y, angle) +{ + var c = Math.cos(angle); + var s = Math.sin(angle); + + var tx = point.x - x; + var ty = point.y - y; + + point.x = tx * c - ty * s + x; + point.y = tx * s + ty * c + y; + + return point; +}; + +module.exports = RotateAround; + + +/***/ }), + +/***/ 8348: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` by the given `angle` and `distance`. + * + * In polar notation, this maps a point from (r, t) to (distance, t + angle), vs. the origin (x, y). + * + * @function Phaser.Math.RotateAroundDistance + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] + * + * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. + * @param {number} x - The horizontal coordinate to rotate around. + * @param {number} y - The vertical coordinate to rotate around. + * @param {number} angle - The angle of rotation in radians. + * @param {number} distance - The distance from (x, y) to place the point at. + * + * @return {Phaser.Types.Math.Vector2Like} The given point. + */ +var RotateAroundDistance = function (point, x, y, angle, distance) +{ + var t = angle + Math.atan2(point.y - y, point.x - x); + + point.x = x + (distance * Math.cos(t)); + point.y = y + (distance * Math.sin(t)); + + return point; +}; + +module.exports = RotateAroundDistance; + + +/***/ }), + +/***/ 4497: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Position a `point` at the given `angle` and `distance` to (`x`, `y`). + * + * @function Phaser.Math.RotateTo + * @since 3.24.0 + * + * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] + * + * @param {Phaser.Types.Math.Vector2Like} point - The point to be positioned. + * @param {number} x - The horizontal coordinate to position from. + * @param {number} y - The vertical coordinate to position from. + * @param {number} angle - The angle of rotation in radians. + * @param {number} distance - The distance from (x, y) to place the point at. + * + * @return {Phaser.Types.Math.Vector2Like} The given point. + */ +var RotateTo = function (point, x, y, angle, distance) +{ + point.x = x + (distance * Math.cos(angle)); + point.y = y + (distance * Math.sin(angle)); + + return point; +}; + +module.exports = RotateTo; + + +/***/ }), + +/***/ 9640: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector3 = __webpack_require__(5689); +var Matrix4 = __webpack_require__(9652); +var Quaternion = __webpack_require__(372); + +var tmpMat4 = new Matrix4(); +var tmpQuat = new Quaternion(); +var tmpVec3 = new Vector3(); + +/** + * Rotates a vector in place by axis angle. + * + * This is the same as transforming a point by an + * axis-angle quaternion, but it has higher precision. + * + * @function Phaser.Math.RotateVec3 + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} vec - The vector to be rotated. + * @param {Phaser.Math.Vector3} axis - The axis to rotate around. + * @param {number} radians - The angle of rotation in radians. + * + * @return {Phaser.Math.Vector3} The given vector. + */ +var RotateVec3 = function (vec, axis, radians) +{ + // Set the quaternion to our axis angle + tmpQuat.setAxisAngle(axis, radians); + + // Create a rotation matrix from the axis angle + tmpMat4.fromRotationTranslation(tmpQuat, tmpVec3.set(0, 0, 0)); + + // Multiply our vector by the rotation matrix + return vec.transformMat4(tmpMat4); +}; + +module.exports = RotateVec3; + + +/***/ }), + +/***/ 4078: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down. + * + * @function Phaser.Math.RoundAwayFromZero + * @since 3.0.0 + * + * @param {number} value - The number to round. + * + * @return {number} The rounded number, rounded away from zero. + */ +var RoundAwayFromZero = function (value) +{ + // "Opposite" of truncate. + return (value > 0) ? Math.ceil(value) : Math.floor(value); +}; + +module.exports = RoundAwayFromZero; + + +/***/ }), + +/***/ 855: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Round a value to the given precision. + * + * For example: + * + * ```javascript + * RoundTo(123.456, 0) = 123 + * RoundTo(123.456, 1) = 120 + * RoundTo(123.456, 2) = 100 + * ``` + * + * To round the decimal, i.e. to round to precision, pass in a negative `place`: + * + * ```javascript + * RoundTo(123.456789, 0) = 123 + * RoundTo(123.456789, -1) = 123.5 + * RoundTo(123.456789, -2) = 123.46 + * RoundTo(123.456789, -3) = 123.457 + * ``` + * + * @function Phaser.Math.RoundTo + * @since 3.0.0 + * + * @param {number} value - The value to round. + * @param {number} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. + * + * @return {number} The rounded value. + */ +var RoundTo = function (value, place, base) +{ + if (place === undefined) { place = 0; } + if (base === undefined) { base = 10; } + + var p = Math.pow(base, -place); + + return Math.round(value * p) / p; +}; + +module.exports = RoundTo; + + +/***/ }), + +/***/ 4936: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Generate a series of sine and cosine values. + * + * @function Phaser.Math.SinCosTableGenerator + * @since 3.0.0 + * + * @param {number} length - The number of values to generate. + * @param {number} [sinAmp=1] - The sine value amplitude. + * @param {number} [cosAmp=1] - The cosine value amplitude. + * @param {number} [frequency=1] - The frequency of the values. + * + * @return {Phaser.Types.Math.SinCosTable} The generated values. + */ +var SinCosTableGenerator = function (length, sinAmp, cosAmp, frequency) +{ + if (sinAmp === undefined) { sinAmp = 1; } + if (cosAmp === undefined) { cosAmp = 1; } + if (frequency === undefined) { frequency = 1; } + + frequency *= Math.PI / length; + + var cos = []; + var sin = []; + + for (var c = 0; c < length; c++) + { + cosAmp -= sinAmp * frequency; + sinAmp += cosAmp * frequency; + + cos[c] = cosAmp; + sin[c] = sinAmp; + } + + return { + sin: sin, + cos: cos, + length: length + }; +}; + +module.exports = SinCosTableGenerator; + + +/***/ }), + +/***/ 2733: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate a smooth interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * + * @function Phaser.Math.SmoothStep + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep} + * + * @param {number} x - The input value. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The percentage of interpolation, between 0 and 1. + */ +var SmoothStep = function (x, min, max) +{ + if (x <= min) + { + return 0; + } + + if (x >= max) + { + return 1; + } + + x = (x - min) / (max - min); + + return x * x * (3 - 2 * x); +}; + +module.exports = SmoothStep; + + +/***/ }), + +/***/ 278: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate a smoother interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * + * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}. + * + * @function Phaser.Math.SmootherStep + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} + * + * @param {number} x - The input value. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The percentage of interpolation, between 0 and 1. + */ +var SmootherStep = function (x, min, max) +{ + x = Math.max(0, Math.min(1, (x - min) / (max - min))); + + return x * x * x * (x * (x * 6 - 15) + 10); +}; + +module.exports = SmootherStep; + + +/***/ }), + +/***/ 163: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(2529); + +/** + * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid. + * + * For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2. + * + * If the given index is out of range an empty Vector2 is returned. + * + * @function Phaser.Math.ToXY + * @since 3.19.0 + * + * @param {number} index - The position within the grid to get the x/y value for. + * @param {number} width - The width of the grid. + * @param {number} height - The height of the grid. + * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created. + * + * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index. + */ +var ToXY = function (index, width, height, out) +{ + if (out === undefined) { out = new Vector2(); } + + var x = 0; + var y = 0; + var total = width * height; + + if (index > 0 && index <= total) + { + if (index > width - 1) + { + y = Math.floor(index / width); + x = index - (y * width); + } + else + { + x = index; + } + } + + return out.set(x, y); +}; + +module.exports = ToXY; + + +/***/ }), + +/***/ 7556: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(2529); + +/** + * Takes the `x` and `y` coordinates and transforms them into the same space as + * defined by the position, rotation and scale values. + * + * @function Phaser.Math.TransformXY + * @since 3.0.0 + * + * @param {number} x - The x coordinate to be transformed. + * @param {number} y - The y coordinate to be transformed. + * @param {number} positionX - Horizontal position of the transform point. + * @param {number} positionY - Vertical position of the transform point. + * @param {number} rotation - Rotation of the transform point, in radians. + * @param {number} scaleX - Horizontal scale of the transform point. + * @param {number} scaleY - Vertical scale of the transform point. + * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates. + * + * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point. + */ +var TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output) +{ + if (output === undefined) { output = new Vector2(); } + + var radianSin = Math.sin(rotation); + var radianCos = Math.cos(rotation); + + // Rotate and Scale + var a = radianCos * scaleX; + var b = radianSin * scaleX; + var c = -radianSin * scaleY; + var d = radianCos * scaleY; + + // Invert + var id = 1 / ((a * d) + (c * -b)); + + output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id); + output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id); + + return output; +}; + +module.exports = TransformXY; + + +/***/ }), + +/***/ 2529: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(7473); +var FuzzyEqual = __webpack_require__(12); + +/** + * @classdesc + * A representation of a vector in 2D space. + * + * A two-component vector. + * + * @class Vector2 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number|Phaser.Types.Math.Vector2Like} [x=0] - The x component, or an object with `x` and `y` properties. + * @param {number} [y=x] - The y component. + */ +var Vector2 = new Class({ + + initialize: + + function Vector2 (x, y) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector2#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector2#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + } + else + { + if (y === undefined) { y = x; } + + this.x = x || 0; + this.y = y || 0; + } + }, + + /** + * Make a clone of this Vector2. + * + * @method Phaser.Math.Vector2#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} A clone of this Vector2. + */ + clone: function () + { + return new Vector2(this.x, this.y); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector2#copy + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + copy: function (src) + { + this.x = src.x || 0; + this.y = src.y || 0; + + return this; + }, + + /** + * Set the component values of this Vector from a given Vector2Like object. + * + * @method Phaser.Math.Vector2#setFromObject + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setFromObject: function (obj) + { + this.x = obj.x || 0; + this.y = obj.y || 0; + + return this; + }, + + /** + * Set the `x` and `y` components of the this Vector to the given `x` and `y` values. + * + * @method Phaser.Math.Vector2#set + * @since 3.0.0 + * + * @param {number} x - The x value to set for this Vector. + * @param {number} [y=x] - The y value to set for this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + set: function (x, y) + { + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + }, + + /** + * This method is an alias for `Vector2.set`. + * + * @method Phaser.Math.Vector2#setTo + * @since 3.4.0 + * + * @param {number} x - The x value to set for this Vector. + * @param {number} [y=x] - The y value to set for this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setTo: function (x, y) + { + return this.set(x, y); + }, + + /** + * Sets the `x` and `y` values of this object from a given polar coordinate. + * + * @method Phaser.Math.Vector2#setToPolar + * @since 3.0.0 + * + * @param {number} azimuth - The angular coordinate, in radians. + * @param {number} [radius=1] - The radial coordinate (length). + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setToPolar: function (azimuth, radius) + { + if (radius == null) { radius = 1; } + + this.x = Math.cos(azimuth) * radius; + this.y = Math.sin(azimuth) * radius; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @method Phaser.Math.Vector2#equals + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. + * + * @return {boolean} Whether the given Vector is equal to this Vector. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y)); + }, + + /** + * Check whether this Vector is approximately equal to a given Vector. + * + * @method Phaser.Math.Vector2#fuzzyEquals + * @since 3.23.0 + * + * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. + * @param {number} [epsilon=0.0001] - The tolerance value. + * + * @return {boolean} Whether both absolute differences of the x and y components are smaller than `epsilon`. + */ + fuzzyEquals: function (v, epsilon) + { + return (FuzzyEqual(this.x, v.x, epsilon) && FuzzyEqual(this.y, v.y, epsilon)); + }, + + /** + * Calculate the angle between this Vector and the positive x-axis, in radians. + * + * @method Phaser.Math.Vector2#angle + * @since 3.0.0 + * + * @return {number} The angle between this Vector, and the positive x-axis, given in radians. + */ + angle: function () + { + // computes the angle in radians with respect to the positive x-axis + + var angle = Math.atan2(this.y, this.x); + + if (angle < 0) + { + angle += 2 * Math.PI; + } + + return angle; + }, + + /** + * Set the angle of this Vector. + * + * @method Phaser.Math.Vector2#setAngle + * @since 3.23.0 + * + * @param {number} angle - The angle, in radians. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setAngle: function (angle) + { + return this.setToPolar(angle, this.length()); + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector2#add + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + add: function (src) + { + this.x += src.x; + this.y += src.y; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector2#subtract + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + subtract: function (src) + { + this.x -= src.x; + this.y -= src.y; + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector2#multiply + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + multiply: function (src) + { + this.x *= src.x; + this.y *= src.y; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector2#scale + * @since 3.0.0 + * + * @param {number} value - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + scale: function (value) + { + if (isFinite(value)) + { + this.x *= value; + this.y *= value; + } + else + { + this.x = 0; + this.y = 0; + } + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector2#divide + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + divide: function (src) + { + this.x /= src.x; + this.y /= src.y; + + return this; + }, + + /** + * Negate the `x` and `y` components of this Vector. + * + * @method Phaser.Math.Vector2#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#distance + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (src) + { + var dx = src.x - this.x; + var dy = src.y - this.y; + + return Math.sqrt(dx * dx + dy * dy); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector2#distanceSq + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (src) + { + var dx = src.x - this.x; + var dy = src.y - this.y; + + return dx * dx + dy * dy; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector2#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + + return Math.sqrt(x * x + y * y); + }, + + /** + * Set the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector2#setLength + * @since 3.23.0 + * + * @param {number} length + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setLength: function (length) + { + return this.normalize().scale(length); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector2#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + + return x * x + y * y; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector2#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var len = x * x + y * y; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + } + + return this; + }, + + /** + * Rotate this Vector to its perpendicular, in the positive direction. + * + * @method Phaser.Math.Vector2#normalizeRightHand + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + normalizeRightHand: function () + { + var x = this.x; + + this.x = this.y * -1; + this.y = x; + + return this; + }, + + /** + * Rotate this Vector to its perpendicular, in the negative direction. + * + * @method Phaser.Math.Vector2#normalizeLeftHand + * @since 3.23.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + normalizeLeftHand: function () + { + var x = this.x; + + this.x = this.y; + this.y = x * -1; + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#dot + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to dot product with this Vector2. + * + * @return {number} The dot product of this Vector and the given Vector. + */ + dot: function (src) + { + return this.x * src.x + this.y * src.y; + }, + + /** + * Calculate the cross product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#cross + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to cross with this Vector2. + * + * @return {number} The cross product of this Vector and the given Vector. + */ + cross: function (src) + { + return this.x * src.y - this.y * src.x; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector2#lerp + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + lerp: function (src, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + + this.x = ax + t * (src.x - ax); + this.y = ay + t * (src.y - ay); + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector2#transformMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + transformMat3: function (mat) + { + var x = this.x; + var y = this.y; + var m = mat.val; + + this.x = m[0] * x + m[3] * y + m[6]; + this.y = m[1] * x + m[4] * y + m[7]; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector2#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[12]; + this.y = m[1] * x + m[5] * y + m[13]; + + return this; + }, + + /** + * Make this Vector the zero vector (0, 0). + * + * @method Phaser.Math.Vector2#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + reset: function () + { + this.x = 0; + this.y = 0; + + return this; + }, + + /** + * Limit the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector2#limit + * @since 3.23.0 + * + * @param {number} max - The maximum length. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + limit: function (max) + { + var len = this.length(); + + if (len && len > max) + { + this.scale(max / len); + } + + return this; + }, + + /** + * Reflect this Vector off a line defined by a normal. + * + * @method Phaser.Math.Vector2#reflect + * @since 3.23.0 + * + * @param {Phaser.Math.Vector2} normal - A vector perpendicular to the line. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + reflect: function (normal) + { + normal = normal.clone().normalize(); + + return this.subtract(normal.scale(2 * this.dot(normal))); + }, + + /** + * Reflect this Vector across another. + * + * @method Phaser.Math.Vector2#mirror + * @since 3.23.0 + * + * @param {Phaser.Math.Vector2} axis - A vector to reflect across. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + mirror: function (axis) + { + return this.reflect(axis).negate(); + }, + + /** + * Rotate this Vector by an angle amount. + * + * @method Phaser.Math.Vector2#rotate + * @since 3.23.0 + * + * @param {number} delta - The angle to rotate by, in radians. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + rotate: function (delta) + { + var cos = Math.cos(delta); + var sin = Math.sin(delta); + + return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); + }, + + /** + * Project this Vector onto another. + * + * @method Phaser.Math.Vector2#project + * @since 3.60.0 + * + * @param {Phaser.Math.Vector2} src - The vector to project onto. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + project: function (src) + { + var scalar = this.dot(src) / src.dot(src); + + return this.copy(src).scale(scalar); + } + +}); + +/** + * A static zero Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.ZERO + * @type {Phaser.Math.Vector2} + * @since 3.1.0 + */ +Vector2.ZERO = new Vector2(); + +/** + * A static right Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.RIGHT + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.RIGHT = new Vector2(1, 0); + +/** + * A static left Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.LEFT + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.LEFT = new Vector2(-1, 0); + +/** + * A static up Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.UP + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.UP = new Vector2(0, -1); + +/** + * A static down Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.DOWN + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.DOWN = new Vector2(0, 1); + +/** + * A static one Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.ONE + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.ONE = new Vector2(1, 1); + +module.exports = Vector2; + + +/***/ }), + +/***/ 5689: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A representation of a vector in 3D space. + * + * A three-component vector. + * + * @class Vector3 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Vector3 = new Class({ + + initialize: + + function Vector3 (x, y, z) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector3#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector3#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The z component of this Vector. + * + * @name Phaser.Math.Vector3#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.z = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + }, + + /** + * Set this Vector to point up. + * + * Sets the y component of the vector to 1, and the others to 0. + * + * @method Phaser.Math.Vector3#up + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + up: function () + { + this.x = 0; + this.y = 1; + this.z = 0; + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.min` result from the given vector. + * + * @method Phaser.Math.Vector3#min + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the minimum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + min: function (v) + { + this.x = Math.min(this.x, v.x); + this.y = Math.min(this.y, v.y); + this.z = Math.min(this.z, v.z); + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.max` result from the given vector. + * + * @method Phaser.Math.Vector3#max + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the maximum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + max: function (v) + { + this.x = Math.max(this.x, v.x); + this.y = Math.max(this.y, v.y); + this.z = Math.max(this.z, v.z); + + return this; + }, + + /** + * Make a clone of this Vector3. + * + * @method Phaser.Math.Vector3#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. + */ + clone: function () + { + return new Vector3(this.x, this.y, this.z); + }, + + /** + * Adds the two given Vector3s and sets the results into this Vector3. + * + * @method Phaser.Math.Vector3#addVectors + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to add. + * @param {Phaser.Math.Vector3} b - The second Vector to add. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addVectors: function (a, b) + { + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + + return this; + }, + + /** + * Calculate the cross (vector) product of two given Vectors. + * + * @method Phaser.Math.Vector3#crossVectors + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to multiply. + * @param {Phaser.Math.Vector3} b - The second Vector to multiply. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + crossVectors: function (a, b) + { + var ax = a.x; + var ay = a.y; + var az = a.z; + var bx = b.x; + var by = b.y; + var bz = b.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @method Phaser.Math.Vector3#equals + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. + * + * @return {boolean} True if the two vectors strictly match, otherwise false. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector3#copy + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + copy: function (src) + { + this.x = src.x; + this.y = src.y; + this.z = src.z || 0; + + return this; + }, + + /** + * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. + * + * @method Phaser.Math.Vector3#set + * @since 3.0.0 + * + * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. + * @param {number} [y] - The y value to set for this Vector. + * @param {number} [z] - The z value to set for this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + set: function (x, y, z) + { + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + + return this; + }, + + /** + * Sets the components of this Vector3 from the position of the given Matrix4. + * + * @method Phaser.Math.Vector3#setFromMatrixPosition + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the position from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixPosition: function (m) + { + return this.fromArray(m.val, 12); + }, + + /** + * Sets the components of this Vector3 from the Matrix4 column specified. + * + * @method Phaser.Math.Vector3#setFromMatrixColumn + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the column from. + * @param {number} index - The column index. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixColumn: function (mat4, index) + { + return this.fromArray(mat4.val, index * 4); + }, + + /** + * Sets the components of this Vector3 from the given array, based on the offset. + * + * Vector3.x = array[offset] + * Vector3.y = array[offset + 1] + * Vector3.z = array[offset + 2] + * + * @method Phaser.Math.Vector3#fromArray + * @since 3.50.0 + * + * @param {number[]} array - The array of values to get this Vector from. + * @param {number} [offset=0] - The offset index into the array. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + fromArray: function (array, offset) + { + if (offset === undefined) { offset = 0; } + + this.x = array[offset]; + this.y = array[offset + 1]; + this.z = array[offset + 2]; + + return this; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + add: function (v) + { + this.x += v.x; + this.y += v.y; + this.z += v.z || 0; + + return this; + }, + + /** + * Add the given value to each component of this Vector. + * + * @method Phaser.Math.Vector3#addScalar + * @since 3.50.0 + * + * @param {number} s - The amount to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScalar: function (s) + { + this.x += s; + this.y += s; + this.z += s; + + return this; + }, + + /** + * Add and scale a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#addScale + * @since 3.50.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * @param {number} scale - The amount to scale `v` by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScale: function (v, scale) + { + this.x += v.x * scale; + this.y += v.y * scale; + this.z += v.z * scale || 0; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector3#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + subtract: function (v) + { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z || 0; + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + multiply: function (v) + { + this.x *= v.x; + this.y *= v.y; + this.z *= v.z || 1; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector3#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + scale: function (scale) + { + if (isFinite(scale)) + { + this.x *= scale; + this.y *= scale; + this.z *= scale; + } + else + { + this.x = 0; + this.y = 0; + this.z = 0; + } + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#divide + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + divide: function (v) + { + this.x /= v.x; + this.y /= v.y; + this.z /= v.z || 1; + + return this; + }, + + /** + * Negate the `x`, `y` and `z` components of this Vector. + * + * @method Phaser.Math.Vector3#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#distance + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return Math.sqrt(dx * dx + dy * dy + dz * dz); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector3#distanceSq + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return dx * dx + dy * dy + dz * dz; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector3#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return Math.sqrt(x * x + y * y + z * z); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector3#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return x * x + y * y + z * z; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector3#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var len = x * x + y * y + z * z; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + this.z = z * len; + } + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. + * + * @return {number} The dot product of this Vector and `v`. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z; + }, + + /** + * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. + * + * @method Phaser.Math.Vector3#cross + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector to cross product with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + cross: function (v) + { + var ax = this.x; + var ay = this.y; + var az = this.z; + var bx = v.x; + var by = v.y; + var bz = v.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector3#lerp + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + + this.x = ax + t * (v.x - ax); + this.y = ay + t * (v.y - ay); + this.z = az + t * (v.z - az); + + return this; + }, + + /** + * Takes a Matrix3 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix3 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix3} mat3 - The Matrix3 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix3: function (mat3) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat3.val; + + this.x = m[0] * x + m[3] * y + m[6] * z; + this.y = m[1] * x + m[4] * y + m[7] * z; + this.z = m[2] * x + m[5] * y + m[8] * z; + + return this; + }, + + /** + * Takes a Matrix4 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix4: function (mat4) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat4.val; + + var w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]); + + this.x = (m[0] * x + m[4] * y + m[8] * z + m[12]) * w; + this.y = (m[1] * x + m[5] * y + m[9] * z + m[13]) * w; + this.z = (m[2] * x + m[6] * y + m[10] * z + m[14]) * w; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector3#transformMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat3: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = x * m[0] + y * m[3] + z * m[6]; + this.y = x * m[1] + y * m[4] + z * m[7]; + this.z = x * m[2] + y * m[5] + z * m[8]; + + return this; + }, + + /** + * Transform this Vector with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; + this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; + this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; + + return this; + }, + + /** + * Transforms the coordinates of this Vector3 with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformCoordinates + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformCoordinates: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; + var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; + var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; + var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; + + this.x = tx / tw; + this.y = ty / tw; + this.z = tz / tw; + + return this; + }, + + /** + * Transform this Vector with the given Quaternion. + * + * @method Phaser.Math.Vector3#transformQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformQuat: function (q) + { + // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations + var x = this.x; + var y = this.y; + var z = this.z; + var qx = q.x; + var qy = q.y; + var qz = q.z; + var qw = q.w; + + // calculate quat * vec + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; + + return this; + }, + + /** + * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, + * e.g. unprojecting a 2D point into 3D space. + * + * @method Phaser.Math.Vector3#project + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + project: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var a00 = m[0]; + var a01 = m[1]; + var a02 = m[2]; + var a03 = m[3]; + var a10 = m[4]; + var a11 = m[5]; + var a12 = m[6]; + var a13 = m[7]; + var a20 = m[8]; + var a21 = m[9]; + var a22 = m[10]; + var a23 = m[11]; + var a30 = m[12]; + var a31 = m[13]; + var a32 = m[14]; + var a33 = m[15]; + + var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); + + this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; + this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; + this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; + + return this; + }, + + /** + * Multiplies this Vector3 by the given view and projection matrices. + * + * @method Phaser.Math.Vector3#projectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} viewMatrix - A View Matrix. + * @param {Phaser.Math.Matrix4} projectionMatrix - A Projection Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + projectViewMatrix: function (viewMatrix, projectionMatrix) + { + return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix); + }, + + /** + * Multiplies this Vector3 by the given inversed projection matrix and world matrix. + * + * @method Phaser.Math.Vector3#unprojectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} projectionMatrix - An inversed Projection Matrix. + * @param {Phaser.Math.Matrix4} worldMatrix - A World View Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unprojectViewMatrix: function (projectionMatrix, worldMatrix) + { + return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix); + }, + + /** + * Unproject this point from 2D space to 3D space. + * The point should have its x and y properties set to + * 2D screen space, and the z either at 0 (near plane) + * or 1 (far plane). The provided matrix is assumed to already + * be combined, i.e. projection * view * model. + * + * After this operation, this vector's (x, y, z) components will + * represent the unprojected 3D coordinate. + * + * @method Phaser.Math.Vector3#unproject + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. + * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unproject: function (viewport, invProjectionView) + { + var viewX = viewport.x; + var viewY = viewport.y; + var viewWidth = viewport.z; + var viewHeight = viewport.w; + + var x = this.x - viewX; + var y = (viewHeight - this.y - 1) - viewY; + var z = this.z; + + this.x = (2 * x) / viewWidth - 1; + this.y = (2 * y) / viewHeight - 1; + this.z = 2 * z - 1; + + return this.project(invProjectionView); + }, + + /** + * Make this Vector the zero vector (0, 0, 0). + * + * @method Phaser.Math.Vector3#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + reset: function () + { + this.x = 0; + this.y = 0; + this.z = 0; + + return this; + } + +}); + +/** + * A static zero Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ZERO + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ZERO = new Vector3(); + +/** + * A static right Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.RIGHT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.RIGHT = new Vector3(1, 0, 0); + +/** + * A static left Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.LEFT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.LEFT = new Vector3(-1, 0, 0); + +/** + * A static up Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.UP + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.UP = new Vector3(0, -1, 0); + +/** + * A static down Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.DOWN + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.DOWN = new Vector3(0, 1, 0); + +/** + * A static forward Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.FORWARD + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.FORWARD = new Vector3(0, 0, 1); + +/** + * A static back Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.BACK + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.BACK = new Vector3(0, 0, -1); + +/** + * A static one Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ONE + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ONE = new Vector3(1, 1, 1); + +module.exports = Vector3; + + +/***/ }), + +/***/ 9279: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A representation of a vector in 4D space. + * + * A four-component vector. + * + * @class Vector4 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + * @param {number} [w] - The w component. + */ +var Vector4 = new Class({ + + initialize: + + function Vector4 (x, y, z, w) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector4#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector4#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The z component of this Vector. + * + * @name Phaser.Math.Vector4#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.z = 0; + + /** + * The w component of this Vector. + * + * @name Phaser.Math.Vector4#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.w = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + this.w = x.w || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + this.w = w || 0; + } + }, + + /** + * Make a clone of this Vector4. + * + * @method Phaser.Math.Vector4#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} A clone of this Vector4. + */ + clone: function () + { + return new Vector4(this.x, this.y, this.z, this.w); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector4#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + copy: function (src) + { + this.x = src.x; + this.y = src.y; + this.z = src.z || 0; + this.w = src.w || 0; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict quality check against each Vector's components. + * + * @method Phaser.Math.Vector4#equals + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} v - The vector to check equality with. + * + * @return {boolean} A boolean indicating whether the two Vectors are equal or not. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z) && (this.w === v.w)); + }, + + /** + * Set the `x`, `y`, `z` and `w` components of the this Vector to the given `x`, `y`, `z` and `w` values. + * + * @method Phaser.Math.Vector4#set + * @since 3.0.0 + * + * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y, z and w components. + * @param {number} y - The y value to set for this Vector. + * @param {number} z - The z value to set for this Vector. + * @param {number} w - The z value to set for this Vector. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + set: function (x, y, z, w) + { + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + this.w = x.w || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + this.w = w || 0; + } + + return this; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector4#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + add: function (v) + { + this.x += v.x; + this.y += v.y; + this.z += v.z || 0; + this.w += v.w || 0; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector4#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + subtract: function (v) + { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z || 0; + this.w -= v.w || 0; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector4#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + scale: function (scale) + { + this.x *= scale; + this.y *= scale; + this.z *= scale; + this.w *= scale; + + return this; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector4#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return Math.sqrt(x * x + y * y + z * z + w * w); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector4#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return x * x + y * y + z * z + w * w; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector4#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + var len = x * x + y * y + z * z + w * w; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + this.z = z * len; + this.w = w * len; + } + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector4#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} v - The Vector4 to dot product with this Vector4. + * + * @return {number} The dot product of this Vector and the given Vector. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector4#lerp + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} v - The Vector4 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + this.x = ax + t * (v.x - ax); + this.y = ay + t * (v.y - ay); + this.z = az + t * (v.z - az); + this.w = aw + t * (v.w - aw); + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector4#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + multiply: function (v) + { + this.x *= v.x; + this.y *= v.y; + this.z *= v.z || 1; + this.w *= v.w || 1; + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector4#divide + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + divide: function (v) + { + this.x /= v.x; + this.y /= v.y; + this.z /= v.z || 1; + this.w /= v.w || 1; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector4#distance + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + var dw = v.w - this.w || 0; + + return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector4#distanceSq + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + var dw = v.w - this.w || 0; + + return dx * dx + dy * dy + dz * dz + dw * dw; + }, + + /** + * Negate the `x`, `y`, `z` and `w` components of this Vector. + * + * @method Phaser.Math.Vector4#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + this.w = -this.w; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector4#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector4 with. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + this.y = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + this.z = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + this.w = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + + return this; + }, + + /** + * Transform this Vector with the given Quaternion. + * + * @method Phaser.Math.Vector4#transformQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + transformQuat: function (q) + { + var x = this.x; + var y = this.y; + var z = this.z; + var qx = q.x; + var qy = q.y; + var qz = q.z; + var qw = q.w; + + // calculate quat * vec + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; + + return this; + }, + + /** + * Make this Vector the zero vector (0, 0, 0, 0). + * + * @method Phaser.Math.Vector4#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + reset: function () + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 0; + + return this; + } + +}); + +Vector4.prototype.sub = Vector4.prototype.subtract; +Vector4.prototype.mul = Vector4.prototype.multiply; +Vector4.prototype.div = Vector4.prototype.divide; +Vector4.prototype.dist = Vector4.prototype.distance; +Vector4.prototype.distSq = Vector4.prototype.distanceSq; +Vector4.prototype.len = Vector4.prototype.length; +Vector4.prototype.lenSq = Vector4.prototype.lengthSq; + +module.exports = Vector4; + + +/***/ }), + +/***/ 4119: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if the two values are within the given `tolerance` of each other. + * + * @function Phaser.Math.Within + * @since 3.0.0 + * + * @param {number} a - The first value to use in the calculation. + * @param {number} b - The second value to use in the calculation. + * @param {number} tolerance - The tolerance. Anything equal to or less than this value is considered as being within range. + * + * @return {boolean} Returns `true` if `a` is less than or equal to the tolerance of `b`. + */ +var Within = function (a, b, tolerance) +{ + return (Math.abs(a - b) <= tolerance); +}; + +module.exports = Within; + + +/***/ }), + +/***/ 8445: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Wrap the given `value` between `min` and `max`. + * + * @function Phaser.Math.Wrap + * @since 3.0.0 + * + * @param {number} value - The value to wrap. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. + * + * @return {number} The wrapped value. + */ +var Wrap = function (value, min, max) +{ + if (value >= min && value <= max) + { + // Skip modulo if already in range + return value; + } + + var range = max - min; + + return (min + ((((value - min) % range) + range) % range)); +}; + +module.exports = Wrap; + + +/***/ }), + +/***/ 6412: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * + * @function Phaser.Math.Angle.Between + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The angle in radians. + */ +var Between = function (x1, y1, x2, y2) +{ + return Math.atan2(y2 - y1, x2 - x1); +}; + +module.exports = Between; + + +/***/ }), + +/***/ 760: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * + * Calculates the angle of the vector from the first point to the second point. + * + * @function Phaser.Math.Angle.BetweenPoints + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} point1 - The first point. + * @param {Phaser.Types.Math.Vector2Like} point2 - The second point. + * + * @return {number} The angle in radians. + */ +var BetweenPoints = function (point1, point2) +{ + return Math.atan2(point2.y - point1.y, point2.x - point1.x); +}; + +module.exports = BetweenPoints; + + +/***/ }), + +/***/ 6909: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * + * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate + * travels down the screen. + * + * @function Phaser.Math.Angle.BetweenPointsY + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} point1 - The first point. + * @param {Phaser.Types.Math.Vector2Like} point2 - The second point. + * + * @return {number} The angle in radians. + */ +var BetweenPointsY = function (point1, point2) +{ + return Math.atan2(point2.x - point1.x, point2.y - point1.y); +}; + +module.exports = BetweenPointsY; + + +/***/ }), + +/***/ 6947: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * + * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate + * travels down the screen. + * + * @function Phaser.Math.Angle.BetweenY + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The angle in radians. + */ +var BetweenY = function (x1, y1, x2, y2) +{ + return Math.atan2(x2 - x1, y2 - y1); +}; + +module.exports = BetweenY; + + +/***/ }), + +/***/ 3426: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(7425); + +/** + * Takes an angle in Phasers default clockwise format and converts it so that + * 0 is North, 90 is West, 180 is South and 270 is East, + * therefore running counter-clockwise instead of clockwise. + * + * You can pass in the angle from a Game Object using: + * + * ```javascript + * var converted = CounterClockwise(gameobject.rotation); + * ``` + * + * All values for this function are in radians. + * + * @function Phaser.Math.Angle.CounterClockwise + * @since 3.16.0 + * + * @param {number} angle - The angle to convert, in radians. + * + * @return {number} The converted angle, in radians. + */ +var CounterClockwise = function (angle) +{ + if (angle > Math.PI) + { + angle -= CONST.PI2; + } + + return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); +}; + +module.exports = CounterClockwise; + + +/***/ }), + +/***/ 6906: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Normalize an angle to the [0, 2pi] range. + * + * @function Phaser.Math.Angle.Normalize + * @since 3.0.0 + * + * @param {number} angle - The angle to normalize, in radians. + * + * @return {number} The normalized angle, in radians. + */ +var Normalize = function (angle) +{ + angle = angle % (2 * Math.PI); + + if (angle >= 0) + { + return angle; + } + else + { + return angle + 2 * Math.PI; + } +}; + +module.exports = Normalize; + + +/***/ }), + +/***/ 3270: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @author @samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FloatBetween = __webpack_require__(104); + +/** + * Returns a random angle in the range [-pi, pi]. + * + * @function Phaser.Math.Angle.Random + * @since 3.23.0 + * + * @return {number} The angle, in radians. + */ +var Random = function () +{ + return FloatBetween(-Math.PI, Math.PI); +}; + +module.exports = Random; + + +/***/ }), + +/***/ 2748: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @author @samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FloatBetween = __webpack_require__(104); + +/** + * Returns a random angle in the range [-180, 180]. + * + * @function Phaser.Math.Angle.RandomDegrees + * @since 3.23.0 + * + * @return {number} The angle, in degrees. + */ +var RandomDegrees = function () +{ + return FloatBetween(-180, 180); +}; + +module.exports = RandomDegrees; + + +/***/ }), + +/***/ 936: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Normalize = __webpack_require__(6906); + +/** + * Reverse the given angle. + * + * @function Phaser.Math.Angle.Reverse + * @since 3.0.0 + * + * @param {number} angle - The angle to reverse, in radians. + * + * @return {number} The reversed angle, in radians. + */ +var Reverse = function (angle) +{ + return Normalize(angle + Math.PI); +}; + +module.exports = Reverse; + + +/***/ }), + +/***/ 1935: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(7425); + +/** + * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. + * + * @function Phaser.Math.Angle.RotateTo + * @since 3.0.0 + * + * @param {number} currentAngle - The current angle, in radians. + * @param {number} targetAngle - The target angle to rotate to, in radians. + * @param {number} [lerp=0.05] - The lerp value to add to the current angle. + * + * @return {number} The adjusted angle. + */ +var RotateTo = function (currentAngle, targetAngle, lerp) +{ + if (lerp === undefined) { lerp = 0.05; } + + if (currentAngle === targetAngle) + { + return currentAngle; + } + + if (Math.abs(targetAngle - currentAngle) <= lerp || Math.abs(targetAngle - currentAngle) >= (MATH_CONST.PI2 - lerp)) + { + currentAngle = targetAngle; + } + else + { + if (Math.abs(targetAngle - currentAngle) > Math.PI) + { + if (targetAngle < currentAngle) + { + targetAngle += MATH_CONST.PI2; + } + else + { + targetAngle -= MATH_CONST.PI2; + } + } + + if (targetAngle > currentAngle) + { + currentAngle += lerp; + } + else if (targetAngle < currentAngle) + { + currentAngle -= lerp; + } + } + + return currentAngle; +}; + +module.exports = RotateTo; + + +/***/ }), + +/***/ 5393: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Gets the shortest angle between `angle1` and `angle2`. + * + * Both angles must be in the range -180 to 180, which is the same clamped + * range that `sprite.angle` uses, so you can pass in two sprite angles to + * this method and get the shortest angle back between the two of them. + * + * The angle returned will be in the same range. If the returned angle is + * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's + * a clockwise rotation. + * + * @function Phaser.Math.Angle.ShortestBetween + * @since 3.0.0 + * + * @param {number} angle1 - The first angle in the range -180 to 180. + * @param {number} angle2 - The second angle in the range -180 to 180. + * + * @return {number} The shortest angle, in degrees. If greater than zero it's a counter-clockwise rotation. + */ +var ShortestBetween = function (angle1, angle2) +{ + var difference = angle2 - angle1; + + if (difference === 0) + { + return 0; + } + + var times = Math.floor((difference - (-180)) / 360); + + return difference - (times * 360); + +}; + +module.exports = ShortestBetween; + + +/***/ }), + +/***/ 3692: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MathWrap = __webpack_require__(8445); + +/** + * Wrap an angle. + * + * Wraps the angle to a value in the range of -PI to PI. + * + * @function Phaser.Math.Angle.Wrap + * @since 3.0.0 + * + * @param {number} angle - The angle to wrap, in radians. + * + * @return {number} The wrapped angle, in radians. + */ +var Wrap = function (angle) +{ + return MathWrap(angle, -Math.PI, Math.PI); +}; + +module.exports = Wrap; + + +/***/ }), + +/***/ 2820: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Wrap = __webpack_require__(8445); + +/** + * Wrap an angle in degrees. + * + * Wraps the angle to a value in the range of -180 to 180. + * + * @function Phaser.Math.Angle.WrapDegrees + * @since 3.0.0 + * + * @param {number} angle - The angle to wrap, in degrees. + * + * @return {number} The wrapped angle, in degrees. + */ +var WrapDegrees = function (angle) +{ + return Wrap(angle, -180, 180); +}; + +module.exports = WrapDegrees; + + +/***/ }), + +/***/ 1833: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Angle + */ + +module.exports = { + + Between: __webpack_require__(6412), + BetweenPoints: __webpack_require__(760), + BetweenPointsY: __webpack_require__(6909), + BetweenY: __webpack_require__(6947), + CounterClockwise: __webpack_require__(3426), + Normalize: __webpack_require__(6906), + Random: __webpack_require__(3270), + RandomDegrees: __webpack_require__(2748), + Reverse: __webpack_require__(936), + RotateTo: __webpack_require__(1935), + ShortestBetween: __webpack_require__(5393), + Wrap: __webpack_require__(3692), + WrapDegrees: __webpack_require__(2820) + +}; + + +/***/ }), + +/***/ 7425: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = { + + /** + * The value of PI * 2. + * + * @name Phaser.Math.PI2 + * @type {number} + * @since 3.0.0 + */ + PI2: Math.PI * 2, + + /** + * The value of PI * 0.5. + * + * Yes, we understand that this should actually be PI * 2, but + * it has been like this for so long we can't change it now. + * If you need PI * 2, use the PI2 constant instead. + * + * @name Phaser.Math.TAU + * @type {number} + * @since 3.0.0 + */ + TAU: Math.PI * 0.5, + + /** + * An epsilon value (1.0e-6) + * + * @name Phaser.Math.EPSILON + * @type {number} + * @since 3.0.0 + */ + EPSILON: 1.0e-6, + + /** + * For converting degrees to radians (PI / 180) + * + * @name Phaser.Math.DEG_TO_RAD + * @type {number} + * @since 3.0.0 + */ + DEG_TO_RAD: Math.PI / 180, + + /** + * For converting radians to degrees (180 / PI) + * + * @name Phaser.Math.RAD_TO_DEG + * @type {number} + * @since 3.0.0 + */ + RAD_TO_DEG: 180 / Math.PI, + + /** + * An instance of the Random Number Generator. + * This is not set until the Game boots. + * + * @name Phaser.Math.RND + * @type {Phaser.Math.RandomDataGenerator} + * @since 3.0.0 + */ + RND: null, + + /** + * The minimum safe integer this browser supports. + * We use a const for backward compatibility with Internet Explorer. + * + * @name Phaser.Math.MIN_SAFE_INTEGER + * @type {number} + * @since 3.21.0 + */ + MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER || -9007199254740991, + + /** + * The maximum safe integer this browser supports. + * We use a const for backward compatibility with Internet Explorer. + * + * @name Phaser.Math.MAX_SAFE_INTEGER + * @type {number} + * @since 3.21.0 + */ + MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER || 9007199254740991 + +}; + +module.exports = MATH_CONST; + + +/***/ }), + +/***/ 1518: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the distance between two sets of coordinates (points). + * + * @function Phaser.Math.Distance.Between + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point. + */ +var DistanceBetween = function (x1, y1, x2, y2) +{ + var dx = x1 - x2; + var dy = y1 - y2; + + return Math.sqrt(dx * dx + dy * dy); +}; + +module.exports = DistanceBetween; + + +/***/ }), + +/***/ 5372: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the distance between two points. + * + * @function Phaser.Math.Distance.BetweenPoints + * @since 3.22.0 + * + * @param {Phaser.Types.Math.Vector2Like} a - The first point. + * @param {Phaser.Types.Math.Vector2Like} b - The second point. + * + * @return {number} The distance between the points. + */ +var DistanceBetweenPoints = function (a, b) +{ + var dx = a.x - b.x; + var dy = a.y - b.y; + + return Math.sqrt(dx * dx + dy * dy); +}; + +module.exports = DistanceBetweenPoints; + + +/***/ }), + +/***/ 4430: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the squared distance between two points. + * + * @function Phaser.Math.Distance.BetweenPointsSquared + * @since 3.22.0 + * + * @param {Phaser.Types.Math.Vector2Like} a - The first point. + * @param {Phaser.Types.Math.Vector2Like} b - The second point. + * + * @return {number} The squared distance between the points. + */ +var DistanceBetweenPointsSquared = function (a, b) +{ + var dx = a.x - b.x; + var dy = a.y - b.y; + + return dx * dx + dy * dy; +}; + +module.exports = DistanceBetweenPointsSquared; + + +/***/ }), + +/***/ 4361: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the Chebyshev distance between two sets of coordinates (points). + * + * Chebyshev distance (or chessboard distance) is the maximum of the horizontal and vertical distances. + * It's the effective distance when movement can be horizontal, vertical, or diagonal. + * + * @function Phaser.Math.Distance.Chebyshev + * @since 3.22.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point. + */ +var ChebyshevDistance = function (x1, y1, x2, y2) +{ + return Math.max(Math.abs(x1 - x2), Math.abs(y1 - y2)); +}; + +module.exports = ChebyshevDistance; + + +/***/ }), + +/***/ 7798: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the distance between two sets of coordinates (points) to the power of `pow`. + * + * @function Phaser.Math.Distance.Power + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * @param {number} pow - The exponent. + * + * @return {number} The distance between each point. + */ +var DistancePower = function (x1, y1, x2, y2, pow) +{ + if (pow === undefined) { pow = 2; } + + return Math.sqrt(Math.pow(x2 - x1, pow) + Math.pow(y2 - y1, pow)); +}; + +module.exports = DistancePower; + + +/***/ }), + +/***/ 8290: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the snake distance between two sets of coordinates (points). + * + * Snake distance (rectilinear distance, Manhattan distance) is the sum of the horizontal and vertical distances. + * It's the effective distance when movement is allowed only horizontally or vertically (but not both). + * + * @function Phaser.Math.Distance.Snake + * @since 3.22.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point. + */ +var SnakeDistance = function (x1, y1, x2, y2) +{ + return Math.abs(x1 - x2) + Math.abs(y1 - y2); +}; + +module.exports = SnakeDistance; + + +/***/ }), + +/***/ 3788: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the distance between two sets of coordinates (points), squared. + * + * @function Phaser.Math.Distance.Squared + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point, squared. + */ +var DistanceSquared = function (x1, y1, x2, y2) +{ + var dx = x1 - x2; + var dy = y1 - y2; + + return dx * dx + dy * dy; +}; + +module.exports = DistanceSquared; + + +/***/ }), + +/***/ 6338: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Distance + */ + +module.exports = { + + Between: __webpack_require__(1518), + BetweenPoints: __webpack_require__(5372), + BetweenPointsSquared: __webpack_require__(4430), + Chebyshev: __webpack_require__(4361), + Power: __webpack_require__(7798), + Snake: __webpack_require__(8290), + Squared: __webpack_require__(3788) + +}; + + +/***/ }), + +/***/ 5751: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Back ease-in. + * + * @function Phaser.Math.Easing.Back.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [overshoot=1.70158] - The overshoot amount. + * + * @return {number} The tweened value. + */ +var In = function (v, overshoot) +{ + if (overshoot === undefined) { overshoot = 1.70158; } + + return v * v * ((overshoot + 1) * v - overshoot); +}; + +module.exports = In; + + +/***/ }), + +/***/ 6203: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Back ease-in/out. + * + * @function Phaser.Math.Easing.Back.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [overshoot=1.70158] - The overshoot amount. + * + * @return {number} The tweened value. + */ +var InOut = function (v, overshoot) +{ + if (overshoot === undefined) { overshoot = 1.70158; } + + var s = overshoot * 1.525; + + if ((v *= 2) < 1) + { + return 0.5 * (v * v * ((s + 1) * v - s)); + } + else + { + return 0.5 * ((v -= 2) * v * ((s + 1) * v + s) + 2); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 9103: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Back ease-out. + * + * @function Phaser.Math.Easing.Back.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [overshoot=1.70158] - The overshoot amount. + * + * @return {number} The tweened value. + */ +var Out = function (v, overshoot) +{ + if (overshoot === undefined) { overshoot = 1.70158; } + + return --v * v * ((overshoot + 1) * v + overshoot) + 1; +}; + +module.exports = Out; + + +/***/ }), + +/***/ 4938: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Back + */ + +module.exports = { + + In: __webpack_require__(5751), + Out: __webpack_require__(9103), + InOut: __webpack_require__(6203) + +}; + + +/***/ }), + +/***/ 8677: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Bounce ease-in. + * + * @function Phaser.Math.Easing.Bounce.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + v = 1 - v; + + if (v < 1 / 2.75) + { + return 1 - (7.5625 * v * v); + } + else if (v < 2 / 2.75) + { + return 1 - (7.5625 * (v -= 1.5 / 2.75) * v + 0.75); + } + else if (v < 2.5 / 2.75) + { + return 1 - (7.5625 * (v -= 2.25 / 2.75) * v + 0.9375); + } + else + { + return 1 - (7.5625 * (v -= 2.625 / 2.75) * v + 0.984375); + } +}; + +module.exports = In; + + +/***/ }), + +/***/ 4649: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Bounce ease-in/out. + * + * @function Phaser.Math.Easing.Bounce.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + var reverse = false; + + if (v < 0.5) + { + v = 1 - (v * 2); + reverse = true; + } + else + { + v = (v * 2) - 1; + } + + if (v < 1 / 2.75) + { + v = 7.5625 * v * v; + } + else if (v < 2 / 2.75) + { + v = 7.5625 * (v -= 1.5 / 2.75) * v + 0.75; + } + else if (v < 2.5 / 2.75) + { + v = 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375; + } + else + { + v = 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375; + } + + if (reverse) + { + return (1 - v) * 0.5; + } + else + { + return v * 0.5 + 0.5; + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 504: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Bounce ease-out. + * + * @function Phaser.Math.Easing.Bounce.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + if (v < 1 / 2.75) + { + return 7.5625 * v * v; + } + else if (v < 2 / 2.75) + { + return 7.5625 * (v -= 1.5 / 2.75) * v + 0.75; + } + else if (v < 2.5 / 2.75) + { + return 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375; + } + else + { + return 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375; + } +}; + +module.exports = Out; + + +/***/ }), + +/***/ 8872: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Bounce + */ + +module.exports = { + + In: __webpack_require__(8677), + Out: __webpack_require__(504), + InOut: __webpack_require__(4649) + +}; + + +/***/ }), + +/***/ 3170: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Circular ease-in. + * + * @function Phaser.Math.Easing.Circular.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return 1 - Math.sqrt(1 - v * v); +}; + +module.exports = In; + + +/***/ }), + +/***/ 2627: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Circular ease-in/out. + * + * @function Phaser.Math.Easing.Circular.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return -0.5 * (Math.sqrt(1 - v * v) - 1); + } + else + { + return 0.5 * (Math.sqrt(1 - (v -= 2) * v) + 1); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 1349: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Circular ease-out. + * + * @function Phaser.Math.Easing.Circular.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return Math.sqrt(1 - (--v * v)); +}; + +module.exports = Out; + + +/***/ }), + +/***/ 5006: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Circular + */ + +module.exports = { + + In: __webpack_require__(3170), + Out: __webpack_require__(1349), + InOut: __webpack_require__(2627) + +}; + + +/***/ }), + +/***/ 6046: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Cubic ease-in. + * + * @function Phaser.Math.Easing.Cubic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v * v; +}; + +module.exports = In; + + +/***/ }), + +/***/ 9531: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Cubic ease-in/out. + * + * @function Phaser.Math.Easing.Cubic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v * v; + } + else + { + return 0.5 * ((v -= 2) * v * v + 2); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 4836: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Cubic ease-out. + * + * @function Phaser.Math.Easing.Cubic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return --v * v * v + 1; +}; + +module.exports = Out; + + +/***/ }), + +/***/ 875: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Cubic + */ + +module.exports = { + + In: __webpack_require__(6046), + Out: __webpack_require__(4836), + InOut: __webpack_require__(9531) + +}; + + +/***/ }), + +/***/ 7619: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Elastic ease-in. + * + * @function Phaser.Math.Easing.Elastic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. + * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. + * + * @return {number} The tweened value. + */ +var In = function (v, amplitude, period) +{ + if (amplitude === undefined) { amplitude = 0.1; } + if (period === undefined) { period = 0.1; } + + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + var s = period / 4; + + if (amplitude < 1) + { + amplitude = 1; + } + else + { + s = period * Math.asin(1 / amplitude) / (2 * Math.PI); + } + + return -(amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period)); + } +}; + +module.exports = In; + + +/***/ }), + +/***/ 7437: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Elastic ease-in/out. + * + * @function Phaser.Math.Easing.Elastic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. + * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. + * + * @return {number} The tweened value. + */ +var InOut = function (v, amplitude, period) +{ + if (amplitude === undefined) { amplitude = 0.1; } + if (period === undefined) { period = 0.1; } + + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + var s = period / 4; + + if (amplitude < 1) + { + amplitude = 1; + } + else + { + s = period * Math.asin(1 / amplitude) / (2 * Math.PI); + } + + if ((v *= 2) < 1) + { + return -0.5 * (amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period)); + } + else + { + return amplitude * Math.pow(2, -10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period) * 0.5 + 1; + } + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 8119: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Elastic ease-out. + * + * @function Phaser.Math.Easing.Elastic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. + * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. + * + * @return {number} The tweened value. + */ +var Out = function (v, amplitude, period) +{ + if (amplitude === undefined) { amplitude = 0.1; } + if (period === undefined) { period = 0.1; } + + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + var s = period / 4; + + if (amplitude < 1) + { + amplitude = 1; + } + else + { + s = period * Math.asin(1 / amplitude) / (2 * Math.PI); + } + + return (amplitude * Math.pow(2, -10 * v) * Math.sin((v - s) * (2 * Math.PI) / period) + 1); + } +}; + +module.exports = Out; + + +/***/ }), + +/***/ 2884: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Elastic + */ + +module.exports = { + + In: __webpack_require__(7619), + Out: __webpack_require__(8119), + InOut: __webpack_require__(7437) + +}; + + +/***/ }), + +/***/ 5456: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Exponential ease-in. + * + * @function Phaser.Math.Easing.Expo.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return Math.pow(2, 10 * (v - 1)) - 0.001; +}; + +module.exports = In; + + +/***/ }), + +/***/ 3461: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Exponential ease-in/out. + * + * @function Phaser.Math.Easing.Expo.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * Math.pow(2, 10 * (v - 1)); + } + else + { + return 0.5 * (2 - Math.pow(2, -10 * (v - 1))); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 2711: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Exponential ease-out. + * + * @function Phaser.Math.Easing.Expo.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return 1 - Math.pow(2, -10 * v); +}; + +module.exports = Out; + + +/***/ }), + +/***/ 6287: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Expo + */ + +module.exports = { + + In: __webpack_require__(5456), + Out: __webpack_require__(2711), + InOut: __webpack_require__(3461) + +}; + + +/***/ }), + +/***/ 8613: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing + */ + +module.exports = { + + Back: __webpack_require__(4938), + Bounce: __webpack_require__(8872), + Circular: __webpack_require__(5006), + Cubic: __webpack_require__(875), + Elastic: __webpack_require__(2884), + Expo: __webpack_require__(6287), + Linear: __webpack_require__(4233), + Quadratic: __webpack_require__(6341), + Quartic: __webpack_require__(762), + Quintic: __webpack_require__(345), + Sine: __webpack_require__(8698), + Stepped: __webpack_require__(7051) + +}; + + +/***/ }), + +/***/ 744: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Linear easing (no variation). + * + * @function Phaser.Math.Easing.Linear + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Linear = function (v) +{ + return v; +}; + +module.exports = Linear; + + +/***/ }), + +/***/ 4233: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +module.exports = __webpack_require__(744); + + +/***/ }), + +/***/ 9810: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quadratic ease-in. + * + * @function Phaser.Math.Easing.Quadratic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v; +}; + +module.exports = In; + + +/***/ }), + +/***/ 8163: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quadratic ease-in/out. + * + * @function Phaser.Math.Easing.Quadratic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v; + } + else + { + return -0.5 * (--v * (v - 2) - 1); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 6123: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quadratic ease-out. + * + * @function Phaser.Math.Easing.Quadratic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return v * (2 - v); +}; + +module.exports = Out; + + +/***/ }), + +/***/ 6341: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quadratic + */ + +module.exports = { + + In: __webpack_require__(9810), + Out: __webpack_require__(6123), + InOut: __webpack_require__(8163) + +}; + + +/***/ }), + +/***/ 7337: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quartic ease-in. + * + * @function Phaser.Math.Easing.Quartic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v * v * v; +}; + +module.exports = In; + + +/***/ }), + +/***/ 4878: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quartic ease-in/out. + * + * @function Phaser.Math.Easing.Quartic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v * v * v; + } + else + { + return -0.5 * ((v -= 2) * v * v * v - 2); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 9012: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quartic ease-out. + * + * @function Phaser.Math.Easing.Quartic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return 1 - (--v * v * v * v); +}; + +module.exports = Out; + + +/***/ }), + +/***/ 762: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quartic + */ + +module.exports = { + + In: __webpack_require__(7337), + Out: __webpack_require__(9012), + InOut: __webpack_require__(4878) + +}; + + +/***/ }), + +/***/ 303: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quintic ease-in. + * + * @function Phaser.Math.Easing.Quintic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v * v * v * v; +}; + +module.exports = In; + + +/***/ }), + +/***/ 553: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quintic ease-in/out. + * + * @function Phaser.Math.Easing.Quintic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v * v * v * v; + } + else + { + return 0.5 * ((v -= 2) * v * v * v * v + 2); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 1632: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quintic ease-out. + * + * @function Phaser.Math.Easing.Quintic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return --v * v * v * v * v + 1; +}; + +module.exports = Out; + + +/***/ }), + +/***/ 345: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quintic + */ + +module.exports = { + + In: __webpack_require__(303), + Out: __webpack_require__(1632), + InOut: __webpack_require__(553) + +}; + + +/***/ }), + +/***/ 8455: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sinusoidal ease-in. + * + * @function Phaser.Math.Easing.Sine.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + return 1 - Math.cos(v * Math.PI / 2); + } +}; + +module.exports = In; + + +/***/ }), + +/***/ 1844: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sinusoidal ease-in/out. + * + * @function Phaser.Math.Easing.Sine.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + return 0.5 * (1 - Math.cos(Math.PI * v)); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 990: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sinusoidal ease-out. + * + * @function Phaser.Math.Easing.Sine.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + return Math.sin(v * Math.PI / 2); + } +}; + +module.exports = Out; + + +/***/ }), + +/***/ 8698: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Sine + */ + +module.exports = { + + In: __webpack_require__(8455), + Out: __webpack_require__(990), + InOut: __webpack_require__(1844) + +}; + + +/***/ }), + +/***/ 6745: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Stepped easing. + * + * @function Phaser.Math.Easing.Stepped + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [steps=1] - The number of steps in the ease. + * + * @return {number} The tweened value. + */ +var Stepped = function (v, steps) +{ + if (steps === undefined) { steps = 1; } + + if (v <= 0) + { + return 0; + } + else if (v >= 1) + { + return 1; + } + else + { + return (((steps * v) | 0) + 1) * (1 / steps); + } +}; + +module.exports = Stepped; + + +/***/ }), + +/***/ 7051: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Stepped + */ + +module.exports = __webpack_require__(6745); + + +/***/ }), + +/***/ 3158: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the fuzzy ceiling of the given value. + * + * @function Phaser.Math.Fuzzy.Ceil + * @since 3.0.0 + * + * @param {number} value - The value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {number} The fuzzy ceiling of the value. + */ +var Ceil = function (value, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return Math.ceil(value - epsilon); +}; + +module.exports = Ceil; + + +/***/ }), + +/***/ 12: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check whether the given values are fuzzily equal. + * + * Two numbers are fuzzily equal if their difference is less than `epsilon`. + * + * @function Phaser.Math.Fuzzy.Equal + * @since 3.0.0 + * + * @param {number} a - The first value. + * @param {number} b - The second value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`. + */ +var Equal = function (a, b, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return Math.abs(a - b) < epsilon; +}; + +module.exports = Equal; + + +/***/ }), + +/***/ 1326: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the fuzzy floor of the given value. + * + * @function Phaser.Math.Fuzzy.Floor + * @since 3.0.0 + * + * @param {number} value - The value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {number} The floor of the value. + */ +var Floor = function (value, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return Math.floor(value + epsilon); +}; + +module.exports = Floor; + + +/***/ }), + +/***/ 7373: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check whether `a` is fuzzily greater than `b`. + * + * `a` is fuzzily greater than `b` if it is more than `b - epsilon`. + * + * @function Phaser.Math.Fuzzy.GreaterThan + * @since 3.0.0 + * + * @param {number} a - The first value. + * @param {number} b - The second value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {boolean} `true` if `a` is fuzzily greater than than `b`, otherwise `false`. + */ +var GreaterThan = function (a, b, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return a > b - epsilon; +}; + +module.exports = GreaterThan; + + +/***/ }), + +/***/ 2622: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check whether `a` is fuzzily less than `b`. + * + * `a` is fuzzily less than `b` if it is less than `b + epsilon`. + * + * @function Phaser.Math.Fuzzy.LessThan + * @since 3.0.0 + * + * @param {number} a - The first value. + * @param {number} b - The second value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {boolean} `true` if `a` is fuzzily less than `b`, otherwise `false`. + */ +var LessThan = function (a, b, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return a < b + epsilon; +}; + +module.exports = LessThan; + + +/***/ }), + +/***/ 7927: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Fuzzy + */ + +module.exports = { + + Ceil: __webpack_require__(3158), + Equal: __webpack_require__(12), + Floor: __webpack_require__(1326), + GreaterThan: __webpack_require__(7373), + LessThan: __webpack_require__(2622) + +}; + + +/***/ }), + +/***/ 4675: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(7425); +var Extend = __webpack_require__(1030); + +/** + * @namespace Phaser.Math + */ + +var PhaserMath = { + + // Collections of functions + Angle: __webpack_require__(1833), + Distance: __webpack_require__(6338), + Easing: __webpack_require__(8613), + Fuzzy: __webpack_require__(7927), + Interpolation: __webpack_require__(2140), + Pow2: __webpack_require__(7897), + Snap: __webpack_require__(3943), + + // Expose the RNG Class + RandomDataGenerator: __webpack_require__(6957), + + // Single functions + Average: __webpack_require__(3136), + Bernstein: __webpack_require__(785), + Between: __webpack_require__(7025), + CatmullRom: __webpack_require__(48), + CeilTo: __webpack_require__(5035), + Clamp: __webpack_require__(2915), + DegToRad: __webpack_require__(7149), + Difference: __webpack_require__(2975), + Euler: __webpack_require__(2107), + Factorial: __webpack_require__(3916), + FloatBetween: __webpack_require__(104), + FloorTo: __webpack_require__(4941), + FromPercent: __webpack_require__(1555), + GetSpeed: __webpack_require__(5005), + IsEven: __webpack_require__(3702), + IsEvenStrict: __webpack_require__(8820), + Linear: __webpack_require__(1743), + LinearXY: __webpack_require__(3416), + MaxAdd: __webpack_require__(3733), + Median: __webpack_require__(44), + MinSub: __webpack_require__(5385), + Percent: __webpack_require__(8585), + RadToDeg: __webpack_require__(4208), + RandomXY: __webpack_require__(1705), + RandomXYZ: __webpack_require__(6650), + RandomXYZW: __webpack_require__(2037), + Rotate: __webpack_require__(6283), + RotateAround: __webpack_require__(9876), + RotateAroundDistance: __webpack_require__(8348), + RotateTo: __webpack_require__(4497), + RoundAwayFromZero: __webpack_require__(4078), + RoundTo: __webpack_require__(855), + SinCosTableGenerator: __webpack_require__(4936), + SmootherStep: __webpack_require__(278), + SmoothStep: __webpack_require__(2733), + ToXY: __webpack_require__(163), + TransformXY: __webpack_require__(7556), + Within: __webpack_require__(4119), + Wrap: __webpack_require__(8445), + + // Vector classes + Vector2: __webpack_require__(2529), + Vector3: __webpack_require__(5689), + Vector4: __webpack_require__(9279), + Matrix3: __webpack_require__(2149), + Matrix4: __webpack_require__(9652), + Quaternion: __webpack_require__(372), + RotateVec3: __webpack_require__(9640) + +}; + +// Merge in the consts + +PhaserMath = Extend(false, PhaserMath, CONST); + +// Export it + +module.exports = PhaserMath; + + +/***/ }), + +/***/ 1640: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bernstein = __webpack_require__(785); + +/** + * A bezier interpolation method. + * + * @function Phaser.Math.Interpolation.Bezier + * @since 3.0.0 + * + * @param {number[]} v - The input array of values to interpolate between. + * @param {number} k - The percentage of interpolation, between 0 and 1. + * + * @return {number} The interpolated value. + */ +var BezierInterpolation = function (v, k) +{ + var b = 0; + var n = v.length - 1; + + for (var i = 0; i <= n; i++) + { + b += Math.pow(1 - k, n - i) * Math.pow(k, i) * v[i] * Bernstein(n, i); + } + + return b; +}; + +module.exports = BezierInterpolation; + + +/***/ }), + +/***/ 6105: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CatmullRom = __webpack_require__(48); + +/** + * A Catmull-Rom interpolation method. + * + * @function Phaser.Math.Interpolation.CatmullRom + * @since 3.0.0 + * + * @param {number[]} v - The input array of values to interpolate between. + * @param {number} k - The percentage of interpolation, between 0 and 1. + * + * @return {number} The interpolated value. + */ +var CatmullRomInterpolation = function (v, k) +{ + var m = v.length - 1; + var f = m * k; + var i = Math.floor(f); + + if (v[0] === v[m]) + { + if (k < 0) + { + i = Math.floor(f = m * (1 + k)); + } + + return CatmullRom(f - i, v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m]); + } + else + { + if (k < 0) + { + return v[0] - (CatmullRom(-f, v[0], v[0], v[1], v[1]) - v[0]); + } + + if (k > 1) + { + return v[m] - (CatmullRom(f - m, v[m], v[m], v[m - 1], v[m - 1]) - v[m]); + } + + return CatmullRom(f - i, v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2]); + } +}; + +module.exports = CatmullRomInterpolation; + + +/***/ }), + +/***/ 4002: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @ignore + */ +function P0 (t, p) +{ + var k = 1 - t; + + return k * k * k * p; +} + +/** + * @ignore + */ +function P1 (t, p) +{ + var k = 1 - t; + + return 3 * k * k * t * p; +} + +/** + * @ignore + */ +function P2 (t, p) +{ + return 3 * (1 - t) * t * t * p; +} + +/** + * @ignore + */ +function P3 (t, p) +{ + return t * t * t * p; +} + +/** + * A cubic bezier interpolation method. + * + * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a + * + * @function Phaser.Math.Interpolation.CubicBezier + * @since 3.0.0 + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} p0 - The start point. + * @param {number} p1 - The first control point. + * @param {number} p2 - The second control point. + * @param {number} p3 - The end point. + * + * @return {number} The interpolated value. + */ +var CubicBezierInterpolation = function (t, p0, p1, p2, p3) +{ + return P0(t, p0) + P1(t, p1) + P2(t, p2) + P3(t, p3); +}; + +module.exports = CubicBezierInterpolation; + + +/***/ }), + +/***/ 6765: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Linear = __webpack_require__(1743); + +/** + * A linear interpolation method. + * + * @function Phaser.Math.Interpolation.Linear + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Linear_interpolation} + * + * @param {number[]} v - The input array of values to interpolate between. + * @param {!number} k - The percentage of interpolation, between 0 and 1. + * + * @return {!number} The interpolated value. + */ +var LinearInterpolation = function (v, k) +{ + var m = v.length - 1; + var f = m * k; + var i = Math.floor(f); + + if (k < 0) + { + return Linear(v[0], v[1], f); + } + else if (k > 1) + { + return Linear(v[m], v[m - 1], m - f); + } + else + { + return Linear(v[i], v[(i + 1 > m) ? m : i + 1], f - i); + } +}; + +module.exports = LinearInterpolation; + + +/***/ }), + +/***/ 6388: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @ignore + */ +function P0 (t, p) +{ + var k = 1 - t; + + return k * k * p; +} + +/** + * @ignore + */ +function P1 (t, p) +{ + return 2 * (1 - t) * t * p; +} + +/** + * @ignore + */ +function P2 (t, p) +{ + return t * t * p; +} + +// https://github.com/mrdoob/three.js/blob/master/src/extras/core/Interpolations.js + +/** + * A quadratic bezier interpolation method. + * + * @function Phaser.Math.Interpolation.QuadraticBezier + * @since 3.2.0 + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} p0 - The start point. + * @param {number} p1 - The control point. + * @param {number} p2 - The end point. + * + * @return {number} The interpolated value. + */ +var QuadraticBezierInterpolation = function (t, p0, p1, p2) +{ + return P0(t, p0) + P1(t, p1) + P2(t, p2); +}; + +module.exports = QuadraticBezierInterpolation; + + +/***/ }), + +/***/ 5735: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmoothStep = __webpack_require__(2733); + +/** + * A Smooth Step interpolation method. + * + * @function Phaser.Math.Interpolation.SmoothStep + * @since 3.9.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep} + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The interpolated value. + */ +var SmoothStepInterpolation = function (t, min, max) +{ + return min + (max - min) * SmoothStep(t, 0, 1); +}; + +module.exports = SmoothStepInterpolation; + + +/***/ }), + +/***/ 8705: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmootherStep = __webpack_require__(278); + +/** + * A Smoother Step interpolation method. + * + * @function Phaser.Math.Interpolation.SmootherStep + * @since 3.9.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The interpolated value. + */ +var SmootherStepInterpolation = function (t, min, max) +{ + return min + (max - min) * SmootherStep(t, 0, 1); +}; + +module.exports = SmootherStepInterpolation; + + +/***/ }), + +/***/ 2140: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Interpolation + */ + +module.exports = { + + Bezier: __webpack_require__(1640), + CatmullRom: __webpack_require__(6105), + CubicBezier: __webpack_require__(4002), + Linear: __webpack_require__(6765), + QuadraticBezier: __webpack_require__(6388), + SmoothStep: __webpack_require__(5735), + SmootherStep: __webpack_require__(8705) + +}; + + +/***/ }), + +/***/ 5443: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns the nearest power of 2 to the given `value`. + * + * @function Phaser.Math.Pow2.GetNext + * @since 3.0.0 + * + * @param {number} value - The value. + * + * @return {number} The nearest power of 2 to `value`. + */ +var GetPowerOfTwo = function (value) +{ + var index = Math.log(value) / 0.6931471805599453; + + return (1 << Math.ceil(index)); +}; + +module.exports = GetPowerOfTwo; + + +/***/ }), + +/***/ 725: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if the given `width` and `height` are a power of two. + * Useful for checking texture dimensions. + * + * @function Phaser.Math.Pow2.IsSize + * @since 3.0.0 + * + * @param {number} width - The width. + * @param {number} height - The height. + * + * @return {boolean} `true` if `width` and `height` are a power of two, otherwise `false`. + */ +var IsSizePowerOfTwo = function (width, height) +{ + return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0); +}; + +module.exports = IsSizePowerOfTwo; + + +/***/ }), + +/***/ 167: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Tests the value and returns `true` if it is a power of two. + * + * @function Phaser.Math.Pow2.IsValue + * @since 3.0.0 + * + * @param {number} value - The value to check if it's a power of two. + * + * @return {boolean} Returns `true` if `value` is a power of two, otherwise `false`. + */ +var IsValuePowerOfTwo = function (value) +{ + return (value > 0 && (value & (value - 1)) === 0); +}; + +module.exports = IsValuePowerOfTwo; + + +/***/ }), + +/***/ 7897: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Pow2 + */ + +module.exports = { + + GetNext: __webpack_require__(5443), + IsSize: __webpack_require__(725), + IsValue: __webpack_require__(167) + +}; + + +/***/ }), + +/***/ 6957: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A seeded Random Data Generator. + * + * Access via `Phaser.Math.RND` which is an instance of this class pre-defined + * by Phaser. Or, create your own instance to use as you require. + * + * The `Math.RND` generator is seeded by the Game Config property value `seed`. + * If no such config property exists, a random number is used. + * + * If you create your own instance of this class you should provide a seed for it. + * If no seed is given it will use a 'random' one based on Date.now. + * + * @class RandomDataGenerator + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {(string|string[])} [seeds] - The seeds to use for the random number generator. + */ +var RandomDataGenerator = new Class({ + + initialize: + + function RandomDataGenerator (seeds) + { + if (seeds === undefined) { seeds = [ (Date.now() * Math.random()).toString() ]; } + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#c + * @type {number} + * @default 1 + * @private + * @since 3.0.0 + */ + this.c = 1; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#s0 + * @type {number} + * @default 0 + * @private + * @since 3.0.0 + */ + this.s0 = 0; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#s1 + * @type {number} + * @default 0 + * @private + * @since 3.0.0 + */ + this.s1 = 0; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#s2 + * @type {number} + * @default 0 + * @private + * @since 3.0.0 + */ + this.s2 = 0; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#n + * @type {number} + * @default 0 + * @private + * @since 3.2.0 + */ + this.n = 0; + + /** + * Signs to choose from. + * + * @name Phaser.Math.RandomDataGenerator#signs + * @type {number[]} + * @since 3.0.0 + */ + this.signs = [ -1, 1 ]; + + if (seeds) + { + this.init(seeds); + } + }, + + /** + * Private random helper. + * + * @method Phaser.Math.RandomDataGenerator#rnd + * @since 3.0.0 + * @private + * + * @return {number} A random number. + */ + rnd: function () + { + var t = 2091639 * this.s0 + this.c * 2.3283064365386963e-10; // 2^-32 + + this.c = t | 0; + this.s0 = this.s1; + this.s1 = this.s2; + this.s2 = t - this.c; + + return this.s2; + }, + + /** + * Internal method that creates a seed hash. + * + * @method Phaser.Math.RandomDataGenerator#hash + * @since 3.0.0 + * @private + * + * @param {string} data - The value to hash. + * + * @return {number} The hashed value. + */ + hash: function (data) + { + var h; + var n = this.n; + + data = data.toString(); + + for (var i = 0; i < data.length; i++) + { + n += data.charCodeAt(i); + h = 0.02519603282416938 * n; + n = h >>> 0; + h -= n; + h *= n; + n = h >>> 0; + h -= n; + n += h * 0x100000000;// 2^32 + } + + this.n = n; + + return (n >>> 0) * 2.3283064365386963e-10;// 2^-32 + }, + + /** + * Initialize the state of the random data generator. + * + * @method Phaser.Math.RandomDataGenerator#init + * @since 3.0.0 + * + * @param {(string|string[])} seeds - The seeds to initialize the random data generator with. + */ + init: function (seeds) + { + if (typeof seeds === 'string') + { + this.state(seeds); + } + else + { + this.sow(seeds); + } + }, + + /** + * Reset the seed of the random data generator. + * + * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present. + * + * @method Phaser.Math.RandomDataGenerator#sow + * @since 3.0.0 + * + * @param {string[]} seeds - The array of seeds: the `toString()` of each value is used. + */ + sow: function (seeds) + { + // Always reset to default seed + this.n = 0xefc8249d; + this.s0 = this.hash(' '); + this.s1 = this.hash(' '); + this.s2 = this.hash(' '); + this.c = 1; + + if (!seeds) + { + return; + } + + // Apply any seeds + for (var i = 0; i < seeds.length && (seeds[i] != null); i++) + { + var seed = seeds[i]; + + this.s0 -= this.hash(seed); + this.s0 += ~~(this.s0 < 0); + this.s1 -= this.hash(seed); + this.s1 += ~~(this.s1 < 0); + this.s2 -= this.hash(seed); + this.s2 += ~~(this.s2 < 0); + } + }, + + /** + * Returns a random integer between 0 and 2^32. + * + * @method Phaser.Math.RandomDataGenerator#integer + * @since 3.0.0 + * + * @return {number} A random integer between 0 and 2^32. + */ + integer: function () + { + // 2^32 + return this.rnd() * 0x100000000; + }, + + /** + * Returns a random real number between 0 and 1. + * + * @method Phaser.Math.RandomDataGenerator#frac + * @since 3.0.0 + * + * @return {number} A random real number between 0 and 1. + */ + frac: function () + { + // 2^-53 + return this.rnd() + (this.rnd() * 0x200000 | 0) * 1.1102230246251565e-16; + }, + + /** + * Returns a random real number between 0 and 2^32. + * + * @method Phaser.Math.RandomDataGenerator#real + * @since 3.0.0 + * + * @return {number} A random real number between 0 and 2^32. + */ + real: function () + { + return this.integer() + this.frac(); + }, + + /** + * Returns a random integer between and including min and max. + * + * @method Phaser.Math.RandomDataGenerator#integerInRange + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random number between min and max. + */ + integerInRange: function (min, max) + { + return Math.floor(this.realInRange(0, max - min + 1) + min); + }, + + /** + * Returns a random integer between and including min and max. + * This method is an alias for RandomDataGenerator.integerInRange. + * + * @method Phaser.Math.RandomDataGenerator#between + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random number between min and max. + */ + between: function (min, max) + { + return Math.floor(this.realInRange(0, max - min + 1) + min); + }, + + /** + * Returns a random real number between min and max. + * + * @method Phaser.Math.RandomDataGenerator#realInRange + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random number between min and max. + */ + realInRange: function (min, max) + { + return this.frac() * (max - min) + min; + }, + + /** + * Returns a random real number between -1 and 1. + * + * @method Phaser.Math.RandomDataGenerator#normal + * @since 3.0.0 + * + * @return {number} A random real number between -1 and 1. + */ + normal: function () + { + return 1 - (2 * this.frac()); + }, + + /** + * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368 + * + * @method Phaser.Math.RandomDataGenerator#uuid + * @since 3.0.0 + * + * @return {string} A valid RFC4122 version4 ID hex string + */ + uuid: function () + { + var a = ''; + var b = ''; + + for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-') + { + // eslint-disable-next-line no-empty + } + + return b; + }, + + /** + * Returns a random element from within the given array. + * + * @method Phaser.Math.RandomDataGenerator#pick + * @since 3.0.0 + * + * @generic T + * @genericUse {T[]} - [array] + * @genericUse {T} - [$return] + * + * @param {T[]} array - The array to pick a random element from. + * + * @return {T} A random member of the array. + */ + pick: function (array) + { + return array[this.integerInRange(0, array.length - 1)]; + }, + + /** + * Returns a sign to be used with multiplication operator. + * + * @method Phaser.Math.RandomDataGenerator#sign + * @since 3.0.0 + * + * @return {number} -1 or +1. + */ + sign: function () + { + return this.pick(this.signs); + }, + + /** + * Returns a random element from within the given array, favoring the earlier entries. + * + * @method Phaser.Math.RandomDataGenerator#weightedPick + * @since 3.0.0 + * + * @generic T + * @genericUse {T[]} - [array] + * @genericUse {T} - [$return] + * + * @param {T[]} array - The array to pick a random element from. + * + * @return {T} A random member of the array. + */ + weightedPick: function (array) + { + return array[~~(Math.pow(this.frac(), 2) * (array.length - 1) + 0.5)]; + }, + + /** + * Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified. + * + * @method Phaser.Math.RandomDataGenerator#timestamp + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random timestamp between min and max. + */ + timestamp: function (min, max) + { + return this.realInRange(min || 946684800000, max || 1577862000000); + }, + + /** + * Returns a random angle between -180 and 180. + * + * @method Phaser.Math.RandomDataGenerator#angle + * @since 3.0.0 + * + * @return {number} A random number between -180 and 180. + */ + angle: function () + { + return this.integerInRange(-180, 180); + }, + + /** + * Returns a random rotation in radians, between -3.141 and 3.141 + * + * @method Phaser.Math.RandomDataGenerator#rotation + * @since 3.0.0 + * + * @return {number} A random number between -3.141 and 3.141 + */ + rotation: function () + { + return this.realInRange(-3.1415926, 3.1415926); + }, + + /** + * Gets or Sets the state of the generator. This allows you to retain the values + * that the generator is using between games, i.e. in a game save file. + * + * To seed this generator with a previously saved state you can pass it as the + * `seed` value in your game config, or call this method directly after Phaser has booted. + * + * Call this method with no parameters to return the current state. + * + * If providing a state it should match the same format that this method + * returns, which is a string with a header `!rnd` followed by the `c`, + * `s0`, `s1` and `s2` values respectively, each comma-delimited. + * + * @method Phaser.Math.RandomDataGenerator#state + * @since 3.0.0 + * + * @param {string} [state] - Generator state to be set. + * + * @return {string} The current state of the generator. + */ + state: function (state) + { + if (typeof state === 'string' && state.match(/^!rnd/)) + { + state = state.split(','); + + this.c = parseFloat(state[1]); + this.s0 = parseFloat(state[2]); + this.s1 = parseFloat(state[3]); + this.s2 = parseFloat(state[4]); + } + + return [ '!rnd', this.c, this.s0, this.s1, this.s2 ].join(','); + }, + + /** + * Shuffles the given array, using the current seed. + * + * @method Phaser.Math.RandomDataGenerator#shuffle + * @since 3.7.0 + * + * @generic T + * @genericUse {T[]} - [array,$return] + * + * @param {T[]} [array] - The array to be shuffled. + * + * @return {T[]} The shuffled array. + */ + shuffle: function (array) + { + var len = array.length - 1; + + for (var i = len; i > 0; i--) + { + var randomIndex = Math.floor(this.frac() * (i + 1)); + var itemAtIndex = array[randomIndex]; + + array[randomIndex] = array[i]; + array[i] = itemAtIndex; + } + + return array; + } + +}); + +module.exports = RandomDataGenerator; + + +/***/ }), + +/***/ 5659: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using ceil. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`. + * As will `14` snap to `15`... but `16` will snap to `20`. + * + * @function Phaser.Math.Snap.Ceil + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapCeil = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.ceil(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapCeil; + + +/***/ }), + +/***/ 5461: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using floor. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`. + * As will `14` snap to `10`... but `16` will snap to `15`. + * + * @function Phaser.Math.Snap.Floor + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapFloor = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.floor(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapFloor; + + +/***/ }), + +/***/ 5131: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using rounding. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10` whereas `14` will snap to `15`. + * + * @function Phaser.Math.Snap.To + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapTo = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.round(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapTo; + + +/***/ }), + +/***/ 3943: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Snap + */ + +module.exports = { + + Ceil: __webpack_require__(5659), + Floor: __webpack_require__(5461), + To: __webpack_require__(5131) + +}; + + +/***/ }), + +/***/ 8666: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** +* @author Richard Davey +* @copyright 2013-2023 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A Global Plugin is installed just once into the Game owned Plugin Manager. + * It can listen for Game events and respond to them. + * + * @class BasePlugin + * @memberof Phaser.Plugins + * @constructor + * @since 3.8.0 + * + * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager. + */ +var BasePlugin = new Class({ + + initialize: + + function BasePlugin (pluginManager) + { + /** + * A handy reference to the Plugin Manager that is responsible for this plugin. + * Can be used as a route to gain access to game systems and events. + * + * @name Phaser.Plugins.BasePlugin#pluginManager + * @type {Phaser.Plugins.PluginManager} + * @protected + * @since 3.8.0 + */ + this.pluginManager = pluginManager; + + /** + * A reference to the Game instance this plugin is running under. + * + * @name Phaser.Plugins.BasePlugin#game + * @type {Phaser.Game} + * @protected + * @since 3.8.0 + */ + this.game = pluginManager.game; + }, + + /** + * The PluginManager calls this method on a Global Plugin when the plugin is first instantiated. + * It will never be called again on this instance. + * In here you can set-up whatever you need for this plugin to run. + * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this. + * On a Scene Plugin, this method is never called. Use {@link Phaser.Plugins.ScenePlugin#boot} instead. + * + * @method Phaser.Plugins.BasePlugin#init + * @since 3.8.0 + * + * @param {?any} [data] - A value specified by the user, if any, from the `data` property of the plugin's configuration object (if started at game boot) or passed in the PluginManager's `install` method (if started manually). + */ + init: function () + { + }, + + /** + * The PluginManager calls this method on a Global Plugin when the plugin is started. + * If a plugin is stopped, and then started again, this will get called again. + * Typically called immediately after `BasePlugin.init`. + * On a Scene Plugin, this method is never called. + * + * @method Phaser.Plugins.BasePlugin#start + * @since 3.8.0 + */ + start: function () + { + // Here are the game-level events you can listen to. + // At the very least you should offer a destroy handler for when the game closes down. + + // var eventEmitter = this.game.events; + + // eventEmitter.once('destroy', this.gameDestroy, this); + // eventEmitter.on('pause', this.gamePause, this); + // eventEmitter.on('resume', this.gameResume, this); + // eventEmitter.on('resize', this.gameResize, this); + // eventEmitter.on('prestep', this.gamePreStep, this); + // eventEmitter.on('step', this.gameStep, this); + // eventEmitter.on('poststep', this.gamePostStep, this); + // eventEmitter.on('prerender', this.gamePreRender, this); + // eventEmitter.on('postrender', this.gamePostRender, this); + }, + + /** + * The PluginManager calls this method on a Global Plugin when the plugin is stopped. + * The game code has requested that your plugin stop doing whatever it does. + * It is now considered as 'inactive' by the PluginManager. + * Handle that process here (i.e. stop listening for events, etc) + * If the plugin is started again then `BasePlugin.start` will be called again. + * On a Scene Plugin, this method is never called. + * + * @method Phaser.Plugins.BasePlugin#stop + * @since 3.8.0 + */ + stop: function () + { + }, + + /** + * Game instance has been destroyed. + * You must release everything in here, all references, all objects, free it all up. + * + * @method Phaser.Plugins.BasePlugin#destroy + * @since 3.8.0 + */ + destroy: function () + { + this.pluginManager = null; + this.game = null; + this.scene = null; + this.systems = null; + } + +}); + +module.exports = BasePlugin; + + +/***/ }), + +/***/ 8456: +/***/ ((module) => { /** * @author Richard Davey @@ -57122,328 +57989,152 @@ module.exports = PluginCache; /***/ }), -/* 332 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 5722: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ +* @author Richard Davey +* @copyright 2013-2023 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ -var Class = __webpack_require__(0); +var BasePlugin = __webpack_require__(8666); +var Class = __webpack_require__(7473); +var SceneEvents = __webpack_require__(204); /** * @classdesc - * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect - * a visible pixel from the geometry mask. The mask is essentially a clipping path which can only - * make a masked pixel fully visible or fully invisible without changing its alpha (opacity). + * A Scene Level Plugin is installed into every Scene and belongs to that Scene. + * It can listen for Scene events and respond to them. + * It can map itself to a Scene property, or into the Scene Systems, or both. * - * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) - * should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed - * if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and - * alpha of the pixel from the Geometry Mask do not matter. - * - * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. - * Moving or transforming the underlying Graphics object will change the mask (and affect the visibility - * of any masked objects), whereas moving or transforming a masked object will not affect the mask. - * You can think of the Geometry Mask (or rather, of its Graphics object) as an invisible curtain placed - * in front of all masked objects which has its own visual properties and, naturally, respects the camera's - * visual properties, but isn't affected by and doesn't follow the masked objects by itself. - * - * @class GeometryMask - * @memberof Phaser.Display.Masks + * @class ScenePlugin + * @memberof Phaser.Plugins + * @extends Phaser.Plugins.BasePlugin * @constructor - * @since 3.0.0 + * @since 3.8.0 * - * @param {Phaser.Scene} scene - This parameter is not used. - * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List. + * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin. + * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager. + * @param {string} pluginKey - The key under which this plugin has been installed into the Scene Systems. */ -var GeometryMask = new Class({ +var ScenePlugin = new Class({ + + Extends: BasePlugin, initialize: - function GeometryMask (scene, graphicsGeometry) + function ScenePlugin (scene, pluginManager, pluginKey) { - /** - * The Graphics object which describes the Geometry Mask. - * - * @name Phaser.Display.Masks.GeometryMask#geometryMask - * @type {Phaser.GameObjects.Graphics} - * @since 3.0.0 - */ - this.geometryMask = graphicsGeometry; + BasePlugin.call(this, pluginManager); /** - * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels - * drawn to the Geometry Mask. + * A reference to the Scene that has installed this plugin. + * Only set if it's a Scene Plugin, otherwise `null`. + * This property is only set when the plugin is instantiated and added to the Scene, not before. + * You can use it during the `boot` method. * - * This is a WebGL only feature. - * - * @name Phaser.Display.Masks.GeometryMask#invertAlpha - * @type {boolean} - * @since 3.16.0 + * @name Phaser.Plugins.ScenePlugin#scene + * @type {?Phaser.Scene} + * @protected + * @since 3.8.0 */ - this.invertAlpha = false; + this.scene = scene; /** - * Is this mask a stencil mask? + * A reference to the Scene Systems of the Scene that has installed this plugin. + * Only set if it's a Scene Plugin, otherwise `null`. + * This property is only set when the plugin is instantiated and added to the Scene, not before. + * You can use it during the `boot` method. * - * @name Phaser.Display.Masks.GeometryMask#isStencil - * @type {boolean} + * @name Phaser.Plugins.ScenePlugin#systems + * @type {?Phaser.Scenes.Systems} + * @protected + * @since 3.8.0 + */ + this.systems = scene.sys; + + /** + * The key under which this plugin was installed into the Scene Systems. + * + * This property is only set when the plugin is instantiated and added to the Scene, not before. + * You can use it during the `boot` method. + * + * @name Phaser.Plugins.ScenePlugin#pluginKey + * @type {string} * @readonly - * @since 3.17.0 + * @since 3.54.0 */ - this.isStencil = true; + this.pluginKey = pluginKey; - /** - * The current stencil level. - * - * @name Phaser.Display.Masks.GeometryMask#level - * @type {boolean} - * @private - * @since 3.17.0 - */ - this.level = 0; + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); }, /** - * Sets a new Graphics object for the Geometry Mask. + * This method is called when the Scene boots. It is only ever called once. * - * @method Phaser.Display.Masks.GeometryMask#setShape - * @since 3.0.0 + * By this point the plugin properties `scene` and `systems` will have already been set. * - * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. + * In here you can listen for {@link Phaser.Scenes.Events Scene events} and set-up whatever you need for this plugin to run. + * Here are the Scene events you can listen to: * - * @return {this} This Geometry Mask + * - start + * - ready + * - preupdate + * - update + * - postupdate + * - resize + * - pause + * - resume + * - sleep + * - wake + * - transitioninit + * - transitionstart + * - transitioncomplete + * - transitionout + * - shutdown + * - destroy + * + * At the very least you should offer a destroy handler for when the Scene closes down, i.e: + * + * ```javascript + * var eventEmitter = this.systems.events; + * eventEmitter.once('destroy', this.sceneDestroy, this); + * ``` + * + * @method Phaser.Plugins.ScenePlugin#boot + * @since 3.8.0 */ - setShape: function (graphicsGeometry) + boot: function () { - this.geometryMask = graphicsGeometry; - - return this; }, /** - * Sets the `invertAlpha` property of this Geometry Mask. + * Game instance has been destroyed. * - * Inverting the alpha essentially flips the way the mask works. + * You must release everything in here, all references, all objects, free it all up. * - * This is a WebGL only feature. - * - * @method Phaser.Display.Masks.GeometryMask#setInvertAlpha - * @since 3.17.0 - * - * @param {boolean} [value=true] - Invert the alpha of this mask? - * - * @return {this} This Geometry Mask - */ - setInvertAlpha: function (value) - { - if (value === undefined) { value = true; } - - this.invertAlpha = value; - - return this; - }, - - /** - * Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask. - * - * @method Phaser.Display.Masks.GeometryMask#preRenderWebGL - * @since 3.0.0 - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. - * @param {Phaser.GameObjects.GameObject} child - The Game Object being rendered. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. - */ - preRenderWebGL: function (renderer, child, camera) - { - var gl = renderer.gl; - - // Force flushing before drawing to stencil buffer - renderer.flush(); - - if (renderer.maskStack.length === 0) - { - gl.enable(gl.STENCIL_TEST); - gl.clear(gl.STENCIL_BUFFER_BIT); - - renderer.maskCount = 0; - } - - if (renderer.currentCameraMask.mask !== this) - { - renderer.currentMask.mask = this; - } - - renderer.maskStack.push({ mask: this, camera: camera }); - - this.applyStencil(renderer, camera, true); - - renderer.maskCount++; - }, - - /** - * Applies the current stencil mask to the renderer. - * - * @method Phaser.Display.Masks.GeometryMask#applyStencil - * @since 3.17.0 - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. - * @param {boolean} inc - Is this an INCR stencil or a DECR stencil? - */ - applyStencil: function (renderer, camera, inc) - { - var gl = renderer.gl; - var geometryMask = this.geometryMask; - var level = renderer.maskCount; - - gl.colorMask(false, false, false, false); - - if (inc) - { - gl.stencilFunc(gl.EQUAL, level, 0xFF); - gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL, level + 1, 0xFF); - gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR); - } - - // Write stencil buffer - geometryMask.renderWebGL(renderer, geometryMask, camera); - - renderer.flush(); - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); - - if (inc) - { - if (this.invertAlpha) - { - gl.stencilFunc(gl.NOTEQUAL, level + 1, 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL, level + 1, 0xFF); - } - } - else if (this.invertAlpha) - { - gl.stencilFunc(gl.NOTEQUAL, level, 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL, level, 0xFF); - } - }, - - /** - * Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it. - * - * @method Phaser.Display.Masks.GeometryMask#postRenderWebGL - * @since 3.0.0 - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw flush. - */ - postRenderWebGL: function (renderer) - { - var gl = renderer.gl; - - renderer.maskStack.pop(); - - renderer.maskCount--; - - // Force flush before disabling stencil test - renderer.flush(); - - var current = renderer.currentMask; - - if (renderer.maskStack.length === 0) - { - // If this is the only mask in the stack, flush and disable - current.mask = null; - - gl.disable(gl.STENCIL_TEST); - } - else - { - var prev = renderer.maskStack[renderer.maskStack.length - 1]; - - prev.mask.applyStencil(renderer, prev.camera, false); - - if (renderer.currentCameraMask.mask !== prev.mask) - { - current.mask = prev.mask; - current.camera = prev.camera; - } - else - { - current.mask = null; - } - } - }, - - /** - * Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object. - * - * @method Phaser.Display.Masks.GeometryMask#preRenderCanvas - * @since 3.0.0 - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance to set the clipping path on. - * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. - */ - preRenderCanvas: function (renderer, mask, camera) - { - var geometryMask = this.geometryMask; - - renderer.currentContext.save(); - - geometryMask.renderCanvas(renderer, geometryMask, camera, null, null, true); - - renderer.currentContext.clip(); - }, - - /** - * Restore the canvas context's previous clipping path, thus turning off the mask for it. - * - * @method Phaser.Display.Masks.GeometryMask#postRenderCanvas - * @since 3.0.0 - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance being restored. - */ - postRenderCanvas: function (renderer) - { - renderer.currentContext.restore(); - }, - - /** - * Destroys this GeometryMask and nulls any references it holds. - * - * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, - * so be sure to call `clearMask` on any Game Object using it, before destroying it. - * - * @method Phaser.Display.Masks.GeometryMask#destroy - * @since 3.7.0 + * @method Phaser.Plugins.ScenePlugin#destroy + * @since 3.8.0 */ destroy: function () { - this.geometryMask = null; + this.pluginManager = null; + this.game = null; + this.scene = null; + this.systems = null; } }); -module.exports = GeometryMask; +module.exports = ScenePlugin; /***/ }), -/* 333 */ -/***/ (function(module, exports) { + +/***/ 8351: +/***/ ((module) => { /** * @author Richard Davey @@ -57452,201 +58143,338 @@ module.exports = GeometryMask; */ /** - * Provides methods used for getting and setting the origin of a Game Object. - * Values are normalized, given in the range 0 to 1. - * Display values contain the calculated pixel values. - * Should be applied as a mixin and not used directly. + * Phaser Blend Modes. * - * @namespace Phaser.GameObjects.Components.Origin + * @namespace Phaser.BlendModes * @since 3.0.0 */ -var Origin = { +module.exports = { /** - * A property indicating that a Game Object has this component. + * Skips the Blend Mode check in the renderer. * - * @name Phaser.GameObjects.Components.Origin#_originComponent - * @type {boolean} - * @private - * @default true - * @since 3.2.0 - */ - _originComponent: true, - - /** - * The horizontal origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the left of the Game Object. - * - * @name Phaser.GameObjects.Components.Origin#originX + * @name Phaser.BlendModes.SKIP_CHECK * @type {number} - * @default 0.5 + * @const * @since 3.0.0 */ - originX: 0.5, + SKIP_CHECK: -1, /** - * The vertical origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the top of the Game Object. + * Normal blend mode. For Canvas and WebGL. + * This is the default setting and draws new shapes on top of the existing canvas content. * - * @name Phaser.GameObjects.Components.Origin#originY + * @name Phaser.BlendModes.NORMAL * @type {number} - * @default 0.5 + * @const * @since 3.0.0 */ - originY: 0.5, - - // private + read only - _displayOriginX: 0, - _displayOriginY: 0, + NORMAL: 0, /** - * The horizontal display origin of this Game Object. - * The origin is a normalized value between 0 and 1. - * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + * Add blend mode. For Canvas and WebGL. + * Where both shapes overlap the color is determined by adding color values. * - * @name Phaser.GameObjects.Components.Origin#displayOriginX + * @name Phaser.BlendModes.ADD * @type {number} + * @const * @since 3.0.0 */ - displayOriginX: { - - get: function () - { - return this._displayOriginX; - }, - - set: function (value) - { - this._displayOriginX = value; - this.originX = value / this.width; - } - - }, + ADD: 1, /** - * The vertical display origin of this Game Object. - * The origin is a normalized value between 0 and 1. - * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + * Multiply blend mode. For Canvas and WebGL. + * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. * - * @name Phaser.GameObjects.Components.Origin#displayOriginY + * @name Phaser.BlendModes.MULTIPLY * @type {number} + * @const * @since 3.0.0 */ - displayOriginY: { - - get: function () - { - return this._displayOriginY; - }, - - set: function (value) - { - this._displayOriginY = value; - this.originY = value / this.height; - } - - }, + MULTIPLY: 2, /** - * Sets the origin of this Game Object. + * Screen blend mode. For Canvas and WebGL. + * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) * - * The values are given in the range 0 to 1. - * - * @method Phaser.GameObjects.Components.Origin#setOrigin + * @name Phaser.BlendModes.SCREEN + * @type {number} + * @const * @since 3.0.0 - * - * @param {number} [x=0.5] - The horizontal origin value. - * @param {number} [y=x] - The vertical origin value. If not defined it will be set to the value of `x`. - * - * @return {this} This Game Object instance. */ - setOrigin: function (x, y) - { - if (x === undefined) { x = 0.5; } - if (y === undefined) { y = x; } - - this.originX = x; - this.originY = y; - - return this.updateDisplayOrigin(); - }, + SCREEN: 3, /** - * Sets the origin of this Game Object based on the Pivot values in its Frame. + * Overlay blend mode. For Canvas only. + * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. * - * @method Phaser.GameObjects.Components.Origin#setOriginFromFrame + * @name Phaser.BlendModes.OVERLAY + * @type {number} + * @const * @since 3.0.0 - * - * @return {this} This Game Object instance. */ - setOriginFromFrame: function () - { - if (!this.frame || !this.frame.customPivot) - { - return this.setOrigin(); - } - else - { - this.originX = this.frame.pivotX; - this.originY = this.frame.pivotY; - } - - return this.updateDisplayOrigin(); - }, + OVERLAY: 4, /** - * Sets the display origin of this Game Object. - * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * Darken blend mode. For Canvas only. + * Retains the darkest pixels of both layers. * - * @method Phaser.GameObjects.Components.Origin#setDisplayOrigin + * @name Phaser.BlendModes.DARKEN + * @type {number} + * @const * @since 3.0.0 - * - * @param {number} [x=0] - The horizontal display origin value. - * @param {number} [y=x] - The vertical display origin value. If not defined it will be set to the value of `x`. - * - * @return {this} This Game Object instance. */ - setDisplayOrigin: function (x, y) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = x; } - - this.displayOriginX = x; - this.displayOriginY = y; - - return this; - }, + DARKEN: 5, /** - * Updates the Display Origin cached values internally stored on this Game Object. - * You don't usually call this directly, but it is exposed for edge-cases where you may. + * Lighten blend mode. For Canvas only. + * Retains the lightest pixels of both layers. * - * @method Phaser.GameObjects.Components.Origin#updateDisplayOrigin + * @name Phaser.BlendModes.LIGHTEN + * @type {number} + * @const * @since 3.0.0 - * - * @return {this} This Game Object instance. */ - updateDisplayOrigin: function () - { - this._displayOriginX = this.originX * this.width; - this._displayOriginY = this.originY * this.height; + LIGHTEN: 6, - return this; - } + /** + * Color Dodge blend mode. For Canvas only. + * Divides the bottom layer by the inverted top layer. + * + * @name Phaser.BlendModes.COLOR_DODGE + * @type {number} + * @const + * @since 3.0.0 + */ + COLOR_DODGE: 7, + + /** + * Color Burn blend mode. For Canvas only. + * Divides the inverted bottom layer by the top layer, and then inverts the result. + * + * @name Phaser.BlendModes.COLOR_BURN + * @type {number} + * @const + * @since 3.0.0 + */ + COLOR_BURN: 8, + + /** + * Hard Light blend mode. For Canvas only. + * A combination of multiply and screen like overlay, but with top and bottom layer swapped. + * + * @name Phaser.BlendModes.HARD_LIGHT + * @type {number} + * @const + * @since 3.0.0 + */ + HARD_LIGHT: 9, + + /** + * Soft Light blend mode. For Canvas only. + * A softer version of hard-light. Pure black or white does not result in pure black or white. + * + * @name Phaser.BlendModes.SOFT_LIGHT + * @type {number} + * @const + * @since 3.0.0 + */ + SOFT_LIGHT: 10, + + /** + * Difference blend mode. For Canvas only. + * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. + * + * @name Phaser.BlendModes.DIFFERENCE + * @type {number} + * @const + * @since 3.0.0 + */ + DIFFERENCE: 11, + + /** + * Exclusion blend mode. For Canvas only. + * Like difference, but with lower contrast. + * + * @name Phaser.BlendModes.EXCLUSION + * @type {number} + * @const + * @since 3.0.0 + */ + EXCLUSION: 12, + + /** + * Hue blend mode. For Canvas only. + * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. + * + * @name Phaser.BlendModes.HUE + * @type {number} + * @const + * @since 3.0.0 + */ + HUE: 13, + + /** + * Saturation blend mode. For Canvas only. + * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. + * + * @name Phaser.BlendModes.SATURATION + * @type {number} + * @const + * @since 3.0.0 + */ + SATURATION: 14, + + /** + * Color blend mode. For Canvas only. + * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. + * + * @name Phaser.BlendModes.COLOR + * @type {number} + * @const + * @since 3.0.0 + */ + COLOR: 15, + + /** + * Luminosity blend mode. For Canvas only. + * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. + * + * @name Phaser.BlendModes.LUMINOSITY + * @type {number} + * @const + * @since 3.0.0 + */ + LUMINOSITY: 16, + + /** + * Alpha erase blend mode. For Canvas and WebGL. + * + * @name Phaser.BlendModes.ERASE + * @type {number} + * @const + * @since 3.0.0 + */ + ERASE: 17, + + /** + * Source-in blend mode. For Canvas only. + * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. + * + * @name Phaser.BlendModes.SOURCE_IN + * @type {number} + * @const + * @since 3.0.0 + */ + SOURCE_IN: 18, + + /** + * Source-out blend mode. For Canvas only. + * The new shape is drawn where it doesn't overlap the existing canvas content. + * + * @name Phaser.BlendModes.SOURCE_OUT + * @type {number} + * @const + * @since 3.0.0 + */ + SOURCE_OUT: 19, + + /** + * Source-out blend mode. For Canvas only. + * The new shape is only drawn where it overlaps the existing canvas content. + * + * @name Phaser.BlendModes.SOURCE_ATOP + * @type {number} + * @const + * @since 3.0.0 + */ + SOURCE_ATOP: 20, + + /** + * Destination-over blend mode. For Canvas only. + * New shapes are drawn behind the existing canvas content. + * + * @name Phaser.BlendModes.DESTINATION_OVER + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_OVER: 21, + + /** + * Destination-in blend mode. For Canvas only. + * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. + * + * @name Phaser.BlendModes.DESTINATION_IN + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_IN: 22, + + /** + * Destination-out blend mode. For Canvas only. + * The existing content is kept where it doesn't overlap the new shape. + * + * @name Phaser.BlendModes.DESTINATION_OUT + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_OUT: 23, + + /** + * Destination-out blend mode. For Canvas only. + * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. + * + * @name Phaser.BlendModes.DESTINATION_ATOP + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_ATOP: 24, + + /** + * Lighten blend mode. For Canvas only. + * Where both shapes overlap the color is determined by adding color values. + * + * @name Phaser.BlendModes.LIGHTER + * @type {number} + * @const + * @since 3.0.0 + */ + LIGHTER: 25, + + /** + * Copy blend mode. For Canvas only. + * Only the new shape is shown. + * + * @name Phaser.BlendModes.COPY + * @type {number} + * @const + * @since 3.0.0 + */ + COPY: 26, + + /** + * Xor blend mode. For Canvas only. + * Shapes are made transparent where both overlap and drawn normal everywhere else. + * + * @name Phaser.BlendModes.XOR + * @type {number} + * @const + * @since 3.0.0 + */ + XOR: 27 }; -module.exports = Origin; - /***/ }), -/* 334 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8196: +/***/ ((module) => { /** * @author Richard Davey @@ -57654,428 +58482,1727 @@ module.exports = Origin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DegToRad = __webpack_require__(21); -var GetBoolean = __webpack_require__(335); -var GetValue = __webpack_require__(10); -var TWEEN_CONST = __webpack_require__(336); -var Vector2 = __webpack_require__(3); - /** - * Provides methods used for managing a Game Object following a Path. - * Should be applied as a mixin and not used directly. + * Phaser Scale Modes. * - * @namespace Phaser.GameObjects.Components.PathFollower - * @since 3.17.0 + * @namespace Phaser.ScaleModes + * @since 3.0.0 */ -var PathFollower = { +var ScaleModes = { /** - * The Path this PathFollower is following. It can only follow one Path at a time. + * Default Scale Mode (Linear). * - * @name Phaser.GameObjects.Components.PathFollower#path - * @type {Phaser.Curves.Path} - * @since 3.0.0 - */ - path: null, - - /** - * Should the PathFollower automatically rotate to point in the direction of the Path? - * - * @name Phaser.GameObjects.Components.PathFollower#rotateToPath - * @type {boolean} - * @default false - * @since 3.0.0 - */ - rotateToPath: false, - - /** - * If the PathFollower is rotating to match the Path (@see Phaser.GameObjects.PathFollower#rotateToPath) - * this value is added to the rotation value. This allows you to rotate objects to a path but control - * the angle of the rotation as well. - * - * @name Phaser.GameObjects.PathFollower#pathRotationOffset + * @name Phaser.ScaleModes.DEFAULT * @type {number} - * @default 0 + * @readonly * @since 3.0.0 */ - pathRotationOffset: 0, + DEFAULT: 0, /** - * An additional vector to add to the PathFollowers position, allowing you to offset it from the - * Path coordinates. + * Linear Scale Mode. * - * @name Phaser.GameObjects.PathFollower#pathOffset - * @type {Phaser.Math.Vector2} - * @since 3.0.0 - */ - pathOffset: null, - - /** - * A Vector2 that stores the current point of the path the follower is on. - * - * @name Phaser.GameObjects.PathFollower#pathVector - * @type {Phaser.Math.Vector2} - * @since 3.0.0 - */ - pathVector: null, - - /** - * The distance the follower has traveled from the previous point to the current one, at the last update. - * - * @name Phaser.GameObjects.PathFollower#pathDelta - * @type {Phaser.Math.Vector2} - * @since 3.23.0 - */ - pathDelta: null, - - /** - * The Tween used for following the Path. - * - * @name Phaser.GameObjects.PathFollower#pathTween - * @type {Phaser.Tweens.Tween} - * @since 3.0.0 - */ - pathTween: null, - - /** - * Settings for the PathFollower. - * - * @name Phaser.GameObjects.PathFollower#pathConfig - * @type {?Phaser.Types.GameObjects.PathFollower.PathConfig} - * @default null - * @since 3.0.0 - */ - pathConfig: null, - - /** - * Records the direction of the follower so it can change direction. - * - * @name Phaser.GameObjects.PathFollower#_prevDirection + * @name Phaser.ScaleModes.LINEAR * @type {number} - * @private + * @readonly * @since 3.0.0 */ - _prevDirection: TWEEN_CONST.PLAYING_FORWARD, + LINEAR: 0, /** - * Set the Path that this PathFollower should follow. + * Nearest Scale Mode. * - * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings. - * - * @method Phaser.GameObjects.Components.PathFollower#setPath + * @name Phaser.ScaleModes.NEAREST + * @type {number} + * @readonly * @since 3.0.0 - * - * @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time. - * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config] - Settings for the PathFollower. - * - * @return {this} This Game Object. */ - setPath: function (path, config) - { - if (config === undefined) { config = this.pathConfig; } - - var tween = this.pathTween; - - if (tween && tween.isPlaying()) - { - tween.stop(); - } - - this.path = path; - - if (config) - { - this.startFollow(config); - } - - return this; - }, - - /** - * Set whether the PathFollower should automatically rotate to point in the direction of the Path. - * - * @method Phaser.GameObjects.Components.PathFollower#setRotateToPath - * @since 3.0.0 - * - * @param {boolean} value - Whether the PathFollower should automatically rotate to point in the direction of the Path. - * @param {number} [offset=0] - Rotation offset in degrees. - * - * @return {this} This Game Object. - */ - setRotateToPath: function (value, offset) - { - if (offset === undefined) { offset = 0; } - - this.rotateToPath = value; - - this.pathRotationOffset = offset; - - return this; - }, - - /** - * Is this PathFollower actively following a Path or not? - * - * To be considered as `isFollowing` it must be currently moving on a Path, and not paused. - * - * @method Phaser.GameObjects.Components.PathFollower#isFollowing - * @since 3.0.0 - * - * @return {boolean} `true` is this PathFollower is actively following a Path, otherwise `false`. - */ - isFollowing: function () - { - var tween = this.pathTween; - - return (tween && tween.isPlaying()); - }, - - /** - * Starts this PathFollower following its given Path. - * - * @method Phaser.GameObjects.Components.PathFollower#startFollow - * @since 3.3.0 - * - * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config={}] - The duration of the follow, or a PathFollower config object. - * @param {number} [startAt=0] - Optional start position of the follow, between 0 and 1. - * - * @return {this} This Game Object. - */ - startFollow: function (config, startAt) - { - if (config === undefined) { config = {}; } - if (startAt === undefined) { startAt = 0; } - - var tween = this.pathTween; - - if (tween && tween.isPlaying()) - { - tween.stop(); - } - - if (typeof config === 'number') - { - config = { duration: config }; - } - - // Override in case they've been specified in the config - config.from = GetValue(config, 'from', 0); - config.to = GetValue(config, 'to', 1); - - var positionOnPath = GetBoolean(config, 'positionOnPath', false); - - this.rotateToPath = GetBoolean(config, 'rotateToPath', false); - this.pathRotationOffset = GetValue(config, 'rotationOffset', 0); - - // This works, but it's not an ideal way of doing it as the follower jumps position - var seek = GetValue(config, 'startAt', startAt); - - if (seek) - { - config.onStart = function (tween) - { - var tweenData = tween.data[0]; - tweenData.progress = seek; - tweenData.elapsed = tweenData.duration * seek; - var v = tweenData.ease(tweenData.progress); - tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); - tweenData.setTargetValue(); - }; - } - - if (!this.pathOffset) - { - this.pathOffset = new Vector2(this.x, this.y); - } - - if (!this.pathVector) - { - this.pathVector = new Vector2(); - } - - if (!this.pathDelta) - { - this.pathDelta = new Vector2(); - } - - this.pathDelta.reset(); - - config.persist = true; - - this.pathTween = this.scene.sys.tweens.addCounter(config); - - // The starting point of the path, relative to this follower - this.path.getStartPoint(this.pathOffset); - - if (positionOnPath) - { - this.x = this.pathOffset.x; - this.y = this.pathOffset.y; - } - - this.pathOffset.x = this.x - this.pathOffset.x; - this.pathOffset.y = this.y - this.pathOffset.y; - - this._prevDirection = TWEEN_CONST.PLAYING_FORWARD; - - if (this.rotateToPath) - { - // Set the rotation now (in case the tween has a delay on it, etc) - var nextPoint = this.path.getPoint(0.1); - - this.rotation = Math.atan2(nextPoint.y - this.y, nextPoint.x - this.x) + DegToRad(this.pathRotationOffset); - } - - this.pathConfig = config; - - return this; - }, - - /** - * Pauses this PathFollower. It will still continue to render, but it will remain motionless at the - * point on the Path at which you paused it. - * - * @method Phaser.GameObjects.Components.PathFollower#pauseFollow - * @since 3.3.0 - * - * @return {this} This Game Object. - */ - pauseFollow: function () - { - var tween = this.pathTween; - - if (tween && tween.isPlaying()) - { - tween.pause(); - } - - return this; - }, - - /** - * Resumes a previously paused PathFollower. - * - * If the PathFollower was not paused this has no effect. - * - * @method Phaser.GameObjects.Components.PathFollower#resumeFollow - * @since 3.3.0 - * - * @return {this} This Game Object. - */ - resumeFollow: function () - { - var tween = this.pathTween; - - if (tween && tween.isPaused()) - { - tween.resume(); - } - - return this; - }, - - /** - * Stops this PathFollower from following the path any longer. - * - * This will invoke any 'stop' conditions that may exist on the Path, or for the follower. - * - * @method Phaser.GameObjects.Components.PathFollower#stopFollow - * @since 3.3.0 - * - * @return {this} This Game Object. - */ - stopFollow: function () - { - var tween = this.pathTween; - - if (tween && tween.isPlaying()) - { - tween.stop(); - } - - return this; - }, - - /** - * Internal update handler that advances this PathFollower along the path. - * - * Called automatically by the Scene step, should not typically be called directly. - * - * @method Phaser.GameObjects.Components.PathFollower#pathUpdate - * @since 3.17.0 - */ - pathUpdate: function () - { - var tween = this.pathTween; - - if (tween) - { - var tweenData = tween.data[0]; - var pathDelta = this.pathDelta; - var pathVector = this.pathVector; - - pathDelta.copy(pathVector).negate(); - - if (tweenData.state === TWEEN_CONST.COMPLETE) - { - this.path.getPoint(tweenData.end, pathVector); - - pathDelta.add(pathVector); - pathVector.add(this.pathOffset); - - this.setPosition(pathVector.x, pathVector.y); - - return; - } - else if (tweenData.state !== TWEEN_CONST.PLAYING_FORWARD && tweenData.state !== TWEEN_CONST.PLAYING_BACKWARD) - { - // If delayed, etc then bail out - return; - } - - this.path.getPoint(tween.getValue(), pathVector); - - pathDelta.add(pathVector); - pathVector.add(this.pathOffset); - - var oldX = this.x; - var oldY = this.y; - - this.setPosition(pathVector.x, pathVector.y); - - var speedX = this.x - oldX; - var speedY = this.y - oldY; - - if (speedX === 0 && speedY === 0) - { - // Bail out early - return; - } - - if (tweenData.state !== this._prevDirection) - { - // We've changed direction, so don't do a rotate this frame - this._prevDirection = tweenData.state; - - return; - } - - if (this.rotateToPath) - { - this.rotation = Math.atan2(speedY, speedX) + DegToRad(this.pathRotationOffset); - } - } - } + NEAREST: 1 }; -module.exports = PathFollower; +module.exports = ScaleModes; /***/ }), -/* 335 */ -/***/ (function(module, exports) { + +/***/ 3527: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scale Manager Resize Event. + * + * This event is dispatched whenever the Scale Manager detects a resize event from the browser. + * It sends three parameters to the callback, each of them being Size components. You can read + * the `width`, `height`, `aspectRatio` and other properties of these components to help with + * scaling your own game content. + * + * @event Phaser.Scale.Events#RESIZE + * @type {string} + * @since 3.16.1 + * + * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas. + * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size. + * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode. + * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width. + * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height. + */ +module.exports = 'resize'; + + +/***/ }), + +/***/ 8618: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Added to Scene Event. + * + * This event is dispatched when a Game Object is added to a Scene. + * + * Listen for it from a Scene using `this.events.on('addedtoscene', listener)`. + * + * @event Phaser.Scenes.Events#ADDED_TO_SCENE + * @type {string} + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene. + * @param {Phaser.Scene} scene - The Scene to which the Game Object was added. + */ +module.exports = 'addedtoscene'; + + +/***/ }), + +/***/ 4328: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Boot Event. + * + * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins. + * + * Listen to it from a Scene using `this.events.on('boot', listener)`. + * + * @event Phaser.Scenes.Events#BOOT + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + */ +module.exports = 'boot'; + + +/***/ }), + +/***/ 6099: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Create Event. + * + * This event is dispatched by a Scene after it has been created by the Scene Manager. + * + * If a Scene has a `create` method then this event is emitted _after_ that has run. + * + * If there is a transition, this event will be fired after the `TRANSITION_START` event. + * + * Listen to it from a Scene using `this.events.on('create', listener)`. + * + * @event Phaser.Scenes.Events#CREATE + * @type {string} + * @since 3.17.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event. + */ +module.exports = 'create'; + + +/***/ }), + +/***/ 7645: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Destroy Event. + * + * This event is dispatched by a Scene during the Scene Systems destroy process. + * + * Listen to it from a Scene using `this.events.on('destroy', listener)`. + * + * You should destroy any resources that may be in use by your Scene in this event handler. + * + * @event Phaser.Scenes.Events#DESTROY + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + */ +module.exports = 'destroy'; + + +/***/ }), + +/***/ 2710: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Pause Event. + * + * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an + * action from another Scene. + * + * Listen to it from a Scene using `this.events.on('pause', listener)`. + * + * @event Phaser.Scenes.Events#PAUSE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was paused. + */ +module.exports = 'pause'; + + +/***/ }), + +/***/ 2547: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Post Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('postupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#POST_UPDATE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'postupdate'; + + +/***/ }), + +/***/ 8577: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Pre-Render Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to this event from a Scene using `this.events.on('prerender', listener)`. + * + * A Scene will only render if it is visible. + * + * This event is dispatched after the Scene Display List is sorted and before the Scene is rendered. + * + * @event Phaser.Scenes.Events#PRE_RENDER + * @type {string} + * @since 3.53.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. + */ +module.exports = 'prerender'; + + +/***/ }), + +/***/ 8197: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Pre Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('preupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#PRE_UPDATE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'preupdate'; + + +/***/ }), + +/***/ 8997: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Ready Event. + * + * This event is dispatched by a Scene during the Scene Systems start process. + * By this point in the process the Scene is now fully active and rendering. + * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event. + * + * Listen to it from a Scene using `this.events.on('ready', listener)`. + * + * @event Phaser.Scenes.Events#READY + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was started. + */ +module.exports = 'ready'; + + +/***/ }), + +/***/ 7604: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Removed from Scene Event. + * + * This event is dispatched when a Game Object is removed from a Scene. + * + * Listen for it from a Scene using `this.events.on('removedfromscene', listener)`. + * + * @event Phaser.Scenes.Events#REMOVED_FROM_SCENE + * @type {string} + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene. + * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed. + */ +module.exports = 'removedfromscene'; + + +/***/ }), + +/***/ 8999: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Render Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('render', listener)`. + * + * A Scene will only render if it is visible. + * + * By the time this event is dispatched, the Scene will have already been rendered. + * + * @event Phaser.Scenes.Events#RENDER + * @type {string} + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. + */ +module.exports = 'render'; + + +/***/ }), + +/***/ 9742: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Resume Event. + * + * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.events.on('resume', listener)`. + * + * @event Phaser.Scenes.Events#RESUME + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was resumed. + */ +module.exports = 'resume'; + + +/***/ }), + +/***/ 3667: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Shutdown Event. + * + * This event is dispatched by a Scene during the Scene Systems shutdown process. + * + * Listen to it from a Scene using `this.events.on('shutdown', listener)`. + * + * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding + * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not + * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources. + * + * @event Phaser.Scenes.Events#SHUTDOWN + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was shutdown. + */ +module.exports = 'shutdown'; + + +/***/ }), + +/***/ 3468: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Sleep Event. + * + * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.events.on('sleep', listener)`. + * + * @event Phaser.Scenes.Events#SLEEP + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was sent to sleep. + */ +module.exports = 'sleep'; + + +/***/ }), + +/***/ 7840: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Start Event. + * + * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins. + * + * Listen to it from a Scene using `this.events.on('start', listener)`. + * + * @event Phaser.Scenes.Events#START + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + */ +module.exports = 'start'; + + +/***/ }), + +/***/ 9896: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Complete Event. + * + * This event is dispatched by the Target Scene of a transition. + * + * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration + * of the transition. + * + * Listen to it from a Scene using `this.events.on('transitioncomplete', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_COMPLETE + * @type {string} + * @since 3.5.0 + * + * @param {Phaser.Scene} scene -The Scene on which the transitioned completed. + */ +module.exports = 'transitioncomplete'; + + +/***/ }), + +/***/ 5103: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Init Event. + * + * This event is dispatched by the Target Scene of a transition. + * + * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method, + * this event is not dispatched. + * + * Listen to it from a Scene using `this.events.on('transitioninit', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_INIT + * @type {string} + * @since 3.5.0 + * + * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitioninit'; + + +/***/ }), + +/***/ 3162: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Out Event. + * + * This event is dispatched by a Scene when it initiates a transition to another Scene. + * + * Listen to it from a Scene using `this.events.on('transitionout', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_OUT + * @type {string} + * @since 3.5.0 + * + * @param {Phaser.Scene} target - A reference to the Scene that is being transitioned to. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitionout'; + + +/***/ }), + +/***/ 7841: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Start Event. + * + * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep. + * + * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method, + * this event is dispatched anyway. + * + * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is + * dispatched instead of this event. + * + * Listen to it from a Scene using `this.events.on('transitionstart', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_START + * @type {string} + * @since 3.5.0 + * + * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitionstart'; + + +/***/ }), + +/***/ 6454: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Wake Event. + * + * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before + * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead. + * + * Listen to it from a Scene using `this.events.on('transitionwake', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_WAKE + * @type {string} + * @since 3.5.0 + * + * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitionwake'; + + +/***/ }), + +/***/ 6536: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists and the Scene is in a Running state, otherwise this is skipped. + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('update', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#UPDATE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'update'; + + +/***/ }), + +/***/ 3875: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Wake Event. + * + * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.events.on('wake', listener)`. + * + * @event Phaser.Scenes.Events#WAKE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was woken up. + */ +module.exports = 'wake'; + + +/***/ }), + +/***/ 204: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Scenes.Events + */ + +module.exports = { + + ADDED_TO_SCENE: __webpack_require__(8618), + BOOT: __webpack_require__(4328), + CREATE: __webpack_require__(6099), + DESTROY: __webpack_require__(7645), + PAUSE: __webpack_require__(2710), + POST_UPDATE: __webpack_require__(2547), + PRE_RENDER: __webpack_require__(8577), + PRE_UPDATE: __webpack_require__(8197), + READY: __webpack_require__(8997), + REMOVED_FROM_SCENE: __webpack_require__(7604), + RENDER: __webpack_require__(8999), + RESUME: __webpack_require__(9742), + SHUTDOWN: __webpack_require__(3667), + SLEEP: __webpack_require__(3468), + START: __webpack_require__(7840), + TRANSITION_COMPLETE: __webpack_require__(9896), + TRANSITION_INIT: __webpack_require__(5103), + TRANSITION_OUT: __webpack_require__(3162), + TRANSITION_START: __webpack_require__(7841), + TRANSITION_WAKE: __webpack_require__(6454), + UPDATE: __webpack_require__(6536), + WAKE: __webpack_require__(3875) + +}; + + +/***/ }), + +/***/ 2362: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Clamp = __webpack_require__(2915); +var Extend = __webpack_require__(1030); + +/** + * @classdesc + * A Frame is a section of a Texture. + * + * @class Frame + * @memberof Phaser.Textures + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Textures.Texture} texture - The Texture this Frame is a part of. + * @param {(number|string)} name - The name of this Frame. The name is unique within the Texture. + * @param {number} sourceIndex - The index of the TextureSource that this Frame is a part of. + * @param {number} x - The x coordinate of the top-left of this Frame. + * @param {number} y - The y coordinate of the top-left of this Frame. + * @param {number} width - The width of this Frame. + * @param {number} height - The height of this Frame. + */ +var Frame = new Class({ + + initialize: + + function Frame (texture, name, sourceIndex, x, y, width, height) + { + /** + * The Texture this Frame is a part of. + * + * @name Phaser.Textures.Frame#texture + * @type {Phaser.Textures.Texture} + * @since 3.0.0 + */ + this.texture = texture; + + /** + * The name of this Frame. + * The name is unique within the Texture. + * + * @name Phaser.Textures.Frame#name + * @type {string} + * @since 3.0.0 + */ + this.name = name; + + /** + * The TextureSource this Frame is part of. + * + * @name Phaser.Textures.Frame#source + * @type {Phaser.Textures.TextureSource} + * @since 3.0.0 + */ + this.source = texture.source[sourceIndex]; + + /** + * The index of the TextureSource in the Texture sources array. + * + * @name Phaser.Textures.Frame#sourceIndex + * @type {number} + * @since 3.0.0 + */ + this.sourceIndex = sourceIndex; + + /** + * A reference to the Texture Source WebGL Texture that this Frame is using. + * + * @name Phaser.Textures.Frame#glTexture + * @type {?WebGLTexture} + * @default null + * @since 3.11.0 + */ + this.glTexture = this.source.glTexture; + + /** + * X position within the source image to cut from. + * + * @name Phaser.Textures.Frame#cutX + * @type {number} + * @since 3.0.0 + */ + this.cutX; + + /** + * Y position within the source image to cut from. + * + * @name Phaser.Textures.Frame#cutY + * @type {number} + * @since 3.0.0 + */ + this.cutY; + + /** + * The width of the area in the source image to cut. + * + * @name Phaser.Textures.Frame#cutWidth + * @type {number} + * @since 3.0.0 + */ + this.cutWidth; + + /** + * The height of the area in the source image to cut. + * + * @name Phaser.Textures.Frame#cutHeight + * @type {number} + * @since 3.0.0 + */ + this.cutHeight; + + /** + * The X rendering offset of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The Y rendering offset of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The rendering width of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#width + * @type {number} + * @since 3.0.0 + */ + this.width; + + /** + * The rendering height of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#height + * @type {number} + * @since 3.0.0 + */ + this.height; + + /** + * Half the width, floored. + * Precalculated for the renderer. + * + * @name Phaser.Textures.Frame#halfWidth + * @type {number} + * @since 3.0.0 + */ + this.halfWidth; + + /** + * Half the height, floored. + * Precalculated for the renderer. + * + * @name Phaser.Textures.Frame#halfHeight + * @type {number} + * @since 3.0.0 + */ + this.halfHeight; + + /** + * The x center of this frame, floored. + * + * @name Phaser.Textures.Frame#centerX + * @type {number} + * @since 3.0.0 + */ + this.centerX; + + /** + * The y center of this frame, floored. + * + * @name Phaser.Textures.Frame#centerY + * @type {number} + * @since 3.0.0 + */ + this.centerY; + + /** + * The horizontal pivot point of this Frame. + * + * @name Phaser.Textures.Frame#pivotX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.pivotX = 0; + + /** + * The vertical pivot point of this Frame. + * + * @name Phaser.Textures.Frame#pivotY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.pivotY = 0; + + /** + * Does this Frame have a custom pivot point? + * + * @name Phaser.Textures.Frame#customPivot + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.customPivot = false; + + /** + * **CURRENTLY UNSUPPORTED** + * + * Is this frame is rotated or not in the Texture? + * Rotation allows you to use rotated frames in texture atlas packing. + * It has nothing to do with Sprite rotation. + * + * @name Phaser.Textures.Frame#rotated + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.rotated = false; + + /** + * Over-rides the Renderer setting. + * -1 = use Renderer Setting + * 0 = No rounding + * 1 = Round + * + * @name Phaser.Textures.Frame#autoRound + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.autoRound = -1; + + /** + * Any Frame specific custom data can be stored here. + * + * @name Phaser.Textures.Frame#customData + * @type {object} + * @since 3.0.0 + */ + this.customData = {}; + + /** + * WebGL UV u0 value. + * + * @name Phaser.Textures.Frame#u0 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.u0 = 0; + + /** + * WebGL UV v0 value. + * + * @name Phaser.Textures.Frame#v0 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.v0 = 0; + + /** + * WebGL UV u1 value. + * + * @name Phaser.Textures.Frame#u1 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.u1 = 0; + + /** + * WebGL UV v1 value. + * + * @name Phaser.Textures.Frame#v1 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.v1 = 0; + + /** + * The un-modified source frame, trim and UV data. + * + * @name Phaser.Textures.Frame#data + * @type {object} + * @private + * @since 3.0.0 + */ + this.data = { + cut: { + x: 0, + y: 0, + w: 0, + h: 0, + r: 0, + b: 0 + }, + trim: false, + sourceSize: { + w: 0, + h: 0 + }, + spriteSourceSize: { + x: 0, + y: 0, + w: 0, + h: 0, + r: 0, + b: 0 + }, + radius: 0, + drawImage: { + x: 0, + y: 0, + width: 0, + height: 0 + } + }; + + this.setSize(width, height, x, y); + }, + + /** + * Sets the width, height, x and y of this Frame. + * + * This is called automatically by the constructor + * and should rarely be changed on-the-fly. + * + * @method Phaser.Textures.Frame#setSize + * @since 3.7.0 + * + * @param {number} width - The width of the frame before being trimmed. + * @param {number} height - The height of the frame before being trimmed. + * @param {number} [x=0] - The x coordinate of the top-left of this Frame. + * @param {number} [y=0] - The y coordinate of the top-left of this Frame. + * + * @return {this} This Frame object. + */ + setSize: function (width, height, x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + this.cutX = x; + this.cutY = y; + this.cutWidth = width; + this.cutHeight = height; + + this.width = width; + this.height = height; + + this.halfWidth = Math.floor(width * 0.5); + this.halfHeight = Math.floor(height * 0.5); + + this.centerX = Math.floor(width / 2); + this.centerY = Math.floor(height / 2); + + var data = this.data; + var cut = data.cut; + + cut.x = x; + cut.y = y; + cut.w = width; + cut.h = height; + cut.r = x + width; + cut.b = y + height; + + data.sourceSize.w = width; + data.sourceSize.h = height; + + data.spriteSourceSize.w = width; + data.spriteSourceSize.h = height; + + data.radius = 0.5 * Math.sqrt(width * width + height * height); + + var drawImage = data.drawImage; + + drawImage.x = x; + drawImage.y = y; + drawImage.width = width; + drawImage.height = height; + + return this.updateUVs(); + }, + + /** + * If the frame was trimmed when added to the Texture Atlas, this records the trim and source data. + * + * @method Phaser.Textures.Frame#setTrim + * @since 3.0.0 + * + * @param {number} actualWidth - The width of the frame before being trimmed. + * @param {number} actualHeight - The height of the frame before being trimmed. + * @param {number} destX - The destination X position of the trimmed frame for display. + * @param {number} destY - The destination Y position of the trimmed frame for display. + * @param {number} destWidth - The destination width of the trimmed frame for display. + * @param {number} destHeight - The destination height of the trimmed frame for display. + * + * @return {this} This Frame object. + */ + setTrim: function (actualWidth, actualHeight, destX, destY, destWidth, destHeight) + { + var data = this.data; + var ss = data.spriteSourceSize; + + // Store actual values + + data.trim = true; + + data.sourceSize.w = actualWidth; + data.sourceSize.h = actualHeight; + + ss.x = destX; + ss.y = destY; + ss.w = destWidth; + ss.h = destHeight; + ss.r = destX + destWidth; + ss.b = destY + destHeight; + + // Adjust properties + this.x = destX; + this.y = destY; + + this.width = destWidth; + this.height = destHeight; + + this.halfWidth = destWidth * 0.5; + this.halfHeight = destHeight * 0.5; + + this.centerX = Math.floor(destWidth / 2); + this.centerY = Math.floor(destHeight / 2); + + return this.updateUVs(); + }, + + /** + * Takes a crop data object and, based on the rectangular region given, calculates the + * required UV coordinates in order to crop this Frame for WebGL and Canvas rendering. + * + * This is called directly by the Game Object Texture Components `setCrop` method. + * Please use that method to crop a Game Object. + * + * @method Phaser.Textures.Frame#setCropUVs + * @since 3.11.0 + * + * @param {object} crop - The crop data object. This is the `GameObject._crop` property. + * @param {number} x - The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. + * @param {number} y - The y coordinate to start the crop from. Cannot be negative or exceed the Frame height. + * @param {number} width - The width of the crop rectangle. Cannot exceed the Frame width. + * @param {number} height - The height of the crop rectangle. Cannot exceed the Frame height. + * @param {boolean} flipX - Does the parent Game Object have flipX set? + * @param {boolean} flipY - Does the parent Game Object have flipY set? + * + * @return {object} The updated crop data object. + */ + setCropUVs: function (crop, x, y, width, height, flipX, flipY) + { + // Clamp the input values + + var cx = this.cutX; + var cy = this.cutY; + var cw = this.cutWidth; + var ch = this.cutHeight; + var rw = this.realWidth; + var rh = this.realHeight; + + x = Clamp(x, 0, rw); + y = Clamp(y, 0, rh); + + width = Clamp(width, 0, rw - x); + height = Clamp(height, 0, rh - y); + + var ox = cx + x; + var oy = cy + y; + var ow = width; + var oh = height; + + var data = this.data; + + if (data.trim) + { + var ss = data.spriteSourceSize; + + // Need to check for intersection between the cut area and the crop area + // If there is none, we set UV to be empty, otherwise set it to be the intersection area + + width = Clamp(width, 0, cw - x); + height = Clamp(height, 0, ch - y); + + var cropRight = x + width; + var cropBottom = y + height; + + var intersects = !(ss.r < x || ss.b < y || ss.x > cropRight || ss.y > cropBottom); + + if (intersects) + { + var ix = Math.max(ss.x, x); + var iy = Math.max(ss.y, y); + var iw = Math.min(ss.r, cropRight) - ix; + var ih = Math.min(ss.b, cropBottom) - iy; + + ow = iw; + oh = ih; + + if (flipX) + { + ox = cx + (cw - (ix - ss.x) - iw); + } + else + { + ox = cx + (ix - ss.x); + } + + if (flipY) + { + oy = cy + (ch - (iy - ss.y) - ih); + } + else + { + oy = cy + (iy - ss.y); + } + + x = ix; + y = iy; + + width = iw; + height = ih; + } + else + { + ox = 0; + oy = 0; + ow = 0; + oh = 0; + } + } + else + { + if (flipX) + { + ox = cx + (cw - x - width); + } + + if (flipY) + { + oy = cy + (ch - y - height); + } + } + + var tw = this.source.width; + var th = this.source.height; + + // Map the given coordinates into UV space, clamping to the 0-1 range. + + crop.u0 = Math.max(0, ox / tw); + crop.v0 = Math.max(0, oy / th); + crop.u1 = Math.min(1, (ox + ow) / tw); + crop.v1 = Math.min(1, (oy + oh) / th); + + crop.x = x; + crop.y = y; + + crop.cx = ox; + crop.cy = oy; + crop.cw = ow; + crop.ch = oh; + + crop.width = width; + crop.height = height; + + crop.flipX = flipX; + crop.flipY = flipY; + + return crop; + }, + + /** + * Takes a crop data object and recalculates the UVs based on the dimensions inside the crop object. + * Called automatically by `setFrame`. + * + * @method Phaser.Textures.Frame#updateCropUVs + * @since 3.11.0 + * + * @param {object} crop - The crop data object. This is the `GameObject._crop` property. + * @param {boolean} flipX - Does the parent Game Object have flipX set? + * @param {boolean} flipY - Does the parent Game Object have flipY set? + * + * @return {object} The updated crop data object. + */ + updateCropUVs: function (crop, flipX, flipY) + { + return this.setCropUVs(crop, crop.x, crop.y, crop.width, crop.height, flipX, flipY); + }, + + /** + * Directly sets the canvas and WebGL UV data for this frame. + * + * Use this if you need to override the values that are generated automatically + * when the Frame is created. + * + * @method Phaser.Textures.Frame#setUVs + * @since 3.50.0 + * + * @param {number} width - Width of this frame for the Canvas data. + * @param {number} height - Height of this frame for the Canvas data. + * @param {number} u0 - UV u0 value. + * @param {number} v0 - UV v0 value. + * @param {number} u1 - UV u1 value. + * @param {number} v1 - UV v1 value. + * + * @return {this} This Frame object. + */ + setUVs: function (width, height, u0, v0, u1, v1) + { + // Canvas data + + var cd = this.data.drawImage; + + cd.width = width; + cd.height = height; + + // WebGL data + + this.u0 = u0; + this.v0 = v0; + + this.u1 = u1; + this.v1 = v1; + + return this; + }, + + /** + * Updates the internal WebGL UV cache and the drawImage cache. + * + * @method Phaser.Textures.Frame#updateUVs + * @since 3.0.0 + * + * @return {this} This Frame object. + */ + updateUVs: function () + { + var cx = this.cutX; + var cy = this.cutY; + var cw = this.cutWidth; + var ch = this.cutHeight; + + // Canvas data + + var cd = this.data.drawImage; + + cd.width = cw; + cd.height = ch; + + // WebGL data + + var tw = this.source.width; + var th = this.source.height; + + this.u0 = cx / tw; + this.v0 = cy / th; + + this.u1 = (cx + cw) / tw; + this.v1 = (cy + ch) / th; + + return this; + }, + + /** + * Updates the internal WebGL UV cache. + * + * @method Phaser.Textures.Frame#updateUVsInverted + * @since 3.0.0 + * + * @return {this} This Frame object. + */ + updateUVsInverted: function () + { + var tw = this.source.width; + var th = this.source.height; + + this.u0 = (this.cutX + this.cutHeight) / tw; + this.v0 = this.cutY / th; + + this.u1 = this.cutX / tw; + this.v1 = (this.cutY + this.cutWidth) / th; + + return this; + }, + + /** + * Clones this Frame into a new Frame object. + * + * @method Phaser.Textures.Frame#clone + * @since 3.0.0 + * + * @return {Phaser.Textures.Frame} A clone of this Frame. + */ + clone: function () + { + var clone = new Frame(this.texture, this.name, this.sourceIndex); + + clone.cutX = this.cutX; + clone.cutY = this.cutY; + clone.cutWidth = this.cutWidth; + clone.cutHeight = this.cutHeight; + + clone.x = this.x; + clone.y = this.y; + + clone.width = this.width; + clone.height = this.height; + + clone.halfWidth = this.halfWidth; + clone.halfHeight = this.halfHeight; + + clone.centerX = this.centerX; + clone.centerY = this.centerY; + + clone.rotated = this.rotated; + + clone.data = Extend(true, clone.data, this.data); + + clone.updateUVs(); + + return clone; + }, + + /** + * Destroys this Frame by nulling its reference to the parent Texture and and data objects. + * + * @method Phaser.Textures.Frame#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.source = null; + this.texture = null; + this.glTexture = null; + this.customData = null; + this.data = null; + }, + + /** + * The width of the Frame in its un-trimmed, un-padded state, as prepared in the art package, + * before being packed. + * + * @name Phaser.Textures.Frame#realWidth + * @type {number} + * @readonly + * @since 3.0.0 + */ + realWidth: { + + get: function () + { + return this.data.sourceSize.w; + } + + }, + + /** + * The height of the Frame in its un-trimmed, un-padded state, as prepared in the art package, + * before being packed. + * + * @name Phaser.Textures.Frame#realHeight + * @type {number} + * @readonly + * @since 3.0.0 + */ + realHeight: { + + get: function () + { + return this.data.sourceSize.h; + } + + }, + + /** + * The radius of the Frame (derived from sqrt(w * w + h * h) / 2) + * + * @name Phaser.Textures.Frame#radius + * @type {number} + * @readonly + * @since 3.0.0 + */ + radius: { + + get: function () + { + return this.data.radius; + } + + }, + + /** + * Is the Frame trimmed or not? + * + * @name Phaser.Textures.Frame#trimmed + * @type {boolean} + * @readonly + * @since 3.0.0 + */ + trimmed: { + + get: function () + { + return this.data.trim; + } + + }, + + /** + * The Canvas drawImage data object. + * + * @name Phaser.Textures.Frame#canvasData + * @type {object} + * @readonly + * @since 3.0.0 + */ + canvasData: { + + get: function () + { + return this.data.drawImage; + } + + } + +}); + +module.exports = Frame; + + +/***/ }), + +/***/ 1864: +/***/ ((module) => { /** * @author Richard Davey @@ -58115,8 +60242,9 @@ module.exports = GetBoolean; /***/ }), -/* 336 */ -/***/ (function(module, exports) { + +/***/ 3747: +/***/ ((module) => { /** * @author Richard Davey @@ -58340,8 +60468,9 @@ module.exports = TWEEN_CONST; /***/ }), -/* 337 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 7473: +/***/ ((module) => { /** * @author Richard Davey @@ -58349,426 +60478,3319 @@ module.exports = TWEEN_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DeepCopy = __webpack_require__(338); -var SpliceOne = __webpack_require__(13); +// Taken from klasse by mattdesl https://github.com/mattdesl/klasse + +function hasGetterOrSetter (def) +{ + return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function'); +} + +function getProperty (definition, k, isClassDescriptor) +{ + // This may be a lightweight object, OR it might be a property that was defined previously. + + // For simple class descriptors we can just assume its NOT previously defined. + var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k); + + if (!isClassDescriptor && def.value && typeof def.value === 'object') + { + def = def.value; + } + + // This might be a regular property, or it may be a getter/setter the user defined in a class. + if (def && hasGetterOrSetter(def)) + { + if (typeof def.enumerable === 'undefined') + { + def.enumerable = true; + } + + if (typeof def.configurable === 'undefined') + { + def.configurable = true; + } + + return def; + } + else + { + return false; + } +} + +function hasNonConfigurable (obj, k) +{ + var prop = Object.getOwnPropertyDescriptor(obj, k); + + if (!prop) + { + return false; + } + + if (prop.value && typeof prop.value === 'object') + { + prop = prop.value; + } + + if (prop.configurable === false) + { + return true; + } + + return false; +} /** - * Provides methods used for setting the WebGL rendering pipeline of a Game Object. + * Extends the given `myClass` object's prototype with the properties of `definition`. * - * @namespace Phaser.GameObjects.Components.Pipeline - * @webglOnly - * @since 3.0.0 + * @function extend + * @ignore + * @param {Object} ctor The constructor object to mix into. + * @param {Object} definition A dictionary of functions for the class. + * @param {boolean} isClassDescriptor Is the definition a class descriptor? + * @param {Object} [extend] The parent constructor object. */ - -var Pipeline = { - - /** - * The initial WebGL pipeline of this Game Object. - * - * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. - * - * @name Phaser.GameObjects.Components.Pipeline#defaultPipeline - * @type {Phaser.Renderer.WebGL.WebGLPipeline} - * @default null - * @webglOnly - * @since 3.0.0 - */ - defaultPipeline: null, - - /** - * The current WebGL pipeline of this Game Object. - * - * @name Phaser.GameObjects.Components.Pipeline#pipeline - * @type {Phaser.Renderer.WebGL.WebGLPipeline} - * @default null - * @webglOnly - * @since 3.0.0 - */ - pipeline: null, - - /** - * Does this Game Object have any Post Pipelines set? - * - * @name Phaser.GameObjects.Components.Pipeline#hasPostPipeline - * @type {boolean} - * @webglOnly - * @since 3.50.0 - */ - hasPostPipeline: false, - - /** - * The WebGL Post FX Pipelines this Game Object uses for post-render effects. - * - * The pipelines are processed in the order in which they appear in this array. - * - * If you modify this array directly, be sure to set the - * `hasPostPipeline` property accordingly. - * - * @name Phaser.GameObjects.Components.Pipeline#postPipelines - * @type {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]} - * @webglOnly - * @since 3.50.0 - */ - postPipelines: null, - - /** - * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. - * - * @name Phaser.GameObjects.Components.Pipeline#pipelineData - * @type {object} - * @webglOnly - * @since 3.50.0 - */ - pipelineData: null, - - /** - * Sets the initial WebGL Pipeline of this Game Object. - * - * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. - * - * @method Phaser.GameObjects.Components.Pipeline#initPipeline - * @webglOnly - * @since 3.0.0 - * - * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - Either the string-based name of the pipeline, or a pipeline instance to set. - * - * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. - */ - initPipeline: function (pipeline) +function extend (ctor, definition, isClassDescriptor, extend) +{ + for (var k in definition) { - var renderer = this.scene.sys.renderer; - - if (!renderer) + if (!definition.hasOwnProperty(k)) { - return false; + continue; } - var pipelines = renderer.pipelines; + var def = getProperty(definition, k, isClassDescriptor); - this.postPipelines = []; - this.pipelineData = {}; - - if (pipelines) + if (def !== false) { - if (pipeline === undefined) + // If Extends is used, we will check its prototype to see if the final variable exists. + + var parent = extend || ctor; + + if (hasNonConfigurable(parent.prototype, k)) { - pipeline = pipelines.default; - } - - var instance = pipelines.get(pipeline); - - if (instance) - { - this.defaultPipeline = instance; - this.pipeline = instance; - - return true; - } - } - - return false; - }, - - /** - * Sets the main WebGL Pipeline of this Game Object. - * - * Also sets the `pipelineData` property, if the parameter is given. - * - * Both the pipeline and post pipelines share the same pipeline data object. - * - * @method Phaser.GameObjects.Components.Pipeline#setPipeline - * @webglOnly - * @since 3.0.0 - * - * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set. - * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. - * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. - * - * @return {this} This Game Object instance. - */ - setPipeline: function (pipeline, pipelineData, copyData) - { - var renderer = this.scene.sys.renderer; - - if (!renderer) - { - return this; - } - - var pipelines = renderer.pipelines; - - if (pipelines) - { - var instance = pipelines.get(pipeline); - - if (instance) - { - this.pipeline = instance; - } - - if (pipelineData) - { - this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; - } - } - - return this; - }, - - /** - * Sets one, or more, Post Pipelines on this Game Object. - * - * Post Pipelines are invoked after this Game Object has rendered to its target and - * are commonly used for post-fx. - * - * The post pipelines are appended to the `postPipelines` array belonging to this - * Game Object. When the renderer processes this Game Object, it iterates through the post - * pipelines in the order in which they appear in the array. If you are stacking together - * multiple effects, be aware that the order is important. - * - * If you call this method multiple times, the new pipelines will be appended to any existing - * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. - * - * You can optionally also set the `pipelineData` property, if the parameter is given. - * - * Both the pipeline and post pipelines share the pipeline data object together. - * - * @method Phaser.GameObjects.Components.Pipeline#setPostPipeline - * @webglOnly - * @since 3.50.0 - * - * @param {(string|string[]|function|function[]|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} pipelines - Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. - * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. - * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. - * - * @return {this} This Game Object instance. - */ - setPostPipeline: function (pipelines, pipelineData, copyData) - { - var renderer = this.scene.sys.renderer; - - if (!renderer) - { - return this; - } - - var pipelineManager = renderer.pipelines; - - if (pipelineManager) - { - if (!Array.isArray(pipelines)) - { - pipelines = [ pipelines ]; - } - - for (var i = 0; i < pipelines.length; i++) - { - var instance = pipelineManager.getPostPipeline(pipelines[i], this); - - if (instance) + // Just skip the final property + if (Class.ignoreFinals) { - this.postPipelines.push(instance); + continue; } + + // We cannot re-define a property that is configurable=false. + // So we will consider them final and throw an error. This is by + // default so it is clear to the developer what is happening. + // You can set ignoreFinals to true if you need to extend a class + // which has configurable=false; it will simply not re-define final properties. + throw new Error('cannot override final property \'' + k + '\', set Class.ignoreFinals = true to skip'); } - if (pipelineData) - { - this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; - } - } - - this.hasPostPipeline = (this.postPipelines.length > 0); - - return this; - }, - - /** - * Adds an entry to the `pipelineData` object belonging to this Game Object. - * - * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. - * - * If `value` is undefined, and `key` exists, `key` is removed from the data object. - * - * Both the pipeline and post pipelines share the pipeline data object together. - * - * @method Phaser.GameObjects.Components.Pipeline#setPipelineData - * @webglOnly - * @since 3.50.0 - * - * @param {string} key - The key of the pipeline data to set, update, or delete. - * @param {any} [value] - The value to be set with the key. If `undefined` then `key` will be deleted from the object. - * - * @return {this} This Game Object instance. - */ - setPipelineData: function (key, value) - { - var data = this.pipelineData; - - if (value === undefined) - { - delete data[key]; + Object.defineProperty(ctor.prototype, k, def); } else { - data[key] = value; + ctor.prototype[k] = definition[k]; } + } +} - return this; - }, - - /** - * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. - * - * @method Phaser.GameObjects.Components.Pipeline#getPostPipeline - * @webglOnly - * @since 3.50.0 - * - * @param {(string|function|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline)} pipeline - The string-based name of the pipeline, or a pipeline class. - * - * @return {(Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} The Post Pipeline/s matching the name, or undefined if no match. If more than one match they are returned in an array. - */ - getPostPipeline: function (pipeline) +/** + * Applies the given `mixins` to the prototype of `myClass`. + * + * @function mixin + * @ignore + * @param {Object} myClass The constructor object to mix into. + * @param {Object|Array} mixins The mixins to apply to the constructor. + */ +function mixin (myClass, mixins) +{ + if (!mixins) { - var isString = (typeof pipeline === 'string'); - - var pipelines = this.postPipelines; - - var results = []; - - for (var i = 0; i < pipelines.length; i++) - { - var instance = pipelines[i]; - - if ((isString && instance.name === pipeline) || (!isString && instance instanceof pipeline)) - { - results.push(instance); - } - } - - return (results.length === 1) ? results[0] : results; - }, - - /** - * Resets the WebGL Pipeline of this Game Object back to the default it was created with. - * - * @method Phaser.GameObjects.Components.Pipeline#resetPipeline - * @webglOnly - * @since 3.0.0 - * - * @param {boolean} [resetPostPipelines=false] - Reset all of the post pipelines? - * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? - * - * @return {boolean} `true` if the pipeline was reset successfully, otherwise `false`. - */ - resetPipeline: function (resetPostPipelines, resetData) - { - if (resetPostPipelines === undefined) { resetPostPipelines = false; } - if (resetData === undefined) { resetData = false; } - - this.pipeline = this.defaultPipeline; - - if (resetPostPipelines) - { - this.postPipelines = []; - this.hasPostPipeline = false; - } - - if (resetData) - { - this.pipelineData = {}; - } - - return (this.pipeline !== null); - }, - - /** - * Resets the WebGL Post Pipelines of this Game Object. It does this by calling - * the `destroy` method on each post pipeline and then clearing the local array. - * - * @method Phaser.GameObjects.Components.Pipeline#resetPostPipeline - * @webglOnly - * @since 3.50.0 - * - * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? - */ - resetPostPipeline: function (resetData) - { - if (resetData === undefined) { resetData = false; } - - var pipelines = this.postPipelines; - - for (var i = 0; i < pipelines.length; i++) - { - pipelines[i].destroy(); - } - - this.postPipelines = []; - this.hasPostPipeline = false; - - if (resetData) - { - this.pipelineData = {}; - } - }, - - /** - * Removes a type of Post Pipeline instances from this Game Object, based on the given name, and destroys them. - * - * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. - * - * @method Phaser.GameObjects.Components.Pipeline#removePostPipeline - * @webglOnly - * @since 3.50.0 - * - * @param {string|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} pipeline - The string-based name of the pipeline, or a pipeline class. - * - * @return {this} This Game Object. - */ - removePostPipeline: function (pipeline) - { - var pipelines = this.postPipelines; - - for (var i = pipelines.length - 1; i >= 0; i--) - { - var instance = pipelines[i]; - - if ( - (typeof pipeline === 'string' && instance.name === pipeline) || - (typeof pipeline !== 'string' && instance instanceof pipeline)) - { - instance.destroy(); - - SpliceOne(pipelines, i); - } - } - - this.hasPostPipeline = (this.postPipelines.length > 0); - - return this; - }, - - /** - * Gets the name of the WebGL Pipeline this Game Object is currently using. - * - * @method Phaser.GameObjects.Components.Pipeline#getPipelineName - * @webglOnly - * @since 3.0.0 - * - * @return {string} The string-based name of the pipeline being used by this Game Object. - */ - getPipelineName: function () - { - return this.pipeline.name; + return; } -}; + if (!Array.isArray(mixins)) + { + mixins = [ mixins ]; + } -module.exports = Pipeline; + for (var i = 0; i < mixins.length; i++) + { + extend(myClass, mixins[i].prototype || mixins[i]); + } +} + +/** + * Creates a new class with the given descriptor. + * The constructor, defined by the name `initialize`, + * is an optional function. If unspecified, an anonymous + * function will be used which calls the parent class (if + * one exists). + * + * You can also use `Extends` and `Mixins` to provide subclassing + * and inheritance. + * + * @class Phaser.Class + * @constructor + * @param {Object} definition a dictionary of functions for the class + * @example + * + * var MyClass = new Phaser.Class({ + * + * initialize: function() { + * this.foo = 2.0; + * }, + * + * bar: function() { + * return this.foo + 5; + * } + * }); + */ +function Class (definition) +{ + if (!definition) + { + definition = {}; + } + + // The variable name here dictates what we see in Chrome debugger + var initialize; + var Extends; + + if (definition.initialize) + { + if (typeof definition.initialize !== 'function') + { + throw new Error('initialize must be a function'); + } + + initialize = definition.initialize; + + // Usually we should avoid 'delete' in V8 at all costs. + // However, its unlikely to make any performance difference + // here since we only call this on class creation (i.e. not object creation). + delete definition.initialize; + } + else if (definition.Extends) + { + var base = definition.Extends; + + initialize = function () + { + base.apply(this, arguments); + }; + } + else + { + initialize = function () {}; + } + + if (definition.Extends) + { + initialize.prototype = Object.create(definition.Extends.prototype); + initialize.prototype.constructor = initialize; + + // For getOwnPropertyDescriptor to work, we need to act directly on the Extends (or Mixin) + + Extends = definition.Extends; + + delete definition.Extends; + } + else + { + initialize.prototype.constructor = initialize; + } + + // Grab the mixins, if they are specified... + var mixins = null; + + if (definition.Mixins) + { + mixins = definition.Mixins; + delete definition.Mixins; + } + + // First, mixin if we can. + mixin(initialize, mixins); + + // Now we grab the actual definition which defines the overrides. + extend(initialize, definition, true, Extends); + + return initialize; +} + +Class.extend = extend; +Class.mixin = mixin; +Class.ignoreFinals = false; + +module.exports = Class; /***/ }), -/* 338 */ -/***/ (function(module, exports) { + +/***/ 1984: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A NOOP (No Operation) callback function. + * + * Used internally by Phaser when it's more expensive to determine if a callback exists + * than it is to just invoke an empty function. + * + * @function Phaser.Utils.NOOP + * @since 3.0.0 + */ +var NOOP = function () +{ + // NOOP +}; + +module.exports = NOOP; + + +/***/ }), + +/***/ 1792: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Adds the given item, or array of items, to the array. + * + * Each item must be unique within the array. + * + * The array is modified in-place and returned. + * + * You can optionally specify a limit to the maximum size of the array. If the quantity of items being + * added will take the array length over this limit, it will stop adding once the limit is reached. + * + * You can optionally specify a callback to be invoked for each item successfully added to the array. + * + * @function Phaser.Utils.Array.Add + * @since 3.4.0 + * + * @param {array} array - The array to be added to. + * @param {any|any[]} item - The item, or array of items, to add to the array. Each item must be unique within the array. + * @param {number} [limit] - Optional limit which caps the size of the array. + * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {array} The input array. + */ +var Add = function (array, item, limit, callback, context) +{ + if (context === undefined) { context = array; } + + if (limit > 0) + { + var remaining = limit - array.length; + + // There's nothing more we can do here, the array is full + if (remaining <= 0) + { + return null; + } + } + + // Fast path to avoid array mutation and iteration + if (!Array.isArray(item)) + { + if (array.indexOf(item) === -1) + { + array.push(item); + + if (callback) + { + callback.call(context, item); + } + + return item; + } + else + { + return null; + } + } + + // If we got this far, we have an array of items to insert + + // Ensure all the items are unique + var itemLength = item.length - 1; + + while (itemLength >= 0) + { + if (array.indexOf(item[itemLength]) !== -1) + { + // Already exists in array, so remove it + item.splice(itemLength, 1); + } + + itemLength--; + } + + // Anything left? + itemLength = item.length; + + if (itemLength === 0) + { + return null; + } + + if (limit > 0 && itemLength > remaining) + { + item.splice(remaining); + + itemLength = remaining; + } + + for (var i = 0; i < itemLength; i++) + { + var entry = item[i]; + + array.push(entry); + + if (callback) + { + callback.call(context, entry); + } + } + + return item; +}; + +module.exports = Add; + + +/***/ }), + +/***/ 2280: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Adds the given item, or array of items, to the array starting at the index specified. + * + * Each item must be unique within the array. + * + * Existing elements in the array are shifted up. + * + * The array is modified in-place and returned. + * + * You can optionally specify a limit to the maximum size of the array. If the quantity of items being + * added will take the array length over this limit, it will stop adding once the limit is reached. + * + * You can optionally specify a callback to be invoked for each item successfully added to the array. + * + * @function Phaser.Utils.Array.AddAt + * @since 3.4.0 + * + * @param {array} array - The array to be added to. + * @param {any|any[]} item - The item, or array of items, to add to the array. + * @param {number} [index=0] - The index in the array where the item will be inserted. + * @param {number} [limit] - Optional limit which caps the size of the array. + * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {array} The input array. + */ +var AddAt = function (array, item, index, limit, callback, context) +{ + if (index === undefined) { index = 0; } + if (context === undefined) { context = array; } + + if (limit > 0) + { + var remaining = limit - array.length; + + // There's nothing more we can do here, the array is full + if (remaining <= 0) + { + return null; + } + } + + // Fast path to avoid array mutation and iteration + if (!Array.isArray(item)) + { + if (array.indexOf(item) === -1) + { + array.splice(index, 0, item); + + if (callback) + { + callback.call(context, item); + } + + return item; + } + else + { + return null; + } + } + + // If we got this far, we have an array of items to insert + + // Ensure all the items are unique + var itemLength = item.length - 1; + + while (itemLength >= 0) + { + if (array.indexOf(item[itemLength]) !== -1) + { + // Already exists in array, so remove it + item.pop(); + } + + itemLength--; + } + + // Anything left? + itemLength = item.length; + + if (itemLength === 0) + { + return null; + } + + // Truncate to the limit + if (limit > 0 && itemLength > remaining) + { + item.splice(remaining); + + itemLength = remaining; + } + + for (var i = itemLength - 1; i >= 0; i--) + { + var entry = item[i]; + + array.splice(index, 0, entry); + + if (callback) + { + callback.call(context, entry); + } + } + + return item; +}; + +module.exports = AddAt; + + +/***/ }), + +/***/ 2513: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given element to the top of the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.BringToTop + * @since 3.4.0 + * + * @param {array} array - The array. + * @param {*} item - The element to move. + * + * @return {*} The element that was moved. + */ +var BringToTop = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex !== -1 && currentIndex < array.length) + { + array.splice(currentIndex, 1); + array.push(item); + } + + return item; +}; + +module.exports = BringToTop; + + +/***/ }), + +/***/ 1771: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Returns the total number of elements in the array which have a property matching the given value. + * + * @function Phaser.Utils.Array.CountAllMatching + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} property - The property to test on each array element. + * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. + * + * @return {number} The total number of elements with properties matching the given value. + */ +var CountAllMatching = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + var total = 0; + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var child = array[i]; + + if (child[property] === value) + { + total++; + } + } + } + + return total; +}; + +module.exports = CountAllMatching; + + +/***/ }), + +/***/ 7883: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Passes each element in the array to the given callback. + * + * @function Phaser.Utils.Array.Each + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {function} callback - A callback to be invoked for each item in the array. + * @param {object} context - The context in which the callback is invoked. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the current array item. + * + * @return {array} The input array. + */ +var Each = function (array, callback, context) +{ + var i; + var args = [ null ]; + + for (i = 3; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (i = 0; i < array.length; i++) + { + args[0] = array[i]; + + callback.apply(context, args); + } + + return array; +}; + +module.exports = Each; + + +/***/ }), + +/***/ 5856: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Passes each element in the array, between the start and end indexes, to the given callback. + * + * @function Phaser.Utils.Array.EachInRange + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {function} callback - A callback to be invoked for each item in the array. + * @param {object} context - The context in which the callback is invoked. + * @param {number} startIndex - The start index to search from. + * @param {number} endIndex - The end index to search to. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + * + * @return {array} The input array. + */ +var EachInRange = function (array, callback, context, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + if (SafeRange(array, startIndex, endIndex)) + { + var i; + var args = [ null ]; + + for (i = 5; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (i = startIndex; i < endIndex; i++) + { + args[0] = array[i]; + + callback.apply(context, args); + } + } + + return array; +}; + +module.exports = EachInRange; + + +/***/ }), + +/***/ 3957: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Searches a pre-sorted array for the closet value to the given number. + * + * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, + * and will check for the closest value of those to the given number. + * + * @function Phaser.Utils.Array.FindClosestInSorted + * @since 3.0.0 + * + * @param {number} value - The value to search for in the array. + * @param {array} array - The array to search, which must be sorted. + * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. + * + * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. + */ +var FindClosestInSorted = function (value, array, key) +{ + if (!array.length) + { + return NaN; + } + else if (array.length === 1) + { + return array[0]; + } + + var i = 1; + var low; + var high; + + if (key) + { + if (value < array[0][key]) + { + return array[0]; + } + + while (array[i][key] < value) + { + i++; + } + } + else + { + while (array[i] < value) + { + i++; + } + } + + if (i > array.length) + { + i = array.length; + } + + if (key) + { + low = array[i - 1][key]; + high = array[i][key]; + + return ((high - value) <= (value - low)) ? array[i] : array[i - 1]; + } + else + { + low = array[i - 1]; + high = array[i]; + + return ((high - value) <= (value - low)) ? high : low; + } +}; + +module.exports = FindClosestInSorted; + + +/***/ }), + +/***/ 4493: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array and flattens it, returning a shallow-copy flattened array. + * + * @function Phaser.Utils.Array.Flatten + * @since 3.60.0 + * + * @param {array} array - The array to flatten. + * @param {array} [output] - An array to hold the results in. + * + * @return {array} The flattened output array. + */ +var Flatten = function (array, output) +{ + if (output === undefined) { output = []; } + + for (var i = 0; i < array.length; i++) + { + if (Array.isArray(array[i])) + { + Flatten(array[i], output); + } + else + { + output.push(array[i]); + } + } + + return output; +}; + +module.exports = Flatten; + + +/***/ }), + +/***/ 6245: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Returns all elements in the array. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('visible', true)` would return only elements that have their visible property set. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 elements. + * + * @function Phaser.Utils.Array.GetAll + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} [property] - The property to test on each array element. + * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. + * + * @return {array} All matching elements from the array. + */ +var GetAll = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + var output = []; + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var child = array[i]; + + if (!property || + (property && value === undefined && child.hasOwnProperty(property)) || + (property && value !== undefined && child[property] === value)) + { + output.push(child); + } + } + } + + return output; +}; + +module.exports = GetAll; + + +/***/ }), + +/***/ 1647: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Returns the first element in the array. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('visible', true)` would return the first element that had its `visible` property set. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would search only the first 50 elements. + * + * @function Phaser.Utils.Array.GetFirst + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} [property] - The property to test on each array element. + * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=array.length] - An optional end index to search up to (but not included) + * + * @return {object} The first matching element from the array, or `null` if no element could be found in the range given. + */ +var GetFirst = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var child = array[i]; + + if (!property || + (property && value === undefined && child.hasOwnProperty(property)) || + (property && value !== undefined && child[property] === value)) + { + return child; + } + } + } + + return null; +}; + +module.exports = GetFirst; + + +/***/ }), + +/***/ 5301: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns a Random element from the array. + * + * @function Phaser.Utils.Array.GetRandom + * @since 3.0.0 + * + * @param {array} array - The array to select the random entry from. + * @param {number} [startIndex=0] - An optional start index. + * @param {number} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from. + * + * @return {*} A random element from the array, or `null` if no element could be found in the range given. + */ +var GetRandom = function (array, startIndex, length) +{ + if (startIndex === undefined) { startIndex = 0; } + if (length === undefined) { length = array.length; } + + var randomIndex = startIndex + Math.floor(Math.random() * length); + + return (array[randomIndex] === undefined) ? null : array[randomIndex]; +}; + +module.exports = GetRandom; + + +/***/ }), + +/***/ 8683: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given array element above another one in the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveAbove + * @since 3.55.0 + * + * @param {array} array - The input array. + * @param {*} item1 - The element to move above base element. + * @param {*} item2 - The base element. + * + * + * @return {array} The input array. + */ +var MoveAbove = function (array, item1, item2) +{ + if (item1 === item2) + { + return array; + } + + var currentIndex = array.indexOf(item1); + var baseIndex = array.indexOf(item2); + + if (currentIndex < 0 || baseIndex < 0) + { + throw new Error('Supplied items must be elements of the same array'); + } + + if (currentIndex > baseIndex) + { + // item1 is already above item2 + return array; + } + + // Remove + array.splice(currentIndex, 1); + + // Add in new location + if (baseIndex === array.length - 1) + { + array.push(item1); + } + else + { + array.splice(baseIndex, 0, item1); + } + + return array; +}; + +module.exports = MoveAbove; + + +/***/ }), + +/***/ 546: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given array element below another one in the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveBelow + * @since 3.55.0 + * + * @param {array} array - The input array. + * @param {*} item1 - The element to move below base element. + * @param {*} item2 - The base element. + * + * + * @return {array} The input array. + */ +var MoveBelow = function (array, item1, item2) +{ + if (item1 === item2) + { + return array; + } + + var currentIndex = array.indexOf(item1); + var baseIndex = array.indexOf(item2); + + if (currentIndex < 0 || baseIndex < 0) + { + throw new Error('Supplied items must be elements of the same array'); + } + + if (currentIndex < baseIndex) + { + // item1 is already below item2 + return array; + } + + // Remove + array.splice(currentIndex, 1); + + // Add in new location + if (baseIndex === 0) + { + array.unshift(item1); + } + else + { + array.splice(baseIndex, 0, item1); + } + + return array; +}; + +module.exports = MoveBelow; + + +/***/ }), + +/***/ 1842: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given array element down one place in the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveDown + * @since 3.4.0 + * + * @param {array} array - The input array. + * @param {*} item - The element to move down the array. + * + * @return {array} The input array. + */ +var MoveDown = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex > 0) + { + var item2 = array[currentIndex - 1]; + + var index2 = array.indexOf(item2); + + array[currentIndex] = item2; + array[index2] = item; + } + + return array; +}; + +module.exports = MoveDown; + + +/***/ }), + +/***/ 1419: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves an element in an array to a new position within the same array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveTo + * @since 3.4.0 + * + * @param {array} array - The array. + * @param {*} item - The element to move. + * @param {number} index - The new index that the element will be moved to. + * + * @return {*} The element that was moved. + */ +var MoveTo = function (array, item, index) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex === -1 || index < 0 || index >= array.length) + { + throw new Error('Supplied index out of bounds'); + } + + if (currentIndex !== index) + { + // Remove + array.splice(currentIndex, 1); + + // Add in new location + array.splice(index, 0, item); + } + + return item; +}; + +module.exports = MoveTo; + + +/***/ }), + +/***/ 6512: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given array element up one place in the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveUp + * @since 3.4.0 + * + * @param {array} array - The input array. + * @param {*} item - The element to move up the array. + * + * @return {array} The input array. + */ +var MoveUp = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex !== -1 && currentIndex < array.length - 1) + { + // The element one above `item` in the array + var item2 = array[currentIndex + 1]; + var index2 = array.indexOf(item2); + + array[currentIndex] = item2; + array[index2] = item; + } + + return array; +}; + +module.exports = MoveUp; + + +/***/ }), + +/***/ 4130: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Create an array representing the range of numbers (usually integers), between, and inclusive of, + * the given `start` and `end` arguments. For example: + * + * `var array = Phaser.Utils.Array.NumberArray(2, 4); // array = [2, 3, 4]` + * `var array = Phaser.Utils.Array.NumberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` + * `var array = Phaser.Utils.Array.NumberArray(8, 2); // array = [8, 7, 6, 5, 4, 3, 2]` + * + * This is equivalent to `Phaser.Utils.Array.NumberArrayStep(start, end, 1)`. + * + * You can optionally provide a prefix and / or suffix string. If given the array will contain + * strings, not integers. For example: + * + * `var array = Phaser.Utils.Array.NumberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` + * `var array = Phaser.Utils.Array.NumberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` + * + * @function Phaser.Utils.Array.NumberArray + * @since 3.0.0 + * + * @param {number} start - The minimum value the array starts with. + * @param {number} end - The maximum value the array contains. + * @param {string} [prefix] - Optional prefix to place before the number. If provided the array will contain strings, not integers. + * @param {string} [suffix] - Optional suffix to place after the number. If provided the array will contain strings, not integers. + * + * @return {(number[]|string[])} The array of number values, or strings if a prefix or suffix was provided. + */ +var NumberArray = function (start, end, prefix, suffix) +{ + var result = []; + + var i; + var asString = false; + + if (prefix || suffix) + { + asString = true; + + if (!prefix) + { + prefix = ''; + } + + if (!suffix) + { + suffix = ''; + } + } + + if (end < start) + { + for (i = start; i >= end; i--) + { + if (asString) + { + result.push(prefix + i.toString() + suffix); + } + else + { + result.push(i); + } + } + } + else + { + for (i = start; i <= end; i++) + { + if (asString) + { + result.push(prefix + i.toString() + suffix); + } + else + { + result.push(i); + } + } + } + + return result; +}; + +module.exports = NumberArray; + + +/***/ }), + +/***/ 1316: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RoundAwayFromZero = __webpack_require__(4078); + +/** + * Create an array of numbers (positive and/or negative) progressing from `start` + * up to but not including `end` by advancing by `step`. + * + * If `start` is less than `end` a zero-length range is created unless a negative `step` is specified. + * + * Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0; + * for forward compatibility make sure to pass in actual numbers. + * + * @example + * NumberArrayStep(4); + * // => [0, 1, 2, 3] + * + * NumberArrayStep(1, 5); + * // => [1, 2, 3, 4] + * + * NumberArrayStep(0, 20, 5); + * // => [0, 5, 10, 15] + * + * NumberArrayStep(0, -4, -1); + * // => [0, -1, -2, -3] + * + * NumberArrayStep(1, 4, 0); + * // => [1, 1, 1] + * + * NumberArrayStep(0); + * // => [] + * + * @function Phaser.Utils.Array.NumberArrayStep + * @since 3.0.0 + * + * @param {number} [start=0] - The start of the range. + * @param {number} [end=null] - The end of the range. + * @param {number} [step=1] - The value to increment or decrement by. + * + * @return {number[]} The array of number values. + */ +var NumberArrayStep = function (start, end, step) +{ + if (start === undefined) { start = 0; } + if (end === undefined) { end = null; } + if (step === undefined) { step = 1; } + + if (end === null) + { + end = start; + start = 0; + } + + var result = []; + + var total = Math.max(RoundAwayFromZero((end - start) / (step || 1)), 0); + + for (var i = 0; i < total; i++) + { + result.push(start); + start += step; + } + + return result; +}; + +module.exports = NumberArrayStep; + + +/***/ }), + +/***/ 9465: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @ignore + */ +function swap (arr, i, j) +{ + var tmp = arr[i]; + arr[i] = arr[j]; + arr[j] = tmp; +} + +/** + * @ignore + */ +function defaultCompare (a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * A [Floyd-Rivest](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm) quick selection algorithm. + * + * Rearranges the array items so that all items in the [left, k] range are smaller than all items in [k, right]; + * The k-th element will have the (k - left + 1)th smallest value in [left, right]. + * + * The array is modified in-place. + * + * Based on code by [Vladimir Agafonkin](https://www.npmjs.com/~mourner) + * + * @function Phaser.Utils.Array.QuickSelect + * @since 3.0.0 + * + * @param {array} arr - The array to sort. + * @param {number} k - The k-th element index. + * @param {number} [left=0] - The index of the left part of the range. + * @param {number} [right] - The index of the right part of the range. + * @param {function} [compare] - An optional comparison function. Is passed two elements and should return 0, 1 or -1. + */ +var QuickSelect = function (arr, k, left, right, compare) +{ + if (left === undefined) { left = 0; } + if (right === undefined) { right = arr.length - 1; } + if (compare === undefined) { compare = defaultCompare; } + + while (right > left) + { + if (right - left > 600) + { + var n = right - left + 1; + var m = k - left + 1; + var z = Math.log(n); + var s = 0.5 * Math.exp(2 * z / 3); + var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1); + var newLeft = Math.max(left, Math.floor(k - m * s / n + sd)); + var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd)); + + QuickSelect(arr, k, newLeft, newRight, compare); + } + + var t = arr[k]; + var i = left; + var j = right; + + swap(arr, left, k); + + if (compare(arr[right], t) > 0) + { + swap(arr, left, right); + } + + while (i < j) + { + swap(arr, i, j); + + i++; + j--; + + while (compare(arr[i], t) < 0) + { + i++; + } + + while (compare(arr[j], t) > 0) + { + j--; + } + } + + if (compare(arr[left], t) === 0) + { + swap(arr, left, j); + } + else + { + j++; + swap(arr, j, right); + } + + if (j <= k) + { + left = j + 1; + } + + if (k <= j) + { + right = j - 1; + } + } +}; + +module.exports = QuickSelect; + + +/***/ }), + +/***/ 9703: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetValue = __webpack_require__(5851); +var Shuffle = __webpack_require__(4912); + +var BuildChunk = function (a, b, qty) +{ + var out = []; + + for (var aIndex = 0; aIndex < a.length; aIndex++) + { + for (var bIndex = 0; bIndex < b.length; bIndex++) + { + for (var i = 0; i < qty; i++) + { + out.push({ a: a[aIndex], b: b[bIndex] }); + } + } + } + + return out; +}; + +/** + * Creates an array populated with a range of values, based on the given arguments and configuration object. + * + * Range ([a,b,c], [1,2,3]) = + * a1, a2, a3, b1, b2, b3, c1, c2, c3 + * + * Range ([a,b], [1,2,3], qty = 3) = + * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3 + * + * Range ([a,b,c], [1,2,3], repeat x1) = + * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3 + * + * Range ([a,b], [1,2], repeat -1 = endless, max = 14) = + * Maybe if max is set then repeat goes to -1 automatically? + * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements) + * + * Range ([a], [1,2,3,4,5], random = true) = + * a4, a1, a5, a2, a3 + * + * Range ([a, b], [1,2,3], random = true) = + * b3, a2, a1, b1, a3, b2 + * + * Range ([a, b, c], [1,2,3], randomB = true) = + * a3, a1, a2, b2, b3, b1, c1, c3, c2 + * + * Range ([a], [1,2,3,4,5], yoyo = true) = + * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1 + * + * Range ([a, b], [1,2,3], yoyo = true) = + * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1 + * + * @function Phaser.Utils.Array.Range + * @since 3.0.0 + * + * @param {array} a - The first array of range elements. + * @param {array} b - The second array of range elements. + * @param {object} [options] - A range configuration object. Can contain: repeat, random, randomB, yoyo, max, qty. + * + * @return {array} An array of arranged elements. + */ +var Range = function (a, b, options) +{ + var max = GetValue(options, 'max', 0); + var qty = GetValue(options, 'qty', 1); + var random = GetValue(options, 'random', false); + var randomB = GetValue(options, 'randomB', false); + var repeat = GetValue(options, 'repeat', 0); + var yoyo = GetValue(options, 'yoyo', false); + + var out = []; + + if (randomB) + { + Shuffle(b); + } + + // Endless repeat, so limit by max + if (repeat === -1) + { + if (max === 0) + { + repeat = 0; + } + else + { + // Work out how many repeats we need + var total = (a.length * b.length) * qty; + + if (yoyo) + { + total *= 2; + } + + repeat = Math.ceil(max / total); + } + } + + for (var i = 0; i <= repeat; i++) + { + var chunk = BuildChunk(a, b, qty); + + if (random) + { + Shuffle(chunk); + } + + out = out.concat(chunk); + + if (yoyo) + { + chunk.reverse(); + + out = out.concat(chunk); + } + } + + if (max) + { + out.splice(max); + } + + return out; +}; + +module.exports = Range; + + +/***/ }), + +/***/ 7161: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SpliceOne = __webpack_require__(8935); + +/** + * Removes the given item, or array of items, from the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for each item successfully removed from the array. + * + * @function Phaser.Utils.Array.Remove + * @since 3.4.0 + * + * @param {array} array - The array to be modified. + * @param {*|Array.<*>} item - The item, or array of items, to be removed from the array. + * @param {function} [callback] - A callback to be invoked for each item successfully removed from the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {*|Array.<*>} The item, or array of items, that were successfully removed from the array. + */ +var Remove = function (array, item, callback, context) +{ + if (context === undefined) { context = array; } + + var index; + + // Fast path to avoid array mutation and iteration + if (!Array.isArray(item)) + { + index = array.indexOf(item); + + if (index !== -1) + { + SpliceOne(array, index); + + if (callback) + { + callback.call(context, item); + } + + return item; + } + else + { + return null; + } + } + + // If we got this far, we have an array of items to remove + + var itemLength = item.length - 1; + var removed = []; + + while (itemLength >= 0) + { + var entry = item[itemLength]; + + index = array.indexOf(entry); + + if (index !== -1) + { + SpliceOne(array, index); + + removed.push(entry); + + if (callback) + { + callback.call(context, entry); + } + } + + itemLength--; + } + + return removed; +}; + +module.exports = Remove; + + +/***/ }), + +/***/ 4725: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SpliceOne = __webpack_require__(8935); + +/** + * Removes the item from the given position in the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array. + * + * @function Phaser.Utils.Array.RemoveAt + * @since 3.4.0 + * + * @param {array} array - The array to be modified. + * @param {number} index - The array index to remove the item from. The index must be in bounds or it will throw an error. + * @param {function} [callback] - A callback to be invoked for the item removed from the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {*} The item that was removed. + */ +var RemoveAt = function (array, index, callback, context) +{ + if (context === undefined) { context = array; } + + if (index < 0 || index > array.length - 1) + { + throw new Error('Index out of bounds'); + } + + var item = SpliceOne(array, index); + + if (callback) + { + callback.call(context, item); + } + + return item; +}; + +module.exports = RemoveAt; + + +/***/ }), + +/***/ 8780: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Removes the item within the given range in the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for the item/s successfully removed from the array. + * + * @function Phaser.Utils.Array.RemoveBetween + * @since 3.4.0 + * + * @param {array} array - The array to be modified. + * @param {number} startIndex - The start index to remove from. + * @param {number} endIndex - The end index to remove to. + * @param {function} [callback] - A callback to be invoked for the item removed from the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {Array.<*>} An array of items that were removed. + */ +var RemoveBetween = function (array, startIndex, endIndex, callback, context) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + if (context === undefined) { context = array; } + + if (SafeRange(array, startIndex, endIndex)) + { + var size = endIndex - startIndex; + + var removed = array.splice(startIndex, size); + + if (callback) + { + for (var i = 0; i < removed.length; i++) + { + var entry = removed[i]; + + callback.call(context, entry); + } + } + + return removed; + } + else + { + return []; + } +}; + +module.exports = RemoveBetween; + + +/***/ }), + +/***/ 5744: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SpliceOne = __webpack_require__(8935); + +/** + * Removes a random object from the given array and returns it. + * Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index. + * + * @function Phaser.Utils.Array.RemoveRandomElement + * @since 3.0.0 + * + * @param {array} array - The array to removed a random element from. + * @param {number} [start=0] - The array index to start the search from. + * @param {number} [length=array.length] - Optional restriction on the number of elements to randomly select from. + * + * @return {object} The random element that was removed, or `null` if there were no array elements that fell within the given range. + */ +var RemoveRandomElement = function (array, start, length) +{ + if (start === undefined) { start = 0; } + if (length === undefined) { length = array.length; } + + var randomIndex = start + Math.floor(Math.random() * length); + + return SpliceOne(array, randomIndex); +}; + +module.exports = RemoveRandomElement; + + +/***/ }), + +/***/ 6960: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Replaces an element of the array with the new element. + * The new element cannot already be a member of the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.Replace + * @since 3.4.0 + * + * @param {array} array - The array to search within. + * @param {*} oldChild - The element in the array that will be replaced. + * @param {*} newChild - The element to be inserted into the array at the position of `oldChild`. + * + * @return {boolean} Returns true if the oldChild was successfully replaced, otherwise returns false. + */ +var Replace = function (array, oldChild, newChild) +{ + var index1 = array.indexOf(oldChild); + var index2 = array.indexOf(newChild); + + if (index1 !== -1 && index2 === -1) + { + array[index1] = newChild; + + return true; + } + else + { + return false; + } +}; + +module.exports = Replace; + + +/***/ }), + +/***/ 1021: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the element at the start of the array to the end, shifting all items in the process. + * The "rotation" happens to the left. + * + * @function Phaser.Utils.Array.RotateLeft + * @since 3.0.0 + * + * @param {array} array - The array to shift to the left. This array is modified in place. + * @param {number} [total=1] - The number of times to shift the array. + * + * @return {*} The most recently shifted element. + */ +var RotateLeft = function (array, total) +{ + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) + { + element = array.shift(); + array.push(element); + } + + return element; +}; + +module.exports = RotateLeft; + + +/***/ }), + +/***/ 4027: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the element at the end of the array to the start, shifting all items in the process. + * The "rotation" happens to the right. + * + * @function Phaser.Utils.Array.RotateRight + * @since 3.0.0 + * + * @param {array} array - The array to shift to the right. This array is modified in place. + * @param {number} [total=1] - The number of times to shift the array. + * + * @return {*} The most recently shifted element. + */ +var RotateRight = function (array, total) +{ + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) + { + element = array.pop(); + array.unshift(element); + } + + return element; +}; + +module.exports = RotateRight; + + +/***/ }), + +/***/ 2497: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Tests if the start and end indexes are a safe range for the given array. + * + * @function Phaser.Utils.Array.SafeRange + * @since 3.4.0 + * + * @param {array} array - The array to check. + * @param {number} startIndex - The start index. + * @param {number} endIndex - The end index. + * @param {boolean} [throwError=true] - Throw an error if the range is out of bounds. + * + * @return {boolean} True if the range is safe, otherwise false. + */ +var SafeRange = function (array, startIndex, endIndex, throwError) +{ + var len = array.length; + + if (startIndex < 0 || + startIndex > len || + startIndex >= endIndex || + endIndex > len) + { + if (throwError) + { + throw new Error('Range Error: Values outside acceptable range'); + } + + return false; + } + else + { + return true; + } +}; + +module.exports = SafeRange; + + +/***/ }), + +/***/ 5361: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given element to the bottom of the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.SendToBack + * @since 3.4.0 + * + * @param {array} array - The array. + * @param {*} item - The element to move. + * + * @return {*} The element that was moved. + */ +var SendToBack = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex !== -1 && currentIndex > 0) + { + array.splice(currentIndex, 1); + array.unshift(item); + } + + return item; +}; + +module.exports = SendToBack; + + +/***/ }), + +/***/ 3718: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Scans the array for elements with the given property. If found, the property is set to the `value`. + * + * For example: `SetAll('visible', true)` would set all elements that have a `visible` property to `false`. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would update only the first 50 elements. + * + * @function Phaser.Utils.Array.SetAll + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} property - The property to test for on each array element. + * @param {*} value - The value to set the property to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. + * + * @return {array} The input array. + */ +var SetAll = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var entry = array[i]; + + if (entry.hasOwnProperty(property)) + { + entry[property] = value; + } + } + } + + return array; +}; + +module.exports = SetAll; + + +/***/ }), + +/***/ 4912: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Shuffles the contents of the given array using the Fisher-Yates implementation. + * + * The original array is modified directly and returned. + * + * @function Phaser.Utils.Array.Shuffle + * @since 3.0.0 + * + * @generic T + * @genericUse {T[]} - [array,$return] + * + * @param {T[]} array - The array to shuffle. This array is modified in place. + * + * @return {T[]} The shuffled array. + */ +var Shuffle = function (array) +{ + for (var i = array.length - 1; i > 0; i--) + { + var j = Math.floor(Math.random() * (i + 1)); + var temp = array[i]; + array[i] = array[j]; + array[j] = temp; + } + + return array; +}; + +module.exports = Shuffle; + + +/***/ }), + +/***/ 2071: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes the given array and runs a numeric sort on it, ignoring any non-digits that + * may be in the entries. + * + * You should only run this on arrays containing strings. + * + * @function Phaser.Utils.Array.SortByDigits + * @since 3.50.0 + * + * @param {string[]} array - The input array of strings. + * + * @return {string[]} The sorted input array. + */ +var SortByDigits = function (array) +{ + var re = /\D/g; + + array.sort(function (a, b) + { + return (parseInt(a.replace(re, ''), 10) - parseInt(b.replace(re, ''), 10)); + }); + + return array; +}; + +module.exports = SortByDigits; + + +/***/ }), + +/***/ 8935: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Removes a single item from an array and returns it without creating gc, like the native splice does. + * Based on code by Mike Reinstein. + * + * @function Phaser.Utils.Array.SpliceOne + * @since 3.0.0 + * + * @param {array} array - The array to splice from. + * @param {number} index - The index of the item which should be spliced. + * + * @return {*} The item which was spliced (removed). + */ +var SpliceOne = function (array, index) +{ + if (index >= array.length) + { + return; + } + + var len = array.length - 1; + + var item = array[index]; + + for (var i = index; i < len; i++) + { + array[i] = array[i + 1]; + } + + array.length = len; + + return item; +}; + +module.exports = SpliceOne; + + +/***/ }), + +/***/ 9992: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @author Angry Bytes (and contributors) + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Device = __webpack_require__(9356); + +/** + * The comparator function. + * + * @ignore + * + * @param {*} a - The first item to test. + * @param {*} b - The second itemt to test. + * + * @return {boolean} True if they localCompare, otherwise false. + */ +function Compare (a, b) +{ + return String(a).localeCompare(b); +} + +/** + * Process the array contents. + * + * @ignore + * + * @param {array} array - The array to process. + * @param {function} compare - The comparison function. + * + * @return {array} - The processed array. + */ +function Process (array, compare) +{ + // Short-circuit when there's nothing to sort. + var len = array.length; + + if (len <= 1) + { + return array; + } + + // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. + // Chunks are the size of the left or right hand in merge sort. + // Stop when the left-hand covers all of the array. + var buffer = new Array(len); + + for (var chk = 1; chk < len; chk *= 2) + { + RunPass(array, compare, chk, buffer); + + var tmp = array; + + array = buffer; + + buffer = tmp; + } + + return array; +} + +/** + * Run a single pass with the given chunk size. + * + * @ignore + * + * @param {array} arr - The array to run the pass on. + * @param {function} comp - The comparison function. + * @param {number} chk - The number of iterations. + * @param {array} result - The array to store the result in. + */ +function RunPass (arr, comp, chk, result) +{ + var len = arr.length; + var i = 0; + + // Step size / double chunk size. + var dbl = chk * 2; + + // Bounds of the left and right chunks. + var l, r, e; + + // Iterators over the left and right chunk. + var li, ri; + + // Iterate over pairs of chunks. + for (l = 0; l < len; l += dbl) + { + r = l + chk; + e = r + chk; + + if (r > len) + { + r = len; + } + + if (e > len) + { + e = len; + } + + // Iterate both chunks in parallel. + li = l; + ri = r; + + while (true) + { + // Compare the chunks. + if (li < r && ri < e) + { + // This works for a regular `sort()` compatible comparator, + // but also for a simple comparator like: `a > b` + if (comp(arr[li], arr[ri]) <= 0) + { + result[i++] = arr[li++]; + } + else + { + result[i++] = arr[ri++]; + } + } + else if (li < r) + { + // Nothing to compare, just flush what's left. + result[i++] = arr[li++]; + } + else if (ri < e) + { + result[i++] = arr[ri++]; + } + else + { + // Both iterators are at the chunk ends. + break; + } + } + } +} + +/** + * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. + * + * This is an implementation of merge sort, without recursion. + * + * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable + * + * @function Phaser.Utils.Array.StableSort + * @since 3.0.0 + * + * @param {array} array - The input array to be sorted. + * @param {function} [compare] - The comparison function. + * + * @return {array} The sorted result. + */ +var StableSort = function (array, compare) +{ + if (compare === undefined) { compare = Compare; } + + // Short-circuit when there's nothing to sort. + if (!array || array.length < 2) + { + return array; + } + + if (Device.features.stableSort) + { + return array.sort(compare); + } + + var result = Process(array, compare); + + // This simply copies back if the result isn't in the original array, which happens on an odd number of passes. + if (result !== array) + { + RunPass(result, null, array.length, array); + } + + return array; +}; + +module.exports = StableSort; + + +/***/ }), + +/***/ 2372: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Swaps the position of two elements in the given array. + * The elements must exist in the same array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.Swap + * @since 3.4.0 + * + * @param {array} array - The input array. + * @param {*} item1 - The first element to swap. + * @param {*} item2 - The second element to swap. + * + * @return {array} The input array. + */ +var Swap = function (array, item1, item2) +{ + if (item1 === item2) + { + return array; + } + + var index1 = array.indexOf(item1); + var index2 = array.indexOf(item2); + + if (index1 < 0 || index2 < 0) + { + throw new Error('Supplied items must be elements of the same array'); + } + + array[index1] = item2; + array[index2] = item1; + + return array; +}; + +module.exports = Swap; + + +/***/ }), + +/***/ 1953: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Utils.Array + */ + +module.exports = { + + Matrix: __webpack_require__(1237), + + Add: __webpack_require__(1792), + AddAt: __webpack_require__(2280), + BringToTop: __webpack_require__(2513), + CountAllMatching: __webpack_require__(1771), + Each: __webpack_require__(7883), + EachInRange: __webpack_require__(5856), + FindClosestInSorted: __webpack_require__(3957), + Flatten: __webpack_require__(4493), + GetAll: __webpack_require__(6245), + GetFirst: __webpack_require__(1647), + GetRandom: __webpack_require__(5301), + MoveDown: __webpack_require__(1842), + MoveTo: __webpack_require__(1419), + MoveUp: __webpack_require__(6512), + MoveAbove: __webpack_require__(8683), + MoveBelow: __webpack_require__(546), + NumberArray: __webpack_require__(4130), + NumberArrayStep: __webpack_require__(1316), + QuickSelect: __webpack_require__(9465), + Range: __webpack_require__(9703), + Remove: __webpack_require__(7161), + RemoveAt: __webpack_require__(4725), + RemoveBetween: __webpack_require__(8780), + RemoveRandomElement: __webpack_require__(5744), + Replace: __webpack_require__(6960), + RotateLeft: __webpack_require__(1021), + RotateRight: __webpack_require__(4027), + SafeRange: __webpack_require__(2497), + SendToBack: __webpack_require__(5361), + SetAll: __webpack_require__(3718), + Shuffle: __webpack_require__(4912), + SortByDigits: __webpack_require__(2071), + SpliceOne: __webpack_require__(8935), + StableSort: __webpack_require__(9992), + Swap: __webpack_require__(2372) + +}; + + +/***/ }), + +/***/ 1816: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if an array can be used as a matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.CheckMatrix + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix] + * + * @param {T[][]} [matrix] - The array to check. + * + * @return {boolean} `true` if the given `matrix` array is a valid matrix. + */ +var CheckMatrix = function (matrix) +{ + if (!Array.isArray(matrix) || !Array.isArray(matrix[0])) + { + return false; + } + + // How long is the first row? + var size = matrix[0].length; + + // Validate the rest of the rows are the same length + for (var i = 1; i < matrix.length; i++) + { + if (matrix[i].length !== size) + { + return false; + } + } + + return true; +}; + +module.exports = CheckMatrix; + + +/***/ }), + +/***/ 6655: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Pad = __webpack_require__(7222); +var CheckMatrix = __webpack_require__(1816); + +/** + * Generates a string (which you can pass to console.log) from the given Array Matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.MatrixToString + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix] + * + * @param {T[][]} [matrix] - A 2-dimensional array. + * + * @return {string} A string representing the matrix. + */ +var MatrixToString = function (matrix) +{ + var str = ''; + + if (!CheckMatrix(matrix)) + { + return str; + } + + for (var r = 0; r < matrix.length; r++) + { + for (var c = 0; c < matrix[r].length; c++) + { + var cell = matrix[r][c].toString(); + + if (cell !== 'undefined') + { + str += Pad(cell, 2); + } + else + { + str += '?'; + } + + if (c < matrix[r].length - 1) + { + str += ' |'; + } + } + + if (r < matrix.length - 1) + { + str += '\n'; + + for (var i = 0; i < matrix[r].length; i++) + { + str += '---'; + + if (i < matrix[r].length - 1) + { + str += '+'; + } + } + + str += '\n'; + } + + } + + return str; +}; + +module.exports = MatrixToString; + + +/***/ }), + +/***/ 582: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Reverses the columns in the given Array Matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.ReverseColumns + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to reverse the columns for. + * + * @return {T[][]} The column reversed matrix. + */ +var ReverseColumns = function (matrix) +{ + return matrix.reverse(); +}; + +module.exports = ReverseColumns; + + +/***/ }), + +/***/ 6063: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Reverses the rows in the given Array Matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.ReverseRows + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to reverse the rows for. + * + * @return {T[][]} The column reversed matrix. + */ +var ReverseRows = function (matrix) +{ + for (var i = 0; i < matrix.length; i++) + { + matrix[i].reverse(); + } + + return matrix; +}; + +module.exports = ReverseRows; + + +/***/ }), + +/***/ 8321: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateMatrix = __webpack_require__(7116); + +/** + * Rotates the array matrix 180 degrees. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.Rotate180 + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var Rotate180 = function (matrix) +{ + return RotateMatrix(matrix, 180); +}; + +module.exports = Rotate180; + + +/***/ }), + +/***/ 2597: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateMatrix = __webpack_require__(7116); + +/** + * Rotates the array matrix to the left (or 90 degrees) + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.RotateLeft + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var RotateLeft = function (matrix) +{ + return RotateMatrix(matrix, 90); +}; + +module.exports = RotateLeft; + + +/***/ }), + +/***/ 7116: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CheckMatrix = __webpack_require__(1816); +var TransposeMatrix = __webpack_require__(4780); + +/** + * Rotates the array matrix based on the given rotation value. + * + * The value can be given in degrees: 90, -90, 270, -270 or 180, + * or a string command: `rotateLeft`, `rotateRight` or `rotate180`. + * + * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.RotateMatrix + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * @param {(number|string)} [direction=90] - The amount to rotate the matrix by. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var RotateMatrix = function (matrix, direction) +{ + if (direction === undefined) { direction = 90; } + + if (!CheckMatrix(matrix)) + { + return null; + } + + if (typeof direction !== 'string') + { + direction = ((direction % 360) + 360) % 360; + } + + if (direction === 90 || direction === -270 || direction === 'rotateLeft') + { + matrix = TransposeMatrix(matrix); + matrix.reverse(); + } + else if (direction === -90 || direction === 270 || direction === 'rotateRight') + { + matrix.reverse(); + matrix = TransposeMatrix(matrix); + } + else if (Math.abs(direction) === 180 || direction === 'rotate180') + { + for (var i = 0; i < matrix.length; i++) + { + matrix[i].reverse(); + } + + matrix.reverse(); + } + + return matrix; +}; + +module.exports = RotateMatrix; + + +/***/ }), + +/***/ 6285: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateMatrix = __webpack_require__(7116); + +/** + * Rotates the array matrix to the left (or -90 degrees) + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.RotateRight + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var RotateRight = function (matrix) +{ + return RotateMatrix(matrix, -90); +}; + +module.exports = RotateRight; + + +/***/ }), + +/***/ 7711: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateLeft = __webpack_require__(1021); +var RotateRight = __webpack_require__(4027); + +/** + * Translates the given Array Matrix by shifting each column and row the + * amount specified. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.Translate + * @since 3.50.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to translate. + * @param {number} [x=0] - The amount to horizontally translate the matrix by. + * @param {number} [y=0] - The amount to vertically translate the matrix by. + * + * @return {T[][]} The translated matrix. + */ +var TranslateMatrix = function (matrix, x, y) +{ + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + // Vertical translation + + if (y !== 0) + { + if (y < 0) + { + // Shift Up + RotateLeft(matrix, Math.abs(y)); + } + else + { + // Shift Down + RotateRight(matrix, y); + } + } + + // Horizontal translation + + if (x !== 0) + { + for (var i = 0; i < matrix.length; i++) + { + var row = matrix[i]; + + if (x < 0) + { + RotateLeft(row, Math.abs(x)); + } + else + { + RotateRight(row, x); + } + } + } + + return matrix; +}; + +module.exports = TranslateMatrix; + + +/***/ }), + +/***/ 4780: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Transposes the elements of the given matrix (array of arrays). + * + * The transpose of a matrix is a new matrix whose rows are the columns of the original. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.TransposeMatrix + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [array,$return] + * + * @param {T[][]} [array] - The array matrix to transpose. + * + * @return {T[][]} A new array matrix which is a transposed version of the given array. + */ +var TransposeMatrix = function (array) +{ + var sourceRowCount = array.length; + var sourceColCount = array[0].length; + + var result = new Array(sourceColCount); + + for (var i = 0; i < sourceColCount; i++) + { + result[i] = new Array(sourceRowCount); + + for (var j = sourceRowCount - 1; j > -1; j--) + { + result[i][j] = array[j][i]; + } + } + + return result; +}; + +module.exports = TransposeMatrix; + + +/***/ }), + +/***/ 1237: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Utils.Array.Matrix + */ + +module.exports = { + + CheckMatrix: __webpack_require__(1816), + MatrixToString: __webpack_require__(6655), + ReverseColumns: __webpack_require__(582), + ReverseRows: __webpack_require__(6063), + Rotate180: __webpack_require__(8321), + RotateLeft: __webpack_require__(2597), + RotateMatrix: __webpack_require__(7116), + RotateRight: __webpack_require__(6285), + Translate: __webpack_require__(7711), + TransposeMatrix: __webpack_require__(4780) + +}; + + +/***/ }), + +/***/ 3911: +/***/ ((module) => { /** * @author Richard Davey @@ -58816,8 +63838,9 @@ module.exports = DeepCopy; /***/ }), -/* 339 */ -/***/ (function(module, exports) { + +/***/ 1030: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -58825,194 +63848,101 @@ module.exports = DeepCopy; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var IsPlainObject = __webpack_require__(2482); + +// @param {boolean} deep - Perform a deep copy? +// @param {object} target - The target object to copy to. +// @return {object} The extended object. + /** - * Provides methods used for getting and setting the size of a Game Object. + * This is a slightly modified version of http://api.jquery.com/jQuery.extend/ * - * @namespace Phaser.GameObjects.Components.Size + * @function Phaser.Utils.Objects.Extend * @since 3.0.0 + * + * @param {...*} [args] - The objects that will be mixed. + * + * @return {object} The extended object. */ +var Extend = function () +{ + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; -var Size = { - - /** - * A property indicating that a Game Object has this component. - * - * @name Phaser.GameObjects.Components.Size#_sizeComponent - * @type {boolean} - * @private - * @default true - * @since 3.2.0 - */ - _sizeComponent: true, - - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - * - * @name Phaser.GameObjects.Components.Size#width - * @type {number} - * @since 3.0.0 - */ - width: 0, - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - * - * @name Phaser.GameObjects.Components.Size#height - * @type {number} - * @since 3.0.0 - */ - height: 0, - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.Size#displayWidth - * @type {number} - * @since 3.0.0 - */ - displayWidth: { - - get: function () - { - return Math.abs(this.scaleX * this.frame.realWidth); - }, - - set: function (value) - { - this.scaleX = value / this.frame.realWidth; - } - - }, - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.Size#displayHeight - * @type {number} - * @since 3.0.0 - */ - displayHeight: { - - get: function () - { - return Math.abs(this.scaleY * this.frame.realHeight); - }, - - set: function (value) - { - this.scaleY = value / this.frame.realHeight; - } - - }, - - /** - * Sets the size of this Game Object to be that of the given Frame. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * - * @method Phaser.GameObjects.Components.Size#setSizeToFrame - * @since 3.0.0 - * - * @param {Phaser.Textures.Frame} frame - The frame to base the size of this Game Object on. - * - * @return {this} This Game Object instance. - */ - setSizeToFrame: function (frame) + // Handle a deep copy situation + if (typeof target === 'boolean') { - if (frame === undefined) { frame = this.frame; } + deep = target; + target = arguments[1] || {}; - this.width = frame.realWidth; - this.height = frame.realHeight; - - var input = this.input; - - if (input && !input.customHitArea) - { - input.hitArea.width = this.width; - input.hitArea.height = this.height; - } - - return this; - }, - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * - * @method Phaser.GameObjects.Components.Size#setSize - * @since 3.0.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setSize: function (width, height) - { - this.width = width; - this.height = height; - - return this; - }, - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * - * @method Phaser.GameObjects.Components.Size#setDisplaySize - * @since 3.0.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setDisplaySize: function (width, height) - { - this.displayWidth = width; - this.displayHeight = height; - - return this; + // skip the boolean and the target + i = 2; } + // extend Phaser if only one argument is passed + if (length === i) + { + target = this; + --i; + } + + for (; i < length; i++) + { + // Only deal with non-null/undefined values + if ((options = arguments[i]) != null) + { + // Extend the base object + for (name in options) + { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target === copy) + { + continue; + } + + // Recurse if we're merging plain objects or arrays + if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) + { + if (copyIsArray) + { + copyIsArray = false; + clone = src && Array.isArray(src) ? src : []; + } + else + { + clone = src && IsPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = Extend(deep, clone, copy); + + // Don't bring in undefined values + } + else if (copy !== undefined) + { + target[name] = copy; + } + } + } + } + + // Return the modified object + return target; }; -module.exports = Size; +module.exports = Extend; /***/ }), -/* 340 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8361: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -59020,893 +63950,250 @@ module.exports = Size; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Frame = __webpack_require__(68); - -// bitmask flag for GameObject.renderMask -var _FLAG = 8; // 1000 +var MATH = __webpack_require__(4675); +var GetValue = __webpack_require__(5851); /** - * Provides methods used for getting and setting the texture of a Game Object. + * Retrieves a value from an object. Allows for more advanced selection options, including: * - * @namespace Phaser.GameObjects.Components.Texture + * Allowed types: + * + * Implicit + * { + * x: 4 + * } + * + * From function + * { + * x: function () + * } + * + * Randomly pick one element from the array + * { + * x: [a, b, c, d, e, f] + * } + * + * Random integer between min and max: + * { + * x: { randInt: [min, max] } + * } + * + * Random float between min and max: + * { + * x: { randFloat: [min, max] } + * } + * + * + * @function Phaser.Utils.Objects.GetAdvancedValue * @since 3.0.0 + * + * @param {object} source - The object to retrieve the value from. + * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. + * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. + * + * @return {*} The value of the requested key. + */ +var GetAdvancedValue = function (source, key, defaultValue) +{ + var value = GetValue(source, key, null); + + if (value === null) + { + return defaultValue; + } + else if (Array.isArray(value)) + { + return MATH.RND.pick(value); + } + else if (typeof value === 'object') + { + if (value.hasOwnProperty('randInt')) + { + return MATH.RND.integerInRange(value.randInt[0], value.randInt[1]); + } + else if (value.hasOwnProperty('randFloat')) + { + return MATH.RND.realInRange(value.randFloat[0], value.randFloat[1]); + } + } + else if (typeof value === 'function') + { + return value(key); + } + + return value; +}; + +module.exports = GetAdvancedValue; + + +/***/ }), + +/***/ 4597: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Texture = { +/** + * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue} + * + * @function Phaser.Utils.Objects.GetFastValue + * @since 3.0.0 + * + * @param {object} source - The object to search + * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods) + * @param {*} [defaultValue] - The default value to use if the key does not exist. + * + * @return {*} The value if found; otherwise, defaultValue (null if none provided) + */ +var GetFastValue = function (source, key, defaultValue) +{ + var t = typeof(source); - /** - * The Texture this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.Texture#texture - * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} - * @since 3.0.0 - */ - texture: null, - - /** - * The Texture Frame this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.Texture#frame - * @type {Phaser.Textures.Frame} - * @since 3.0.0 - */ - frame: null, - - /** - * Internal flag. Not to be set by this Game Object. - * - * @name Phaser.GameObjects.Components.Texture#isCropped - * @type {boolean} - * @private - * @since 3.11.0 - */ - isCropped: false, - - /** - * Sets the texture and frame this Game Object will use to render with. - * - * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * - * @method Phaser.GameObjects.Components.Texture#setTexture - * @since 3.0.0 - * - * @param {(string|Phaser.Textures.Texture)} key - The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. - * @param {(string|number)} [frame] - The name or index of the frame within the Texture. - * - * @return {this} This Game Object instance. - */ - setTexture: function (key, frame) + if (!source || t === 'number' || t === 'string') { - this.texture = this.scene.sys.textures.get(key); - - return this.setFrame(frame); - }, - - /** - * Sets the frame this Game Object will use to render with. - * - * If you pass a string or index then the Frame has to belong to the current Texture being used - * by this Game Object. - * - * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * - * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * - * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. - * - * @method Phaser.GameObjects.Components.Texture#setFrame - * @since 3.0.0 - * - * @param {(string|number|Phaser.Textures.Frame)} frame - The name or index of the frame within the Texture, or a Frame instance. - * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? - * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? - * - * @return {this} This Game Object instance. - */ - setFrame: function (frame, updateSize, updateOrigin) + return defaultValue; + } + else if (source.hasOwnProperty(key) && source[key] !== undefined) { - if (updateSize === undefined) { updateSize = true; } - if (updateOrigin === undefined) { updateOrigin = true; } + return source[key]; + } + else + { + return defaultValue; + } +}; - if (frame instanceof Frame) - { - this.texture = this.scene.sys.textures.get(frame.texture.key); +module.exports = GetFastValue; - this.frame = frame; - } - else - { - this.frame = this.texture.get(frame); - } - if (!this.frame.cutWidth || !this.frame.cutHeight) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } +/***/ }), - if (this._sizeComponent && updateSize) - { - this.setSizeToFrame(); - } +/***/ 5851: +/***/ ((module) => { - if (this._originComponent && updateOrigin) +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Retrieves a value from an object, or an alternative object, falling to a back-up default value if not found. + * + * The key is a string, which can be split based on the use of the period character. + * + * For example: + * + * ```javascript + * const source = { + * lives: 3, + * render: { + * screen: { + * width: 1024 + * } + * } + * } + * + * const lives = GetValue(source, 'lives', 1); + * const width = GetValue(source, 'render.screen.width', 800); + * const height = GetValue(source, 'render.screen.height', 600); + * ``` + * + * In the code above, `lives` will be 3 because it's defined at the top level of `source`. + * The `width` value will be 1024 because it can be found inside the `render.screen` object. + * The `height` value will be 600, the default value, because it is missing from the `render.screen` object. + * + * @function Phaser.Utils.Objects.GetValue + * @since 3.0.0 + * + * @param {object} source - The primary object to try to retrieve the value from. If not found in here, `altSource` is checked. + * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. + * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. + * @param {object} [altSource] - An alternative object to retrieve the value from. If the property exists in `source` then `altSource` will not be used. + * + * @return {*} The value of the requested key. + */ +var GetValue = function (source, key, defaultValue, altSource) +{ + if ((!source && !altSource) || typeof source === 'number') + { + return defaultValue; + } + else if (source && source.hasOwnProperty(key)) + { + return source[key]; + } + else if (altSource && altSource.hasOwnProperty(key)) + { + return altSource[key]; + } + else if (key.indexOf('.') !== -1) + { + var keys = key.split('.'); + var parentA = source; + var parentB = altSource; + var valueA = defaultValue; + var valueB = defaultValue; + var valueAFound = true; + var valueBFound = true; + + // Use for loop here so we can break early + for (var i = 0; i < keys.length; i++) { - if (this.frame.customPivot) + if (parentA && parentA.hasOwnProperty(keys[i])) { - this.setOrigin(this.frame.pivotX, this.frame.pivotY); + // Yes parentA has a key property, let's carry on down + valueA = parentA[keys[i]]; + parentA = parentA[keys[i]]; } else { - this.updateDisplayOrigin(); + valueAFound = false; } - } - return this; - } - -}; - -module.exports = Texture; - - -/***/ }), -/* 341 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Frame = __webpack_require__(68); - -// bitmask flag for GameObject.renderMask -var _FLAG = 8; // 1000 - -/** - * Provides methods used for getting and setting the texture of a Game Object. - * - * @namespace Phaser.GameObjects.Components.TextureCrop - * @since 3.0.0 - */ - -var TextureCrop = { - - /** - * The Texture this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.TextureCrop#texture - * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} - * @since 3.0.0 - */ - texture: null, - - /** - * The Texture Frame this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.TextureCrop#frame - * @type {Phaser.Textures.Frame} - * @since 3.0.0 - */ - frame: null, - - /** - * A boolean flag indicating if this Game Object is being cropped or not. - * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. - * Equally, calling `setCrop` with no arguments will reset the crop and disable it. - * - * @name Phaser.GameObjects.Components.TextureCrop#isCropped - * @type {boolean} - * @since 3.11.0 - */ - isCropped: false, - - /** - * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * - * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * - * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just - * changes what is shown when rendered. - * - * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * - * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left - * half of it, you could call `setCrop(0, 0, 400, 600)`. - * - * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop - * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * - * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * - * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * - * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow - * the renderer to skip several internal calculations. - * - * @method Phaser.GameObjects.Components.TextureCrop#setCrop - * @since 3.11.0 - * - * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. - * @param {number} [y] - The y coordinate to start the crop from. - * @param {number} [width] - The width of the crop rectangle in pixels. - * @param {number} [height] - The height of the crop rectangle in pixels. - * - * @return {this} This Game Object instance. - */ - setCrop: function (x, y, width, height) - { - if (x === undefined) - { - this.isCropped = false; - } - else if (this.frame) - { - if (typeof x === 'number') + if (parentB && parentB.hasOwnProperty(keys[i])) { - this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY); + // Yes parentB has a key property, let's carry on down + valueB = parentB[keys[i]]; + parentB = parentB[keys[i]]; } else { - var rect = x; - - this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY); + valueBFound = false; } - - this.isCropped = true; } - return this; - }, - - /** - * Sets the texture and frame this Game Object will use to render with. - * - * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * - * @method Phaser.GameObjects.Components.TextureCrop#setTexture - * @since 3.0.0 - * - * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|number)} [frame] - The name or index of the frame within the Texture. - * - * @return {this} This Game Object instance. - */ - setTexture: function (key, frame) - { - this.texture = this.scene.sys.textures.get(key); - - return this.setFrame(frame); - }, - - /** - * Sets the frame this Game Object will use to render with. - * - * If you pass a string or index then the Frame has to belong to the current Texture being used - * by this Game Object. - * - * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * - * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * - * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. - * - * @method Phaser.GameObjects.Components.TextureCrop#setFrame - * @since 3.0.0 - * - * @param {(string|number|Phaser.Textures.Frame)} frame - The name or index of the frame within the Texture, or a Frame instance. - * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? - * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? - * - * @return {this} This Game Object instance. - */ - setFrame: function (frame, updateSize, updateOrigin) - { - if (updateSize === undefined) { updateSize = true; } - if (updateOrigin === undefined) { updateOrigin = true; } - - if (frame instanceof Frame) + if (valueAFound) { - this.texture = this.scene.sys.textures.get(frame.texture.key); - - this.frame = frame; + return valueA; + } + else if (valueBFound) + { + return valueB; } else { - this.frame = this.texture.get(frame); + return defaultValue; } - - if (!this.frame.cutWidth || !this.frame.cutHeight) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - - if (this._sizeComponent && updateSize) - { - this.setSizeToFrame(); - } - - if (this._originComponent && updateOrigin) - { - if (this.frame.customPivot) - { - this.setOrigin(this.frame.pivotX, this.frame.pivotY); - } - else - { - this.updateDisplayOrigin(); - } - } - - if (this.isCropped) - { - this.frame.updateCropUVs(this._crop, this.flipX, this.flipY); - } - - return this; - }, - - /** - * Internal method that returns a blank, well-formed crop object for use by a Game Object. - * - * @method Phaser.GameObjects.Components.TextureCrop#resetCropObject - * @private - * @since 3.12.0 - * - * @return {object} The crop object. - */ - resetCropObject: function () - { - return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 }; - } - -}; - -module.exports = TextureCrop; - - -/***/ }), -/* 342 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for setting the tint of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Tint - * @webglOnly - * @since 3.0.0 - */ - -var Tint = { - - /** - * The tint value being applied to the top-left vertice of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. - * - * @name Phaser.GameObjects.Components.Tint#tintTopLeft - * @type {number} - * @default 0xffffff - * @since 3.0.0 - */ - tintTopLeft: 0xffffff, - - /** - * The tint value being applied to the top-right vertice of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. - * - * @name Phaser.GameObjects.Components.Tint#tintTopRight - * @type {number} - * @default 0xffffff - * @since 3.0.0 - */ - tintTopRight: 0xffffff, - - /** - * The tint value being applied to the bottom-left vertice of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomLeft - * @type {number} - * @default 0xffffff - * @since 3.0.0 - */ - tintBottomLeft: 0xffffff, - - /** - * The tint value being applied to the bottom-right vertice of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomRight - * @type {number} - * @default 0xffffff - * @since 3.0.0 - */ - tintBottomRight: 0xffffff, - - /** - * The tint fill mode. - * - * `false` = An additive tint (the default), where vertices colors are blended with the texture. - * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. - * - * @name Phaser.GameObjects.Components.Tint#tintFill - * @type {boolean} - * @default false - * @since 3.11.0 - */ - tintFill: false, - - /** - * Clears all tint values associated with this Game Object. - * - * Immediately sets the color values back to 0xffffff and the tint type to 'additive', - * which results in no visible change to the texture. - * - * @method Phaser.GameObjects.Components.Tint#clearTint - * @webglOnly - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - clearTint: function () - { - this.setTint(0xffffff); - - return this; - }, - - /** - * Sets an additive tint on this Game Object. - * - * The tint works by taking the pixel color values from the Game Objects texture, and then - * multiplying it by the color value of the tint. You can provide either one color value, - * in which case the whole Game Object will be tinted in that color. Or you can provide a color - * per corner. The colors are blended together across the extent of the Game Object. - * - * To modify the tint color once set, either call this method again with new values or use the - * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, - * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * - * To remove a tint call `clearTint`. - * - * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. - * - * @method Phaser.GameObjects.Components.Tint#setTint - * @webglOnly - * @since 3.0.0 - * - * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. - * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. - * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. - * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. - * - * @return {this} This Game Object instance. - */ - setTint: function (topLeft, topRight, bottomLeft, bottomRight) - { - if (topLeft === undefined) { topLeft = 0xffffff; } - - if (topRight === undefined) - { - topRight = topLeft; - bottomLeft = topLeft; - bottomRight = topLeft; - } - - this.tintTopLeft = topLeft; - this.tintTopRight = topRight; - this.tintBottomLeft = bottomLeft; - this.tintBottomRight = bottomRight; - - this.tintFill = false; - - return this; - }, - - /** - * Sets a fill-based tint on this Game Object. - * - * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture - * with those in the tint. You can use this for effects such as making a player flash 'white' - * if hit by something. You can provide either one color value, in which case the whole - * Game Object will be rendered in that color. Or you can provide a color per corner. The colors - * are blended together across the extent of the Game Object. - * - * To modify the tint color once set, either call this method again with new values or use the - * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, - * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * - * To remove a tint call `clearTint`. - * - * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. - * - * @method Phaser.GameObjects.Components.Tint#setTintFill - * @webglOnly - * @since 3.11.0 - * - * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. - * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. - * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. - * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. - * - * @return {this} This Game Object instance. - */ - setTintFill: function (topLeft, topRight, bottomLeft, bottomRight) - { - this.setTint(topLeft, topRight, bottomLeft, bottomRight); - - this.tintFill = true; - - return this; - }, - - /** - * The tint value being applied to the whole of the Game Object. - * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. - * - * @name Phaser.GameObjects.Components.Tint#tint - * @type {number} - * @webglOnly - * @since 3.0.0 - */ - tint: { - - set: function (value) - { - this.setTint(value, value, value, value); - } - }, - - /** - * Does this Game Object have a tint applied? - * - * It checks to see if the 4 tint properties are set to the value 0xffffff - * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. - * - * @name Phaser.GameObjects.Components.Tint#isTinted - * @type {boolean} - * @webglOnly - * @readonly - * @since 3.11.0 - */ - isTinted: { - - get: function () - { - var white = 0xffffff; - - return ( - this.tintFill || - this.tintTopLeft !== white || - this.tintTopRight !== white || - this.tintBottomLeft !== white || - this.tintBottomRight !== white - ); - } - - } - -}; - -module.exports = Tint; - - -/***/ }), -/* 343 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var NOOP = __webpack_require__(2); -var renderWebGL = NOOP; -var renderCanvas = NOOP; - -if (true) -{ - renderWebGL = __webpack_require__(344); -} - -if (true) -{ - renderCanvas = __webpack_require__(345); -} - -module.exports = { - - renderWebGL: renderWebGL, - renderCanvas: renderCanvas - -}; - - -/***/ }), -/* 344 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Renders this Game Object with the WebGL Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * @method Phaser.GameObjects.Container#renderWebGL - * @since 3.4.0 - * @private - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - */ -var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) -{ - camera.addToRenderList(container); - - var children = container.list; - var childCount = children.length; - - if (childCount === 0) - { - return; - } - - var transformMatrix = container.localTransform; - - if (parentMatrix) - { - transformMatrix.loadIdentity(); - transformMatrix.multiply(parentMatrix); - transformMatrix.translate(container.x, container.y); - transformMatrix.rotate(container.rotation); - transformMatrix.scale(container.scaleX, container.scaleY); } else { - transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); - } - - renderer.pipelines.preBatch(container); - - var containerHasBlendMode = (container.blendMode !== -1); - - if (!containerHasBlendMode) - { - // If Container is SKIP_TEST then set blend mode to be Normal - renderer.setBlendMode(0); - } - - var alpha = container.alpha; - - var scrollFactorX = container.scrollFactorX; - var scrollFactorY = container.scrollFactorY; - - for (var i = 0; i < childCount; i++) - { - var child = children[i]; - - if (!child.willRender(camera)) - { - continue; - } - - var childAlphaTopLeft; - var childAlphaTopRight; - var childAlphaBottomLeft; - var childAlphaBottomRight; - - if (child.alphaTopLeft !== undefined) - { - childAlphaTopLeft = child.alphaTopLeft; - childAlphaTopRight = child.alphaTopRight; - childAlphaBottomLeft = child.alphaBottomLeft; - childAlphaBottomRight = child.alphaBottomRight; - } - else - { - var childAlpha = child.alpha; - - childAlphaTopLeft = childAlpha; - childAlphaTopRight = childAlpha; - childAlphaBottomLeft = childAlpha; - childAlphaBottomRight = childAlpha; - } - - var childScrollFactorX = child.scrollFactorX; - var childScrollFactorY = child.scrollFactorY; - - if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode) - { - // If Container doesn't have its own blend mode, then a child can have one - renderer.setBlendMode(child.blendMode); - } - - var mask = child.mask; - - if (mask) - { - mask.preRenderWebGL(renderer, child, camera); - } - - var type = child.type; - - if (type !== renderer.currentType) - { - renderer.newType = true; - renderer.currentType = type; - } - - renderer.nextTypeMatch = (i < childCount - 1) ? (children[i + 1].type === renderer.currentType) : false; - - // Set parent values - child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); - - child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha); - - // Render - child.renderWebGL(renderer, child, camera, transformMatrix, container); - - // Restore original values - - child.setAlpha(childAlphaTopLeft, childAlphaTopRight, childAlphaBottomLeft, childAlphaBottomRight); - - child.setScrollFactor(childScrollFactorX, childScrollFactorY); - - if (mask) - { - mask.postRenderWebGL(renderer, camera); - } - - renderer.newType = false; - } - - renderer.pipelines.postBatch(container); -}; - -module.exports = ContainerWebGLRenderer; - - -/***/ }), -/* 345 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Renders this Game Object with the Canvas Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * @method Phaser.GameObjects.Container#renderCanvas - * @since 3.4.0 - * @private - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - */ -var ContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) -{ - camera.addToRenderList(container); - - var children = container.list; - - if (children.length === 0) - { - return; - } - - var transformMatrix = container.localTransform; - - if (parentMatrix) - { - transformMatrix.loadIdentity(); - transformMatrix.multiply(parentMatrix); - transformMatrix.translate(container.x, container.y); - transformMatrix.rotate(container.rotation); - transformMatrix.scale(container.scaleX, container.scaleY); - } - else - { - transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); - } - - var containerHasBlendMode = (container.blendMode !== -1); - - if (!containerHasBlendMode) - { - // If Container is SKIP_TEST then set blend mode to be Normal - renderer.setBlendMode(0); - } - - var alpha = container._alpha; - var scrollFactorX = container.scrollFactorX; - var scrollFactorY = container.scrollFactorY; - - if (container.mask) - { - container.mask.preRenderCanvas(renderer, null, camera); - } - - for (var i = 0; i < children.length; i++) - { - var child = children[i]; - - if (!child.willRender(camera)) - { - continue; - } - - var childAlpha = child.alpha; - var childScrollFactorX = child.scrollFactorX; - var childScrollFactorY = child.scrollFactorY; - - if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode) - { - // If Container doesn't have its own blend mode, then a child can have one - renderer.setBlendMode(child.blendMode); - } - - // Set parent values - child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); - child.setAlpha(childAlpha * alpha); - - // Render - child.renderCanvas(renderer, child, camera, transformMatrix); - - // Restore original values - child.setAlpha(childAlpha); - child.setScrollFactor(childScrollFactorX, childScrollFactorY); - } - - if (container.mask) - { - container.mask.postRenderCanvas(renderer); + return defaultValue; } }; -module.exports = ContainerCanvasRenderer; +module.exports = GetValue; /***/ }), -/* 346 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 2482: +/***/ ((module) => { /** * @author Richard Davey @@ -59914,301 +64201,164 @@ module.exports = ContainerCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(29); - /** - * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union. + * This is a slightly modified version of jQuery.isPlainObject. + * A plain object is an object whose internal class property is [object Object]. * - * @function Phaser.Geom.Rectangle.Union + * @function Phaser.Utils.Objects.IsPlainObject * @since 3.0.0 * - * @generic {Phaser.Geom.Rectangle} O - [out,$return] + * @param {object} obj - The object to inspect. * - * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to use. - * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to use. - * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the union in. - * - * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided. + * @return {boolean} `true` if the object is plain, otherwise `false`. */ -var Union = function (rectA, rectB, out) +var IsPlainObject = function (obj) { - if (out === undefined) { out = new Rectangle(); } + // Not plain objects: + // - Any object or value whose internal [[Class]] property is not "[object Object]" + // - DOM nodes + // - window + if (!obj || typeof(obj) !== 'object' || obj.nodeType || obj === obj.window) + { + return false; + } - // Cache vars so we can use one of the input rects as the output rect - var x = Math.min(rectA.x, rectB.x); - var y = Math.min(rectA.y, rectB.y); - var w = Math.max(rectA.right, rectB.right) - x; - var h = Math.max(rectA.bottom, rectB.bottom) - y; + // Support: Firefox <20 + // The try/catch suppresses exceptions thrown when attempting to access + // the "constructor" property of certain host objects, ie. |window.location| + // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 + try + { + if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf')) + { + return false; + } + } + catch (e) + { + return false; + } - return out.setTo(x, y, w, h); + // If the function hasn't returned already, we're confident that + // |obj| is a plain object, created by {} or constructed with new Object + return true; }; -module.exports = Union; +module.exports = IsPlainObject; /***/ }), -/* 347 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 7222: +/***/ ((module) => { /** * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var renderWebGL = __webpack_require__(2); -var renderCanvas = __webpack_require__(2); - -if (true) -{ - renderWebGL = __webpack_require__(348); -} - -if (true) -{ - renderCanvas = __webpack_require__(349); -} - -module.exports = { - - renderWebGL: renderWebGL, - renderCanvas: renderCanvas - -}; - - -/***/ }), -/* 348 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. + * @copyright 2013-2023 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * Renders this Game Object with the WebGL Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. + * Takes the given string and pads it out, to the length required, using the character + * specified. For example if you need a string to be 6 characters long, you can call: * - * @method SpineContainerWebGLRenderer#renderWebGL - * @since 3.50.0 - * @private + * `pad('bob', 6, '-', 2)` * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {SpineContainer} container - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right. + * + * You can also use it to pad numbers (they are always returned as strings): + * + * `pad(512, 6, '0', 1)` + * + * Would return: `000512` with the string padded to the left. + * + * If you don't specify a direction it'll pad to both sides: + * + * `pad('c64', 7, '*')` + * + * Would return: `**c64**` + * + * @function Phaser.Utils.String.Pad + * @since 3.0.0 + * + * @param {string|number|object} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. + * @param {number} [len=0] - The number of characters to be added. + * @param {string} [pad=" "] - The string to pad it out with (defaults to a space). + * @param {number} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). + * + * @return {string} The padded string. */ -var SpineContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) +var Pad = function (str, len, pad, dir) { - var plugin = container.plugin; - var sceneRenderer = plugin.sceneRenderer; - var children = container.list; + if (len === undefined) { len = 0; } + if (pad === undefined) { pad = ' '; } + if (dir === undefined) { dir = 3; } - if (children.length === 0) + str = str.toString(); + + var padlen = 0; + + if (len + 1 >= str.length) { - if (sceneRenderer.batcher.isDrawing && renderer.finalType) + switch (dir) { - sceneRenderer.end(); + case 1: + str = new Array(len + 1 - str.length).join(pad) + str; + break; - renderer.pipelines.rebind(); - } + case 3: + var right = Math.ceil((padlen = len - str.length) / 2); + var left = padlen - right; + str = new Array(left + 1).join(pad) + str + new Array(right + 1).join(pad); + break; - return; - } - - camera.addToRenderList(container); - - var transformMatrix = container.localTransform; - - if (parentMatrix) - { - transformMatrix.loadIdentity(); - transformMatrix.multiply(parentMatrix); - transformMatrix.translate(container.x, container.y); - transformMatrix.rotate(container.rotation); - transformMatrix.scale(container.scaleX, container.scaleY); - } - else - { - transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); - } - - if (renderer.newType) - { - // flush + clear if this is a new type - renderer.pipelines.clear(); - - sceneRenderer.begin(); - } - - var rendererNextType = renderer.nextTypeMatch; - - // Force these to avoid batch flushing during SpineGameObject.renderWebGL - renderer.nextTypeMatch = true; - renderer.newType = false; - - for (var i = 0; i < children.length; i++) - { - var child = children[i]; - - if (child.willRender(camera, container)) - { - var mask = child.mask; - - if (mask) - { - sceneRenderer.end(); - - renderer.pipelines.rebind(); - - mask.preRenderWebGL(renderer, child, camera); - - renderer.pipelines.clear(); - - sceneRenderer.begin(); - } - - child.renderWebGL(renderer, child, camera, transformMatrix, container); - - if (mask) - { - sceneRenderer.end(); - - renderer.pipelines.rebind(); - - mask.postRenderWebGL(renderer, camera); - - renderer.pipelines.clear(); - - sceneRenderer.begin(); - } + default: + str = str + new Array(len + 1 - str.length).join(pad); + break; } } - renderer.nextTypeMatch = rendererNextType; - - if (!rendererNextType) - { - // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch - sceneRenderer.end(); - - // And rebind the previous pipeline - renderer.pipelines.rebind(); - } + return str; }; -module.exports = SpineContainerWebGLRenderer; - - -/***/ }), -/* 349 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Renders this Game Object with the Canvas Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * @method Phaser.GameObjects.Container#renderCanvas - * @since 3.4.0 - * @private - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - */ -var SpineContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) -{ - var children = container.list; - - if (children.length === 0) - { - return; - } - - camera.addToRenderList(container); - - var transformMatrix = container.localTransform; - - if (parentMatrix) - { - transformMatrix.loadIdentity(); - transformMatrix.multiply(parentMatrix); - transformMatrix.translate(container.x, container.y); - transformMatrix.rotate(container.rotation); - transformMatrix.scale(container.scaleX, container.scaleY); - } - else - { - transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); - } - - var containerHasBlendMode = (container.blendMode !== -1); - - if (!containerHasBlendMode) - { - // If Container is SKIP_TEST then set blend mode to be Normal - renderer.setBlendMode(0); - } - - var alpha = container._alpha; - var scrollFactorX = container.scrollFactorX; - var scrollFactorY = container.scrollFactorY; - - if (container.mask) - { - container.mask.preRenderCanvas(renderer, null, camera); - } - - for (var i = 0; i < children.length; i++) - { - var child = children[i]; - - if (!child.willRender(camera)) - { - continue; - } - - var childAlpha = child.alpha; - var childScrollFactorX = child.scrollFactorX; - var childScrollFactorY = child.scrollFactorY; - - if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode) - { - // If Container doesn't have its own blend mode, then a child can have one - renderer.setBlendMode(child.blendMode); - } - - // Set parent values - child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); - child.setAlpha(childAlpha * alpha); - - // Render - child.renderCanvas(renderer, child, camera, transformMatrix); - - // Restore original values - child.setAlpha(childAlpha); - child.setScrollFactor(childScrollFactorX, childScrollFactorY); - } - - if (container.mask) - { - container.mask.postRenderCanvas(renderer); - } -}; - -module.exports = SpineContainerCanvasRenderer; +module.exports = Pad; /***/ }) -/******/ ]); \ No newline at end of file + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module is referenced by other modules so it can't be inlined +/******/ var __webpack_exports__ = __webpack_require__(4513); +/******/ window.SpinePlugin = __webpack_exports__; +/******/ +/******/ })() +; \ No newline at end of file diff --git a/plugins/spine4.1/dist/SpinePlugin.min.js b/plugins/spine4.1/dist/SpinePlugin.min.js index cb9b91cbc..2e95d6f03 100644 --- a/plugins/spine4.1/dist/SpinePlugin.min.js +++ b/plugins/spine4.1/dist/SpinePlugin.min.js @@ -1,1272 +1 @@ -window.SpinePlugin=function(t){var e={};function i(s){if(e[s])return e[s].exports;var n=e[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(s,n,function(e){return t[e]}.bind(null,n));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=69)}([function(t,e){function i(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||! -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function s(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function n(t,e,n,r){for(var o in e)if(e.hasOwnProperty(o)){var h=i(e,o,n);if(!1!==h){if(s((r||t).prototype,o)){if(a.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=e[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(35),r=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new r(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return n(this.x,t.x,e)&&n(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});r.ZERO=new r,r.RIGHT=new r(1,0),r.LEFT=new r(-1,0),r.UP=new r(0,-1),r.DOWN=new r(0,1),r.ONE=new r(1,1),t.exports=r},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=i},function(t,e){t.exports=function(t,e,i,s){var n=t.length;if(e<0||e>n||e>=i||i>n){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e){t.exports=function(t,e,i){var s=i-e;return e+((t-e)%s+s)%s}},function(t,e){t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(4);t.exports=function(t){return t>Math.PI&&(t-=s.PI2),Math.abs(((t+s.TAU)%s.PI2-s.PI2)%s.PI2)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(4);t.exports=function(t){return t*s.RAD_TO_DEG}},function(t,e){t.exports=function(t,e,i,s){if(!t&&!s||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(s&&s.hasOwnProperty(e))return s[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),r=t,a=s,o=i,h=i,l=!0,c=!0,u=0;u=t.length)){for(var i=t.length-1,s=t[e],n=e;n - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(30),r=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=n.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=r},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=new(i(0))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,n=t.z,r=e.x,a=e.y,o=e.z;return this.x=s*o-n*a,this.y=n*r-i*o,this.z=i*a-s*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z;return this.x=i*a-s*r,this.y=s*n-e*a,this.z=e*r-i*n,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[3]*i+n[6]*s,this.y=n[1]*e+n[4]*i+n[7]*s,this.z=n[2]*e+n[5]*i+n[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=1/(n[3]*e+n[7]*i+n[11]*s+n[15]);return this.x=(n[0]*e+n[4]*i+n[8]*s+n[12])*r,this.y=(n[1]*e+n[5]*i+n[9]*s+n[13])*r,this.z=(n[2]*e+n[6]*i+n[10]*s+n[14])*r,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=e*n[0]+i*n[3]+s*n[6],this.y=e*n[1]+i*n[4]+s*n[7],this.z=e*n[2]+i*n[5]+s*n[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12],this.y=n[1]*e+n[5]*i+n[9]*s+n[13],this.z=n[2]*e+n[6]*i+n[10]*s+n[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=e*n[0]+i*n[4]+s*n[8]+n[12],a=e*n[1]+i*n[5]+s*n[9]+n[13],o=e*n[2]+i*n[6]+s*n[10]+n[14],h=e*n[3]+i*n[7]+s*n[11]+n[15];return this.x=r/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z,o=t.w,h=o*e+r*s-a*i,l=o*i+a*e-n*s,c=o*s+n*i-r*e,u=-n*e-r*i-a*s;return this.x=h*o+u*-n+l*-a-c*-r,this.y=l*o+u*-r+c*-n-h*-a,this.z=c*o+u*-a+h*-r-l*-n,this},project:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=n[0],a=n[1],o=n[2],h=n[3],l=n[4],c=n[5],u=n[6],d=n[7],f=n[8],p=n[9],m=n[10],g=n[11],x=n[12],w=n[13],y=n[14],v=1/(e*h+i*d+s*g+n[15]);return this.x=(e*r+i*l+s*f+x)*v,this.y=(e*a+i*c+s*p+w)*v,this.z=(e*o+i*u+s*m+y)*v,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,n=t.z,r=t.w,a=this.x-i,o=r-this.y-1-s,h=this.z;return this.x=2*a/n-1,this.y=2*o/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(27),n=i(61);t.exports=function(t,e){if(void 0===e&&(e=90),!s(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=n(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=n(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s,n=i(28),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(s=navigator.userAgent,/Edg\/\d+/.test(s)?(r.edge=!0,r.es2019=!0):/OPR/.test(s)?(r.opera=!0,r.es2019=!0):/Chrome\/(\d+)/.test(s)&&!n.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10),r.es2019=r.chromeVersion>69):/Firefox\D+(\d+)/.test(s)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10),r.es2019=r.firefoxVersion>10):/AppleWebKit/.test(s)&&n.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(s)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+) Safari/.test(s)&&!n.windowsPhone?(r.safari=!0,r.safariVersion=parseInt(RegExp.$1,10),r.es2019=r.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(r.silk=!0),r)},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(7),n=function(){var t,e,i,r,a,o,h=arguments[0]||{},l=1,c=arguments.length,u=!1;for("boolean"==typeof h&&(u=h,h=arguments[1]||{},l=2),c===l&&(h=this,--l);l - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(4);t.exports=function(t){return t*s.DEG_TO_RAD}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(16),r=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new r(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,n,r,a,o,h,l,c,u,d,f,p,m){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=s,g[4]=n,g[5]=r,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=c,g[11]=u,g[12]=d,g[13]=f,g[14]=p,g[15]=m,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=a.fromQuat(i).val,n=e.x,r=e.y,o=e.z;return this.setValues(s[0]*n,s[1]*n,s[2]*n,0,s[4]*r,s[5]*r,s[6]*r,0,s[8]*o,s[9]*o,s[10]*o,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],n=t[6],r=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=n,t[11]=t[14],t[12]=s,t[13]=r,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15],x=e*a-i*r,w=e*o-s*r,y=e*h-n*r,v=i*o-s*a,b=i*h-n*a,A=s*h-n*o,M=l*p-c*f,S=l*m-u*f,I=l*g-d*f,k=c*m-u*p,T=c*g-d*p,E=u*g-d*m,C=x*E-w*T+y*k+v*I-b*S+A*M;return C?(C=1/C,this.setValues((a*E-o*T+h*k)*C,(s*T-i*E-n*k)*C,(p*A-m*b+g*v)*C,(u*b-c*A-d*v)*C,(o*I-r*E-h*S)*C,(e*E-s*I+n*S)*C,(m*y-f*A-g*w)*C,(l*A-u*y+d*w)*C,(r*T-a*I+h*M)*C,(i*I-e*T-n*M)*C,(f*b-p*y+g*x)*C,(c*y-l*b-d*x)*C,(a*S-r*k-o*M)*C,(e*k-i*S+s*M)*C,(p*w-f*v-m*x)*C,(l*v-c*w+u*x)*C)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return this.setValues(a*(u*g-d*m)-c*(o*g-h*m)+p*(o*d-h*u),-(i*(u*g-d*m)-c*(s*g-n*m)+p*(s*d-n*u)),i*(o*g-h*m)-a*(s*g-n*m)+p*(s*h-n*o),-(i*(o*d-h*u)-a*(s*d-n*u)+c*(s*h-n*o)),-(r*(u*g-d*m)-l*(o*g-h*m)+f*(o*d-h*u)),e*(u*g-d*m)-l*(s*g-n*m)+f*(s*d-n*u),-(e*(o*g-h*m)-r*(s*g-n*m)+f*(s*h-n*o)),e*(o*d-h*u)-r*(s*d-n*u)+l*(s*h-n*o),r*(c*g-d*p)-l*(a*g-h*p)+f*(a*d-h*c),-(e*(c*g-d*p)-l*(i*g-n*p)+f*(i*d-n*c)),e*(a*g-h*p)-r*(i*g-n*p)+f*(i*h-n*a),-(e*(a*d-h*c)-r*(i*d-n*c)+l*(i*h-n*a)),-(r*(c*m-u*p)-l*(a*m-o*p)+f*(a*u-o*c)),e*(c*m-u*p)-l*(i*m-s*p)+f*(i*u-s*c),-(e*(a*m-o*p)-r*(i*m-s*p)+f*(i*o-s*a)),e*(a*u-o*c)-r*(i*u-s*c)+l*(i*o-s*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return(e*a-i*r)*(u*g-d*m)-(e*o-s*r)*(c*g-d*p)+(e*h-n*r)*(c*m-u*p)+(i*o-s*a)*(l*g-d*f)-(i*h-n*a)*(l*m-u*f)+(s*h-n*o)*(l*p-c*f)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],g=e[14],x=e[15],w=t.val,y=w[0],v=w[1],b=w[2],A=w[3];return e[0]=y*i+v*a+b*c+A*p,e[1]=y*s+v*o+b*u+A*m,e[2]=y*n+v*h+b*d+A*g,e[3]=y*r+v*l+b*f+A*x,y=w[4],v=w[5],b=w[6],A=w[7],e[4]=y*i+v*a+b*c+A*p,e[5]=y*s+v*o+b*u+A*m,e[6]=y*n+v*h+b*d+A*g,e[7]=y*r+v*l+b*f+A*x,y=w[8],v=w[9],b=w[10],A=w[11],e[8]=y*i+v*a+b*c+A*p,e[9]=y*s+v*o+b*u+A*m,e[10]=y*n+v*h+b*d+A*g,e[11]=y*r+v*l+b*f+A*x,y=w[12],v=w[13],b=w[14],A=w[15],e[12]=y*i+v*a+b*c+A*p,e[13]=y*s+v*o+b*u+A*m,e[14]=y*n+v*h+b*d+A*g,e[15]=y*r+v*l+b*f+A*x,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,n=i[0],r=i[4],a=i[8],o=i[12],h=i[1],l=i[5],c=i[9],u=i[13],d=i[2],f=i[6],p=i[10],m=i[14],g=i[3],x=i[7],w=i[11],y=i[15],v=s[0],b=s[4],A=s[8],M=s[12],S=s[1],I=s[5],k=s[9],T=s[13],E=s[2],C=s[6],R=s[10],F=s[14],Y=s[3],X=s[7],P=s[11],L=s[15];return this.setValues(n*v+r*S+a*E+o*Y,h*v+l*S+c*E+u*Y,d*v+f*S+p*E+m*Y,g*v+x*S+w*E+y*Y,n*b+r*I+a*C+o*X,h*b+l*I+c*C+u*X,d*b+f*I+p*C+m*X,g*b+x*I+w*C+y*X,n*A+r*k+a*R+o*P,h*A+l*k+c*R+u*P,d*A+f*k+p*R+m*P,g*A+x*k+w*R+y*P,n*M+r*T+a*F+o*L,h*M+l*T+c*F+u*L,d*M+f*T+p*F+m*L,g*M+x*T+w*F+y*L)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),n=1-i,r=t.x,a=t.y,o=t.z,h=n*r,l=n*a;return this.setValues(h*r+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*r,0,h*o-s*a,l*o+s*r,n*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,n=e.y,r=e.z,a=Math.sqrt(s*s+n*n+r*r);if(Math.abs(a)<1e-6)return this;s*=a=1/a,n*=a,r*=a;var o=Math.sin(t),h=Math.cos(t),l=1-h,c=i[0],u=i[1],d=i[2],f=i[3],p=i[4],m=i[5],g=i[6],x=i[7],w=i[8],y=i[9],v=i[10],b=i[11],A=i[12],M=i[13],S=i[14],I=i[15],k=s*s*l+h,T=n*s*l+r*o,E=r*s*l-n*o,C=s*n*l-r*o,R=n*n*l+h,F=r*n*l+s*o,Y=s*r*l+n*o,X=n*r*l-s*o,P=r*r*l+h;return this.setValues(c*k+p*T+w*E,u*k+m*T+y*E,d*k+g*T+v*E,f*k+x*T+b*E,c*C+p*R+w*F,u*C+m*R+y*F,d*C+g*R+v*F,f*C+x*R+b*F,c*Y+p*X+w*P,u*Y+m*X+y*P,d*Y+g*X+v*P,f*Y+x*X+b*P,A,M,S,I)},rotateX:function(t){var e=this.val,i=Math.sin(t),s=Math.cos(t),n=e[4],r=e[5],a=e[6],o=e[7],h=e[8],l=e[9],c=e[10],u=e[11];return e[4]=n*s+h*i,e[5]=r*s+l*i,e[6]=a*s+c*i,e[7]=o*s+u*i,e[8]=h*s-n*i,e[9]=l*s-r*i,e[10]=c*s-a*i,e[11]=u*s-o*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),s=Math.cos(t),n=e[0],r=e[1],a=e[2],o=e[3],h=e[8],l=e[9],c=e[10],u=e[11];return e[0]=n*s-h*i,e[1]=r*s-l*i,e[2]=a*s-c*i,e[3]=o*s-u*i,e[8]=n*i+h*s,e[9]=r*i+l*s,e[10]=a*i+c*s,e[11]=o*i+u*s,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),s=Math.cos(t),n=e[0],r=e[1],a=e[2],o=e[3],h=e[4],l=e[5],c=e[6],u=e[7];return e[0]=n*s+h*i,e[1]=r*s+l*i,e[2]=a*s+c*i,e[3]=o*s+u*i,e[4]=h*s-n*i,e[5]=l*s-r*i,e[6]=c*s-a*i,e[7]=u*s-o*i,this},fromRotationTranslation:function(t,e){var i=t.x,s=t.y,n=t.z,r=t.w,a=i+i,o=s+s,h=n+n,l=i*a,c=i*o,u=i*h,d=s*o,f=s*h,p=n*h,m=r*a,g=r*o,x=r*h;return this.setValues(1-(d+p),c+x,u-g,0,c-x,1-(l+p),f+m,0,u+g,f-m,1-(l+d),0,e.x,e.y,e.z,1)},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,n=t.w,r=e+e,a=i+i,o=s+s,h=e*r,l=e*a,c=e*o,u=i*a,d=i*o,f=s*o,p=n*r,m=n*a,g=n*o;return this.setValues(1-(u+f),l+g,c-m,0,l-g,1-(h+f),d+p,0,c+m,d-p,1-(h+u),0,0,0,0,1)},frustum:function(t,e,i,s,n,r){var a=1/(e-t),o=1/(s-i),h=1/(n-r);return this.setValues(2*n*a,0,0,0,0,2*n*o,0,0,(e+t)*a,(s+i)*o,(r+n)*h,-1,0,0,r*n*2*h,0)},perspective:function(t,e,i,s){var n=1/Math.tan(t/2),r=1/(i-s);return this.setValues(n/e,0,0,0,0,n,0,0,0,0,(s+i)*r,-1,0,0,2*s*i*r,0)},perspectiveLH:function(t,e,i,s){return this.setValues(2*i/t,0,0,0,0,2*i/e,0,0,0,0,-s/(i-s),1,0,0,i*s/(i-s),0)},ortho:function(t,e,i,s,n,r){var a=t-e,o=i-s,h=n-r;return a=0===a?a:1/a,o=0===o?o:1/o,h=0===h?h:1/h,this.setValues(-2*a,0,0,0,0,-2*o,0,0,0,0,2*h,0,(t+e)*a,(s+i)*o,(r+n)*h,1)},lookAtRH:function(t,e,i){var s=this.val;return c.subVectors(t,e),0===c.getLengthSquared()&&(c.z=1),c.normalize(),h.crossVectors(i,c),0===h.getLengthSquared()&&(1===Math.abs(i.z)?c.x+=1e-4:c.z+=1e-4,c.normalize(),h.crossVectors(i,c)),h.normalize(),l.crossVectors(c,h),s[0]=h.x,s[1]=h.y,s[2]=h.z,s[4]=l.x,s[5]=l.y,s[6]=l.z,s[8]=c.x,s[9]=c.y,s[10]=c.z,this},lookAt:function(t,e,i){var s=t.x,n=t.y,r=t.z,a=i.x,o=i.y,h=i.z,l=e.x,c=e.y,u=e.z;if(Math.abs(s-l)<1e-6&&Math.abs(n-c)<1e-6&&Math.abs(r-u)<1e-6)return this.identity();var d=s-l,f=n-c,p=r-u,m=1/Math.sqrt(d*d+f*f+p*p),g=o*(p*=m)-h*(f*=m),x=h*(d*=m)-a*p,w=a*f-o*d;(m=Math.sqrt(g*g+x*x+w*w))?(g*=m=1/m,x*=m,w*=m):(g=0,x=0,w=0);var y=f*w-p*x,v=p*g-d*w,b=d*x-f*g;return(m=Math.sqrt(y*y+v*v+b*b))?(y*=m=1/m,v*=m,b*=m):(y=0,v=0,b=0),this.setValues(g,y,d,0,x,v,f,0,w,b,p,0,-(g*s+x*n+w*r),-(y*s+v*n+b*r),-(d*s+f*n+p*r),1)},yawPitchRoll:function(t,e,i){this.zero(),a.zero(),o.zero();var s=this.val,n=a.val,r=o.val,h=Math.sin(i),l=Math.cos(i);return s[10]=1,s[15]=1,s[0]=l,s[1]=h,s[4]=-h,s[5]=l,h=Math.sin(e),l=Math.cos(e),n[0]=1,n[15]=1,n[5]=l,n[10]=l,n[9]=-h,n[6]=h,h=Math.sin(t),l=Math.cos(t),r[5]=1,r[15]=1,r[0]=l,r[2]=-h,r[8]=h,r[10]=l,this.multiplyLocal(a),this.multiplyLocal(o),this},setWorldMatrix:function(t,e,i,s,n){return this.yawPitchRoll(t.y,t.x,t.z),a.scaling(i.x,i.y,i.z),o.xyz(e.x,e.y,e.z),this.multiplyLocal(a),this.multiplyLocal(o),s&&this.multiplyLocal(s),n&&this.multiplyLocal(n),this},multiplyToMat4:function(t,e){var i=this.val,s=t.val,n=i[0],r=i[1],a=i[2],o=i[3],h=i[4],l=i[5],c=i[6],u=i[7],d=i[8],f=i[9],p=i[10],m=i[11],g=i[12],x=i[13],w=i[14],y=i[15],v=s[0],b=s[1],A=s[2],M=s[3],S=s[4],I=s[5],k=s[6],T=s[7],E=s[8],C=s[9],R=s[10],F=s[11],Y=s[12],X=s[13],P=s[14],L=s[15];return e.setValues(v*n+b*h+A*d+M*g,b*r+b*l+A*f+M*x,A*a+b*c+A*p+M*w,M*o+b*u+A*m+M*y,S*n+I*h+k*d+T*g,S*r+I*l+k*f+T*x,S*a+I*c+k*p+T*w,S*o+I*u+k*m+T*y,E*n+C*h+R*d+F*g,E*r+C*l+R*f+F*x,E*a+C*c+R*p+F*w,E*o+C*u+R*m+F*y,Y*n+X*h+P*d+L*g,Y*r+X*l+P*f+L*x,Y*a+X*c+P*p+L*w,Y*o+X*u+P*m+L*y)},fromRotationXYTranslation:function(t,e,i){var s=e.x,n=e.y,r=e.z,a=Math.sin(t.x),o=Math.cos(t.x),h=Math.sin(t.y),l=Math.cos(t.y),c=s,u=n,d=r,f=-a,p=0-f*h,m=0-o*h,g=f*l,x=o*l;return i||(c=l*s+h*r,u=p*s+o*n+g*r,d=m*s+a*n+x*r),this.setValues(l,p,m,0,0,o,a,0,h,g,x,0,c,u,d,1)},getMaxScaleOnAxis:function(){var t=this.val,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,s))}}),a=new r,o=new r,h=new n,l=new n,c=new n;t.exports=r},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={ADDED_TO_SCENE:i(187),BOOT:i(188),CREATE:i(189),DESTROY:i(190),PAUSE:i(191),POST_UPDATE:i(192),PRE_RENDER:i(193),PRE_UPDATE:i(194),READY:i(195),REMOVED_FROM_SCENE:i(196),RENDER:i(197),RESUME:i(198),SHUTDOWN:i(199),SLEEP:i(200),START:i(201),TRANSITION_COMPLETE:i(202),TRANSITION_INIT:i(203),TRANSITION_OUT:i(204),TRANSITION_START:i(205),TRANSITION_WAKE:i(206),UPDATE:i(207),WAKE:i(208)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(12),r=i(47),a=i(11),o=i(48),h=i(49),l=i(223),c=i(50),u=new s({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var s=a(e,"url");void 0===s?s=t.path+i+"."+a(e,"extension",""):"string"!=typeof s||s.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(s=t.path+s),this.url=s,this.src="",this.xhrSettings=c(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?n.FILE_POPULATED:n.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===n.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=n.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,s=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(s=!1),this.state=n.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=n.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=n.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=n.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==n.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(r.FILE_COMPLETE,e,i,t),this.loader.emit(r.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=n.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={},s={install:function(t){for(var e in i)t[e]=i[e]},register:function(t,e){i[t]=e},destroy:function(){i={}}};t.exports=s},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(4),r=i(3),a=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,s,n,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||r?n.TAU-(r>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,n=s[0],r=s[1],a=s[2],o=s[3];return s[0]=n*i+a*e,s[1]=r*i+o*e,s[2]=n*-e+a*i,s[3]=r*-e+o*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,n=i[0],r=i[1],a=i[2],o=i[3],h=i[4],l=i[5],c=s[0],u=s[1],d=s[2],f=s[3],p=s[4],m=s[5],g=void 0===e?i:e.matrix;return g[0]=c*n+u*a,g[1]=c*r+u*o,g[2]=d*n+f*a,g[3]=d*r+f*o,g[4]=p*n+m*a+h,g[5]=p*r+m*o+l,g},multiplyWithOffset:function(t,e,i){var s=this.matrix,n=t.matrix,r=s[0],a=s[1],o=s[2],h=s[3],l=e*r+i*o+s[4],c=e*a+i*h+s[5],u=n[0],d=n[1],f=n[2],p=n[3],m=n[4],g=n[5];return s[0]=u*r+d*o,s[1]=u*a+d*h,s[2]=f*r+p*o,s[3]=f*a+p*h,s[4]=m*r+g*o+l,s[5]=m*a+g*h+c,this},transform:function(t,e,i,s,n,r){var a=this.matrix,o=a[0],h=a[1],l=a[2],c=a[3],u=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*c,a[2]=i*o+s*l,a[3]=i*h+s*c,a[4]=n*o+r*l+u,a[5]=n*h+r*c+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,n=s[0],r=s[1],a=s[2],o=s[3],h=s[4],l=s[5];return i.x=t*n+e*a+h,i.y=t*r+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=e*n-i*s;return t[0]=n/o,t[1]=-i/o,t[2]=-s/o,t[3]=e/o,t[4]=(s*a-n*r)/o,t[5]=-(e*a-i*r)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,n,r){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=s,a[4]=n,a[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],n=e[2],r=e[3],a=i*r-s*n;if(t.translateX=e[4],t.translateY=e[5],i||s){var o=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(n||r){var h=Math.sqrt(n*n+r*r);t.rotation=.5*Math.PI-(r>0?Math.acos(-n/h):-Math.acos(n/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,n){var r=this.matrix,a=Math.sin(i),o=Math.cos(i);return r[4]=t,r[5]=e,r[0]=o*s,r[1]=a*s,r[2]=-a*n,r[3]=o*n,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var s=this.matrix,n=s[0],a=s[1],o=s[2],h=s[3],l=s[4],c=s[5],u=1/(n*h+o*-a);return i.x=h*u*t+-o*u*e+(c*o-l*h)*u,i.y=n*u*e+-a*u*t+(-c*n+l*a)*u,i},setQuad:function(t,e,i,s,n,r){void 0===r&&(r=this.quad);var a=this.matrix,o=a[0],h=a[1],l=a[2],c=a[3],u=a[4],d=a[5];return r[0]=t*o+e*l+u,r[1]=t*h+e*c+d,r[2]=t*o+s*l+u,r[3]=t*h+s*c+d,r[4]=i*o+s*l+u,r[5]=i*h+s*c+d,r[6]=i*o+e*l+u,r[7]=i*h+e*c+d,n&&r.forEach((function(t,e){r[e]=Math.round(t)})),r},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.round(s)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.round(s)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},function(t,e){t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return i;var t=navigator.userAgent;/Windows/.test(t)?i.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(i.iOS=!0,i.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),i.iOSVersion=parseInt(RegExp.$1,10)):i.macOS=!0:/Android/.test(t)?i.android=!0:/Linux/.test(t)?i.linux=!0:/iP[ao]d|iPhone/i.test(t)?(i.iOS=!0,navigator.appVersion.match(/OS (\d+)/),i.iOSVersion=parseInt(RegExp.$1,10),i.iPhone=-1!==t.toLowerCase().indexOf("iphone"),i.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?i.kindle=!0:/CrOS/.test(t)&&(i.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(i.android=!1,i.iOS=!1,i.macOS=!1,i.windows=!0,i.windowsPhone=!0);var s=/Silk/.test(t);return(i.windows||i.macOS||i.linux&&!s||i.chromeOS)&&(i.desktop=!0),(i.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(i.desktop=!1),navigator.standalone&&(i.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(i.cordova=!0),void 0!==window.ejecta&&(i.ejecta=!0)),void 0!==e&&e.versions&&e.versions.node&&(i.node=!0),i.node&&"object"==typeof e.versions&&(i.nodeWebkit=!!e.versions["node-webkit"],i.electron=!!e.versions.electron),/Crosswalk/.test(t)&&(i.crosswalk=!0),i.pixelRatio=window.devicePixelRatio||1,i}()}).call(this,i(302))},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(320),r=i(66),a=i(321),o=i(30),h=i(322),l=i(327),c=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=c},function(t,e){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},function(t,e){t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},function(t,e){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(6);t.exports=function(t){return s(t,-Math.PI,Math.PI)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(6);t.exports=function(t){return s(t,-180,180)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e) - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(37);t.exports=function(t,e){return s(t)/s(e)/s(t-e)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e){t.exports=function(t,e,i,s,n){var r=.5*(s-e),a=.5*(n-i),o=t*t;return(2*i-2*s+r+a)*(t*o)+(-3*i+3*s-2*r-a)*o+r*t+i}},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),a=t.x-e,o=t.y-i;return t.x=a*n-o*r+e,t.y=a*r+o*n+i,t}},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(3);t.exports=function(t,e,i,n,r,a,o,h){void 0===h&&(h=new s);var l=Math.sin(r),c=Math.cos(r),u=c*a,d=l*a,f=-l*o,p=c*o,m=1/(u*p+f*-d);return h.x=p*m*t+-f*m*e+(n*f-i*p)*m,h.y=u*m*e+-d*m*t+(-n*u+i*d)*m,h}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=l*r-a*h,u=-l*n+a*o,d=h*n-r*o,f=e*c+i*u+s*d;return f?(f=1/f,t[0]=c*f,t[1]=(-l*i+s*h)*f,t[2]=(a*i-s*r)*f,t[3]=u*f,t[4]=(l*e-s*o)*f,t[5]=(-a*e+s*n)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(r*e-i*n)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=r*l-a*h,t[1]=s*h-i*l,t[2]=i*a-s*r,t[3]=a*o-n*l,t[4]=e*l-s*o,t[5]=s*n-e*a,t[6]=n*h-r*o,t[7]=i*o-e*h,t[8]=e*r-i*n,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*r-a*h)+i*(-l*n+a*o)+s*(h*n-r*o)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=t.val,d=u[0],f=u[1],p=u[2],m=u[3],g=u[4],x=u[5],w=u[6],y=u[7],v=u[8];return e[0]=d*i+f*r+p*h,e[1]=d*s+f*a+p*l,e[2]=d*n+f*o+p*c,e[3]=m*i+g*r+x*h,e[4]=m*s+g*a+x*l,e[5]=m*n+g*o+x*c,e[6]=w*i+y*r+v*h,e[7]=w*s+y*a+v*l,e[8]=w*n+y*o+v*c,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*s+h*a,e[2]=l*n+h*o,e[3]=l*r-h*i,e[4]=l*a-h*s,e[5]=l*o-h*n,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,n=t.w,r=e+e,a=i+i,o=s+s,h=e*r,l=e*a,c=e*o,u=i*a,d=i*o,f=s*o,p=n*r,m=n*a,g=n*o,x=this.val;return x[0]=1-(u+f),x[3]=l+g,x[6]=c-m,x[1]=l-g,x[4]=1-(h+f),x[7]=d+p,x[2]=c+m,x[5]=d-p,x[8]=1-(h+u),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],m=e[12],g=e[13],x=e[14],w=e[15],y=s*h-n*o,v=s*l-r*o,b=s*c-a*o,A=n*l-r*h,M=n*c-a*h,S=r*c-a*l,I=u*g-d*m,k=u*x-f*m,T=u*w-p*m,E=d*x-f*g,C=d*w-p*g,R=f*w-p*x,F=y*R-v*C+b*E+A*T-M*k+S*I;return F?(F=1/F,i[0]=(h*R-l*C+c*E)*F,i[1]=(l*T-o*R-c*k)*F,i[2]=(o*C-h*T+c*I)*F,i[3]=(r*C-n*R-a*E)*F,i[4]=(s*R-r*T+a*k)*F,i[5]=(n*T-s*C-a*I)*F,i[6]=(g*S-x*M+w*A)*F,i[7]=(x*b-m*S-w*v)*F,i[8]=(m*M-g*b+w*y)*F,this):null}});t.exports=s},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(45),r=i(2),a=i(16),o=new Int8Array([1,2,0]),h=new Float32Array([0,0,0]),l=new a(1,0,0),c=new a(0,1,0),u=new a,d=new n,f=new s({initialize:function(t,e,i,s){this.onChangeCallback=r,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,n){return void 0===n&&(n=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),n&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this._x=t*n,this._y=e*n,this._z=i*n,this._w=s*n),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),n+e*(t.z-n),r+e*(t.w-r))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(l).cross(t).length()<1e-6&&u.copy(c).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?this.set(0,0,0,1):(u.copy(t).cross(e),this._x=u.x,this._y=u.y,this._z=u.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=d.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(d).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+n*r+i*o-s*a,i*h+n*a+s*r-e*o,s*h+n*o+e*a-i*r,n*h-e*r-i*a-s*o)},slerp:function(t,e){var i=this.x,s=this.y,n=this.z,r=this.w,a=t.x,o=t.y,h=t.z,l=t.w,c=i*a+s*o+n*h+r*l;c<0&&(c=-c,a=-a,o=-o,h=-h,l=-l);var u=1-e,d=e;if(1-c>1e-6){var f=Math.acos(c),p=Math.sin(f);u=Math.sin((1-e)*f)/p,d=Math.sin(e*f)/p}return this.set(u*i+d*a,u*s+d*o,u*n+d*h,u*r+d*l)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s,r=n?1/n:0;return this.set(-t*r,-e*r,-i*r,s*r)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a+n*r,i*a+s*r,s*a-i*r,n*a-e*r)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a-s*r,i*a+n*r,s*a+e*r,n*a-i*r)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*r,i*a-e*r,s*a+n*r,n*a-s*r)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,n=t.z/2,r=Math.cos(i),a=Math.cos(s),o=Math.cos(n),h=Math.sin(i),l=Math.sin(s),c=Math.sin(n);switch(t.order){case"XYZ":this.set(h*a*o+r*l*c,r*l*o-h*a*c,r*a*c+h*l*o,r*a*o-h*l*c,e);break;case"YXZ":this.set(h*a*o+r*l*c,r*l*o-h*a*c,r*a*c-h*l*o,r*a*o+h*l*c,e);break;case"ZXY":this.set(h*a*o-r*l*c,r*l*o+h*a*c,r*a*c+h*l*o,r*a*o-h*l*c,e);break;case"ZYX":this.set(h*a*o-r*l*c,r*l*o+h*a*c,r*a*c-h*l*o,r*a*o+h*l*c,e);break;case"YZX":this.set(h*a*o+r*l*c,r*l*o+h*a*c,r*a*c-h*l*o,r*a*o-h*l*c,e);break;case"XZY":this.set(h*a*o-r*l*c,r*l*o-h*a*c,r*a*c+h*l*o,r*a*o+h*l*c,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],n=i[4],r=i[8],a=i[1],o=i[5],h=i[9],l=i[2],c=i[6],u=i[10],d=s+o+u;return d>0?(e=.5/Math.sqrt(d+1),this.set((c-h)*e,(r-l)*e,(a-n)*e,.25/e)):s>o&&s>u?(e=2*Math.sqrt(1+s-o-u),this.set(.25*e,(n+a)/e,(r+l)/e,(c-h)/e)):o>u?(e=2*Math.sqrt(1+o-s-u),this.set((n+a)/e,.25*e,(h+c)/e,(r-l)/e)):(e=2*Math.sqrt(1+u-s-o),this.set((r+l)/e,(h+c)/e,.25*e,(a-n)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var n=0;i[4]>i[0]&&(n=1),i[8]>i[3*n+n]&&(n=2);var r=o[n],a=o[r];e=Math.sqrt(i[3*n+n]-i[3*r+r]-i[3*a+a]+1),h[n]=.5*e,e=.5/e,h[r]=(i[3*r+n]+i[3*n+r])*e,h[a]=(i[3*a+n]+i[3*n+a])*e,this._x=h[0],this._y=h[1],this._z=h[2],this._w=(i[3*a+r]-i[3*r+a])*e}return this.onChangeCallback(this),this}});t.exports=f},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={ADD:i(213),COMPLETE:i(214),FILE_COMPLETE:i(215),FILE_KEY_COMPLETE:i(216),FILE_LOAD_ERROR:i(217),FILE_LOAD:i(218),FILE_PROGRESS:i(219),POST_PROCESS:i(220),PROGRESS:i(221),START:i(222)}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(19),n=i(50);t.exports=function(t,e){var i=void 0===t?n():s({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},function(t,e){t.exports=function(t,e,i,s,n,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===s&&(s=""),void 0===n&&(n=0),void 0===r&&(r=!1),{responseType:t,async:e,user:i,password:s,timeout:n,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:r}}},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(4),n=i(26),r=i(44),a=i(33),o=i(34),h=i(3),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*s.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.z=i,this.w=s,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*s,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new n),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new n),void 0===e&&(e=new n);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,s){i||(i=new h),s||(s=this.scene.sys.cameras.main);var n=s.scrollX,a=s.scrollY,o=t+n*this.scrollFactorX-n,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):r(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(58),r=i(228),a=i(235),o=i(59),h=i(23),l=new s({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new r(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new r(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={ADDED_TO_SCENE:i(236),DESTROY:i(237),REMOVED_FROM_SCENE:i(238),VIDEO_COMPLETE:i(239),VIDEO_CREATED:i(240),VIDEO_ERROR:i(241),VIDEO_LOOP:i(242),VIDEO_PLAY:i(243),VIDEO_SEEKED:i(244),VIDEO_SEEKING:i(245),VIDEO_STOP:i(246),VIDEO_TIMEOUT:i(247),VIDEO_UNLOCKED:i(248)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(26),n=new s,r=new s,a=new s,o={camera:n,sprite:r,calc:a};t.exports=function(t,e,i){var s=n,h=r,l=a;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),s.multiply(h,l),o}},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),n=0;n-1;r--)s[n][r]=t[r][n]}return s}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s,n,r,a=i(304),o=i(306),h=[],l=!1;t.exports=(r=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return s(t,e,i,a.CANVAS)},create:s=function(t,e,i,s,r){var c;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=a.CANVAS),void 0===r&&(r=!1);var u=n(s);return null===u?(u={parent:t,canvas:document.createElement("canvas"),type:s},s===a.CANVAS&&h.push(u),c=u.canvas):(u.parent=t,c=u.canvas),r&&(u.parent=c),c.width=e,c.height=i,l&&s===a.CANVAS&&o.disable(c.getContext("2d")),c},createWebGL:function(t,e,i){return s(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:n=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(67),n=i(14);t.exports=function(t,e,i){if(void 0===i&&(i=new n),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var r=s(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},function(t,e){t.exports=function(t){return 2*(t.width+t.height)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(1),r=i(19),a=new s({initialize:function(t,e,i,s,n,r,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,a,s,n)},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.cutX=i,this.cutY=s,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var n=this.data,r=n.cut;r.x=i,r.y=s,r.w=t,r.h=e,r.r=i+t,r.b=s+e,n.sourceSize.w=t,n.sourceSize.h=e,n.spriteSourceSize.w=t,n.spriteSourceSize.h=e,n.radius=.5*Math.sqrt(t*t+e*e);var a=n.drawImage;return a.x=i,a.y=s,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,s,n,r){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=s,o.w=n,o.h=r,o.r=i+n,o.b=s+r,this.x=i,this.y=s,this.width=n,this.height=r,this.halfWidth=.5*n,this.halfHeight=.5*r,this.centerX=Math.floor(n/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,s,r,a,o){var h=this.cutX,l=this.cutY,c=this.cutWidth,u=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=n(e,0,d)),m=l+(i=n(i,0,f)),g=s=n(s,0,d-e),x=r=n(r,0,f-i),w=this.data;if(w.trim){var y=w.spriteSourceSize,v=e+(s=n(s,0,c-e)),b=i+(r=n(r,0,u-i));if(!(y.rv||y.y>b)){var A=Math.max(y.x,e),M=Math.max(y.y,i),S=Math.min(y.r,v)-A,I=Math.min(y.b,b)-M;g=S,x=I,p=a?h+(c-(A-y.x)-S):h+(A-y.x),m=o?l+(u-(M-y.y)-I):l+(M-y.y),e=A,i=M,s=S,r=I}else p=0,m=0,g=0,x=0}else a&&(p=h+(c-e-s)),o&&(m=l+(u-i-r));var k=this.source.width,T=this.source.height;return t.u0=Math.max(0,p/k),t.v0=Math.max(0,m/T),t.u1=Math.min(1,(p+g)/k),t.v1=Math.min(1,(m+x)/T),t.x=e,t.y=i,t.cx=p,t.cy=m,t.cw=g,t.ch=x,t.width=s,t.height=r,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,n,r){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=s,this.u1=n,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,n=this.data.drawImage;n.width=i,n.height=s;var r=this.source.width,a=this.source.height;return this.u0=t/r,this.v0=e/a,this.u1=(t+i)/r,this.v1=(e+s)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var s=i(70),n=i(0),r=i(10),a=i(184),o=i(185),h={canvas:i(209),webgl:i(210)},l=i(211),c=i(227),u=i(260),d=i(2),f=new n({Extends:o,initialize:function(t,e,i){o.call(this,t,e,i);var n=e.game;this.isWebGL=2===n.config.renderType,this.cache=n.cache.addCustom("spine"),this.spineTextures=n.cache.addCustom("spineTextures"),this.json=n.cache.json,this.textures=n.textures,this.drawDebug=!1,this.gl,this.renderer,this.sceneRenderer,this.skeletonRenderer,this.skeletonDebugRenderer,this.plugin=h,this.temp1,this.temp2,this.isWebGL?(this.runtime=h.webgl,this.renderer=n.renderer,this.gl=n.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=n.renderer,this.getAtlas=this.getAtlasCanvas),this.renderer||(this.renderer={width:n.scale.width,height:n.scale.height,preRender:d,postRender:d,render:d,destroy:d});e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",(function(t,e,s,n,r){var a=this.scene.sys[i],o=new c(this.scene,a,t,e,s,n,r);return this.displayList.add(o),this.updateList.add(o),o}),(function(t,e){void 0===t&&(t={});var n=r(t,"key",null),a=r(t,"animationName",null),o=r(t,"loop",!1),h=this.scene.sys[i],l=new c(this.scene,h,0,0,n,a,o);void 0!==e&&(t.add=e),s(this.scene,l,t);var u=r(t,"skinName",!1);u&&l.setSkinByName(u);var d=r(t,"slotName",!1),f=r(t,"attachmentName",null);return d&&l.setAttachment(d,f),l.refresh()})),e.registerGameObject("spineContainer",(function(t,e,s){var n=this.scene.sys[i],r=new u(this.scene,n,t,e,s);return this.displayList.add(r),r}),(function(t,e){void 0===t&&(t={});var n=r(t,"x",0),a=r(t,"y",0),o=r(t,"children",null),h=this.scene.sys[i],l=new u(this.scene,h,n,a,o);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(a,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this),this.game.events.once("destroy",this.gameDestroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){var t=this.renderer.spineSceneRenderer;t||(t=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0),this.renderer.spineSceneRenderer=t),this.sceneRenderer=t,this.skeletonRenderer=t.skeletonRenderer,this.skeletonDebugRenderer=t.skeletonDebugRenderer,this.temp1=new h.webgl.Vector3(0,0,0),this.temp2=new h.webgl.Vector3(0,0,0)},getAtlasCanvas:function(t){var e=this.cache.get(t);if(e){var i,s=this.spineTextures;if(s.has(t))i=s.get(t);else{var n=this.textures;i=new this.runtime.TextureAtlas(e.data,(function(t){return new h.canvas.CanvasTexture(n.get(e.prefix+t).getSourceImage())}))}return i}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var i,s=this.spineTextures;if(s.has(t))i=s.get(t);else{var n=this.textures,r=this.sceneRenderer.context.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i=new this.runtime.TextureAtlas(e.data,(function(t){return new h.webgl.GLTexture(r,n.get(e.prefix+t).getSourceImage(),!1)}))}return i}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,i,s,n,r,a){var o;if(a=a||{},Array.isArray(t))for(var h=0;h - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(15),n=i(71);t.exports=function(t,e,i){e.x=n(i,"x",0),e.y=n(i,"y",0),e.depth=n(i,"depth",0),e.flipX=n(i,"flipX",!1),e.flipY=n(i,"flipY",!1);var r=n(i,"scale",null);"number"==typeof r?e.setScale(r):null!==r&&(e.scaleX=n(r,"x",1),e.scaleY=n(r,"y",1));var a=n(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=n(a,"x",1),e.scrollFactorY=n(a,"y",1)),e.rotation=n(i,"rotation",0);var o=n(i,"angle",null);null!==o&&(e.angle=o),e.alpha=n(i,"alpha",1);var h=n(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=n(h,"x",.5),c=n(h,"y",.5);e.setOrigin(l,c)}return e.blendMode=n(i,"blendMode",s.NORMAL),e.visible=n(i,"visible",!0),n(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(72),n=i(10);t.exports=function(t,e,i){var r=n(t,e,null);if(null===r)return i;if(Array.isArray(r))return s.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return s.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return s.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(4),n=i(19),r={Angle:i(73),Distance:i(82),Easing:i(90),Fuzzy:i(135),Interpolation:i(140),Pow2:i(148),Snap:i(152),RandomDataGenerator:i(156),Average:i(157),Bernstein:i(36),Between:i(158),CatmullRom:i(38),CeilTo:i(159),Clamp:i(1),DegToRad:i(21),Difference:i(160),Euler:i(161),Factorial:i(37),FloatBetween:i(20),FloorTo:i(162),FromPercent:i(163),GetSpeed:i(164),IsEven:i(165),IsEvenStrict:i(166),Linear:i(39),LinearXY:i(167),MaxAdd:i(168),Median:i(169),MinSub:i(170),Percent:i(171),RadToDeg:i(9),RandomXY:i(172),RandomXYZ:i(173),RandomXYZW:i(174),Rotate:i(175),RotateAround:i(42),RotateAroundDistance:i(176),RotateTo:i(177),RoundAwayFromZero:i(43),RoundTo:i(178),SinCosTableGenerator:i(179),SmootherStep:i(41),SmoothStep:i(40),ToXY:i(180),TransformXY:i(44),Within:i(181),Wrap:i(6),Vector2:i(3),Vector3:i(16),Vector4:i(182),Matrix3:i(45),Matrix4:i(22),Quaternion:i(46),RotateVec3:i(183)};r=n(!1,r,s),t.exports=r},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Between:i(31),BetweenPoints:i(74),BetweenPointsY:i(75),BetweenY:i(76),CounterClockwise:i(8),Normalize:i(32),Random:i(77),RandomDegrees:i(78),Reverse:i(79),RotateTo:i(80),ShortestBetween:i(81),Wrap:i(33),WrapDegrees:i(34)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},function(t,e){t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},function(t,e,i){ -/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(20);t.exports=function(){return s(-Math.PI,Math.PI)}},function(t,e,i){ -/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(20);t.exports=function(){return s(-180,180)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(32);t.exports=function(t){return s(t+Math.PI)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(4);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Between:i(83),BetweenPoints:i(84),BetweenPointsSquared:i(85),Chebyshev:i(86),Power:i(87),Snake:i(88),Squared:i(89)}},function(t,e){t.exports=function(t,e,i,s){var n=t-i,r=e-s;return Math.sqrt(n*n+r*r)}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}},function(t,e){t.exports=function(t,e,i,s){return Math.max(Math.abs(t-i),Math.abs(e-s))}},function(t,e){t.exports=function(t,e,i,s,n){return void 0===n&&(n=2),Math.sqrt(Math.pow(i-t,n)+Math.pow(s-e,n))}},function(t,e){t.exports=function(t,e,i,s){return Math.abs(t-i)+Math.abs(e-s)}},function(t,e){t.exports=function(t,e,i,s){var n=t-i,r=e-s;return n*n+r*r}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Back:i(91),Bounce:i(95),Circular:i(99),Cubic:i(103),Elastic:i(107),Expo:i(111),Linear:i(115),Quadratic:i(117),Quartic:i(121),Quintic:i(125),Sine:i(129),Stepped:i(133)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(92),Out:i(93),InOut:i(94)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(96),Out:i(97),InOut:i(98)}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(100),Out:i(101),InOut:i(102)}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(104),Out:i(105),InOut:i(106)}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(108),Out:i(109),InOut:i(110)}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+1}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(112),Out:i(113),InOut:i(114)}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports=i(116)},function(t,e){t.exports=function(t){return t}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(118),Out:i(119),InOut:i(120)}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(122),Out:i(123),InOut:i(124)}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(126),Out:i(127),InOut:i(128)}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(130),Out:i(131),InOut:i(132)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports=i(134)},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Ceil:i(136),Equal:i(35),Floor:i(137),GreaterThan:i(138),LessThan:i(139)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Bezier:i(141),CatmullRom:i(142),CubicBezier:i(143),Linear:i(144),QuadraticBezier:i(145),SmoothStep:i(146),SmootherStep:i(147)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(36);t.exports=function(t,e){for(var i=0,n=t.length-1,r=0;r<=n;r++)i+=Math.pow(1-e,n-r)*Math.pow(e,r)*t[r]*s(n,r);return i}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(38);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),s(n-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(s(-n,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(s(n-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(n-r,t[r?r-1:0],t[r],t[i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,n)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(39);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return e<0?s(t[0],t[1],n):e>1?s(t[i],t[i-1],i-n):s(t[r],t[r+1>i?i:r+1],n-r)}},function(t,e){t.exports=function(t,e,i,s){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(40);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(41);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={GetNext:i(149),IsSize:i(150),IsValue:i(151)}},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Ceil:i(153),Floor:i(154),To:i(155)}},function(t,e){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},function(t,e){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},function(t,e){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=new(i(0))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},function(t,e){t.exports=function(t){for(var e=0,i=0;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(1),n=i(0),r=i(22),a=i(2),o=new r,h=new n({initialize:function t(e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=t.DefaultOrder),this._x=e,this._y=i,this._z=s,this._order=n,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,s){return void 0===s&&(s=this._order),this._x=t,this._y=e,this._z=i,this._order=s,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var n=t.val,r=n[0],a=n[4],o=n[8],h=n[1],l=n[5],c=n[9],u=n[2],d=n[6],f=n[10],p=0,m=0,g=0;switch(e){case"XYZ":m=Math.asin(s(o,-1,1)),Math.abs(o)<.99999?(p=Math.atan2(-c,f),g=Math.atan2(-a,r)):p=Math.atan2(d,l);break;case"YXZ":p=Math.asin(-s(c,-1,1)),Math.abs(c)<.99999?(m=Math.atan2(o,f),g=Math.atan2(h,l)):m=Math.atan2(-u,r);break;case"ZXY":p=Math.asin(s(d,-1,1)),Math.abs(d)<.99999?(m=Math.atan2(-u,f),g=Math.atan2(-a,l)):g=Math.atan2(h,r);break;case"ZYX":m=Math.asin(-s(u,-1,1)),Math.abs(u)<.99999?(p=Math.atan2(d,f),g=Math.atan2(h,r)):g=Math.atan2(-a,l);break;case"YZX":g=Math.asin(s(h,-1,1)),Math.abs(h)<.99999?(p=Math.atan2(-c,l),m=Math.atan2(-u,r)):m=Math.atan2(o,f);break;case"XZY":g=Math.asin(-s(a,-1,1)),Math.abs(a)<.99999?(p=Math.atan2(d,l),m=Math.atan2(o,r)):p=Math.atan2(-c,f)}return this._x=p,this._y=m,this._z=g,this._order=e,i&&this.onChangeCallback(this),this}});h.RotationOrders=["XYZ","YXZ","ZXY","ZYX","YZX","XZY"],h.DefaultOrder="XYZ",t.exports=h},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(1);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))+e}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i,s){void 0===i&&(i=e+1);var n=(t-e)/(i-e);return n>1?void 0!==s?(n=(s-t)/(s-i))<0&&(n=0):n=1:n<0&&(n=0),n}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,n=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*n,t.y=Math.sin(i)*n,t.z=s*e,t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},function(t,e){t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},function(t,e){t.exports=function(t,e,i,s,n){var r=s+Math.atan2(t.y-i,t.x-e);return t.x=e+n*Math.cos(r),t.y=i+n*Math.sin(r),t}},function(t,e){t.exports=function(t,e,i,s,n){return t.x=e+n*Math.cos(s),t.y=i+n*Math.sin(s),t}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},function(t,e){t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1),s*=Math.PI/t;for(var n=[],r=[],a=0;a - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(3);t.exports=function(t,e,i,n){void 0===n&&(n=new s);var r=0,a=0;return t>0&&t<=e*i&&(r=t>e-1?t-(a=Math.floor(t/e))*e:t),n.set(r,a)}},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=new(i(0))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n,this.w=s*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return e*e+i*i+s*s+n*n},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12]*n,this.y=r[1]*e+r[5]*i+r[9]*s+r[13]*n,this.z=r[2]*e+r[6]*i+r[10]*s+r[14]*n,this.w=r[3]*e+r[7]*i+r[11]*s+r[15]*n,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z,o=t.w,h=o*e+r*s-a*i,l=o*i+a*e-n*s,c=o*s+n*i-r*e,u=-n*e-r*i-a*s;return this.x=h*o+u*-n+l*-a-c*-r,this.y=l*o+u*-r+c*-n-h*-a,this.z=c*o+u*-a+h*-r-l*-n,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(16),n=i(22),r=i(46),a=new n,o=new r,h=new s;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="resize"},function(t,e,i){ -/** -* @author Richard Davey -* @copyright 2013-2023 Photon Storm Ltd. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/ -var s=i(186),n=i(0),r=i(23),a=new n({Extends:s,initialize:function(t,e,i){s.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},function(t,e,i){ -/** -* @author Richard Davey -* @copyright 2013-2023 Photon Storm Ltd. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/ -var s=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="addedtoscene"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="boot"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="create"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="destroy"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="pause"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="postupdate"},function(t,e){ -/** - * @author samme - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="prerender"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="preupdate"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="ready"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="removedfromscene"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="render"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="resume"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="shutdown"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="sleep"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="start"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="transitioncomplete"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="transitioninit"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="transitionout"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="transitionstart"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="transitionwake"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="update"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="wake"},function(t,e){(function(){"use strict";var e=(()=>{var t=Object.defineProperty,e=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,n={};((e,i)=>{for(var s in i)t(e,s,{get:i[s],enumerable:!0})})(n,{AlphaTimeline:()=>ft,Animation:()=>E,AnimationState:()=>Rt,AnimationStateAdapter:()=>Pt,AnimationStateData:()=>_t,AssetManager:()=>bi,AssetManagerBase:()=>ce,AtlasAttachmentLoader:()=>re,Attachment:()=>b,AttachmentTimeline:()=>gt,BinaryInput:()=>Xe,BlendMode:()=>Re,Bone:()=>he,BoneData:()=>ae,BoundingBoxAttachment:()=>Ut,CURRENT:()=>Nt,CanvasTexture:()=>vi,ClippingAttachment:()=>Wt,Color:()=>h,ConstraintData:()=>le,CurveTimeline:()=>Q,CurveTimeline1:()=>$,CurveTimeline2:()=>tt,DebugUtils:()=>g,DeformTimeline:()=>xt,Downloader:()=>ue,DrawOrderTimeline:()=>bt,Event:()=>de,EventData:()=>fe,EventQueue:()=>Yt,EventTimeline:()=>yt,EventType:()=>Xt,FIRST:()=>Dt,FakeTexture:()=>Zt,HOLD_FIRST:()=>Bt,HOLD_MIX:()=>Vt,HOLD_SUBSEQUENT:()=>Ot,IkConstraint:()=>pe,IkConstraintData:()=>me,IkConstraintTimeline:()=>At,IntSet:()=>r,Interpolation:()=>u,MathUtils:()=>c,MeshAttachment:()=>te,MixBlend:()=>C,MixDirection:()=>R,PathAttachment:()=>ee,PathConstraint:()=>be,PathConstraintData:()=>ge,PathConstraintMixTimeline:()=>kt,PathConstraintPositionTimeline:()=>St,PathConstraintSpacingTimeline:()=>It,PointAttachment:()=>ie,Pool:()=>x,PositionMode:()=>xe,Pow:()=>d,PowOut:()=>f,RGB2Timeline:()=>mt,RGBA2Timeline:()=>pt,RGBATimeline:()=>ut,RGBTimeline:()=>dt,RegionAttachment:()=>ne,RotateMode:()=>ye,RotateTimeline:()=>et,SETUP:()=>zt,SUBSEQUENT:()=>Lt,ScaleTimeline:()=>rt,ScaleXTimeline:()=>at,ScaleYTimeline:()=>ot,SequenceTimeline:()=>Et,ShearTimeline:()=>ht,ShearXTimeline:()=>lt,ShearYTimeline:()=>ct,Skeleton:()=>Ie,SkeletonBinary:()=>Ye,SkeletonBounds:()=>ci,SkeletonClipping:()=>di,SkeletonData:()=>ke,SkeletonJson:()=>fi,SkeletonRenderer:()=>Si,Skin:()=>Ee,SkinEntry:()=>Te,Slot:()=>Ae,SlotData:()=>Ce,SpacingMode:()=>we,StringSet:()=>a,Texture:()=>qt,TextureAtlas:()=>Kt,TextureAtlasPage:()=>Qt,TextureAtlasRegion:()=>$t,TextureFilter:()=>Gt,TextureRegion:()=>Ht,TextureWrap:()=>jt,TimeKeeper:()=>y,Timeline:()=>J,TrackEntry:()=>Ft,TransformConstraint:()=>Me,TransformConstraintData:()=>Fe,TransformConstraintTimeline:()=>Mt,TransformMode:()=>oe,TranslateTimeline:()=>it,TranslateXTimeline:()=>st,TranslateYTimeline:()=>nt,Triangulator:()=>ui,Utils:()=>m,Vector2:()=>w,VertexAttachment:()=>M,WindowedMean:()=>v});var r=class{constructor(){this.array=new Array}add(t){let e=this.contains(t);return this.array[0|t]=0|t,!e}contains(t){return null!=this.array[0|t]}remove(t){this.array[0|t]=void 0}clear(){this.array.length=0}},a=class{constructor(){this.entries={},this.size=0}add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var i=0,s=t.length;i1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}static fromString(t){return(new o).setFromString(t)}},h=o;h.WHITE=new o(1,1,1,1),h.RED=new o(1,0,0,1),h.GREEN=new o(0,1,0,1),h.BLUE=new o(0,0,1,1),h.MAGENTA=new o(1,0,1,1);var l=class{static clamp(t,e,i){return ti?i:t}static cosDeg(t){return Math.cos(t*l.degRad)}static sinDeg(t){return Math.sin(t*l.degRad)}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return l.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,i){let s=Math.random(),n=e-t;return s<=(i-t)/n?t+Math.sqrt(s*n*(i-t)):e-Math.sqrt((1-s)*n*(e-i))}static isPowerOfTwo(t){return t&&0==(t&t-1)}},c=l;c.PI=3.1415927,c.PI2=2*l.PI,c.radiansToDegrees=180/l.PI,c.radDeg=l.radiansToDegrees,c.degreesToRadians=l.PI/180,c.degRad=l.degreesToRadians;var u=class{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}},d=class extends u{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}},f=class extends d{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}},p=class{static arrayCopy(t,e,i,s,n){for(let r=e,a=s;r=e?t:p.setArraySize(t,e,i)}static newArray(t,e){let i=new Array(t);for(let s=0;s0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},v=class{constructor(t=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let e=0;e>1)*r;let a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(!l){o.length>0&&(h=o);let a=t.bone,l=a.worldX,c=a.worldY,u=a.a,d=a.b,f=a.c,p=a.d;for(let t=e,a=n;a=this.regions.length&&(i=this.regions.length-1);let s=this.regions[i];e.region!=s&&(e.region=s,e.updateRegion())}getPath(t,e){let i=t,s=(this.start+e).toString();for(let t=this.digits-s.length;t>0;t--)i+="0";return i+=s,i}static nextID(){return S._nextID++}},I=S;I._nextID=0;var k=(t=>(t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse",t))(k||{}),T=[0,1,2,3,4,5,6],E=class{constructor(t,e,i){if(this.timelines=[],this.timelineIds=new a,!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=i}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e0&&(e%=this.duration));let h=this.timelines;for(let s=0,l=h.length;s(t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add",t))(C||{}),R=(t=>(t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut",t))(R||{}),F=0,Y=1,X=2,P=3,L=4,D=5,O=6,B=7,V=8,z=9,N=10,_=11,U=12,W=13,q=14,G=15,j=16,H=17,Z=18,K=19,J=class{constructor(t,e){this.propertyIds=e,this.frames=m.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let i=t.length;for(let s=1;se)return s-1;return i-1}static search(t,e,i){let s=t.length;for(let n=i;ne)return n-i;return s-i}},Q=class extends J{constructor(t,e,i){super(t,i),this.curves=m.newFloatArray(t+18*e),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+18*t;if(this.curves.length>e){let t=m.newFloatArray(e);m.arrayCopy(this.curves,0,t,0,e),this.curves=t}}setBezier(t,e,i,s,n,r,a,o,h,l,c){let u=this.curves,d=this.getFrameCount()+18*t;0==i&&(u[e]=2+d);let f=.03*(s-2*r+o),p=.03*(n-2*a+h),m=.006*(3*(r-o)-s+l),g=.006*(3*(a-h)-n+c),x=2*f+m,w=2*p+g,y=.3*(r-s)+f+.16666667*m,v=.3*(a-n)+p+.16666667*g,b=s+y,A=n+v;for(let t=d+18;dt){let r=this.frames[e],a=this.frames[e+i];return a+(t-r)/(n[s]-r)*(n[s+1]-a)}let r=s+18;for(s+=2;s=t){let e=n[s-2],i=n[s-1];return i+(t-e)/(n[s]-e)*(n[s+1]-i)}e+=this.getFrameEntries();let a=n[r-2],o=n[r-1];return o+(t-a)/(this.frames[e]-a)*(this.frames[e+i]-o)}},$=class extends Q{constructor(t,e,i){super(t,e,[i])}getFrameEntries(){return 2}setFrame(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+1]=i}getCurveValue(t){let e=this.frames,i=e.length-2;for(let s=2;s<=i;s+=2)if(e[s]>t){i=s-2;break}let s=this.curves[i>>1];switch(s){case 0:let s=e[i],n=e[i+1];return n+(t-s)/(e[i+2]-s)*(e[i+2+1]-n);case 1:return e[i+1]}return this.getBezierValue(t,i,1,s-2)}},tt=class extends Q{constructor(t,e,i,s){super(t,e,[i,s])}getFrameEntries(){return 3}setFrame(t,e,i,s){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s}},et=class extends ${constructor(t,e,i){super(t,e,F+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i>2];switch(p){case 0:let t=h[f];c=h[f+1],u=h[f+2],d=h[f+3];let e=(i-t)/(h[f+4]-t);c+=(h[f+4+1]-c)*e,u+=(h[f+4+2]-u)*e,d+=(h[f+4+3]-d)*e;break;case 1:c=h[f+1],u=h[f+2],d=h[f+3];break;default:c=this.getBezierValue(i,f,1,p-2),u=this.getBezierValue(i,f,2,p+18-2),d=this.getBezierValue(i,f,3,p+36-2)}if(1==n)l.r=c,l.g=u,l.b=d;else{if(0==r){let t=o.data.color;l.r=t.r,l.g=t.g,l.b=t.b}l.r+=(c-l.r)*n,l.g+=(u-l.g)*n,l.b+=(d-l.b)*n}}},ft=class extends ${constructor(t,e,i){super(t,e,V+"|"+i),this.slotIndex=0,this.slotIndex=i}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.color;if(i>3];switch(y){case 0:let t=h[w];u=h[w+1],d=h[w+2],f=h[w+3],p=h[w+4],m=h[w+5],g=h[w+6],x=h[w+7];let e=(i-t)/(h[w+8]-t);u+=(h[w+8+1]-u)*e,d+=(h[w+8+2]-d)*e,f+=(h[w+8+3]-f)*e,p+=(h[w+8+4]-p)*e,m+=(h[w+8+5]-m)*e,g+=(h[w+8+6]-g)*e,x+=(h[w+8+7]-x)*e;break;case 1:u=h[w+1],d=h[w+2],f=h[w+3],p=h[w+4],m=h[w+5],g=h[w+6],x=h[w+7];break;default:u=this.getBezierValue(i,w,1,y-2),d=this.getBezierValue(i,w,2,y+18-2),f=this.getBezierValue(i,w,3,y+36-2),p=this.getBezierValue(i,w,4,y+54-2),m=this.getBezierValue(i,w,5,y+72-2),g=this.getBezierValue(i,w,6,y+90-2),x=this.getBezierValue(i,w,7,y+108-2)}if(1==n)l.set(u,d,f,p),c.r=m,c.g=g,c.b=x;else{if(0==r){l.setFromColor(o.data.color);let t=o.data.darkColor;c.r=t.r,c.g=t.g,c.b=t.b}l.add((u-l.r)*n,(d-l.g)*n,(f-l.b)*n,(p-l.a)*n),c.r+=(m-c.r)*n,c.g+=(g-c.g)*n,c.b+=(x-c.b)*n}}},mt=class extends Q{constructor(t,e,i){super(t,e,[B+"|"+i,z+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,s,n,r,a,o){t*=7,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n,this.frames[t+4]=r,this.frames[t+5]=a,this.frames[t+6]=o}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,c=o.darkColor;if(it){let n=this.frames[e];return i[s+1]*(t-n)/(i[s]-n)}let n=s+18;for(s+=2;s=t){let e=i[s-2],n=i[s-1];return n+(t-e)/(i[s]-e)*(i[s+1]-n)}let r=i[n-2],a=i[n-1];return a+(1-a)*(t-r)/(this.frames[e+this.getFrameEntries()]-r)}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.getAttachment();if(!h)return;if(!(h instanceof M)||h.timelineAttachment!=this.attachment)return;let l=o.deform;0==l.length&&(r=0);let c=this.vertices,u=c[0].length,d=this.frames;if(i=d[d.length-1]){let t=c[d.length-1];if(1==n)if(3==r){let e=h;if(e.bones)for(let e=0;ei)this.apply(t,e,Number.MAX_VALUE,s,n,r,a),e=-1;else if(e>=o[h-1])return;if(i0&&o[l-1]==t;)l--}for(;l=o[l];l++)s.push(this.events[l])}},yt=wt;yt.propertyIds=[""+U];var vt=class extends J{constructor(t){super(t,vt.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,s,n,r,a){if(1==a)return void(0==r&&m.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));if(i>2];switch(f){case 0:let t=u[d];h=u[d+1],l=u[d+2],c=u[d+3];let e=(i-t)/(u[d+4]-t);h+=(u[d+4+1]-h)*e,l+=(u[d+4+2]-l)*e,c+=(u[d+4+3]-c)*e;break;case 1:h=u[d+1],l=u[d+2],c=u[d+3];break;default:h=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),c=this.getBezierValue(i,d,3,f+36-2)}if(0==r){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*n,o.mixX=t.mixX+(l-t.mixX)*n,o.mixY=t.mixY+(c-t.mixY)*n}else o.mixRotate+=(h-o.mixRotate)*n,o.mixX+=(l-o.mixX)*n,o.mixY+=(c-o.mixY)*n}},Tt=class extends J{constructor(t,e,i){super(t,[K+"|"+e+"|"+i.sequence.id]),this.slotIndex=e,this.attachment=i}getFrameEntries(){return Tt.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,i,s,n){let r=this.frames;r[t*=Tt.ENTRIES]=e,r[t+Tt.MODE]=i|s<<4,r[t+Tt.DELAY]=n}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.attachment,l=this.attachment;if(!(h==l||h instanceof M&&h.timelineAttachment==l))return;let c=this.frames;if(i>4,g=this.attachment.sequence.regions.length,x=T[15&f];if(0!=x)switch(m+=(i-d)/p+1e-5|0,x){case 1:m=Math.min(g-1,m);break;case 2:m%=g;break;case 3:{let t=(g<<1)-2;m=0==t?0:m%t,m>=g&&(m=t-m);break}case 4:m=Math.max(g-1-m,0);break;case 5:m=g-1-m%g;break;case 6:{let t=(g<<1)-2;m=0==t?0:(m+g-1)%t,m>=g&&(m=t-m)}}o.sequenceIndex=m}},Et=Tt;Et.ENTRIES=3,Et.MODE=1,Et.DELAY=2;var Ct=class{constructor(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Yt(this),this.propertyIDs=new a,this.animationsChanged=!1,this.trackEntryPool=new x(()=>new Ft),this.data=t}static emptyAnimation(){return Ct._emptyAnimation}update(t){t*=this.timeScale;let e=this.tracks;for(let i=0,s=e.length;i0){if(s.delay-=n,s.delay>0)continue;n=-s.delay,s.delay=0}let r=s.next;if(r){let e=s.trackLast-r.delay;if(e>=0){for(r.delay=0,r.trackTime+=0==s.timeScale?0:(e/s.timeScale+t)*r.timeScale,s.trackTime+=n,this.setCurrent(i,r,!0);r.mixingFrom;)r.mixTime+=t,r=r.mixingFrom;continue}}else if(s.trackLast>=s.trackEnd&&!s.mixingFrom){e[i]=null,this.queue.end(s),this.clearNext(s);continue}if(s.mixingFrom&&this.updateMixingFrom(s,t)){let t=s.mixingFrom;for(s.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}s.trackTime+=n}this.queue.drain()}updateMixingFrom(t,e){let i=t.mixingFrom;if(!i)return!0;let s=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),s):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,i=this.tracks,s=!1;for(let r=0,a=i.length;r0)continue;s=!0;let o=0==r?1:a.mixBlend,h=a.alpha;a.mixingFrom?h*=this.applyMixingFrom(a,t,o):a.trackTime>=a.trackEnd&&!a.next&&(h=0);let l=a.animationLast,c=a.getAnimationTime(),u=c,d=e;a.reverse&&(u=a.animation.duration-u,d=null);let f=a.animation.timelines,p=f.length;if(0==r&&1==h||3==o)for(let e=0;e1&&(n=1),1!=i&&(i=s.mixBlend));let r=n0&&this.queueEvents(s,d),this.events.length=0,s.nextAnimationLast=d,s.nextTrackLast=s.trackTime,n}applyAttachmentTimeline(t,e,i,s,n){var r=e.slots[t.slotIndex];r.bone.active&&(i0,s=t>=0;c.signum(e)!=c.signum(f)&&Math.abs(e)<=90&&(Math.abs(t)>180&&(t+=360*c.signum(t)),s=i),d=f+t-t%360,s!=i&&(d+=360*c.signum(t)),r[a]=d}r[a+1]=f,h.rotation=l+d*s}queueEvents(t,e){let i=t.animationStart,s=t.animationEnd,n=s-i,r=t.trackLast%n,a=this.events,o=0,h=a.length;for(;os||this.queue.event(t,e)}let l=!1;for(l=t.loop?0==n||r>t.trackTime%n:e>=s&&t.animationLast=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let i=e;for(;;){let t=i.mixingFrom;if(!t)break;this.queue.end(t),i.mixingFrom=null,i.mixingTo=null,i=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,i){let s=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,s&&(i&&this.queue.interrupt(s),e.mixingFrom=s,s.mixingTo=e,e.mixTime=0,s.mixingFrom&&s.mixDuration>0&&(e.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,i=!1){let s=this.data.skeletonData.findAnimation(e);if(!s)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,s,i)}setAnimationWith(t,e,i=!1){if(!e)throw new Error("animation cannot be null.");let s=!0,n=this.expandToIndex(t);n&&(-1==n.nextTrackLast?(this.tracks[t]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.clearNext(n),n=n.mixingFrom,s=!1):this.clearNext(n));let r=this.trackEntry(t,e,i,n);return this.setCurrent(t,r,s),this.queue.drain(),r}addAnimation(t,e,i=!1,s=0){let n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,n,i,s)}addAnimationWith(t,e,i=!1,s=0){if(!e)throw new Error("animation cannot be null.");let n=this.expandToIndex(t);if(n)for(;n.next;)n=n.next;let r=this.trackEntry(t,e,i,n);return n?(n.next=r,r.previous=n,s<=0&&(s+=n.getTrackComplete()-r.mixDuration)):(this.setCurrent(t,r,!0),this.queue.drain()),r.delay=s,r}setEmptyAnimation(t,e=0){let i=this.setAnimationWith(t,Ct.emptyAnimation(),!1);return i.mixDuration=e,i.trackEnd=e,i}addEmptyAnimation(t,e=0,i=0){let s=this.addAnimationWith(t,Ct.emptyAnimation(),!1,i);return i<=0&&(s.delay+=s.mixDuration-e),s.mixDuration=e,s.trackEnd=e,s}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e0){n[o]=Vt,r[o]=i;continue t}break}n[o]=Bt}else n[o]=Lt}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},Rt=Ct;Rt._emptyAnimation=new E("",[],0);var Ft=class{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=2,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime(t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event",t))(Xt||{}),Pt=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}},Lt=0,Dt=1,Ot=2,Bt=3,Vt=4,zt=1,Nt=2,_t=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,i){let s=this.skeletonData.findAnimation(t);if(!s)throw new Error("Animation not found: "+t);let n=this.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);this.setMixWith(s,n,i)}setMixWith(t,e,i){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let s=t.name+"."+e.name;this.animationToMixTime[s]=i}getMix(t,e){let i=t.name+"."+e.name,s=this.animationToMixTime[i];return void 0===s?this.defaultMix:s}},Ut=class extends M{constructor(t){super(t),this.color=new h(1,1,1,1)}copy(){let t=new Ut(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},Wt=class extends M{constructor(t){super(t),this.endSlot=null,this.color=new h(.2275,.2275,.8078,1)}copy(){let t=new Wt(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},qt=class{constructor(t){this._image=t}getImage(){return this._image}},Gt=(t=>(t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear",t))(Gt||{}),jt=(t=>(t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat",t))(jt||{}),Ht=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},Zt=class extends qt{setFilters(t,e){}setWraps(t,e){}dispose(){}},Kt=class{constructor(t){this.pages=new Array,this.regions=new Array;let e=new Jt(t),i=new Array(4),s={size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},format:()=>{},filter:t=>{t.minFilter=m.enumValue(Gt,i[1]),t.magFilter=m.enumValue(Gt,i[2])},repeat:t=>{-1!=i[1].indexOf("x")&&(t.uWrap=10497),-1!=i[1].indexOf("y")&&(t.vWrap=10497)},pma:t=>{t.pma="true"==i[1]}};var n={xy:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2])},size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},bounds:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2]),t.width=parseInt(i[3]),t.height=parseInt(i[4])},offset:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2])},orig:t=>{t.originalWidth=parseInt(i[1]),t.originalHeight=parseInt(i[2])},offsets:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2]),t.originalWidth=parseInt(i[3]),t.originalHeight=parseInt(i[4])},rotate:t=>{let e=i[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:t=>{t.index=parseInt(i[1])}};let r=e.readLine();for(;r&&0==r.trim().length;)r=e.readLine();for(;r&&0!=r.trim().length&&0!=e.readEntry(i,r);)r=e.readLine();let a=null,o=null,h=null;for(;null!==r;)if(0==r.trim().length)a=null,r=e.readLine();else if(a){let t=new $t(a,r);for(;;){let s=e.readEntry(i,r=e.readLine());if(0==s)break;let a=n[i[0]];if(a)a(t);else{o||(o=[]),h||(h=[]),o.push(i[0]);let t=[];for(let e=0;e0&&h&&h.length>0&&(t.names=o,t.values=h,o=null,h=null),t.u=t.x/a.width,t.v=t.y/a.height,90==t.degrees?(t.u2=(t.x+t.height)/a.width,t.v2=(t.y+t.width)/a.height):(t.u2=(t.x+t.width)/a.width,t.v2=(t.y+t.height)/a.height),this.regions.push(t)}else{for(a=new Qt(r.trim());0!=e.readEntry(i,r=e.readLine());){let t=s[i[0]];t&&t(a)}this.pages.push(a)}}findRegion(t){for(let e=0;e=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;let i=e.indexOf(":");if(-1==i)return 0;t[0]=e.substr(0,i).trim();for(let s=1,n=i+1;;s++){let i=e.indexOf(",",n);if(-1==i)return t[s]=e.substr(n).trim(),s;if(t[s]=e.substr(n,i-n).trim(),n=i+1,4==s)return 4}}},Qt=class{constructor(t){this.minFilter=9728,this.magFilter=9728,this.uWrap=33071,this.vWrap=33071,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}},$t=class extends Ht{constructor(t,e){super(),this.x=0,this.y=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.index=0,this.degrees=0,this.names=null,this.values=null,this.page=t,this.name=e}},te=class extends M{constructor(t,e){super(t),this.region=null,this.regionUVs=[],this.uvs=[],this.triangles=[],this.color=new h(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=[],this.parentMesh=null,this.sequence=null,this.tempColor=new h(0,0,0,0),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=m.newFloatArray(t.length));let e=this.uvs,i=this.uvs.length,s=this.region.u,n=this.region.v,r=0,a=0;if(this.region instanceof $t){let o=this.region,h=o.page.texture.getImage(),l=h.width,c=h.height;switch(o.degrees){case 90:s-=(o.originalHeight-o.offsetY-o.height)/l,n-=(o.originalWidth-o.offsetX-o.width)/c,r=o.originalHeight/l,a=o.originalWidth/c;for(let o=0;o= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}},oe=(t=>(t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection",t))(oe||{}),he=class{constructor(t,e,i){if(this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,s,n,r,a){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=s,this.ascaleY=n,this.ashearX=r,this.ashearY=a;let o=this.parent;if(!o){let o=this.skeleton,h=i+90+a,l=o.scaleX,u=o.scaleY;return this.a=c.cosDeg(i+r)*s*l,this.b=c.cosDeg(h)*n*l,this.c=c.sinDeg(i+r)*s*u,this.d=c.sinDeg(h)*n*u,this.worldX=t*l+o.x,void(this.worldY=e*u+o.y)}let h=o.a,l=o.b,u=o.c,d=o.d;switch(this.worldX=h*t+l*e+o.worldX,this.worldY=u*t+d*e+o.worldY,this.data.transformMode){case 0:{let t=i+90+a,e=c.cosDeg(i+r)*s,o=c.cosDeg(t)*n,f=c.sinDeg(i+r)*s,p=c.sinDeg(t)*n;return this.a=h*e+l*f,this.b=h*o+l*p,this.c=u*e+d*f,void(this.d=u*o+d*p)}case 1:{let t=i+90+a;this.a=c.cosDeg(i+r)*s,this.b=c.cosDeg(t)*n,this.c=c.sinDeg(i+r)*s,this.d=c.sinDeg(t)*n;break}case 2:{let t=h*h+u*u,e=0;t>1e-4?(t=Math.abs(h*d-l*u)/t,h/=this.skeleton.scaleX,u/=this.skeleton.scaleY,l=u*t,d=h*t,e=Math.atan2(u,h)*c.radDeg):(h=0,u=0,e=90-Math.atan2(d,l)*c.radDeg);let o=i+r-e,f=i+a-e+90,p=c.cosDeg(o)*s,m=c.cosDeg(f)*n,g=c.sinDeg(o)*s,x=c.sinDeg(f)*n;this.a=h*p-l*g,this.b=h*m-l*x,this.c=u*p+d*g,this.d=u*m+d*x;break}case 3:case 4:{let t=c.cosDeg(i),e=c.sinDeg(i),o=(h*t+l*e)/this.skeleton.scaleX,f=(u*t+d*e)/this.skeleton.scaleY,p=Math.sqrt(o*o+f*f);p>1e-5&&(p=1/p),o*=p,f*=p,p=Math.sqrt(o*o+f*f),3==this.data.transformMode&&h*d-l*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let m=Math.PI/2+Math.atan2(f,o),g=Math.cos(m)*p,x=Math.sin(m)*p,w=c.cosDeg(r)*s,y=c.cosDeg(90+a)*n,v=c.sinDeg(r)*s,b=c.sinDeg(90+a)*n;this.a=o*w+g*v,this.b=o*y+g*b,this.c=f*w+x*v,this.d=f*y+x*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.c,this.a)*c.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*c.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){let t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*c.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*c.radDeg);let e=t.a,i=t.b,s=t.c,n=t.d,r=1/(e*n-i*s),a=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=a*n*r-o*i*r,this.ay=o*e*r-a*s*r;let h=r*n,l=r*e,u=r*i,d=r*s,f=h*this.a-u*this.c,p=h*this.b-u*this.d,m=l*this.c-d*this.a,g=l*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let t=f*g-p*m;this.ascaleY=t/this.ascaleX,this.ashearY=Math.atan2(f*p+m*g,t)*c.radDeg,this.arotation=Math.atan2(m,f)*c.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*c.radDeg}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),i=t.x-this.worldX,s=t.y-this.worldY;return t.x=i*this.d*e-s*this.b*e,t.y=s*this.a*e-i*this.c*e,t}localToWorld(t){let e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t}worldToLocalRotation(t){let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(this.a*e-this.c*i,this.d*i-this.b*e)*c.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(i*this.c+e*this.d,i*this.a+e*this.b)*c.radDeg}rotateWorld(t){let e=this.a,i=this.b,s=this.c,n=this.d,r=c.cosDeg(t),a=c.sinDeg(t);this.a=r*e-a*s,this.b=r*i-a*n,this.c=a*e+r*s,this.d=a*i+r*n}},le=class{constructor(t,e,i){this.name=t,this.order=e,this.skinRequired=i}},ce=class{constructor(t,e="",i=new ue){this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e,this.downloader=i}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,i){this.toLoad--,this.loaded++,this.assets[e]=i,t&&t(e,i)}error(t,e,i){this.toLoad--,this.loaded++,this.errors[e]=i,t&&t(e,i)}loadAll(){return new Promise((t,e)=>{let i=()=>{this.isLoadingComplete()?this.hasErrors()?e(this.errors):t(this):requestAnimationFrame(i)};requestAnimationFrame(i)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadBinary(t,i=>{this.success(e,t,i)},(e,s)=>{this.error(i,t,`Couldn't load binary ${t}: status ${e}, ${s}`)})}loadText(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadText(t,i=>{this.success(e,t,i)},(e,s)=>{this.error(i,t,`Couldn't load text ${t}: status ${e}, ${s}`)})}loadJson(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadJson(t,i=>{this.success(e,t,i)},(e,s)=>{this.error(i,t,`Couldn't load JSON ${t}: status ${e}, ${s}`)})}loadTexture(t,e=(()=>{}),i=(()=>{})){if(t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then(e=>e.ok?e.blob():(this.error(i,t,"Couldn't load image: "+t),null)).then(t=>t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(i=>{i&&this.success(e,t,this.textureLoader(i))});else{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>{this.success(e,t,this.textureLoader(s))},s.onerror=()=>{this.error(i,t,"Couldn't load image: "+t)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),s.src=t}}loadTextureAtlas(t,e=(()=>{}),i=(()=>{}),s){let n=t.lastIndexOf("/"),r=n>=0?t.substring(0,n+1):"";t=this.start(t),this.downloader.downloadText(t,n=>{try{let a=new Kt(n),o=a.pages.length,h=!1;for(let n of a.pages)this.loadTexture(s?s[n.name]:r+n.name,(i,s)=>{h||(n.setTexture(s),0==--o&&this.success(e,t,a))},(e,s)=>{h||this.error(i,t,`Couldn't load texture atlas ${t} page image: ${e}`),h=!0})}catch(e){this.error(i,t,`Couldn't parse texture atlas ${t}: ${e.message}`)}},(e,s)=>{this.error(i,t,`Couldn't load texture atlas ${t}: status ${e}, ${s}`)})}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let e=this.assets[t];if(e)return e;let i=this.errors[t];throw Error("Asset not found: "+t+(i?"\n"+i:""))}remove(t){t=this.pathPrefix+t;let e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}removeAll(){for(let t in this.assets){let e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}isLoadingComplete(){return 0==this.toLoad}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},ue=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return-1!=e?(e+="base64,".length,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var e=window.atob(t),i=e.length,s=new Uint8Array(i),n=0;n{this.finish(t,s.status,s.responseText)};s.onload=n,s.onerror=n,s.send()}downloadJson(t,e,i){this.downloadText(t,t=>{e(JSON.parse(t))},i)}downloadBinary(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType="arraybuffer";let n=()=>{this.finish(t,s.status,s.response)};s.onload=()=>{200==s.status||0==s.status?this.finish(t,200,new Uint8Array(s.response)):n()},s.onerror=n,s.send()}start(t,e,i){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,i)}}finish(t,e,i){let s=this.callbacks[t];delete this.callbacks[t];let n=200==e||0==e?[i]:[e,i];for(let t=n.length-1,e=s.length;t180?f-=360:f<-180&&(f+=360);let g=t.ascaleX,x=t.ascaleY;if(s||n){switch(t.data.transformMode){case 3:case 4:p=e-t.worldX,m=i-t.worldY}let o=t.data.length*g,h=Math.sqrt(p*p+m*m);if(s&&ho&&o>1e-4){let t=(h/o-1)*a+1;g*=t,r&&(x*=t)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*a,g,x,t.ashearX,t.ashearY)}apply2(t,e,i,s,n,r,a,o,h){let l=t.ax,u=t.ay,d=t.ascaleX,f=t.ascaleY,p=d,m=f,g=e.ascaleX,x=0,w=0,y=0;d<0?(d=-d,x=180,y=-1):(x=0,y=1),f<0&&(f=-f,y=-y),g<0?(g=-g,w=180):w=0;let v=e.ax,b=0,A=0,M=0,S=t.a,I=t.b,k=t.c,T=t.d,E=Math.abs(d-f)<=1e-4;!E||r?(b=0,A=S*v+t.worldX,M=k*v+t.worldY):(b=e.ay,A=S*v+I*b+t.worldX,M=k*v+T*b+t.worldY);let C=t.parent;if(!C)throw new Error("IK parent must itself have a parent.");S=C.a,I=C.b,k=C.c,T=C.d;let R,F,Y=1/(S*T-I*k),X=A-C.worldX,P=M-C.worldY,L=(X*T-P*I)*Y-l,D=(P*S-X*k)*Y-u,O=Math.sqrt(L*L+D*D),B=e.data.length*g;if(O<1e-4)return this.apply1(t,i,s,!1,r,!1,h),void e.updateWorldTransformWith(v,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);X=i-C.worldX,P=s-C.worldY;let V=(X*T-P*I)*Y-l,z=(P*S-X*k)*Y-u,N=V*V+z*z;if(0!=o){o*=d*(g+1)*.5;let t=Math.sqrt(N),e=t-O-B*d+o;if(e>0){let i=Math.min(1,e/(2*o))-1;i=(e-o*(1-i*i))/t,V-=i*V,z-=i*z,N=V*V+z*z}}t:if(E){B*=d;let t=(N-O*O-B*B)/(2*O*B);t<-1?(t=-1,F=Math.PI*n):t>1?(t=1,F=0,r&&(S=(Math.sqrt(N)/(O+B)-1)*h+1,p*=S,a&&(m*=S))):F=Math.acos(t)*n,S=O+B*t,I=B*Math.sin(F),R=Math.atan2(z*S-V*I,V*S+z*I)}else{S=d*B,I=f*B;let t=S*S,e=I*I,i=Math.atan2(z,V);k=e*O*O+t*N-t*e;let s=-2*e*O,r=e-t;if(T=s*s-4*r*k,T>=0){let t=Math.sqrt(T);s<0&&(t=-t),t=.5*-(s+t);let e=t/r,a=k/t,o=Math.abs(e)=-1&&k<=1&&(k=Math.acos(k),X=S*Math.cos(k)+O,P=I*Math.sin(k),T=X*X+P*P,Tm&&(u=k,m=T,p=X,g=P)),N<=.5*(h+m)?(R=i-Math.atan2(l*n,o),F=a*n):(R=i-Math.atan2(g*n,p),F=u*n)}let _=Math.atan2(b,v)*y,U=t.arotation;R=(R-_)*c.radDeg+x-U,R>180?R-=360:R<-180&&(R+=360),t.updateWorldTransformWith(l,u,U+R*h,p,m,0,0),U=e.arotation,F=((F+_)*c.radDeg-e.ashearX)*y+w-U,F>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(v,b,U+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}},me=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},ge=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.positionMode=xe.Fixed,this.spacingMode=we.Fixed,this.rotateMode=ye.Chain,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}},xe=(t=>(t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent",t))(xe||{}),we=(t=>(t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional",t))(we||{}),ye=(t=>(t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale",t))(ye||{}),ve=class{constructor(t,e){if(this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0,s=t.bones.length;i0){t=l/t*f;for(let e=1;e0?c.degRad:-c.degRad}for(let t=0,n=3;t0){let i=h.a,s=h.b,a=h.c,o=h.d,l=0,d=0,f=0;if(l=r?p[n-1]:0==u[t+1]?p[n+2]:Math.atan2(v,m),l-=Math.atan2(a,i),y){d=Math.cos(l),f=Math.sin(l);let t=h.data.length;g+=(t*(d*i-f*a)-m)*e,x+=(t*(f*i+d*a)-v)*e}else l+=w;l>c.PI?l-=c.PI2:l<-c.PI&&(l+=c.PI2),l*=e,d=Math.cos(l),f=Math.sin(l),h.a=d*i-f*a,h.b=d*s-f*o,h.c=f*i+d*a,h.d=f*s+d*o}h.updateAppliedTransform()}}computeWorldPositions(t,e,i){let s=this.target,n=this.position,r=this.spaces,a=m.setArraySize(this.positions,3*e+2),o=this.world,h=t.closed,l=t.worldVerticesLength,c=l/6,u=ve.NONE;if(!t.constantSpeed){let d=t.lengths;c-=h?1:2;let f,p=d[c];switch(1==this.data.positionMode&&(n*=p),this.data.spacingMode){case 2:f=p;break;case 3:f=p/e;break;default:f=1}o=m.setArraySize(this.world,8);for(let m=0,g=0,x=0;mp){u!=ve.AFTER&&(u=ve.AFTER,t.computeWorldVertices(s,l-6,4,o,0,2)),this.addAfterPosition(w-p,o,0,a,g);continue}}for(;;x++){let t=d[x];if(!(w>t)){if(0==x)w/=t;else{let e=d[x-1];w=(w-e)/(t-e)}break}}x!=u&&(u=x,h&&x==c?(t.computeWorldVertices(s,l-4,4,o,0,2),t.computeWorldVertices(s,0,4,o,4,2)):t.computeWorldVertices(s,6*x+2,8,o,0,2)),this.addCurvePosition(w,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],a,g,i||m>0&&0==e)}return a}h?(l+=2,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l-4,o,0,2),t.computeWorldVertices(s,0,2,o,l-4,2),o[l-2]=o[0],o[l-1]=o[1]):(c--,l-=4,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l,o,0,2));let d,f=m.setArraySize(this.curves,c),p=0,g=o[0],x=o[1],w=0,y=0,v=0,b=0,A=0,M=0,S=0,I=0,k=0,T=0,E=0,C=0,R=0,F=0;for(let t=0,e=2;tp){this.addAfterPosition(P-p,o,l-4,a,s);continue}}for(;;c++){let t=f[c];if(!(P>t)){if(0==c)P/=t;else{let e=f[c-1];P=(P-e)/(t-e)}break}}if(c!=u){u=c;let t=6*c;for(g=o[t],x=o[t+1],w=o[t+2],y=o[t+3],v=o[t+4],b=o[t+5],A=o[t+6],M=o[t+7],S=.03*(g-2*w+v),I=.03*(x-2*y+b),k=.006*(3*(w-v)-g+A),T=.006*(3*(y-b)-x+M),E=2*S+k,C=2*I+T,R=.3*(w-g)+S+.16666667*k,F=.3*(y-x)+I+.16666667*T,X=Math.sqrt(R*R+F*F),Y[0]=X,t=1;t<8;t++)R+=E,F+=C,E+=k,C+=T,X+=Math.sqrt(R*R+F*F),Y[t]=X;R+=E,F+=C,X+=Math.sqrt(R*R+F*F),Y[8]=X,R+=E+k,F+=C+T,X+=Math.sqrt(R*R+F*F),Y[9]=X,m=0}for(P*=X;;m++){let t=Y[m];if(!(P>t)){if(0==m)P/=t;else{let e=Y[m-1];P=m+(P-e)/(t-e)}break}}this.addCurvePosition(.1*P,g,x,w,y,v,b,A,M,a,s,i||t>0&&0==e)}return a}addBeforePosition(t,e,i,s,n){let r=e[i],a=e[i+1],o=e[i+2]-r,h=e[i+3]-a,l=Math.atan2(h,o);s[n]=r+t*Math.cos(l),s[n+1]=a+t*Math.sin(l),s[n+2]=l}addAfterPosition(t,e,i,s,n){let r=e[i+2],a=e[i+3],o=r-e[i],h=a-e[i+1],l=Math.atan2(h,o);s[n]=r+t*Math.cos(l),s[n+1]=a+t*Math.sin(l),s[n+2]=l}addCurvePosition(t,e,i,s,n,r,a,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=i,void(l[c+2]=Math.atan2(n-i,s-e));let d=t*t,f=d*t,p=1-t,m=p*p,g=m*p,x=p*t,w=3*x,y=p*w,v=w*t,b=e*g+s*y+r*v+o*f,A=i*g+n*y+a*v+h*f;l[c]=b,l[c+1]=A,u&&(l[c+2]=t<.001?Math.atan2(n-i,s-e):Math.atan2(A-(i*m+n*x*2+a*d),b-(e*m+s*x*2+r*d)))}},be=ve;be.NONE=-1,be.BEFORE=-2,be.AFTER=-3,be.epsilon=1e-5;var Ae=class{constructor(t,e){if(this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new h,this.darkColor=t.darkColor?new h:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(t instanceof M&&this.attachment instanceof M&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},Me=class{constructor(t,e){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new w,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(let i=0;i0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;fc.PI?r-=c.PI2:r<-c.PI&&(r+=c.PI2),r*=t;let a=Math.cos(r),o=Math.sin(r);x.a=a*e-o*s,x.b=a*i-o*n,x.c=o*e+a*s,x.d=o*i+a*n}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(t.x-x.worldX)*e,x.worldY+=(t.y-x.worldY)*i}if(0!=s){let t=Math.sqrt(x.a*x.a+x.c*x.c);0!=t&&(t=(t+(Math.sqrt(h*h+u*u)-t+this.data.offsetScaleX)*s)/t),x.a*=t,x.c*=t}if(0!=n){let t=Math.sqrt(x.b*x.b+x.d*x.d);0!=t&&(t=(t+(Math.sqrt(l*l+d*d)-t+this.data.offsetScaleY)*n)/t),x.b*=t,x.d*=t}if(r>0){let t=x.b,e=x.d,i=Math.atan2(e,t),s=Math.atan2(d,l)-Math.atan2(u,h)-(i-Math.atan2(x.c,x.a));s>c.PI?s-=c.PI2:s<-c.PI&&(s+=c.PI2),s=i+(s+m)*r;let n=Math.sqrt(t*t+e*e);x.b=Math.cos(s)*n,x.d=Math.sin(s)*n}x.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=0!=e||0!=i,o=this.target,h=o.a,l=o.b,u=o.c,d=o.d,f=h*d-l*u>0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;fc.PI?r-=c.PI2:r<-c.PI&&(r+=c.PI2),r*=t;let a=Math.cos(r),o=Math.sin(r);x.a=a*e-o*s,x.b=a*i-o*n,x.c=o*e+a*s,x.d=o*i+a*n}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=t.x*e,x.worldY+=t.y*i}if(0!=s){let t=(Math.sqrt(h*h+u*u)-1+this.data.offsetScaleX)*s+1;x.a*=t,x.c*=t}if(0!=n){let t=(Math.sqrt(l*l+d*d)-1+this.data.offsetScaleY)*n+1;x.b*=t,x.d*=t}if(r>0){let t=Math.atan2(d,l)-Math.atan2(u,h);t>c.PI?t-=c.PI2:t<-c.PI&&(t+=c.PI2);let e=x.b,i=x.d;t=Math.atan2(i,e)+(t-c.PI/2+m)*r;let s=Math.sqrt(e*e+i*i);x.b=Math.cos(t)*s,x.d=Math.sin(t)*s}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=this.target,o=this.bones;for(let h=0,l=o.length;h=s.length&&(s.length=t+1),s[t]||(s[t]={}),s[t][e]=i}addSkin(t){for(let e=0;e= 0.");if(!e)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}},Re=(t=>(t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen",t))(Re||{}),Fe=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Ye=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new ke;i.name="";let s=new Xe(t),n=s.readInt32(),r=s.readInt32();i.hash=0==r&&0==n?null:r.toString(16)+n.toString(16),i.version=s.readString(),i.x=s.readFloat(),i.y=s.readFloat(),i.width=s.readFloat(),i.height=s.readFloat();let a=s.readBoolean();a&&(i.fps=s.readFloat(),i.imagesPath=s.readString(),i.audioPath=s.readString());let o=0;o=s.readInt(!0);for(let t=0;t>4,t.readFloat())}s.push(e);break}}}}}let r=t.readInt(!0);if(r>0){let e=new bt(r),n=i.slots.length;for(let i=0;i=0;t--)a[t]=-1;let o=m.newArray(n-r,0),h=0,l=0;for(let e=0;e=0;t--)-1==a[t]&&(a[t]=o[--l]);e.setFrame(i,s,a)}s.push(e)}let a=t.readInt(!0);if(a>0){let e=new yt(a);for(let s=0;s>>1^-(1&i)}readStringRef(){let t=this.readInt(!0);return 0==t?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&t)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(t),i++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return 0!=this.readByte()}},Pe=class{constructor(t,e,i,s,n){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=s,this.inheritTimeline=n}},Le=class{constructor(t=null,e=null){this.bones=t,this.vertices=e}},De=(t=>(t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping",t))(De||{});function Oe(t,e,i){let s=t.readFloat(),n=t.readFloat()*i;for(let r=0,a=0,o=e.getFrameCount()-1;e.setFrame(r,s,n),r!=o;r++){let o=t.readFloat(),h=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(r);break;case li:Ve(t,e,a++,r,0,s,o,n,h,i)}s=o,n=h}return e}function Be(t,e,i){let s=t.readFloat(),n=t.readFloat()*i,r=t.readFloat()*i;for(let a=0,o=0,h=e.getFrameCount()-1;e.setFrame(a,s,n,r),a!=h;a++){let h=t.readFloat(),l=t.readFloat()*i,c=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(a);break;case li:Ve(t,e,o++,a,0,s,h,n,l,i),Ve(t,e,o++,a,1,s,h,r,c,i)}s=h,n=l,r=c}return e}function Ve(t,e,i,s,n,r,a,o,h,l){e.setBezier(i,s,n,r,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,a,h)}var ze,Ne=0,_e=1,Ue=2,We=3,qe=4,Ge=5,je=6,He=7,Ze=8,Ke=9,Je=0,Qe=1,$e=2,ti=3,ei=4,ii=5,si=0,ni=1,ri=0,ai=1,oi=2,hi=1,li=2,ci=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new x(()=>m.newFloatArray(16))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");let i=this.boundingBoxes,s=this.polygons,n=this.polygonPool,r=t.slots,a=r.length;i.length=0,n.freeAll(s),s.length=0;for(let t=0;t=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,i,s){let n=this.minX,r=this.minY,a=this.maxX,o=this.maxY;if(t<=n&&i<=n||e<=r&&s<=r||t>=a&&i>=a||e>=o&&s>=o)return!1;let h=(s-e)/(i-t),l=h*(n-t)+e;if(l>r&&lr&&ln&&cn&&ct.minX&&this.minYt.minY}containsPoint(t,e){let i=this.polygons;for(let s=0,n=i.length;s=i||o=i){let h=s[t];h+(i-n)/(o-n)*(s[r]-h)=c&&x<=a||x>=a&&x<=c)&&(x>=e&&x<=s||x>=s&&x<=e)){let t=(l*m-h*f)/g;if((t>=u&&t<=d||t>=d&&t<=u)&&(t>=i&&t<=n||t>=n&&t<=i))return!0}c=a,u=d}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},ui=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new x(()=>new Array),this.polygonIndicesPool=new x(()=>new Array)}triangulate(t){let e=t,i=t.length>>1,s=this.indicesArray;s.length=0;for(let t=0;t3;){let t=i-1,a=0,o=1;for(;;){t:if(!n[a]){let r=s[t]<<1,h=s[a]<<1,l=s[o]<<1,c=e[r],u=e[r+1],d=e[h],f=e[h+1],p=e[l],m=e[l+1];for(let r=(o+1)%i;r!=t;r=(r+1)%i){if(!n[r])continue;let t=s[r]<<1,i=e[t],a=e[t+1];if(ui.positiveArea(p,m,c,u,i,a)&&ui.positiveArea(c,u,d,f,i,a)&&ui.positiveArea(d,f,p,m,i,a))break t}break}if(0==o){do{if(!n[a])break;a--}while(a>0);break}t=a,a=o,o=(o+1)%i}r.push(s[(i+a-1)%i]),r.push(s[a]),r.push(s[(a+1)%i]),s.splice(a,1),n.splice(a,1),i--;let h=(i+a-1)%i,l=a==i?0:a;n[h]=ui.isConcave(h,i,e,s),n[l]=ui.isConcave(l,i,e,s)}return 3==i&&(r.push(s[2]),r.push(s[0]),r.push(s[1])),r}decompose(t,e){let i=t,s=this.convexPolygons;this.polygonPool.freeAll(s),s.length=0;let n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;let r=this.polygonIndicesPool.obtain();r.length=0;let a=this.polygonPool.obtain();a.length=0;let o=-1,h=0;for(let t=0,l=e.length;t0?(s.push(a),n.push(r)):(this.polygonPool.free(a),this.polygonIndicesPool.free(r)),a=this.polygonPool.obtain(),a.length=0,a.push(d),a.push(f),a.push(p),a.push(m),a.push(g),a.push(x),r=this.polygonIndicesPool.obtain(),r.length=0,r.push(l),r.push(c),r.push(u),h=ui.winding(d,f,p,m,g,x),o=l)}a.length>0&&(s.push(a),n.push(r));for(let t=0,e=s.length;t=0;t--)a=s[t],0==a.length&&(s.splice(t,1),this.polygonPool.free(a),r=n[t],n.splice(t,1),this.polygonIndicesPool.free(r));return s}static isConcave(t,e,i,s){let n=s[(e+t-1)%e]<<1,r=s[t]<<1,a=s[(t+1)%e]<<1;return!this.positiveArea(i[n],i[n+1],i[r],i[r+1],i[a],i[a+1])}static positiveArea(t,e,i,s,n,r){return t*(r-s)+i*(e-r)+n*(s-e)>=0}static winding(t,e,i,s,n,r){let a=i-t,o=s-e;return n*o-r*a+a*e-t*o>=0?1:-1}},di=class{constructor(){this.triangulator=new ui,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let i=e.worldVerticesLength,s=m.setArraySize(this.clippingPolygon,i);e.computeWorldVertices(t,0,i,s,0,2);let n=this.clippingPolygon;di.makeClockwise(n);let r=this.clippingPolygons=this.triangulator.decompose(n,this.triangulator.triangulate(n));for(let t=0,e=r.length;t>1,C=this.clipOutput,R=m.setArraySize(l,e+E*f);for(let h=0;h=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(i),h.push(s),h.push(n),h.push(r),h.push(t),h.push(e),o.length=0;let u=a,d=a.length-4;for(let t=0;;t+=2){let e=u[t],i=u[t+1],s=u[t+2],n=u[t+3],r=e-s,a=i-n,f=h,p=h.length-2,m=o.length;for(let t=0;t0;if(r*(l-n)-a*(h-s)>0){if(p){o.push(u),o.push(d);continue}let t=d-l,r=u-h,a=t*(s-e)-r*(n-i);if(Math.abs(a)>1e-6){let c=(r*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(n-i)*c)}else o.push(e),o.push(i)}else if(p){let t=d-l,r=u-h,a=t*(s-e)-r*(n-i);if(Math.abs(a)>1e-6){let c=(r*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(n-i)*c)}else o.push(e),o.push(i);o.push(u),o.push(d)}c=!0}if(m==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),t==d)break;let g=o;(o=h).length=0,h=g}if(l!=o){l.length=0;for(let t=0,e=o.length-2;t>1;t=0;e--)-1==o[e]&&(o[e]=t[--n])}e.setFrame(r,wi(a,"time",0),o)}n.push(e)}if(t.events){let e=new yt(t.events.length),s=0;for(let n=0;nnew vi(t),t,e)}},Ai=m.newFloatArray(8),Mi=class{constructor(t){this.triangleRendering=!1,this.debugRendering=!1,this.vertices=m.newFloatArray(8192),this.tempColor=new h,this.ctx=t}draw(t){this.triangleRendering?this.drawTriangles(t):this.drawImages(t)}drawImages(t){let e=this.ctx,i=this.tempColor,s=t.color,n=t.drawOrder;this.debugRendering&&(e.strokeStyle="green");for(let t=0,r=n.length;t{if(r&&"object"==typeof r||"function"==typeof r)for(let h of i(r))s.call(n,h)||h===a||t(n,h,{get:()=>r[h],enumerable:!(o=e(r,h))||o.enumerable});return n})(t({},"__esModule",{value:!0}),yi)})();t.exports=e}).call(window)},function(t,e){(function(){"use strict";var e=(()=>{var t=Object.defineProperty,e=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,n={};((e,i)=>{for(var s in i)t(e,s,{get:i[s],enumerable:!0})})(n,{AlphaTimeline:()=>ft,Animation:()=>E,AnimationState:()=>Rt,AnimationStateAdapter:()=>Pt,AnimationStateData:()=>_t,AssetManager:()=>Mi,AssetManagerBase:()=>ce,AtlasAttachmentLoader:()=>re,Attachment:()=>b,AttachmentTimeline:()=>gt,BinaryInput:()=>Xe,BlendMode:()=>Re,Bone:()=>he,BoneData:()=>ae,BoundingBoxAttachment:()=>Ut,CURRENT:()=>Nt,CameraController:()=>Gi,ClippingAttachment:()=>Wt,Color:()=>h,Color2Attribute:()=>es,ColorAttribute:()=>ts,ConstraintData:()=>le,CurveTimeline:()=>Q,CurveTimeline1:()=>$,CurveTimeline2:()=>tt,DebugUtils:()=>g,DeformTimeline:()=>xt,Downloader:()=>ue,DrawOrderTimeline:()=>bt,Event:()=>de,EventData:()=>fe,EventQueue:()=>Yt,EventTimeline:()=>yt,EventType:()=>Xt,FIRST:()=>Dt,FakeTexture:()=>Zt,GLTexture:()=>Ai,HOLD_FIRST:()=>Bt,HOLD_MIX:()=>Vt,HOLD_SUBSEQUENT:()=>Ot,IkConstraint:()=>pe,IkConstraintData:()=>me,IkConstraintTimeline:()=>At,Input:()=>Wi,IntSet:()=>r,Interpolation:()=>u,LoadingScreen:()=>vs,M00:()=>Ii,M01:()=>ki,M02:()=>Ti,M03:()=>Ei,M10:()=>Ci,M11:()=>Ri,M12:()=>Fi,M13:()=>Yi,M20:()=>Xi,M21:()=>Pi,M22:()=>Li,M23:()=>Di,M30:()=>Oi,M31:()=>Bi,M32:()=>Vi,M33:()=>zi,ManagedWebGLRenderingContext:()=>yi,MathUtils:()=>c,Matrix4:()=>_i,Mesh:()=>Zi,MeshAttachment:()=>te,MixBlend:()=>C,MixDirection:()=>R,OrthoCamera:()=>Ui,PathAttachment:()=>ee,PathConstraint:()=>be,PathConstraintData:()=>ge,PathConstraintMixTimeline:()=>kt,PathConstraintPositionTimeline:()=>St,PathConstraintSpacingTimeline:()=>It,PointAttachment:()=>ie,PolygonBatcher:()=>ns,Pool:()=>x,Position2Attribute:()=>Ji,Position3Attribute:()=>Qi,PositionMode:()=>xe,Pow:()=>d,PowOut:()=>f,RGB2Timeline:()=>mt,RGBA2Timeline:()=>pt,RGBATimeline:()=>ut,RGBTimeline:()=>dt,RegionAttachment:()=>ne,ResizeMode:()=>ws,RotateMode:()=>ye,RotateTimeline:()=>et,SETUP:()=>zt,SUBSEQUENT:()=>Lt,ScaleTimeline:()=>rt,ScaleXTimeline:()=>at,ScaleYTimeline:()=>ot,SceneRenderer:()=>xs,SequenceTimeline:()=>Et,Shader:()=>Hi,ShapeRenderer:()=>rs,ShapeType:()=>as,ShearTimeline:()=>ht,ShearXTimeline:()=>lt,ShearYTimeline:()=>ct,Skeleton:()=>Ie,SkeletonBinary:()=>Ye,SkeletonBounds:()=>ci,SkeletonClipping:()=>di,SkeletonData:()=>ke,SkeletonDebugRenderer:()=>hs,SkeletonJson:()=>fi,SkeletonRenderer:()=>cs,Skin:()=>Ee,SkinEntry:()=>Te,Slot:()=>Ae,SlotData:()=>Ce,SpacingMode:()=>we,SpineCanvas:()=>Ms,StringSet:()=>a,TexCoordAttribute:()=>$i,Texture:()=>qt,TextureAtlas:()=>Kt,TextureAtlasPage:()=>Qt,TextureAtlasRegion:()=>$t,TextureFilter:()=>Gt,TextureRegion:()=>Ht,TextureWrap:()=>jt,TimeKeeper:()=>y,Timeline:()=>J,Touch:()=>qi,TrackEntry:()=>Ft,TransformConstraint:()=>Me,TransformConstraintData:()=>Fe,TransformConstraintTimeline:()=>Mt,TransformMode:()=>oe,TranslateTimeline:()=>it,TranslateXTimeline:()=>st,TranslateYTimeline:()=>nt,Triangulator:()=>ui,Utils:()=>m,Vector2:()=>w,Vector3:()=>Si,VertexAttachment:()=>M,VertexAttribute:()=>Ki,VertexAttributeType:()=>is,WebGLBlendModeConverter:()=>vi,WindowedMean:()=>v});var r=class{constructor(){this.array=new Array}add(t){let e=this.contains(t);return this.array[0|t]=0|t,!e}contains(t){return null!=this.array[0|t]}remove(t){this.array[0|t]=void 0}clear(){this.array.length=0}},a=class{constructor(){this.entries={},this.size=0}add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var i=0,s=t.length;i1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}static fromString(t){return(new o).setFromString(t)}},h=o;h.WHITE=new o(1,1,1,1),h.RED=new o(1,0,0,1),h.GREEN=new o(0,1,0,1),h.BLUE=new o(0,0,1,1),h.MAGENTA=new o(1,0,1,1);var l=class{static clamp(t,e,i){return ti?i:t}static cosDeg(t){return Math.cos(t*l.degRad)}static sinDeg(t){return Math.sin(t*l.degRad)}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return l.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,i){let s=Math.random(),n=e-t;return s<=(i-t)/n?t+Math.sqrt(s*n*(i-t)):e-Math.sqrt((1-s)*n*(e-i))}static isPowerOfTwo(t){return t&&0==(t&t-1)}},c=l;c.PI=3.1415927,c.PI2=2*l.PI,c.radiansToDegrees=180/l.PI,c.radDeg=l.radiansToDegrees,c.degreesToRadians=l.PI/180,c.degRad=l.degreesToRadians;var u=class{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}},d=class extends u{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}},f=class extends d{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}},p=class{static arrayCopy(t,e,i,s,n){for(let r=e,a=s;r=e?t:p.setArraySize(t,e,i)}static newArray(t,e){let i=new Array(t);for(let s=0;s0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},v=class{constructor(t=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let e=0;e>1)*r;let a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(!l){o.length>0&&(h=o);let a=t.bone,l=a.worldX,c=a.worldY,u=a.a,d=a.b,f=a.c,p=a.d;for(let t=e,a=n;a=this.regions.length&&(i=this.regions.length-1);let s=this.regions[i];e.region!=s&&(e.region=s,e.updateRegion())}getPath(t,e){let i=t,s=(this.start+e).toString();for(let t=this.digits-s.length;t>0;t--)i+="0";return i+=s,i}static nextID(){return S._nextID++}},I=S;I._nextID=0;var k=(t=>(t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse",t))(k||{}),T=[0,1,2,3,4,5,6],E=class{constructor(t,e,i){if(this.timelines=[],this.timelineIds=new a,!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=i}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e0&&(e%=this.duration));let h=this.timelines;for(let s=0,l=h.length;s(t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add",t))(C||{}),R=(t=>(t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut",t))(R||{}),F=0,Y=1,X=2,P=3,L=4,D=5,O=6,B=7,V=8,z=9,N=10,_=11,U=12,W=13,q=14,G=15,j=16,H=17,Z=18,K=19,J=class{constructor(t,e){this.propertyIds=e,this.frames=m.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let i=t.length;for(let s=1;se)return s-1;return i-1}static search(t,e,i){let s=t.length;for(let n=i;ne)return n-i;return s-i}},Q=class extends J{constructor(t,e,i){super(t,i),this.curves=m.newFloatArray(t+18*e),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+18*t;if(this.curves.length>e){let t=m.newFloatArray(e);m.arrayCopy(this.curves,0,t,0,e),this.curves=t}}setBezier(t,e,i,s,n,r,a,o,h,l,c){let u=this.curves,d=this.getFrameCount()+18*t;0==i&&(u[e]=2+d);let f=.03*(s-2*r+o),p=.03*(n-2*a+h),m=.006*(3*(r-o)-s+l),g=.006*(3*(a-h)-n+c),x=2*f+m,w=2*p+g,y=.3*(r-s)+f+.16666667*m,v=.3*(a-n)+p+.16666667*g,b=s+y,A=n+v;for(let t=d+18;dt){let r=this.frames[e],a=this.frames[e+i];return a+(t-r)/(n[s]-r)*(n[s+1]-a)}let r=s+18;for(s+=2;s=t){let e=n[s-2],i=n[s-1];return i+(t-e)/(n[s]-e)*(n[s+1]-i)}e+=this.getFrameEntries();let a=n[r-2],o=n[r-1];return o+(t-a)/(this.frames[e]-a)*(this.frames[e+i]-o)}},$=class extends Q{constructor(t,e,i){super(t,e,[i])}getFrameEntries(){return 2}setFrame(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+1]=i}getCurveValue(t){let e=this.frames,i=e.length-2;for(let s=2;s<=i;s+=2)if(e[s]>t){i=s-2;break}let s=this.curves[i>>1];switch(s){case 0:let s=e[i],n=e[i+1];return n+(t-s)/(e[i+2]-s)*(e[i+2+1]-n);case 1:return e[i+1]}return this.getBezierValue(t,i,1,s-2)}},tt=class extends Q{constructor(t,e,i,s){super(t,e,[i,s])}getFrameEntries(){return 3}setFrame(t,e,i,s){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s}},et=class extends ${constructor(t,e,i){super(t,e,F+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i>2];switch(p){case 0:let t=h[f];c=h[f+1],u=h[f+2],d=h[f+3];let e=(i-t)/(h[f+4]-t);c+=(h[f+4+1]-c)*e,u+=(h[f+4+2]-u)*e,d+=(h[f+4+3]-d)*e;break;case 1:c=h[f+1],u=h[f+2],d=h[f+3];break;default:c=this.getBezierValue(i,f,1,p-2),u=this.getBezierValue(i,f,2,p+18-2),d=this.getBezierValue(i,f,3,p+36-2)}if(1==n)l.r=c,l.g=u,l.b=d;else{if(0==r){let t=o.data.color;l.r=t.r,l.g=t.g,l.b=t.b}l.r+=(c-l.r)*n,l.g+=(u-l.g)*n,l.b+=(d-l.b)*n}}},ft=class extends ${constructor(t,e,i){super(t,e,V+"|"+i),this.slotIndex=0,this.slotIndex=i}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.color;if(i>3];switch(y){case 0:let t=h[w];u=h[w+1],d=h[w+2],f=h[w+3],p=h[w+4],m=h[w+5],g=h[w+6],x=h[w+7];let e=(i-t)/(h[w+8]-t);u+=(h[w+8+1]-u)*e,d+=(h[w+8+2]-d)*e,f+=(h[w+8+3]-f)*e,p+=(h[w+8+4]-p)*e,m+=(h[w+8+5]-m)*e,g+=(h[w+8+6]-g)*e,x+=(h[w+8+7]-x)*e;break;case 1:u=h[w+1],d=h[w+2],f=h[w+3],p=h[w+4],m=h[w+5],g=h[w+6],x=h[w+7];break;default:u=this.getBezierValue(i,w,1,y-2),d=this.getBezierValue(i,w,2,y+18-2),f=this.getBezierValue(i,w,3,y+36-2),p=this.getBezierValue(i,w,4,y+54-2),m=this.getBezierValue(i,w,5,y+72-2),g=this.getBezierValue(i,w,6,y+90-2),x=this.getBezierValue(i,w,7,y+108-2)}if(1==n)l.set(u,d,f,p),c.r=m,c.g=g,c.b=x;else{if(0==r){l.setFromColor(o.data.color);let t=o.data.darkColor;c.r=t.r,c.g=t.g,c.b=t.b}l.add((u-l.r)*n,(d-l.g)*n,(f-l.b)*n,(p-l.a)*n),c.r+=(m-c.r)*n,c.g+=(g-c.g)*n,c.b+=(x-c.b)*n}}},mt=class extends Q{constructor(t,e,i){super(t,e,[B+"|"+i,z+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,s,n,r,a,o){t*=7,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n,this.frames[t+4]=r,this.frames[t+5]=a,this.frames[t+6]=o}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,c=o.darkColor;if(it){let n=this.frames[e];return i[s+1]*(t-n)/(i[s]-n)}let n=s+18;for(s+=2;s=t){let e=i[s-2],n=i[s-1];return n+(t-e)/(i[s]-e)*(i[s+1]-n)}let r=i[n-2],a=i[n-1];return a+(1-a)*(t-r)/(this.frames[e+this.getFrameEntries()]-r)}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.getAttachment();if(!h)return;if(!(h instanceof M)||h.timelineAttachment!=this.attachment)return;let l=o.deform;0==l.length&&(r=0);let c=this.vertices,u=c[0].length,d=this.frames;if(i=d[d.length-1]){let t=c[d.length-1];if(1==n)if(3==r){let e=h;if(e.bones)for(let e=0;ei)this.apply(t,e,Number.MAX_VALUE,s,n,r,a),e=-1;else if(e>=o[h-1])return;if(i0&&o[l-1]==t;)l--}for(;l=o[l];l++)s.push(this.events[l])}},yt=wt;yt.propertyIds=[""+U];var vt=class extends J{constructor(t){super(t,vt.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,s,n,r,a){if(1==a)return void(0==r&&m.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));if(i>2];switch(f){case 0:let t=u[d];h=u[d+1],l=u[d+2],c=u[d+3];let e=(i-t)/(u[d+4]-t);h+=(u[d+4+1]-h)*e,l+=(u[d+4+2]-l)*e,c+=(u[d+4+3]-c)*e;break;case 1:h=u[d+1],l=u[d+2],c=u[d+3];break;default:h=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),c=this.getBezierValue(i,d,3,f+36-2)}if(0==r){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*n,o.mixX=t.mixX+(l-t.mixX)*n,o.mixY=t.mixY+(c-t.mixY)*n}else o.mixRotate+=(h-o.mixRotate)*n,o.mixX+=(l-o.mixX)*n,o.mixY+=(c-o.mixY)*n}},Tt=class extends J{constructor(t,e,i){super(t,[K+"|"+e+"|"+i.sequence.id]),this.slotIndex=e,this.attachment=i}getFrameEntries(){return Tt.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,i,s,n){let r=this.frames;r[t*=Tt.ENTRIES]=e,r[t+Tt.MODE]=i|s<<4,r[t+Tt.DELAY]=n}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.attachment,l=this.attachment;if(!(h==l||h instanceof M&&h.timelineAttachment==l))return;let c=this.frames;if(i>4,g=this.attachment.sequence.regions.length,x=T[15&f];if(0!=x)switch(m+=(i-d)/p+1e-5|0,x){case 1:m=Math.min(g-1,m);break;case 2:m%=g;break;case 3:{let t=(g<<1)-2;m=0==t?0:m%t,m>=g&&(m=t-m);break}case 4:m=Math.max(g-1-m,0);break;case 5:m=g-1-m%g;break;case 6:{let t=(g<<1)-2;m=0==t?0:(m+g-1)%t,m>=g&&(m=t-m)}}o.sequenceIndex=m}},Et=Tt;Et.ENTRIES=3,Et.MODE=1,Et.DELAY=2;var Ct=class{constructor(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Yt(this),this.propertyIDs=new a,this.animationsChanged=!1,this.trackEntryPool=new x(()=>new Ft),this.data=t}static emptyAnimation(){return Ct._emptyAnimation}update(t){t*=this.timeScale;let e=this.tracks;for(let i=0,s=e.length;i0){if(s.delay-=n,s.delay>0)continue;n=-s.delay,s.delay=0}let r=s.next;if(r){let e=s.trackLast-r.delay;if(e>=0){for(r.delay=0,r.trackTime+=0==s.timeScale?0:(e/s.timeScale+t)*r.timeScale,s.trackTime+=n,this.setCurrent(i,r,!0);r.mixingFrom;)r.mixTime+=t,r=r.mixingFrom;continue}}else if(s.trackLast>=s.trackEnd&&!s.mixingFrom){e[i]=null,this.queue.end(s),this.clearNext(s);continue}if(s.mixingFrom&&this.updateMixingFrom(s,t)){let t=s.mixingFrom;for(s.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}s.trackTime+=n}this.queue.drain()}updateMixingFrom(t,e){let i=t.mixingFrom;if(!i)return!0;let s=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),s):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,i=this.tracks,s=!1;for(let r=0,a=i.length;r0)continue;s=!0;let o=0==r?1:a.mixBlend,h=a.alpha;a.mixingFrom?h*=this.applyMixingFrom(a,t,o):a.trackTime>=a.trackEnd&&!a.next&&(h=0);let l=a.animationLast,c=a.getAnimationTime(),u=c,d=e;a.reverse&&(u=a.animation.duration-u,d=null);let f=a.animation.timelines,p=f.length;if(0==r&&1==h||3==o)for(let e=0;e1&&(n=1),1!=i&&(i=s.mixBlend));let r=n0&&this.queueEvents(s,d),this.events.length=0,s.nextAnimationLast=d,s.nextTrackLast=s.trackTime,n}applyAttachmentTimeline(t,e,i,s,n){var r=e.slots[t.slotIndex];r.bone.active&&(i0,s=t>=0;c.signum(e)!=c.signum(f)&&Math.abs(e)<=90&&(Math.abs(t)>180&&(t+=360*c.signum(t)),s=i),d=f+t-t%360,s!=i&&(d+=360*c.signum(t)),r[a]=d}r[a+1]=f,h.rotation=l+d*s}queueEvents(t,e){let i=t.animationStart,s=t.animationEnd,n=s-i,r=t.trackLast%n,a=this.events,o=0,h=a.length;for(;os||this.queue.event(t,e)}let l=!1;for(l=t.loop?0==n||r>t.trackTime%n:e>=s&&t.animationLast=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let i=e;for(;;){let t=i.mixingFrom;if(!t)break;this.queue.end(t),i.mixingFrom=null,i.mixingTo=null,i=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,i){let s=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,s&&(i&&this.queue.interrupt(s),e.mixingFrom=s,s.mixingTo=e,e.mixTime=0,s.mixingFrom&&s.mixDuration>0&&(e.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,i=!1){let s=this.data.skeletonData.findAnimation(e);if(!s)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,s,i)}setAnimationWith(t,e,i=!1){if(!e)throw new Error("animation cannot be null.");let s=!0,n=this.expandToIndex(t);n&&(-1==n.nextTrackLast?(this.tracks[t]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.clearNext(n),n=n.mixingFrom,s=!1):this.clearNext(n));let r=this.trackEntry(t,e,i,n);return this.setCurrent(t,r,s),this.queue.drain(),r}addAnimation(t,e,i=!1,s=0){let n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,n,i,s)}addAnimationWith(t,e,i=!1,s=0){if(!e)throw new Error("animation cannot be null.");let n=this.expandToIndex(t);if(n)for(;n.next;)n=n.next;let r=this.trackEntry(t,e,i,n);return n?(n.next=r,r.previous=n,s<=0&&(s+=n.getTrackComplete()-r.mixDuration)):(this.setCurrent(t,r,!0),this.queue.drain()),r.delay=s,r}setEmptyAnimation(t,e=0){let i=this.setAnimationWith(t,Ct.emptyAnimation(),!1);return i.mixDuration=e,i.trackEnd=e,i}addEmptyAnimation(t,e=0,i=0){let s=this.addAnimationWith(t,Ct.emptyAnimation(),!1,i);return i<=0&&(s.delay+=s.mixDuration-e),s.mixDuration=e,s.trackEnd=e,s}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e0){n[o]=Vt,r[o]=i;continue t}break}n[o]=Bt}else n[o]=Lt}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},Rt=Ct;Rt._emptyAnimation=new E("",[],0);var Ft=class{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=2,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime(t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event",t))(Xt||{}),Pt=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}},Lt=0,Dt=1,Ot=2,Bt=3,Vt=4,zt=1,Nt=2,_t=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,i){let s=this.skeletonData.findAnimation(t);if(!s)throw new Error("Animation not found: "+t);let n=this.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);this.setMixWith(s,n,i)}setMixWith(t,e,i){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let s=t.name+"."+e.name;this.animationToMixTime[s]=i}getMix(t,e){let i=t.name+"."+e.name,s=this.animationToMixTime[i];return void 0===s?this.defaultMix:s}},Ut=class extends M{constructor(t){super(t),this.color=new h(1,1,1,1)}copy(){let t=new Ut(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},Wt=class extends M{constructor(t){super(t),this.endSlot=null,this.color=new h(.2275,.2275,.8078,1)}copy(){let t=new Wt(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},qt=class{constructor(t){this._image=t}getImage(){return this._image}},Gt=(t=>(t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear",t))(Gt||{}),jt=(t=>(t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat",t))(jt||{}),Ht=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},Zt=class extends qt{setFilters(t,e){}setWraps(t,e){}dispose(){}},Kt=class{constructor(t){this.pages=new Array,this.regions=new Array;let e=new Jt(t),i=new Array(4),s={size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},format:()=>{},filter:t=>{t.minFilter=m.enumValue(Gt,i[1]),t.magFilter=m.enumValue(Gt,i[2])},repeat:t=>{-1!=i[1].indexOf("x")&&(t.uWrap=10497),-1!=i[1].indexOf("y")&&(t.vWrap=10497)},pma:t=>{t.pma="true"==i[1]}};var n={xy:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2])},size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},bounds:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2]),t.width=parseInt(i[3]),t.height=parseInt(i[4])},offset:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2])},orig:t=>{t.originalWidth=parseInt(i[1]),t.originalHeight=parseInt(i[2])},offsets:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2]),t.originalWidth=parseInt(i[3]),t.originalHeight=parseInt(i[4])},rotate:t=>{let e=i[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:t=>{t.index=parseInt(i[1])}};let r=e.readLine();for(;r&&0==r.trim().length;)r=e.readLine();for(;r&&0!=r.trim().length&&0!=e.readEntry(i,r);)r=e.readLine();let a=null,o=null,h=null;for(;null!==r;)if(0==r.trim().length)a=null,r=e.readLine();else if(a){let t=new $t(a,r);for(;;){let s=e.readEntry(i,r=e.readLine());if(0==s)break;let a=n[i[0]];if(a)a(t);else{o||(o=[]),h||(h=[]),o.push(i[0]);let t=[];for(let e=0;e0&&h&&h.length>0&&(t.names=o,t.values=h,o=null,h=null),t.u=t.x/a.width,t.v=t.y/a.height,90==t.degrees?(t.u2=(t.x+t.height)/a.width,t.v2=(t.y+t.width)/a.height):(t.u2=(t.x+t.width)/a.width,t.v2=(t.y+t.height)/a.height),this.regions.push(t)}else{for(a=new Qt(r.trim());0!=e.readEntry(i,r=e.readLine());){let t=s[i[0]];t&&t(a)}this.pages.push(a)}}findRegion(t){for(let e=0;e=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;let i=e.indexOf(":");if(-1==i)return 0;t[0]=e.substr(0,i).trim();for(let s=1,n=i+1;;s++){let i=e.indexOf(",",n);if(-1==i)return t[s]=e.substr(n).trim(),s;if(t[s]=e.substr(n,i-n).trim(),n=i+1,4==s)return 4}}},Qt=class{constructor(t){this.minFilter=9728,this.magFilter=9728,this.uWrap=33071,this.vWrap=33071,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}},$t=class extends Ht{constructor(t,e){super(),this.x=0,this.y=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.index=0,this.degrees=0,this.names=null,this.values=null,this.page=t,this.name=e}},te=class extends M{constructor(t,e){super(t),this.region=null,this.regionUVs=[],this.uvs=[],this.triangles=[],this.color=new h(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=[],this.parentMesh=null,this.sequence=null,this.tempColor=new h(0,0,0,0),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=m.newFloatArray(t.length));let e=this.uvs,i=this.uvs.length,s=this.region.u,n=this.region.v,r=0,a=0;if(this.region instanceof $t){let o=this.region,h=o.page.texture.getImage(),l=h.width,c=h.height;switch(o.degrees){case 90:s-=(o.originalHeight-o.offsetY-o.height)/l,n-=(o.originalWidth-o.offsetX-o.width)/c,r=o.originalHeight/l,a=o.originalWidth/c;for(let o=0;o= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}},oe=(t=>(t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection",t))(oe||{}),he=class{constructor(t,e,i){if(this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,s,n,r,a){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=s,this.ascaleY=n,this.ashearX=r,this.ashearY=a;let o=this.parent;if(!o){let o=this.skeleton,h=i+90+a,l=o.scaleX,u=o.scaleY;return this.a=c.cosDeg(i+r)*s*l,this.b=c.cosDeg(h)*n*l,this.c=c.sinDeg(i+r)*s*u,this.d=c.sinDeg(h)*n*u,this.worldX=t*l+o.x,void(this.worldY=e*u+o.y)}let h=o.a,l=o.b,u=o.c,d=o.d;switch(this.worldX=h*t+l*e+o.worldX,this.worldY=u*t+d*e+o.worldY,this.data.transformMode){case 0:{let t=i+90+a,e=c.cosDeg(i+r)*s,o=c.cosDeg(t)*n,f=c.sinDeg(i+r)*s,p=c.sinDeg(t)*n;return this.a=h*e+l*f,this.b=h*o+l*p,this.c=u*e+d*f,void(this.d=u*o+d*p)}case 1:{let t=i+90+a;this.a=c.cosDeg(i+r)*s,this.b=c.cosDeg(t)*n,this.c=c.sinDeg(i+r)*s,this.d=c.sinDeg(t)*n;break}case 2:{let t=h*h+u*u,e=0;t>1e-4?(t=Math.abs(h*d-l*u)/t,h/=this.skeleton.scaleX,u/=this.skeleton.scaleY,l=u*t,d=h*t,e=Math.atan2(u,h)*c.radDeg):(h=0,u=0,e=90-Math.atan2(d,l)*c.radDeg);let o=i+r-e,f=i+a-e+90,p=c.cosDeg(o)*s,m=c.cosDeg(f)*n,g=c.sinDeg(o)*s,x=c.sinDeg(f)*n;this.a=h*p-l*g,this.b=h*m-l*x,this.c=u*p+d*g,this.d=u*m+d*x;break}case 3:case 4:{let t=c.cosDeg(i),e=c.sinDeg(i),o=(h*t+l*e)/this.skeleton.scaleX,f=(u*t+d*e)/this.skeleton.scaleY,p=Math.sqrt(o*o+f*f);p>1e-5&&(p=1/p),o*=p,f*=p,p=Math.sqrt(o*o+f*f),3==this.data.transformMode&&h*d-l*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let m=Math.PI/2+Math.atan2(f,o),g=Math.cos(m)*p,x=Math.sin(m)*p,w=c.cosDeg(r)*s,y=c.cosDeg(90+a)*n,v=c.sinDeg(r)*s,b=c.sinDeg(90+a)*n;this.a=o*w+g*v,this.b=o*y+g*b,this.c=f*w+x*v,this.d=f*y+x*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.c,this.a)*c.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*c.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){let t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*c.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*c.radDeg);let e=t.a,i=t.b,s=t.c,n=t.d,r=1/(e*n-i*s),a=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=a*n*r-o*i*r,this.ay=o*e*r-a*s*r;let h=r*n,l=r*e,u=r*i,d=r*s,f=h*this.a-u*this.c,p=h*this.b-u*this.d,m=l*this.c-d*this.a,g=l*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let t=f*g-p*m;this.ascaleY=t/this.ascaleX,this.ashearY=Math.atan2(f*p+m*g,t)*c.radDeg,this.arotation=Math.atan2(m,f)*c.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*c.radDeg}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),i=t.x-this.worldX,s=t.y-this.worldY;return t.x=i*this.d*e-s*this.b*e,t.y=s*this.a*e-i*this.c*e,t}localToWorld(t){let e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t}worldToLocalRotation(t){let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(this.a*e-this.c*i,this.d*i-this.b*e)*c.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(i*this.c+e*this.d,i*this.a+e*this.b)*c.radDeg}rotateWorld(t){let e=this.a,i=this.b,s=this.c,n=this.d,r=c.cosDeg(t),a=c.sinDeg(t);this.a=r*e-a*s,this.b=r*i-a*n,this.c=a*e+r*s,this.d=a*i+r*n}},le=class{constructor(t,e,i){this.name=t,this.order=e,this.skinRequired=i}},ce=class{constructor(t,e="",i=new ue){this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e,this.downloader=i}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,i){this.toLoad--,this.loaded++,this.assets[e]=i,t&&t(e,i)}error(t,e,i){this.toLoad--,this.loaded++,this.errors[e]=i,t&&t(e,i)}loadAll(){return new Promise((t,e)=>{let i=()=>{this.isLoadingComplete()?this.hasErrors()?e(this.errors):t(this):requestAnimationFrame(i)};requestAnimationFrame(i)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadBinary(t,i=>{this.success(e,t,i)},(e,s)=>{this.error(i,t,`Couldn't load binary ${t}: status ${e}, ${s}`)})}loadText(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadText(t,i=>{this.success(e,t,i)},(e,s)=>{this.error(i,t,`Couldn't load text ${t}: status ${e}, ${s}`)})}loadJson(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadJson(t,i=>{this.success(e,t,i)},(e,s)=>{this.error(i,t,`Couldn't load JSON ${t}: status ${e}, ${s}`)})}loadTexture(t,e=(()=>{}),i=(()=>{})){if(t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then(e=>e.ok?e.blob():(this.error(i,t,"Couldn't load image: "+t),null)).then(t=>t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(i=>{i&&this.success(e,t,this.textureLoader(i))});else{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>{this.success(e,t,this.textureLoader(s))},s.onerror=()=>{this.error(i,t,"Couldn't load image: "+t)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),s.src=t}}loadTextureAtlas(t,e=(()=>{}),i=(()=>{}),s){let n=t.lastIndexOf("/"),r=n>=0?t.substring(0,n+1):"";t=this.start(t),this.downloader.downloadText(t,n=>{try{let a=new Kt(n),o=a.pages.length,h=!1;for(let n of a.pages)this.loadTexture(s?s[n.name]:r+n.name,(i,s)=>{h||(n.setTexture(s),0==--o&&this.success(e,t,a))},(e,s)=>{h||this.error(i,t,`Couldn't load texture atlas ${t} page image: ${e}`),h=!0})}catch(e){this.error(i,t,`Couldn't parse texture atlas ${t}: ${e.message}`)}},(e,s)=>{this.error(i,t,`Couldn't load texture atlas ${t}: status ${e}, ${s}`)})}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let e=this.assets[t];if(e)return e;let i=this.errors[t];throw Error("Asset not found: "+t+(i?"\n"+i:""))}remove(t){t=this.pathPrefix+t;let e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}removeAll(){for(let t in this.assets){let e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}isLoadingComplete(){return 0==this.toLoad}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},ue=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return-1!=e?(e+="base64,".length,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var e=window.atob(t),i=e.length,s=new Uint8Array(i),n=0;n{this.finish(t,s.status,s.responseText)};s.onload=n,s.onerror=n,s.send()}downloadJson(t,e,i){this.downloadText(t,t=>{e(JSON.parse(t))},i)}downloadBinary(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType="arraybuffer";let n=()=>{this.finish(t,s.status,s.response)};s.onload=()=>{200==s.status||0==s.status?this.finish(t,200,new Uint8Array(s.response)):n()},s.onerror=n,s.send()}start(t,e,i){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,i)}}finish(t,e,i){let s=this.callbacks[t];delete this.callbacks[t];let n=200==e||0==e?[i]:[e,i];for(let t=n.length-1,e=s.length;t180?f-=360:f<-180&&(f+=360);let g=t.ascaleX,x=t.ascaleY;if(s||n){switch(t.data.transformMode){case 3:case 4:p=e-t.worldX,m=i-t.worldY}let o=t.data.length*g,h=Math.sqrt(p*p+m*m);if(s&&ho&&o>1e-4){let t=(h/o-1)*a+1;g*=t,r&&(x*=t)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*a,g,x,t.ashearX,t.ashearY)}apply2(t,e,i,s,n,r,a,o,h){let l=t.ax,u=t.ay,d=t.ascaleX,f=t.ascaleY,p=d,m=f,g=e.ascaleX,x=0,w=0,y=0;d<0?(d=-d,x=180,y=-1):(x=0,y=1),f<0&&(f=-f,y=-y),g<0?(g=-g,w=180):w=0;let v=e.ax,b=0,A=0,M=0,S=t.a,I=t.b,k=t.c,T=t.d,E=Math.abs(d-f)<=1e-4;!E||r?(b=0,A=S*v+t.worldX,M=k*v+t.worldY):(b=e.ay,A=S*v+I*b+t.worldX,M=k*v+T*b+t.worldY);let C=t.parent;if(!C)throw new Error("IK parent must itself have a parent.");S=C.a,I=C.b,k=C.c,T=C.d;let R,F,Y=1/(S*T-I*k),X=A-C.worldX,P=M-C.worldY,L=(X*T-P*I)*Y-l,D=(P*S-X*k)*Y-u,O=Math.sqrt(L*L+D*D),B=e.data.length*g;if(O<1e-4)return this.apply1(t,i,s,!1,r,!1,h),void e.updateWorldTransformWith(v,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);X=i-C.worldX,P=s-C.worldY;let V=(X*T-P*I)*Y-l,z=(P*S-X*k)*Y-u,N=V*V+z*z;if(0!=o){o*=d*(g+1)*.5;let t=Math.sqrt(N),e=t-O-B*d+o;if(e>0){let i=Math.min(1,e/(2*o))-1;i=(e-o*(1-i*i))/t,V-=i*V,z-=i*z,N=V*V+z*z}}t:if(E){B*=d;let t=(N-O*O-B*B)/(2*O*B);t<-1?(t=-1,F=Math.PI*n):t>1?(t=1,F=0,r&&(S=(Math.sqrt(N)/(O+B)-1)*h+1,p*=S,a&&(m*=S))):F=Math.acos(t)*n,S=O+B*t,I=B*Math.sin(F),R=Math.atan2(z*S-V*I,V*S+z*I)}else{S=d*B,I=f*B;let t=S*S,e=I*I,i=Math.atan2(z,V);k=e*O*O+t*N-t*e;let s=-2*e*O,r=e-t;if(T=s*s-4*r*k,T>=0){let t=Math.sqrt(T);s<0&&(t=-t),t=.5*-(s+t);let e=t/r,a=k/t,o=Math.abs(e)=-1&&k<=1&&(k=Math.acos(k),X=S*Math.cos(k)+O,P=I*Math.sin(k),T=X*X+P*P,Tm&&(u=k,m=T,p=X,g=P)),N<=.5*(h+m)?(R=i-Math.atan2(l*n,o),F=a*n):(R=i-Math.atan2(g*n,p),F=u*n)}let _=Math.atan2(b,v)*y,U=t.arotation;R=(R-_)*c.radDeg+x-U,R>180?R-=360:R<-180&&(R+=360),t.updateWorldTransformWith(l,u,U+R*h,p,m,0,0),U=e.arotation,F=((F+_)*c.radDeg-e.ashearX)*y+w-U,F>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(v,b,U+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}},me=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},ge=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.positionMode=xe.Fixed,this.spacingMode=we.Fixed,this.rotateMode=ye.Chain,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}},xe=(t=>(t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent",t))(xe||{}),we=(t=>(t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional",t))(we||{}),ye=(t=>(t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale",t))(ye||{}),ve=class{constructor(t,e){if(this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0,s=t.bones.length;i0){t=l/t*f;for(let e=1;e0?c.degRad:-c.degRad}for(let t=0,n=3;t0){let i=h.a,s=h.b,a=h.c,o=h.d,l=0,d=0,f=0;if(l=r?p[n-1]:0==u[t+1]?p[n+2]:Math.atan2(v,m),l-=Math.atan2(a,i),y){d=Math.cos(l),f=Math.sin(l);let t=h.data.length;g+=(t*(d*i-f*a)-m)*e,x+=(t*(f*i+d*a)-v)*e}else l+=w;l>c.PI?l-=c.PI2:l<-c.PI&&(l+=c.PI2),l*=e,d=Math.cos(l),f=Math.sin(l),h.a=d*i-f*a,h.b=d*s-f*o,h.c=f*i+d*a,h.d=f*s+d*o}h.updateAppliedTransform()}}computeWorldPositions(t,e,i){let s=this.target,n=this.position,r=this.spaces,a=m.setArraySize(this.positions,3*e+2),o=this.world,h=t.closed,l=t.worldVerticesLength,c=l/6,u=ve.NONE;if(!t.constantSpeed){let d=t.lengths;c-=h?1:2;let f,p=d[c];switch(1==this.data.positionMode&&(n*=p),this.data.spacingMode){case 2:f=p;break;case 3:f=p/e;break;default:f=1}o=m.setArraySize(this.world,8);for(let m=0,g=0,x=0;mp){u!=ve.AFTER&&(u=ve.AFTER,t.computeWorldVertices(s,l-6,4,o,0,2)),this.addAfterPosition(w-p,o,0,a,g);continue}}for(;;x++){let t=d[x];if(!(w>t)){if(0==x)w/=t;else{let e=d[x-1];w=(w-e)/(t-e)}break}}x!=u&&(u=x,h&&x==c?(t.computeWorldVertices(s,l-4,4,o,0,2),t.computeWorldVertices(s,0,4,o,4,2)):t.computeWorldVertices(s,6*x+2,8,o,0,2)),this.addCurvePosition(w,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],a,g,i||m>0&&0==e)}return a}h?(l+=2,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l-4,o,0,2),t.computeWorldVertices(s,0,2,o,l-4,2),o[l-2]=o[0],o[l-1]=o[1]):(c--,l-=4,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l,o,0,2));let d,f=m.setArraySize(this.curves,c),p=0,g=o[0],x=o[1],w=0,y=0,v=0,b=0,A=0,M=0,S=0,I=0,k=0,T=0,E=0,C=0,R=0,F=0;for(let t=0,e=2;tp){this.addAfterPosition(P-p,o,l-4,a,s);continue}}for(;;c++){let t=f[c];if(!(P>t)){if(0==c)P/=t;else{let e=f[c-1];P=(P-e)/(t-e)}break}}if(c!=u){u=c;let t=6*c;for(g=o[t],x=o[t+1],w=o[t+2],y=o[t+3],v=o[t+4],b=o[t+5],A=o[t+6],M=o[t+7],S=.03*(g-2*w+v),I=.03*(x-2*y+b),k=.006*(3*(w-v)-g+A),T=.006*(3*(y-b)-x+M),E=2*S+k,C=2*I+T,R=.3*(w-g)+S+.16666667*k,F=.3*(y-x)+I+.16666667*T,X=Math.sqrt(R*R+F*F),Y[0]=X,t=1;t<8;t++)R+=E,F+=C,E+=k,C+=T,X+=Math.sqrt(R*R+F*F),Y[t]=X;R+=E,F+=C,X+=Math.sqrt(R*R+F*F),Y[8]=X,R+=E+k,F+=C+T,X+=Math.sqrt(R*R+F*F),Y[9]=X,m=0}for(P*=X;;m++){let t=Y[m];if(!(P>t)){if(0==m)P/=t;else{let e=Y[m-1];P=m+(P-e)/(t-e)}break}}this.addCurvePosition(.1*P,g,x,w,y,v,b,A,M,a,s,i||t>0&&0==e)}return a}addBeforePosition(t,e,i,s,n){let r=e[i],a=e[i+1],o=e[i+2]-r,h=e[i+3]-a,l=Math.atan2(h,o);s[n]=r+t*Math.cos(l),s[n+1]=a+t*Math.sin(l),s[n+2]=l}addAfterPosition(t,e,i,s,n){let r=e[i+2],a=e[i+3],o=r-e[i],h=a-e[i+1],l=Math.atan2(h,o);s[n]=r+t*Math.cos(l),s[n+1]=a+t*Math.sin(l),s[n+2]=l}addCurvePosition(t,e,i,s,n,r,a,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=i,void(l[c+2]=Math.atan2(n-i,s-e));let d=t*t,f=d*t,p=1-t,m=p*p,g=m*p,x=p*t,w=3*x,y=p*w,v=w*t,b=e*g+s*y+r*v+o*f,A=i*g+n*y+a*v+h*f;l[c]=b,l[c+1]=A,u&&(l[c+2]=t<.001?Math.atan2(n-i,s-e):Math.atan2(A-(i*m+n*x*2+a*d),b-(e*m+s*x*2+r*d)))}},be=ve;be.NONE=-1,be.BEFORE=-2,be.AFTER=-3,be.epsilon=1e-5;var Ae=class{constructor(t,e){if(this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new h,this.darkColor=t.darkColor?new h:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(t instanceof M&&this.attachment instanceof M&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},Me=class{constructor(t,e){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new w,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(let i=0;i0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;fc.PI?r-=c.PI2:r<-c.PI&&(r+=c.PI2),r*=t;let a=Math.cos(r),o=Math.sin(r);x.a=a*e-o*s,x.b=a*i-o*n,x.c=o*e+a*s,x.d=o*i+a*n}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(t.x-x.worldX)*e,x.worldY+=(t.y-x.worldY)*i}if(0!=s){let t=Math.sqrt(x.a*x.a+x.c*x.c);0!=t&&(t=(t+(Math.sqrt(h*h+u*u)-t+this.data.offsetScaleX)*s)/t),x.a*=t,x.c*=t}if(0!=n){let t=Math.sqrt(x.b*x.b+x.d*x.d);0!=t&&(t=(t+(Math.sqrt(l*l+d*d)-t+this.data.offsetScaleY)*n)/t),x.b*=t,x.d*=t}if(r>0){let t=x.b,e=x.d,i=Math.atan2(e,t),s=Math.atan2(d,l)-Math.atan2(u,h)-(i-Math.atan2(x.c,x.a));s>c.PI?s-=c.PI2:s<-c.PI&&(s+=c.PI2),s=i+(s+m)*r;let n=Math.sqrt(t*t+e*e);x.b=Math.cos(s)*n,x.d=Math.sin(s)*n}x.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=0!=e||0!=i,o=this.target,h=o.a,l=o.b,u=o.c,d=o.d,f=h*d-l*u>0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;fc.PI?r-=c.PI2:r<-c.PI&&(r+=c.PI2),r*=t;let a=Math.cos(r),o=Math.sin(r);x.a=a*e-o*s,x.b=a*i-o*n,x.c=o*e+a*s,x.d=o*i+a*n}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=t.x*e,x.worldY+=t.y*i}if(0!=s){let t=(Math.sqrt(h*h+u*u)-1+this.data.offsetScaleX)*s+1;x.a*=t,x.c*=t}if(0!=n){let t=(Math.sqrt(l*l+d*d)-1+this.data.offsetScaleY)*n+1;x.b*=t,x.d*=t}if(r>0){let t=Math.atan2(d,l)-Math.atan2(u,h);t>c.PI?t-=c.PI2:t<-c.PI&&(t+=c.PI2);let e=x.b,i=x.d;t=Math.atan2(i,e)+(t-c.PI/2+m)*r;let s=Math.sqrt(e*e+i*i);x.b=Math.cos(t)*s,x.d=Math.sin(t)*s}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=this.target,o=this.bones;for(let h=0,l=o.length;h=s.length&&(s.length=t+1),s[t]||(s[t]={}),s[t][e]=i}addSkin(t){for(let e=0;e= 0.");if(!e)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}},Re=(t=>(t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen",t))(Re||{}),Fe=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Ye=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new ke;i.name="";let s=new Xe(t),n=s.readInt32(),r=s.readInt32();i.hash=0==r&&0==n?null:r.toString(16)+n.toString(16),i.version=s.readString(),i.x=s.readFloat(),i.y=s.readFloat(),i.width=s.readFloat(),i.height=s.readFloat();let a=s.readBoolean();a&&(i.fps=s.readFloat(),i.imagesPath=s.readString(),i.audioPath=s.readString());let o=0;o=s.readInt(!0);for(let t=0;t>4,t.readFloat())}s.push(e);break}}}}}let r=t.readInt(!0);if(r>0){let e=new bt(r),n=i.slots.length;for(let i=0;i=0;t--)a[t]=-1;let o=m.newArray(n-r,0),h=0,l=0;for(let e=0;e=0;t--)-1==a[t]&&(a[t]=o[--l]);e.setFrame(i,s,a)}s.push(e)}let a=t.readInt(!0);if(a>0){let e=new yt(a);for(let s=0;s>>1^-(1&i)}readStringRef(){let t=this.readInt(!0);return 0==t?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&t)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(t),i++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return 0!=this.readByte()}},Pe=class{constructor(t,e,i,s,n){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=s,this.inheritTimeline=n}},Le=class{constructor(t=null,e=null){this.bones=t,this.vertices=e}},De=(t=>(t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping",t))(De||{});function Oe(t,e,i){let s=t.readFloat(),n=t.readFloat()*i;for(let r=0,a=0,o=e.getFrameCount()-1;e.setFrame(r,s,n),r!=o;r++){let o=t.readFloat(),h=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(r);break;case li:Ve(t,e,a++,r,0,s,o,n,h,i)}s=o,n=h}return e}function Be(t,e,i){let s=t.readFloat(),n=t.readFloat()*i,r=t.readFloat()*i;for(let a=0,o=0,h=e.getFrameCount()-1;e.setFrame(a,s,n,r),a!=h;a++){let h=t.readFloat(),l=t.readFloat()*i,c=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(a);break;case li:Ve(t,e,o++,a,0,s,h,n,l,i),Ve(t,e,o++,a,1,s,h,r,c,i)}s=h,n=l,r=c}return e}function Ve(t,e,i,s,n,r,a,o,h,l){e.setBezier(i,s,n,r,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,a,h)}var ze,Ne=0,_e=1,Ue=2,We=3,qe=4,Ge=5,je=6,He=7,Ze=8,Ke=9,Je=0,Qe=1,$e=2,ti=3,ei=4,ii=5,si=0,ni=1,ri=0,ai=1,oi=2,hi=1,li=2,ci=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new x(()=>m.newFloatArray(16))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");let i=this.boundingBoxes,s=this.polygons,n=this.polygonPool,r=t.slots,a=r.length;i.length=0,n.freeAll(s),s.length=0;for(let t=0;t=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,i,s){let n=this.minX,r=this.minY,a=this.maxX,o=this.maxY;if(t<=n&&i<=n||e<=r&&s<=r||t>=a&&i>=a||e>=o&&s>=o)return!1;let h=(s-e)/(i-t),l=h*(n-t)+e;if(l>r&&lr&&ln&&cn&&ct.minX&&this.minYt.minY}containsPoint(t,e){let i=this.polygons;for(let s=0,n=i.length;s=i||o=i){let h=s[t];h+(i-n)/(o-n)*(s[r]-h)=c&&x<=a||x>=a&&x<=c)&&(x>=e&&x<=s||x>=s&&x<=e)){let t=(l*m-h*f)/g;if((t>=u&&t<=d||t>=d&&t<=u)&&(t>=i&&t<=n||t>=n&&t<=i))return!0}c=a,u=d}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},ui=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new x(()=>new Array),this.polygonIndicesPool=new x(()=>new Array)}triangulate(t){let e=t,i=t.length>>1,s=this.indicesArray;s.length=0;for(let t=0;t3;){let t=i-1,a=0,o=1;for(;;){t:if(!n[a]){let r=s[t]<<1,h=s[a]<<1,l=s[o]<<1,c=e[r],u=e[r+1],d=e[h],f=e[h+1],p=e[l],m=e[l+1];for(let r=(o+1)%i;r!=t;r=(r+1)%i){if(!n[r])continue;let t=s[r]<<1,i=e[t],a=e[t+1];if(ui.positiveArea(p,m,c,u,i,a)&&ui.positiveArea(c,u,d,f,i,a)&&ui.positiveArea(d,f,p,m,i,a))break t}break}if(0==o){do{if(!n[a])break;a--}while(a>0);break}t=a,a=o,o=(o+1)%i}r.push(s[(i+a-1)%i]),r.push(s[a]),r.push(s[(a+1)%i]),s.splice(a,1),n.splice(a,1),i--;let h=(i+a-1)%i,l=a==i?0:a;n[h]=ui.isConcave(h,i,e,s),n[l]=ui.isConcave(l,i,e,s)}return 3==i&&(r.push(s[2]),r.push(s[0]),r.push(s[1])),r}decompose(t,e){let i=t,s=this.convexPolygons;this.polygonPool.freeAll(s),s.length=0;let n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;let r=this.polygonIndicesPool.obtain();r.length=0;let a=this.polygonPool.obtain();a.length=0;let o=-1,h=0;for(let t=0,l=e.length;t0?(s.push(a),n.push(r)):(this.polygonPool.free(a),this.polygonIndicesPool.free(r)),a=this.polygonPool.obtain(),a.length=0,a.push(d),a.push(f),a.push(p),a.push(m),a.push(g),a.push(x),r=this.polygonIndicesPool.obtain(),r.length=0,r.push(l),r.push(c),r.push(u),h=ui.winding(d,f,p,m,g,x),o=l)}a.length>0&&(s.push(a),n.push(r));for(let t=0,e=s.length;t=0;t--)a=s[t],0==a.length&&(s.splice(t,1),this.polygonPool.free(a),r=n[t],n.splice(t,1),this.polygonIndicesPool.free(r));return s}static isConcave(t,e,i,s){let n=s[(e+t-1)%e]<<1,r=s[t]<<1,a=s[(t+1)%e]<<1;return!this.positiveArea(i[n],i[n+1],i[r],i[r+1],i[a],i[a+1])}static positiveArea(t,e,i,s,n,r){return t*(r-s)+i*(e-r)+n*(s-e)>=0}static winding(t,e,i,s,n,r){let a=i-t,o=s-e;return n*o-r*a+a*e-t*o>=0?1:-1}},di=class{constructor(){this.triangulator=new ui,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let i=e.worldVerticesLength,s=m.setArraySize(this.clippingPolygon,i);e.computeWorldVertices(t,0,i,s,0,2);let n=this.clippingPolygon;di.makeClockwise(n);let r=this.clippingPolygons=this.triangulator.decompose(n,this.triangulator.triangulate(n));for(let t=0,e=r.length;t>1,C=this.clipOutput,R=m.setArraySize(l,e+E*f);for(let h=0;h=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(i),h.push(s),h.push(n),h.push(r),h.push(t),h.push(e),o.length=0;let u=a,d=a.length-4;for(let t=0;;t+=2){let e=u[t],i=u[t+1],s=u[t+2],n=u[t+3],r=e-s,a=i-n,f=h,p=h.length-2,m=o.length;for(let t=0;t0;if(r*(l-n)-a*(h-s)>0){if(p){o.push(u),o.push(d);continue}let t=d-l,r=u-h,a=t*(s-e)-r*(n-i);if(Math.abs(a)>1e-6){let c=(r*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(n-i)*c)}else o.push(e),o.push(i)}else if(p){let t=d-l,r=u-h,a=t*(s-e)-r*(n-i);if(Math.abs(a)>1e-6){let c=(r*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(n-i)*c)}else o.push(e),o.push(i);o.push(u),o.push(d)}c=!0}if(m==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),t==d)break;let g=o;(o=h).length=0,h=g}if(l!=o){l.length=0;for(let t=0,e=o.length-2;t>1;t=0;e--)-1==o[e]&&(o[e]=t[--n])}e.setFrame(r,wi(a,"time",0),o)}n.push(e)}if(t.events){let e=new yt(t.events.length),s=0;for(let n=0;n{t&&t.preventDefault()}),i.addEventListener("webglcontextrestored",t=>{for(let t=0,e=this.restorables.length;t-1&&this.restorables.splice(e,1)}},vi=class{static getDestGLBlendMode(t){switch(t){case 0:return 771;case 1:return 1;case 2:case 3:return 771;default:throw new Error("Unknown blend mode: "+t)}}static getSourceColorGLBlendMode(t,e=!1){switch(t){case 0:case 1:return e?1:770;case 2:return 774;case 3:return 1;default:throw new Error("Unknown blend mode: "+t)}}static getSourceAlphaGLBlendMode(t){switch(t){case 0:case 1:return 1;case 2:return 771;case 3:return 769;default:throw new Error("Unknown blend mode: "+t)}}},bi=class extends qt{constructor(t,e,i=!1){super(e),this.texture=null,this.boundUnit=0,this.useMipMaps=!1,this.context=t instanceof yi?t:new yi(t),this.useMipMaps=i,this.restore(),this.context.addRestorable(this)}setFilters(t,e){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,bi.validateMagFilter(e)),this.useMipMaps=bi.usesMipMaps(t),this.useMipMaps&&i.generateMipmap(i.TEXTURE_2D)}static validateMagFilter(t){switch(t){case 9987:case 9987:case 9985:case 9986:case 9984:return 9729;default:return t}}static usesMipMaps(t){switch(t){case 9987:case 9987:case 9985:case 9986:case 9984:return!0;default:return!1}}setWraps(t,e){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e)}update(t){let e=this.context.gl;this.texture||(this.texture=this.context.gl.createTexture()),this.bind(),bi.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL&&e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this._image),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t&&e.generateMipmap(e.TEXTURE_2D)}restore(){this.texture=null,this.update(this.useMipMaps)}bind(t=0){let e=this.context.gl;this.boundUnit=t,e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.texture)}unbind(){let t=this.context.gl;t.activeTexture(t.TEXTURE0+this.boundUnit),t.bindTexture(t.TEXTURE_2D,null)}dispose(){this.context.removeRestorable(this),this.context.gl.deleteTexture(this.texture)}},Ai=bi;Ai.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL=!1;var Mi=class extends ce{constructor(t,e="",i=new ue){super(e=>new Ai(t,e),e,i)}},Si=class{constructor(t=0,e=0,i=0){this.x=0,this.y=0,this.z=0,this.x=t,this.y=e,this.z=i}setFrom(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}set(t,e,i){return this.x=t,this.y=e,this.z=i,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}scale(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(){let t=this.length();return 0==t||(t=1/t,this.x*=t,this.y*=t,this.z*=t),this}cross(t){return this.set(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)}multiply(t){let e=t.values;return this.set(this.x*e[Ii]+this.y*e[ki]+this.z*e[Ti]+e[Ei],this.x*e[Ci]+this.y*e[Ri]+this.z*e[Fi]+e[Yi],this.x*e[Xi]+this.y*e[Pi]+this.z*e[Li]+e[Di])}project(t){let e=t.values,i=1/(this.x*e[Oi]+this.y*e[Bi]+this.z*e[Vi]+e[zi]);return this.set((this.x*e[Ii]+this.y*e[ki]+this.z*e[Ti]+e[Ei])*i,(this.x*e[Ci]+this.y*e[Ri]+this.z*e[Fi]+e[Yi])*i,(this.x*e[Xi]+this.y*e[Pi]+this.z*e[Li]+e[Di])*i)}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}distance(t){let e=t.x-this.x,i=t.y-this.y,s=t.z-this.z;return Math.sqrt(e*e+i*i+s*s)}},Ii=0,ki=4,Ti=8,Ei=12,Ci=1,Ri=5,Fi=9,Yi=13,Xi=2,Pi=6,Li=10,Di=14,Oi=3,Bi=7,Vi=11,zi=15,Ni=class{constructor(){this.temp=new Float32Array(16),this.values=new Float32Array(16);let t=this.values;t[Ii]=1,t[Ri]=1,t[Li]=1,t[zi]=1}set(t){return this.values.set(t),this}transpose(){let t=this.temp,e=this.values;return t[Ii]=e[Ii],t[ki]=e[Ci],t[Ti]=e[Xi],t[Ei]=e[Oi],t[Ci]=e[ki],t[Ri]=e[Ri],t[Fi]=e[Pi],t[Yi]=e[Bi],t[Xi]=e[Ti],t[Pi]=e[Fi],t[Li]=e[Li],t[Di]=e[Vi],t[Oi]=e[Ei],t[Bi]=e[Yi],t[Vi]=e[Di],t[zi]=e[zi],this.set(t)}identity(){let t=this.values;return t[Ii]=1,t[ki]=0,t[Ti]=0,t[Ei]=0,t[Ci]=0,t[Ri]=1,t[Fi]=0,t[Yi]=0,t[Xi]=0,t[Pi]=0,t[Li]=1,t[Di]=0,t[Oi]=0,t[Bi]=0,t[Vi]=0,t[zi]=1,this}invert(){let t=this.values,e=this.temp,i=t[Oi]*t[Pi]*t[Fi]*t[Ei]-t[Xi]*t[Bi]*t[Fi]*t[Ei]-t[Oi]*t[Ri]*t[Li]*t[Ei]+t[Ci]*t[Bi]*t[Li]*t[Ei]+t[Xi]*t[Ri]*t[Vi]*t[Ei]-t[Ci]*t[Pi]*t[Vi]*t[Ei]-t[Oi]*t[Pi]*t[Ti]*t[Yi]+t[Xi]*t[Bi]*t[Ti]*t[Yi]+t[Oi]*t[ki]*t[Li]*t[Yi]-t[Ii]*t[Bi]*t[Li]*t[Yi]-t[Xi]*t[ki]*t[Vi]*t[Yi]+t[Ii]*t[Pi]*t[Vi]*t[Yi]+t[Oi]*t[Ri]*t[Ti]*t[Di]-t[Ci]*t[Bi]*t[Ti]*t[Di]-t[Oi]*t[ki]*t[Fi]*t[Di]+t[Ii]*t[Bi]*t[Fi]*t[Di]+t[Ci]*t[ki]*t[Vi]*t[Di]-t[Ii]*t[Ri]*t[Vi]*t[Di]-t[Xi]*t[Ri]*t[Ti]*t[zi]+t[Ci]*t[Pi]*t[Ti]*t[zi]+t[Xi]*t[ki]*t[Fi]*t[zi]-t[Ii]*t[Pi]*t[Fi]*t[zi]-t[Ci]*t[ki]*t[Li]*t[zi]+t[Ii]*t[Ri]*t[Li]*t[zi];if(0==i)throw new Error("non-invertible matrix");let s=1/i;return e[Ii]=t[Fi]*t[Di]*t[Bi]-t[Yi]*t[Li]*t[Bi]+t[Yi]*t[Pi]*t[Vi]-t[Ri]*t[Di]*t[Vi]-t[Fi]*t[Pi]*t[zi]+t[Ri]*t[Li]*t[zi],e[ki]=t[Ei]*t[Li]*t[Bi]-t[Ti]*t[Di]*t[Bi]-t[Ei]*t[Pi]*t[Vi]+t[ki]*t[Di]*t[Vi]+t[Ti]*t[Pi]*t[zi]-t[ki]*t[Li]*t[zi],e[Ti]=t[Ti]*t[Yi]*t[Bi]-t[Ei]*t[Fi]*t[Bi]+t[Ei]*t[Ri]*t[Vi]-t[ki]*t[Yi]*t[Vi]-t[Ti]*t[Ri]*t[zi]+t[ki]*t[Fi]*t[zi],e[Ei]=t[Ei]*t[Fi]*t[Pi]-t[Ti]*t[Yi]*t[Pi]-t[Ei]*t[Ri]*t[Li]+t[ki]*t[Yi]*t[Li]+t[Ti]*t[Ri]*t[Di]-t[ki]*t[Fi]*t[Di],e[Ci]=t[Yi]*t[Li]*t[Oi]-t[Fi]*t[Di]*t[Oi]-t[Yi]*t[Xi]*t[Vi]+t[Ci]*t[Di]*t[Vi]+t[Fi]*t[Xi]*t[zi]-t[Ci]*t[Li]*t[zi],e[Ri]=t[Ti]*t[Di]*t[Oi]-t[Ei]*t[Li]*t[Oi]+t[Ei]*t[Xi]*t[Vi]-t[Ii]*t[Di]*t[Vi]-t[Ti]*t[Xi]*t[zi]+t[Ii]*t[Li]*t[zi],e[Fi]=t[Ei]*t[Fi]*t[Oi]-t[Ti]*t[Yi]*t[Oi]-t[Ei]*t[Ci]*t[Vi]+t[Ii]*t[Yi]*t[Vi]+t[Ti]*t[Ci]*t[zi]-t[Ii]*t[Fi]*t[zi],e[Yi]=t[Ti]*t[Yi]*t[Xi]-t[Ei]*t[Fi]*t[Xi]+t[Ei]*t[Ci]*t[Li]-t[Ii]*t[Yi]*t[Li]-t[Ti]*t[Ci]*t[Di]+t[Ii]*t[Fi]*t[Di],e[Xi]=t[Ri]*t[Di]*t[Oi]-t[Yi]*t[Pi]*t[Oi]+t[Yi]*t[Xi]*t[Bi]-t[Ci]*t[Di]*t[Bi]-t[Ri]*t[Xi]*t[zi]+t[Ci]*t[Pi]*t[zi],e[Pi]=t[Ei]*t[Pi]*t[Oi]-t[ki]*t[Di]*t[Oi]-t[Ei]*t[Xi]*t[Bi]+t[Ii]*t[Di]*t[Bi]+t[ki]*t[Xi]*t[zi]-t[Ii]*t[Pi]*t[zi],e[Li]=t[ki]*t[Yi]*t[Oi]-t[Ei]*t[Ri]*t[Oi]+t[Ei]*t[Ci]*t[Bi]-t[Ii]*t[Yi]*t[Bi]-t[ki]*t[Ci]*t[zi]+t[Ii]*t[Ri]*t[zi],e[Di]=t[Ei]*t[Ri]*t[Xi]-t[ki]*t[Yi]*t[Xi]-t[Ei]*t[Ci]*t[Pi]+t[Ii]*t[Yi]*t[Pi]+t[ki]*t[Ci]*t[Di]-t[Ii]*t[Ri]*t[Di],e[Oi]=t[Fi]*t[Pi]*t[Oi]-t[Ri]*t[Li]*t[Oi]-t[Fi]*t[Xi]*t[Bi]+t[Ci]*t[Li]*t[Bi]+t[Ri]*t[Xi]*t[Vi]-t[Ci]*t[Pi]*t[Vi],e[Bi]=t[ki]*t[Li]*t[Oi]-t[Ti]*t[Pi]*t[Oi]+t[Ti]*t[Xi]*t[Bi]-t[Ii]*t[Li]*t[Bi]-t[ki]*t[Xi]*t[Vi]+t[Ii]*t[Pi]*t[Vi],e[Vi]=t[Ti]*t[Ri]*t[Oi]-t[ki]*t[Fi]*t[Oi]-t[Ti]*t[Ci]*t[Bi]+t[Ii]*t[Fi]*t[Bi]+t[ki]*t[Ci]*t[Vi]-t[Ii]*t[Ri]*t[Vi],e[zi]=t[ki]*t[Fi]*t[Xi]-t[Ti]*t[Ri]*t[Xi]+t[Ti]*t[Ci]*t[Pi]-t[Ii]*t[Fi]*t[Pi]-t[ki]*t[Ci]*t[Li]+t[Ii]*t[Ri]*t[Li],t[Ii]=e[Ii]*s,t[ki]=e[ki]*s,t[Ti]=e[Ti]*s,t[Ei]=e[Ei]*s,t[Ci]=e[Ci]*s,t[Ri]=e[Ri]*s,t[Fi]=e[Fi]*s,t[Yi]=e[Yi]*s,t[Xi]=e[Xi]*s,t[Pi]=e[Pi]*s,t[Li]=e[Li]*s,t[Di]=e[Di]*s,t[Oi]=e[Oi]*s,t[Bi]=e[Bi]*s,t[Vi]=e[Vi]*s,t[zi]=e[zi]*s,this}determinant(){let t=this.values;return t[Oi]*t[Pi]*t[Fi]*t[Ei]-t[Xi]*t[Bi]*t[Fi]*t[Ei]-t[Oi]*t[Ri]*t[Li]*t[Ei]+t[Ci]*t[Bi]*t[Li]*t[Ei]+t[Xi]*t[Ri]*t[Vi]*t[Ei]-t[Ci]*t[Pi]*t[Vi]*t[Ei]-t[Oi]*t[Pi]*t[Ti]*t[Yi]+t[Xi]*t[Bi]*t[Ti]*t[Yi]+t[Oi]*t[ki]*t[Li]*t[Yi]-t[Ii]*t[Bi]*t[Li]*t[Yi]-t[Xi]*t[ki]*t[Vi]*t[Yi]+t[Ii]*t[Pi]*t[Vi]*t[Yi]+t[Oi]*t[Ri]*t[Ti]*t[Di]-t[Ci]*t[Bi]*t[Ti]*t[Di]-t[Oi]*t[ki]*t[Fi]*t[Di]+t[Ii]*t[Bi]*t[Fi]*t[Di]+t[Ci]*t[ki]*t[Vi]*t[Di]-t[Ii]*t[Ri]*t[Vi]*t[Di]-t[Xi]*t[Ri]*t[Ti]*t[zi]+t[Ci]*t[Pi]*t[Ti]*t[zi]+t[Xi]*t[ki]*t[Fi]*t[zi]-t[Ii]*t[Pi]*t[Fi]*t[zi]-t[Ci]*t[ki]*t[Li]*t[zi]+t[Ii]*t[Ri]*t[Li]*t[zi]}translate(t,e,i){let s=this.values;return s[Ei]+=t,s[Yi]+=e,s[Di]+=i,this}copy(){return(new Ni).set(this.values)}projection(t,e,i,s){this.identity();let n=1/Math.tan(i*(Math.PI/180)/2),r=(e+t)/(t-e),a=2*e*t/(t-e),o=this.values;return o[Ii]=n/s,o[Ci]=0,o[Xi]=0,o[Oi]=0,o[ki]=0,o[Ri]=n,o[Pi]=0,o[Bi]=0,o[Ti]=0,o[Fi]=0,o[Li]=r,o[Vi]=-1,o[Ei]=0,o[Yi]=0,o[Di]=a,o[zi]=0,this}ortho2d(t,e,i,s){return this.ortho(t,t+i,e,e+s,0,1)}ortho(t,e,i,s,n,r){this.identity();let a=2/(e-t),o=2/(s-i),h=-2/(r-n),l=-(e+t)/(e-t),c=-(s+i)/(s-i),u=-(r+n)/(r-n),d=this.values;return d[Ii]=a,d[Ci]=0,d[Xi]=0,d[Oi]=0,d[ki]=0,d[Ri]=o,d[Pi]=0,d[Bi]=0,d[Ti]=0,d[Fi]=0,d[Li]=h,d[Vi]=0,d[Ei]=l,d[Yi]=c,d[Di]=u,d[zi]=1,this}multiply(t){let e=this.temp,i=this.values,s=t.values;return e[Ii]=i[Ii]*s[Ii]+i[ki]*s[Ci]+i[Ti]*s[Xi]+i[Ei]*s[Oi],e[ki]=i[Ii]*s[ki]+i[ki]*s[Ri]+i[Ti]*s[Pi]+i[Ei]*s[Bi],e[Ti]=i[Ii]*s[Ti]+i[ki]*s[Fi]+i[Ti]*s[Li]+i[Ei]*s[Vi],e[Ei]=i[Ii]*s[Ei]+i[ki]*s[Yi]+i[Ti]*s[Di]+i[Ei]*s[zi],e[Ci]=i[Ci]*s[Ii]+i[Ri]*s[Ci]+i[Fi]*s[Xi]+i[Yi]*s[Oi],e[Ri]=i[Ci]*s[ki]+i[Ri]*s[Ri]+i[Fi]*s[Pi]+i[Yi]*s[Bi],e[Fi]=i[Ci]*s[Ti]+i[Ri]*s[Fi]+i[Fi]*s[Li]+i[Yi]*s[Vi],e[Yi]=i[Ci]*s[Ei]+i[Ri]*s[Yi]+i[Fi]*s[Di]+i[Yi]*s[zi],e[Xi]=i[Xi]*s[Ii]+i[Pi]*s[Ci]+i[Li]*s[Xi]+i[Di]*s[Oi],e[Pi]=i[Xi]*s[ki]+i[Pi]*s[Ri]+i[Li]*s[Pi]+i[Di]*s[Bi],e[Li]=i[Xi]*s[Ti]+i[Pi]*s[Fi]+i[Li]*s[Li]+i[Di]*s[Vi],e[Di]=i[Xi]*s[Ei]+i[Pi]*s[Yi]+i[Li]*s[Di]+i[Di]*s[zi],e[Oi]=i[Oi]*s[Ii]+i[Bi]*s[Ci]+i[Vi]*s[Xi]+i[zi]*s[Oi],e[Bi]=i[Oi]*s[ki]+i[Bi]*s[Ri]+i[Vi]*s[Pi]+i[zi]*s[Bi],e[Vi]=i[Oi]*s[Ti]+i[Bi]*s[Fi]+i[Vi]*s[Li]+i[zi]*s[Vi],e[zi]=i[Oi]*s[Ei]+i[Bi]*s[Yi]+i[Vi]*s[Di]+i[zi]*s[zi],this.set(this.temp)}multiplyLeft(t){let e=this.temp,i=this.values,s=t.values;return e[Ii]=s[Ii]*i[Ii]+s[ki]*i[Ci]+s[Ti]*i[Xi]+s[Ei]*i[Oi],e[ki]=s[Ii]*i[ki]+s[ki]*i[Ri]+s[Ti]*i[Pi]+s[Ei]*i[Bi],e[Ti]=s[Ii]*i[Ti]+s[ki]*i[Fi]+s[Ti]*i[Li]+s[Ei]*i[Vi],e[Ei]=s[Ii]*i[Ei]+s[ki]*i[Yi]+s[Ti]*i[Di]+s[Ei]*i[zi],e[Ci]=s[Ci]*i[Ii]+s[Ri]*i[Ci]+s[Fi]*i[Xi]+s[Yi]*i[Oi],e[Ri]=s[Ci]*i[ki]+s[Ri]*i[Ri]+s[Fi]*i[Pi]+s[Yi]*i[Bi],e[Fi]=s[Ci]*i[Ti]+s[Ri]*i[Fi]+s[Fi]*i[Li]+s[Yi]*i[Vi],e[Yi]=s[Ci]*i[Ei]+s[Ri]*i[Yi]+s[Fi]*i[Di]+s[Yi]*i[zi],e[Xi]=s[Xi]*i[Ii]+s[Pi]*i[Ci]+s[Li]*i[Xi]+s[Di]*i[Oi],e[Pi]=s[Xi]*i[ki]+s[Pi]*i[Ri]+s[Li]*i[Pi]+s[Di]*i[Bi],e[Li]=s[Xi]*i[Ti]+s[Pi]*i[Fi]+s[Li]*i[Li]+s[Di]*i[Vi],e[Di]=s[Xi]*i[Ei]+s[Pi]*i[Yi]+s[Li]*i[Di]+s[Di]*i[zi],e[Oi]=s[Oi]*i[Ii]+s[Bi]*i[Ci]+s[Vi]*i[Xi]+s[zi]*i[Oi],e[Bi]=s[Oi]*i[ki]+s[Bi]*i[Ri]+s[Vi]*i[Pi]+s[zi]*i[Bi],e[Vi]=s[Oi]*i[Ti]+s[Bi]*i[Fi]+s[Vi]*i[Li]+s[zi]*i[Vi],e[zi]=s[Oi]*i[Ei]+s[Bi]*i[Yi]+s[Vi]*i[Di]+s[zi]*i[zi],this.set(this.temp)}lookAt(t,e,i){let s=Ni.xAxis,n=Ni.yAxis,r=Ni.zAxis;r.setFrom(e).normalize(),s.setFrom(e).normalize(),s.cross(i).normalize(),n.setFrom(s).cross(r).normalize(),this.identity();let a=this.values;return a[Ii]=s.x,a[ki]=s.y,a[Ti]=s.z,a[Ci]=n.x,a[Ri]=n.y,a[Fi]=n.z,a[Xi]=-r.x,a[Pi]=-r.y,a[Li]=-r.z,Ni.tmpMatrix.identity(),Ni.tmpMatrix.values[Ei]=-t.x,Ni.tmpMatrix.values[Yi]=-t.y,Ni.tmpMatrix.values[Di]=-t.z,this.multiply(Ni.tmpMatrix),this}},_i=Ni;_i.xAxis=new Si,_i.yAxis=new Si,_i.zAxis=new Si,_i.tmpMatrix=new Ni;var Ui=class{constructor(t,e){this.position=new Si(0,0,0),this.direction=new Si(0,0,-1),this.up=new Si(0,1,0),this.near=0,this.far=100,this.zoom=1,this.viewportWidth=0,this.viewportHeight=0,this.projectionView=new _i,this.inverseProjectionView=new _i,this.projection=new _i,this.view=new _i,this.viewportWidth=t,this.viewportHeight=e,this.update()}update(){let t=this.projection,e=this.view,i=this.projectionView,s=this.inverseProjectionView,n=this.zoom,r=this.viewportWidth,a=this.viewportHeight;t.ortho(n*(-r/2),n*(r/2),n*(-a/2),n*(a/2),this.near,this.far),e.lookAt(this.position,this.direction,this.up),i.set(t.values),i.multiply(e),s.set(i.values).invert()}screenToWorld(t,e,i){let s=t.x,n=i-t.y-1;return t.x=2*s/e-1,t.y=2*n/i-1,t.z=2*t.z-1,t.project(this.inverseProjectionView),t}worldToScreen(t,e,i){return t.project(this.projectionView),t.x=e*(t.x+1)/2,t.y=i*(t.y+1)/2,t.z=(t.z+1)/2,t}setViewport(t,e){this.viewportWidth=t,this.viewportHeight=e}},Wi=class{constructor(t){this.mouseX=0,this.mouseY=0,this.buttonDown=!1,this.touch0=null,this.touch1=null,this.initialPinchDistance=0,this.listeners=new Array,this.eventListeners=[],this.element=t,this.setupCallbacks(t)}setupCallbacks(t){let e=e=>{if(e instanceof MouseEvent){let i=t.getBoundingClientRect();this.mouseX=e.clientX-i.left,this.mouseY=e.clientY-i.top,this.listeners.map(t=>{this.buttonDown?t.dragged&&t.dragged(this.mouseX,this.mouseY):t.moved&&t.moved(this.mouseX,this.mouseY)})}},i=s=>{if(s instanceof MouseEvent){let n=t.getBoundingClientRect();this.mouseX=s.clientX-n.left,this.mouseY=s.clientY-n.top,this.buttonDown=!1,this.listeners.map(t=>{t.up&&t.up(this.mouseX,this.mouseY)}),document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",i)}};t.addEventListener("mousedown",s=>{if(s instanceof MouseEvent){let n=t.getBoundingClientRect();this.mouseX=s.clientX-n.left,this.mouseY=s.clientY-n.top,this.buttonDown=!0,this.listeners.map(t=>{t.down&&t.down(this.mouseX,this.mouseY)}),document.addEventListener("mousemove",e),document.addEventListener("mouseup",i)}},!0),t.addEventListener("mousemove",e,!0),t.addEventListener("mouseup",i,!0),t.addEventListener("wheel",t=>{t.preventDefault();let e=t.deltaY;t.deltaMode==WheelEvent.DOM_DELTA_LINE&&(e*=8),t.deltaMode==WheelEvent.DOM_DELTA_PAGE&&(e*=24),this.listeners.map(e=>{e.wheel&&e.wheel(t.deltaY)})},!0),t.addEventListener("touchstart",e=>{if(!this.touch0||!this.touch1){let i=e.changedTouches.item(0);if(!i)return;let s=t.getBoundingClientRect(),n=i.clientX-s.left,r=i.clientY-s.top,a=new qi(i.identifier,n,r);if(this.mouseX=n,this.mouseY=r,this.buttonDown=!0,this.touch0){if(!this.touch1){this.touch1=a;let t=this.touch1.x-this.touch0.x,e=this.touch1.x-this.touch0.x;this.initialPinchDistance=Math.sqrt(t*t+e*e),this.listeners.map(t=>{t.zoom&&t.zoom(this.initialPinchDistance,this.initialPinchDistance)})}}else this.touch0=a,this.listeners.map(t=>{t.down&&t.down(a.x,a.y)})}e.preventDefault()},!1),t.addEventListener("touchmove",e=>{if(this.touch0){var i=e.changedTouches;let r=t.getBoundingClientRect();for(var s=0;s{i.dragged&&i.dragged(t,e)})),this.touch1&&this.touch1.identifier===n.identifier&&(this.touch1.x=this.mouseX=t,this.touch1.y=this.mouseY=e)}if(this.touch0&&this.touch1){let t=this.touch1.x-this.touch0.x,e=this.touch1.x-this.touch0.x,i=Math.sqrt(t*t+e*e);this.listeners.map(t=>{t.zoom&&t.zoom(this.initialPinchDistance,i)})}}e.preventDefault()},!1);let s=e=>{if(this.touch0){var i=e.changedTouches;let r=t.getBoundingClientRect();for(var s=0;s{i.up&&i.up(t,e)}),!this.touch1){this.buttonDown=!1;break}this.touch0=this.touch1,this.touch1=null,this.mouseX=this.touch0.x,this.mouseX=this.touch0.x,this.buttonDown=!0,this.listeners.map(t=>{t.down&&t.down(this.touch0.x,this.touch0.y)})}this.touch1&&this.touch1.identifier&&(this.touch1=null)}}e.preventDefault()};t.addEventListener("touchend",s,!1),t.addEventListener("touchcancel",s)}addListener(t){this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>-1&&this.listeners.splice(e,1)}},qi=class{constructor(t,e,i){this.identifier=t,this.x=e,this.y=i}},Gi=class{constructor(t,e){this.canvas=t,this.camera=e;let i=0,s=0,n=0,r=0,a=0,o=0,h=0;new Wi(t).addListener({down:(t,l)=>{i=e.position.x,s=e.position.y,n=a=t,r=o=l,h=e.zoom},dragged:(h,l)=>{let c=h-n,u=l-r,d=e.screenToWorld(new Si(0,0),t.clientWidth,t.clientHeight),f=e.screenToWorld(new Si(c,u),t.clientWidth,t.clientHeight).sub(d);e.position.set(i-f.x,s-f.y,0),e.update(),a=h,o=l},wheel:i=>{let s=i/200*e.zoom,n=e.zoom+s;if(n>0){let s=0,r=0;if(i<0)s=a,r=o;else{let e=new Si(t.clientWidth/2+15,t.clientHeight/2),i=a-e.x,n=t.clientHeight-1-o-e.y;s=e.x-i,r=t.clientHeight-1-e.y+n}let h=e.screenToWorld(new Si(s,r),t.clientWidth,t.clientHeight);e.zoom=n,e.update();let l=e.screenToWorld(new Si(s,r),t.clientWidth,t.clientHeight);e.position.add(h.sub(l)),e.update()}},zoom:(t,i)=>{let s=t/i;e.zoom=h*s},up:(t,e)=>{a=t,o=e},moved:(t,e)=>{a=t,o=e}})}},ji=class{constructor(t,e,i){this.vertexShader=e,this.fragmentShader=i,this.vs=null,this.fs=null,this.program=null,this.tmp2x2=new Float32Array(4),this.tmp3x3=new Float32Array(9),this.tmp4x4=new Float32Array(16),this.vsSource=e,this.fsSource=i,this.context=t instanceof yi?t:new yi(t),this.context.addRestorable(this),this.compile()}getProgram(){return this.program}getVertexShader(){return this.vertexShader}getFragmentShader(){return this.fragmentShader}getVertexShaderSource(){return this.vsSource}getFragmentSource(){return this.fsSource}compile(){let t=this.context.gl;try{if(this.vs=this.compileShader(t.VERTEX_SHADER,this.vertexShader),!this.vs)throw new Error("Couldn't compile vertex shader.");if(this.fs=this.compileShader(t.FRAGMENT_SHADER,this.fragmentShader),!this.fs)throw new Error("Couldn#t compile fragment shader.");this.program=this.compileProgram(this.vs,this.fs)}catch(t){throw this.dispose(),t}}compileShader(t,e){let i=this.context.gl,s=i.createShader(t);if(!s)throw new Error("Couldn't create shader.");if(i.shaderSource(s,e),i.compileShader(s),!i.getShaderParameter(s,i.COMPILE_STATUS)){let t="Couldn't compile shader: "+i.getShaderInfoLog(s);if(i.deleteShader(s),!i.isContextLost())throw new Error(t)}return s}compileProgram(t,e){let i=this.context.gl,s=i.createProgram();if(!s)throw new Error("Couldn't compile program.");if(i.attachShader(s,t),i.attachShader(s,e),i.linkProgram(s),!i.getProgramParameter(s,i.LINK_STATUS)){let t="Couldn't compile shader program: "+i.getProgramInfoLog(s);if(i.deleteProgram(s),!i.isContextLost())throw new Error(t)}return s}restore(){this.compile()}bind(){this.context.gl.useProgram(this.program)}unbind(){this.context.gl.useProgram(null)}setUniformi(t,e){this.context.gl.uniform1i(this.getUniformLocation(t),e)}setUniformf(t,e){this.context.gl.uniform1f(this.getUniformLocation(t),e)}setUniform2f(t,e,i){this.context.gl.uniform2f(this.getUniformLocation(t),e,i)}setUniform3f(t,e,i,s){this.context.gl.uniform3f(this.getUniformLocation(t),e,i,s)}setUniform4f(t,e,i,s,n){this.context.gl.uniform4f(this.getUniformLocation(t),e,i,s,n)}setUniform2x2f(t,e){let i=this.context.gl;this.tmp2x2.set(e),i.uniformMatrix2fv(this.getUniformLocation(t),!1,this.tmp2x2)}setUniform3x3f(t,e){let i=this.context.gl;this.tmp3x3.set(e),i.uniformMatrix3fv(this.getUniformLocation(t),!1,this.tmp3x3)}setUniform4x4f(t,e){let i=this.context.gl;this.tmp4x4.set(e),i.uniformMatrix4fv(this.getUniformLocation(t),!1,this.tmp4x4)}getUniformLocation(t){let e=this.context.gl;if(!this.program)throw new Error("Shader not compiled.");let i=e.getUniformLocation(this.program,t);if(!i&&!e.isContextLost())throw new Error("Couldn't find location for uniform "+t);return i}getAttributeLocation(t){let e=this.context.gl;if(!this.program)throw new Error("Shader not compiled.");let i=e.getAttribLocation(this.program,t);if(-1==i&&!e.isContextLost())throw new Error("Couldn't find location for attribute "+t);return i}dispose(){this.context.removeRestorable(this);let t=this.context.gl;this.vs&&(t.deleteShader(this.vs),this.vs=null),this.fs&&(t.deleteShader(this.fs),this.fs=null),this.program&&(t.deleteProgram(this.program),this.program=null)}static newColoredTextured(t){let e=`\n\t\t\t\tattribute vec4 ${ji.POSITION};\n\t\t\t\tattribute vec4 ${ji.COLOR};\n\t\t\t\tattribute vec2 ${ji.TEXCOORDS};\n\t\t\t\tuniform mat4 ${ji.MVP_MATRIX};\n\t\t\t\tvarying vec4 v_color;\n\t\t\t\tvarying vec2 v_texCoords;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = ${ji.COLOR};\n\t\t\t\t\tv_texCoords = ${ji.TEXCOORDS};\n\t\t\t\t\tgl_Position = ${ji.MVP_MATRIX} * ${ji.POSITION};\n\t\t\t\t}\n\t\t\t`;return new ji(t,e,"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_color;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tgl_FragColor = v_color * texture2D(u_texture, v_texCoords);\n\t\t\t\t}\n\t\t\t")}static newTwoColoredTextured(t){let e=`\n\t\t\t\tattribute vec4 ${ji.POSITION};\n\t\t\t\tattribute vec4 ${ji.COLOR};\n\t\t\t\tattribute vec4 ${ji.COLOR2};\n\t\t\t\tattribute vec2 ${ji.TEXCOORDS};\n\t\t\t\tuniform mat4 ${ji.MVP_MATRIX};\n\t\t\t\tvarying vec4 v_light;\n\t\t\t\tvarying vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_light = ${ji.COLOR};\n\t\t\t\t\tv_dark = ${ji.COLOR2};\n\t\t\t\t\tv_texCoords = ${ji.TEXCOORDS};\n\t\t\t\t\tgl_Position = ${ji.MVP_MATRIX} * ${ji.POSITION};\n\t\t\t\t}\n\t\t\t`;return new ji(t,e,"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_light;\n\t\t\t\tvarying LOWP vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tvec4 texColor = texture2D(u_texture, v_texCoords);\n\t\t\t\t\tgl_FragColor.a = texColor.a * v_light.a;\n\t\t\t\t\tgl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;\n\t\t\t\t}\n\t\t\t")}static newColored(t){let e=`\n\t\t\t\tattribute vec4 ${ji.POSITION};\n\t\t\t\tattribute vec4 ${ji.COLOR};\n\t\t\t\tuniform mat4 ${ji.MVP_MATRIX};\n\t\t\t\tvarying vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = ${ji.COLOR};\n\t\t\t\t\tgl_Position = ${ji.MVP_MATRIX} * ${ji.POSITION};\n\t\t\t\t}\n\t\t\t`;return new ji(t,e,"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tgl_FragColor = v_color;\n\t\t\t\t}\n\t\t\t")}},Hi=ji;Hi.MVP_MATRIX="u_projTrans",Hi.POSITION="a_position",Hi.COLOR="a_color",Hi.COLOR2="a_color2",Hi.TEXCOORDS="a_texCoords",Hi.SAMPLER="u_texture";var Zi=class{constructor(t,e,i,s){this.attributes=e,this.verticesBuffer=null,this.verticesLength=0,this.dirtyVertices=!1,this.indicesBuffer=null,this.indicesLength=0,this.dirtyIndices=!1,this.elementsPerVertex=0,this.context=t instanceof yi?t:new yi(t),this.elementsPerVertex=0;for(let t=0;tthis.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length}setIndices(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length}draw(t,e){this.drawWithOffset(t,e,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)}drawWithOffset(t,e,i,s){let n=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?n.drawElements(e,s,n.UNSIGNED_SHORT,2*i):n.drawArrays(e,i,s),this.unbind(t)}bind(t){let e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);let i=0;for(let s=0;s0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)}unbind(t){let e=this.context.gl;for(let i=0;i0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)}update(){let t=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=t.createBuffer()),t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),t.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),t.DYNAMIC_DRAW),this.dirtyIndices=!1)}restore(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()}dispose(){this.context.removeRestorable(this);let t=this.context.gl;t.deleteBuffer(this.verticesBuffer),t.deleteBuffer(this.indicesBuffer)}},Ki=class{constructor(t,e,i){this.name=t,this.type=e,this.numElements=i}},Ji=class extends Ki{constructor(){super(Hi.POSITION,is.Float,2)}},Qi=class extends Ki{constructor(){super(Hi.POSITION,is.Float,3)}},$i=class extends Ki{constructor(t=0){super(Hi.TEXCOORDS+(0==t?"":t),is.Float,2)}},ts=class extends Ki{constructor(){super(Hi.COLOR,is.Float,4)}},es=class extends Ki{constructor(){super(Hi.COLOR2,is.Float,4)}},is=(t=>(t[t.Float=0]="Float",t))(is||{}),ss=class{constructor(t,e=!0,i=10920){if(this.drawCalls=0,this.isDrawing=!1,this.shader=null,this.lastTexture=null,this.verticesLength=0,this.indicesLength=0,this.cullWasEnabled=!1,i>10920)throw new Error("Can't have more than 10920 triangles per batch: "+i);this.context=t instanceof yi?t:new yi(t);let s=e?[new Ji,new ts,new $i,new es]:[new Ji,new ts,new $i];this.mesh=new Zi(t,s,i,3*i);let n=this.context.gl;this.srcColorBlend=n.SRC_ALPHA,this.srcAlphaBlend=n.ONE,this.dstBlend=n.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=t,this.lastTexture=null,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend),this.cullWasEnabled=e.isEnabled(e.CULL_FACE),this.cullWasEnabled&&e.disable(e.CULL_FACE)}setBlendMode(t,e,i){if((this.srcColorBlend!=t||this.srcAlphaBlend!=e||this.dstBlend!=i)&&(this.srcColorBlend=t,this.srcAlphaBlend=e,this.dstBlend=i,this.isDrawing)){this.flush(),this.context.gl.blendFuncSeparate(t,i,e,i)}}draw(t,e,i){t!=this.lastTexture?(this.flush(),this.lastTexture=t):(this.verticesLength+e.length>this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();let s=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);let n=this.mesh.getIndices();for(let t=this.indicesLength,e=0;e0||this.indicesLength>0)&&this.flush(),this.shader=null,this.lastTexture=null,this.isDrawing=!1;let t=this.context.gl;t.disable(t.BLEND),this.cullWasEnabled&&t.enable(t.CULL_FACE)}getDrawCalls(){return this.drawCalls}static getAndResetGlobalDrawCalls(){let t=ss.globalDrawCalls;return ss.globalDrawCalls=0,t}dispose(){this.mesh.dispose()}},ns=ss;ns.globalDrawCalls=0;var rs=class{constructor(t,e=10920){if(this.isDrawing=!1,this.shapeType=as.Filled,this.color=new h(1,1,1,1),this.shader=null,this.vertexIndex=0,this.tmp=new w,e>10920)throw new Error("Can't have more than 10920 triangles per batch: "+e);this.context=t instanceof yi?t:new yi(t),this.mesh=new Zi(t,[new Ji,new ts],e,0);let i=this.context.gl;this.srcColorBlend=i.SRC_ALPHA,this.srcAlphaBlend=i.ONE,this.dstBlend=i.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("ShapeRenderer.begin() has already been called");this.shader=t,this.vertexIndex=0,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend)}setBlendMode(t,e,i){if(this.srcColorBlend=t,this.srcAlphaBlend=e,this.dstBlend=i,this.isDrawing){this.flush(),this.context.gl.blendFuncSeparate(t,i,e,i)}}setColor(t){this.color.setFromColor(t)}setColorWith(t,e,i,s){this.color.set(t,e,i,s)}point(t,e,i){this.check(as.Point,1),i||(i=this.color),this.vertex(t,e,i)}line(t,e,i,s,n){this.check(as.Line,2);this.mesh.getVertices(),this.vertexIndex;n||(n=this.color),this.vertex(t,e,n),this.vertex(i,s,n)}triangle(t,e,i,s,n,r,a,o,h,l){this.check(t?as.Filled:as.Line,3);this.mesh.getVertices(),this.vertexIndex;o||(o=this.color),h||(h=this.color),l||(l=this.color),t?(this.vertex(e,i,o),this.vertex(s,n,h),this.vertex(r,a,l)):(this.vertex(e,i,o),this.vertex(s,n,h),this.vertex(s,n,o),this.vertex(r,a,h),this.vertex(r,a,o),this.vertex(e,i,h))}quad(t,e,i,s,n,r,a,o,h,l,c,u,d){this.check(t?as.Filled:as.Line,3);this.mesh.getVertices(),this.vertexIndex;l||(l=this.color),c||(c=this.color),u||(u=this.color),d||(d=this.color),t?(this.vertex(e,i,l),this.vertex(s,n,c),this.vertex(r,a,u),this.vertex(r,a,u),this.vertex(o,h,d),this.vertex(e,i,l)):(this.vertex(e,i,l),this.vertex(s,n,c),this.vertex(s,n,c),this.vertex(r,a,u),this.vertex(r,a,u),this.vertex(o,h,d),this.vertex(o,h,d),this.vertex(e,i,l))}rect(t,e,i,s,n,r){this.quad(t,e,i,e+s,i,e+s,i+n,e,i+n,r,r,r,r)}rectLine(t,e,i,s,n,r,a){this.check(t?as.Filled:as.Line,8),a||(a=this.color);let o=this.tmp.set(n-i,e-s);o.normalize(),r*=.5;let h=o.x*r,l=o.y*r;t?(this.vertex(e+h,i+l,a),this.vertex(e-h,i-l,a),this.vertex(s+h,n+l,a),this.vertex(s-h,n-l,a),this.vertex(s+h,n+l,a),this.vertex(e-h,i-l,a)):(this.vertex(e+h,i+l,a),this.vertex(e-h,i-l,a),this.vertex(s+h,n+l,a),this.vertex(s-h,n-l,a),this.vertex(s+h,n+l,a),this.vertex(e+h,i+l,a),this.vertex(s-h,n-l,a),this.vertex(e-h,i-l,a))}x(t,e,i){this.line(t-i,e-i,t+i,e+i),this.line(t-i,e+i,t+i,e-i)}polygon(t,e,i,s){if(i<3)throw new Error("Polygon must contain at least 3 vertices");this.check(as.Line,2*i),s||(s=this.color);this.mesh.getVertices(),this.vertexIndex;i<<=1;let n=t[e<<=1],r=t[e+1],a=e+i;for(let o=e,h=e+i-2;o=a?(h=n,l=r):(h=t[o+2],l=t[o+3]),this.vertex(e,i,s),this.vertex(h,l,s)}}circle(t,e,i,s,n,r=0){if(0==r&&(r=Math.max(1,6*c.cbrt(s)|0)),r<=0)throw new Error("segments must be > 0.");n||(n=this.color);let a=2*c.PI/r,o=Math.cos(a),h=Math.sin(a),l=s,u=0;if(t){this.check(as.Filled,3*r+3),r--;for(let t=0;t0;)this.vertex(b,A,l),b+=M,A+=S,M+=I,S+=k,I+=T,k+=E,this.vertex(b,A,l);this.vertex(b,A,l),this.vertex(a,o,l)}vertex(t,e,i){let s=this.vertexIndex,n=this.mesh.getVertices();n[s++]=t,n[s++]=e,n[s++]=i.r,n[s++]=i.g,n[s++]=i.b,n[s++]=i.a,this.vertexIndex=s}end(){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");this.flush();let t=this.context.gl;t.disable(t.BLEND),this.isDrawing=!1}flush(){if(0!=this.vertexIndex){if(!this.shader)throw new Error("No shader set.");this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0}}check(t,e){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");if(this.shapeType==t){if(!(this.mesh.maxVertices()-this.mesh.numVertices()(t[t.Point=0]="Point",t[t.Line=1]="Line",t[t.Filled=4]="Filled",t))(as||{}),os=class{constructor(t){this.boneLineColor=new h(1,0,0,1),this.boneOriginColor=new h(0,1,0,1),this.attachmentLineColor=new h(0,0,1,.5),this.triangleLineColor=new h(1,.64,0,.5),this.pathColor=(new h).setFromString("FF7F00"),this.clipColor=new h(.8,0,0,2),this.aabbColor=new h(0,1,0,.5),this.drawBones=!0,this.drawRegionAttachments=!0,this.drawBoundingBoxes=!0,this.drawMeshHull=!0,this.drawMeshTriangles=!0,this.drawPaths=!0,this.drawSkeletonXY=!1,this.drawClipping=!0,this.premultipliedAlpha=!1,this.scale=1,this.boneWidth=2,this.bounds=new ci,this.temp=new Array,this.vertices=m.newFloatArray(2048),this.context=t instanceof yi?t:new yi(t)}draw(t,e,i){let s=e.x,n=e.y,r=this.context.gl,a=this.premultipliedAlpha?r.ONE:r.SRC_ALPHA;t.setBlendMode(a,r.ONE,r.ONE_MINUS_SRC_ALPHA);let o=e.bones;if(this.drawBones){t.setColor(this.boneLineColor);for(let e=0,s=o.length;e-1)continue;if(!s.parent)continue;let n=s.data.length*s.a+s.worldX,r=s.data.length*s.c+s.worldY;t.rectLine(!0,s.worldX,s.worldY,n,r,this.boneWidth*this.scale)}this.drawSkeletonXY&&t.x(s,n,4*this.scale)}if(this.drawRegionAttachments){t.setColor(this.attachmentLineColor);let i=e.slots;for(let e=0,s=i.length;e0){t.setColor(this.attachmentLineColor),h=2*(h>>1);let e=a[h-2],i=a[h-1];for(let s=0,n=h;s-1||t.circle(!0,s.worldX,s.worldY,3*this.scale,this.boneOriginColor,8)}}if(this.drawClipping){let i=e.slots;t.setColor(this.clipColor);for(let e=0,s=i.length;e=0&&i==y.data.index&&(x=!0),!x){h.clipEndWithSlot(y);continue}s>=0&&s==y.data.index&&(x=!1);let v,b=y.getAttachment();if(b instanceof ne){let t=b;d.vertices=this.vertices,d.numVertices=4,d.numFloats=w<<2,t.computeWorldVertices(y,d.vertices,0,w),a=ls.QUAD_TRIANGLES,r=t.uvs,v=t.region.renderObject.page.texture,o=t.color}else{if(!(b instanceof te)){if(b instanceof Wt){let t=b;h.clipStart(y,t);continue}h.clipEndWithSlot(y);continue}{let t=b;d.vertices=this.vertices,d.numVertices=t.worldVerticesLength>>1,d.numFloats=d.numVertices*w,d.numFloats>d.vertices.length&&(d.vertices=this.vertices=m.newFloatArray(d.numFloats)),t.computeWorldVertices(y,0,t.worldVerticesLength,d.vertices,0,w),a=t.triangles,v=t.region.renderObject.page.texture,r=t.uvs,o=t.color}}if(v){let e=y.color,i=this.tempColor;i.r=p.r*e.r*o.r,i.g=p.g*e.g*o.g,i.b=p.b*e.b*o.b,i.a=p.a*e.a*o.a,l&&(i.r*=i.a,i.g*=i.a,i.b*=i.a);let s=this.tempColor2;y.darkColor?(l?(s.r=y.darkColor.r*i.a,s.g=y.darkColor.g*i.a,s.b=y.darkColor.b*i.a):s.setFromColor(y.darkColor),s.a=l?1:0):s.set(0,0,0,1);let f=y.data.blendMode;if(f!=u&&(u=f,t.setBlendMode(vi.getSourceColorGLBlendMode(u,l),vi.getSourceAlphaGLBlendMode(u),vi.getDestGLBlendMode(u))),h.isClipping()){h.clipTriangles(d.vertices,d.numFloats,a,a.length,r,i,s,c);let e=new Float32Array(h.clippedVertices),o=h.clippedTriangles;n&&n(d.vertices,d.numFloats,g),t.draw(v,e,o)}else{let e=d.vertices;if(c)for(let t=2,n=0,a=d.numFloats;t(t[t.Stretch=0]="Stretch",t[t.Expand=1]="Expand",t[t.Fit=2]="Fit",t))(ws||{}),ys=0,vs=class{constructor(t){if(this.logo=null,this.spinner=null,this.angle=0,this.fadeOut=0,this.fadeIn=0,this.timeKeeper=new y,this.backgroundColor=new h(.135,.135,.135,1),this.tempColor=new h,this.renderer=t,this.timeKeeper.maxDelta=9,!ds){let t=navigator.userAgent.indexOf("Safari")>-1,e=()=>ys++;(ds=new Image).src=As,t||(ds.crossOrigin="anonymous"),ds.onload=e,(us=new Image).src=bs,t||(us.crossOrigin="anonymous"),us.onload=e}}dispose(){var t,e;null==(t=this.logo)||t.dispose(),null==(e=this.spinner)||e.dispose()}draw(t=!1){if(ys<2||t&&this.fadeOut>1)return;this.timeKeeper.update();let e=Math.abs(Math.sin(this.timeKeeper.totalTime+.25));this.angle-=200*this.timeKeeper.delta*(1+1.5*Math.pow(e,5));let i=this.tempColor,s=this.renderer,n=s.canvas,r=s.context.gl;if(s.resize(1),s.camera.position.set(n.width/2,n.height/2,0),s.batcher.setBlendMode(r.ONE,r.ONE,r.ONE_MINUS_SRC_ALPHA),t){if(this.fadeOut+=this.timeKeeper.delta*(this.timeKeeper.totalTime<1?2:1),this.fadeOut>1)return;i.setFromColor(this.backgroundColor),e=1-this.fadeOut/1,e=1-(e-1)*(e-1),i.a*=e,i.a>0&&(s.camera.zoom=1,s.begin(),s.quad(!0,0,0,n.width,0,n.width,n.height,0,n.height,i,i,i,i),s.end())}else this.fadeIn+=this.timeKeeper.delta,this.backgroundColor.a>0&&(r.clearColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),r.clear(r.COLOR_BUFFER_BIT)),e=1;e*=Math.min(this.fadeIn/1,1),i.set(e,e,e,e),this.logo||(this.logo=new Ai(s.context,ds),this.spinner=new Ai(s.context,us)),s.camera.zoom=Math.max(1,163/n.height),s.begin(),s.drawTexture(this.logo,(n.width-165)/2,(n.height-108)/2,165,108,i),this.spinner&&s.drawTextureRotated(this.spinner,(n.width-163)/2,(n.height-163)/2,163,163,81.5,81.5,this.angle,i),s.end()}},bs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAALKElEQVR42u2de2iW5R/GPzuqcwfnnKfNmafl5tTNHWzqNi3DEMQykcAoJSsySkspjSIk0iD/07Kf4R+FnVBDUTshZGpWUEJaaiWFgZlUFmXmIe3HNXthyebeZ77P9H13ffBG8Y8H7ut7vff93N/7fu4vGGPiFZiez/Qtw9lytJajfzfw9z/j+efPOv7cV8W+lUNY2a8T/ayTCRsWFLJA5rtUO1LLkV5p9LJeJizQiHeqnlOtmVFtdTGrrZkJCxYXsTgaI6r9MY4/UpNItW4mFDaXsTlaM6qVZlBq3UwofFrJp0HMWJ9DvXUzobCznJ1BzFjWlTLrZkJh/TDWBzFjTgo51s2EgnKI0Rrx+FiOWzNzVaym91Syx5qZsGBWb2ZFa0ZN6dbMhAWTcpkUrRmXD2K5NTNhgVbH0Zpxbl/mWjMTFvRIo0e0ZpzcncnWzISKtvmiMWNRJ4qslwmVXRXsas2Ix8ZwzFqZsGFREYtaM+Oaa1ljrUzYkJ9G/ok6TlzKjJWZVFor0y7c1Zu7WjLiqiGsskamXdHopyT4vALmzS9k/t19uHtKHlOSIMn6xAtARjIZ1sFcUSZ0Y4La+G6M18hS2IlCn4a+WoC0JNL0d/dUupdnUj40g6EJ2VEdMnhrOG/p5f/jUXz8SgmvaGU6KpNRNsLVQV0OdXf24s63h/P2gWoOrBjMCr2GJFQnnxnIM3q5P1PPmaYv+4ev4/C6UtbpV2gzXCkgL5W8Bwt48OIc6ul6Tp+s4+SyASxLiI4+PYCn1bHzDZxvaQW6vZzto7MYnQIpNkf7kp5EuozYUroqEjcNKHHd0Tl9mBPN1pk+hFeieGBnBtog7UXjsj9pWg+m6duecw2cay1OC/uxMC47KmP9OIYfoz1YoC20J/rzRG4quTZK2EAyJGs20qwUbYw0aNRmUxtvfUW/uEtNzc1NB1/X8LVyd15hh82F43AvD+VlXcsSJEZa1CQ3ejleAO7oxR3RDP0XN91X4+NXYb8nkv7UNTwV7e0YTdu7I3g33t7tuaEbNwSZpps2fSyvs4M2Tjhot+jb0Xzbltj8r5j/xVt/6Z1Ob93U1ZYO691EhhzchcHeXosVjcNZysyezLw4xRZt05R+fTeuj8vOj+zKyG0j2aZcVVs6v+QalnjrMFZASQYl2nBoSyz06e3j/Xk8rgWYmMvEICu2pm1HOTuc7okV8FgRj0XukwzanhvCc/F+72TjoQjdObN1OFuDLmh0xP+WHtxiI10ukJlCprb4guiv1fP+avZrS1C7NAkliHZjDtZwMMgqbukAltpMlwuMy2FcEBPqvfLLar5Uqi0hBdEwryy+Mv5n6zkbjTBa+dlMlwvUZFETZKGiFM7tvbhdJ3gSVRO0wzIjnxmvl/J6a6JsGMYGrahtpssFeqbR841S3mhN80OjOaSDEdqd6SjaMKgzgzRK7q1ib3PT9sYyNo7JZoyNFNvRcVMZmy7WOvIuryv/Zvdmdt90+nY0bRp3AvROohFwdwW7dTG7RFlbwlqdrbOBYg005NAQmZU0HWt1rXMBH1Xw0dQ8pmqzoaPmdhun7bHZjNVe9qP9eFQfO1VkUmHjhAVUZ1GtnKFSbjrkrPfy4i4UW5t/6ZxM54J0CqxFe81KpGsQyE4h23oYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjLna+bdOy+IiFquIpGq16Pb79cNYv3IIK/X/ugx+Ui6TVKvYVU9Nc8gX8od8Ir/IN/KPfCQ/yVfyl/6/pfJvLChkQdD6wyqntquCXYuKWJSfRr6D0dEAxV3xlw/khyD+kd/ku/88cHo+09tS3LBpO1HHCVUqcIA6CqB4K+6X6x35L/JM2loXurlWmUmlA5XogOIcK8/If5HncrSWo7F6cKIWPjT/RXGOlWfkv8hzaWsN4uaaysE6WIkOKM6x8oz8F3kusXqo2vxC5jtYiQ4ozrH0TeS5qIZcrB7qkrwdA8U5Vp6R/yLPZV8V+2L14Cl5THGwEh1QnGPlGfkv8lyUlIzFQ1cNYVVHrcjZ0VCcFe9Y+Eb+izy3ceclUl43aFN52DXXssYpnY6a4qFS8ZcP2uIf+e7inRh6pdFrdTGrm8uiHx/L8T2V7NGWzvJBLJ/bl7mTuzO5qBNFDoiJID/IF/KHfCK/yDfyT3O7d/KbfNfS80hNIrU0g9L6HOq1x5iTQo6FNpeLfCQ/yVfyl3xmXYwxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHNk9z4JwJ0SqKTdQkbyEwhU393T6V7zzR6pieR3tE1ITeVXImhe6BXDGZFdRbVeank2TBhcaEMr0rwbixj49IBLL2/L/ffmMuNHfqO9tFZjJYBd1ewO3Lx+IcVfKhqna5nHZYR6XFPH+5R3eeI5t9fx/fvjeC9Jdew5OKZKqFR/RDVKL6vL/f9PJafmyvHsL+a/ff24V6NmjZQbGchVbY6UM2BluqHv1rCqzVZ1KQlkZboepCdQvacPsz5bjTfXao+yMEaDt7Wk9tSIMVGig3TejCtJSM2bSpkPjWPqd1S6Zao+lORSYWmgkOjORRNwZqd5ezMSiHLRooNr5XwWjS6/1XHX9vL2T67N7M1iyXa9JCrYjVrS1gbpJyw6hBfsmiNCYT0P9/A+Wj1/6qGr5YNYFlJBiWJogEzezLz/ZG8/9s4fgtSyuvNYbyp1IONFBtu7sHNv4/j9yAxUHWrdaWsG9+N8XHd+YxkMpSy+aySz841cC5oXbmHCnnI74yxAgZ3YbDeB4PEQCOpBpFNZWwa2ZWRcdnxLsl00crtRB0n2lLg8JNRfDKoM4NsolgBSmw/UMADba1+qpmqfyf6x1u/0a/og3I+aEunP6/i86osqmygcGarF4p54dex/Bo0LqfqOfVwIQ/HW5/RSkwV1oN2WLlHTc82TljAwM4M1O5LWwYKZTjibYXNS0N5KcjKTe10PadfLObFuJwK4ozp+UzXDBTUjL+M5ZcBnRkQV53dMIwNQTu6bSTbVEzbi5awuVByd2E/FgaN0Tc1fKOzBHHV2aAdVSdv6s5NNkp7cSH/++xAng2yyHx+CM/H21YhfdPp+0U1X0TbSZnXx8faG9Aop0MS0cToh1p+iLcpOkLj9t/JOk5eqoPHxnDsyf486an5yqCDK7XZ1O4oZ4dWyy3FSXHUAYq47uyYbMZoGmhpG3DlEFb6uNiVBhpyaHhnBO8oJmfqOROJjzIiP43hJ8UxITqqX56S2Hur2KsOnq3nrE6PPNKPRwrSKbAZrjTQNZmuE7oxYXMZmxWbw9dxWFu4W4ezVedOE6qzI7oyYkY+M7TPeWsPbk2UX1qioSN+E3OZqOR2cReKE+qQRFN0Pi7y73g/UawU1KzezJpXwLz5hczX1ueUPKYkNb6GJQZ+j7/aAfRZREsv+quGsMoamXZBW2Gt5eU0alorEzYsKmJRa/m4NdeyxlqZsCGa84DKnVorEzboC7podis69DfIJmwufHMc7famvvmxZiYsKOtKWbRm1OcW1syEBboSJFozLh/EcmtmwgIluaM14/phrLdmJixYXMTiaM24p5I91syEBTphFOR7Y2tmwgJNvUFOr+tov3UzoaAv44KYUatv62ZCoemdhtG0+hzqrZsJBR08DWLG0gxKrZu50qvpxos3U5NItW4mFPp1ot+lPlpq2lYXs9qamVBZUMiC1ox4pJYjvlfStAu6GmTLcLboMtPIV4/6im5fFfuUi9QIap2MiWP+D96R1vPmsD/fAAAAAElFTkSuQmCC",As="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKUAAABsCAYAAAALzHKmAAAQ7klEQVR42u3da4xdVRUA4D0zd2Y6nZY59DVtZ1puS9+lzC0YAi2UQ8AAQczFpPgA9VIeIQbirRqJ0cBUBVGjDr/QCKSNRSMmpuODxAdxqhgwxkhFjf6Sxh/+UUNVNGJCzR7uTvas7LXX2q9zzp3em6y0gTN3Zu75utZe5+yztxC9V+/Ve5X9En1Vjd7J6SFbLNF7naPw+l2jh7YHMBWssqMHtlsRdim4qsLtIawaPiHEQOLoNrA9iIkQDnRrVA1qD2LZ8ISoxYqKo13sQAtBWBayQWZUAXGRQM9JjCngDVY0UqJNDbQrMcaGmArdUKpIjbYiQLsCZCyIMQBy8QwnilR4Q5AuCpxFYvRFmBLbEiwKwpsSaWycVQGZBKMrwBjA9BhxDe57u2L2hOoKNCbOrgAZitEVYUxoKSMErQvSxYIzCkguRg5EF4AUhqUlhy/YUKSxcRaKsioYOQhD4I0yYxkR3PcJBcuFysmgsXAWBTMJyBCMIQh9kGGxXIXvexCQXbHGAMrBWTbM2CCpMSMLIxehC77lSJwXGth7M0FzoVJIXXDWQnGmhOkL0ic7YhhtWdGGkAuPAjUWGoF4faCmwBkbZmyUqUCyMqMLRA4+E6IsdTjidUHKBYrh9CnpRcH0ypKxsyOGEYNIIeTCOz91OIJ1QYoB5eAMyZo+MFNnyVTZ0YiRC9EGEMOyAgshxErHsL2XK1gOUgwohtM1a5YNM7Rsu4K0ZkcbRm4mpPBRwFZ5hg9eCqkrUB+csWGGogzNkqEgrdnRhpGLkINudaLgwvVB6oqzCjCTZElb2Y4B0gUjBtEG0ARnDRLjjoG9DwcshtQGlIPTljVjwUySLWNkyRCQVHa0ZUUTRAwgF91a33BEy0VKAcVwwqwZC2bqbOlUurllOxQkJzNyINoAYqjWhYYjWg5SCiiG05Q1U8FMjTIoS8YE6YORi1BHtJ4KIcQEEtTXUWAxpK44YVlPBdO1jCdFWTZIE8bVGEYMIRPcZGBw4HKQcoBiOE1ZMzbMgVQwU6JMAdKEEcuIJogUvg1YCCE2gsCO42DlIIVAKZwpYJaSLVNnSU6XjYHUmxhTmXaFaMO3EYkLqMC+FsLlIoVAKZzMrEnBhJeLfLNlKMrYWRIDCbOkFSSVHbHM6AKRC6/ODUewNqQ+OLlZkxpjUmV8MBbMUJSxyzY3Q1IgTRgxiBRCHdem0KDAUkBh9sRwwjEnAXMMgTnKhFlUtiwkS5rGka4g9SaGgxFmRC7AzTCEEBcyA36dDSsXqAtOLkysjGMwY5XxVChjZ0kuSCo7YlkRQsQQYtDEFsegsLoCxUp7Kpgps2UslFGzJGccSYHUmxhOZqwzEZqAbfUMCisHKIZzgsCpl3MTzMwTpi1bYp2477gyFKUxS7qWbdjY2EBS2dGE0QQRA7gNCyHEdhjE8RhUDlBT9tzgmjWZMFNlSy+Urk1OzCyJlW0XkK4YOQh1cDtcgwBrQmoDWkdgboBZE8mYsJSHlnFbJ+5bwmOPJ7lZkirbC8aRsMvmgtTHjBhGE0QbwJ2egUE1ITVlUC5OmDVdYNrKuN70xM6WoShjlW4464dbtiFIWK6x7GjESEHUUe0iYncnbMdQSE0Z1ITTNOb0hRmjjLtmS9dmJ2rp1jtuKktyyrb6YLEMCUHq2dGG0QQRQ7f72kzc+cJecerne8Wvv7JNPHPvenEkz8Sh3UtFc92QyGt9Yko/HgOLAIUZlItTz5ouMF3KuE+2jFLCQ1D6lm6fLMkBacuOJowYRBUXyfjuHjF3NhdnsfjvAfH6E9vFt9XxKgikEKgJZyyYalzOLeMu2bLbULI6bh+QGwmQ+rgRlumdGEQAao+K56bEL2woVUwOiev0r8OAUjiJrMmFCbvykGxZRAmPitK1dHM7bohyMsuyi/I8f0+e57fJYIKEZXpXo9E4mOf5XTKyLLvCBLETF8uY2SKepkC+dpX4T02Ivepr4HvZcOZ5fmee54fyPL+DmTUhzAs6n4n8bN5dr9f3YdkSg8nsxG0lPBVKVpNjG0/aGhzfLDmRZdnumZmZp8+c+cdZPV555fSr7Xb7s0jJ3i5Pcue4MxKkPPkvvXTqz/B92u32l0wYOzG1fkhcd/py8Rcbyq/vFM/KY1WA95h/3zzP71bfU6JsNpsfgj+P/FlbrdaDGExYyuXvLz8H+DudODH700ajcSM3W6Yu4alQ1spCOTd38jcKocTZbh9+9NixY99XJ8AEUkcpo9W64yH197m5k7+bnZ19QT+J09NHntQhwji/Jg58qi6++ofLxJ8gSFneVw2Ka4QQDfh1Ok4dZavVmtZ/nrm5k7/Vf55O1tRhboUw5+ZOvqyOl5+R/FyOHj32PYVU/tloNG5IXcKrhJIzngwp3fNjomazea/64BuNxts646f50lWv169utw9/DmtqdJQyZFaSJVuV6nq9fqMEof5/vV6/CYBqgJDlee+yAbF/+4i4ZWqZeNfaIfHWzn+Hx0KcEuU9+s8jv3ej0bhVlXOZydX/k0iRMeb8P0D5e6tj8zy/Xb9UJIc56h/yqVOnXul8lmuZ2bJslKmbHG7XrbpCmCXFRLvdfqQD6jTS3Jiy5I4OykM6ADV+1Eu1DmV6evopBORexzDi1L+X/HnGxsb2w3Hm9PSRJ9QxWPOTZdmlKht2hi+w6dkox5bqffI8fye3hDteGqKaHVsHXihKl0tB+h0cY+lute54AGRKDCW89LNTRynHb7ChUWVVjetOnJh9EYBUyPZeNCoOtsbFQwdXi4/esELcd+tq8cCHJ8UXp+viy9efLz7AgamjlKXc1AA1m83DoIRDlFubzeb96hhZLVTlgJ24gttutx+ONa50bHZKRenaeTs1OfpAfnr6yOOdE7EZdNwmlKocntXLNkA5JTGq47Ds+Lf94lWsyfnXleLfnIwJUN4DOnNYwuUxh2A3Ln9XULrfK8t3J27Tu3BVwiOjXJqoAy8UZej1yclGo3GTLN+gu3w+z/P3YaWbQqk3Ne12e4ZC+c8rxWsYytcPiP9RpZxCqWDKnxOiBNlyAUpOnGsoh4tA2Rm8X9xqtT6md5wyZmYe+0YRKL+1S/wYQ3n8zctBl5SBUv5djivfjMOPduIzcizeiYfr9foVvUwZG+XCuzibZKnSceZ5/v4QlKp8y7ElhnJlTeTP7BI/kllRYfzrfvHqFy4UX1vaL/aVlSmROzwbwdS29T2UcEwZF+V8ozM2lu1VY812u/15akypGh3TmFJesJbHHD167IdUxz3YJy5bNySuX1mbvy55CbMLtzU6tjGlsdFptVqfUMc0Go23F4wy1l2dSnbfvpMwVPe9WWVLDsrOJaF9MFu2Wq1PqmNkGce67xiXhTjdNwdlvV6/BgxfbPfBfVCetxi6b9/rlCup65QzM48dl2OjLMv26CibzeZ96sTIzEFdpwQXz9U1yrtVlpR/Zll2Fec65Y6l4pbbx8XHH9kknvzJlPjlHy8Tp29eKT5ou0aJoIT3w3dBlLDzVpfAJEZ1XOdaJZxnOSlvPMjPzxFljIvng914RwebsjYO7uhMyHu46sOfnf3Oz2TXDW6vvYxdFoIXz3Wc8J5zs9n8iOn2IrxTc2BM3Glqdp7dI553uaOjxrhwcob+MyuUpjs6WZZdon8OcigjPx8V+u+GTWFTSWEx3WYcdJ225jNDSE4q0GHCzlueHOyujn6bUWYgeb9ZZUaQPe+GzQ+Gc8+oOGhC+c1d4gfI16n3XDAhQ7+9qE9l01E2Go132GYKyXE1NiFDTcpoNpv3LOYJGWXNErJNW9sEp63p2RKiVPMn1bS1DgxsyhoGdGpmizj+xtXiDYnx7/vFmce3iWdW1cTVGEY4hQ2ZW0nNq8Qm/M6XbXm3S100lwGedFybuvNOibLI+ZS2ceU4eAxiEuvCkfmU8ycToDxETe6FgCBQHeqyAbFvfEhcO7BwDuXFCEbTZF840XeHK0jYcbs2OIGle0mVJ/mmnClEPQqxyTY5I8/zFhif7fSZee4bnrPOU4AssnRXHaVTCTd14dRDY3UbTIiSeFhsN/aMjgnqthFx880rxX3yATL5p3y4LPXzOaBkUyBjZMlYpbtQlIOBD475ZEusjMNSvkXe6VEoJVDkeZ2dzIfIFsRzU+JF2OyM9M9fTC/6SUYOyFQPjQ2nWiUjxnPfw5EeHqMWIqAeIFsAU847lJM2JM6xsewt1OIDLs99P7ZFHNdB/upS8XtPiD7PfLuCXJNolYyyFiNI/Zit65ItrOVafFbHcFohY7hPTN21Tjz4uc3iqfsnxKdX1MTl1OoYRFaMsToGB6Trw2JFP/OdZC2hJZ7ZkrMoAbbSGmelDJ91hFKuJeS7jlBMkJnrAqqJlgMUZS/dArPlGHNdSg5M3xXXtvquuEatvIYtDRhpxbUJuIgqsU5lGWtUploK0KuEU9mSW8YpmFQ556xNuYW7NiW13B+FkMiKHIy+C6eGgBxJvMR0oSv5hi6+z4HJyZoU0M2RVvDlrOQbcxVfX5AhZbuqy0v7ZstYMLHlAVlLTF9ALLbvu9Y5Zylpn/XOsd0ibIvxr2KCLHpp6SCUIdnSZSF+WzfOhem6GD+1KwR3Z4jNjrtDpNoZwmWd8yrupZN6Hx3fbMmFSe0Swdq2ZIPjxk1112Duo8OBGLrBkw/IoncdK2XHsdC9dHz204m50xh3tzFq1zFqtzHXrfCw7OgDsqyNnZLszVijsmXgrmNcmGtS78lIoMX2aJz03fKO2sDJddPQSCDPiQ1DfWBycY6XtXstc2PQKuxgG2McmXTPb9/9vmuJYXKyJrWjbeg+3xPM4O73nWqvbyw7xgZZSJbEUBa157cNJjdr2vb+5iA1YV3HxYscj30PDCEHIgcjtfm8K8hSsmRotkwFk5s1TTghUAopB6xrjHMBBkI0YYTZ0dZlxwLpkiWDULpmy5gwqayZgZNkA7oKQQCxctByYg0XIIEQQuRitGVHblMTA2ShKGPDpC6wu+DEgJqg2rDGDBtAF4Q6RAojp1xXGmSMbImVcR+YWNY04eQCtUG1ofUJ2/uvcETIgUhhdAE5GAlkKShjwHTNmhhODKgJqQ2sC14uOgyfD0IbRF+MlQaZAiZWyn2yJsTJATqGnHQO2Jhh+xlsACFCG0QbRtdyzQFZCZSxYPpmTS7Q5cjJHYNBYIkZpu99HoUQ/o4QIYSIZUZfjJ4ZMjZI32wZBDMU5yhy8pZTULl4XYP5fagMyEVoy4oupTpGduwnkloSlKEwY+AcQU4MhRTD6ovXBRwFzwWgCSEF0QVjJUGmgEllTS5OLlCIlIN1mS9mx/cZ5eLDALpCTI2RAhkTZQqYoTgpoCPECbaBHQ2ETL3PUl98ECAXYijG0OyYAmQoTG7W5ODkAF1CnVgm2JQx4okPA+gCMTbGskBGgRmaOblAh5GTORIrfKFx4VH4EIAxIXIxlg2SBbMvECY3e7oApbDaIgQu5/2HmeEKEINYiwSRi7EQkLFgumZOCuggctKGI4ULZN/vMeSLj0AYMytWEqMLzFg4fYDaoKaC6wvOFR4FkIPQFaILxrJAOsHsc/zlfYDWXE8qF22s8Pz5KHxcgEVALBtjJXBSSEOwFhk1Zgy4hitCT4hVw+gFs8/zwxqIBbUgyK7fcyA0PD9XX4iVxhiC0xdof6STWCsoBmKF7+cVCWFXQYyBMxRpf+STX1b0x45AhN0OMSrOGEirhrY/dfQAdjvS7oy+WCF6r1RIFxXWvlTRg1YVqFWBmxZbD99ig9pt0YPQw9rD1nstVri9V+/Ve3XrS/wfim4P5fIFxLoAAAAASUVORK5CYII=",Ms=class{constructor(t,e){this.time=new y,e.pathPrefix||(e.pathPrefix=""),e.app||(e.app={loadAssets:()=>{},initialize:()=>{},update:()=>{},render:()=>{},error:()=>{}}),e.webglConfig&&(e.webglConfig={alpha:!0}),this.htmlCanvas=t,this.context=new yi(t,e.webglConfig),this.renderer=new xs(t,this.context),this.gl=this.context.gl,this.assetManager=new Mi(this.context,e.pathPrefix),this.input=new Wi(t),e.app.loadAssets&&e.app.loadAssets(this);let i=()=>{requestAnimationFrame(i),this.time.update(),e.app.update&&e.app.update(this,this.time.delta),e.app.render&&e.app.render(this)},s=()=>{this.assetManager.isLoadingComplete()?this.assetManager.hasErrors()?e.app.error&&e.app.error(this,this.assetManager.getErrors()):(e.app.initialize&&e.app.initialize(this),i()):requestAnimationFrame(s)};requestAnimationFrame(s)}clear(t,e,i,s){this.gl.clearColor(t,e,i,s),this.gl.clear(this.gl.COLOR_BUFFER_BIT)}};return fs=n,((n,r,a,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let h of i(r))s.call(n,h)||h===a||t(n,h,{get:()=>r[h],enumerable:!(o=e(r,h))||o.enumerable});return n})(t({},"__esModule",{value:!0}),fs)})();t.exports=e}).call(window)},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var s=i(0),n=i(11),r=i(212),a=i(7),o=i(224),h=i(225),l=i(226),c=new s({Extends:h,initialize:function(t,e,i,s,r,c,u){var d,f,p,m=[],g=t.cacheManager.custom.spine;if(a(e)){var x=e;for(e=n(x,"key"),f=new o(t,{key:e,url:n(x,"jsonURL"),extension:n(x,"jsonExtension","json"),xhrSettings:n(x,"jsonXhrSettings")}),s=n(x,"atlasURL"),r=n(x,"preMultipliedAlpha"),Array.isArray(s)||(s=[s]),d=0;d - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(12),r=i(24),a=i(25),o=i(11),h=i(7),l=i(48),c=new s({Extends:r,initialize:function t(e,i,s,n,a){var l,c="png";if(h(i)){var u=i;i=o(u,"key"),s=o(u,"url"),l=o(u,"normalMap"),n=o(u,"xhrSettings"),c=o(u,"extension",c),a=o(u,"frameConfig")}Array.isArray(s)&&(l=s[1],s=s[0]);var d={type:"image",cache:e.textureManager,extension:c,responseType:"blob",key:i,url:s,xhrSettings:n,config:a};if(r.call(this,e,d),l){var f=new t(e,this.key,l,n,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=n.FILE_PROCESSING,t===n.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=n.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=n.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t?t.state>=n.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var s=0;s - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="addfile"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="complete"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="filecomplete"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="filecomplete-"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="loaderror"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="load"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="fileprogress"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="postprocess"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="progress"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="start"},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(49);t.exports=function(t,e){var i=s(e,t.xhrSettings),n=new XMLHttpRequest;if(n.open("GET",t.src,i.async,i.user,i.password),n.responseType=t.xhrSettings.responseType,n.timeout=i.timeout,i.headers)for(var r in i.headers)n.setRequestHeader(r,i.headers[r]);return i.header&&i.headerValue&&n.setRequestHeader(i.header,i.headerValue),i.requestedWith&&n.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&n.overrideMimeType(i.overrideMimeType),i.withCredentials&&(n.withCredentials=!0),n.onload=t.onLoad.bind(t,n),n.onerror=t.onError.bind(t,n),n.onprogress=t.onProgress.bind(t),n.send(),n}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(12),r=i(24),a=i(25),o=i(11),h=i(10),l=i(7),c=new s({Extends:r,initialize:function(t,e,i,s,a){var c="json";if(l(e)){var u=e;e=o(u,"key"),i=o(u,"url"),s=o(u,"xhrSettings"),c=o(u,"extension",c),a=o(u,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:c,responseType:"text",key:e,url:i,xhrSettings:s,config:a};r.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=n.FILE_POPULATED)},onProcess:function(){if(this.state!==n.FILE_POPULATED){this.state=n.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(12),r=i(47),a=new s({initialize:function(t,e,i,s){var r=[];s.forEach((function(t){t&&r.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=r,this.state=n.FILE_PENDING,this.complete=!1,this.pending=r.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(12),r=i(24),a=i(25),o=i(11),h=i(7),l=new s({Extends:r,initialize:function(t,e,i,s){var n="text",a="txt",l=t.cacheManager.text;if(h(e)){var c=e;e=o(c,"key"),i=o(c,"url"),s=o(c,"xhrSettings"),a=o(c,"extension",a),n=o(c,"type",n),l=o(c,"cache",l)}var u={type:n,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var s=0;s - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var s=i(31),n=i(1),r=i(0),a=i(51),o=i(52),h=i(53),l=i(54),c=i(55),u=i(56),d=i(8),f=i(21),p=i(57),m=i(9),g=i(249),x=i(256),w=new r({Extends:p,Mixins:[a,o,h,l,c,u,x],initialize:function(t,e,i,s,n,r,a){p.call(this,t,"Spine"),this.plugin=e,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null,this.root=null,this.bounds=null,this.drawDebug=!1,this.timeScale=1,this.displayOriginX=0,this.displayOriginY=0,this.preMultipliedAlpha=!1,this.blendMode=-1,this.setPosition(i,s),n&&this.setSkeleton(n,r,a)},willRender:function(t,e){var i=!this.skeleton||!(15!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id);if(!e&&!i&&this.parentContainer){var s=this.plugin,n=s.sceneRenderer;s.gl&&n.batcher.isDrawing&&(n.end(),s.renderer.pipelines.rebind())}return i},setAlpha:function(t,e){if(void 0===t&&(t=1),e){var i=this.findSlot(e);i&&(i.color.a=n(t,0,1))}else this.alpha=t;return this},alpha:{get:function(){return this.skeleton.color.a},set:function(t){var e=n(t,0,1);this.skeleton&&(this.skeleton.color.a=e),0===e?this.renderFlags&=-3:this.renderFlags|=2}},red:{get:function(){return this.skeleton.color.r},set:function(t){var e=n(t,0,1);this.skeleton&&(this.skeleton.color.r=e)}},green:{get:function(){return this.skeleton.color.g},set:function(t){var e=n(t,0,1);this.skeleton&&(this.skeleton.color.g=e)}},blue:{get:function(){return this.skeleton.color.b},set:function(t){var e=n(t,0,1);this.skeleton&&(this.skeleton.color.b=e)}},setColor:function(t,e){void 0===t&&(t=16777215);var i=(t>>16&255)/255,s=(t>>8&255)/255,n=(255&t)/255,r=t>16777215?(t>>>24)/255:null,a=this.skeleton;if(e){var o=this.findSlot(e);o&&(a=o)}return a.color.r=i,a.color.g=s,a.color.b=n,null!==r&&(a.color.a=r),this},setSkeletonFromJSON:function(t,e,i,s){return this.setSkeleton(t,e,i,s)},setSkeleton:function(t,e,i,s){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var n=this.plugin.createSkeleton(t,s);this.skeletonData=n.skeletonData,this.preMultipliedAlpha=n.preMultipliedAlpha;var r=n.skeleton;return r.setSkin(),r.setToSetupPose(),this.skeleton=r,n=this.plugin.createAnimationState(r),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=n.state,this.stateData=n.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=m(d(this.rotation))+90),this.state.apply(r),r.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=m(d(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,s){var n=this.skeleton;return void 0===t&&(t=n.data.width),void 0===e&&(e=n.data.height),void 0===i&&(i=0),void 0===s&&(s=0),this.width=t,this.height=e,this.displayOriginX=n.x-i,this.displayOriginY=n.y-s,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,s=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var n=this.getBounds();return this.width=n.size.x,this.height=n.size.y,this.displayOriginX=this.x-n.offset.x,this.displayOriginY=this.y-(e-(this.height+n.offset.y)),t.scaleX=i,t.scaleY=s,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(229),r=new s({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(n.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],s=0;s - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={CHANGE_DATA:i(230),CHANGE_DATA_KEY:i(231),DESTROY:i(232),REMOVE_DATA:i(233),SET_DATA:i(234)}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="changedata"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="changedata-"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="destroy"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="removedata"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="setdata"},function(t,e,i){"use strict";var s=Object.prototype.hasOwnProperty,n="~";function r(){}function a(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,i,s,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new a(i,s||t,r),h=n?n+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function l(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),l.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)s.call(t,e)&&i.push(n?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},l.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var s=0,r=i.length,a=new Array(r);s - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="addedtoscene"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="destroy"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="removedfromscene"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="complete"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="created"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="error"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="loop"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="play"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="seeked"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="seeking"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="stop"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="timeout"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="unlocked"},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={COMPLETE:i(250),DISPOSE:i(251),END:i(252),EVENT:i(253),INTERRUPTED:i(254),START:i(255)}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="complete"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="dispose"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="end"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="event"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="interrupted"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="start"},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var s=i(2),n=i(2),r=i(2);s=i(257),r=i(258),n=i(259),t.exports={renderWebGL:s,renderCanvas:n,renderDirect:r}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var s=i(1),n=i(8),r=i(60),a=i(9),o=i(6);t.exports=function(t,e,i,h,l){var c=e.plugin,u=e.skeleton,d=c.sceneRenderer;t.newType&&(t.pipelines.clear(),d.begin());var f=e.scrollFactorX,p=e.scrollFactorY,m=u.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,u.color.a=s(m*l.alpha,0,1)),i.addToRenderList(e);var g=r(e,i,h).calc,x=t.height;if(u.x=g.tx,u.y=x-g.ty,u.scaleX=g.scaleX,u.scaleY=g.scaleY,e.scaleX<0?(u.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(n(g.rotationNormalized))+90,0,360),e.scaleY<0&&(u.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),u.updateWorldTransform(),d.drawSkeleton(u,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,u.color.a=m),c.drawDebug||e.drawDebug){var w=u.x,y=u.y;u.x=0,u.y=0,d.drawSkeletonDebug(u,e.preMultipliedAlpha),u.x=w,u.y=y}t.nextTypeMatch||(d.end(),t.pipelines.rebind())}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var s=i(1),n=i(8),r=i(60),a=i(9),o=i(6);t.exports=function(t,e,i,h,l){var c=e.plugin,u=e.skeleton,d=c.sceneRenderer;t.pipelines.clear(),d.begin();var f=e.scrollFactorX,p=e.scrollFactorY,m=u.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,u.color.a=s(m*l.alpha,0,1)),i.addToRenderList(e);var g=r(e,i,h).calc,x=t.height;if(u.x=g.tx,u.y=x-g.ty,u.scaleX=g.scaleX,u.scaleY=g.scaleY,e.scaleX<0?(u.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(n(g.rotationNormalized))+90,0,360),e.scaleY<0&&(u.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),u.updateWorldTransform(),d.drawSkeleton(u,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,u.color.a=m),c.drawDebug||e.drawDebug){var w=u.x,y=u.y;u.x=0,u.y=0,d.drawSkeletonDebug(u,e.preMultipliedAlpha),u.x=w,u.y=y}d.end(),t.pipelines.rebind()}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var s=i(8),n=i(9),r=i(6);t.exports=function(t,e,i,a){var o=t.currentContext,h=e.plugin,l=e.skeleton,c=h.skeletonRenderer,u=t._tempMatrix1,d=t._tempMatrix2,f=t._tempMatrix3;i.addToRenderList(e),d.applyITRS(e.x,e.y,e.rotation,Math.abs(e.scaleX),Math.abs(e.scaleY)),u.copyFrom(i.matrix),a?(u.multiplyWithOffset(a,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),d.e=e.x,d.f=e.y,u.multiply(d,f)):(d.e-=i.scrollX*e.scrollFactorX,d.f-=i.scrollY*e.scrollFactorY,u.multiply(d,f)),l.x=f.tx,l.y=f.ty,l.scaleX=f.scaleX,l.scaleY=-1*f.scaleY,e.scaleX<0?(l.scaleX*=-1,e.root.rotation=n(f.rotationNormalized)):e.root.rotation=r(n(s(f.rotationNormalized))+90,0,360),e.scaleY<0&&(l.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*n(f.rotationNormalized):e.root.rotation+=2*n(f.rotationNormalized)),i.renderToTexture&&(l.y=f.ty,l.scaleY*=-1),l.updateWorldTransform(),c.ctx=o,c.debugRendering=h.drawDebug||e.drawDebug,o.save(),c.draw(l),o.restore()}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var s=i(0),n=i(261),r=i(347),a=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r){n.call(this,t,i,s,r),this.type="Spine",this.plugin=e},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null,this.plugin=null}});t.exports=a},function(t,e,i){ -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(262),n=i(15),r=i(0),a=i(313),o=i(59),h=i(57),l=i(29),c=i(343),u=i(346),d=i(3),f=new r({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.Pipeline,a.Transform,a.Visible,c],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPipeline(),this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(n.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,n=!1;t.setEmpty();for(var r=0;r-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){var i,s=[null],n=this.list.slice(),r=n.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Matrix:i(263),Add:i(272),AddAt:i(273),BringToTop:i(274),CountAllMatching:i(275),Each:i(276),EachInRange:i(277),FindClosestInSorted:i(278),Flatten:i(279),GetAll:i(280),GetFirst:i(281),GetRandom:i(282),MoveDown:i(283),MoveTo:i(284),MoveUp:i(285),MoveAbove:i(286),MoveBelow:i(287),NumberArray:i(288),NumberArrayStep:i(289),QuickSelect:i(290),Range:i(291),Remove:i(292),RemoveAt:i(293),RemoveBetween:i(294),RemoveRandomElement:i(295),Replace:i(296),RotateLeft:i(62),RotateRight:i(63),SafeRange:i(5),SendToBack:i(297),SetAll:i(298),Shuffle:i(64),SortByDigits:i(299),SpliceOne:i(13),StableSort:i(300),Swap:i(312)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={CheckMatrix:i(27),MatrixToString:i(264),ReverseColumns:i(266),ReverseRows:i(267),Rotate180:i(268),RotateLeft:i(269),RotateMatrix:i(17),RotateRight:i(270),Translate:i(271),TransposeMatrix:i(61)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(265),n=i(27);t.exports=function(t){var e="";if(!n(t))return e;for(var i=0;i=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((n=e-t.length)/2);t=new Array(n-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;e - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(17);t.exports=function(t){return s(t,180)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(17);t.exports=function(t){return s(t,90)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(17);t.exports=function(t){return s(t,-90)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(62),n=i(63);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?s(t,Math.abs(i)):n(t,i)),0!==e)for(var r=0;r0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(n,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>r&&(e.splice(r),a=r);for(var o=0;o0){var a=s-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),n&&n.call(r,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;s>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),n&&n.call(r,l)}return e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(5);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var a=0;if(s(t,n,r))for(var o=n;o - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(5);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r)){var a,o=[null];for(a=5;ae.length&&(r=e.length),i?(s=e[r-1][i],(n=e[r][i])-t<=t-s?e[r]:e[r-1]):(s=e[r-1],(n=e[r])-t<=t-s?n:s)}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i=function(t,e){void 0===e&&(e=[]);for(var s=0;s - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(5);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var a=[];if(s(t,n,r))for(var o=n;o - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(5);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var a=n;a0){var s=t[i-1],n=t.indexOf(s);t[i]=s,t[n]=e}return t}},function(t,e){t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&in||(t.splice(s,1),n===t.length-1?t.push(e):t.splice(n,0,e)),t}},function(t,e){t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s=e;n--)a?r.push(i+n.toString()+s):r.push(n);else for(n=t;n<=e;n++)a?r.push(i+n.toString()+s):r.push(n);return r}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(43);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var n=[],r=Math.max(s((e-t)/(i||1)),0),a=0;a - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -function i(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function s(t,e){return te?1:0}var n=function(t,e,r,a,o){for(void 0===r&&(r=0),void 0===a&&(a=t.length-1),void 0===o&&(o=s);a>r;){if(a-r>600){var h=a-r+1,l=e-r+1,c=Math.log(h),u=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*u*(h-u)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(e-l*u/h+d)),p=Math.min(a,Math.floor(e+(h-l)*u/h+d));n(t,e,f,p,o)}var m=t[e],g=r,x=a;for(i(t,r,e),o(t[a],m)>0&&i(t,r,a);g0;)x--}0===o(t[r],m)?i(t,r,x):i(t,++x,a),x<=e&&(r=x+1),e<=x&&(a=x-1)}};t.exports=n},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(10),n=i(64),r=function(t,e,i){for(var s=[],n=0;n - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(13);t.exports=function(t,e,i,n){var r;if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(s(t,r),i&&i.call(n,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(r=t.indexOf(h))&&(s(t,r),o.push(h),i&&i.call(n,h)),a--}return o}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(13);t.exports=function(t,e,i,n){if(void 0===n&&(n=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(5);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),s(t,e,i)){var a=i-e,o=t.splice(e,a);if(n)for(var h=0;h - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(13);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return s(t,n)}},function(t,e){t.exports=function(t,e,i){var s=t.indexOf(e),n=t.indexOf(i);return-1!==s&&-1===n&&(t[s]=i,!0)}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(5);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var a=n;a - * @author Angry Bytes (and contributors) - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(301);function n(t,e){return String(t).localeCompare(e)}function r(t,e,i,s){var n,r,a,o,h,l=t.length,c=0,u=2*i;for(n=0;nl&&(r=l),a>l&&(a=l),o=n,h=r;;)if(o - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={os:i(28),browser:i(18),features:i(303),input:i(307),audio:i(308),video:i(309),fullscreen:i(310),canvasFeatures:i(311)}},function(t,e){var i,s,n=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{s="function"==typeof clearTimeout?clearTimeout:a}catch(t){s=a}}();var h,l=[],c=!1,u=-1;function d(){c&&h&&(c=!1,h.length?l=h.concat(l):u=-1,l.length&&f())}function f(){if(!c){var t=o(d);c=!0;for(var e=l.length;e;){for(h=l,l=[];++u1)for(var i=1;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(28),n=i(18),r=i(65),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=r.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=r.create2D(this),s=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=s.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,n.firefox&&n.firefoxVersion<21&&(a.getUserMedia=!1),!s.iOS&&(n.ie||n.firefox||n.chrome)&&(a.canvasBitBltShift=!0),(n.safari||n.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s={VERSION:"3.60.0-beta.18",BlendModes:i(15),ScaleModes:i(305),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i,s="";t.exports={disable:function(t){return""===s&&(s=i(t)),s&&(t[s]=!1),t},enable:function(t){return""===s&&(s=i(t)),s&&(t[s]=!0),t},getPrefix:i=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(18),n={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(n.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(n.mspointer=!0),navigator.getGamepads&&(n.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?n.wheelEvent="wheel":"onmousewheel"in window?n.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(n.wheelEvent="DOMMouseScroll")),n)},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(18),n={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return n;n.audioData=!!window.Audio,n.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var s=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(s||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(s)};if(n.ogg=i('ogg; codecs="vorbis"'),n.opus=i('ogg; codecs="opus"',"opus"),n.mp3=i("mpeg"),n.wav=i("wav"),n.m4a=i("x-m4a"),n.aac=i("aac"),n.flac=i("flac","x-flac"),n.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(s.edge)n.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var r=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===r&&a>=11||r>10)&&(n.dolby=!0)}}}catch(t){}return n}()},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return i;var t=document.createElement("video"),e=!!t.canPlayType,s=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(s,"")&&(i.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(s,"")&&(i.h264=!0,i.mp4=!0),t.canPlayType("video/x-m4v").replace(s,"")&&(i.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(s,"")&&(i.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(s,"")&&(i.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(s,"")&&(i.hls=!0))}catch(t){}return i}()},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return i;var t,e="Fullscreen",s="FullScreen",n=["request"+e,"request"+s,"webkitRequest"+e,"webkitRequest"+s,"msRequest"+e,"msRequest"+s,"mozRequest"+s,"mozRequest"+e];for(t=0;t - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s,n,r,a=i(65),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",n="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+n},r.src=s+"AP804Oa6"+n,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),s=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),s}()),o)},function(t,e){t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return t[s]=i,t[n]=e,t}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Alpha:i(314),AlphaSingle:i(315),BlendMode:i(316),ComputedSize:i(51),Crop:i(317),Depth:i(52),Flip:i(53),FX:i(318),GetBounds:i(319),Mask:i(328),Origin:i(333),PathFollower:i(334),Pipeline:i(337),ScrollFactor:i(54),Size:i(339),Texture:i(340),TextureCrop:i(341),Tint:i(342),ToJSON:i(58),Transform:i(55),TransformMatrix:i(26),Visible:i(56)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(1),n={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,n){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(n,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=n},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(1),n={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=n},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(15),n={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=n},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={fxPadding:0,setFXPadding:function(t){return void 0===t&&(t=0),this.fxPadding=t,this},onFXCopy:function(){},onFX:function(){}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(29),n=i(42),r=i(3),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,n,r,a,o,h,l;if(void 0===t&&(t=new s),this.parentContainer){var c=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),c.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),c.transformPoint(t.x,t.y,t),n=t.x,r=t.y,this.getBottomLeft(t),c.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),c.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),n=t.x,r=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,n,a,h),t.y=Math.min(i,r,o,l),t.width=Math.max(e,n,a,h)-t.x,t.height=Math.max(i,r,o,l)-t.y,t}};t.exports=a},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(66),n=i(67);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=n(t)/i);for(var a=0;a - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(323),r=i(324),a=i(30),o=i(326),h=i(3),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(14);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(325),n=i(14);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=s(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,c=0;c - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(14);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(14);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(329),n=i(332),r={mask:null,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},createBitmapMask:function(t,e,i,n,r){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new s(this.scene,t,e,i,n,r)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new n(this.scene,t)}};t.exports=r},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(330),r=new s({initialize:function(t,e,i,s,n,r){e||(e=t.sys.make.image({x:i,y:s,key:n,frame:r,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});n.register("bitmapMask",(function(t,e,i,s,n){return new r(this.scene,t,e,i,s,n)})),t.exports=r},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(331),r=i(23),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},n.register("GameObjectFactory",a,"add"),t.exports=a},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={},s={},n={register:function(t,e,s,n){void 0===n&&(n=!1),i[t]={plugin:e,mapping:s,custom:n}},registerCustom:function(t,e,i,n){s[t]={plugin:e,mapping:i,data:n}},hasCore:function(t){return i.hasOwnProperty(t)},hasCustom:function(t){return s.hasOwnProperty(t)},getCore:function(t){return i[t]},getCustom:function(t){return s[t]},getCustomClass:function(t){return s.hasOwnProperty(t)?s[t].plugin:null},remove:function(t){i.hasOwnProperty(t)&&delete i[t]},removeCustom:function(t){s.hasOwnProperty(t)&&delete s[t]},destroyCorePlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]},destroyCustomPlugins:function(){for(var t in s)s.hasOwnProperty(t)&&delete s[t]}};t.exports=n},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=new(i(0))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,n=this.geometryMask,r=t.maskCount;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,r,255),s.stencilOp(s.KEEP,s.KEEP,s.INCR)):(s.stencilFunc(s.EQUAL,r+1,255),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),n.renderWebGL(t,n,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),i?this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r+1,255):s.stencilFunc(s.EQUAL,r+1,255):this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r,255):s.stencilFunc(s.EQUAL,r,255)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(21),n=i(335),r=i(10),a=i(336),o=i(3),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=r(t,"from",0),t.to=r(t,"to",1);var h=n(t,"positionOnPath",!1);this.rotateToPath=n(t,"rotateToPath",!1),this.pathRotationOffset=r(t,"rotationOffset",0);var l=r(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var c=this.path.getPoint(.1);this.rotation=Math.atan2(c.y-this.y,c.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,n=this.pathVector;if(i.copy(n).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,n),i.add(n),n.add(this.pathOffset),void this.setPosition(n.x,n.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),n),i.add(n),n.add(this.pathOffset);var r=this.x,o=this.y;this.setPosition(n.x,n.y);var h=this.x-r,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+s(this.pathRotationOffset))}}};t.exports=h},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(338),n=i(13),r={defaultPipeline:null,pipeline:null,hasPostPipeline:!1,postPipelines:null,pipelineData:null,initPipeline:function(t){var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(this.postPipelines=[],this.pipelineData={},i){void 0===t&&(t=i.default);var s=i.get(t);if(s)return this.defaultPipeline=s,this.pipeline=s,!0}return!1},setPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){var a=r.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?s(e):e)}return this},setPostPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){Array.isArray(t)||(t=[t]);for(var a=0;a0,this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,s=[],n=0;n=0;i--){var s=e[i];("string"==typeof t&&s.name===t||"string"!=typeof t&&s instanceof t)&&(s.destroy(),n(e,i))}return this.hasPostPipeline=this.postPipelines.length>0,this},getPipelineName:function(){return this.pipeline.name}};t.exports=r},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i=function(t){var e,s,n;if("object"!=typeof t||null===t)return t;for(n in e=Array.isArray(t)?[]:{},t)s=t[n],e[n]=i(s);return e};t.exports=i},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(68),n={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=n},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(68),n={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=n},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,s=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=s,this.tintFill=!1,this},setTintFill:function(t,e,i,s){return this.setTint(t,e,i,s),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this.tintFill||16777215!==this.tintTopLeft||16777215!==this.tintTopRight||16777215!==this.tintBottomLeft||16777215!==this.tintBottomRight}}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(2),n=s,r=s;n=i(344),r=i(345),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list,r=n.length;if(0!==r){var a=e.localTransform;s?(a.loadIdentity(),a.multiply(s),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var o=-1!==e.blendMode;o||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,c=e.scrollFactorY,u=0;u - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(29);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-n,o=Math.max(t.bottom,e.bottom)-r;return i.setTo(n,r,a,o)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(2),n=i(2);s=i(348),n=i(349),t.exports={renderWebGL:s,renderCanvas:n}},function(t,e){t.exports=function(t,e,i,s){var n=e.plugin.sceneRenderer,r=e.list;if(0!==r.length){i.addToRenderList(e);var a=e.localTransform;s?(a.loadIdentity(),a.multiply(s),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.newType&&(t.pipelines.clear(),n.begin());var o=t.nextTypeMatch;t.nextTypeMatch=!0,t.newType=!1;for(var h=0;h{var t={4399:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function n(t,e,s,n,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new r(s,n||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,s,r=[];if(0===this._eventsCount)return r;for(s in t=this._events)e.call(t,s)&&r.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var r=0,n=s.length,a=new Array(n);r{(function(){"use strict";var e=(()=>{var t=Object.defineProperty,e=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,r={};((e,i)=>{for(var s in i)t(e,s,{get:i[s],enumerable:!0})})(r,{AlphaTimeline:()=>ft,Animation:()=>k,AnimationState:()=>Rt,AnimationStateAdapter:()=>Xt,AnimationStateData:()=>_t,AssetManager:()=>bi,AssetManagerBase:()=>ce,AtlasAttachmentLoader:()=>ne,Attachment:()=>b,AttachmentTimeline:()=>gt,BinaryInput:()=>Pe,BlendMode:()=>Re,Bone:()=>he,BoneData:()=>ae,BoundingBoxAttachment:()=>Ut,CURRENT:()=>Nt,CanvasTexture:()=>yi,ClippingAttachment:()=>Wt,Color:()=>h,ConstraintData:()=>le,CurveTimeline:()=>Q,CurveTimeline1:()=>$,CurveTimeline2:()=>tt,DebugUtils:()=>g,DeformTimeline:()=>xt,Downloader:()=>ue,DrawOrderTimeline:()=>bt,Event:()=>de,EventData:()=>fe,EventQueue:()=>Yt,EventTimeline:()=>vt,EventType:()=>Pt,FIRST:()=>Ot,FakeTexture:()=>Zt,HOLD_FIRST:()=>Bt,HOLD_MIX:()=>Vt,HOLD_SUBSEQUENT:()=>Dt,IkConstraint:()=>pe,IkConstraintData:()=>me,IkConstraintTimeline:()=>At,IntSet:()=>n,Interpolation:()=>u,MathUtils:()=>c,MeshAttachment:()=>te,MixBlend:()=>C,MixDirection:()=>R,PathAttachment:()=>ee,PathConstraint:()=>be,PathConstraintData:()=>ge,PathConstraintMixTimeline:()=>Et,PathConstraintPositionTimeline:()=>Mt,PathConstraintSpacingTimeline:()=>It,PointAttachment:()=>ie,Pool:()=>x,PositionMode:()=>xe,Pow:()=>d,PowOut:()=>f,RGB2Timeline:()=>mt,RGBA2Timeline:()=>pt,RGBATimeline:()=>ut,RGBTimeline:()=>dt,RegionAttachment:()=>re,RotateMode:()=>ve,RotateTimeline:()=>et,SETUP:()=>zt,SUBSEQUENT:()=>Lt,ScaleTimeline:()=>nt,ScaleXTimeline:()=>at,ScaleYTimeline:()=>ot,SequenceTimeline:()=>kt,ShearTimeline:()=>ht,ShearXTimeline:()=>lt,ShearYTimeline:()=>ct,Skeleton:()=>Ie,SkeletonBinary:()=>Ye,SkeletonBounds:()=>ci,SkeletonClipping:()=>di,SkeletonData:()=>Ee,SkeletonJson:()=>fi,SkeletonRenderer:()=>Mi,Skin:()=>ke,SkinEntry:()=>Te,Slot:()=>Ae,SlotData:()=>Ce,SpacingMode:()=>we,StringSet:()=>a,Texture:()=>qt,TextureAtlas:()=>Kt,TextureAtlasPage:()=>Qt,TextureAtlasRegion:()=>$t,TextureFilter:()=>Gt,TextureRegion:()=>Ht,TextureWrap:()=>jt,TimeKeeper:()=>v,Timeline:()=>J,TrackEntry:()=>Ft,TransformConstraint:()=>Se,TransformConstraintData:()=>Fe,TransformConstraintTimeline:()=>St,TransformMode:()=>oe,TranslateTimeline:()=>it,TranslateXTimeline:()=>st,TranslateYTimeline:()=>rt,Triangulator:()=>ui,Utils:()=>m,Vector2:()=>w,VertexAttachment:()=>S,WindowedMean:()=>y});var n=class{constructor(){this.array=new Array}add(t){let e=this.contains(t);return this.array[0|t]=0|t,!e}contains(t){return null!=this.array[0|t]}remove(t){this.array[0|t]=void 0}clear(){this.array.length=0}},a=class{constructor(){this.entries={},this.size=0}add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var i=0,s=t.length;i1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}static fromString(t){return(new o).setFromString(t)}},h=o;h.WHITE=new o(1,1,1,1),h.RED=new o(1,0,0,1),h.GREEN=new o(0,1,0,1),h.BLUE=new o(0,0,1,1),h.MAGENTA=new o(1,0,1,1);var l=class{static clamp(t,e,i){return ti?i:t}static cosDeg(t){return Math.cos(t*l.degRad)}static sinDeg(t){return Math.sin(t*l.degRad)}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return l.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,i){let s=Math.random(),r=e-t;return s<=(i-t)/r?t+Math.sqrt(s*r*(i-t)):e-Math.sqrt((1-s)*r*(e-i))}static isPowerOfTwo(t){return t&&0==(t&t-1)}},c=l;c.PI=3.1415927,c.PI2=2*l.PI,c.radiansToDegrees=180/l.PI,c.radDeg=l.radiansToDegrees,c.degreesToRadians=l.PI/180,c.degRad=l.degreesToRadians;var u=class{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}},d=class extends u{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}},f=class extends d{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}},p=class{static arrayCopy(t,e,i,s,r){for(let n=e,a=s;n=e?t:p.setArraySize(t,e,i)}static newArray(t,e){let i=new Array(t);for(let s=0;s0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},y=class{constructor(t=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let e=0;e>1)*n;let a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(!l){o.length>0&&(h=o);let a=t.bone,l=a.worldX,c=a.worldY,u=a.a,d=a.b,f=a.c,p=a.d;for(let t=e,a=r;a=this.regions.length&&(i=this.regions.length-1);let s=this.regions[i];e.region!=s&&(e.region=s,e.updateRegion())}getPath(t,e){let i=t,s=(this.start+e).toString();for(let t=this.digits-s.length;t>0;t--)i+="0";return i+=s,i}static nextID(){return M._nextID++}},I=M;I._nextID=0;var E=(t=>(t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse",t))(E||{}),T=[0,1,2,3,4,5,6],k=class{constructor(t,e,i){if(this.timelines=[],this.timelineIds=new a,!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=i}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e0&&(e%=this.duration));let h=this.timelines;for(let s=0,l=h.length;s(t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add",t))(C||{}),R=(t=>(t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut",t))(R||{}),F=0,Y=1,P=2,X=3,L=4,O=5,D=6,B=7,V=8,z=9,N=10,_=11,U=12,W=13,q=14,G=15,j=16,H=17,Z=18,K=19,J=class{constructor(t,e){this.propertyIds=e,this.frames=m.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let i=t.length;for(let s=1;se)return s-1;return i-1}static search(t,e,i){let s=t.length;for(let r=i;re)return r-i;return s-i}},Q=class extends J{constructor(t,e,i){super(t,i),this.curves=m.newFloatArray(t+18*e),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+18*t;if(this.curves.length>e){let t=m.newFloatArray(e);m.arrayCopy(this.curves,0,t,0,e),this.curves=t}}setBezier(t,e,i,s,r,n,a,o,h,l,c){let u=this.curves,d=this.getFrameCount()+18*t;0==i&&(u[e]=2+d);let f=.03*(s-2*n+o),p=.03*(r-2*a+h),m=.006*(3*(n-o)-s+l),g=.006*(3*(a-h)-r+c),x=2*f+m,w=2*p+g,v=.3*(n-s)+f+.16666667*m,y=.3*(a-r)+p+.16666667*g,b=s+v,A=r+y;for(let t=d+18;dt){let n=this.frames[e],a=this.frames[e+i];return a+(t-n)/(r[s]-n)*(r[s+1]-a)}let n=s+18;for(s+=2;s=t){let e=r[s-2],i=r[s-1];return i+(t-e)/(r[s]-e)*(r[s+1]-i)}e+=this.getFrameEntries();let a=r[n-2],o=r[n-1];return o+(t-a)/(this.frames[e]-a)*(this.frames[e+i]-o)}},$=class extends Q{constructor(t,e,i){super(t,e,[i])}getFrameEntries(){return 2}setFrame(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+1]=i}getCurveValue(t){let e=this.frames,i=e.length-2;for(let s=2;s<=i;s+=2)if(e[s]>t){i=s-2;break}let s=this.curves[i>>1];switch(s){case 0:let s=e[i],r=e[i+1];return r+(t-s)/(e[i+2]-s)*(e[i+2+1]-r);case 1:return e[i+1]}return this.getBezierValue(t,i,1,s-2)}},tt=class extends Q{constructor(t,e,i,s){super(t,e,[i,s])}getFrameEntries(){return 3}setFrame(t,e,i,s){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s}},et=class extends ${constructor(t,e,i){super(t,e,F+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,r,n,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i>2];switch(p){case 0:let t=h[f];c=h[f+1],u=h[f+2],d=h[f+3];let e=(i-t)/(h[f+4]-t);c+=(h[f+4+1]-c)*e,u+=(h[f+4+2]-u)*e,d+=(h[f+4+3]-d)*e;break;case 1:c=h[f+1],u=h[f+2],d=h[f+3];break;default:c=this.getBezierValue(i,f,1,p-2),u=this.getBezierValue(i,f,2,p+18-2),d=this.getBezierValue(i,f,3,p+36-2)}if(1==r)l.r=c,l.g=u,l.b=d;else{if(0==n){let t=o.data.color;l.r=t.r,l.g=t.g,l.b=t.b}l.r+=(c-l.r)*r,l.g+=(u-l.g)*r,l.b+=(d-l.b)*r}}},ft=class extends ${constructor(t,e,i){super(t,e,V+"|"+i),this.slotIndex=0,this.slotIndex=i}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.color;if(i>3];switch(v){case 0:let t=h[w];u=h[w+1],d=h[w+2],f=h[w+3],p=h[w+4],m=h[w+5],g=h[w+6],x=h[w+7];let e=(i-t)/(h[w+8]-t);u+=(h[w+8+1]-u)*e,d+=(h[w+8+2]-d)*e,f+=(h[w+8+3]-f)*e,p+=(h[w+8+4]-p)*e,m+=(h[w+8+5]-m)*e,g+=(h[w+8+6]-g)*e,x+=(h[w+8+7]-x)*e;break;case 1:u=h[w+1],d=h[w+2],f=h[w+3],p=h[w+4],m=h[w+5],g=h[w+6],x=h[w+7];break;default:u=this.getBezierValue(i,w,1,v-2),d=this.getBezierValue(i,w,2,v+18-2),f=this.getBezierValue(i,w,3,v+36-2),p=this.getBezierValue(i,w,4,v+54-2),m=this.getBezierValue(i,w,5,v+72-2),g=this.getBezierValue(i,w,6,v+90-2),x=this.getBezierValue(i,w,7,v+108-2)}if(1==r)l.set(u,d,f,p),c.r=m,c.g=g,c.b=x;else{if(0==n){l.setFromColor(o.data.color);let t=o.data.darkColor;c.r=t.r,c.g=t.g,c.b=t.b}l.add((u-l.r)*r,(d-l.g)*r,(f-l.b)*r,(p-l.a)*r),c.r+=(m-c.r)*r,c.g+=(g-c.g)*r,c.b+=(x-c.b)*r}}},mt=class extends Q{constructor(t,e,i){super(t,e,[B+"|"+i,z+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,s,r,n,a,o){t*=7,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=r,this.frames[t+4]=n,this.frames[t+5]=a,this.frames[t+6]=o}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,c=o.darkColor;if(it){let r=this.frames[e];return i[s+1]*(t-r)/(i[s]-r)}let r=s+18;for(s+=2;s=t){let e=i[s-2],r=i[s-1];return r+(t-e)/(i[s]-e)*(i[s+1]-r)}let n=i[r-2],a=i[r-1];return a+(1-a)*(t-n)/(this.frames[e+this.getFrameEntries()]-n)}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.getAttachment();if(!h)return;if(!(h instanceof S)||h.timelineAttachment!=this.attachment)return;let l=o.deform;0==l.length&&(n=0);let c=this.vertices,u=c[0].length,d=this.frames;if(i=d[d.length-1]){let t=c[d.length-1];if(1==r)if(3==n){let e=h;if(e.bones)for(let e=0;ei)this.apply(t,e,Number.MAX_VALUE,s,r,n,a),e=-1;else if(e>=o[h-1])return;if(i0&&o[l-1]==t;)l--}for(;l=o[l];l++)s.push(this.events[l])}},vt=wt;vt.propertyIds=[""+U];var yt=class extends J{constructor(t){super(t,yt.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,s,r,n,a){if(1==a)return void(0==n&&m.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));if(i>2];switch(f){case 0:let t=u[d];h=u[d+1],l=u[d+2],c=u[d+3];let e=(i-t)/(u[d+4]-t);h+=(u[d+4+1]-h)*e,l+=(u[d+4+2]-l)*e,c+=(u[d+4+3]-c)*e;break;case 1:h=u[d+1],l=u[d+2],c=u[d+3];break;default:h=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),c=this.getBezierValue(i,d,3,f+36-2)}if(0==n){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*r,o.mixX=t.mixX+(l-t.mixX)*r,o.mixY=t.mixY+(c-t.mixY)*r}else o.mixRotate+=(h-o.mixRotate)*r,o.mixX+=(l-o.mixX)*r,o.mixY+=(c-o.mixY)*r}},Tt=class extends J{constructor(t,e,i){super(t,[K+"|"+e+"|"+i.sequence.id]),this.slotIndex=e,this.attachment=i}getFrameEntries(){return Tt.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,i,s,r){let n=this.frames;n[t*=Tt.ENTRIES]=e,n[t+Tt.MODE]=i|s<<4,n[t+Tt.DELAY]=r}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.attachment,l=this.attachment;if(!(h==l||h instanceof S&&h.timelineAttachment==l))return;let c=this.frames;if(i>4,g=this.attachment.sequence.regions.length,x=T[15&f];if(0!=x)switch(m+=(i-d)/p+1e-5|0,x){case 1:m=Math.min(g-1,m);break;case 2:m%=g;break;case 3:{let t=(g<<1)-2;m=0==t?0:m%t,m>=g&&(m=t-m);break}case 4:m=Math.max(g-1-m,0);break;case 5:m=g-1-m%g;break;case 6:{let t=(g<<1)-2;m=0==t?0:(m+g-1)%t,m>=g&&(m=t-m)}}o.sequenceIndex=m}},kt=Tt;kt.ENTRIES=3,kt.MODE=1,kt.DELAY=2;var Ct=class{constructor(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Yt(this),this.propertyIDs=new a,this.animationsChanged=!1,this.trackEntryPool=new x((()=>new Ft)),this.data=t}static emptyAnimation(){return Ct._emptyAnimation}update(t){t*=this.timeScale;let e=this.tracks;for(let i=0,s=e.length;i0){if(s.delay-=r,s.delay>0)continue;r=-s.delay,s.delay=0}let n=s.next;if(n){let e=s.trackLast-n.delay;if(e>=0){for(n.delay=0,n.trackTime+=0==s.timeScale?0:(e/s.timeScale+t)*n.timeScale,s.trackTime+=r,this.setCurrent(i,n,!0);n.mixingFrom;)n.mixTime+=t,n=n.mixingFrom;continue}}else if(s.trackLast>=s.trackEnd&&!s.mixingFrom){e[i]=null,this.queue.end(s),this.clearNext(s);continue}if(s.mixingFrom&&this.updateMixingFrom(s,t)){let t=s.mixingFrom;for(s.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}s.trackTime+=r}this.queue.drain()}updateMixingFrom(t,e){let i=t.mixingFrom;if(!i)return!0;let s=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),s):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,i=this.tracks,s=!1;for(let n=0,a=i.length;n0)continue;s=!0;let o=0==n?1:a.mixBlend,h=a.alpha;a.mixingFrom?h*=this.applyMixingFrom(a,t,o):a.trackTime>=a.trackEnd&&!a.next&&(h=0);let l=a.animationLast,c=a.getAnimationTime(),u=c,d=e;a.reverse&&(u=a.animation.duration-u,d=null);let f=a.animation.timelines,p=f.length;if(0==n&&1==h||3==o)for(let e=0;e1&&(r=1),1!=i&&(i=s.mixBlend));let n=r0&&this.queueEvents(s,d),this.events.length=0,s.nextAnimationLast=d,s.nextTrackLast=s.trackTime,r}applyAttachmentTimeline(t,e,i,s,r){var n=e.slots[t.slotIndex];n.bone.active&&(i0,s=t>=0;c.signum(e)!=c.signum(f)&&Math.abs(e)<=90&&(Math.abs(t)>180&&(t+=360*c.signum(t)),s=i),d=f+t-t%360,s!=i&&(d+=360*c.signum(t)),n[a]=d}n[a+1]=f,h.rotation=l+d*s}queueEvents(t,e){let i=t.animationStart,s=t.animationEnd,r=s-i,n=t.trackLast%r,a=this.events,o=0,h=a.length;for(;os||this.queue.event(t,e)}let l=!1;for(l=t.loop?0==r||n>t.trackTime%r:e>=s&&t.animationLast=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let i=e;for(;;){let t=i.mixingFrom;if(!t)break;this.queue.end(t),i.mixingFrom=null,i.mixingTo=null,i=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,i){let s=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,s&&(i&&this.queue.interrupt(s),e.mixingFrom=s,s.mixingTo=e,e.mixTime=0,s.mixingFrom&&s.mixDuration>0&&(e.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,i=!1){let s=this.data.skeletonData.findAnimation(e);if(!s)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,s,i)}setAnimationWith(t,e,i=!1){if(!e)throw new Error("animation cannot be null.");let s=!0,r=this.expandToIndex(t);r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,s=!1):this.clearNext(r));let n=this.trackEntry(t,e,i,r);return this.setCurrent(t,n,s),this.queue.drain(),n}addAnimation(t,e,i=!1,s=0){let r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,i,s)}addAnimationWith(t,e,i=!1,s=0){if(!e)throw new Error("animation cannot be null.");let r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;let n=this.trackEntry(t,e,i,r);return r?(r.next=n,n.previous=r,s<=0&&(s+=r.getTrackComplete()-n.mixDuration)):(this.setCurrent(t,n,!0),this.queue.drain()),n.delay=s,n}setEmptyAnimation(t,e=0){let i=this.setAnimationWith(t,Ct.emptyAnimation(),!1);return i.mixDuration=e,i.trackEnd=e,i}addEmptyAnimation(t,e=0,i=0){let s=this.addAnimationWith(t,Ct.emptyAnimation(),!1,i);return i<=0&&(s.delay+=s.mixDuration-e),s.mixDuration=e,s.trackEnd=e,s}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e0){r[o]=Vt,n[o]=i;continue t}break}r[o]=Bt}else r[o]=Lt}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},Rt=Ct;Rt._emptyAnimation=new k("",[],0);var Ft=class{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=2,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime(t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event",t))(Pt||{}),Xt=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}},Lt=0,Ot=1,Dt=2,Bt=3,Vt=4,zt=1,Nt=2,_t=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,i){let s=this.skeletonData.findAnimation(t);if(!s)throw new Error("Animation not found: "+t);let r=this.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);this.setMixWith(s,r,i)}setMixWith(t,e,i){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let s=t.name+"."+e.name;this.animationToMixTime[s]=i}getMix(t,e){let i=t.name+"."+e.name,s=this.animationToMixTime[i];return void 0===s?this.defaultMix:s}},Ut=class extends S{constructor(t){super(t),this.color=new h(1,1,1,1)}copy(){let t=new Ut(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},Wt=class extends S{constructor(t){super(t),this.endSlot=null,this.color=new h(.2275,.2275,.8078,1)}copy(){let t=new Wt(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},qt=class{constructor(t){this._image=t}getImage(){return this._image}},Gt=(t=>(t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear",t))(Gt||{}),jt=(t=>(t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat",t))(jt||{}),Ht=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},Zt=class extends qt{setFilters(t,e){}setWraps(t,e){}dispose(){}},Kt=class{constructor(t){this.pages=new Array,this.regions=new Array;let e=new Jt(t),i=new Array(4),s={size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},format:()=>{},filter:t=>{t.minFilter=m.enumValue(Gt,i[1]),t.magFilter=m.enumValue(Gt,i[2])},repeat:t=>{-1!=i[1].indexOf("x")&&(t.uWrap=10497),-1!=i[1].indexOf("y")&&(t.vWrap=10497)},pma:t=>{t.pma="true"==i[1]}};var r={xy:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2])},size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},bounds:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2]),t.width=parseInt(i[3]),t.height=parseInt(i[4])},offset:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2])},orig:t=>{t.originalWidth=parseInt(i[1]),t.originalHeight=parseInt(i[2])},offsets:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2]),t.originalWidth=parseInt(i[3]),t.originalHeight=parseInt(i[4])},rotate:t=>{let e=i[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:t=>{t.index=parseInt(i[1])}};let n=e.readLine();for(;n&&0==n.trim().length;)n=e.readLine();for(;n&&0!=n.trim().length&&0!=e.readEntry(i,n);)n=e.readLine();let a=null,o=null,h=null;for(;null!==n;)if(0==n.trim().length)a=null,n=e.readLine();else if(a){let t=new $t(a,n);for(;;){let s=e.readEntry(i,n=e.readLine());if(0==s)break;let a=r[i[0]];if(a)a(t);else{o||(o=[]),h||(h=[]),o.push(i[0]);let t=[];for(let e=0;e0&&h&&h.length>0&&(t.names=o,t.values=h,o=null,h=null),t.u=t.x/a.width,t.v=t.y/a.height,90==t.degrees?(t.u2=(t.x+t.height)/a.width,t.v2=(t.y+t.width)/a.height):(t.u2=(t.x+t.width)/a.width,t.v2=(t.y+t.height)/a.height),this.regions.push(t)}else{for(a=new Qt(n.trim());0!=e.readEntry(i,n=e.readLine());){let t=s[i[0]];t&&t(a)}this.pages.push(a)}}findRegion(t){for(let e=0;e=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;let i=e.indexOf(":");if(-1==i)return 0;t[0]=e.substr(0,i).trim();for(let s=1,r=i+1;;s++){let i=e.indexOf(",",r);if(-1==i)return t[s]=e.substr(r).trim(),s;if(t[s]=e.substr(r,i-r).trim(),r=i+1,4==s)return 4}}},Qt=class{constructor(t){this.minFilter=9728,this.magFilter=9728,this.uWrap=33071,this.vWrap=33071,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}},$t=class extends Ht{constructor(t,e){super(),this.x=0,this.y=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.index=0,this.degrees=0,this.names=null,this.values=null,this.page=t,this.name=e}},te=class extends S{constructor(t,e){super(t),this.region=null,this.regionUVs=[],this.uvs=[],this.triangles=[],this.color=new h(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=[],this.parentMesh=null,this.sequence=null,this.tempColor=new h(0,0,0,0),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=m.newFloatArray(t.length));let e=this.uvs,i=this.uvs.length,s=this.region.u,r=this.region.v,n=0,a=0;if(this.region instanceof $t){let o=this.region,h=o.page.texture.getImage(),l=h.width,c=h.height;switch(o.degrees){case 90:s-=(o.originalHeight-o.offsetY-o.height)/l,r-=(o.originalWidth-o.offsetX-o.width)/c,n=o.originalHeight/l,a=o.originalWidth/c;for(let o=0;o= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}},oe=(t=>(t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection",t))(oe||{}),he=class{constructor(t,e,i){if(this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,s,r,n,a){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=s,this.ascaleY=r,this.ashearX=n,this.ashearY=a;let o=this.parent;if(!o){let o=this.skeleton,h=i+90+a,l=o.scaleX,u=o.scaleY;return this.a=c.cosDeg(i+n)*s*l,this.b=c.cosDeg(h)*r*l,this.c=c.sinDeg(i+n)*s*u,this.d=c.sinDeg(h)*r*u,this.worldX=t*l+o.x,void(this.worldY=e*u+o.y)}let h=o.a,l=o.b,u=o.c,d=o.d;switch(this.worldX=h*t+l*e+o.worldX,this.worldY=u*t+d*e+o.worldY,this.data.transformMode){case 0:{let t=i+90+a,e=c.cosDeg(i+n)*s,o=c.cosDeg(t)*r,f=c.sinDeg(i+n)*s,p=c.sinDeg(t)*r;return this.a=h*e+l*f,this.b=h*o+l*p,this.c=u*e+d*f,void(this.d=u*o+d*p)}case 1:{let t=i+90+a;this.a=c.cosDeg(i+n)*s,this.b=c.cosDeg(t)*r,this.c=c.sinDeg(i+n)*s,this.d=c.sinDeg(t)*r;break}case 2:{let t=h*h+u*u,e=0;t>1e-4?(t=Math.abs(h*d-l*u)/t,h/=this.skeleton.scaleX,u/=this.skeleton.scaleY,l=u*t,d=h*t,e=Math.atan2(u,h)*c.radDeg):(h=0,u=0,e=90-Math.atan2(d,l)*c.radDeg);let o=i+n-e,f=i+a-e+90,p=c.cosDeg(o)*s,m=c.cosDeg(f)*r,g=c.sinDeg(o)*s,x=c.sinDeg(f)*r;this.a=h*p-l*g,this.b=h*m-l*x,this.c=u*p+d*g,this.d=u*m+d*x;break}case 3:case 4:{let t=c.cosDeg(i),e=c.sinDeg(i),o=(h*t+l*e)/this.skeleton.scaleX,f=(u*t+d*e)/this.skeleton.scaleY,p=Math.sqrt(o*o+f*f);p>1e-5&&(p=1/p),o*=p,f*=p,p=Math.sqrt(o*o+f*f),3==this.data.transformMode&&h*d-l*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let m=Math.PI/2+Math.atan2(f,o),g=Math.cos(m)*p,x=Math.sin(m)*p,w=c.cosDeg(n)*s,v=c.cosDeg(90+a)*r,y=c.sinDeg(n)*s,b=c.sinDeg(90+a)*r;this.a=o*w+g*y,this.b=o*v+g*b,this.c=f*w+x*y,this.d=f*v+x*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.c,this.a)*c.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*c.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){let t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*c.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*c.radDeg);let e=t.a,i=t.b,s=t.c,r=t.d,n=1/(e*r-i*s),a=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=a*r*n-o*i*n,this.ay=o*e*n-a*s*n;let h=n*r,l=n*e,u=n*i,d=n*s,f=h*this.a-u*this.c,p=h*this.b-u*this.d,m=l*this.c-d*this.a,g=l*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let t=f*g-p*m;this.ascaleY=t/this.ascaleX,this.ashearY=Math.atan2(f*p+m*g,t)*c.radDeg,this.arotation=Math.atan2(m,f)*c.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*c.radDeg}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),i=t.x-this.worldX,s=t.y-this.worldY;return t.x=i*this.d*e-s*this.b*e,t.y=s*this.a*e-i*this.c*e,t}localToWorld(t){let e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t}worldToLocalRotation(t){let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(this.a*e-this.c*i,this.d*i-this.b*e)*c.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(i*this.c+e*this.d,i*this.a+e*this.b)*c.radDeg}rotateWorld(t){let e=this.a,i=this.b,s=this.c,r=this.d,n=c.cosDeg(t),a=c.sinDeg(t);this.a=n*e-a*s,this.b=n*i-a*r,this.c=a*e+n*s,this.d=a*i+n*r}},le=class{constructor(t,e,i){this.name=t,this.order=e,this.skinRequired=i}},ce=class{constructor(t,e="",i=new ue){this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e,this.downloader=i}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,i){this.toLoad--,this.loaded++,this.assets[e]=i,t&&t(e,i)}error(t,e,i){this.toLoad--,this.loaded++,this.errors[e]=i,t&&t(e,i)}loadAll(){return new Promise(((t,e)=>{let i=()=>{this.isLoadingComplete()?this.hasErrors()?e(this.errors):t(this):requestAnimationFrame(i)};requestAnimationFrame(i)}))}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadBinary(t,(i=>{this.success(e,t,i)}),((e,s)=>{this.error(i,t,`Couldn't load binary ${t}: status ${e}, ${s}`)}))}loadText(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadText(t,(i=>{this.success(e,t,i)}),((e,s)=>{this.error(i,t,`Couldn't load text ${t}: status ${e}, ${s}`)}))}loadJson(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadJson(t,(i=>{this.success(e,t,i)}),((e,s)=>{this.error(i,t,`Couldn't load JSON ${t}: status ${e}, ${s}`)}))}loadTexture(t,e=(()=>{}),i=(()=>{})){if(t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then((e=>e.ok?e.blob():(this.error(i,t,`Couldn't load image: ${t}`),null))).then((t=>t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null)).then((i=>{i&&this.success(e,t,this.textureLoader(i))}));else{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>{this.success(e,t,this.textureLoader(s))},s.onerror=()=>{this.error(i,t,`Couldn't load image: ${t}`)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),s.src=t}}loadTextureAtlas(t,e=(()=>{}),i=(()=>{}),s){let r=t.lastIndexOf("/"),n=r>=0?t.substring(0,r+1):"";t=this.start(t),this.downloader.downloadText(t,(r=>{try{let a=new Kt(r),o=a.pages.length,h=!1;for(let r of a.pages)this.loadTexture(s?s[r.name]:n+r.name,((i,s)=>{h||(r.setTexture(s),0==--o&&this.success(e,t,a))}),((e,s)=>{h||this.error(i,t,`Couldn't load texture atlas ${t} page image: ${e}`),h=!0}))}catch(e){this.error(i,t,`Couldn't parse texture atlas ${t}: ${e.message}`)}}),((e,s)=>{this.error(i,t,`Couldn't load texture atlas ${t}: status ${e}, ${s}`)}))}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let e=this.assets[t];if(e)return e;let i=this.errors[t];throw Error("Asset not found: "+t+(i?"\n"+i:""))}remove(t){t=this.pathPrefix+t;let e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}removeAll(){for(let t in this.assets){let e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}isLoadingComplete(){return 0==this.toLoad}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},ue=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return-1!=e?(e+="base64,".length,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var e=window.atob(t),i=e.length,s=new Uint8Array(i),r=0;r{this.finish(t,s.status,s.responseText)};s.onload=r,s.onerror=r,s.send()}downloadJson(t,e,i){this.downloadText(t,(t=>{e(JSON.parse(t))}),i)}downloadBinary(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType="arraybuffer";let r=()=>{this.finish(t,s.status,s.response)};s.onload=()=>{200==s.status||0==s.status?this.finish(t,200,new Uint8Array(s.response)):r()},s.onerror=r,s.send()}start(t,e,i){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,i)}}finish(t,e,i){let s=this.callbacks[t];delete this.callbacks[t];let r=200==e||0==e?[i]:[e,i];for(let t=r.length-1,e=s.length;t180?f-=360:f<-180&&(f+=360);let g=t.ascaleX,x=t.ascaleY;if(s||r){switch(t.data.transformMode){case 3:case 4:p=e-t.worldX,m=i-t.worldY}let o=t.data.length*g,h=Math.sqrt(p*p+m*m);if(s&&ho&&o>1e-4){let t=(h/o-1)*a+1;g*=t,n&&(x*=t)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*a,g,x,t.ashearX,t.ashearY)}apply2(t,e,i,s,r,n,a,o,h){let l=t.ax,u=t.ay,d=t.ascaleX,f=t.ascaleY,p=d,m=f,g=e.ascaleX,x=0,w=0,v=0;d<0?(d=-d,x=180,v=-1):(x=0,v=1),f<0&&(f=-f,v=-v),g<0?(g=-g,w=180):w=0;let y=e.ax,b=0,A=0,S=0,M=t.a,I=t.b,E=t.c,T=t.d,k=Math.abs(d-f)<=1e-4;!k||n?(b=0,A=M*y+t.worldX,S=E*y+t.worldY):(b=e.ay,A=M*y+I*b+t.worldX,S=E*y+T*b+t.worldY);let C=t.parent;if(!C)throw new Error("IK parent must itself have a parent.");M=C.a,I=C.b,E=C.c,T=C.d;let R,F,Y=1/(M*T-I*E),P=A-C.worldX,X=S-C.worldY,L=(P*T-X*I)*Y-l,O=(X*M-P*E)*Y-u,D=Math.sqrt(L*L+O*O),B=e.data.length*g;if(D<1e-4)return this.apply1(t,i,s,!1,n,!1,h),void e.updateWorldTransformWith(y,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);P=i-C.worldX,X=s-C.worldY;let V=(P*T-X*I)*Y-l,z=(X*M-P*E)*Y-u,N=V*V+z*z;if(0!=o){o*=d*(g+1)*.5;let t=Math.sqrt(N),e=t-D-B*d+o;if(e>0){let i=Math.min(1,e/(2*o))-1;i=(e-o*(1-i*i))/t,V-=i*V,z-=i*z,N=V*V+z*z}}t:if(k){B*=d;let t=(N-D*D-B*B)/(2*D*B);t<-1?(t=-1,F=Math.PI*r):t>1?(t=1,F=0,n&&(M=(Math.sqrt(N)/(D+B)-1)*h+1,p*=M,a&&(m*=M))):F=Math.acos(t)*r,M=D+B*t,I=B*Math.sin(F),R=Math.atan2(z*M-V*I,V*M+z*I)}else{M=d*B,I=f*B;let t=M*M,e=I*I,i=Math.atan2(z,V);E=e*D*D+t*N-t*e;let s=-2*e*D,n=e-t;if(T=s*s-4*n*E,T>=0){let t=Math.sqrt(T);s<0&&(t=-t),t=.5*-(s+t);let e=t/n,a=E/t,o=Math.abs(e)=-1&&E<=1&&(E=Math.acos(E),P=M*Math.cos(E)+D,X=I*Math.sin(E),T=P*P+X*X,Tm&&(u=E,m=T,p=P,g=X)),N<=.5*(h+m)?(R=i-Math.atan2(l*r,o),F=a*r):(R=i-Math.atan2(g*r,p),F=u*r)}let _=Math.atan2(b,y)*v,U=t.arotation;R=(R-_)*c.radDeg+x-U,R>180?R-=360:R<-180&&(R+=360),t.updateWorldTransformWith(l,u,U+R*h,p,m,0,0),U=e.arotation,F=((F+_)*c.radDeg-e.ashearX)*v+w-U,F>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(y,b,U+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}},me=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},ge=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.positionMode=xe.Fixed,this.spacingMode=we.Fixed,this.rotateMode=ve.Chain,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}},xe=(t=>(t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent",t))(xe||{}),we=(t=>(t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional",t))(we||{}),ve=(t=>(t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale",t))(ve||{}),ye=class{constructor(t,e){if(this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0,s=t.bones.length;i0){t=l/t*f;for(let e=1;e0?c.degRad:-c.degRad}for(let t=0,r=3;t0){let i=h.a,s=h.b,a=h.c,o=h.d,l=0,d=0,f=0;if(l=n?p[r-1]:0==u[t+1]?p[r+2]:Math.atan2(y,m),l-=Math.atan2(a,i),v){d=Math.cos(l),f=Math.sin(l);let t=h.data.length;g+=(t*(d*i-f*a)-m)*e,x+=(t*(f*i+d*a)-y)*e}else l+=w;l>c.PI?l-=c.PI2:l<-c.PI&&(l+=c.PI2),l*=e,d=Math.cos(l),f=Math.sin(l),h.a=d*i-f*a,h.b=d*s-f*o,h.c=f*i+d*a,h.d=f*s+d*o}h.updateAppliedTransform()}}computeWorldPositions(t,e,i){let s=this.target,r=this.position,n=this.spaces,a=m.setArraySize(this.positions,3*e+2),o=this.world,h=t.closed,l=t.worldVerticesLength,c=l/6,u=ye.NONE;if(!t.constantSpeed){let d=t.lengths;c-=h?1:2;let f,p=d[c];switch(1==this.data.positionMode&&(r*=p),this.data.spacingMode){case 2:f=p;break;case 3:f=p/e;break;default:f=1}o=m.setArraySize(this.world,8);for(let m=0,g=0,x=0;mp){u!=ye.AFTER&&(u=ye.AFTER,t.computeWorldVertices(s,l-6,4,o,0,2)),this.addAfterPosition(w-p,o,0,a,g);continue}}for(;;x++){let t=d[x];if(!(w>t)){if(0==x)w/=t;else{let e=d[x-1];w=(w-e)/(t-e)}break}}x!=u&&(u=x,h&&x==c?(t.computeWorldVertices(s,l-4,4,o,0,2),t.computeWorldVertices(s,0,4,o,4,2)):t.computeWorldVertices(s,6*x+2,8,o,0,2)),this.addCurvePosition(w,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],a,g,i||m>0&&0==e)}return a}h?(l+=2,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l-4,o,0,2),t.computeWorldVertices(s,0,2,o,l-4,2),o[l-2]=o[0],o[l-1]=o[1]):(c--,l-=4,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l,o,0,2));let d,f=m.setArraySize(this.curves,c),p=0,g=o[0],x=o[1],w=0,v=0,y=0,b=0,A=0,S=0,M=0,I=0,E=0,T=0,k=0,C=0,R=0,F=0;for(let t=0,e=2;tp){this.addAfterPosition(X-p,o,l-4,a,s);continue}}for(;;c++){let t=f[c];if(!(X>t)){if(0==c)X/=t;else{let e=f[c-1];X=(X-e)/(t-e)}break}}if(c!=u){u=c;let t=6*c;for(g=o[t],x=o[t+1],w=o[t+2],v=o[t+3],y=o[t+4],b=o[t+5],A=o[t+6],S=o[t+7],M=.03*(g-2*w+y),I=.03*(x-2*v+b),E=.006*(3*(w-y)-g+A),T=.006*(3*(v-b)-x+S),k=2*M+E,C=2*I+T,R=.3*(w-g)+M+.16666667*E,F=.3*(v-x)+I+.16666667*T,P=Math.sqrt(R*R+F*F),Y[0]=P,t=1;t<8;t++)R+=k,F+=C,k+=E,C+=T,P+=Math.sqrt(R*R+F*F),Y[t]=P;R+=k,F+=C,P+=Math.sqrt(R*R+F*F),Y[8]=P,R+=k+E,F+=C+T,P+=Math.sqrt(R*R+F*F),Y[9]=P,m=0}for(X*=P;;m++){let t=Y[m];if(!(X>t)){if(0==m)X/=t;else{let e=Y[m-1];X=m+(X-e)/(t-e)}break}}this.addCurvePosition(.1*X,g,x,w,v,y,b,A,S,a,s,i||t>0&&0==e)}return a}addBeforePosition(t,e,i,s,r){let n=e[i],a=e[i+1],o=e[i+2]-n,h=e[i+3]-a,l=Math.atan2(h,o);s[r]=n+t*Math.cos(l),s[r+1]=a+t*Math.sin(l),s[r+2]=l}addAfterPosition(t,e,i,s,r){let n=e[i+2],a=e[i+3],o=n-e[i],h=a-e[i+1],l=Math.atan2(h,o);s[r]=n+t*Math.cos(l),s[r+1]=a+t*Math.sin(l),s[r+2]=l}addCurvePosition(t,e,i,s,r,n,a,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=i,void(l[c+2]=Math.atan2(r-i,s-e));let d=t*t,f=d*t,p=1-t,m=p*p,g=m*p,x=p*t,w=3*x,v=p*w,y=w*t,b=e*g+s*v+n*y+o*f,A=i*g+r*v+a*y+h*f;l[c]=b,l[c+1]=A,u&&(l[c+2]=t<.001?Math.atan2(r-i,s-e):Math.atan2(A-(i*m+r*x*2+a*d),b-(e*m+s*x*2+n*d)))}},be=ye;be.NONE=-1,be.BEFORE=-2,be.AFTER=-3,be.epsilon=1e-5;var Ae=class{constructor(t,e){if(this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new h,this.darkColor=t.darkColor?new h:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(t instanceof S&&this.attachment instanceof S&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},Se=class{constructor(t,e){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new w,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(let i=0;i0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;fc.PI?n-=c.PI2:n<-c.PI&&(n+=c.PI2),n*=t;let a=Math.cos(n),o=Math.sin(n);x.a=a*e-o*s,x.b=a*i-o*r,x.c=o*e+a*s,x.d=o*i+a*r}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(t.x-x.worldX)*e,x.worldY+=(t.y-x.worldY)*i}if(0!=s){let t=Math.sqrt(x.a*x.a+x.c*x.c);0!=t&&(t=(t+(Math.sqrt(h*h+u*u)-t+this.data.offsetScaleX)*s)/t),x.a*=t,x.c*=t}if(0!=r){let t=Math.sqrt(x.b*x.b+x.d*x.d);0!=t&&(t=(t+(Math.sqrt(l*l+d*d)-t+this.data.offsetScaleY)*r)/t),x.b*=t,x.d*=t}if(n>0){let t=x.b,e=x.d,i=Math.atan2(e,t),s=Math.atan2(d,l)-Math.atan2(u,h)-(i-Math.atan2(x.c,x.a));s>c.PI?s-=c.PI2:s<-c.PI&&(s+=c.PI2),s=i+(s+m)*n;let r=Math.sqrt(t*t+e*e);x.b=Math.cos(s)*r,x.d=Math.sin(s)*r}x.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,r=this.mixScaleY,n=this.mixShearY,a=0!=e||0!=i,o=this.target,h=o.a,l=o.b,u=o.c,d=o.d,f=h*d-l*u>0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;fc.PI?n-=c.PI2:n<-c.PI&&(n+=c.PI2),n*=t;let a=Math.cos(n),o=Math.sin(n);x.a=a*e-o*s,x.b=a*i-o*r,x.c=o*e+a*s,x.d=o*i+a*r}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=t.x*e,x.worldY+=t.y*i}if(0!=s){let t=(Math.sqrt(h*h+u*u)-1+this.data.offsetScaleX)*s+1;x.a*=t,x.c*=t}if(0!=r){let t=(Math.sqrt(l*l+d*d)-1+this.data.offsetScaleY)*r+1;x.b*=t,x.d*=t}if(n>0){let t=Math.atan2(d,l)-Math.atan2(u,h);t>c.PI?t-=c.PI2:t<-c.PI&&(t+=c.PI2);let e=x.b,i=x.d;t=Math.atan2(i,e)+(t-c.PI/2+m)*n;let s=Math.sqrt(e*e+i*i);x.b=Math.cos(t)*s,x.d=Math.sin(t)*s}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,r=this.mixScaleY,n=this.mixShearY,a=this.target,o=this.bones;for(let h=0,l=o.length;h=s.length&&(s.length=t+1),s[t]||(s[t]={}),s[t][e]=i}addSkin(t){for(let e=0;e= 0.");if(!e)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}},Re=(t=>(t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen",t))(Re||{}),Fe=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Ye=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new Ee;i.name="";let s=new Pe(t),r=s.readInt32(),n=s.readInt32();i.hash=0==n&&0==r?null:n.toString(16)+r.toString(16),i.version=s.readString(),i.x=s.readFloat(),i.y=s.readFloat(),i.width=s.readFloat(),i.height=s.readFloat();let a=s.readBoolean();a&&(i.fps=s.readFloat(),i.imagesPath=s.readString(),i.audioPath=s.readString());let o=0;o=s.readInt(!0);for(let t=0;t>4,t.readFloat())}s.push(e);break}}}}}let n=t.readInt(!0);if(n>0){let e=new bt(n),r=i.slots.length;for(let i=0;i=0;t--)a[t]=-1;let o=m.newArray(r-n,0),h=0,l=0;for(let e=0;e=0;t--)-1==a[t]&&(a[t]=o[--l]);e.setFrame(i,s,a)}s.push(e)}let a=t.readInt(!0);if(a>0){let e=new vt(a);for(let s=0;s>>1^-(1&i)}readStringRef(){let t=this.readInt(!0);return 0==t?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&t)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(t),i++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return 0!=this.readByte()}},Xe=class{constructor(t,e,i,s,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=s,this.inheritTimeline=r}},Le=class{constructor(t=null,e=null){this.bones=t,this.vertices=e}},Oe=(t=>(t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping",t))(Oe||{});function De(t,e,i){let s=t.readFloat(),r=t.readFloat()*i;for(let n=0,a=0,o=e.getFrameCount()-1;e.setFrame(n,s,r),n!=o;n++){let o=t.readFloat(),h=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(n);break;case li:Ve(t,e,a++,n,0,s,o,r,h,i)}s=o,r=h}return e}function Be(t,e,i){let s=t.readFloat(),r=t.readFloat()*i,n=t.readFloat()*i;for(let a=0,o=0,h=e.getFrameCount()-1;e.setFrame(a,s,r,n),a!=h;a++){let h=t.readFloat(),l=t.readFloat()*i,c=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(a);break;case li:Ve(t,e,o++,a,0,s,h,r,l,i),Ve(t,e,o++,a,1,s,h,n,c,i)}s=h,r=l,n=c}return e}function Ve(t,e,i,s,r,n,a,o,h,l){e.setBezier(i,s,r,n,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,a,h)}var ze,Ne=0,_e=1,Ue=2,We=3,qe=4,Ge=5,je=6,He=7,Ze=8,Ke=9,Je=0,Qe=1,$e=2,ti=3,ei=4,ii=5,si=0,ri=1,ni=0,ai=1,oi=2,hi=1,li=2,ci=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new x((()=>m.newFloatArray(16)))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");let i=this.boundingBoxes,s=this.polygons,r=this.polygonPool,n=t.slots,a=n.length;i.length=0,r.freeAll(s),s.length=0;for(let t=0;t=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,i,s){let r=this.minX,n=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&i<=r||e<=n&&s<=n||t>=a&&i>=a||e>=o&&s>=o)return!1;let h=(s-e)/(i-t),l=h*(r-t)+e;if(l>n&&ln&&lr&&cr&&ct.minX&&this.minYt.minY}containsPoint(t,e){let i=this.polygons;for(let s=0,r=i.length;s=i||o=i){let h=s[t];h+(i-r)/(o-r)*(s[n]-h)=c&&x<=a||x>=a&&x<=c)&&(x>=e&&x<=s||x>=s&&x<=e)){let t=(l*m-h*f)/g;if((t>=u&&t<=d||t>=d&&t<=u)&&(t>=i&&t<=r||t>=r&&t<=i))return!0}c=a,u=d}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},ui=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new x((()=>new Array)),this.polygonIndicesPool=new x((()=>new Array))}triangulate(t){let e=t,i=t.length>>1,s=this.indicesArray;s.length=0;for(let t=0;t3;){let t=i-1,a=0,o=1;for(;;){t:if(!r[a]){let n=s[t]<<1,h=s[a]<<1,l=s[o]<<1,c=e[n],u=e[n+1],d=e[h],f=e[h+1],p=e[l],m=e[l+1];for(let n=(o+1)%i;n!=t;n=(n+1)%i){if(!r[n])continue;let t=s[n]<<1,i=e[t],a=e[t+1];if(ui.positiveArea(p,m,c,u,i,a)&&ui.positiveArea(c,u,d,f,i,a)&&ui.positiveArea(d,f,p,m,i,a))break t}break}if(0==o){do{if(!r[a])break;a--}while(a>0);break}t=a,a=o,o=(o+1)%i}n.push(s[(i+a-1)%i]),n.push(s[a]),n.push(s[(a+1)%i]),s.splice(a,1),r.splice(a,1),i--;let h=(i+a-1)%i,l=a==i?0:a;r[h]=ui.isConcave(h,i,e,s),r[l]=ui.isConcave(l,i,e,s)}return 3==i&&(n.push(s[2]),n.push(s[0]),n.push(s[1])),n}decompose(t,e){let i=t,s=this.convexPolygons;this.polygonPool.freeAll(s),s.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let n=this.polygonIndicesPool.obtain();n.length=0;let a=this.polygonPool.obtain();a.length=0;let o=-1,h=0;for(let t=0,l=e.length;t0?(s.push(a),r.push(n)):(this.polygonPool.free(a),this.polygonIndicesPool.free(n)),a=this.polygonPool.obtain(),a.length=0,a.push(d),a.push(f),a.push(p),a.push(m),a.push(g),a.push(x),n=this.polygonIndicesPool.obtain(),n.length=0,n.push(l),n.push(c),n.push(u),h=ui.winding(d,f,p,m,g,x),o=l)}a.length>0&&(s.push(a),r.push(n));for(let t=0,e=s.length;t=0;t--)a=s[t],0==a.length&&(s.splice(t,1),this.polygonPool.free(a),n=r[t],r.splice(t,1),this.polygonIndicesPool.free(n));return s}static isConcave(t,e,i,s){let r=s[(e+t-1)%e]<<1,n=s[t]<<1,a=s[(t+1)%e]<<1;return!this.positiveArea(i[r],i[r+1],i[n],i[n+1],i[a],i[a+1])}static positiveArea(t,e,i,s,r,n){return t*(n-s)+i*(e-n)+r*(s-e)>=0}static winding(t,e,i,s,r,n){let a=i-t,o=s-e;return r*o-n*a+a*e-t*o>=0?1:-1}},di=class{constructor(){this.triangulator=new ui,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let i=e.worldVerticesLength,s=m.setArraySize(this.clippingPolygon,i);e.computeWorldVertices(t,0,i,s,0,2);let r=this.clippingPolygon;di.makeClockwise(r);let n=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let t=0,e=n.length;t>1,C=this.clipOutput,R=m.setArraySize(l,e+k*f);for(let h=0;h=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(i),h.push(s),h.push(r),h.push(n),h.push(t),h.push(e),o.length=0;let u=a,d=a.length-4;for(let t=0;;t+=2){let e=u[t],i=u[t+1],s=u[t+2],r=u[t+3],n=e-s,a=i-r,f=h,p=h.length-2,m=o.length;for(let t=0;t0;if(n*(l-r)-a*(h-s)>0){if(p){o.push(u),o.push(d);continue}let t=d-l,n=u-h,a=t*(s-e)-n*(r-i);if(Math.abs(a)>1e-6){let c=(n*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(r-i)*c)}else o.push(e),o.push(i)}else if(p){let t=d-l,n=u-h,a=t*(s-e)-n*(r-i);if(Math.abs(a)>1e-6){let c=(n*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(r-i)*c)}else o.push(e),o.push(i);o.push(u),o.push(d)}c=!0}if(m==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),t==d)break;let g=o;(o=h).length=0,h=g}if(l!=o){l.length=0;for(let t=0,e=o.length-2;t>1;t=0;e--)-1==o[e]&&(o[e]=t[--r])}e.setFrame(n,wi(a,"time",0),o)}r.push(e)}if(t.events){let e=new vt(t.events.length),s=0;for(let r=0;rnew yi(t)),t,e)}},Ai=m.newFloatArray(8),Si=class{constructor(t){this.triangleRendering=!1,this.debugRendering=!1,this.vertices=m.newFloatArray(8192),this.tempColor=new h,this.ctx=t}draw(t){this.triangleRendering?this.drawTriangles(t):this.drawImages(t)}drawImages(t){let e=this.ctx,i=this.tempColor,s=t.color,r=t.drawOrder;this.debugRendering&&(e.strokeStyle="green");for(let t=0,n=r.length;t{if(n&&"object"==typeof n||"function"==typeof n)for(let h of i(n))s.call(r,h)||h===a||t(r,h,{get:()=>n[h],enumerable:!(o=e(n,h))||o.enumerable});return r})(t({},"__esModule",{value:!0}),vi)})();t.exports=e}).call(window)},7518:t=>{(function(){"use strict";var e=(()=>{var t=Object.defineProperty,e=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,r={};((e,i)=>{for(var s in i)t(e,s,{get:i[s],enumerable:!0})})(r,{AlphaTimeline:()=>ft,Animation:()=>k,AnimationState:()=>Rt,AnimationStateAdapter:()=>Xt,AnimationStateData:()=>_t,AssetManager:()=>Mi,AssetManagerBase:()=>ce,AtlasAttachmentLoader:()=>ne,Attachment:()=>b,AttachmentTimeline:()=>gt,BinaryInput:()=>Pe,BlendMode:()=>Re,Bone:()=>he,BoneData:()=>ae,BoundingBoxAttachment:()=>Ut,CURRENT:()=>Nt,CameraController:()=>ji,ClippingAttachment:()=>Wt,Color:()=>h,Color2Attribute:()=>is,ColorAttribute:()=>es,ConstraintData:()=>le,CurveTimeline:()=>Q,CurveTimeline1:()=>$,CurveTimeline2:()=>tt,DebugUtils:()=>g,DeformTimeline:()=>xt,Downloader:()=>ue,DrawOrderTimeline:()=>bt,Event:()=>de,EventData:()=>fe,EventQueue:()=>Yt,EventTimeline:()=>vt,EventType:()=>Pt,FIRST:()=>Ot,FakeTexture:()=>Zt,GLTexture:()=>Si,HOLD_FIRST:()=>Bt,HOLD_MIX:()=>Vt,HOLD_SUBSEQUENT:()=>Dt,IkConstraint:()=>pe,IkConstraintData:()=>me,IkConstraintTimeline:()=>At,Input:()=>qi,IntSet:()=>n,Interpolation:()=>u,LoadingScreen:()=>As,M00:()=>Ei,M01:()=>Ti,M02:()=>ki,M03:()=>Ci,M10:()=>Ri,M11:()=>Fi,M12:()=>Yi,M13:()=>Pi,M20:()=>Xi,M21:()=>Li,M22:()=>Oi,M23:()=>Di,M30:()=>Bi,M31:()=>Vi,M32:()=>zi,M33:()=>Ni,ManagedWebGLRenderingContext:()=>vi,MathUtils:()=>c,Matrix4:()=>Ui,Mesh:()=>Ki,MeshAttachment:()=>te,MixBlend:()=>C,MixDirection:()=>R,OrthoCamera:()=>Wi,PathAttachment:()=>ee,PathConstraint:()=>be,PathConstraintData:()=>ge,PathConstraintMixTimeline:()=>Et,PathConstraintPositionTimeline:()=>Mt,PathConstraintSpacingTimeline:()=>It,PointAttachment:()=>ie,PolygonBatcher:()=>ns,Pool:()=>x,Position2Attribute:()=>Qi,Position3Attribute:()=>$i,PositionMode:()=>xe,Pow:()=>d,PowOut:()=>f,RGB2Timeline:()=>mt,RGBA2Timeline:()=>pt,RGBATimeline:()=>ut,RGBTimeline:()=>dt,RegionAttachment:()=>re,ResizeMode:()=>vs,RotateMode:()=>ve,RotateTimeline:()=>et,SETUP:()=>zt,SUBSEQUENT:()=>Lt,ScaleTimeline:()=>nt,ScaleXTimeline:()=>at,ScaleYTimeline:()=>ot,SceneRenderer:()=>ws,SequenceTimeline:()=>kt,Shader:()=>Zi,ShapeRenderer:()=>as,ShapeType:()=>os,ShearTimeline:()=>ht,ShearXTimeline:()=>lt,ShearYTimeline:()=>ct,Skeleton:()=>Ie,SkeletonBinary:()=>Ye,SkeletonBounds:()=>ci,SkeletonClipping:()=>di,SkeletonData:()=>Ee,SkeletonDebugRenderer:()=>ls,SkeletonJson:()=>fi,SkeletonRenderer:()=>us,Skin:()=>ke,SkinEntry:()=>Te,Slot:()=>Ae,SlotData:()=>Ce,SpacingMode:()=>we,SpineCanvas:()=>Is,StringSet:()=>a,TexCoordAttribute:()=>ts,Texture:()=>qt,TextureAtlas:()=>Kt,TextureAtlasPage:()=>Qt,TextureAtlasRegion:()=>$t,TextureFilter:()=>Gt,TextureRegion:()=>Ht,TextureWrap:()=>jt,TimeKeeper:()=>v,Timeline:()=>J,Touch:()=>Gi,TrackEntry:()=>Ft,TransformConstraint:()=>Se,TransformConstraintData:()=>Fe,TransformConstraintTimeline:()=>St,TransformMode:()=>oe,TranslateTimeline:()=>it,TranslateXTimeline:()=>st,TranslateYTimeline:()=>rt,Triangulator:()=>ui,Utils:()=>m,Vector2:()=>w,Vector3:()=>Ii,VertexAttachment:()=>S,VertexAttribute:()=>Ji,VertexAttributeType:()=>ss,WebGLBlendModeConverter:()=>bi,WindowedMean:()=>y});var n=class{constructor(){this.array=new Array}add(t){let e=this.contains(t);return this.array[0|t]=0|t,!e}contains(t){return null!=this.array[0|t]}remove(t){this.array[0|t]=void 0}clear(){this.array.length=0}},a=class{constructor(){this.entries={},this.size=0}add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var i=0,s=t.length;i1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}static fromString(t){return(new o).setFromString(t)}},h=o;h.WHITE=new o(1,1,1,1),h.RED=new o(1,0,0,1),h.GREEN=new o(0,1,0,1),h.BLUE=new o(0,0,1,1),h.MAGENTA=new o(1,0,1,1);var l=class{static clamp(t,e,i){return ti?i:t}static cosDeg(t){return Math.cos(t*l.degRad)}static sinDeg(t){return Math.sin(t*l.degRad)}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return l.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,i){let s=Math.random(),r=e-t;return s<=(i-t)/r?t+Math.sqrt(s*r*(i-t)):e-Math.sqrt((1-s)*r*(e-i))}static isPowerOfTwo(t){return t&&0==(t&t-1)}},c=l;c.PI=3.1415927,c.PI2=2*l.PI,c.radiansToDegrees=180/l.PI,c.radDeg=l.radiansToDegrees,c.degreesToRadians=l.PI/180,c.degRad=l.degreesToRadians;var u=class{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}},d=class extends u{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}},f=class extends d{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}},p=class{static arrayCopy(t,e,i,s,r){for(let n=e,a=s;n=e?t:p.setArraySize(t,e,i)}static newArray(t,e){let i=new Array(t);for(let s=0;s0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},y=class{constructor(t=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let e=0;e>1)*n;let a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(!l){o.length>0&&(h=o);let a=t.bone,l=a.worldX,c=a.worldY,u=a.a,d=a.b,f=a.c,p=a.d;for(let t=e,a=r;a=this.regions.length&&(i=this.regions.length-1);let s=this.regions[i];e.region!=s&&(e.region=s,e.updateRegion())}getPath(t,e){let i=t,s=(this.start+e).toString();for(let t=this.digits-s.length;t>0;t--)i+="0";return i+=s,i}static nextID(){return M._nextID++}},I=M;I._nextID=0;var E=(t=>(t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse",t))(E||{}),T=[0,1,2,3,4,5,6],k=class{constructor(t,e,i){if(this.timelines=[],this.timelineIds=new a,!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=i}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e0&&(e%=this.duration));let h=this.timelines;for(let s=0,l=h.length;s(t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add",t))(C||{}),R=(t=>(t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut",t))(R||{}),F=0,Y=1,P=2,X=3,L=4,O=5,D=6,B=7,V=8,z=9,N=10,_=11,U=12,W=13,q=14,G=15,j=16,H=17,Z=18,K=19,J=class{constructor(t,e){this.propertyIds=e,this.frames=m.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let i=t.length;for(let s=1;se)return s-1;return i-1}static search(t,e,i){let s=t.length;for(let r=i;re)return r-i;return s-i}},Q=class extends J{constructor(t,e,i){super(t,i),this.curves=m.newFloatArray(t+18*e),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+18*t;if(this.curves.length>e){let t=m.newFloatArray(e);m.arrayCopy(this.curves,0,t,0,e),this.curves=t}}setBezier(t,e,i,s,r,n,a,o,h,l,c){let u=this.curves,d=this.getFrameCount()+18*t;0==i&&(u[e]=2+d);let f=.03*(s-2*n+o),p=.03*(r-2*a+h),m=.006*(3*(n-o)-s+l),g=.006*(3*(a-h)-r+c),x=2*f+m,w=2*p+g,v=.3*(n-s)+f+.16666667*m,y=.3*(a-r)+p+.16666667*g,b=s+v,A=r+y;for(let t=d+18;dt){let n=this.frames[e],a=this.frames[e+i];return a+(t-n)/(r[s]-n)*(r[s+1]-a)}let n=s+18;for(s+=2;s=t){let e=r[s-2],i=r[s-1];return i+(t-e)/(r[s]-e)*(r[s+1]-i)}e+=this.getFrameEntries();let a=r[n-2],o=r[n-1];return o+(t-a)/(this.frames[e]-a)*(this.frames[e+i]-o)}},$=class extends Q{constructor(t,e,i){super(t,e,[i])}getFrameEntries(){return 2}setFrame(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+1]=i}getCurveValue(t){let e=this.frames,i=e.length-2;for(let s=2;s<=i;s+=2)if(e[s]>t){i=s-2;break}let s=this.curves[i>>1];switch(s){case 0:let s=e[i],r=e[i+1];return r+(t-s)/(e[i+2]-s)*(e[i+2+1]-r);case 1:return e[i+1]}return this.getBezierValue(t,i,1,s-2)}},tt=class extends Q{constructor(t,e,i,s){super(t,e,[i,s])}getFrameEntries(){return 3}setFrame(t,e,i,s){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s}},et=class extends ${constructor(t,e,i){super(t,e,F+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,r,n,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i>2];switch(p){case 0:let t=h[f];c=h[f+1],u=h[f+2],d=h[f+3];let e=(i-t)/(h[f+4]-t);c+=(h[f+4+1]-c)*e,u+=(h[f+4+2]-u)*e,d+=(h[f+4+3]-d)*e;break;case 1:c=h[f+1],u=h[f+2],d=h[f+3];break;default:c=this.getBezierValue(i,f,1,p-2),u=this.getBezierValue(i,f,2,p+18-2),d=this.getBezierValue(i,f,3,p+36-2)}if(1==r)l.r=c,l.g=u,l.b=d;else{if(0==n){let t=o.data.color;l.r=t.r,l.g=t.g,l.b=t.b}l.r+=(c-l.r)*r,l.g+=(u-l.g)*r,l.b+=(d-l.b)*r}}},ft=class extends ${constructor(t,e,i){super(t,e,V+"|"+i),this.slotIndex=0,this.slotIndex=i}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.color;if(i>3];switch(v){case 0:let t=h[w];u=h[w+1],d=h[w+2],f=h[w+3],p=h[w+4],m=h[w+5],g=h[w+6],x=h[w+7];let e=(i-t)/(h[w+8]-t);u+=(h[w+8+1]-u)*e,d+=(h[w+8+2]-d)*e,f+=(h[w+8+3]-f)*e,p+=(h[w+8+4]-p)*e,m+=(h[w+8+5]-m)*e,g+=(h[w+8+6]-g)*e,x+=(h[w+8+7]-x)*e;break;case 1:u=h[w+1],d=h[w+2],f=h[w+3],p=h[w+4],m=h[w+5],g=h[w+6],x=h[w+7];break;default:u=this.getBezierValue(i,w,1,v-2),d=this.getBezierValue(i,w,2,v+18-2),f=this.getBezierValue(i,w,3,v+36-2),p=this.getBezierValue(i,w,4,v+54-2),m=this.getBezierValue(i,w,5,v+72-2),g=this.getBezierValue(i,w,6,v+90-2),x=this.getBezierValue(i,w,7,v+108-2)}if(1==r)l.set(u,d,f,p),c.r=m,c.g=g,c.b=x;else{if(0==n){l.setFromColor(o.data.color);let t=o.data.darkColor;c.r=t.r,c.g=t.g,c.b=t.b}l.add((u-l.r)*r,(d-l.g)*r,(f-l.b)*r,(p-l.a)*r),c.r+=(m-c.r)*r,c.g+=(g-c.g)*r,c.b+=(x-c.b)*r}}},mt=class extends Q{constructor(t,e,i){super(t,e,[B+"|"+i,z+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,s,r,n,a,o){t*=7,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=r,this.frames[t+4]=n,this.frames[t+5]=a,this.frames[t+6]=o}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,c=o.darkColor;if(it){let r=this.frames[e];return i[s+1]*(t-r)/(i[s]-r)}let r=s+18;for(s+=2;s=t){let e=i[s-2],r=i[s-1];return r+(t-e)/(i[s]-e)*(i[s+1]-r)}let n=i[r-2],a=i[r-1];return a+(1-a)*(t-n)/(this.frames[e+this.getFrameEntries()]-n)}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.getAttachment();if(!h)return;if(!(h instanceof S)||h.timelineAttachment!=this.attachment)return;let l=o.deform;0==l.length&&(n=0);let c=this.vertices,u=c[0].length,d=this.frames;if(i=d[d.length-1]){let t=c[d.length-1];if(1==r)if(3==n){let e=h;if(e.bones)for(let e=0;ei)this.apply(t,e,Number.MAX_VALUE,s,r,n,a),e=-1;else if(e>=o[h-1])return;if(i0&&o[l-1]==t;)l--}for(;l=o[l];l++)s.push(this.events[l])}},vt=wt;vt.propertyIds=[""+U];var yt=class extends J{constructor(t){super(t,yt.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,s,r,n,a){if(1==a)return void(0==n&&m.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));if(i>2];switch(f){case 0:let t=u[d];h=u[d+1],l=u[d+2],c=u[d+3];let e=(i-t)/(u[d+4]-t);h+=(u[d+4+1]-h)*e,l+=(u[d+4+2]-l)*e,c+=(u[d+4+3]-c)*e;break;case 1:h=u[d+1],l=u[d+2],c=u[d+3];break;default:h=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),c=this.getBezierValue(i,d,3,f+36-2)}if(0==n){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*r,o.mixX=t.mixX+(l-t.mixX)*r,o.mixY=t.mixY+(c-t.mixY)*r}else o.mixRotate+=(h-o.mixRotate)*r,o.mixX+=(l-o.mixX)*r,o.mixY+=(c-o.mixY)*r}},Tt=class extends J{constructor(t,e,i){super(t,[K+"|"+e+"|"+i.sequence.id]),this.slotIndex=e,this.attachment=i}getFrameEntries(){return Tt.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,i,s,r){let n=this.frames;n[t*=Tt.ENTRIES]=e,n[t+Tt.MODE]=i|s<<4,n[t+Tt.DELAY]=r}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.attachment,l=this.attachment;if(!(h==l||h instanceof S&&h.timelineAttachment==l))return;let c=this.frames;if(i>4,g=this.attachment.sequence.regions.length,x=T[15&f];if(0!=x)switch(m+=(i-d)/p+1e-5|0,x){case 1:m=Math.min(g-1,m);break;case 2:m%=g;break;case 3:{let t=(g<<1)-2;m=0==t?0:m%t,m>=g&&(m=t-m);break}case 4:m=Math.max(g-1-m,0);break;case 5:m=g-1-m%g;break;case 6:{let t=(g<<1)-2;m=0==t?0:(m+g-1)%t,m>=g&&(m=t-m)}}o.sequenceIndex=m}},kt=Tt;kt.ENTRIES=3,kt.MODE=1,kt.DELAY=2;var Ct=class{constructor(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Yt(this),this.propertyIDs=new a,this.animationsChanged=!1,this.trackEntryPool=new x((()=>new Ft)),this.data=t}static emptyAnimation(){return Ct._emptyAnimation}update(t){t*=this.timeScale;let e=this.tracks;for(let i=0,s=e.length;i0){if(s.delay-=r,s.delay>0)continue;r=-s.delay,s.delay=0}let n=s.next;if(n){let e=s.trackLast-n.delay;if(e>=0){for(n.delay=0,n.trackTime+=0==s.timeScale?0:(e/s.timeScale+t)*n.timeScale,s.trackTime+=r,this.setCurrent(i,n,!0);n.mixingFrom;)n.mixTime+=t,n=n.mixingFrom;continue}}else if(s.trackLast>=s.trackEnd&&!s.mixingFrom){e[i]=null,this.queue.end(s),this.clearNext(s);continue}if(s.mixingFrom&&this.updateMixingFrom(s,t)){let t=s.mixingFrom;for(s.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}s.trackTime+=r}this.queue.drain()}updateMixingFrom(t,e){let i=t.mixingFrom;if(!i)return!0;let s=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),s):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,i=this.tracks,s=!1;for(let n=0,a=i.length;n0)continue;s=!0;let o=0==n?1:a.mixBlend,h=a.alpha;a.mixingFrom?h*=this.applyMixingFrom(a,t,o):a.trackTime>=a.trackEnd&&!a.next&&(h=0);let l=a.animationLast,c=a.getAnimationTime(),u=c,d=e;a.reverse&&(u=a.animation.duration-u,d=null);let f=a.animation.timelines,p=f.length;if(0==n&&1==h||3==o)for(let e=0;e1&&(r=1),1!=i&&(i=s.mixBlend));let n=r0&&this.queueEvents(s,d),this.events.length=0,s.nextAnimationLast=d,s.nextTrackLast=s.trackTime,r}applyAttachmentTimeline(t,e,i,s,r){var n=e.slots[t.slotIndex];n.bone.active&&(i0,s=t>=0;c.signum(e)!=c.signum(f)&&Math.abs(e)<=90&&(Math.abs(t)>180&&(t+=360*c.signum(t)),s=i),d=f+t-t%360,s!=i&&(d+=360*c.signum(t)),n[a]=d}n[a+1]=f,h.rotation=l+d*s}queueEvents(t,e){let i=t.animationStart,s=t.animationEnd,r=s-i,n=t.trackLast%r,a=this.events,o=0,h=a.length;for(;os||this.queue.event(t,e)}let l=!1;for(l=t.loop?0==r||n>t.trackTime%r:e>=s&&t.animationLast=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let i=e;for(;;){let t=i.mixingFrom;if(!t)break;this.queue.end(t),i.mixingFrom=null,i.mixingTo=null,i=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,i){let s=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,s&&(i&&this.queue.interrupt(s),e.mixingFrom=s,s.mixingTo=e,e.mixTime=0,s.mixingFrom&&s.mixDuration>0&&(e.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,i=!1){let s=this.data.skeletonData.findAnimation(e);if(!s)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,s,i)}setAnimationWith(t,e,i=!1){if(!e)throw new Error("animation cannot be null.");let s=!0,r=this.expandToIndex(t);r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,s=!1):this.clearNext(r));let n=this.trackEntry(t,e,i,r);return this.setCurrent(t,n,s),this.queue.drain(),n}addAnimation(t,e,i=!1,s=0){let r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,i,s)}addAnimationWith(t,e,i=!1,s=0){if(!e)throw new Error("animation cannot be null.");let r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;let n=this.trackEntry(t,e,i,r);return r?(r.next=n,n.previous=r,s<=0&&(s+=r.getTrackComplete()-n.mixDuration)):(this.setCurrent(t,n,!0),this.queue.drain()),n.delay=s,n}setEmptyAnimation(t,e=0){let i=this.setAnimationWith(t,Ct.emptyAnimation(),!1);return i.mixDuration=e,i.trackEnd=e,i}addEmptyAnimation(t,e=0,i=0){let s=this.addAnimationWith(t,Ct.emptyAnimation(),!1,i);return i<=0&&(s.delay+=s.mixDuration-e),s.mixDuration=e,s.trackEnd=e,s}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e0){r[o]=Vt,n[o]=i;continue t}break}r[o]=Bt}else r[o]=Lt}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},Rt=Ct;Rt._emptyAnimation=new k("",[],0);var Ft=class{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=2,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime(t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event",t))(Pt||{}),Xt=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}},Lt=0,Ot=1,Dt=2,Bt=3,Vt=4,zt=1,Nt=2,_t=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,i){let s=this.skeletonData.findAnimation(t);if(!s)throw new Error("Animation not found: "+t);let r=this.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);this.setMixWith(s,r,i)}setMixWith(t,e,i){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let s=t.name+"."+e.name;this.animationToMixTime[s]=i}getMix(t,e){let i=t.name+"."+e.name,s=this.animationToMixTime[i];return void 0===s?this.defaultMix:s}},Ut=class extends S{constructor(t){super(t),this.color=new h(1,1,1,1)}copy(){let t=new Ut(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},Wt=class extends S{constructor(t){super(t),this.endSlot=null,this.color=new h(.2275,.2275,.8078,1)}copy(){let t=new Wt(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},qt=class{constructor(t){this._image=t}getImage(){return this._image}},Gt=(t=>(t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear",t))(Gt||{}),jt=(t=>(t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat",t))(jt||{}),Ht=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},Zt=class extends qt{setFilters(t,e){}setWraps(t,e){}dispose(){}},Kt=class{constructor(t){this.pages=new Array,this.regions=new Array;let e=new Jt(t),i=new Array(4),s={size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},format:()=>{},filter:t=>{t.minFilter=m.enumValue(Gt,i[1]),t.magFilter=m.enumValue(Gt,i[2])},repeat:t=>{-1!=i[1].indexOf("x")&&(t.uWrap=10497),-1!=i[1].indexOf("y")&&(t.vWrap=10497)},pma:t=>{t.pma="true"==i[1]}};var r={xy:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2])},size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},bounds:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2]),t.width=parseInt(i[3]),t.height=parseInt(i[4])},offset:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2])},orig:t=>{t.originalWidth=parseInt(i[1]),t.originalHeight=parseInt(i[2])},offsets:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2]),t.originalWidth=parseInt(i[3]),t.originalHeight=parseInt(i[4])},rotate:t=>{let e=i[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:t=>{t.index=parseInt(i[1])}};let n=e.readLine();for(;n&&0==n.trim().length;)n=e.readLine();for(;n&&0!=n.trim().length&&0!=e.readEntry(i,n);)n=e.readLine();let a=null,o=null,h=null;for(;null!==n;)if(0==n.trim().length)a=null,n=e.readLine();else if(a){let t=new $t(a,n);for(;;){let s=e.readEntry(i,n=e.readLine());if(0==s)break;let a=r[i[0]];if(a)a(t);else{o||(o=[]),h||(h=[]),o.push(i[0]);let t=[];for(let e=0;e0&&h&&h.length>0&&(t.names=o,t.values=h,o=null,h=null),t.u=t.x/a.width,t.v=t.y/a.height,90==t.degrees?(t.u2=(t.x+t.height)/a.width,t.v2=(t.y+t.width)/a.height):(t.u2=(t.x+t.width)/a.width,t.v2=(t.y+t.height)/a.height),this.regions.push(t)}else{for(a=new Qt(n.trim());0!=e.readEntry(i,n=e.readLine());){let t=s[i[0]];t&&t(a)}this.pages.push(a)}}findRegion(t){for(let e=0;e=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;let i=e.indexOf(":");if(-1==i)return 0;t[0]=e.substr(0,i).trim();for(let s=1,r=i+1;;s++){let i=e.indexOf(",",r);if(-1==i)return t[s]=e.substr(r).trim(),s;if(t[s]=e.substr(r,i-r).trim(),r=i+1,4==s)return 4}}},Qt=class{constructor(t){this.minFilter=9728,this.magFilter=9728,this.uWrap=33071,this.vWrap=33071,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}},$t=class extends Ht{constructor(t,e){super(),this.x=0,this.y=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.index=0,this.degrees=0,this.names=null,this.values=null,this.page=t,this.name=e}},te=class extends S{constructor(t,e){super(t),this.region=null,this.regionUVs=[],this.uvs=[],this.triangles=[],this.color=new h(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=[],this.parentMesh=null,this.sequence=null,this.tempColor=new h(0,0,0,0),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=m.newFloatArray(t.length));let e=this.uvs,i=this.uvs.length,s=this.region.u,r=this.region.v,n=0,a=0;if(this.region instanceof $t){let o=this.region,h=o.page.texture.getImage(),l=h.width,c=h.height;switch(o.degrees){case 90:s-=(o.originalHeight-o.offsetY-o.height)/l,r-=(o.originalWidth-o.offsetX-o.width)/c,n=o.originalHeight/l,a=o.originalWidth/c;for(let o=0;o= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}},oe=(t=>(t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection",t))(oe||{}),he=class{constructor(t,e,i){if(this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,s,r,n,a){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=s,this.ascaleY=r,this.ashearX=n,this.ashearY=a;let o=this.parent;if(!o){let o=this.skeleton,h=i+90+a,l=o.scaleX,u=o.scaleY;return this.a=c.cosDeg(i+n)*s*l,this.b=c.cosDeg(h)*r*l,this.c=c.sinDeg(i+n)*s*u,this.d=c.sinDeg(h)*r*u,this.worldX=t*l+o.x,void(this.worldY=e*u+o.y)}let h=o.a,l=o.b,u=o.c,d=o.d;switch(this.worldX=h*t+l*e+o.worldX,this.worldY=u*t+d*e+o.worldY,this.data.transformMode){case 0:{let t=i+90+a,e=c.cosDeg(i+n)*s,o=c.cosDeg(t)*r,f=c.sinDeg(i+n)*s,p=c.sinDeg(t)*r;return this.a=h*e+l*f,this.b=h*o+l*p,this.c=u*e+d*f,void(this.d=u*o+d*p)}case 1:{let t=i+90+a;this.a=c.cosDeg(i+n)*s,this.b=c.cosDeg(t)*r,this.c=c.sinDeg(i+n)*s,this.d=c.sinDeg(t)*r;break}case 2:{let t=h*h+u*u,e=0;t>1e-4?(t=Math.abs(h*d-l*u)/t,h/=this.skeleton.scaleX,u/=this.skeleton.scaleY,l=u*t,d=h*t,e=Math.atan2(u,h)*c.radDeg):(h=0,u=0,e=90-Math.atan2(d,l)*c.radDeg);let o=i+n-e,f=i+a-e+90,p=c.cosDeg(o)*s,m=c.cosDeg(f)*r,g=c.sinDeg(o)*s,x=c.sinDeg(f)*r;this.a=h*p-l*g,this.b=h*m-l*x,this.c=u*p+d*g,this.d=u*m+d*x;break}case 3:case 4:{let t=c.cosDeg(i),e=c.sinDeg(i),o=(h*t+l*e)/this.skeleton.scaleX,f=(u*t+d*e)/this.skeleton.scaleY,p=Math.sqrt(o*o+f*f);p>1e-5&&(p=1/p),o*=p,f*=p,p=Math.sqrt(o*o+f*f),3==this.data.transformMode&&h*d-l*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let m=Math.PI/2+Math.atan2(f,o),g=Math.cos(m)*p,x=Math.sin(m)*p,w=c.cosDeg(n)*s,v=c.cosDeg(90+a)*r,y=c.sinDeg(n)*s,b=c.sinDeg(90+a)*r;this.a=o*w+g*y,this.b=o*v+g*b,this.c=f*w+x*y,this.d=f*v+x*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.c,this.a)*c.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*c.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){let t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*c.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*c.radDeg);let e=t.a,i=t.b,s=t.c,r=t.d,n=1/(e*r-i*s),a=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=a*r*n-o*i*n,this.ay=o*e*n-a*s*n;let h=n*r,l=n*e,u=n*i,d=n*s,f=h*this.a-u*this.c,p=h*this.b-u*this.d,m=l*this.c-d*this.a,g=l*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let t=f*g-p*m;this.ascaleY=t/this.ascaleX,this.ashearY=Math.atan2(f*p+m*g,t)*c.radDeg,this.arotation=Math.atan2(m,f)*c.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*c.radDeg}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),i=t.x-this.worldX,s=t.y-this.worldY;return t.x=i*this.d*e-s*this.b*e,t.y=s*this.a*e-i*this.c*e,t}localToWorld(t){let e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t}worldToLocalRotation(t){let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(this.a*e-this.c*i,this.d*i-this.b*e)*c.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(i*this.c+e*this.d,i*this.a+e*this.b)*c.radDeg}rotateWorld(t){let e=this.a,i=this.b,s=this.c,r=this.d,n=c.cosDeg(t),a=c.sinDeg(t);this.a=n*e-a*s,this.b=n*i-a*r,this.c=a*e+n*s,this.d=a*i+n*r}},le=class{constructor(t,e,i){this.name=t,this.order=e,this.skinRequired=i}},ce=class{constructor(t,e="",i=new ue){this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e,this.downloader=i}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,i){this.toLoad--,this.loaded++,this.assets[e]=i,t&&t(e,i)}error(t,e,i){this.toLoad--,this.loaded++,this.errors[e]=i,t&&t(e,i)}loadAll(){return new Promise(((t,e)=>{let i=()=>{this.isLoadingComplete()?this.hasErrors()?e(this.errors):t(this):requestAnimationFrame(i)};requestAnimationFrame(i)}))}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadBinary(t,(i=>{this.success(e,t,i)}),((e,s)=>{this.error(i,t,`Couldn't load binary ${t}: status ${e}, ${s}`)}))}loadText(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadText(t,(i=>{this.success(e,t,i)}),((e,s)=>{this.error(i,t,`Couldn't load text ${t}: status ${e}, ${s}`)}))}loadJson(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadJson(t,(i=>{this.success(e,t,i)}),((e,s)=>{this.error(i,t,`Couldn't load JSON ${t}: status ${e}, ${s}`)}))}loadTexture(t,e=(()=>{}),i=(()=>{})){if(t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then((e=>e.ok?e.blob():(this.error(i,t,`Couldn't load image: ${t}`),null))).then((t=>t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null)).then((i=>{i&&this.success(e,t,this.textureLoader(i))}));else{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>{this.success(e,t,this.textureLoader(s))},s.onerror=()=>{this.error(i,t,`Couldn't load image: ${t}`)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),s.src=t}}loadTextureAtlas(t,e=(()=>{}),i=(()=>{}),s){let r=t.lastIndexOf("/"),n=r>=0?t.substring(0,r+1):"";t=this.start(t),this.downloader.downloadText(t,(r=>{try{let a=new Kt(r),o=a.pages.length,h=!1;for(let r of a.pages)this.loadTexture(s?s[r.name]:n+r.name,((i,s)=>{h||(r.setTexture(s),0==--o&&this.success(e,t,a))}),((e,s)=>{h||this.error(i,t,`Couldn't load texture atlas ${t} page image: ${e}`),h=!0}))}catch(e){this.error(i,t,`Couldn't parse texture atlas ${t}: ${e.message}`)}}),((e,s)=>{this.error(i,t,`Couldn't load texture atlas ${t}: status ${e}, ${s}`)}))}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let e=this.assets[t];if(e)return e;let i=this.errors[t];throw Error("Asset not found: "+t+(i?"\n"+i:""))}remove(t){t=this.pathPrefix+t;let e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}removeAll(){for(let t in this.assets){let e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}isLoadingComplete(){return 0==this.toLoad}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},ue=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return-1!=e?(e+="base64,".length,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var e=window.atob(t),i=e.length,s=new Uint8Array(i),r=0;r{this.finish(t,s.status,s.responseText)};s.onload=r,s.onerror=r,s.send()}downloadJson(t,e,i){this.downloadText(t,(t=>{e(JSON.parse(t))}),i)}downloadBinary(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType="arraybuffer";let r=()=>{this.finish(t,s.status,s.response)};s.onload=()=>{200==s.status||0==s.status?this.finish(t,200,new Uint8Array(s.response)):r()},s.onerror=r,s.send()}start(t,e,i){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,i)}}finish(t,e,i){let s=this.callbacks[t];delete this.callbacks[t];let r=200==e||0==e?[i]:[e,i];for(let t=r.length-1,e=s.length;t180?f-=360:f<-180&&(f+=360);let g=t.ascaleX,x=t.ascaleY;if(s||r){switch(t.data.transformMode){case 3:case 4:p=e-t.worldX,m=i-t.worldY}let o=t.data.length*g,h=Math.sqrt(p*p+m*m);if(s&&ho&&o>1e-4){let t=(h/o-1)*a+1;g*=t,n&&(x*=t)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*a,g,x,t.ashearX,t.ashearY)}apply2(t,e,i,s,r,n,a,o,h){let l=t.ax,u=t.ay,d=t.ascaleX,f=t.ascaleY,p=d,m=f,g=e.ascaleX,x=0,w=0,v=0;d<0?(d=-d,x=180,v=-1):(x=0,v=1),f<0&&(f=-f,v=-v),g<0?(g=-g,w=180):w=0;let y=e.ax,b=0,A=0,S=0,M=t.a,I=t.b,E=t.c,T=t.d,k=Math.abs(d-f)<=1e-4;!k||n?(b=0,A=M*y+t.worldX,S=E*y+t.worldY):(b=e.ay,A=M*y+I*b+t.worldX,S=E*y+T*b+t.worldY);let C=t.parent;if(!C)throw new Error("IK parent must itself have a parent.");M=C.a,I=C.b,E=C.c,T=C.d;let R,F,Y=1/(M*T-I*E),P=A-C.worldX,X=S-C.worldY,L=(P*T-X*I)*Y-l,O=(X*M-P*E)*Y-u,D=Math.sqrt(L*L+O*O),B=e.data.length*g;if(D<1e-4)return this.apply1(t,i,s,!1,n,!1,h),void e.updateWorldTransformWith(y,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);P=i-C.worldX,X=s-C.worldY;let V=(P*T-X*I)*Y-l,z=(X*M-P*E)*Y-u,N=V*V+z*z;if(0!=o){o*=d*(g+1)*.5;let t=Math.sqrt(N),e=t-D-B*d+o;if(e>0){let i=Math.min(1,e/(2*o))-1;i=(e-o*(1-i*i))/t,V-=i*V,z-=i*z,N=V*V+z*z}}t:if(k){B*=d;let t=(N-D*D-B*B)/(2*D*B);t<-1?(t=-1,F=Math.PI*r):t>1?(t=1,F=0,n&&(M=(Math.sqrt(N)/(D+B)-1)*h+1,p*=M,a&&(m*=M))):F=Math.acos(t)*r,M=D+B*t,I=B*Math.sin(F),R=Math.atan2(z*M-V*I,V*M+z*I)}else{M=d*B,I=f*B;let t=M*M,e=I*I,i=Math.atan2(z,V);E=e*D*D+t*N-t*e;let s=-2*e*D,n=e-t;if(T=s*s-4*n*E,T>=0){let t=Math.sqrt(T);s<0&&(t=-t),t=.5*-(s+t);let e=t/n,a=E/t,o=Math.abs(e)=-1&&E<=1&&(E=Math.acos(E),P=M*Math.cos(E)+D,X=I*Math.sin(E),T=P*P+X*X,Tm&&(u=E,m=T,p=P,g=X)),N<=.5*(h+m)?(R=i-Math.atan2(l*r,o),F=a*r):(R=i-Math.atan2(g*r,p),F=u*r)}let _=Math.atan2(b,y)*v,U=t.arotation;R=(R-_)*c.radDeg+x-U,R>180?R-=360:R<-180&&(R+=360),t.updateWorldTransformWith(l,u,U+R*h,p,m,0,0),U=e.arotation,F=((F+_)*c.radDeg-e.ashearX)*v+w-U,F>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(y,b,U+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}},me=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},ge=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.positionMode=xe.Fixed,this.spacingMode=we.Fixed,this.rotateMode=ve.Chain,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}},xe=(t=>(t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent",t))(xe||{}),we=(t=>(t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional",t))(we||{}),ve=(t=>(t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale",t))(ve||{}),ye=class{constructor(t,e){if(this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0,s=t.bones.length;i0){t=l/t*f;for(let e=1;e0?c.degRad:-c.degRad}for(let t=0,r=3;t0){let i=h.a,s=h.b,a=h.c,o=h.d,l=0,d=0,f=0;if(l=n?p[r-1]:0==u[t+1]?p[r+2]:Math.atan2(y,m),l-=Math.atan2(a,i),v){d=Math.cos(l),f=Math.sin(l);let t=h.data.length;g+=(t*(d*i-f*a)-m)*e,x+=(t*(f*i+d*a)-y)*e}else l+=w;l>c.PI?l-=c.PI2:l<-c.PI&&(l+=c.PI2),l*=e,d=Math.cos(l),f=Math.sin(l),h.a=d*i-f*a,h.b=d*s-f*o,h.c=f*i+d*a,h.d=f*s+d*o}h.updateAppliedTransform()}}computeWorldPositions(t,e,i){let s=this.target,r=this.position,n=this.spaces,a=m.setArraySize(this.positions,3*e+2),o=this.world,h=t.closed,l=t.worldVerticesLength,c=l/6,u=ye.NONE;if(!t.constantSpeed){let d=t.lengths;c-=h?1:2;let f,p=d[c];switch(1==this.data.positionMode&&(r*=p),this.data.spacingMode){case 2:f=p;break;case 3:f=p/e;break;default:f=1}o=m.setArraySize(this.world,8);for(let m=0,g=0,x=0;mp){u!=ye.AFTER&&(u=ye.AFTER,t.computeWorldVertices(s,l-6,4,o,0,2)),this.addAfterPosition(w-p,o,0,a,g);continue}}for(;;x++){let t=d[x];if(!(w>t)){if(0==x)w/=t;else{let e=d[x-1];w=(w-e)/(t-e)}break}}x!=u&&(u=x,h&&x==c?(t.computeWorldVertices(s,l-4,4,o,0,2),t.computeWorldVertices(s,0,4,o,4,2)):t.computeWorldVertices(s,6*x+2,8,o,0,2)),this.addCurvePosition(w,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],a,g,i||m>0&&0==e)}return a}h?(l+=2,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l-4,o,0,2),t.computeWorldVertices(s,0,2,o,l-4,2),o[l-2]=o[0],o[l-1]=o[1]):(c--,l-=4,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l,o,0,2));let d,f=m.setArraySize(this.curves,c),p=0,g=o[0],x=o[1],w=0,v=0,y=0,b=0,A=0,S=0,M=0,I=0,E=0,T=0,k=0,C=0,R=0,F=0;for(let t=0,e=2;tp){this.addAfterPosition(X-p,o,l-4,a,s);continue}}for(;;c++){let t=f[c];if(!(X>t)){if(0==c)X/=t;else{let e=f[c-1];X=(X-e)/(t-e)}break}}if(c!=u){u=c;let t=6*c;for(g=o[t],x=o[t+1],w=o[t+2],v=o[t+3],y=o[t+4],b=o[t+5],A=o[t+6],S=o[t+7],M=.03*(g-2*w+y),I=.03*(x-2*v+b),E=.006*(3*(w-y)-g+A),T=.006*(3*(v-b)-x+S),k=2*M+E,C=2*I+T,R=.3*(w-g)+M+.16666667*E,F=.3*(v-x)+I+.16666667*T,P=Math.sqrt(R*R+F*F),Y[0]=P,t=1;t<8;t++)R+=k,F+=C,k+=E,C+=T,P+=Math.sqrt(R*R+F*F),Y[t]=P;R+=k,F+=C,P+=Math.sqrt(R*R+F*F),Y[8]=P,R+=k+E,F+=C+T,P+=Math.sqrt(R*R+F*F),Y[9]=P,m=0}for(X*=P;;m++){let t=Y[m];if(!(X>t)){if(0==m)X/=t;else{let e=Y[m-1];X=m+(X-e)/(t-e)}break}}this.addCurvePosition(.1*X,g,x,w,v,y,b,A,S,a,s,i||t>0&&0==e)}return a}addBeforePosition(t,e,i,s,r){let n=e[i],a=e[i+1],o=e[i+2]-n,h=e[i+3]-a,l=Math.atan2(h,o);s[r]=n+t*Math.cos(l),s[r+1]=a+t*Math.sin(l),s[r+2]=l}addAfterPosition(t,e,i,s,r){let n=e[i+2],a=e[i+3],o=n-e[i],h=a-e[i+1],l=Math.atan2(h,o);s[r]=n+t*Math.cos(l),s[r+1]=a+t*Math.sin(l),s[r+2]=l}addCurvePosition(t,e,i,s,r,n,a,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=i,void(l[c+2]=Math.atan2(r-i,s-e));let d=t*t,f=d*t,p=1-t,m=p*p,g=m*p,x=p*t,w=3*x,v=p*w,y=w*t,b=e*g+s*v+n*y+o*f,A=i*g+r*v+a*y+h*f;l[c]=b,l[c+1]=A,u&&(l[c+2]=t<.001?Math.atan2(r-i,s-e):Math.atan2(A-(i*m+r*x*2+a*d),b-(e*m+s*x*2+n*d)))}},be=ye;be.NONE=-1,be.BEFORE=-2,be.AFTER=-3,be.epsilon=1e-5;var Ae=class{constructor(t,e){if(this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new h,this.darkColor=t.darkColor?new h:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(t instanceof S&&this.attachment instanceof S&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},Se=class{constructor(t,e){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new w,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(let i=0;i0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;fc.PI?n-=c.PI2:n<-c.PI&&(n+=c.PI2),n*=t;let a=Math.cos(n),o=Math.sin(n);x.a=a*e-o*s,x.b=a*i-o*r,x.c=o*e+a*s,x.d=o*i+a*r}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(t.x-x.worldX)*e,x.worldY+=(t.y-x.worldY)*i}if(0!=s){let t=Math.sqrt(x.a*x.a+x.c*x.c);0!=t&&(t=(t+(Math.sqrt(h*h+u*u)-t+this.data.offsetScaleX)*s)/t),x.a*=t,x.c*=t}if(0!=r){let t=Math.sqrt(x.b*x.b+x.d*x.d);0!=t&&(t=(t+(Math.sqrt(l*l+d*d)-t+this.data.offsetScaleY)*r)/t),x.b*=t,x.d*=t}if(n>0){let t=x.b,e=x.d,i=Math.atan2(e,t),s=Math.atan2(d,l)-Math.atan2(u,h)-(i-Math.atan2(x.c,x.a));s>c.PI?s-=c.PI2:s<-c.PI&&(s+=c.PI2),s=i+(s+m)*n;let r=Math.sqrt(t*t+e*e);x.b=Math.cos(s)*r,x.d=Math.sin(s)*r}x.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,r=this.mixScaleY,n=this.mixShearY,a=0!=e||0!=i,o=this.target,h=o.a,l=o.b,u=o.c,d=o.d,f=h*d-l*u>0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;fc.PI?n-=c.PI2:n<-c.PI&&(n+=c.PI2),n*=t;let a=Math.cos(n),o=Math.sin(n);x.a=a*e-o*s,x.b=a*i-o*r,x.c=o*e+a*s,x.d=o*i+a*r}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=t.x*e,x.worldY+=t.y*i}if(0!=s){let t=(Math.sqrt(h*h+u*u)-1+this.data.offsetScaleX)*s+1;x.a*=t,x.c*=t}if(0!=r){let t=(Math.sqrt(l*l+d*d)-1+this.data.offsetScaleY)*r+1;x.b*=t,x.d*=t}if(n>0){let t=Math.atan2(d,l)-Math.atan2(u,h);t>c.PI?t-=c.PI2:t<-c.PI&&(t+=c.PI2);let e=x.b,i=x.d;t=Math.atan2(i,e)+(t-c.PI/2+m)*n;let s=Math.sqrt(e*e+i*i);x.b=Math.cos(t)*s,x.d=Math.sin(t)*s}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,r=this.mixScaleY,n=this.mixShearY,a=this.target,o=this.bones;for(let h=0,l=o.length;h=s.length&&(s.length=t+1),s[t]||(s[t]={}),s[t][e]=i}addSkin(t){for(let e=0;e= 0.");if(!e)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}},Re=(t=>(t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen",t))(Re||{}),Fe=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Ye=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new Ee;i.name="";let s=new Pe(t),r=s.readInt32(),n=s.readInt32();i.hash=0==n&&0==r?null:n.toString(16)+r.toString(16),i.version=s.readString(),i.x=s.readFloat(),i.y=s.readFloat(),i.width=s.readFloat(),i.height=s.readFloat();let a=s.readBoolean();a&&(i.fps=s.readFloat(),i.imagesPath=s.readString(),i.audioPath=s.readString());let o=0;o=s.readInt(!0);for(let t=0;t>4,t.readFloat())}s.push(e);break}}}}}let n=t.readInt(!0);if(n>0){let e=new bt(n),r=i.slots.length;for(let i=0;i=0;t--)a[t]=-1;let o=m.newArray(r-n,0),h=0,l=0;for(let e=0;e=0;t--)-1==a[t]&&(a[t]=o[--l]);e.setFrame(i,s,a)}s.push(e)}let a=t.readInt(!0);if(a>0){let e=new vt(a);for(let s=0;s>>1^-(1&i)}readStringRef(){let t=this.readInt(!0);return 0==t?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&t)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(t),i++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return 0!=this.readByte()}},Xe=class{constructor(t,e,i,s,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=s,this.inheritTimeline=r}},Le=class{constructor(t=null,e=null){this.bones=t,this.vertices=e}},Oe=(t=>(t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping",t))(Oe||{});function De(t,e,i){let s=t.readFloat(),r=t.readFloat()*i;for(let n=0,a=0,o=e.getFrameCount()-1;e.setFrame(n,s,r),n!=o;n++){let o=t.readFloat(),h=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(n);break;case li:Ve(t,e,a++,n,0,s,o,r,h,i)}s=o,r=h}return e}function Be(t,e,i){let s=t.readFloat(),r=t.readFloat()*i,n=t.readFloat()*i;for(let a=0,o=0,h=e.getFrameCount()-1;e.setFrame(a,s,r,n),a!=h;a++){let h=t.readFloat(),l=t.readFloat()*i,c=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(a);break;case li:Ve(t,e,o++,a,0,s,h,r,l,i),Ve(t,e,o++,a,1,s,h,n,c,i)}s=h,r=l,n=c}return e}function Ve(t,e,i,s,r,n,a,o,h,l){e.setBezier(i,s,r,n,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,a,h)}var ze,Ne=0,_e=1,Ue=2,We=3,qe=4,Ge=5,je=6,He=7,Ze=8,Ke=9,Je=0,Qe=1,$e=2,ti=3,ei=4,ii=5,si=0,ri=1,ni=0,ai=1,oi=2,hi=1,li=2,ci=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new x((()=>m.newFloatArray(16)))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");let i=this.boundingBoxes,s=this.polygons,r=this.polygonPool,n=t.slots,a=n.length;i.length=0,r.freeAll(s),s.length=0;for(let t=0;t=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,i,s){let r=this.minX,n=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&i<=r||e<=n&&s<=n||t>=a&&i>=a||e>=o&&s>=o)return!1;let h=(s-e)/(i-t),l=h*(r-t)+e;if(l>n&&ln&&lr&&cr&&ct.minX&&this.minYt.minY}containsPoint(t,e){let i=this.polygons;for(let s=0,r=i.length;s=i||o=i){let h=s[t];h+(i-r)/(o-r)*(s[n]-h)=c&&x<=a||x>=a&&x<=c)&&(x>=e&&x<=s||x>=s&&x<=e)){let t=(l*m-h*f)/g;if((t>=u&&t<=d||t>=d&&t<=u)&&(t>=i&&t<=r||t>=r&&t<=i))return!0}c=a,u=d}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},ui=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new x((()=>new Array)),this.polygonIndicesPool=new x((()=>new Array))}triangulate(t){let e=t,i=t.length>>1,s=this.indicesArray;s.length=0;for(let t=0;t3;){let t=i-1,a=0,o=1;for(;;){t:if(!r[a]){let n=s[t]<<1,h=s[a]<<1,l=s[o]<<1,c=e[n],u=e[n+1],d=e[h],f=e[h+1],p=e[l],m=e[l+1];for(let n=(o+1)%i;n!=t;n=(n+1)%i){if(!r[n])continue;let t=s[n]<<1,i=e[t],a=e[t+1];if(ui.positiveArea(p,m,c,u,i,a)&&ui.positiveArea(c,u,d,f,i,a)&&ui.positiveArea(d,f,p,m,i,a))break t}break}if(0==o){do{if(!r[a])break;a--}while(a>0);break}t=a,a=o,o=(o+1)%i}n.push(s[(i+a-1)%i]),n.push(s[a]),n.push(s[(a+1)%i]),s.splice(a,1),r.splice(a,1),i--;let h=(i+a-1)%i,l=a==i?0:a;r[h]=ui.isConcave(h,i,e,s),r[l]=ui.isConcave(l,i,e,s)}return 3==i&&(n.push(s[2]),n.push(s[0]),n.push(s[1])),n}decompose(t,e){let i=t,s=this.convexPolygons;this.polygonPool.freeAll(s),s.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let n=this.polygonIndicesPool.obtain();n.length=0;let a=this.polygonPool.obtain();a.length=0;let o=-1,h=0;for(let t=0,l=e.length;t0?(s.push(a),r.push(n)):(this.polygonPool.free(a),this.polygonIndicesPool.free(n)),a=this.polygonPool.obtain(),a.length=0,a.push(d),a.push(f),a.push(p),a.push(m),a.push(g),a.push(x),n=this.polygonIndicesPool.obtain(),n.length=0,n.push(l),n.push(c),n.push(u),h=ui.winding(d,f,p,m,g,x),o=l)}a.length>0&&(s.push(a),r.push(n));for(let t=0,e=s.length;t=0;t--)a=s[t],0==a.length&&(s.splice(t,1),this.polygonPool.free(a),n=r[t],r.splice(t,1),this.polygonIndicesPool.free(n));return s}static isConcave(t,e,i,s){let r=s[(e+t-1)%e]<<1,n=s[t]<<1,a=s[(t+1)%e]<<1;return!this.positiveArea(i[r],i[r+1],i[n],i[n+1],i[a],i[a+1])}static positiveArea(t,e,i,s,r,n){return t*(n-s)+i*(e-n)+r*(s-e)>=0}static winding(t,e,i,s,r,n){let a=i-t,o=s-e;return r*o-n*a+a*e-t*o>=0?1:-1}},di=class{constructor(){this.triangulator=new ui,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let i=e.worldVerticesLength,s=m.setArraySize(this.clippingPolygon,i);e.computeWorldVertices(t,0,i,s,0,2);let r=this.clippingPolygon;di.makeClockwise(r);let n=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let t=0,e=n.length;t>1,C=this.clipOutput,R=m.setArraySize(l,e+k*f);for(let h=0;h=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(i),h.push(s),h.push(r),h.push(n),h.push(t),h.push(e),o.length=0;let u=a,d=a.length-4;for(let t=0;;t+=2){let e=u[t],i=u[t+1],s=u[t+2],r=u[t+3],n=e-s,a=i-r,f=h,p=h.length-2,m=o.length;for(let t=0;t0;if(n*(l-r)-a*(h-s)>0){if(p){o.push(u),o.push(d);continue}let t=d-l,n=u-h,a=t*(s-e)-n*(r-i);if(Math.abs(a)>1e-6){let c=(n*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(r-i)*c)}else o.push(e),o.push(i)}else if(p){let t=d-l,n=u-h,a=t*(s-e)-n*(r-i);if(Math.abs(a)>1e-6){let c=(n*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(r-i)*c)}else o.push(e),o.push(i);o.push(u),o.push(d)}c=!0}if(m==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),t==d)break;let g=o;(o=h).length=0,h=g}if(l!=o){l.length=0;for(let t=0,e=o.length-2;t>1;t=0;e--)-1==o[e]&&(o[e]=t[--r])}e.setFrame(n,wi(a,"time",0),o)}r.push(e)}if(t.events){let e=new vt(t.events.length),s=0;for(let r=0;r{t&&t.preventDefault()})),i.addEventListener("webglcontextrestored",(t=>{for(let t=0,e=this.restorables.length;t-1&&this.restorables.splice(e,1)}},yi=771,bi=class{static getDestGLBlendMode(t){switch(t){case 0:case 2:case 3:return yi;case 1:return 1;default:throw new Error("Unknown blend mode: "+t)}}static getSourceColorGLBlendMode(t,e=!1){switch(t){case 0:case 1:return e?1:770;case 2:return 774;case 3:return 1;default:throw new Error("Unknown blend mode: "+t)}}static getSourceAlphaGLBlendMode(t){switch(t){case 0:case 1:return 1;case 2:return yi;case 3:return 769;default:throw new Error("Unknown blend mode: "+t)}}},Ai=class extends qt{constructor(t,e,i=!1){super(e),this.texture=null,this.boundUnit=0,this.useMipMaps=!1,this.context=t instanceof vi?t:new vi(t),this.useMipMaps=i,this.restore(),this.context.addRestorable(this)}setFilters(t,e){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,Ai.validateMagFilter(e)),this.useMipMaps=Ai.usesMipMaps(t),this.useMipMaps&&i.generateMipmap(i.TEXTURE_2D)}static validateMagFilter(t){switch(t){case 9987:case 9987:case 9985:case 9986:case 9984:return 9729;default:return t}}static usesMipMaps(t){switch(t){case 9987:case 9987:case 9985:case 9986:case 9984:return!0;default:return!1}}setWraps(t,e){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e)}update(t){let e=this.context.gl;this.texture||(this.texture=this.context.gl.createTexture()),this.bind(),Ai.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL&&e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this._image),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t&&e.generateMipmap(e.TEXTURE_2D)}restore(){this.texture=null,this.update(this.useMipMaps)}bind(t=0){let e=this.context.gl;this.boundUnit=t,e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.texture)}unbind(){let t=this.context.gl;t.activeTexture(t.TEXTURE0+this.boundUnit),t.bindTexture(t.TEXTURE_2D,null)}dispose(){this.context.removeRestorable(this),this.context.gl.deleteTexture(this.texture)}},Si=Ai;Si.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL=!1;var Mi=class extends ce{constructor(t,e="",i=new ue){super((e=>new Si(t,e)),e,i)}},Ii=class{constructor(t=0,e=0,i=0){this.x=0,this.y=0,this.z=0,this.x=t,this.y=e,this.z=i}setFrom(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}set(t,e,i){return this.x=t,this.y=e,this.z=i,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}scale(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(){let t=this.length();return 0==t||(t=1/t,this.x*=t,this.y*=t,this.z*=t),this}cross(t){return this.set(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)}multiply(t){let e=t.values;return this.set(this.x*e[Ei]+this.y*e[Ti]+this.z*e[ki]+e[Ci],this.x*e[Ri]+this.y*e[Fi]+this.z*e[Yi]+e[Pi],this.x*e[Xi]+this.y*e[Li]+this.z*e[Oi]+e[Di])}project(t){let e=t.values,i=1/(this.x*e[Bi]+this.y*e[Vi]+this.z*e[zi]+e[Ni]);return this.set((this.x*e[Ei]+this.y*e[Ti]+this.z*e[ki]+e[Ci])*i,(this.x*e[Ri]+this.y*e[Fi]+this.z*e[Yi]+e[Pi])*i,(this.x*e[Xi]+this.y*e[Li]+this.z*e[Oi]+e[Di])*i)}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}distance(t){let e=t.x-this.x,i=t.y-this.y,s=t.z-this.z;return Math.sqrt(e*e+i*i+s*s)}},Ei=0,Ti=4,ki=8,Ci=12,Ri=1,Fi=5,Yi=9,Pi=13,Xi=2,Li=6,Oi=10,Di=14,Bi=3,Vi=7,zi=11,Ni=15,_i=class{constructor(){this.temp=new Float32Array(16),this.values=new Float32Array(16);let t=this.values;t[Ei]=1,t[Fi]=1,t[Oi]=1,t[Ni]=1}set(t){return this.values.set(t),this}transpose(){let t=this.temp,e=this.values;return t[Ei]=e[Ei],t[Ti]=e[Ri],t[ki]=e[Xi],t[Ci]=e[Bi],t[Ri]=e[Ti],t[Fi]=e[Fi],t[Yi]=e[Li],t[Pi]=e[Vi],t[Xi]=e[ki],t[Li]=e[Yi],t[Oi]=e[Oi],t[Di]=e[zi],t[Bi]=e[Ci],t[Vi]=e[Pi],t[zi]=e[Di],t[Ni]=e[Ni],this.set(t)}identity(){let t=this.values;return t[Ei]=1,t[Ti]=0,t[ki]=0,t[Ci]=0,t[Ri]=0,t[Fi]=1,t[Yi]=0,t[Pi]=0,t[Xi]=0,t[Li]=0,t[Oi]=1,t[Di]=0,t[Bi]=0,t[Vi]=0,t[zi]=0,t[Ni]=1,this}invert(){let t=this.values,e=this.temp,i=t[Bi]*t[Li]*t[Yi]*t[Ci]-t[Xi]*t[Vi]*t[Yi]*t[Ci]-t[Bi]*t[Fi]*t[Oi]*t[Ci]+t[Ri]*t[Vi]*t[Oi]*t[Ci]+t[Xi]*t[Fi]*t[zi]*t[Ci]-t[Ri]*t[Li]*t[zi]*t[Ci]-t[Bi]*t[Li]*t[ki]*t[Pi]+t[Xi]*t[Vi]*t[ki]*t[Pi]+t[Bi]*t[Ti]*t[Oi]*t[Pi]-t[Ei]*t[Vi]*t[Oi]*t[Pi]-t[Xi]*t[Ti]*t[zi]*t[Pi]+t[Ei]*t[Li]*t[zi]*t[Pi]+t[Bi]*t[Fi]*t[ki]*t[Di]-t[Ri]*t[Vi]*t[ki]*t[Di]-t[Bi]*t[Ti]*t[Yi]*t[Di]+t[Ei]*t[Vi]*t[Yi]*t[Di]+t[Ri]*t[Ti]*t[zi]*t[Di]-t[Ei]*t[Fi]*t[zi]*t[Di]-t[Xi]*t[Fi]*t[ki]*t[Ni]+t[Ri]*t[Li]*t[ki]*t[Ni]+t[Xi]*t[Ti]*t[Yi]*t[Ni]-t[Ei]*t[Li]*t[Yi]*t[Ni]-t[Ri]*t[Ti]*t[Oi]*t[Ni]+t[Ei]*t[Fi]*t[Oi]*t[Ni];if(0==i)throw new Error("non-invertible matrix");let s=1/i;return e[Ei]=t[Yi]*t[Di]*t[Vi]-t[Pi]*t[Oi]*t[Vi]+t[Pi]*t[Li]*t[zi]-t[Fi]*t[Di]*t[zi]-t[Yi]*t[Li]*t[Ni]+t[Fi]*t[Oi]*t[Ni],e[Ti]=t[Ci]*t[Oi]*t[Vi]-t[ki]*t[Di]*t[Vi]-t[Ci]*t[Li]*t[zi]+t[Ti]*t[Di]*t[zi]+t[ki]*t[Li]*t[Ni]-t[Ti]*t[Oi]*t[Ni],e[ki]=t[ki]*t[Pi]*t[Vi]-t[Ci]*t[Yi]*t[Vi]+t[Ci]*t[Fi]*t[zi]-t[Ti]*t[Pi]*t[zi]-t[ki]*t[Fi]*t[Ni]+t[Ti]*t[Yi]*t[Ni],e[Ci]=t[Ci]*t[Yi]*t[Li]-t[ki]*t[Pi]*t[Li]-t[Ci]*t[Fi]*t[Oi]+t[Ti]*t[Pi]*t[Oi]+t[ki]*t[Fi]*t[Di]-t[Ti]*t[Yi]*t[Di],e[Ri]=t[Pi]*t[Oi]*t[Bi]-t[Yi]*t[Di]*t[Bi]-t[Pi]*t[Xi]*t[zi]+t[Ri]*t[Di]*t[zi]+t[Yi]*t[Xi]*t[Ni]-t[Ri]*t[Oi]*t[Ni],e[Fi]=t[ki]*t[Di]*t[Bi]-t[Ci]*t[Oi]*t[Bi]+t[Ci]*t[Xi]*t[zi]-t[Ei]*t[Di]*t[zi]-t[ki]*t[Xi]*t[Ni]+t[Ei]*t[Oi]*t[Ni],e[Yi]=t[Ci]*t[Yi]*t[Bi]-t[ki]*t[Pi]*t[Bi]-t[Ci]*t[Ri]*t[zi]+t[Ei]*t[Pi]*t[zi]+t[ki]*t[Ri]*t[Ni]-t[Ei]*t[Yi]*t[Ni],e[Pi]=t[ki]*t[Pi]*t[Xi]-t[Ci]*t[Yi]*t[Xi]+t[Ci]*t[Ri]*t[Oi]-t[Ei]*t[Pi]*t[Oi]-t[ki]*t[Ri]*t[Di]+t[Ei]*t[Yi]*t[Di],e[Xi]=t[Fi]*t[Di]*t[Bi]-t[Pi]*t[Li]*t[Bi]+t[Pi]*t[Xi]*t[Vi]-t[Ri]*t[Di]*t[Vi]-t[Fi]*t[Xi]*t[Ni]+t[Ri]*t[Li]*t[Ni],e[Li]=t[Ci]*t[Li]*t[Bi]-t[Ti]*t[Di]*t[Bi]-t[Ci]*t[Xi]*t[Vi]+t[Ei]*t[Di]*t[Vi]+t[Ti]*t[Xi]*t[Ni]-t[Ei]*t[Li]*t[Ni],e[Oi]=t[Ti]*t[Pi]*t[Bi]-t[Ci]*t[Fi]*t[Bi]+t[Ci]*t[Ri]*t[Vi]-t[Ei]*t[Pi]*t[Vi]-t[Ti]*t[Ri]*t[Ni]+t[Ei]*t[Fi]*t[Ni],e[Di]=t[Ci]*t[Fi]*t[Xi]-t[Ti]*t[Pi]*t[Xi]-t[Ci]*t[Ri]*t[Li]+t[Ei]*t[Pi]*t[Li]+t[Ti]*t[Ri]*t[Di]-t[Ei]*t[Fi]*t[Di],e[Bi]=t[Yi]*t[Li]*t[Bi]-t[Fi]*t[Oi]*t[Bi]-t[Yi]*t[Xi]*t[Vi]+t[Ri]*t[Oi]*t[Vi]+t[Fi]*t[Xi]*t[zi]-t[Ri]*t[Li]*t[zi],e[Vi]=t[Ti]*t[Oi]*t[Bi]-t[ki]*t[Li]*t[Bi]+t[ki]*t[Xi]*t[Vi]-t[Ei]*t[Oi]*t[Vi]-t[Ti]*t[Xi]*t[zi]+t[Ei]*t[Li]*t[zi],e[zi]=t[ki]*t[Fi]*t[Bi]-t[Ti]*t[Yi]*t[Bi]-t[ki]*t[Ri]*t[Vi]+t[Ei]*t[Yi]*t[Vi]+t[Ti]*t[Ri]*t[zi]-t[Ei]*t[Fi]*t[zi],e[Ni]=t[Ti]*t[Yi]*t[Xi]-t[ki]*t[Fi]*t[Xi]+t[ki]*t[Ri]*t[Li]-t[Ei]*t[Yi]*t[Li]-t[Ti]*t[Ri]*t[Oi]+t[Ei]*t[Fi]*t[Oi],t[Ei]=e[Ei]*s,t[Ti]=e[Ti]*s,t[ki]=e[ki]*s,t[Ci]=e[Ci]*s,t[Ri]=e[Ri]*s,t[Fi]=e[Fi]*s,t[Yi]=e[Yi]*s,t[Pi]=e[Pi]*s,t[Xi]=e[Xi]*s,t[Li]=e[Li]*s,t[Oi]=e[Oi]*s,t[Di]=e[Di]*s,t[Bi]=e[Bi]*s,t[Vi]=e[Vi]*s,t[zi]=e[zi]*s,t[Ni]=e[Ni]*s,this}determinant(){let t=this.values;return t[Bi]*t[Li]*t[Yi]*t[Ci]-t[Xi]*t[Vi]*t[Yi]*t[Ci]-t[Bi]*t[Fi]*t[Oi]*t[Ci]+t[Ri]*t[Vi]*t[Oi]*t[Ci]+t[Xi]*t[Fi]*t[zi]*t[Ci]-t[Ri]*t[Li]*t[zi]*t[Ci]-t[Bi]*t[Li]*t[ki]*t[Pi]+t[Xi]*t[Vi]*t[ki]*t[Pi]+t[Bi]*t[Ti]*t[Oi]*t[Pi]-t[Ei]*t[Vi]*t[Oi]*t[Pi]-t[Xi]*t[Ti]*t[zi]*t[Pi]+t[Ei]*t[Li]*t[zi]*t[Pi]+t[Bi]*t[Fi]*t[ki]*t[Di]-t[Ri]*t[Vi]*t[ki]*t[Di]-t[Bi]*t[Ti]*t[Yi]*t[Di]+t[Ei]*t[Vi]*t[Yi]*t[Di]+t[Ri]*t[Ti]*t[zi]*t[Di]-t[Ei]*t[Fi]*t[zi]*t[Di]-t[Xi]*t[Fi]*t[ki]*t[Ni]+t[Ri]*t[Li]*t[ki]*t[Ni]+t[Xi]*t[Ti]*t[Yi]*t[Ni]-t[Ei]*t[Li]*t[Yi]*t[Ni]-t[Ri]*t[Ti]*t[Oi]*t[Ni]+t[Ei]*t[Fi]*t[Oi]*t[Ni]}translate(t,e,i){let s=this.values;return s[Ci]+=t,s[Pi]+=e,s[Di]+=i,this}copy(){return(new _i).set(this.values)}projection(t,e,i,s){this.identity();let r=1/Math.tan(i*(Math.PI/180)/2),n=(e+t)/(t-e),a=2*e*t/(t-e),o=this.values;return o[Ei]=r/s,o[Ri]=0,o[Xi]=0,o[Bi]=0,o[Ti]=0,o[Fi]=r,o[Li]=0,o[Vi]=0,o[ki]=0,o[Yi]=0,o[Oi]=n,o[zi]=-1,o[Ci]=0,o[Pi]=0,o[Di]=a,o[Ni]=0,this}ortho2d(t,e,i,s){return this.ortho(t,t+i,e,e+s,0,1)}ortho(t,e,i,s,r,n){this.identity();let a=2/(e-t),o=2/(s-i),h=-2/(n-r),l=-(e+t)/(e-t),c=-(s+i)/(s-i),u=-(n+r)/(n-r),d=this.values;return d[Ei]=a,d[Ri]=0,d[Xi]=0,d[Bi]=0,d[Ti]=0,d[Fi]=o,d[Li]=0,d[Vi]=0,d[ki]=0,d[Yi]=0,d[Oi]=h,d[zi]=0,d[Ci]=l,d[Pi]=c,d[Di]=u,d[Ni]=1,this}multiply(t){let e=this.temp,i=this.values,s=t.values;return e[Ei]=i[Ei]*s[Ei]+i[Ti]*s[Ri]+i[ki]*s[Xi]+i[Ci]*s[Bi],e[Ti]=i[Ei]*s[Ti]+i[Ti]*s[Fi]+i[ki]*s[Li]+i[Ci]*s[Vi],e[ki]=i[Ei]*s[ki]+i[Ti]*s[Yi]+i[ki]*s[Oi]+i[Ci]*s[zi],e[Ci]=i[Ei]*s[Ci]+i[Ti]*s[Pi]+i[ki]*s[Di]+i[Ci]*s[Ni],e[Ri]=i[Ri]*s[Ei]+i[Fi]*s[Ri]+i[Yi]*s[Xi]+i[Pi]*s[Bi],e[Fi]=i[Ri]*s[Ti]+i[Fi]*s[Fi]+i[Yi]*s[Li]+i[Pi]*s[Vi],e[Yi]=i[Ri]*s[ki]+i[Fi]*s[Yi]+i[Yi]*s[Oi]+i[Pi]*s[zi],e[Pi]=i[Ri]*s[Ci]+i[Fi]*s[Pi]+i[Yi]*s[Di]+i[Pi]*s[Ni],e[Xi]=i[Xi]*s[Ei]+i[Li]*s[Ri]+i[Oi]*s[Xi]+i[Di]*s[Bi],e[Li]=i[Xi]*s[Ti]+i[Li]*s[Fi]+i[Oi]*s[Li]+i[Di]*s[Vi],e[Oi]=i[Xi]*s[ki]+i[Li]*s[Yi]+i[Oi]*s[Oi]+i[Di]*s[zi],e[Di]=i[Xi]*s[Ci]+i[Li]*s[Pi]+i[Oi]*s[Di]+i[Di]*s[Ni],e[Bi]=i[Bi]*s[Ei]+i[Vi]*s[Ri]+i[zi]*s[Xi]+i[Ni]*s[Bi],e[Vi]=i[Bi]*s[Ti]+i[Vi]*s[Fi]+i[zi]*s[Li]+i[Ni]*s[Vi],e[zi]=i[Bi]*s[ki]+i[Vi]*s[Yi]+i[zi]*s[Oi]+i[Ni]*s[zi],e[Ni]=i[Bi]*s[Ci]+i[Vi]*s[Pi]+i[zi]*s[Di]+i[Ni]*s[Ni],this.set(this.temp)}multiplyLeft(t){let e=this.temp,i=this.values,s=t.values;return e[Ei]=s[Ei]*i[Ei]+s[Ti]*i[Ri]+s[ki]*i[Xi]+s[Ci]*i[Bi],e[Ti]=s[Ei]*i[Ti]+s[Ti]*i[Fi]+s[ki]*i[Li]+s[Ci]*i[Vi],e[ki]=s[Ei]*i[ki]+s[Ti]*i[Yi]+s[ki]*i[Oi]+s[Ci]*i[zi],e[Ci]=s[Ei]*i[Ci]+s[Ti]*i[Pi]+s[ki]*i[Di]+s[Ci]*i[Ni],e[Ri]=s[Ri]*i[Ei]+s[Fi]*i[Ri]+s[Yi]*i[Xi]+s[Pi]*i[Bi],e[Fi]=s[Ri]*i[Ti]+s[Fi]*i[Fi]+s[Yi]*i[Li]+s[Pi]*i[Vi],e[Yi]=s[Ri]*i[ki]+s[Fi]*i[Yi]+s[Yi]*i[Oi]+s[Pi]*i[zi],e[Pi]=s[Ri]*i[Ci]+s[Fi]*i[Pi]+s[Yi]*i[Di]+s[Pi]*i[Ni],e[Xi]=s[Xi]*i[Ei]+s[Li]*i[Ri]+s[Oi]*i[Xi]+s[Di]*i[Bi],e[Li]=s[Xi]*i[Ti]+s[Li]*i[Fi]+s[Oi]*i[Li]+s[Di]*i[Vi],e[Oi]=s[Xi]*i[ki]+s[Li]*i[Yi]+s[Oi]*i[Oi]+s[Di]*i[zi],e[Di]=s[Xi]*i[Ci]+s[Li]*i[Pi]+s[Oi]*i[Di]+s[Di]*i[Ni],e[Bi]=s[Bi]*i[Ei]+s[Vi]*i[Ri]+s[zi]*i[Xi]+s[Ni]*i[Bi],e[Vi]=s[Bi]*i[Ti]+s[Vi]*i[Fi]+s[zi]*i[Li]+s[Ni]*i[Vi],e[zi]=s[Bi]*i[ki]+s[Vi]*i[Yi]+s[zi]*i[Oi]+s[Ni]*i[zi],e[Ni]=s[Bi]*i[Ci]+s[Vi]*i[Pi]+s[zi]*i[Di]+s[Ni]*i[Ni],this.set(this.temp)}lookAt(t,e,i){let s=_i.xAxis,r=_i.yAxis,n=_i.zAxis;n.setFrom(e).normalize(),s.setFrom(e).normalize(),s.cross(i).normalize(),r.setFrom(s).cross(n).normalize(),this.identity();let a=this.values;return a[Ei]=s.x,a[Ti]=s.y,a[ki]=s.z,a[Ri]=r.x,a[Fi]=r.y,a[Yi]=r.z,a[Xi]=-n.x,a[Li]=-n.y,a[Oi]=-n.z,_i.tmpMatrix.identity(),_i.tmpMatrix.values[Ci]=-t.x,_i.tmpMatrix.values[Pi]=-t.y,_i.tmpMatrix.values[Di]=-t.z,this.multiply(_i.tmpMatrix),this}},Ui=_i;Ui.xAxis=new Ii,Ui.yAxis=new Ii,Ui.zAxis=new Ii,Ui.tmpMatrix=new _i;var Wi=class{constructor(t,e){this.position=new Ii(0,0,0),this.direction=new Ii(0,0,-1),this.up=new Ii(0,1,0),this.near=0,this.far=100,this.zoom=1,this.viewportWidth=0,this.viewportHeight=0,this.projectionView=new Ui,this.inverseProjectionView=new Ui,this.projection=new Ui,this.view=new Ui,this.viewportWidth=t,this.viewportHeight=e,this.update()}update(){let t=this.projection,e=this.view,i=this.projectionView,s=this.inverseProjectionView,r=this.zoom,n=this.viewportWidth,a=this.viewportHeight;t.ortho(r*(-n/2),r*(n/2),r*(-a/2),r*(a/2),this.near,this.far),e.lookAt(this.position,this.direction,this.up),i.set(t.values),i.multiply(e),s.set(i.values).invert()}screenToWorld(t,e,i){let s=t.x,r=i-t.y-1;return t.x=2*s/e-1,t.y=2*r/i-1,t.z=2*t.z-1,t.project(this.inverseProjectionView),t}worldToScreen(t,e,i){return t.project(this.projectionView),t.x=e*(t.x+1)/2,t.y=i*(t.y+1)/2,t.z=(t.z+1)/2,t}setViewport(t,e){this.viewportWidth=t,this.viewportHeight=e}},qi=class{constructor(t){this.mouseX=0,this.mouseY=0,this.buttonDown=!1,this.touch0=null,this.touch1=null,this.initialPinchDistance=0,this.listeners=new Array,this.eventListeners=[],this.element=t,this.setupCallbacks(t)}setupCallbacks(t){let e=e=>{if(e instanceof MouseEvent){let i=t.getBoundingClientRect();this.mouseX=e.clientX-i.left,this.mouseY=e.clientY-i.top,this.listeners.map((t=>{this.buttonDown?t.dragged&&t.dragged(this.mouseX,this.mouseY):t.moved&&t.moved(this.mouseX,this.mouseY)}))}},i=s=>{if(s instanceof MouseEvent){let r=t.getBoundingClientRect();this.mouseX=s.clientX-r.left,this.mouseY=s.clientY-r.top,this.buttonDown=!1,this.listeners.map((t=>{t.up&&t.up(this.mouseX,this.mouseY)})),document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",i)}};t.addEventListener("mousedown",(s=>{if(s instanceof MouseEvent){let r=t.getBoundingClientRect();this.mouseX=s.clientX-r.left,this.mouseY=s.clientY-r.top,this.buttonDown=!0,this.listeners.map((t=>{t.down&&t.down(this.mouseX,this.mouseY)})),document.addEventListener("mousemove",e),document.addEventListener("mouseup",i)}}),!0),t.addEventListener("mousemove",e,!0),t.addEventListener("mouseup",i,!0),t.addEventListener("wheel",(t=>{t.preventDefault();let e=t.deltaY;t.deltaMode==WheelEvent.DOM_DELTA_LINE&&(e*=8),t.deltaMode==WheelEvent.DOM_DELTA_PAGE&&(e*=24),this.listeners.map((e=>{e.wheel&&e.wheel(t.deltaY)}))}),!0),t.addEventListener("touchstart",(e=>{if(!this.touch0||!this.touch1){let i=e.changedTouches.item(0);if(!i)return;let s=t.getBoundingClientRect(),r=i.clientX-s.left,n=i.clientY-s.top,a=new Gi(i.identifier,r,n);if(this.mouseX=r,this.mouseY=n,this.buttonDown=!0,this.touch0){if(!this.touch1){this.touch1=a;let t=this.touch1.x-this.touch0.x,e=this.touch1.x-this.touch0.x;this.initialPinchDistance=Math.sqrt(t*t+e*e),this.listeners.map((t=>{t.zoom&&t.zoom(this.initialPinchDistance,this.initialPinchDistance)}))}}else this.touch0=a,this.listeners.map((t=>{t.down&&t.down(a.x,a.y)}))}e.preventDefault()}),!1),t.addEventListener("touchmove",(e=>{if(this.touch0){var i=e.changedTouches;let n=t.getBoundingClientRect();for(var s=0;s{i.dragged&&i.dragged(t,e)}))),this.touch1&&this.touch1.identifier===r.identifier&&(this.touch1.x=this.mouseX=t,this.touch1.y=this.mouseY=e)}if(this.touch0&&this.touch1){let t=this.touch1.x-this.touch0.x,e=this.touch1.x-this.touch0.x,i=Math.sqrt(t*t+e*e);this.listeners.map((t=>{t.zoom&&t.zoom(this.initialPinchDistance,i)}))}}e.preventDefault()}),!1);let s=e=>{if(this.touch0){var i=e.changedTouches;let n=t.getBoundingClientRect();for(var s=0;s{i.up&&i.up(t,e)})),!this.touch1){this.buttonDown=!1;break}this.touch0=this.touch1,this.touch1=null,this.mouseX=this.touch0.x,this.mouseX=this.touch0.x,this.buttonDown=!0,this.listeners.map((t=>{t.down&&t.down(this.touch0.x,this.touch0.y)}))}this.touch1&&this.touch1.identifier&&(this.touch1=null)}}e.preventDefault()};t.addEventListener("touchend",s,!1),t.addEventListener("touchcancel",s)}addListener(t){this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>-1&&this.listeners.splice(e,1)}},Gi=class{constructor(t,e,i){this.identifier=t,this.x=e,this.y=i}},ji=class{constructor(t,e){this.canvas=t,this.camera=e;let i=0,s=0,r=0,n=0,a=0,o=0,h=0;new qi(t).addListener({down:(t,l)=>{i=e.position.x,s=e.position.y,r=a=t,n=o=l,h=e.zoom},dragged:(h,l)=>{let c=h-r,u=l-n,d=e.screenToWorld(new Ii(0,0),t.clientWidth,t.clientHeight),f=e.screenToWorld(new Ii(c,u),t.clientWidth,t.clientHeight).sub(d);e.position.set(i-f.x,s-f.y,0),e.update(),a=h,o=l},wheel:i=>{let s=i/200*e.zoom,r=e.zoom+s;if(r>0){let s=0,n=0;if(i<0)s=a,n=o;else{let e=new Ii(t.clientWidth/2+15,t.clientHeight/2),i=a-e.x,r=t.clientHeight-1-o-e.y;s=e.x-i,n=t.clientHeight-1-e.y+r}let h=e.screenToWorld(new Ii(s,n),t.clientWidth,t.clientHeight);e.zoom=r,e.update();let l=e.screenToWorld(new Ii(s,n),t.clientWidth,t.clientHeight);e.position.add(h.sub(l)),e.update()}},zoom:(t,i)=>{let s=t/i;e.zoom=h*s},up:(t,e)=>{a=t,o=e},moved:(t,e)=>{a=t,o=e}})}},Hi=class{constructor(t,e,i){this.vertexShader=e,this.fragmentShader=i,this.vs=null,this.fs=null,this.program=null,this.tmp2x2=new Float32Array(4),this.tmp3x3=new Float32Array(9),this.tmp4x4=new Float32Array(16),this.vsSource=e,this.fsSource=i,this.context=t instanceof vi?t:new vi(t),this.context.addRestorable(this),this.compile()}getProgram(){return this.program}getVertexShader(){return this.vertexShader}getFragmentShader(){return this.fragmentShader}getVertexShaderSource(){return this.vsSource}getFragmentSource(){return this.fsSource}compile(){let t=this.context.gl;try{if(this.vs=this.compileShader(t.VERTEX_SHADER,this.vertexShader),!this.vs)throw new Error("Couldn't compile vertex shader.");if(this.fs=this.compileShader(t.FRAGMENT_SHADER,this.fragmentShader),!this.fs)throw new Error("Couldn#t compile fragment shader.");this.program=this.compileProgram(this.vs,this.fs)}catch(t){throw this.dispose(),t}}compileShader(t,e){let i=this.context.gl,s=i.createShader(t);if(!s)throw new Error("Couldn't create shader.");if(i.shaderSource(s,e),i.compileShader(s),!i.getShaderParameter(s,i.COMPILE_STATUS)){let t="Couldn't compile shader: "+i.getShaderInfoLog(s);if(i.deleteShader(s),!i.isContextLost())throw new Error(t)}return s}compileProgram(t,e){let i=this.context.gl,s=i.createProgram();if(!s)throw new Error("Couldn't compile program.");if(i.attachShader(s,t),i.attachShader(s,e),i.linkProgram(s),!i.getProgramParameter(s,i.LINK_STATUS)){let t="Couldn't compile shader program: "+i.getProgramInfoLog(s);if(i.deleteProgram(s),!i.isContextLost())throw new Error(t)}return s}restore(){this.compile()}bind(){this.context.gl.useProgram(this.program)}unbind(){this.context.gl.useProgram(null)}setUniformi(t,e){this.context.gl.uniform1i(this.getUniformLocation(t),e)}setUniformf(t,e){this.context.gl.uniform1f(this.getUniformLocation(t),e)}setUniform2f(t,e,i){this.context.gl.uniform2f(this.getUniformLocation(t),e,i)}setUniform3f(t,e,i,s){this.context.gl.uniform3f(this.getUniformLocation(t),e,i,s)}setUniform4f(t,e,i,s,r){this.context.gl.uniform4f(this.getUniformLocation(t),e,i,s,r)}setUniform2x2f(t,e){let i=this.context.gl;this.tmp2x2.set(e),i.uniformMatrix2fv(this.getUniformLocation(t),!1,this.tmp2x2)}setUniform3x3f(t,e){let i=this.context.gl;this.tmp3x3.set(e),i.uniformMatrix3fv(this.getUniformLocation(t),!1,this.tmp3x3)}setUniform4x4f(t,e){let i=this.context.gl;this.tmp4x4.set(e),i.uniformMatrix4fv(this.getUniformLocation(t),!1,this.tmp4x4)}getUniformLocation(t){let e=this.context.gl;if(!this.program)throw new Error("Shader not compiled.");let i=e.getUniformLocation(this.program,t);if(!i&&!e.isContextLost())throw new Error(`Couldn't find location for uniform ${t}`);return i}getAttributeLocation(t){let e=this.context.gl;if(!this.program)throw new Error("Shader not compiled.");let i=e.getAttribLocation(this.program,t);if(-1==i&&!e.isContextLost())throw new Error(`Couldn't find location for attribute ${t}`);return i}dispose(){this.context.removeRestorable(this);let t=this.context.gl;this.vs&&(t.deleteShader(this.vs),this.vs=null),this.fs&&(t.deleteShader(this.fs),this.fs=null),this.program&&(t.deleteProgram(this.program),this.program=null)}static newColoredTextured(t){let e=`\n\t\t\t\tattribute vec4 ${Hi.POSITION};\n\t\t\t\tattribute vec4 ${Hi.COLOR};\n\t\t\t\tattribute vec2 ${Hi.TEXCOORDS};\n\t\t\t\tuniform mat4 ${Hi.MVP_MATRIX};\n\t\t\t\tvarying vec4 v_color;\n\t\t\t\tvarying vec2 v_texCoords;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = ${Hi.COLOR};\n\t\t\t\t\tv_texCoords = ${Hi.TEXCOORDS};\n\t\t\t\t\tgl_Position = ${Hi.MVP_MATRIX} * ${Hi.POSITION};\n\t\t\t\t}\n\t\t\t`;return new Hi(t,e,"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_color;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tgl_FragColor = v_color * texture2D(u_texture, v_texCoords);\n\t\t\t\t}\n\t\t\t")}static newTwoColoredTextured(t){let e=`\n\t\t\t\tattribute vec4 ${Hi.POSITION};\n\t\t\t\tattribute vec4 ${Hi.COLOR};\n\t\t\t\tattribute vec4 ${Hi.COLOR2};\n\t\t\t\tattribute vec2 ${Hi.TEXCOORDS};\n\t\t\t\tuniform mat4 ${Hi.MVP_MATRIX};\n\t\t\t\tvarying vec4 v_light;\n\t\t\t\tvarying vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_light = ${Hi.COLOR};\n\t\t\t\t\tv_dark = ${Hi.COLOR2};\n\t\t\t\t\tv_texCoords = ${Hi.TEXCOORDS};\n\t\t\t\t\tgl_Position = ${Hi.MVP_MATRIX} * ${Hi.POSITION};\n\t\t\t\t}\n\t\t\t`;return new Hi(t,e,"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_light;\n\t\t\t\tvarying LOWP vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tvec4 texColor = texture2D(u_texture, v_texCoords);\n\t\t\t\t\tgl_FragColor.a = texColor.a * v_light.a;\n\t\t\t\t\tgl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;\n\t\t\t\t}\n\t\t\t")}static newColored(t){let e=`\n\t\t\t\tattribute vec4 ${Hi.POSITION};\n\t\t\t\tattribute vec4 ${Hi.COLOR};\n\t\t\t\tuniform mat4 ${Hi.MVP_MATRIX};\n\t\t\t\tvarying vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = ${Hi.COLOR};\n\t\t\t\t\tgl_Position = ${Hi.MVP_MATRIX} * ${Hi.POSITION};\n\t\t\t\t}\n\t\t\t`;return new Hi(t,e,"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tgl_FragColor = v_color;\n\t\t\t\t}\n\t\t\t")}},Zi=Hi;Zi.MVP_MATRIX="u_projTrans",Zi.POSITION="a_position",Zi.COLOR="a_color",Zi.COLOR2="a_color2",Zi.TEXCOORDS="a_texCoords",Zi.SAMPLER="u_texture";var Ki=class{constructor(t,e,i,s){this.attributes=e,this.verticesBuffer=null,this.verticesLength=0,this.dirtyVertices=!1,this.indicesBuffer=null,this.indicesLength=0,this.dirtyIndices=!1,this.elementsPerVertex=0,this.context=t instanceof vi?t:new vi(t),this.elementsPerVertex=0;for(let t=0;tthis.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length}setIndices(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length}draw(t,e){this.drawWithOffset(t,e,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)}drawWithOffset(t,e,i,s){let r=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?r.drawElements(e,s,r.UNSIGNED_SHORT,2*i):r.drawArrays(e,i,s),this.unbind(t)}bind(t){let e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);let i=0;for(let s=0;s0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)}unbind(t){let e=this.context.gl;for(let i=0;i0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)}update(){let t=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=t.createBuffer()),t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),t.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),t.DYNAMIC_DRAW),this.dirtyIndices=!1)}restore(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()}dispose(){this.context.removeRestorable(this);let t=this.context.gl;t.deleteBuffer(this.verticesBuffer),t.deleteBuffer(this.indicesBuffer)}},Ji=class{constructor(t,e,i){this.name=t,this.type=e,this.numElements=i}},Qi=class extends Ji{constructor(){super(Zi.POSITION,ss.Float,2)}},$i=class extends Ji{constructor(){super(Zi.POSITION,ss.Float,3)}},ts=class extends Ji{constructor(t=0){super(Zi.TEXCOORDS+(0==t?"":t),ss.Float,2)}},es=class extends Ji{constructor(){super(Zi.COLOR,ss.Float,4)}},is=class extends Ji{constructor(){super(Zi.COLOR2,ss.Float,4)}},ss=(t=>(t[t.Float=0]="Float",t))(ss||{}),rs=class{constructor(t,e=!0,i=10920){if(this.drawCalls=0,this.isDrawing=!1,this.shader=null,this.lastTexture=null,this.verticesLength=0,this.indicesLength=0,this.cullWasEnabled=!1,i>10920)throw new Error("Can't have more than 10920 triangles per batch: "+i);this.context=t instanceof vi?t:new vi(t);let s=e?[new Qi,new es,new ts,new is]:[new Qi,new es,new ts];this.mesh=new Ki(t,s,i,3*i);let r=this.context.gl;this.srcColorBlend=r.SRC_ALPHA,this.srcAlphaBlend=r.ONE,this.dstBlend=r.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=t,this.lastTexture=null,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend),this.cullWasEnabled=e.isEnabled(e.CULL_FACE),this.cullWasEnabled&&e.disable(e.CULL_FACE)}setBlendMode(t,e,i){if((this.srcColorBlend!=t||this.srcAlphaBlend!=e||this.dstBlend!=i)&&(this.srcColorBlend=t,this.srcAlphaBlend=e,this.dstBlend=i,this.isDrawing)){this.flush(),this.context.gl.blendFuncSeparate(t,i,e,i)}}draw(t,e,i){t!=this.lastTexture?(this.flush(),this.lastTexture=t):(this.verticesLength+e.length>this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();let s=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);let r=this.mesh.getIndices();for(let t=this.indicesLength,e=0;e0||this.indicesLength>0)&&this.flush(),this.shader=null,this.lastTexture=null,this.isDrawing=!1;let t=this.context.gl;t.disable(t.BLEND),this.cullWasEnabled&&t.enable(t.CULL_FACE)}getDrawCalls(){return this.drawCalls}static getAndResetGlobalDrawCalls(){let t=rs.globalDrawCalls;return rs.globalDrawCalls=0,t}dispose(){this.mesh.dispose()}},ns=rs;ns.globalDrawCalls=0;var as=class{constructor(t,e=10920){if(this.isDrawing=!1,this.shapeType=os.Filled,this.color=new h(1,1,1,1),this.shader=null,this.vertexIndex=0,this.tmp=new w,e>10920)throw new Error("Can't have more than 10920 triangles per batch: "+e);this.context=t instanceof vi?t:new vi(t),this.mesh=new Ki(t,[new Qi,new es],e,0);let i=this.context.gl;this.srcColorBlend=i.SRC_ALPHA,this.srcAlphaBlend=i.ONE,this.dstBlend=i.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("ShapeRenderer.begin() has already been called");this.shader=t,this.vertexIndex=0,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend)}setBlendMode(t,e,i){if(this.srcColorBlend=t,this.srcAlphaBlend=e,this.dstBlend=i,this.isDrawing){this.flush(),this.context.gl.blendFuncSeparate(t,i,e,i)}}setColor(t){this.color.setFromColor(t)}setColorWith(t,e,i,s){this.color.set(t,e,i,s)}point(t,e,i){this.check(os.Point,1),i||(i=this.color),this.vertex(t,e,i)}line(t,e,i,s,r){this.check(os.Line,2);this.mesh.getVertices(),this.vertexIndex;r||(r=this.color),this.vertex(t,e,r),this.vertex(i,s,r)}triangle(t,e,i,s,r,n,a,o,h,l){this.check(t?os.Filled:os.Line,3);this.mesh.getVertices(),this.vertexIndex;o||(o=this.color),h||(h=this.color),l||(l=this.color),t?(this.vertex(e,i,o),this.vertex(s,r,h),this.vertex(n,a,l)):(this.vertex(e,i,o),this.vertex(s,r,h),this.vertex(s,r,o),this.vertex(n,a,h),this.vertex(n,a,o),this.vertex(e,i,h))}quad(t,e,i,s,r,n,a,o,h,l,c,u,d){this.check(t?os.Filled:os.Line,3);this.mesh.getVertices(),this.vertexIndex;l||(l=this.color),c||(c=this.color),u||(u=this.color),d||(d=this.color),t?(this.vertex(e,i,l),this.vertex(s,r,c),this.vertex(n,a,u),this.vertex(n,a,u),this.vertex(o,h,d),this.vertex(e,i,l)):(this.vertex(e,i,l),this.vertex(s,r,c),this.vertex(s,r,c),this.vertex(n,a,u),this.vertex(n,a,u),this.vertex(o,h,d),this.vertex(o,h,d),this.vertex(e,i,l))}rect(t,e,i,s,r,n){this.quad(t,e,i,e+s,i,e+s,i+r,e,i+r,n,n,n,n)}rectLine(t,e,i,s,r,n,a){this.check(t?os.Filled:os.Line,8),a||(a=this.color);let o=this.tmp.set(r-i,e-s);o.normalize(),n*=.5;let h=o.x*n,l=o.y*n;t?(this.vertex(e+h,i+l,a),this.vertex(e-h,i-l,a),this.vertex(s+h,r+l,a),this.vertex(s-h,r-l,a),this.vertex(s+h,r+l,a),this.vertex(e-h,i-l,a)):(this.vertex(e+h,i+l,a),this.vertex(e-h,i-l,a),this.vertex(s+h,r+l,a),this.vertex(s-h,r-l,a),this.vertex(s+h,r+l,a),this.vertex(e+h,i+l,a),this.vertex(s-h,r-l,a),this.vertex(e-h,i-l,a))}x(t,e,i){this.line(t-i,e-i,t+i,e+i),this.line(t-i,e+i,t+i,e-i)}polygon(t,e,i,s){if(i<3)throw new Error("Polygon must contain at least 3 vertices");this.check(os.Line,2*i),s||(s=this.color);this.mesh.getVertices(),this.vertexIndex;i<<=1;let r=t[e<<=1],n=t[e+1],a=e+i;for(let o=e,h=e+i-2;o=a?(h=r,l=n):(h=t[o+2],l=t[o+3]),this.vertex(e,i,s),this.vertex(h,l,s)}}circle(t,e,i,s,r,n=0){if(0==n&&(n=Math.max(1,6*c.cbrt(s)|0)),n<=0)throw new Error("segments must be > 0.");r||(r=this.color);let a=2*c.PI/n,o=Math.cos(a),h=Math.sin(a),l=s,u=0;if(t){this.check(os.Filled,3*n+3),n--;for(let t=0;t0;)this.vertex(b,A,l),b+=S,A+=M,S+=I,M+=E,I+=T,E+=k,this.vertex(b,A,l);this.vertex(b,A,l),this.vertex(a,o,l)}vertex(t,e,i){let s=this.vertexIndex,r=this.mesh.getVertices();r[s++]=t,r[s++]=e,r[s++]=i.r,r[s++]=i.g,r[s++]=i.b,r[s++]=i.a,this.vertexIndex=s}end(){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");this.flush();let t=this.context.gl;t.disable(t.BLEND),this.isDrawing=!1}flush(){if(0!=this.vertexIndex){if(!this.shader)throw new Error("No shader set.");this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0}}check(t,e){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");if(this.shapeType==t){if(!(this.mesh.maxVertices()-this.mesh.numVertices()(t[t.Point=0]="Point",t[t.Line=1]="Line",t[t.Filled=4]="Filled",t))(os||{}),hs=class{constructor(t){this.boneLineColor=new h(1,0,0,1),this.boneOriginColor=new h(0,1,0,1),this.attachmentLineColor=new h(0,0,1,.5),this.triangleLineColor=new h(1,.64,0,.5),this.pathColor=(new h).setFromString("FF7F00"),this.clipColor=new h(.8,0,0,2),this.aabbColor=new h(0,1,0,.5),this.drawBones=!0,this.drawRegionAttachments=!0,this.drawBoundingBoxes=!0,this.drawMeshHull=!0,this.drawMeshTriangles=!0,this.drawPaths=!0,this.drawSkeletonXY=!1,this.drawClipping=!0,this.premultipliedAlpha=!1,this.scale=1,this.boneWidth=2,this.bounds=new ci,this.temp=new Array,this.vertices=m.newFloatArray(2048),this.context=t instanceof vi?t:new vi(t)}draw(t,e,i){let s=e.x,r=e.y,n=this.context.gl,a=this.premultipliedAlpha?n.ONE:n.SRC_ALPHA;t.setBlendMode(a,n.ONE,n.ONE_MINUS_SRC_ALPHA);let o=e.bones;if(this.drawBones){t.setColor(this.boneLineColor);for(let e=0,s=o.length;e-1)continue;if(!s.parent)continue;let r=s.data.length*s.a+s.worldX,n=s.data.length*s.c+s.worldY;t.rectLine(!0,s.worldX,s.worldY,r,n,this.boneWidth*this.scale)}this.drawSkeletonXY&&t.x(s,r,4*this.scale)}if(this.drawRegionAttachments){t.setColor(this.attachmentLineColor);let i=e.slots;for(let e=0,s=i.length;e0){t.setColor(this.attachmentLineColor),h=2*(h>>1);let e=a[h-2],i=a[h-1];for(let s=0,r=h;s-1||t.circle(!0,s.worldX,s.worldY,3*this.scale,this.boneOriginColor,8)}}if(this.drawClipping){let i=e.slots;t.setColor(this.clipColor);for(let e=0,s=i.length;e=0&&i==v.data.index&&(x=!0),!x){h.clipEndWithSlot(v);continue}s>=0&&s==v.data.index&&(x=!1);let y,b=v.getAttachment();if(b instanceof re){let t=b;d.vertices=this.vertices,d.numVertices=4,d.numFloats=w<<2,t.computeWorldVertices(v,d.vertices,0,w),a=cs.QUAD_TRIANGLES,n=t.uvs,y=t.region.renderObject.page.texture,o=t.color}else{if(!(b instanceof te)){if(b instanceof Wt){let t=b;h.clipStart(v,t);continue}h.clipEndWithSlot(v);continue}{let t=b;d.vertices=this.vertices,d.numVertices=t.worldVerticesLength>>1,d.numFloats=d.numVertices*w,d.numFloats>d.vertices.length&&(d.vertices=this.vertices=m.newFloatArray(d.numFloats)),t.computeWorldVertices(v,0,t.worldVerticesLength,d.vertices,0,w),a=t.triangles,y=t.region.renderObject.page.texture,n=t.uvs,o=t.color}}if(y){let e=v.color,i=this.tempColor;i.r=p.r*e.r*o.r,i.g=p.g*e.g*o.g,i.b=p.b*e.b*o.b,i.a=p.a*e.a*o.a,l&&(i.r*=i.a,i.g*=i.a,i.b*=i.a);let s=this.tempColor2;v.darkColor?(l?(s.r=v.darkColor.r*i.a,s.g=v.darkColor.g*i.a,s.b=v.darkColor.b*i.a):s.setFromColor(v.darkColor),s.a=l?1:0):s.set(0,0,0,1);let f=v.data.blendMode;if(f!=u&&(u=f,t.setBlendMode(bi.getSourceColorGLBlendMode(u,l),bi.getSourceAlphaGLBlendMode(u),bi.getDestGLBlendMode(u))),h.isClipping()){h.clipTriangles(d.vertices,d.numFloats,a,a.length,n,i,s,c);let e=new Float32Array(h.clippedVertices),o=h.clippedTriangles;r&&r(d.vertices,d.numFloats,g),t.draw(y,e,o)}else{let e=d.vertices;if(c)for(let t=2,r=0,a=d.numFloats;t(t[t.Stretch=0]="Stretch",t[t.Expand=1]="Expand",t[t.Fit=2]="Fit",t))(vs||{}),ys=0,bs=163,As=class{constructor(t){if(this.logo=null,this.spinner=null,this.angle=0,this.fadeOut=0,this.fadeIn=0,this.timeKeeper=new v,this.backgroundColor=new h(.135,.135,.135,1),this.tempColor=new h,this.renderer=t,this.timeKeeper.maxDelta=9,!fs){let t=navigator.userAgent.indexOf("Safari")>-1,e=()=>ys++;(fs=new Image).src=Ms,t||(fs.crossOrigin="anonymous"),fs.onload=e,(ds=new Image).src=Ss,t||(ds.crossOrigin="anonymous"),ds.onload=e}}dispose(){var t,e;null==(t=this.logo)||t.dispose(),null==(e=this.spinner)||e.dispose()}draw(t=!1){if(ys<2||t&&this.fadeOut>1)return;this.timeKeeper.update();let e=Math.abs(Math.sin(this.timeKeeper.totalTime+.25));this.angle-=200*this.timeKeeper.delta*(1+1.5*Math.pow(e,5));let i=this.tempColor,s=this.renderer,r=s.canvas,n=s.context.gl;if(s.resize(1),s.camera.position.set(r.width/2,r.height/2,0),s.batcher.setBlendMode(n.ONE,n.ONE,n.ONE_MINUS_SRC_ALPHA),t){if(this.fadeOut+=this.timeKeeper.delta*(this.timeKeeper.totalTime<1?2:1),this.fadeOut>1)return;i.setFromColor(this.backgroundColor),e=1-this.fadeOut/1,e=1-(e-1)*(e-1),i.a*=e,i.a>0&&(s.camera.zoom=1,s.begin(),s.quad(!0,0,0,r.width,0,r.width,r.height,0,r.height,i,i,i,i),s.end())}else this.fadeIn+=this.timeKeeper.delta,this.backgroundColor.a>0&&(n.clearColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),n.clear(n.COLOR_BUFFER_BIT)),e=1;e*=Math.min(this.fadeIn/1,1),i.set(e,e,e,e),this.logo||(this.logo=new Si(s.context,fs),this.spinner=new Si(s.context,ds)),s.camera.zoom=Math.max(1,bs/r.height),s.begin(),s.drawTexture(this.logo,(r.width-165)/2,(r.height-108)/2,165,108,i),this.spinner&&s.drawTextureRotated(this.spinner,(r.width-bs)/2,(r.height-bs)/2,bs,bs,81.5,81.5,this.angle,i),s.end()}},Ss="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAALKElEQVR42u2de2iW5R/GPzuqcwfnnKfNmafl5tTNHWzqNi3DEMQykcAoJSsySkspjSIk0iD/07Kf4R+FnVBDUTshZGpWUEJaaiWFgZlUFmXmIe3HNXthyebeZ77P9H13ffBG8Y8H7ut7vff93N/7fu4vGGPiFZiez/Qtw9lytJajfzfw9z/j+efPOv7cV8W+lUNY2a8T/ayTCRsWFLJA5rtUO1LLkV5p9LJeJizQiHeqnlOtmVFtdTGrrZkJCxYXsTgaI6r9MY4/UpNItW4mFDaXsTlaM6qVZlBq3UwofFrJp0HMWJ9DvXUzobCznJ1BzFjWlTLrZkJh/TDWBzFjTgo51s2EgnKI0Rrx+FiOWzNzVaym91Syx5qZsGBWb2ZFa0ZN6dbMhAWTcpkUrRmXD2K5NTNhgVbH0Zpxbl/mWjMTFvRIo0e0ZpzcncnWzISKtvmiMWNRJ4qslwmVXRXsas2Ix8ZwzFqZsGFREYtaM+Oaa1ljrUzYkJ9G/ok6TlzKjJWZVFor0y7c1Zu7WjLiqiGsskamXdHopyT4vALmzS9k/t19uHtKHlOSIMn6xAtARjIZ1sFcUSZ0Y4La+G6M18hS2IlCn4a+WoC0JNL0d/dUupdnUj40g6EJ2VEdMnhrOG/p5f/jUXz8SgmvaGU6KpNRNsLVQV0OdXf24s63h/P2gWoOrBjMCr2GJFQnnxnIM3q5P1PPmaYv+4ev4/C6UtbpV2gzXCkgL5W8Bwt48OIc6ul6Tp+s4+SyASxLiI4+PYCn1bHzDZxvaQW6vZzto7MYnQIpNkf7kp5EuozYUroqEjcNKHHd0Tl9mBPN1pk+hFeieGBnBtog7UXjsj9pWg+m6duecw2cay1OC/uxMC47KmP9OIYfoz1YoC20J/rzRG4quTZK2EAyJGs20qwUbYw0aNRmUxtvfUW/uEtNzc1NB1/X8LVyd15hh82F43AvD+VlXcsSJEZa1CQ3ejleAO7oxR3RDP0XN91X4+NXYb8nkv7UNTwV7e0YTdu7I3g33t7tuaEbNwSZpps2fSyvs4M2Tjhot+jb0Xzbltj8r5j/xVt/6Z1Ob93U1ZYO691EhhzchcHeXosVjcNZysyezLw4xRZt05R+fTeuj8vOj+zKyG0j2aZcVVs6v+QalnjrMFZASQYl2nBoSyz06e3j/Xk8rgWYmMvEICu2pm1HOTuc7okV8FgRj0XukwzanhvCc/F+72TjoQjdObN1OFuDLmh0xP+WHtxiI10ukJlCprb4guiv1fP+avZrS1C7NAkliHZjDtZwMMgqbukAltpMlwuMy2FcEBPqvfLLar5Uqi0hBdEwryy+Mv5n6zkbjTBa+dlMlwvUZFETZKGiFM7tvbhdJ3gSVRO0wzIjnxmvl/J6a6JsGMYGrahtpssFeqbR841S3mhN80OjOaSDEdqd6SjaMKgzgzRK7q1ib3PT9sYyNo7JZoyNFNvRcVMZmy7WOvIuryv/Zvdmdt90+nY0bRp3AvROohFwdwW7dTG7RFlbwlqdrbOBYg005NAQmZU0HWt1rXMBH1Xw0dQ8pmqzoaPmdhun7bHZjNVe9qP9eFQfO1VkUmHjhAVUZ1GtnKFSbjrkrPfy4i4UW5t/6ZxM54J0CqxFe81KpGsQyE4h23oYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjLna+bdOy+IiFquIpGq16Pb79cNYv3IIK/X/ugx+Ui6TVKvYVU9Nc8gX8od8Ir/IN/KPfCQ/yVfyl/6/pfJvLChkQdD6wyqntquCXYuKWJSfRr6D0dEAxV3xlw/khyD+kd/ku/88cHo+09tS3LBpO1HHCVUqcIA6CqB4K+6X6x35L/JM2loXurlWmUmlA5XogOIcK8/If5HncrSWo7F6cKIWPjT/RXGOlWfkv8hzaWsN4uaaysE6WIkOKM6x8oz8F3kusXqo2vxC5jtYiQ4ozrH0TeS5qIZcrB7qkrwdA8U5Vp6R/yLPZV8V+2L14Cl5THGwEh1QnGPlGfkv8lyUlIzFQ1cNYVVHrcjZ0VCcFe9Y+Eb+izy3ceclUl43aFN52DXXssYpnY6a4qFS8ZcP2uIf+e7inRh6pdFrdTGrm8uiHx/L8T2V7NGWzvJBLJ/bl7mTuzO5qBNFDoiJID/IF/KHfCK/yDfyT3O7d/KbfNfS80hNIrU0g9L6HOq1x5iTQo6FNpeLfCQ/yVfyl3xmXYwxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHNk9z4JwJ0SqKTdQkbyEwhU393T6V7zzR6pieR3tE1ITeVXImhe6BXDGZFdRbVeank2TBhcaEMr0rwbixj49IBLL2/L/ffmMuNHfqO9tFZjJYBd1ewO3Lx+IcVfKhqna5nHZYR6XFPH+5R3eeI5t9fx/fvjeC9Jdew5OKZKqFR/RDVKL6vL/f9PJafmyvHsL+a/ff24V6NmjZQbGchVbY6UM2BluqHv1rCqzVZ1KQlkZboepCdQvacPsz5bjTfXao+yMEaDt7Wk9tSIMVGig3TejCtJSM2bSpkPjWPqd1S6Zao+lORSYWmgkOjORRNwZqd5ezMSiHLRooNr5XwWjS6/1XHX9vL2T67N7M1iyXa9JCrYjVrS1gbpJyw6hBfsmiNCYT0P9/A+Wj1/6qGr5YNYFlJBiWJogEzezLz/ZG8/9s4fgtSyuvNYbyp1IONFBtu7sHNv4/j9yAxUHWrdaWsG9+N8XHd+YxkMpSy+aySz841cC5oXbmHCnnI74yxAgZ3YbDeB4PEQCOpBpFNZWwa2ZWRcdnxLsl00crtRB0n2lLg8JNRfDKoM4NsolgBSmw/UMADba1+qpmqfyf6x1u/0a/og3I+aEunP6/i86osqmygcGarF4p54dex/Bo0LqfqOfVwIQ/HW5/RSkwV1oN2WLlHTc82TljAwM4M1O5LWwYKZTjibYXNS0N5KcjKTe10PadfLObFuJwK4ozp+UzXDBTUjL+M5ZcBnRkQV53dMIwNQTu6bSTbVEzbi5awuVByd2E/FgaN0Tc1fKOzBHHV2aAdVSdv6s5NNkp7cSH/++xAng2yyHx+CM/H21YhfdPp+0U1X0TbSZnXx8faG9Aop0MS0cToh1p+iLcpOkLj9t/JOk5eqoPHxnDsyf486an5yqCDK7XZ1O4oZ4dWyy3FSXHUAYq47uyYbMZoGmhpG3DlEFb6uNiVBhpyaHhnBO8oJmfqOROJjzIiP43hJ8UxITqqX56S2Hur2KsOnq3nrE6PPNKPRwrSKbAZrjTQNZmuE7oxYXMZmxWbw9dxWFu4W4ezVedOE6qzI7oyYkY+M7TPeWsPbk2UX1qioSN+E3OZqOR2cReKE+qQRFN0Pi7y73g/UawU1KzezJpXwLz5hczX1ueUPKYkNb6GJQZ+j7/aAfRZREsv+quGsMoamXZBW2Gt5eU0alorEzYsKmJRa/m4NdeyxlqZsCGa84DKnVorEzboC7podis69DfIJmwufHMc7famvvmxZiYsKOtKWbRm1OcW1syEBboSJFozLh/EcmtmwgIluaM14/phrLdmJixYXMTiaM24p5I91syEBTphFOR7Y2tmwgJNvUFOr+tov3UzoaAv44KYUatv62ZCoemdhtG0+hzqrZsJBR08DWLG0gxKrZu50qvpxos3U5NItW4mFPp1ot+lPlpq2lYXs9qamVBZUMiC1ox4pJYjvlfStAu6GmTLcLboMtPIV4/6im5fFfuUi9QIap2MiWP+D96R1vPmsD/fAAAAAElFTkSuQmCC",Ms="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKUAAABsCAYAAAALzHKmAAAQ7klEQVR42u3da4xdVRUA4D0zd2Y6nZY59DVtZ1puS9+lzC0YAi2UQ8AAQczFpPgA9VIeIQbirRqJ0cBUBVGjDr/QCKSNRSMmpuODxAdxqhgwxkhFjf6Sxh/+UUNVNGJCzR7uTvas7LXX2q9zzp3em6y0gTN3Zu75utZe5+yztxC9V+/Ve5X9En1Vjd7J6SFbLNF7naPw+l2jh7YHMBWssqMHtlsRdim4qsLtIawaPiHEQOLoNrA9iIkQDnRrVA1qD2LZ8ISoxYqKo13sQAtBWBayQWZUAXGRQM9JjCngDVY0UqJNDbQrMcaGmArdUKpIjbYiQLsCZCyIMQBy8QwnilR4Q5AuCpxFYvRFmBLbEiwKwpsSaWycVQGZBKMrwBjA9BhxDe57u2L2hOoKNCbOrgAZitEVYUxoKSMErQvSxYIzCkguRg5EF4AUhqUlhy/YUKSxcRaKsioYOQhD4I0yYxkR3PcJBcuFysmgsXAWBTMJyBCMIQh9kGGxXIXvexCQXbHGAMrBWTbM2CCpMSMLIxehC77lSJwXGth7M0FzoVJIXXDWQnGmhOkL0ic7YhhtWdGGkAuPAjUWGoF4faCmwBkbZmyUqUCyMqMLRA4+E6IsdTjidUHKBYrh9CnpRcH0ypKxsyOGEYNIIeTCOz91OIJ1QYoB5eAMyZo+MFNnyVTZ0YiRC9EGEMOyAgshxErHsL2XK1gOUgwohtM1a5YNM7Rsu4K0ZkcbRm4mpPBRwFZ5hg9eCqkrUB+csWGGogzNkqEgrdnRhpGLkINudaLgwvVB6oqzCjCTZElb2Y4B0gUjBtEG0ARnDRLjjoG9DwcshtQGlIPTljVjwUySLWNkyRCQVHa0ZUUTRAwgF91a33BEy0VKAcVwwqwZC2bqbOlUurllOxQkJzNyINoAYqjWhYYjWg5SCiiG05Q1U8FMjTIoS8YE6YORi1BHtJ4KIcQEEtTXUWAxpK44YVlPBdO1jCdFWTZIE8bVGEYMIRPcZGBw4HKQcoBiOE1ZMzbMgVQwU6JMAdKEEcuIJogUvg1YCCE2gsCO42DlIIVAKZwpYJaSLVNnSU6XjYHUmxhTmXaFaMO3EYkLqMC+FsLlIoVAKZzMrEnBhJeLfLNlKMrYWRIDCbOkFSSVHbHM6AKRC6/ODUewNqQ+OLlZkxpjUmV8MBbMUJSxyzY3Q1IgTRgxiBRCHdem0KDAUkBh9sRwwjEnAXMMgTnKhFlUtiwkS5rGka4g9SaGgxFmRC7AzTCEEBcyA36dDSsXqAtOLkysjGMwY5XxVChjZ0kuSCo7YlkRQsQQYtDEFsegsLoCxUp7Kpgps2UslFGzJGccSYHUmxhOZqwzEZqAbfUMCisHKIZzgsCpl3MTzMwTpi1bYp2477gyFKUxS7qWbdjY2EBS2dGE0QQRA7gNCyHEdhjE8RhUDlBT9tzgmjWZMFNlSy+Urk1OzCyJlW0XkK4YOQh1cDtcgwBrQmoDWkdgboBZE8mYsJSHlnFbJ+5bwmOPJ7lZkirbC8aRsMvmgtTHjBhGE0QbwJ2egUE1ITVlUC5OmDVdYNrKuN70xM6WoShjlW4464dbtiFIWK6x7GjESEHUUe0iYncnbMdQSE0Z1ITTNOb0hRmjjLtmS9dmJ2rp1jtuKktyyrb6YLEMCUHq2dGG0QQRQ7f72kzc+cJecerne8Wvv7JNPHPvenEkz8Sh3UtFc92QyGt9Yko/HgOLAIUZlItTz5ouMF3KuE+2jFLCQ1D6lm6fLMkBacuOJowYRBUXyfjuHjF3NhdnsfjvAfH6E9vFt9XxKgikEKgJZyyYalzOLeMu2bLbULI6bh+QGwmQ+rgRlumdGEQAao+K56bEL2woVUwOiev0r8OAUjiJrMmFCbvykGxZRAmPitK1dHM7bohyMsuyi/I8f0+e57fJYIKEZXpXo9E4mOf5XTKyLLvCBLETF8uY2SKepkC+dpX4T02Ivepr4HvZcOZ5fmee54fyPL+DmTUhzAs6n4n8bN5dr9f3YdkSg8nsxG0lPBVKVpNjG0/aGhzfLDmRZdnumZmZp8+c+cdZPV555fSr7Xb7s0jJ3i5Pcue4MxKkPPkvvXTqz/B92u32l0wYOzG1fkhcd/py8Rcbyq/vFM/KY1WA95h/3zzP71bfU6JsNpsfgj+P/FlbrdaDGExYyuXvLz8H+DudODH700ajcSM3W6Yu4alQ1spCOTd38jcKocTZbh9+9NixY99XJ8AEUkcpo9W64yH197m5k7+bnZ19QT+J09NHntQhwji/Jg58qi6++ofLxJ8gSFneVw2Ka4QQDfh1Ok4dZavVmtZ/nrm5k7/Vf55O1tRhboUw5+ZOvqyOl5+R/FyOHj32PYVU/tloNG5IXcKrhJIzngwp3fNjomazea/64BuNxts646f50lWv169utw9/DmtqdJQyZFaSJVuV6nq9fqMEof5/vV6/CYBqgJDlee+yAbF/+4i4ZWqZeNfaIfHWzn+Hx0KcEuU9+s8jv3ej0bhVlXOZydX/k0iRMeb8P0D5e6tj8zy/Xb9UJIc56h/yqVOnXul8lmuZ2bJslKmbHG7XrbpCmCXFRLvdfqQD6jTS3Jiy5I4OykM6ADV+1Eu1DmV6evopBORexzDi1L+X/HnGxsb2w3Hm9PSRJ9QxWPOTZdmlKht2hi+w6dkox5bqffI8fye3hDteGqKaHVsHXihKl0tB+h0cY+lute54AGRKDCW89LNTRynHb7ChUWVVjetOnJh9EYBUyPZeNCoOtsbFQwdXi4/esELcd+tq8cCHJ8UXp+viy9efLz7AgamjlKXc1AA1m83DoIRDlFubzeb96hhZLVTlgJ24gttutx+ONa50bHZKRenaeTs1OfpAfnr6yOOdE7EZdNwmlKocntXLNkA5JTGq47Ds+Lf94lWsyfnXleLfnIwJUN4DOnNYwuUxh2A3Ln9XULrfK8t3J27Tu3BVwiOjXJqoAy8UZej1yclGo3GTLN+gu3w+z/P3YaWbQqk3Ne12e4ZC+c8rxWsYytcPiP9RpZxCqWDKnxOiBNlyAUpOnGsoh4tA2Rm8X9xqtT6md5wyZmYe+0YRKL+1S/wYQ3n8zctBl5SBUv5djivfjMOPduIzcizeiYfr9foVvUwZG+XCuzibZKnSceZ5/v4QlKp8y7ElhnJlTeTP7BI/kllRYfzrfvHqFy4UX1vaL/aVlSmROzwbwdS29T2UcEwZF+V8ozM2lu1VY812u/15akypGh3TmFJesJbHHD167IdUxz3YJy5bNySuX1mbvy55CbMLtzU6tjGlsdFptVqfUMc0Go23F4wy1l2dSnbfvpMwVPe9WWVLDsrOJaF9MFu2Wq1PqmNkGce67xiXhTjdNwdlvV6/BgxfbPfBfVCetxi6b9/rlCup65QzM48dl2OjLMv26CibzeZ96sTIzEFdpwQXz9U1yrtVlpR/Zll2Fec65Y6l4pbbx8XHH9kknvzJlPjlHy8Tp29eKT5ou0aJoIT3w3dBlLDzVpfAJEZ1XOdaJZxnOSlvPMjPzxFljIvng914RwebsjYO7uhMyHu46sOfnf3Oz2TXDW6vvYxdFoIXz3Wc8J5zs9n8iOn2IrxTc2BM3Glqdp7dI553uaOjxrhwcob+MyuUpjs6WZZdon8OcigjPx8V+u+GTWFTSWEx3WYcdJ225jNDSE4q0GHCzlueHOyujn6bUWYgeb9ZZUaQPe+GzQ+Gc8+oOGhC+c1d4gfI16n3XDAhQ7+9qE9l01E2Go132GYKyXE1NiFDTcpoNpv3LOYJGWXNErJNW9sEp63p2RKiVPMn1bS1DgxsyhoGdGpmizj+xtXiDYnx7/vFmce3iWdW1cTVGEY4hQ2ZW0nNq8Qm/M6XbXm3S100lwGedFybuvNOibLI+ZS2ceU4eAxiEuvCkfmU8ycToDxETe6FgCBQHeqyAbFvfEhcO7BwDuXFCEbTZF840XeHK0jYcbs2OIGle0mVJ/mmnClEPQqxyTY5I8/zFhif7fSZee4bnrPOU4AssnRXHaVTCTd14dRDY3UbTIiSeFhsN/aMjgnqthFx880rxX3yATL5p3y4LPXzOaBkUyBjZMlYpbtQlIOBD475ZEusjMNSvkXe6VEoJVDkeZ2dzIfIFsRzU+JF2OyM9M9fTC/6SUYOyFQPjQ2nWiUjxnPfw5EeHqMWIqAeIFsAU847lJM2JM6xsewt1OIDLs99P7ZFHNdB/upS8XtPiD7PfLuCXJNolYyyFiNI/Zit65ItrOVafFbHcFohY7hPTN21Tjz4uc3iqfsnxKdX1MTl1OoYRFaMsToGB6Trw2JFP/OdZC2hJZ7ZkrMoAbbSGmelDJ91hFKuJeS7jlBMkJnrAqqJlgMUZS/dArPlGHNdSg5M3xXXtvquuEatvIYtDRhpxbUJuIgqsU5lGWtUploK0KuEU9mSW8YpmFQ556xNuYW7NiW13B+FkMiKHIy+C6eGgBxJvMR0oSv5hi6+z4HJyZoU0M2RVvDlrOQbcxVfX5AhZbuqy0v7ZstYMLHlAVlLTF9ALLbvu9Y5Zylpn/XOsd0ibIvxr2KCLHpp6SCUIdnSZSF+WzfOhem6GD+1KwR3Z4jNjrtDpNoZwmWd8yrupZN6Hx3fbMmFSe0Swdq2ZIPjxk1112Duo8OBGLrBkw/IoncdK2XHsdC9dHz204m50xh3tzFq1zFqtzHXrfCw7OgDsqyNnZLszVijsmXgrmNcmGtS78lIoMX2aJz03fKO2sDJddPQSCDPiQ1DfWBycY6XtXstc2PQKuxgG2McmXTPb9/9vmuJYXKyJrWjbeg+3xPM4O73nWqvbyw7xgZZSJbEUBa157cNJjdr2vb+5iA1YV3HxYscj30PDCEHIgcjtfm8K8hSsmRotkwFk5s1TTghUAopB6xrjHMBBkI0YYTZ0dZlxwLpkiWDULpmy5gwqayZgZNkA7oKQQCxctByYg0XIIEQQuRitGVHblMTA2ShKGPDpC6wu+DEgJqg2rDGDBtAF4Q6RAojp1xXGmSMbImVcR+YWNY04eQCtUG1ofUJ2/uvcETIgUhhdAE5GAlkKShjwHTNmhhODKgJqQ2sC14uOgyfD0IbRF+MlQaZAiZWyn2yJsTJATqGnHQO2Jhh+xlsACFCG0QbRtdyzQFZCZSxYPpmTS7Q5cjJHYNBYIkZpu99HoUQ/o4QIYSIZUZfjJ4ZMjZI32wZBDMU5yhy8pZTULl4XYP5fagMyEVoy4oupTpGduwnkloSlKEwY+AcQU4MhRTD6ovXBRwFzwWgCSEF0QVjJUGmgEllTS5OLlCIlIN1mS9mx/cZ5eLDALpCTI2RAhkTZQqYoTgpoCPECbaBHQ2ETL3PUl98ECAXYijG0OyYAmQoTG7W5ODkAF1CnVgm2JQx4okPA+gCMTbGskBGgRmaOblAh5GTORIrfKFx4VH4EIAxIXIxlg2SBbMvECY3e7oApbDaIgQu5/2HmeEKEINYiwSRi7EQkLFgumZOCuggctKGI4ULZN/vMeSLj0AYMytWEqMLzFg4fYDaoKaC6wvOFR4FkIPQFaILxrJAOsHsc/zlfYDWXE8qF22s8Pz5KHxcgEVALBtjJXBSSEOwFhk1Zgy4hitCT4hVw+gFs8/zwxqIBbUgyK7fcyA0PD9XX4iVxhiC0xdof6STWCsoBmKF7+cVCWFXQYyBMxRpf+STX1b0x45AhN0OMSrOGEirhrY/dfQAdjvS7oy+WCF6r1RIFxXWvlTRg1YVqFWBmxZbD99ig9pt0YPQw9rD1nstVri9V+/Ve3XrS/wfim4P5fIFxLoAAAAASUVORK5CYII=",Is=class{constructor(t,e){this.time=new v,e.pathPrefix||(e.pathPrefix=""),e.app||(e.app={loadAssets:()=>{},initialize:()=>{},update:()=>{},render:()=>{},error:()=>{}}),e.webglConfig&&(e.webglConfig={alpha:!0}),this.htmlCanvas=t,this.context=new vi(t,e.webglConfig),this.renderer=new ws(t,this.context),this.gl=this.context.gl,this.assetManager=new Mi(this.context,e.pathPrefix),this.input=new qi(t),e.app.loadAssets&&e.app.loadAssets(this);let i=()=>{requestAnimationFrame(i),this.time.update(),e.app.update&&e.app.update(this,this.time.delta),e.app.render&&e.app.render(this)},s=()=>{this.assetManager.isLoadingComplete()?this.assetManager.hasErrors()?e.app.error&&e.app.error(this,this.assetManager.getErrors()):(e.app.initialize&&e.app.initialize(this),i()):requestAnimationFrame(s)};requestAnimationFrame(s)}clear(t,e,i,s){this.gl.clearColor(t,e,i,s),this.gl.clear(this.gl.COLOR_BUFFER_BIT)}};return ps=r,((r,n,a,o)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let h of i(n))s.call(r,h)||h===a||t(r,h,{get:()=>n[h],enumerable:!(o=e(n,h))||o.enumerable});return r})(t({},"__esModule",{value:!0}),ps)})();t.exports=e}).call(window)},3524:(t,e,i)=>{var s=i(7473),r=i(4597),n=i(6732),a=i(2482),o=i(704),h=i(3137),l=i(1192),c=new s({Extends:h,initialize:function(t,e,i,s,n,c,u){var d,f,p,m=[],g=t.cacheManager.custom.spine;if(a(e)){var x=e;for(e=r(x,"key"),f=new o(t,{key:e,url:r(x,"jsonURL"),extension:r(x,"jsonExtension","json"),xhrSettings:r(x,"jsonXhrSettings")}),s=r(x,"atlasURL"),n=r(x,"preMultipliedAlpha"),Array.isArray(s)||(s=[s]),d=0;d{var s=i(2494),r=i(7473),n=i(5851),a=i(3527),o=i(5722),h={canvas:i(5159),webgl:i(7518)},l=i(3524),c=i(8332),u=i(5782),d=i(1984),f=new r({Extends:o,initialize:function(t,e,i){o.call(this,t,e,i);var r=e.game;this.isWebGL=2===r.config.renderType,this.cache=r.cache.addCustom("spine"),this.spineTextures=r.cache.addCustom("spineTextures"),this.json=r.cache.json,this.textures=r.textures,this.drawDebug=!1,this.gl,this.renderer,this.sceneRenderer,this.skeletonRenderer,this.skeletonDebugRenderer,this.plugin=h,this.temp1,this.temp2,this.isWebGL?(this.runtime=h.webgl,this.renderer=r.renderer,this.gl=r.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=r.renderer,this.getAtlas=this.getAtlasCanvas),this.renderer||(this.renderer={width:r.scale.width,height:r.scale.height,preRender:d,postRender:d,render:d,destroy:d});e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",(function(t,e,s,r,n){var a=this.scene.sys[i],o=new c(this.scene,a,t,e,s,r,n);return this.displayList.add(o),this.updateList.add(o),o}),(function(t,e){void 0===t&&(t={});var r=n(t,"key",null),a=n(t,"animationName",null),o=n(t,"loop",!1),h=this.scene.sys[i],l=new c(this.scene,h,0,0,r,a,o);void 0!==e&&(t.add=e),s(this.scene,l,t);var u=n(t,"skinName",!1);u&&l.setSkinByName(u);var d=n(t,"slotName",!1),f=n(t,"attachmentName",null);return d&&l.setAttachment(d,f),l.refresh()})),e.registerGameObject("spineContainer",(function(t,e,s){var r=this.scene.sys[i],n=new u(this.scene,r,t,e,s);return this.displayList.add(n),n}),(function(t,e){void 0===t&&(t={});var r=n(t,"x",0),a=n(t,"y",0),o=n(t,"children",null),h=this.scene.sys[i],l=new u(this.scene,h,r,a,o);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(a,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this),this.game.events.once("destroy",this.gameDestroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){var t=this.renderer.spineSceneRenderer;t||(t=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0),this.renderer.spineSceneRenderer=t),this.sceneRenderer=t,this.skeletonRenderer=t.skeletonRenderer,this.skeletonDebugRenderer=t.skeletonDebugRenderer,this.temp1=new h.webgl.Vector3(0,0,0),this.temp2=new h.webgl.Vector3(0,0,0)},getAtlasCanvas:function(t){var e=this.cache.get(t);if(e){var i,s=this.spineTextures;if(s.has(t))i=s.get(t);else{var r=this.textures;i=new this.runtime.TextureAtlas(e.data,(function(t){return new h.canvas.CanvasTexture(r.get(e.prefix+t).getSourceImage())}))}return i}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var i,s=this.spineTextures;if(s.has(t))i=s.get(t);else{var r=this.textures,n=this.sceneRenderer.context.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i=new this.runtime.TextureAtlas(e.data,(function(t){return new h.webgl.GLTexture(n,r.get(e.prefix+t).getSourceImage(),!1)}))}return i}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,i,s,r,n,a){var o;if(a=a||{},Array.isArray(t))for(var h=0;h{var s=i(7473),r=i(7361),n=i(7738),a=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n){r.call(this,t,i,s,n),this.type="Spine",this.plugin=e},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null,this.plugin=null}});t.exports=a},8064:t=>{t.exports=function(t,e,i,s){var r=e.list;if(0!==r.length){i.addToRenderList(e);var n=e.localTransform;s?(n.loadIdentity(),n.multiply(s),n.translate(e.x,e.y),n.rotate(e.rotation),n.scale(e.scaleX,e.scaleY)):n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var c=0;c{var s=i(1984),r=i(1984);s=i(434),r=i(8064),t.exports={renderWebGL:s,renderCanvas:r}},434:t=>{t.exports=function(t,e,i,s){var r=e.plugin.sceneRenderer,n=e.list;if(0!==n.length){i.addToRenderList(e);var a=e.localTransform;s?(a.loadIdentity(),a.multiply(s),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.newType&&(t.pipelines.clear(),r.begin());var o=t.nextTypeMatch;t.nextTypeMatch=!0,t.newType=!1;for(var h=0;h{t.exports="complete"},8621:t=>{t.exports="dispose"},8944:t=>{t.exports="end"},7494:t=>{t.exports="event"},1908:t=>{t.exports="interrupted"},5591:t=>{t.exports="start"},5146:(t,e,i)=>{t.exports={COMPLETE:i(6576),DISPOSE:i(8621),END:i(8944),EVENT:i(7494),INTERRUPTED:i(1908),START:i(5591)}},8332:(t,e,i)=>{var s=i(6412),r=i(2915),n=i(7473),a=i(1991),o=i(3131),h=i(9660),l=i(4627),c=i(3212),u=i(8414),d=i(3426),f=i(7149),p=i(2273),m=i(4208),g=i(5146),x=i(2762),w=new n({Extends:p,Mixins:[a,o,h,l,c,u,x],initialize:function(t,e,i,s,r,n,a){p.call(this,t,"Spine"),this.plugin=e,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null,this.root=null,this.bounds=null,this.drawDebug=!1,this.timeScale=1,this.displayOriginX=0,this.displayOriginY=0,this.preMultipliedAlpha=!1,this.blendMode=-1,this.setPosition(i,s),r&&this.setSkeleton(r,n,a)},willRender:function(t,e){var i=!this.skeleton||!(15!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id);if(!e&&!i&&this.parentContainer){var s=this.plugin,r=s.sceneRenderer;s.gl&&r.batcher.isDrawing&&(r.end(),s.renderer.pipelines.rebind())}return i},setAlpha:function(t,e){if(void 0===t&&(t=1),e){var i=this.findSlot(e);i&&(i.color.a=r(t,0,1))}else this.alpha=t;return this},alpha:{get:function(){return this.skeleton.color.a},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.a=e),0===e?this.renderFlags&=-3:this.renderFlags|=2}},red:{get:function(){return this.skeleton.color.r},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.r=e)}},green:{get:function(){return this.skeleton.color.g},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.g=e)}},blue:{get:function(){return this.skeleton.color.b},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.b=e)}},setColor:function(t,e){void 0===t&&(t=16777215);var i=(t>>16&255)/255,s=(t>>8&255)/255,r=(255&t)/255,n=t>16777215?(t>>>24)/255:null,a=this.skeleton;if(e){var o=this.findSlot(e);o&&(a=o)}return a.color.r=i,a.color.g=s,a.color.b=r,null!==n&&(a.color.a=n),this},setSkeletonFromJSON:function(t,e,i,s){return this.setSkeleton(t,e,i,s)},setSkeleton:function(t,e,i,s){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,s);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var n=r.skeleton;return n.setSkin(),n.setToSetupPose(),this.skeleton=n,r=this.plugin.createAnimationState(n),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=m(d(this.rotation))+90),this.state.apply(n),n.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=m(d(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,s){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===i&&(i=0),void 0===s&&(s=0),this.width=t,this.height=e,this.displayOriginX=r.x-i,this.displayOriginY=r.y-s,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,s=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=i,t.scaleY=s,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i{var s=i(3426),r=i(4208),n=i(8445);t.exports=function(t,e,i,a){var o=t.currentContext,h=e.plugin,l=e.skeleton,c=h.skeletonRenderer,u=t._tempMatrix1,d=t._tempMatrix2,f=t._tempMatrix3;i.addToRenderList(e),d.applyITRS(e.x,e.y,e.rotation,Math.abs(e.scaleX),Math.abs(e.scaleY)),u.copyFrom(i.matrix),a?(u.multiplyWithOffset(a,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),d.e=e.x,d.f=e.y,u.multiply(d,f)):(d.e-=i.scrollX*e.scrollFactorX,d.f-=i.scrollY*e.scrollFactorY,u.multiply(d,f)),l.x=f.tx,l.y=f.ty,l.scaleX=f.scaleX,l.scaleY=-1*f.scaleY,e.scaleX<0?(l.scaleX*=-1,e.root.rotation=r(f.rotationNormalized)):e.root.rotation=n(r(s(f.rotationNormalized))+90,0,360),e.scaleY<0&&(l.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*r(f.rotationNormalized):e.root.rotation+=2*r(f.rotationNormalized)),i.renderToTexture&&(l.y=f.ty,l.scaleY*=-1),l.updateWorldTransform(),c.ctx=o,c.debugRendering=h.drawDebug||e.drawDebug,o.save(),c.draw(l),o.restore()}},2762:(t,e,i)=>{var s=i(1984),r=i(1984),n=i(1984);s=i(4290),n=i(780),r=i(2753),t.exports={renderWebGL:s,renderCanvas:r,renderDirect:n}},780:(t,e,i)=>{var s=i(2915),r=i(3426),n=i(2208),a=i(4208),o=i(8445);t.exports=function(t,e,i,h,l){var c=e.plugin,u=e.skeleton,d=c.sceneRenderer;t.pipelines.clear(),d.begin();var f=e.scrollFactorX,p=e.scrollFactorY,m=u.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,u.color.a=s(m*l.alpha,0,1)),i.addToRenderList(e);var g=n(e,i,h).calc,x=t.height;if(u.x=g.tx,u.y=x-g.ty,u.scaleX=g.scaleX,u.scaleY=g.scaleY,e.scaleX<0?(u.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(r(g.rotationNormalized))+90,0,360),e.scaleY<0&&(u.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),u.updateWorldTransform(),d.drawSkeleton(u,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,u.color.a=m),c.drawDebug||e.drawDebug){var w=u.x,v=u.y;u.x=0,u.y=0,d.drawSkeletonDebug(u,e.preMultipliedAlpha),u.x=w,u.y=v}d.end(),t.pipelines.rebind()}},4290:(t,e,i)=>{var s=i(2915),r=i(3426),n=i(2208),a=i(4208),o=i(8445);t.exports=function(t,e,i,h,l){var c=e.plugin,u=e.skeleton,d=c.sceneRenderer;t.newType&&(t.pipelines.clear(),d.begin());var f=e.scrollFactorX,p=e.scrollFactorY,m=u.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,u.color.a=s(m*l.alpha,0,1)),i.addToRenderList(e);var g=n(e,i,h).calc,x=t.height;if(u.x=g.tx,u.y=x-g.ty,u.scaleX=g.scaleX,u.scaleY=g.scaleY,e.scaleX<0?(u.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(r(g.rotationNormalized))+90,0,360),e.scaleY<0&&(u.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),u.updateWorldTransform(),d.drawSkeleton(u,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,u.color.a=m),c.drawDebug||e.drawDebug){var w=u.x,v=u.y;u.x=0,u.y=0,d.drawSkeletonDebug(u,e.preMultipliedAlpha),u.x=w,u.y=v}t.nextTypeMatch||(d.end(),t.pipelines.rebind())}},9454:(t,e,i)=>{var s={VERSION:"3.60.0",BlendModes:i(8351),ScaleModes:i(8196),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},1081:(t,e,i)=>{var s=i(7473),r=i(6748),n=new s({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(r.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],s=0;s{t.exports="changedata"},7801:t=>{t.exports="changedata-"},4873:t=>{t.exports="destroy"},9966:t=>{t.exports="removedata"},4586:t=>{t.exports="setdata"},6748:(t,e,i)=>{t.exports={CHANGE_DATA:i(9044),CHANGE_DATA_KEY:i(7801),DESTROY:i(4873),REMOVE_DATA:i(9966),SET_DATA:i(4586)}},3004:(t,e,i)=>{var s=i(2776),r={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return r;r.audioData=!!window.Audio,r.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var s=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(s||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(s)};if(r.ogg=i('ogg; codecs="vorbis"'),r.opus=i('ogg; codecs="opus"',"opus"),r.mp3=i("mpeg"),r.wav=i("wav"),r.m4a=i("x-m4a"),r.aac=i("aac"),r.flac=i("flac","x-flac"),r.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(s.edge)r.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var n=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===n&&a>=11||n>10)&&(r.dolby=!0)}}}catch(t){}return r}()},2776:(t,e,i)=>{var s,r=i(5203),n={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(s=navigator.userAgent,/Edg\/\d+/.test(s)?(n.edge=!0,n.es2019=!0):/OPR/.test(s)?(n.opera=!0,n.es2019=!0):/Chrome\/(\d+)/.test(s)&&!r.windowsPhone?(n.chrome=!0,n.chromeVersion=parseInt(RegExp.$1,10),n.es2019=n.chromeVersion>69):/Firefox\D+(\d+)/.test(s)?(n.firefox=!0,n.firefoxVersion=parseInt(RegExp.$1,10),n.es2019=n.firefoxVersion>10):/AppleWebKit/.test(s)&&r.iOS?n.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(s)?(n.ie=!0,n.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+) Safari/.test(s)&&!r.windowsPhone?(n.safari=!0,n.safariVersion=parseInt(RegExp.$1,10),n.es2019=n.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(n.ie=!0,n.trident=!0,n.tridentVersion=parseInt(RegExp.$1,10),n.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(n.silk=!0),n)},6505:(t,e,i)=>{var s,r,n,a=i(8073),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",r="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(n=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(n,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+r},n.src=s+"AP804Oa6"+r,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),s=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),s}()),o)},6543:(t,e,i)=>{var s=i(5203),r=i(2776),n=i(8073),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=n.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=n.create2D(this),s=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=s.data instanceof Uint8ClampedArray,n.remove(t),n.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!s.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},3922:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",s="FullScreen",r=["request"+i,"request"+s,"webkitRequest"+i,"webkitRequest"+s,"msRequest"+i,"msRequest"+s,"mozRequest"+s,"mozRequest"+i];for(t=0;t{var s=i(2776),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},5203:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},2131:(t,e,i)=>{var s=i(4597),r={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return r;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(r.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(r.h264=!0,r.mp4=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(r.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(r.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(r.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(r.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),r.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e{t.exports={os:i(5203),browser:i(2776),features:i(6543),input:i(1454),audio:i(3004),video:i(2131),fullscreen:i(3922),canvasFeatures:i(6505)}},5686:(t,e,i)=>{var s=i(7473),r=new Float32Array(20),n=new s({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(t){return this._matrix.set(t),this._dirty=!0,this},reset:function(){var t=this._matrix;return t.fill(0),t[0]=1,t[6]=1,t[12]=1,t[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var t=this._data;return this._dirty&&(t.set(this._matrix),t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._dirty=!1),t},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,s=-.5*(i-1);return this.multiply([i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),s=Math.sin(t),r=.213,n=.715,a=.072;return this.multiply([r+.787*i+s*-r,n+i*-n+s*-n,a+i*-a+.928*s,0,0,r+i*-r+.143*s,n+i*(1-n)+.14*s,a+i*-a+-.283*s,0,0,r+i*-r+-.787*s,n+i*-n+s*n,a+.928*i+s*a,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply(n.BLACK_WHITE,t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,s=-.5*(i-1);return this.multiply([i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply(n.NEGATIVE,t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply(n.DESATURATE_LUMINANCE,t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply(n.SEPIA,t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply(n.LSD,t)},brown:function(t){return void 0===t&&(t=!1),this.multiply(n.BROWN,t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply(n.VINTAGE,t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply(n.KODACHROME,t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply(n.TECHNICOLOR,t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply(n.POLAROID,t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply(n.SHIFT_BGR,t)},multiply:function(t,e){void 0===e&&(e=!1),e||this.reset();var i=this._matrix,s=r;return s.set(i),i.set([s[0]*t[0]+s[1]*t[5]+s[2]*t[10]+s[3]*t[15],s[0]*t[1]+s[1]*t[6]+s[2]*t[11]+s[3]*t[16],s[0]*t[2]+s[1]*t[7]+s[2]*t[12]+s[3]*t[17],s[0]*t[3]+s[1]*t[8]+s[2]*t[13]+s[3]*t[18],s[0]*t[4]+s[1]*t[9]+s[2]*t[14]+s[3]*t[19]+s[4],s[5]*t[0]+s[6]*t[5]+s[7]*t[10]+s[8]*t[15],s[5]*t[1]+s[6]*t[6]+s[7]*t[11]+s[8]*t[16],s[5]*t[2]+s[6]*t[7]+s[7]*t[12]+s[8]*t[17],s[5]*t[3]+s[6]*t[8]+s[7]*t[13]+s[8]*t[18],s[5]*t[4]+s[6]*t[9]+s[7]*t[14]+s[8]*t[19]+s[9],s[10]*t[0]+s[11]*t[5]+s[12]*t[10]+s[13]*t[15],s[10]*t[1]+s[11]*t[6]+s[12]*t[11]+s[13]*t[16],s[10]*t[2]+s[11]*t[7]+s[12]*t[12]+s[13]*t[17],s[10]*t[3]+s[11]*t[8]+s[12]*t[13]+s[13]*t[18],s[10]*t[4]+s[11]*t[9]+s[12]*t[14]+s[13]*t[19]+s[14],s[15]*t[0]+s[16]*t[5]+s[17]*t[10]+s[18]*t[15],s[15]*t[1]+s[16]*t[6]+s[17]*t[11]+s[18]*t[16],s[15]*t[2]+s[16]*t[7]+s[17]*t[12]+s[18]*t[17],s[15]*t[3]+s[16]*t[8]+s[17]*t[13]+s[18]*t[18],s[15]*t[4]+s[16]*t[9]+s[17]*t[14]+s[18]*t[19]+s[19]]),this._dirty=!0,this}});n.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],n.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],n.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],n.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],n.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],n.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],n.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],n.KODACHROME=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],n.TECHNICOLOR=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],n.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],n.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t.exports=n},8073:(t,e,i)=>{var s,r,n,a=i(9454),o=i(2150),h=[],l=!1;t.exports=(n=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return s(t,e,i,a.CANVAS)},create:s=function(t,e,i,s,n){var c;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=a.CANVAS),void 0===n&&(n=!1);var u=r(s);return null===u?(u={parent:t,canvas:document.createElement("canvas"),type:s},s===a.CANVAS&&h.push(u),c=u.canvas):(u.parent=t,c=u.canvas),n&&(u.parent=c),c.width=e,c.height=i,l&&s===a.CANVAS&&o.disable(c.getContext("2d",{willReadFrequently:!1})),c},createWebGL:function(t,e,i){return s(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:r=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{var s=i(7473),r=i(3649),n=new s({initialize:function(t,e,i,s,r,n){e||(e=t.sys.make.image({x:i,y:s,key:r,frame:n,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});r.register("bitmapMask",(function(t,e,i,s,r){return new n(this.scene,t,e,i,s,r)})),t.exports=n},6726:(t,e,i)=>{var s=new(i(7473))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,r=this.geometryMask,n=t.maskCount,a=255;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,n,a),s.stencilOp(s.KEEP,s.KEEP,s.INCR),n++):(s.stencilFunc(s.EQUAL,n+1,a),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),this.level=n,r.renderWebGL(t,r,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),this.invertAlpha?s.stencilFunc(s.NOTEQUAL,n,a):s.stencilFunc(s.EQUAL,n,a)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},7340:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,n.BARREL,t),this.amount=e}});t.exports=a},5170:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h){void 0===i&&(i=1),void 0===s&&(s=1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=4),r.call(this,n.BLOOM,t),this.steps=h,this.offsetX=i,this.offsetY=s,this.blurStrength=a,this.strength=o,this.glcolor=[1,1,1],null!=e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4199:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h){void 0===e&&(e=0),void 0===i&&(i=2),void 0===s&&(s=2),void 0===a&&(a=1),void 0===h&&(h=4),r.call(this,n.BLUR,t),this.quality=0,this.x=i,this.y=s,this.steps=h,this.strength=a,this.glcolor=[1,1,1],null!=o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},3132:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h,l){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===s&&(s=.2),void 0===a&&(a=!1),void 0===o&&(o=1),void 0===h&&(h=1),void 0===l&&(l=1),r.call(this,n.BOKEH,t),this.radius=e,this.amount=i,this.contrast=s,this.isTiltShift=a,this.strength=l,this.blurX=o,this.blurY=h}});t.exports=a},6610:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o){void 0===e&&(e=8),void 0===a&&(a=1),void 0===o&&(o=.005),r.call(this,n.CIRCLE,t),this.scale=a,this.feather=o,this.thickness=e,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],null!=i&&(this.color=i),null!=s&&(this.backgroundColor=s)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundColor:{get:function(){var t=this.glcolor2;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor2;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4931:(t,e,i)=>{var s=i(7473),r=i(5686),n=i(1571),a=new s({Extends:r,initialize:function(t){r.call(this),this.type=n.COLOR_MATRIX,this.gameObject=t,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});t.exports=a},6128:(t,e,i)=>{var s=new(i(7473))({initialize:function(t,e){this.type=t,this.gameObject=e,this.active=!0},setActive:function(t){return this.active=t,this},destroy:function(){this.gameObject=null,this.active=!1}});t.exports=s},9195:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===s&&(s=.005),r.call(this,n.DISPLACEMENT,t),this.x=i,this.y=s,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.gameObject.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=a},445:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a){void 0===i&&(i=4),void 0===s&&(s=0),void 0===a&&(a=!1),r.call(this,n.GLOW,t),this.outerStrength=i,this.innerStrength=s,this.knockout=a,this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},7724:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h,l,c){void 0===s&&(s=.2),void 0===a&&(a=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l=1),void 0===c&&(c=0),r.call(this,n.GRADIENT,t),this.alpha=s,this.size=c,this.fromX=a,this.fromY=o,this.toX=h,this.toY=l,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],null!=e&&(this.color1=e),null!=i&&(this.color2=i)},color1:{get:function(){var t=this.glcolor1;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor1;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}},color2:{get:function(){var t=this.glcolor2;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor2;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}}});t.exports=a},4412:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,n.PIXELATE,t),this.amount=e}});t.exports=a},75:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.1),void 0===a&&(a=1),void 0===h&&(h=6),void 0===l&&(l=1),r.call(this,n.SHADOW,t),this.x=e,this.y=i,this.decay=s,this.power=a,this.glcolor=[0,0,0,1],this.samples=h,this.intensity=l,void 0!==o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},8734:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===s&&(s=3),void 0===a&&(a=!1),r.call(this,n.SHINE,t),this.speed=e,this.lineWidth=i,this.gradient=s,this.reveal=a}});t.exports=a},2437:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===s&&(s=.5),void 0===a&&(a=.5),r.call(this,n.VIGNETTE,t),this.x=e,this.y=i,this.radius=s,this.strength=a}});t.exports=a},5984:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a){void 0===e&&(e=.1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===a&&(a=!1),r.call(this,n.WIPE,t),this.progress=0,this.wipeWidth=e,this.direction=i,this.axis=s,this.reveal=a}});t.exports=a},1571:t=>{t.exports={GLOW:4,SHADOW:5,PIXELATE:6,VIGNETTE:7,SHINE:8,BLUR:9,GRADIENT:12,BLOOM:13,COLOR_MATRIX:14,CIRCLE:15,BARREL:16,DISPLACEMENT:17,WIPE:18,BOKEH:19}},7347:(t,e,i)=>{var s=i(1030),r=i(1571),n={Barrel:i(7340),Controller:i(6128),Bloom:i(5170),Blur:i(4199),Bokeh:i(3132),Circle:i(6610),ColorMatrix:i(4931),Displacement:i(9195),Glow:i(445),Gradient:i(7724),Pixelate:i(4412),Shadow:i(75),Shine:i(8734),Vignette:i(2437),Wipe:i(5984)};n=s(!1,n,r),t.exports=n},2494:(t,e,i)=>{var s=i(8351),r=i(8361);t.exports=function(t,e,i){e.x=r(i,"x",0),e.y=r(i,"y",0),e.depth=r(i,"depth",0),e.flipX=r(i,"flipX",!1),e.flipY=r(i,"flipY",!1);var n=r(i,"scale",null);"number"==typeof n?e.setScale(n):null!==n&&(e.scaleX=r(n,"x",1),e.scaleY=r(n,"y",1));var a=r(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=r(a,"x",1),e.scrollFactorY=r(a,"y",1)),e.rotation=r(i,"rotation",0);var o=r(i,"angle",null);null!==o&&(e.angle=o),e.alpha=r(i,"alpha",1);var h=r(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),c=r(h,"y",.5);e.setOrigin(l,c)}return e.blendMode=r(i,"blendMode",s.NORMAL),e.visible=r(i,"visible",!0),r(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},2273:(t,e,i)=>{var s=i(7473),r=i(6125),n=i(1081),a=i(4399),o=i(3389),h=i(204),l=new s({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new n(this)),this},setData:function(t,e){return this.data||(this.data=new n(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new n(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new n(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new n(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.preFX&&(this.preFX.destroy(),this.preFX=void 0),this.postFX&&(this.postFX.destroy(),this.postFX=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},3649:(t,e,i)=>{var s=i(7473),r=i(8456),n=i(204),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectFactory",a,"add"),t.exports=a},2208:(t,e,i)=>{var s=i(4227),r=new s,n=new s,a=new s,o={camera:r,sprite:n,calc:a};t.exports=function(t,e,i){var s=r,h=n,l=a;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),s.multiply(h,l),o}},4344:(t,e,i)=>{var s=i(2915),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,r){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=r},4518:(t,e,i)=>{var s=i(2915),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=r},5173:(t,e,i)=>{var s=i(8351),r={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=r},1991:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},8305:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},3131:t=>{var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},1626:(t,e,i)=>{var s=i(7473),r=i(7347),n=i(8935),a=new s({initialize:function(t,e){this.gameObject=t,this.isPost=e,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(t){return void 0===t&&(t=0),this.padding=t,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(t){if(!this.isPost){var e=this.gameObject.scene.sys.renderer;e&&e.pipelines?(this.gameObject.pipeline=e.pipelines.FX_PIPELINE,void 0!==t&&(this.padding=t),this.enabled=!0):this.enabled=!1}},clear:function(){if(this.isPost)this.gameObject.resetPostPipeline(!0);else{for(var t=this.list,e=0;e{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},3671:(t,e,i)=>{var s=i(1392),r=i(9876),n=i(2529),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&r(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t,e){return void 0===t&&(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getTopLeft:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,r,n,a,o,h,l;if(void 0===t&&(t=new s),this.parentContainer){var c=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),c.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),c.transformPoint(t.x,t.y,t),r=t.x,n=t.y,this.getBottomLeft(t),c.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),c.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),r=t.x,n=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,r,a,h),t.y=Math.min(i,n,o,l),t.width=Math.max(e,r,a,h)-t.x,t.height=Math.max(i,n,o,l)-t.y,t}};t.exports=a},2246:(t,e,i)=>{var s=i(7499),r=i(6726),n={mask:null,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},createBitmapMask:function(t,e,i,r,n){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new s(this.scene,t,e,i,r,n)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new r(this.scene,t)}};t.exports=n},5085:t=>{var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},77:(t,e,i)=>{var s=i(7149),r=i(1864),n=i(5851),a=i(3747),o=i(2529),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=n(t,"from",0),t.to=n(t,"to",1);var h=r(t,"positionOnPath",!1);this.rotateToPath=r(t,"rotateToPath",!1),this.pathRotationOffset=n(t,"rotationOffset",0);var l=n(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var c=this.path.getPoint(.1);this.rotation=Math.atan2(c.y-this.y,c.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,r=this.pathVector;if(i.copy(r).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,r),i.add(r),r.add(this.pathOffset),void this.setPosition(r.x,r.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),r),i.add(r),r.add(this.pathOffset);var n=this.x,o=this.y;this.setPosition(r.x,r.y);var h=this.x-n,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+s(this.pathRotationOffset))}}};t.exports=h},986:(t,e,i)=>{var s=i(3911),r={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(t){this.pipelineData={};var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(i){void 0===t&&(t=i.default);var s=i.get(t);if(s)return this.defaultPipeline=s,this.pipeline=s,!0}return!1},setPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var n=r.pipelines;if(n){var a=n.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?s(e):e)}return this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},resetPipeline:function(t){return void 0===t&&(t=!1),this.pipeline=this.defaultPipeline,t&&(this.pipelineData={}),null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=r},4461:(t,e,i)=>{var s=i(3911),r=i(1626),n=i(8935),a={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(t){this.postPipelines=[],this.postPipelineData={},this.postFX=new r(this,!0),t&&(this.preFX=new r(this,!1))},setPostPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var n=r.pipelines;if(n){Array.isArray(t)||(t=[t]);for(var a=0;a0,this},setPostPipelineData:function(t,e){var i=this.postPipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,s=[],r=0;r=0;s--){var r=i[s];(e&&r.name===t||!e&&r===t)&&(r.destroy(),n(i,s))}return this.hasPostPipeline=this.postPipelines.length>0,this},clearFX:function(){return this.preFX&&this.preFX.clear(),this.postFX&&this.postFX.clear(),this}};t.exports=a},4627:t=>{var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},1868:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},4976:(t,e,i)=>{var s=i(2362),r={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=r},9243:(t,e,i)=>{var s=i(2362),r={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=r},5693:t=>{var e={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,s=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=s,this.tintFill=!1,this},setTintFill:function(t,e,i,s){return this.setTint(t,e,i,s),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=e},6125:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},3212:(t,e,i)=>{var s=i(7425),r=i(4227),n=i(7556),a=i(3692),o=i(2820),h=i(2529),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:0!==this._scaleY&&(this.renderFlags|=4)}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:0!==this._scaleX&&(this.renderFlags|=4)}},angle:{get:function(){return o(this._rotation*s.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.z=i,this.w=s,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*s,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(e||(e=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,s){i||(i=new h),s||(s=this.scene.sys.cameras.main);var r=s.scrollX,a=s.scrollY,o=t+r*this.scrollFactorX-r,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):n(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},4227:(t,e,i)=>{var s=i(7473),r=i(7425),n=i(2529),a=new s({initialize:function(t,e,i,s,r,n){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===r&&(r=0),void 0===n&&(n=0),this.matrix=new Float32Array([t,e,i,s,r,n,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||n?r.TAU-(n>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,r=s[0],n=s[1],a=s[2],o=s[3];return s[0]=r*i+a*e,s[1]=n*i+o*e,s[2]=r*-e+a*i,s[3]=n*-e+o*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,r=i[0],n=i[1],a=i[2],o=i[3],h=i[4],l=i[5],c=s[0],u=s[1],d=s[2],f=s[3],p=s[4],m=s[5],g=void 0===e?i:e.matrix;return g[0]=c*r+u*a,g[1]=c*n+u*o,g[2]=d*r+f*a,g[3]=d*n+f*o,g[4]=p*r+m*a+h,g[5]=p*n+m*o+l,g},multiplyWithOffset:function(t,e,i){var s=this.matrix,r=t.matrix,n=s[0],a=s[1],o=s[2],h=s[3],l=e*n+i*o+s[4],c=e*a+i*h+s[5],u=r[0],d=r[1],f=r[2],p=r[3],m=r[4],g=r[5];return s[0]=u*n+d*o,s[1]=u*a+d*h,s[2]=f*n+p*o,s[3]=f*a+p*h,s[4]=m*n+g*o+l,s[5]=m*a+g*h+c,this},transform:function(t,e,i,s,r,n){var a=this.matrix,o=a[0],h=a[1],l=a[2],c=a[3],u=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*c,a[2]=i*o+s*l,a[3]=i*h+s*c,a[4]=r*o+n*l+u,a[5]=r*h+n*c+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,r=s[0],n=s[1],a=s[2],o=s[3],h=s[4],l=s[5];return i.x=t*r+e*a+h,i.y=t*n+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=e*r-i*s;return t[0]=r/o,t[1]=-i/o,t[2]=-s/o,t[3]=e/o,t[4]=(s*a-r*n)/o,t[5]=-(e*a-i*n)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,r,n){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=s,a[4]=r,a[5]=n,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],r=e[2],n=e[3],a=i*n-s*r;if(t.translateX=e[4],t.translateY=e[5],i||s){var o=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(r||n){var h=Math.sqrt(r*r+n*n);t.rotation=.5*Math.PI-(n>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,r){var n=this.matrix,a=Math.sin(i),o=Math.cos(i);return n[4]=t,n[5]=e,n[0]=o*s,n[1]=a*s,n[2]=-a*r,n[3]=o*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new n);var s=this.matrix,r=s[0],a=s[1],o=s[2],h=s[3],l=s[4],c=s[5],u=1/(r*h+o*-a);return i.x=h*u*t+-o*u*e+(c*o-l*h)*u,i.y=r*u*e+-a*u*t+(-c*r+l*a)*u,i},setQuad:function(t,e,i,s,r,n){void 0===n&&(n=this.quad);var a=this.matrix,o=a[0],h=a[1],l=a[2],c=a[3],u=a[4],d=a[5];return n[0]=t*o+e*l+u,n[1]=t*h+e*c+d,n[2]=t*o+s*l+u,n[3]=t*h+s*c+d,n[4]=i*o+s*l+u,n[5]=i*h+s*c+d,n[6]=i*o+e*l+u,n[7]=i*h+e*c+d,r&&n.forEach((function(t,e){n[e]=Math.round(t)})),n},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.round(s)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.round(s)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},8414:t=>{var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},4286:(t,e,i)=>{t.exports={Alpha:i(4344),AlphaSingle:i(4518),BlendMode:i(5173),ComputedSize:i(1991),Crop:i(8305),Depth:i(3131),Flip:i(9660),FX:i(1626),GetBounds:i(3671),Mask:i(2246),Origin:i(5085),PathFollower:i(77),Pipeline:i(986),PostPipeline:i(4461),ScrollFactor:i(4627),Size:i(1868),Texture:i(4976),TextureCrop:i(9243),Tint:i(5693),ToJSON:i(6125),Transform:i(3212),TransformMatrix:i(4227),Visible:i(8414)}},7361:(t,e,i)=>{var s=i(1953),r=i(8351),n=i(7473),a=i(4286),o=i(3389),h=i(2273),l=i(1392),c=i(3232),u=i(9422),d=i(2529),f=new n({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.PostPipeline,a.Transform,a.Visible,c],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(e,i),this.setBlendMode(r.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,r=!1;t.setEmpty();for(var n=0;n-1},setAll:function(t,e,i,r){return s.SetAll(this.list,t,e,i,r),this},each:function(t,e){var i,s=[null],r=this.list.slice(),n=r.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},2840:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var r=e.list;if(0!==r.length){var n=e.localTransform;s?(n.loadIdentity(),n.multiply(s),n.translate(e.x,e.y),n.rotate(e.rotation),n.scale(e.scaleX,e.scaleY)):n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var c=0;c{var s=i(1984),r=s,n=s;r=i(4343),n=i(2840),t.exports={renderWebGL:r,renderCanvas:n}},4343:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var r=e.list,n=r.length;if(0!==n){var a=e.localTransform;s?(a.loadIdentity(),a.multiply(s),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var o=-1!==e.blendMode;o||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,c=e.scrollFactorY,u=0;u{t.exports="addedtoscene"},4265:t=>{t.exports="destroy"},8671:t=>{t.exports="removedfromscene"},3420:t=>{t.exports="complete"},601:t=>{t.exports="created"},7919:t=>{t.exports="error"},6231:t=>{t.exports="locked"},5241:t=>{t.exports="loop"},8325:t=>{t.exports="playing"},3356:t=>{t.exports="play"},7513:t=>{t.exports="seeked"},5788:t=>{t.exports="seeking"},7111:t=>{t.exports="stalled"},8118:t=>{t.exports="stop"},9184:t=>{t.exports="textureready"},4287:t=>{t.exports="unlocked"},857:t=>{t.exports="unsupported"},3389:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(6608),DESTROY:i(4265),REMOVED_FROM_SCENE:i(8671),VIDEO_COMPLETE:i(3420),VIDEO_CREATED:i(601),VIDEO_ERROR:i(7919),VIDEO_LOCKED:i(6231),VIDEO_LOOP:i(5241),VIDEO_PLAY:i(3356),VIDEO_PLAYING:i(8325),VIDEO_SEEKED:i(7513),VIDEO_SEEKING:i(5788),VIDEO_STALLED:i(7111),VIDEO_STOP:i(8118),VIDEO_TEXTURE:i(9184),VIDEO_UNLOCKED:i(4287),VIDEO_UNSUPPORTED:i(857)}},1643:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},8881:(t,e,i)=>{var s=i(7655);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},4479:(t,e,i)=>{var s=i(4771),r=i(7655);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=s(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,c=0;c{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},284:(t,e,i)=>{var s=i(7473),r=i(8881),n=i(4479),a=i(1643),o=i(3915),h=i(2529),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return n(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},3915:(t,e,i)=>{var s=i(7655);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},7655:(t,e,i)=>{var s=i(7473),r=i(1643),n=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=r.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=n},5956:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},716:(t,e,i)=>{var s=i(7120),r=i(7655);t.exports=function(t,e,i){if(void 0===i&&(i=new r),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var n=s(t)*e;return e>.5?(n-=t.width+t.height)<=t.width?(i.x=t.right-n,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(n-t.width)):n<=t.width?(i.x=t.x+n,i.y=t.y):(i.x=t.right,i.y=t.y+(n-t.width)),i}},8151:(t,e,i)=>{var s=i(716),r=i(7120);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=r(t)/i);for(var a=0;a{t.exports=function(t){return 2*(t.width+t.height)}},2161:(t,e,i)=>{var s=i(7655);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},1392:(t,e,i)=>{var s=i(7473),r=i(5956),n=i(716),a=i(8151),o=i(1643),h=i(284),l=i(2161),c=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=c},9422:(t,e,i)=>{var s=i(1392);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=Math.min(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-r,o=Math.max(t.bottom,e.bottom)-n;return i.setTo(r,n,a,o)}},1593:(t,e,i)=>{var s=i(7473),r=i(4359),n=i(1179),a=i(4597),o=i(5593),h=i(7410),l=i(5874),c=i(707),u=new s({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var s=a(e,"url");void 0===s?s=t.path+i+"."+a(e,"extension",""):"string"!=typeof s||s.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(s=t.path+s),this.url=s,this.src="",this.xhrSettings=c(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===r.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=r.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,s=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(s=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==r.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(n.FILE_COMPLETE,e,i,t),this.loader.emit(n.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=r.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},9845:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},5593:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},7410:(t,e,i)=>{var s=i(1030),r=i(707);t.exports=function(t,e){var i=void 0===t?r():s({},t);if(e)for(var n in e)void 0!==e[n]&&(i[n]=e[n]);return i}},3137:(t,e,i)=>{var s=i(7473),r=i(4359),n=i(1179),a=new s({initialize:function(t,e,i,s){var n=[];s.forEach((function(t){t&&n.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=n,this.state=r.FILE_PENDING,this.complete=!1,this.pending=n.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a{var s=i(7410);t.exports=function(t,e){var i=s(e,t.xhrSettings),r=new XMLHttpRequest;if(r.open("GET",t.src,i.async,i.user,i.password),r.responseType=t.xhrSettings.responseType,r.timeout=i.timeout,i.headers)for(var n in i.headers)r.setRequestHeader(n,i.headers[n]);return i.header&&i.headerValue&&r.setRequestHeader(i.header,i.headerValue),i.requestedWith&&r.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&r.overrideMimeType(i.overrideMimeType),i.withCredentials&&(r.withCredentials=!0),r.onload=t.onLoad.bind(t,r),r.onerror=t.onError.bind(t,r),r.onprogress=t.onProgress.bind(t),r.send(),r}},707:t=>{t.exports=function(t,e,i,s,r,n){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===s&&(s=""),void 0===r&&(r=0),void 0===n&&(n=!1),{responseType:t,async:e,user:i,password:s,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:n}}},4359:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},462:t=>{t.exports="addfile"},7297:t=>{t.exports="complete"},8660:t=>{t.exports="filecomplete"},6484:t=>{t.exports="filecomplete-"},7972:t=>{t.exports="loaderror"},1906:t=>{t.exports="load"},1441:t=>{t.exports="fileprogress"},1072:t=>{t.exports="postprocess"},1927:t=>{t.exports="progress"},6597:t=>{t.exports="start"},1179:(t,e,i)=>{t.exports={ADD:i(462),COMPLETE:i(7297),FILE_COMPLETE:i(8660),FILE_KEY_COMPLETE:i(6484),FILE_LOAD_ERROR:i(7972),FILE_LOAD:i(1906),FILE_PROGRESS:i(1441),POST_PROCESS:i(1072),PROGRESS:i(1927),START:i(6597)}},6732:(t,e,i)=>{var s=i(7473),r=i(4359),n=i(1593),a=i(9845),o=i(4597),h=i(2482),l=i(5593),c=new s({Extends:n,initialize:function t(e,i,s,r,a){var l,c="png";if(h(i)){var u=i;i=o(u,"key"),s=o(u,"url"),l=o(u,"normalMap"),r=o(u,"xhrSettings"),c=o(u,"extension",c),a=o(u,"frameConfig")}Array.isArray(s)&&(l=s[1],s=s[0]);var d={type:"image",cache:e.textureManager,extension:c,responseType:"blob",key:i,url:s,xhrSettings:r,config:a};if(n.call(this,e,d),l){var f=new t(e,this.key,l,r,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){n.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){n.revokeObjectURL(t.data),t.onProcessError()},n.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=r.FILE_PROCESSING,t===r.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=r.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=r.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t?t.state>=r.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(7473),r=i(4359),n=i(1593),a=i(9845),o=i(4597),h=i(5851),l=i(2482),c=new s({Extends:n,initialize:function(t,e,i,s,a){var c="json";if(l(e)){var u=e;e=o(u,"key"),i=o(u,"url"),s=o(u,"xhrSettings"),c=o(u,"extension",c),a=o(u,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:c,responseType:"text",key:e,url:i,xhrSettings:s,config:a};n.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=r.FILE_POPULATED)},onProcess:function(){if(this.state!==r.FILE_POPULATED){this.state=r.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,s){if(Array.isArray(t))for(var r=0;r{var s=i(7473),r=i(4359),n=i(1593),a=i(9845),o=i(4597),h=i(2482),l=new s({Extends:n,initialize:function(t,e,i,s){var r="text",a="txt",l=t.cacheManager.text;if(h(e)){var c=e;e=o(c,"key"),i=o(c,"url"),s=o(c,"xhrSettings"),a=o(c,"extension",a),r=o(c,"type",r),l=o(c,"cache",l)}var u={type:r,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:s};n.call(this,t,u)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{t.exports=function(t){for(var e=0,i=0;i{var s=i(3916);t.exports=function(t,e){return s(t)/s(e)/s(t-e)}},7025:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},48:t=>{t.exports=function(t,e,i,s,r){var n=.5*(s-e),a=.5*(r-i),o=t*t;return(2*i-2*s+n+a)*(t*o)+(-3*i+3*s-2*n-a)*o+n*t+i}},5035:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.ceil(t*s)/s}},2915:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},7149:(t,e,i)=>{var s=i(7425);t.exports=function(t){return t*s.DEG_TO_RAD}},2975:t=>{t.exports=function(t,e){return Math.abs(t-e)}},2107:(t,e,i)=>{var s=i(2915),r=i(7473),n=i(9652),a=i(1984),o=new n,h=new r({initialize:function t(e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=t.DefaultOrder),this._x=e,this._y=i,this._z=s,this._order=r,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,s){return void 0===s&&(s=this._order),this._x=t,this._y=e,this._z=i,this._order=s,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var r=t.val,n=r[0],a=r[4],o=r[8],h=r[1],l=r[5],c=r[9],u=r[2],d=r[6],f=r[10],p=0,m=0,g=0,x=.99999;switch(e){case"XYZ":m=Math.asin(s(o,-1,1)),Math.abs(o){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},104:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},4941:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s}},1555:(t,e,i)=>{var s=i(2915);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))+e}},5005:t=>{t.exports=function(t,e){return t/e/1e3}},3702:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},8820:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},1743:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},3416:t=>{t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},2149:(t,e,i)=>{var s=new(i(7473))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=l*n-a*h,u=-l*r+a*o,d=h*r-n*o,f=e*c+i*u+s*d;return f?(f=1/f,t[0]=c*f,t[1]=(-l*i+s*h)*f,t[2]=(a*i-s*n)*f,t[3]=u*f,t[4]=(l*e-s*o)*f,t[5]=(-a*e+s*r)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(n*e-i*r)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=n*l-a*h,t[1]=s*h-i*l,t[2]=i*a-s*n,t[3]=a*o-r*l,t[4]=e*l-s*o,t[5]=s*r-e*a,t[6]=r*h-n*o,t[7]=i*o-e*h,t[8]=e*n-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*n-a*h)+i*(-l*r+a*o)+s*(h*r-n*o)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=t.val,d=u[0],f=u[1],p=u[2],m=u[3],g=u[4],x=u[5],w=u[6],v=u[7],y=u[8];return e[0]=d*i+f*n+p*h,e[1]=d*s+f*a+p*l,e[2]=d*r+f*o+p*c,e[3]=m*i+g*n+x*h,e[4]=m*s+g*a+x*l,e[5]=m*r+g*o+x*c,e[6]=w*i+v*n+y*h,e[7]=w*s+v*a+y*l,e[8]=w*r+v*o+y*c,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*n,e[1]=l*s+h*a,e[2]=l*r+h*o,e[3]=l*n-h*i,e[4]=l*a-h*s,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,r=t.w,n=e+e,a=i+i,o=s+s,h=e*n,l=e*a,c=e*o,u=i*a,d=i*o,f=s*o,p=r*n,m=r*a,g=r*o,x=this.val;return x[0]=1-(u+f),x[3]=l+g,x[6]=c-m,x[1]=l-g,x[4]=1-(h+f),x[7]=d+p,x[2]=c+m,x[5]=d-p,x[8]=1-(h+u),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],m=e[12],g=e[13],x=e[14],w=e[15],v=s*h-r*o,y=s*l-n*o,b=s*c-a*o,A=r*l-n*h,S=r*c-a*h,M=n*c-a*l,I=u*g-d*m,E=u*x-f*m,T=u*w-p*m,k=d*x-f*g,C=d*w-p*g,R=f*w-p*x,F=v*R-y*C+b*k+A*T-S*E+M*I;return F?(F=1/F,i[0]=(h*R-l*C+c*k)*F,i[1]=(l*T-o*R-c*E)*F,i[2]=(o*C-h*T+c*I)*F,i[3]=(n*C-r*R-a*k)*F,i[4]=(s*R-n*T+a*E)*F,i[5]=(r*T-s*C-a*I)*F,i[6]=(g*M-x*S+w*A)*F,i[7]=(x*b-m*M-w*y)*F,i[8]=(m*S-g*b+w*v)*F,this):null}});t.exports=s},9652:(t,e,i)=>{var s=i(7473),r=i(5689),n=1e-6,a=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,r,n,a,o,h,l,c,u,d,f,p,m){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=s,g[4]=r,g[5]=n,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=c,g[11]=u,g[12]=d,g[13]=f,g[14]=p,g[15]=m,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=o.fromQuat(i).val,r=e.x,n=e.y,a=e.z;return this.setValues(s[0]*r,s[1]*r,s[2]*r,0,s[4]*n,s[5]*n,s[6]*n,0,s[8]*a,s[9]*a,s[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],r=t[6],n=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=s,t[13]=n,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15],x=e*a-i*n,w=e*o-s*n,v=e*h-r*n,y=i*o-s*a,b=i*h-r*a,A=s*h-r*o,S=l*p-c*f,M=l*m-u*f,I=l*g-d*f,E=c*m-u*p,T=c*g-d*p,k=u*g-d*m,C=x*k-w*T+v*E+y*I-b*M+A*S;return C?(C=1/C,this.setValues((a*k-o*T+h*E)*C,(s*T-i*k-r*E)*C,(p*A-m*b+g*y)*C,(u*b-c*A-d*y)*C,(o*I-n*k-h*M)*C,(e*k-s*I+r*M)*C,(m*v-f*A-g*w)*C,(l*A-u*v+d*w)*C,(n*T-a*I+h*S)*C,(i*I-e*T-r*S)*C,(f*b-p*v+g*x)*C,(c*v-l*b-d*x)*C,(a*M-n*E-o*S)*C,(e*E-i*M+s*S)*C,(p*w-f*y-m*x)*C,(l*y-c*w+u*x)*C)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return this.setValues(a*(u*g-d*m)-c*(o*g-h*m)+p*(o*d-h*u),-(i*(u*g-d*m)-c*(s*g-r*m)+p*(s*d-r*u)),i*(o*g-h*m)-a*(s*g-r*m)+p*(s*h-r*o),-(i*(o*d-h*u)-a*(s*d-r*u)+c*(s*h-r*o)),-(n*(u*g-d*m)-l*(o*g-h*m)+f*(o*d-h*u)),e*(u*g-d*m)-l*(s*g-r*m)+f*(s*d-r*u),-(e*(o*g-h*m)-n*(s*g-r*m)+f*(s*h-r*o)),e*(o*d-h*u)-n*(s*d-r*u)+l*(s*h-r*o),n*(c*g-d*p)-l*(a*g-h*p)+f*(a*d-h*c),-(e*(c*g-d*p)-l*(i*g-r*p)+f*(i*d-r*c)),e*(a*g-h*p)-n*(i*g-r*p)+f*(i*h-r*a),-(e*(a*d-h*c)-n*(i*d-r*c)+l*(i*h-r*a)),-(n*(c*m-u*p)-l*(a*m-o*p)+f*(a*u-o*c)),e*(c*m-u*p)-l*(i*m-s*p)+f*(i*u-s*c),-(e*(a*m-o*p)-n*(i*m-s*p)+f*(i*o-s*a)),e*(a*u-o*c)-n*(i*u-s*c)+l*(i*o-s*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return(e*a-i*n)*(u*g-d*m)-(e*o-s*n)*(c*g-d*p)+(e*h-r*n)*(c*m-u*p)+(i*o-s*a)*(l*g-d*f)-(i*h-r*a)*(l*m-u*f)+(s*h-r*o)*(l*p-c*f)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],g=e[14],x=e[15],w=t.val,v=w[0],y=w[1],b=w[2],A=w[3];return e[0]=v*i+y*a+b*c+A*p,e[1]=v*s+y*o+b*u+A*m,e[2]=v*r+y*h+b*d+A*g,e[3]=v*n+y*l+b*f+A*x,v=w[4],y=w[5],b=w[6],A=w[7],e[4]=v*i+y*a+b*c+A*p,e[5]=v*s+y*o+b*u+A*m,e[6]=v*r+y*h+b*d+A*g,e[7]=v*n+y*l+b*f+A*x,v=w[8],y=w[9],b=w[10],A=w[11],e[8]=v*i+y*a+b*c+A*p,e[9]=v*s+y*o+b*u+A*m,e[10]=v*r+y*h+b*d+A*g,e[11]=v*n+y*l+b*f+A*x,v=w[12],y=w[13],b=w[14],A=w[15],e[12]=v*i+y*a+b*c+A*p,e[13]=v*s+y*o+b*u+A*m,e[14]=v*r+y*h+b*d+A*g,e[15]=v*n+y*l+b*f+A*x,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,r=i[0],n=i[4],a=i[8],o=i[12],h=i[1],l=i[5],c=i[9],u=i[13],d=i[2],f=i[6],p=i[10],m=i[14],g=i[3],x=i[7],w=i[11],v=i[15],y=s[0],b=s[4],A=s[8],S=s[12],M=s[1],I=s[5],E=s[9],T=s[13],k=s[2],C=s[6],R=s[10],F=s[14],Y=s[3],P=s[7],X=s[11],L=s[15];return this.setValues(r*y+n*M+a*k+o*Y,h*y+l*M+c*k+u*Y,d*y+f*M+p*k+m*Y,g*y+x*M+w*k+v*Y,r*b+n*I+a*C+o*P,h*b+l*I+c*C+u*P,d*b+f*I+p*C+m*P,g*b+x*I+w*C+v*P,r*A+n*E+a*R+o*X,h*A+l*E+c*R+u*X,d*A+f*E+p*R+m*X,g*A+x*E+w*R+v*X,r*S+n*T+a*F+o*L,h*S+l*T+c*F+u*L,d*S+f*T+p*F+m*L,g*S+x*T+w*F+v*L)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),r=1-i,n=t.x,a=t.y,o=t.z,h=r*n,l=r*a;return this.setValues(h*n+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*n,0,h*o-s*a,l*o+s*n,r*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,r=e.y,a=e.z,o=Math.sqrt(s*s+r*r+a*a);if(Math.abs(o){t.exports=function(t,e,i){return Math.min(t+e,i)}},44:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},5385:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},8585:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=e+1);var r=(t-e)/(i-e);return r>1?void 0!==s?(r=(s-t)/(s-i))<0&&(r=0):r=1:r<0&&(r=0),r}},372:(t,e,i)=>{var s=i(7473),r=i(2149),n=i(1984),a=i(5689),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),c=new a(1,0,0),u=new a(0,1,0),d=new a,f=new r,p=new s({initialize:function(t,e,i,s){this.onChangeCallback=n,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=s*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),r+e*(t.z-r),n+e*(t.w-n))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(c).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=f.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+r*n+i*o-s*a,i*h+r*a+s*n-e*o,s*h+r*o+e*a-i*n,r*h-e*n-i*a-s*o)},slerp:function(t,e){var i=this.x,s=this.y,r=this.z,n=this.w,a=t.x,h=t.y,l=t.z,c=t.w,u=i*a+s*h+r*l+n*c;u<0&&(u=-u,a=-a,h=-h,l=-l,c=-c);var d=1-e,f=e;if(1-u>o){var p=Math.acos(u),m=Math.sin(p);d=Math.sin((1-e)*p)/m,f=Math.sin(e*p)/m}return this.set(d*i+f*a,d*s+f*h,d*r+f*l,d*n+f*c)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s,n=r?1/r:0;return this.set(-t*n,-e*n,-i*n,s*n)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+r*n,i*a+s*n,s*a-i*n,r*a-e*n)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a-s*n,i*a+r*n,s*a+e*n,r*a-i*n)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*n,i*a-e*n,s*a+r*n,r*a-s*n)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,r=t.z/2,n=Math.cos(i),a=Math.cos(s),o=Math.cos(r),h=Math.sin(i),l=Math.sin(s),c=Math.sin(r);switch(t.order){case"XYZ":this.set(h*a*o+n*l*c,n*l*o-h*a*c,n*a*c+h*l*o,n*a*o-h*l*c,e);break;case"YXZ":this.set(h*a*o+n*l*c,n*l*o-h*a*c,n*a*c-h*l*o,n*a*o+h*l*c,e);break;case"ZXY":this.set(h*a*o-n*l*c,n*l*o+h*a*c,n*a*c+h*l*o,n*a*o-h*l*c,e);break;case"ZYX":this.set(h*a*o-n*l*c,n*l*o+h*a*c,n*a*c-h*l*o,n*a*o+h*l*c,e);break;case"YZX":this.set(h*a*o+n*l*c,n*l*o+h*a*c,n*a*c-h*l*o,n*a*o-h*l*c,e);break;case"XZY":this.set(h*a*o-n*l*c,n*l*o-h*a*c,n*a*c+h*l*o,n*a*o+h*l*c,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],r=i[4],n=i[8],a=i[1],o=i[5],h=i[9],l=i[2],c=i[6],u=i[10],d=s+o+u;return d>0?(e=.5/Math.sqrt(d+1),this.set((c-h)*e,(n-l)*e,(a-r)*e,.25/e)):s>o&&s>u?(e=2*Math.sqrt(1+s-o-u),this.set(.25*e,(r+a)/e,(n+l)/e,(c-h)/e)):o>u?(e=2*Math.sqrt(1+o-s-u),this.set((r+a)/e,.25*e,(h+c)/e,(n-l)/e)):(e=2*Math.sqrt(1+u-s-o),this.set((n+l)/e,(h+c)/e,.25*e,(a-r)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var n=h[r],a=h[n];e=Math.sqrt(i[3*r+r]-i[3*n+n]-i[3*a+a]+1),l[r]=.5*e,e=.5/e,l[n]=(i[3*n+r]+i[3*r+n])*e,l[a]=(i[3*a+r]+i[3*r+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+n]-i[3*n+a])*e}return this.onChangeCallback(this),this}});t.exports=p},4208:(t,e,i)=>{var s=i(7425);t.exports=function(t){return t*s.RAD_TO_DEG}},1705:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},6650:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,r=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=s*e,t}},2037:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},6283:t=>{t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},9876:t=>{t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x-e,o=t.y-i;return t.x=a*r-o*n+e,t.y=a*n+o*r+i,t}},8348:t=>{t.exports=function(t,e,i,s,r){var n=s+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},4497:t=>{t.exports=function(t,e,i,s,r){return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},9640:(t,e,i)=>{var s=i(5689),r=i(9652),n=i(372),a=new r,o=new n,h=new s;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},4078:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},855:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},4936:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1),s*=Math.PI/t;for(var r=[],n=[],a=0;a{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},278:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},163:(t,e,i)=>{var s=i(2529);t.exports=function(t,e,i,r){void 0===r&&(r=new s);var n=0,a=0;return t>0&&t<=e*i&&(n=t>e-1?t-(a=Math.floor(t/e))*e:t),r.set(n,a)}},7556:(t,e,i)=>{var s=i(2529);t.exports=function(t,e,i,r,n,a,o,h){void 0===h&&(h=new s);var l=Math.sin(n),c=Math.cos(n),u=c*a,d=l*a,f=-l*o,p=c*o,m=1/(u*p+f*-d);return h.x=p*m*t+-f*m*e+(r*f-i*p)*m,h.y=u*m*e+-d*m*t+(-r*u+i*d)*m,h}},2529:(t,e,i)=>{var s=i(7473),r=i(12),n=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new n(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return r(this.x,t.x,e)&&r(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});n.ZERO=new n,n.RIGHT=new n(1,0),n.LEFT=new n(-1,0),n.UP=new n(0,-1),n.DOWN=new n(0,1),n.ONE=new n(1,1),t.exports=n},5689:(t,e,i)=>{var s=new(i(7473))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,r=t.z,n=e.x,a=e.y,o=e.z;return this.x=s*o-r*a,this.y=r*n-i*o,this.z=i*a-s*n,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z;return this.x=i*a-s*n,this.y=s*r-e*a,this.z=e*n-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*n,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*n,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*n,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+s*r[6],this.y=e*r[1]+i*r[4]+s*r[7],this.z=e*r[2]+i*r[5]+s*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12],this.y=r[1]*e+r[5]*i+r[9]*s+r[13],this.z=r[2]*e+r[6]*i+r[10]*s+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=e*r[0]+i*r[4]+s*r[8]+r[12],a=e*r[1]+i*r[5]+s*r[9]+r[13],o=e*r[2]+i*r[6]+s*r[10]+r[14],h=e*r[3]+i*r[7]+s*r[11]+r[15];return this.x=n/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,c=o*s+r*i-n*e,u=-r*e-n*i-a*s;return this.x=h*o+u*-r+l*-a-c*-n,this.y=l*o+u*-n+c*-r-h*-a,this.z=c*o+u*-a+h*-n-l*-r,this},project:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=r[0],a=r[1],o=r[2],h=r[3],l=r[4],c=r[5],u=r[6],d=r[7],f=r[8],p=r[9],m=r[10],g=r[11],x=r[12],w=r[13],v=r[14],y=1/(e*h+i*d+s*g+r[15]);return this.x=(e*n+i*l+s*f+x)*y,this.y=(e*a+i*c+s*p+w)*y,this.z=(e*o+i*u+s*m+v)*y,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,r=t.z,n=t.w,a=this.x-i,o=n-this.y-1-s,h=this.z;return this.x=2*a/r-1,this.y=2*o/n-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},9279:(t,e,i)=>{var s=new(i(7473))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=s*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this.w=n+e*(t.w-n),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+s*s+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12]*r,this.y=n[1]*e+n[5]*i+n[9]*s+n[13]*r,this.z=n[2]*e+n[6]*i+n[10]*s+n[14]*r,this.w=n[3]*e+n[7]*i+n[11]*s+n[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,c=o*s+r*i-n*e,u=-r*e-n*i-a*s;return this.x=h*o+u*-r+l*-a-c*-n,this.y=l*o+u*-n+c*-r-h*-a,this.z=c*o+u*-a+h*-n-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},4119:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},8445:t=>{t.exports=function(t,e,i){if(t>=e&&t<=i)return t;var s=i-e;return e+((t-e)%s+s)%s}},6412:t=>{t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},760:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},6909:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},6947:t=>{t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},3426:(t,e,i)=>{var s=i(7425);t.exports=function(t){return t>Math.PI&&(t-=s.PI2),Math.abs(((t+s.TAU)%s.PI2-s.PI2)%s.PI2)}},6906:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},3270:(t,e,i)=>{var s=i(104);t.exports=function(){return s(-Math.PI,Math.PI)}},2748:(t,e,i)=>{var s=i(104);t.exports=function(){return s(-180,180)}},936:(t,e,i)=>{var s=i(6906);t.exports=function(t){return s(t+Math.PI)}},1935:(t,e,i)=>{var s=i(7425);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},3692:(t,e,i)=>{var s=i(8445);t.exports=function(t){return s(t,-Math.PI,Math.PI)}},2820:(t,e,i)=>{var s=i(8445);t.exports=function(t){return s(t,-180,180)}},1833:(t,e,i)=>{t.exports={Between:i(6412),BetweenPoints:i(760),BetweenPointsY:i(6909),BetweenY:i(6947),CounterClockwise:i(3426),Normalize:i(6906),Random:i(3270),RandomDegrees:i(2748),Reverse:i(936),RotateTo:i(1935),ShortestBetween:i(5393),Wrap:i(3692),WrapDegrees:i(2820)}},7425:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},1518:t=>{t.exports=function(t,e,i,s){var r=t-i,n=e-s;return Math.sqrt(r*r+n*n)}},5372:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}},4430:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}},4361:t=>{t.exports=function(t,e,i,s){return Math.max(Math.abs(t-i),Math.abs(e-s))}},7798:t=>{t.exports=function(t,e,i,s,r){return void 0===r&&(r=2),Math.sqrt(Math.pow(i-t,r)+Math.pow(s-e,r))}},8290:t=>{t.exports=function(t,e,i,s){return Math.abs(t-i)+Math.abs(e-s)}},3788:t=>{t.exports=function(t,e,i,s){var r=t-i,n=e-s;return r*r+n*n}},6338:(t,e,i)=>{t.exports={Between:i(1518),BetweenPoints:i(5372),BetweenPointsSquared:i(4430),Chebyshev:i(4361),Power:i(7798),Snake:i(8290),Squared:i(3788)}},5751:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},6203:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},9103:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},4938:(t,e,i)=>{t.exports={In:i(5751),Out:i(9103),InOut:i(6203)}},8677:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},4649:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},504:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},8872:(t,e,i)=>{t.exports={In:i(8677),Out:i(504),InOut:i(4649)}},3170:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},2627:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},1349:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},5006:(t,e,i)=>{t.exports={In:i(3170),Out:i(1349),InOut:i(2627)}},6046:t=>{t.exports=function(t){return t*t*t}},9531:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},4836:t=>{t.exports=function(t){return--t*t*t+1}},875:(t,e,i)=>{t.exports={In:i(6046),Out:i(4836),InOut:i(9531)}},7619:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},7437:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+1}},8119:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/i)+1}},2884:(t,e,i)=>{t.exports={In:i(7619),Out:i(8119),InOut:i(7437)}},5456:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},3461:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},2711:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},6287:(t,e,i)=>{t.exports={In:i(5456),Out:i(2711),InOut:i(3461)}},8613:(t,e,i)=>{t.exports={Back:i(4938),Bounce:i(8872),Circular:i(5006),Cubic:i(875),Elastic:i(2884),Expo:i(6287),Linear:i(4233),Quadratic:i(6341),Quartic:i(762),Quintic:i(345),Sine:i(8698),Stepped:i(7051)}},744:t=>{t.exports=function(t){return t}},4233:(t,e,i)=>{t.exports=i(744)},9810:t=>{t.exports=function(t){return t*t}},8163:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},6123:t=>{t.exports=function(t){return t*(2-t)}},6341:(t,e,i)=>{t.exports={In:i(9810),Out:i(6123),InOut:i(8163)}},7337:t=>{t.exports=function(t){return t*t*t*t}},4878:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},9012:t=>{t.exports=function(t){return 1- --t*t*t*t}},762:(t,e,i)=>{t.exports={In:i(7337),Out:i(9012),InOut:i(4878)}},303:t=>{t.exports=function(t){return t*t*t*t*t}},553:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},1632:t=>{t.exports=function(t){return--t*t*t*t*t+1}},345:(t,e,i)=>{t.exports={In:i(303),Out:i(1632),InOut:i(553)}},8455:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},1844:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},990:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},8698:(t,e,i)=>{t.exports={In:i(8455),Out:i(990),InOut:i(1844)}},6745:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},7051:(t,e,i)=>{t.exports=i(6745)},3158:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},12:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},7373:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},2622:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(3158),Equal:i(12),Floor:i(1326),GreaterThan:i(7373),LessThan:i(2622)}},4675:(t,e,i)=>{var s=i(7425),r=i(1030),n={Angle:i(1833),Distance:i(6338),Easing:i(8613),Fuzzy:i(7927),Interpolation:i(2140),Pow2:i(7897),Snap:i(3943),RandomDataGenerator:i(6957),Average:i(3136),Bernstein:i(785),Between:i(7025),CatmullRom:i(48),CeilTo:i(5035),Clamp:i(2915),DegToRad:i(7149),Difference:i(2975),Euler:i(2107),Factorial:i(3916),FloatBetween:i(104),FloorTo:i(4941),FromPercent:i(1555),GetSpeed:i(5005),IsEven:i(3702),IsEvenStrict:i(8820),Linear:i(1743),LinearXY:i(3416),MaxAdd:i(3733),Median:i(44),MinSub:i(5385),Percent:i(8585),RadToDeg:i(4208),RandomXY:i(1705),RandomXYZ:i(6650),RandomXYZW:i(2037),Rotate:i(6283),RotateAround:i(9876),RotateAroundDistance:i(8348),RotateTo:i(4497),RoundAwayFromZero:i(4078),RoundTo:i(855),SinCosTableGenerator:i(4936),SmootherStep:i(278),SmoothStep:i(2733),ToXY:i(163),TransformXY:i(7556),Within:i(4119),Wrap:i(8445),Vector2:i(2529),Vector3:i(5689),Vector4:i(9279),Matrix3:i(2149),Matrix4:i(9652),Quaternion:i(372),RotateVec3:i(9640)};n=r(!1,n,s),t.exports=n},1640:(t,e,i)=>{var s=i(785);t.exports=function(t,e){for(var i=0,r=t.length-1,n=0;n<=r;n++)i+=Math.pow(1-e,r-n)*Math.pow(e,n)*t[n]*s(r,n);return i}},6105:(t,e,i)=>{var s=i(48);t.exports=function(t,e){var i=t.length-1,r=i*e,n=Math.floor(r);return t[0]===t[i]?(e<0&&(n=Math.floor(r=i*(1+e))),s(r-n,t[(n-1+i)%i],t[n],t[(n+1)%i],t[(n+2)%i])):e<0?t[0]-(s(-r,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(s(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(r-n,t[n?n-1:0],t[n],t[i{t.exports=function(t,e,i,s,r){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,r)}},6765:(t,e,i)=>{var s=i(1743);t.exports=function(t,e){var i=t.length-1,r=i*e,n=Math.floor(r);return e<0?s(t[0],t[1],r):e>1?s(t[i],t[i-1],i-r):s(t[n],t[n+1>i?i:n+1],r-n)}},6388:t=>{t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},5735:(t,e,i)=>{var s=i(2733);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},8705:(t,e,i)=>{var s=i(278);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},2140:(t,e,i)=>{t.exports={Bezier:i(1640),CatmullRom:i(6105),CubicBezier:i(4002),Linear:i(6765),QuadraticBezier:i(6388),SmoothStep:i(5735),SmootherStep:i(8705)}},5443:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},167:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},7897:(t,e,i)=>{t.exports={GetNext:i(5443),IsSize:i(725),IsValue:i(167)}},6957:(t,e,i)=>{var s=new(i(7473))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},5659:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},5461:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},5131:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},3943:(t,e,i)=>{t.exports={Ceil:i(5659),Floor:i(5461),To:i(5131)}},8666:(t,e,i)=>{var s=new(i(7473))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},8456:t=>{var e={},i={},s={register:function(t,i,s,r){void 0===r&&(r=!1),e[t]={plugin:i,mapping:s,custom:r}},registerCustom:function(t,e,s,r){i[t]={plugin:e,mapping:s,data:r}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=s},5722:(t,e,i)=>{var s=i(8666),r=i(7473),n=i(204),a=new r({Extends:s,initialize:function(t,e,i){s.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(n.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},8351:t=>{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},8196:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},3527:t=>{t.exports="resize"},8618:t=>{t.exports="addedtoscene"},4328:t=>{t.exports="boot"},6099:t=>{t.exports="create"},7645:t=>{t.exports="destroy"},2710:t=>{t.exports="pause"},2547:t=>{t.exports="postupdate"},8577:t=>{t.exports="prerender"},8197:t=>{t.exports="preupdate"},8997:t=>{t.exports="ready"},7604:t=>{t.exports="removedfromscene"},8999:t=>{t.exports="render"},9742:t=>{t.exports="resume"},3667:t=>{t.exports="shutdown"},3468:t=>{t.exports="sleep"},7840:t=>{t.exports="start"},9896:t=>{t.exports="transitioncomplete"},5103:t=>{t.exports="transitioninit"},3162:t=>{t.exports="transitionout"},7841:t=>{t.exports="transitionstart"},6454:t=>{t.exports="transitionwake"},6536:t=>{t.exports="update"},3875:t=>{t.exports="wake"},204:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(8618),BOOT:i(4328),CREATE:i(6099),DESTROY:i(7645),PAUSE:i(2710),POST_UPDATE:i(2547),PRE_RENDER:i(8577),PRE_UPDATE:i(8197),READY:i(8997),REMOVED_FROM_SCENE:i(7604),RENDER:i(8999),RESUME:i(9742),SHUTDOWN:i(3667),SLEEP:i(3468),START:i(7840),TRANSITION_COMPLETE:i(9896),TRANSITION_INIT:i(5103),TRANSITION_OUT:i(3162),TRANSITION_START:i(7841),TRANSITION_WAKE:i(6454),UPDATE:i(6536),WAKE:i(3875)}},2362:(t,e,i)=>{var s=i(7473),r=i(2915),n=i(1030),a=new s({initialize:function(t,e,i,s,r,n,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(n,a,s,r)},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.cutX=i,this.cutY=s,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var r=this.data,n=r.cut;n.x=i,n.y=s,n.w=t,n.h=e,n.r=i+t,n.b=s+e,r.sourceSize.w=t,r.sourceSize.h=e,r.spriteSourceSize.w=t,r.spriteSourceSize.h=e,r.radius=.5*Math.sqrt(t*t+e*e);var a=r.drawImage;return a.x=i,a.y=s,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,s,r,n){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=s,o.w=r,o.h=n,o.r=i+r,o.b=s+n,this.x=i,this.y=s,this.width=r,this.height=n,this.halfWidth=.5*r,this.halfHeight=.5*n,this.centerX=Math.floor(r/2),this.centerY=Math.floor(n/2),this.updateUVs()},setCropUVs:function(t,e,i,s,n,a,o){var h=this.cutX,l=this.cutY,c=this.cutWidth,u=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=r(e,0,d)),m=l+(i=r(i,0,f)),g=s=r(s,0,d-e),x=n=r(n,0,f-i),w=this.data;if(w.trim){var v=w.spriteSourceSize,y=e+(s=r(s,0,c-e)),b=i+(n=r(n,0,u-i));if(!(v.ry||v.y>b)){var A=Math.max(v.x,e),S=Math.max(v.y,i),M=Math.min(v.r,y)-A,I=Math.min(v.b,b)-S;g=M,x=I,p=a?h+(c-(A-v.x)-M):h+(A-v.x),m=o?l+(u-(S-v.y)-I):l+(S-v.y),e=A,i=S,s=M,n=I}else p=0,m=0,g=0,x=0}else a&&(p=h+(c-e-s)),o&&(m=l+(u-i-n));var E=this.source.width,T=this.source.height;return t.u0=Math.max(0,p/E),t.v0=Math.max(0,m/T),t.u1=Math.min(1,(p+g)/E),t.v1=Math.min(1,(m+x)/T),t.x=e,t.y=i,t.cx=p,t.cy=m,t.cw=g,t.ch=x,t.width=s,t.height=n,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,r,n){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=s,this.u1=r,this.v1=n,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=s;var n=this.source.width,a=this.source.height;return this.u0=t/n,this.v0=e/a,this.u1=(t+i)/n,this.v1=(e+s)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=n(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},1864:t=>{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},3747:t=>{t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},7473:t=>{function e(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,s,r,a){for(var o in s)if(s.hasOwnProperty(o)){var h=e(s,o,r);if(!1!==h){if(i((a||t).prototype,o)){if(n.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=s[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},1792:t=>{t.exports=function(t,e,i,s,r){if(void 0===r&&(r=t),i>0){var n=i-t.length;if(n<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>n&&(e.splice(n),a=n);for(var o=0;o{t.exports=function(t,e,i,s,r,n){if(void 0===i&&(i=0),void 0===n&&(n=t),s>0){var a=s-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),r&&r.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;s>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),r&&r.call(n,l)}return e}},2513:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var s=i(2497);t.exports=function(t,e,i,r,n){void 0===r&&(r=0),void 0===n&&(n=t.length);var a=0;if(s(t,r,n))for(var o=r;o{t.exports=function(t,e,i){var s,r=[null];for(s=3;s{var s=i(2497);t.exports=function(t,e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=t.length),s(t,r,n)){var a,o=[null];for(a=5;a{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var s,r,n=1;if(i){if(te.length&&(n=e.length),i?(s=e[n-1][i],(r=e[n][i])-t<=t-s?e[n]:e[n-1]):(s=e[n-1],(r=e[n])-t<=t-s?r:s)}},4493:t=>{var e=function(t,i){void 0===i&&(i=[]);for(var s=0;s{var s=i(2497);t.exports=function(t,e,i,r,n){void 0===r&&(r=0),void 0===n&&(n=t.length);var a=[];if(s(t,r,n))for(var o=r;o{var s=i(2497);t.exports=function(t,e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=t.length),s(t,r,n))for(var a=r;a{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return void 0===t[s]?null:t[s]}},8683:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return s>r||(t.splice(s,1),r===t.length-1?t.push(e):t.splice(r,0,e)),t}},546:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return s{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var s=t[i-1],r=t.indexOf(s);t[i]=s,t[r]=e}return t}},1419:t=>{t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},6512:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,s){var r,n=[],a=!1;if((i||s)&&(a=!0,i||(i=""),s||(s="")),e=e;r--)a?n.push(i+r.toString()+s):n.push(r);else for(r=t;r<=e;r++)a?n.push(i+r.toString()+s):n.push(r);return n}},1316:(t,e,i)=>{var s=i(4078);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var r=[],n=Math.max(s((e-t)/(i||1)),0),a=0;a{function e(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function i(t,e){return te?1:0}var s=function(t,r,n,a,o){for(void 0===n&&(n=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>n;){if(a-n>600){var h=a-n+1,l=r-n+1,c=Math.log(h),u=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*u*(h-u)/h)*(l-h/2<0?-1:1),f=Math.max(n,Math.floor(r-l*u/h+d)),p=Math.min(a,Math.floor(r+(h-l)*u/h+d));s(t,r,f,p,o)}var m=t[r],g=n,x=a;for(e(t,n,r),o(t[a],m)>0&&e(t,n,a);g0;)x--}0===o(t[n],m)?e(t,n,x):e(t,++x,a),x<=r&&(n=x+1),r<=x&&(a=x-1)}};t.exports=s},9703:(t,e,i)=>{var s=i(5851),r=i(4912),n=function(t,e,i){for(var s=[],r=0;r{var s=i(8935);t.exports=function(t,e,i,r){var n;if(void 0===r&&(r=t),!Array.isArray(e))return-1!==(n=t.indexOf(e))?(s(t,n),i&&i.call(r,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(n=t.indexOf(h))&&(s(t,n),o.push(h),i&&i.call(r,h)),a--}return o}},4725:(t,e,i)=>{var s=i(8935);t.exports=function(t,e,i,r){if(void 0===r&&(r=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var n=s(t,e);return i&&i.call(r,n),n}},8780:(t,e,i)=>{var s=i(2497);t.exports=function(t,e,i,r,n){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===n&&(n=t),s(t,e,i)){var a=i-e,o=t.splice(e,a);if(r)for(var h=0;h{var s=i(8935);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*i);return s(t,r)}},6960:t=>{t.exports=function(t,e,i){var s=t.indexOf(e),r=t.indexOf(i);return-1!==s&&-1===r&&(t[s]=i,!0)}},1021:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e,i,s){var r=t.length;if(e<0||e>r||e>=i||i>r){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},5361:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},3718:(t,e,i)=>{var s=i(2497);t.exports=function(t,e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=t.length),s(t,r,n))for(var a=r;a{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},2071:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},8935:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],r=e;r{var s=i(9356);function r(t,e){return String(t).localeCompare(e)}function n(t,e,i,s){var r,n,a,o,h,l=t.length,c=0,u=2*i;for(r=0;rl&&(n=l),a>l&&(a=l),o=r,h=n;;)if(o{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return t[s]=i,t[r]=e,t}},1953:(t,e,i)=>{t.exports={Matrix:i(1237),Add:i(1792),AddAt:i(2280),BringToTop:i(2513),CountAllMatching:i(1771),Each:i(7883),EachInRange:i(5856),FindClosestInSorted:i(3957),Flatten:i(4493),GetAll:i(6245),GetFirst:i(1647),GetRandom:i(5301),MoveDown:i(1842),MoveTo:i(1419),MoveUp:i(6512),MoveAbove:i(8683),MoveBelow:i(546),NumberArray:i(4130),NumberArrayStep:i(1316),QuickSelect:i(9465),Range:i(9703),Remove:i(7161),RemoveAt:i(4725),RemoveBetween:i(8780),RemoveRandomElement:i(5744),Replace:i(6960),RotateLeft:i(1021),RotateRight:i(4027),SafeRange:i(2497),SendToBack:i(5361),SetAll:i(3718),Shuffle:i(4912),SortByDigits:i(2071),SpliceOne:i(8935),StableSort:i(9992),Swap:i(2372)}},1816:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var s=i(7222),r=i(1816);t.exports=function(t){var e="";if(!r(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},6063:t=>{t.exports=function(t){for(var e=0;e{var s=i(7116);t.exports=function(t){return s(t,180)}},2597:(t,e,i)=>{var s=i(7116);t.exports=function(t){return s(t,90)}},7116:(t,e,i)=>{var s=i(1816),r=i(4780);t.exports=function(t,e){if(void 0===e&&(e=90),!s(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=r(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=r(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var s=i(7116);t.exports=function(t){return s(t,-90)}},7711:(t,e,i)=>{var s=i(1021),r=i(4027);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?s(t,Math.abs(i)):r(t,i)),0!==e)for(var n=0;n{t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),r=0;r-1;n--)s[r][n]=t[n][r]}return s}},1237:(t,e,i)=>{t.exports={CheckMatrix:i(1816),MatrixToString:i(6655),ReverseColumns:i(582),ReverseRows:i(6063),Rotate180:i(8321),RotateLeft:i(2597),RotateMatrix:i(7116),RotateRight:i(6285),Translate:i(7711),TransposeMatrix:i(4780)}},3911:t=>{var e=function(t){var i,s,r;if("object"!=typeof t||null===t)return t;for(r in i=Array.isArray(t)?[]:{},t)s=t[r],i[r]=e(s);return i};t.exports=e},1030:(t,e,i)=>{var s=i(2482),r=function(){var t,e,i,n,a,o,h=arguments[0]||{},l=1,c=arguments.length,u=!1;for("boolean"==typeof h&&(u=h,h=arguments[1]||{},l=2),c===l&&(h=this,--l);l{var s=i(4675),r=i(5851);t.exports=function(t,e,i){var n=r(t,e,null);if(null===n)return i;if(Array.isArray(n))return s.RND.pick(n);if("object"==typeof n){if(n.hasOwnProperty("randInt"))return s.RND.integerInRange(n.randInt[0],n.randInt[1]);if(n.hasOwnProperty("randFloat"))return s.RND.realInRange(n.randFloat[0],n.randFloat[1])}else if("function"==typeof n)return n(e);return n}},4597:t=>{t.exports=function(t,e,i){var s=typeof t;return t&&"number"!==s&&"string"!==s&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},5851:t=>{t.exports=function(t,e,i,s){if(!t&&!s||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(s&&s.hasOwnProperty(e))return s[e];if(-1!==e.indexOf(".")){for(var r=e.split("."),n=t,a=s,o=i,h=i,l=!0,c=!0,u=0;u{t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},7222:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===s&&(s=3);var r=0;if(e+1>=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var n=Math.ceil((r=e-t.length)/2);t=new Array(r-n+1).join(i)+t+new Array(n+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}}},e={};var i=function i(s){var r=e[s];if(void 0!==r)return r.exports;var n=e[s]={exports:{}};return t[s](n,n.exports,i),n.exports}(4513);window.SpinePlugin=i})(); \ No newline at end of file diff --git a/plugins/spine4.1/dist/SpineWebGLPlugin.js b/plugins/spine4.1/dist/SpineWebGLPlugin.js index 7c32472a3..08ce89ccf 100644 --- a/plugins/spine4.1/dist/SpineWebGLPlugin.js +++ b/plugins/spine4.1/dist/SpineWebGLPlugin.js @@ -1,10273 +1,352 @@ -window["SpinePlugin"] = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 70); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports) { +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ 4399: +/***/ ((module) => { + +"use strict"; + + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private */ +function Events() {} -// Taken from klasse by mattdesl https://github.com/mattdesl/klasse +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); -function hasGetterOrSetter (def) -{ - return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function'); -} - -function getProperty (definition, k, isClassDescriptor) -{ - // This may be a lightweight object, OR it might be a property that was defined previously. - - // For simple class descriptors we can just assume its NOT previously defined. - var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k); - - if (!isClassDescriptor && def.value && typeof def.value === 'object') - { - def = def.value; - } - - // This might be a regular property, or it may be a getter/setter the user defined in a class. - if (def && hasGetterOrSetter(def)) - { - if (typeof def.enumerable === 'undefined') - { - def.enumerable = true; - } - - if (typeof def.configurable === 'undefined') - { - def.configurable = true; - } - - return def; - } - else - { - return false; - } -} - -function hasNonConfigurable (obj, k) -{ - var prop = Object.getOwnPropertyDescriptor(obj, k); - - if (!prop) - { - return false; - } - - if (prop.value && typeof prop.value === 'object') - { - prop = prop.value; - } - - if (prop.configurable === false) - { - return true; - } - - return false; + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; } /** - * Extends the given `myClass` object's prototype with the properties of `definition`. + * Representation of a single event listener. * - * @function extend - * @ignore - * @param {Object} ctor The constructor object to mix into. - * @param {Object} definition A dictionary of functions for the class. - * @param {boolean} isClassDescriptor Is the definition a class descriptor? - * @param {Object} [extend] The parent constructor object. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private */ -function extend (ctor, definition, isClassDescriptor, extend) -{ - for (var k in definition) - { - if (!definition.hasOwnProperty(k)) - { - continue; - } - - var def = getProperty(definition, k, isClassDescriptor); - - if (def !== false) - { - // If Extends is used, we will check its prototype to see if the final variable exists. - - var parent = extend || ctor; - - if (hasNonConfigurable(parent.prototype, k)) - { - // Just skip the final property - if (Class.ignoreFinals) - { - continue; - } - - // We cannot re-define a property that is configurable=false. - // So we will consider them final and throw an error. This is by - // default so it is clear to the developer what is happening. - // You can set ignoreFinals to true if you need to extend a class - // which has configurable=false; it will simply not re-define final properties. - throw new Error('cannot override final property \'' + k + '\', set Class.ignoreFinals = true to skip'); - } - - Object.defineProperty(ctor.prototype, k, def); - } - else - { - ctor.prototype[k] = definition[k]; - } - } +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; } /** - * Applies the given `mixins` to the prototype of `myClass`. + * Add a listener for a given event. * - * @function mixin - * @ignore - * @param {Object} myClass The constructor object to mix into. - * @param {Object|Array} mixins The mixins to apply to the constructor. + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private */ -function mixin (myClass, mixins) -{ - if (!mixins) - { - return; - } +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } - if (!Array.isArray(mixins)) - { - mixins = [ mixins ]; - } + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; - for (var i = 0; i < mixins.length; i++) - { - extend(myClass, mixins[i].prototype || mixins[i]); - } + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; } /** - * Creates a new class with the given descriptor. - * The constructor, defined by the name `initialize`, - * is an optional function. If unspecified, an anonymous - * function will be used which calls the parent class (if - * one exists). + * Clear event by name. * - * You can also use `Extends` and `Mixins` to provide subclassing - * and inheritance. - * - * @class Phaser.Class - * @constructor - * @param {Object} definition a dictionary of functions for the class - * @example - * - * var MyClass = new Phaser.Class({ - * - * initialize: function() { - * this.foo = 2.0; - * }, - * - * bar: function() { - * return this.foo + 5; - * } - * }); + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private */ -function Class (definition) -{ - if (!definition) - { - definition = {}; - } - - // The variable name here dictates what we see in Chrome debugger - var initialize; - var Extends; - - if (definition.initialize) - { - if (typeof definition.initialize !== 'function') - { - throw new Error('initialize must be a function'); - } - - initialize = definition.initialize; - - // Usually we should avoid 'delete' in V8 at all costs. - // However, its unlikely to make any performance difference - // here since we only call this on class creation (i.e. not object creation). - delete definition.initialize; - } - else if (definition.Extends) - { - var base = definition.Extends; - - initialize = function () - { - base.apply(this, arguments); - }; - } - else - { - initialize = function () {}; - } - - if (definition.Extends) - { - initialize.prototype = Object.create(definition.Extends.prototype); - initialize.prototype.constructor = initialize; - - // For getOwnPropertyDescriptor to work, we need to act directly on the Extends (or Mixin) - - Extends = definition.Extends; - - delete definition.Extends; - } - else - { - initialize.prototype.constructor = initialize; - } - - // Grab the mixins, if they are specified... - var mixins = null; - - if (definition.Mixins) - { - mixins = definition.Mixins; - delete definition.Mixins; - } - - // First, mixin if we can. - mixin(initialize, mixins); - - // Now we grab the actual definition which defines the overrides. - extend(initialize, definition, true, Extends); - - return initialize; +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; } -Class.extend = extend; -Class.mixin = mixin; -Class.ignoreFinals = false; - -module.exports = Class; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports) { - /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Force a value within the boundaries by clamping it to the range `min`, `max`. + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. * - * @function Phaser.Math.Clamp - * @since 3.0.0 - * - * @param {number} value - The value to be clamped. - * @param {number} min - The minimum bounds. - * @param {number} max - The maximum bounds. - * - * @return {number} The clamped value. - */ -var Clamp = function (value, min, max) -{ - return Math.max(min, Math.min(max, value)); -}; - -module.exports = Clamp; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * A NOOP (No Operation) callback function. - * - * Used internally by Phaser when it's more expensive to determine if a callback exists - * than it is to just invoke an empty function. - * - * @function Phaser.Utils.NOOP - * @since 3.0.0 - */ -var NOOP = function () -{ - // NOOP -}; - -module.exports = NOOP; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); -var FuzzyEqual = __webpack_require__(35); - -/** - * @classdesc - * A representation of a vector in 2D space. - * - * A two-component vector. - * - * @class Vector2 - * @memberof Phaser.Math * @constructor - * @since 3.0.0 - * - * @param {number|Phaser.Types.Math.Vector2Like} [x=0] - The x component, or an object with `x` and `y` properties. - * @param {number} [y=x] - The y component. + * @public */ -var Vector2 = new Class({ - - initialize: - - function Vector2 (x, y) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector2#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector2#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - } - else - { - if (y === undefined) { y = x; } - - this.x = x || 0; - this.y = y || 0; - } - }, - - /** - * Make a clone of this Vector2. - * - * @method Phaser.Math.Vector2#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} A clone of this Vector2. - */ - clone: function () - { - return new Vector2(this.x, this.y); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector2#copy - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - copy: function (src) - { - this.x = src.x || 0; - this.y = src.y || 0; - - return this; - }, - - /** - * Set the component values of this Vector from a given Vector2Like object. - * - * @method Phaser.Math.Vector2#setFromObject - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setFromObject: function (obj) - { - this.x = obj.x || 0; - this.y = obj.y || 0; - - return this; - }, - - /** - * Set the `x` and `y` components of the this Vector to the given `x` and `y` values. - * - * @method Phaser.Math.Vector2#set - * @since 3.0.0 - * - * @param {number} x - The x value to set for this Vector. - * @param {number} [y=x] - The y value to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - set: function (x, y) - { - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - }, - - /** - * This method is an alias for `Vector2.set`. - * - * @method Phaser.Math.Vector2#setTo - * @since 3.4.0 - * - * @param {number} x - The x value to set for this Vector. - * @param {number} [y=x] - The y value to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setTo: function (x, y) - { - return this.set(x, y); - }, - - /** - * Sets the `x` and `y` values of this object from a given polar coordinate. - * - * @method Phaser.Math.Vector2#setToPolar - * @since 3.0.0 - * - * @param {number} azimuth - The angular coordinate, in radians. - * @param {number} [radius=1] - The radial coordinate (length). - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setToPolar: function (azimuth, radius) - { - if (radius == null) { radius = 1; } - - this.x = Math.cos(azimuth) * radius; - this.y = Math.sin(azimuth) * radius; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict equality check against each Vector's components. - * - * @method Phaser.Math.Vector2#equals - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. - * - * @return {boolean} Whether the given Vector is equal to this Vector. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y)); - }, - - /** - * Check whether this Vector is approximately equal to a given Vector. - * - * @method Phaser.Math.Vector2#fuzzyEquals - * @since 3.23.0 - * - * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. - * @param {number} [epsilon=0.0001] - The tolerance value. - * - * @return {boolean} Whether both absolute differences of the x and y components are smaller than `epsilon`. - */ - fuzzyEquals: function (v, epsilon) - { - return (FuzzyEqual(this.x, v.x, epsilon) && FuzzyEqual(this.y, v.y, epsilon)); - }, - - /** - * Calculate the angle between this Vector and the positive x-axis, in radians. - * - * @method Phaser.Math.Vector2#angle - * @since 3.0.0 - * - * @return {number} The angle between this Vector, and the positive x-axis, given in radians. - */ - angle: function () - { - // computes the angle in radians with respect to the positive x-axis - - var angle = Math.atan2(this.y, this.x); - - if (angle < 0) - { - angle += 2 * Math.PI; - } - - return angle; - }, - - /** - * Set the angle of this Vector. - * - * @method Phaser.Math.Vector2#setAngle - * @since 3.23.0 - * - * @param {number} angle - The angle, in radians. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setAngle: function (angle) - { - return this.setToPolar(angle, this.length()); - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector2#add - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - add: function (src) - { - this.x += src.x; - this.y += src.y; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector2#subtract - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - subtract: function (src) - { - this.x -= src.x; - this.y -= src.y; - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector2#multiply - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - multiply: function (src) - { - this.x *= src.x; - this.y *= src.y; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector2#scale - * @since 3.0.0 - * - * @param {number} value - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - scale: function (value) - { - if (isFinite(value)) - { - this.x *= value; - this.y *= value; - } - else - { - this.x = 0; - this.y = 0; - } - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector2#divide - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - divide: function (src) - { - this.x /= src.x; - this.y /= src.y; - - return this; - }, - - /** - * Negate the `x` and `y` components of this Vector. - * - * @method Phaser.Math.Vector2#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#distance - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (src) - { - var dx = src.x - this.x; - var dy = src.y - this.y; - - return Math.sqrt(dx * dx + dy * dy); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector2#distanceSq - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (src) - { - var dx = src.x - this.x; - var dy = src.y - this.y; - - return dx * dx + dy * dy; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - - return Math.sqrt(x * x + y * y); - }, - - /** - * Set the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#setLength - * @since 3.23.0 - * - * @param {number} length - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setLength: function (length) - { - return this.normalize().scale(length); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector2#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - - return x * x + y * y; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector2#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var len = x * x + y * y; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - } - - return this; - }, - - /** - * Rotate this Vector to its perpendicular, in the positive direction. - * - * @method Phaser.Math.Vector2#normalizeRightHand - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalizeRightHand: function () - { - var x = this.x; - - this.x = this.y * -1; - this.y = x; - - return this; - }, - - /** - * Rotate this Vector to its perpendicular, in the negative direction. - * - * @method Phaser.Math.Vector2#normalizeLeftHand - * @since 3.23.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalizeLeftHand: function () - { - var x = this.x; - - this.x = this.y; - this.y = x * -1; - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#dot - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to dot product with this Vector2. - * - * @return {number} The dot product of this Vector and the given Vector. - */ - dot: function (src) - { - return this.x * src.x + this.y * src.y; - }, - - /** - * Calculate the cross product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#cross - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to cross with this Vector2. - * - * @return {number} The cross product of this Vector and the given Vector. - */ - cross: function (src) - { - return this.x * src.y - this.y * src.x; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector2#lerp - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - lerp: function (src, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - - this.x = ax + t * (src.x - ax); - this.y = ay + t * (src.y - ay); - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector2#transformMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - transformMat3: function (mat) - { - var x = this.x; - var y = this.y; - var m = mat.val; - - this.x = m[0] * x + m[3] * y + m[6]; - this.y = m[1] * x + m[4] * y + m[7]; - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector2#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[12]; - this.y = m[1] * x + m[5] * y + m[13]; - - return this; - }, - - /** - * Make this Vector the zero vector (0, 0). - * - * @method Phaser.Math.Vector2#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - reset: function () - { - this.x = 0; - this.y = 0; - - return this; - }, - - /** - * Limit the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#limit - * @since 3.23.0 - * - * @param {number} max - The maximum length. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - limit: function (max) - { - var len = this.length(); - - if (len && len > max) - { - this.scale(max / len); - } - - return this; - }, - - /** - * Reflect this Vector off a line defined by a normal. - * - * @method Phaser.Math.Vector2#reflect - * @since 3.23.0 - * - * @param {Phaser.Math.Vector2} normal - A vector perpendicular to the line. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - reflect: function (normal) - { - normal = normal.clone().normalize(); - - return this.subtract(normal.scale(2 * this.dot(normal))); - }, - - /** - * Reflect this Vector across another. - * - * @method Phaser.Math.Vector2#mirror - * @since 3.23.0 - * - * @param {Phaser.Math.Vector2} axis - A vector to reflect across. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - mirror: function (axis) - { - return this.reflect(axis).negate(); - }, - - /** - * Rotate this Vector by an angle amount. - * - * @method Phaser.Math.Vector2#rotate - * @since 3.23.0 - * - * @param {number} delta - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - rotate: function (delta) - { - var cos = Math.cos(delta); - var sin = Math.sin(delta); - - return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); - }, - - /** - * Project this Vector onto another. - * - * @method Phaser.Math.Vector2#project - * @since 3.60.0 - * - * @param {Phaser.Math.Vector2} src - The vector to project onto. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - project: function (src) - { - var scalar = this.dot(src) / src.dot(src); - - return this.copy(src).scale(scalar); - } - -}); - -/** - * A static zero Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.ZERO - * @type {Phaser.Math.Vector2} - * @since 3.1.0 - */ -Vector2.ZERO = new Vector2(); - -/** - * A static right Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.RIGHT - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.RIGHT = new Vector2(1, 0); - -/** - * A static left Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.LEFT - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.LEFT = new Vector2(-1, 0); - -/** - * A static up Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.UP - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.UP = new Vector2(0, -1); - -/** - * A static down Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.DOWN - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.DOWN = new Vector2(0, 1); - -/** - * A static one Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.ONE - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.ONE = new Vector2(1, 1); - -module.exports = Vector2; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MATH_CONST = { - - /** - * The value of PI * 2. - * - * @name Phaser.Math.PI2 - * @type {number} - * @since 3.0.0 - */ - PI2: Math.PI * 2, - - /** - * The value of PI * 0.5. - * - * @name Phaser.Math.TAU - * @type {number} - * @since 3.0.0 - */ - TAU: Math.PI * 0.5, - - /** - * An epsilon value (1.0e-6) - * - * @name Phaser.Math.EPSILON - * @type {number} - * @since 3.0.0 - */ - EPSILON: 1.0e-6, - - /** - * For converting degrees to radians (PI / 180) - * - * @name Phaser.Math.DEG_TO_RAD - * @type {number} - * @since 3.0.0 - */ - DEG_TO_RAD: Math.PI / 180, - - /** - * For converting radians to degrees (180 / PI) - * - * @name Phaser.Math.RAD_TO_DEG - * @type {number} - * @since 3.0.0 - */ - RAD_TO_DEG: 180 / Math.PI, - - /** - * An instance of the Random Number Generator. - * This is not set until the Game boots. - * - * @name Phaser.Math.RND - * @type {Phaser.Math.RandomDataGenerator} - * @since 3.0.0 - */ - RND: null, - - /** - * The minimum safe integer this browser supports. - * We use a const for backward compatibility with Internet Explorer. - * - * @name Phaser.Math.MIN_SAFE_INTEGER - * @type {number} - * @since 3.21.0 - */ - MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER || -9007199254740991, - - /** - * The maximum safe integer this browser supports. - * We use a const for backward compatibility with Internet Explorer. - * - * @name Phaser.Math.MAX_SAFE_INTEGER - * @type {number} - * @since 3.21.0 - */ - MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER || 9007199254740991 - -}; - -module.exports = MATH_CONST; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Tests if the start and end indexes are a safe range for the given array. - * - * @function Phaser.Utils.Array.SafeRange - * @since 3.4.0 - * - * @param {array} array - The array to check. - * @param {number} startIndex - The start index. - * @param {number} endIndex - The end index. - * @param {boolean} [throwError=true] - Throw an error if the range is out of bounds. - * - * @return {boolean} True if the range is safe, otherwise false. - */ -var SafeRange = function (array, startIndex, endIndex, throwError) -{ - var len = array.length; - - if (startIndex < 0 || - startIndex > len || - startIndex >= endIndex || - endIndex > len) - { - if (throwError) - { - throw new Error('Range Error: Values outside acceptable range'); - } - - return false; - } - else - { - return true; - } -}; - -module.exports = SafeRange; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * This is a slightly modified version of jQuery.isPlainObject. - * A plain object is an object whose internal class property is [object Object]. - * - * @function Phaser.Utils.Objects.IsPlainObject - * @since 3.0.0 - * - * @param {object} obj - The object to inspect. - * - * @return {boolean} `true` if the object is plain, otherwise `false`. - */ -var IsPlainObject = function (obj) -{ - // Not plain objects: - // - Any object or value whose internal [[Class]] property is not "[object Object]" - // - DOM nodes - // - window - if (!obj || typeof(obj) !== 'object' || obj.nodeType || obj === obj.window) - { - return false; - } - - // Support: Firefox <20 - // The try/catch suppresses exceptions thrown when attempting to access - // the "constructor" property of certain host objects, ie. |window.location| - // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 - try - { - if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf')) - { - return false; - } - } - catch (e) - { - return false; - } - - // If the function hasn't returned already, we're confident that - // |obj| is a plain object, created by {} or constructed with new Object - return true; -}; - -module.exports = IsPlainObject; - - -/***/ }), -/* 7 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Wrap the given `value` between `min` and `max`. - * - * @function Phaser.Math.Wrap - * @since 3.0.0 - * - * @param {number} value - The value to wrap. - * @param {number} min - The minimum value. - * @param {number} max - The maximum value. - * - * @return {number} The wrapped value. - */ -var Wrap = function (value, min, max) -{ - var range = max - min; - - return (min + ((((value - min) % range) + range) % range)); -}; - -module.exports = Wrap; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Retrieves a value from an object, or an alternative object, falling to a back-up default value if not found. - * - * The key is a string, which can be split based on the use of the period character. - * - * For example: - * - * ```javascript - * const source = { - * lives: 3, - * render: { - * screen: { - * width: 1024 - * } - * } - * } - * - * const lives = GetValue(source, 'lives', 1); - * const width = GetValue(source, 'render.screen.width', 800); - * const height = GetValue(source, 'render.screen.height', 600); - * ``` - * - * In the code above, `lives` will be 3 because it's defined at the top level of `source`. - * The `width` value will be 1024 because it can be found inside the `render.screen` object. - * The `height` value will be 600, the default value, because it is missing from the `render.screen` object. - * - * @function Phaser.Utils.Objects.GetValue - * @since 3.0.0 - * - * @param {object} source - The primary object to try to retrieve the value from. If not found in here, `altSource` is checked. - * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. - * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. - * @param {object} [altSource] - An alternative object to retrieve the value from. If the property exists in `source` then `altSource` will not be used. - * - * @return {*} The value of the requested key. - */ -var GetValue = function (source, key, defaultValue, altSource) -{ - if ((!source && !altSource) || typeof source === 'number') - { - return defaultValue; - } - else if (source && source.hasOwnProperty(key)) - { - return source[key]; - } - else if (altSource && altSource.hasOwnProperty(key)) - { - return altSource[key]; - } - else if (key.indexOf('.') !== -1) - { - var keys = key.split('.'); - var parentA = source; - var parentB = altSource; - var valueA = defaultValue; - var valueB = defaultValue; - var valueAFound = true; - var valueBFound = true; - - // Use for loop here so we can break early - for (var i = 0; i < keys.length; i++) - { - if (parentA && parentA.hasOwnProperty(keys[i])) - { - // Yes parentA has a key property, let's carry on down - valueA = parentA[keys[i]]; - parentA = parentA[keys[i]]; - } - else - { - valueAFound = false; - } - - if (parentB && parentB.hasOwnProperty(keys[i])) - { - // Yes parentB has a key property, let's carry on down - valueB = parentB[keys[i]]; - parentB = parentB[keys[i]]; - } - else - { - valueBFound = false; - } - } - - if (valueAFound) - { - return valueA; - } - else if (valueBFound) - { - return valueB; - } - else - { - return defaultValue; - } - } - else - { - return defaultValue; - } -}; - -module.exports = GetValue; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue} - * - * @function Phaser.Utils.Objects.GetFastValue - * @since 3.0.0 - * - * @param {object} source - The object to search - * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods) - * @param {*} [defaultValue] - The default value to use if the key does not exist. - * - * @return {*} The value if found; otherwise, defaultValue (null if none provided) - */ -var GetFastValue = function (source, key, defaultValue) -{ - var t = typeof(source); - - if (!source || t === 'number' || t === 'string') - { - return defaultValue; - } - else if (source.hasOwnProperty(key) && source[key] !== undefined) - { - return source[key]; - } - else - { - return defaultValue; - } -}; - -module.exports = GetFastValue; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var FILE_CONST = { - - /** - * The Loader is idle. - * - * @name Phaser.Loader.LOADER_IDLE - * @type {number} - * @since 3.0.0 - */ - LOADER_IDLE: 0, - - /** - * The Loader is actively loading. - * - * @name Phaser.Loader.LOADER_LOADING - * @type {number} - * @since 3.0.0 - */ - LOADER_LOADING: 1, - - /** - * The Loader is processing files is has loaded. - * - * @name Phaser.Loader.LOADER_PROCESSING - * @type {number} - * @since 3.0.0 - */ - LOADER_PROCESSING: 2, - - /** - * The Loader has completed loading and processing. - * - * @name Phaser.Loader.LOADER_COMPLETE - * @type {number} - * @since 3.0.0 - */ - LOADER_COMPLETE: 3, - - /** - * The Loader is shutting down. - * - * @name Phaser.Loader.LOADER_SHUTDOWN - * @type {number} - * @since 3.0.0 - */ - LOADER_SHUTDOWN: 4, - - /** - * The Loader has been destroyed. - * - * @name Phaser.Loader.LOADER_DESTROYED - * @type {number} - * @since 3.0.0 - */ - LOADER_DESTROYED: 5, - - /** - * File is in the load queue but not yet started. - * - * @name Phaser.Loader.FILE_PENDING - * @type {number} - * @since 3.0.0 - */ - FILE_PENDING: 10, - - /** - * File has been started to load by the loader (onLoad called) - * - * @name Phaser.Loader.FILE_LOADING - * @type {number} - * @since 3.0.0 - */ - FILE_LOADING: 11, - - /** - * File has loaded successfully, awaiting processing. - * - * @name Phaser.Loader.FILE_LOADED - * @type {number} - * @since 3.0.0 - */ - FILE_LOADED: 12, - - /** - * File failed to load. - * - * @name Phaser.Loader.FILE_FAILED - * @type {number} - * @since 3.0.0 - */ - FILE_FAILED: 13, - - /** - * File is being processed (onProcess callback) - * - * @name Phaser.Loader.FILE_PROCESSING - * @type {number} - * @since 3.0.0 - */ - FILE_PROCESSING: 14, - - /** - * The File has errored somehow during processing. - * - * @name Phaser.Loader.FILE_ERRORED - * @type {number} - * @since 3.0.0 - */ - FILE_ERRORED: 16, - - /** - * File has finished processing. - * - * @name Phaser.Loader.FILE_COMPLETE - * @type {number} - * @since 3.0.0 - */ - FILE_COMPLETE: 17, - - /** - * File has been destroyed. - * - * @name Phaser.Loader.FILE_DESTROYED - * @type {number} - * @since 3.0.0 - */ - FILE_DESTROYED: 18, - - /** - * File was populated from local data and doesn't need an HTTP request. - * - * @name Phaser.Loader.FILE_POPULATED - * @type {number} - * @since 3.0.0 - */ - FILE_POPULATED: 19, - - /** - * File is pending being destroyed. - * - * @name Phaser.Loader.FILE_PENDING_DESTROY - * @type {number} - * @since 3.60.0 - */ - FILE_PENDING_DESTROY: 20 - -}; - -module.exports = FILE_CONST; - - -/***/ }), -/* 11 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Removes a single item from an array and returns it without creating gc, like the native splice does. - * Based on code by Mike Reinstein. - * - * @function Phaser.Utils.Array.SpliceOne - * @since 3.0.0 - * - * @param {array} array - The array to splice from. - * @param {number} index - The index of the item which should be spliced. - * - * @return {*} The item which was spliced (removed). - */ -var SpliceOne = function (array, index) -{ - if (index >= array.length) - { - return; - } - - var len = array.length - 1; - - var item = array[index]; - - for (var i = index; i < len; i++) - { - array[i] = array[i + 1]; - } - - array.length = len; - - return item; -}; - -module.exports = SpliceOne; - - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var GEOM_CONST = __webpack_require__(30); - -/** - * @classdesc - * Defines a Point in 2D space, with an x and y component. - * - * @class Point - * @memberof Phaser.Geom - * @constructor - * @since 3.0.0 - * - * @param {number} [x=0] - The x coordinate of this Point. - * @param {number} [y=x] - The y coordinate of this Point. - */ -var Point = new Class({ - - initialize: - - function Point (x, y) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = x; } - - /** - * The geometry constant type of this object: `GEOM_CONST.POINT`. - * Used for fast type comparisons. - * - * @name Phaser.Geom.Point#type - * @type {number} - * @readonly - * @since 3.19.0 - */ - this.type = GEOM_CONST.POINT; - - /** - * The x coordinate of this Point. - * - * @name Phaser.Geom.Point#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = x; - - /** - * The y coordinate of this Point. - * - * @name Phaser.Geom.Point#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = y; - }, - - /** - * Set the x and y coordinates of the point to the given values. - * - * @method Phaser.Geom.Point#setTo - * @since 3.0.0 - * - * @param {number} [x=0] - The x coordinate of this Point. - * @param {number} [y=x] - The y coordinate of this Point. - * - * @return {this} This Point object. - */ - setTo: function (x, y) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - } - -}); - -module.exports = Point; - - -/***/ }), -/* 13 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Phaser Blend Modes. - * - * @namespace Phaser.BlendModes - * @since 3.0.0 - */ - -module.exports = { - - /** - * Skips the Blend Mode check in the renderer. - * - * @name Phaser.BlendModes.SKIP_CHECK - * @type {number} - * @const - * @since 3.0.0 - */ - SKIP_CHECK: -1, - - /** - * Normal blend mode. For Canvas and WebGL. - * This is the default setting and draws new shapes on top of the existing canvas content. - * - * @name Phaser.BlendModes.NORMAL - * @type {number} - * @const - * @since 3.0.0 - */ - NORMAL: 0, - - /** - * Add blend mode. For Canvas and WebGL. - * Where both shapes overlap the color is determined by adding color values. - * - * @name Phaser.BlendModes.ADD - * @type {number} - * @const - * @since 3.0.0 - */ - ADD: 1, - - /** - * Multiply blend mode. For Canvas and WebGL. - * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. - * - * @name Phaser.BlendModes.MULTIPLY - * @type {number} - * @const - * @since 3.0.0 - */ - MULTIPLY: 2, - - /** - * Screen blend mode. For Canvas and WebGL. - * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) - * - * @name Phaser.BlendModes.SCREEN - * @type {number} - * @const - * @since 3.0.0 - */ - SCREEN: 3, - - /** - * Overlay blend mode. For Canvas only. - * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. - * - * @name Phaser.BlendModes.OVERLAY - * @type {number} - * @const - * @since 3.0.0 - */ - OVERLAY: 4, - - /** - * Darken blend mode. For Canvas only. - * Retains the darkest pixels of both layers. - * - * @name Phaser.BlendModes.DARKEN - * @type {number} - * @const - * @since 3.0.0 - */ - DARKEN: 5, - - /** - * Lighten blend mode. For Canvas only. - * Retains the lightest pixels of both layers. - * - * @name Phaser.BlendModes.LIGHTEN - * @type {number} - * @const - * @since 3.0.0 - */ - LIGHTEN: 6, - - /** - * Color Dodge blend mode. For Canvas only. - * Divides the bottom layer by the inverted top layer. - * - * @name Phaser.BlendModes.COLOR_DODGE - * @type {number} - * @const - * @since 3.0.0 - */ - COLOR_DODGE: 7, - - /** - * Color Burn blend mode. For Canvas only. - * Divides the inverted bottom layer by the top layer, and then inverts the result. - * - * @name Phaser.BlendModes.COLOR_BURN - * @type {number} - * @const - * @since 3.0.0 - */ - COLOR_BURN: 8, - - /** - * Hard Light blend mode. For Canvas only. - * A combination of multiply and screen like overlay, but with top and bottom layer swapped. - * - * @name Phaser.BlendModes.HARD_LIGHT - * @type {number} - * @const - * @since 3.0.0 - */ - HARD_LIGHT: 9, - - /** - * Soft Light blend mode. For Canvas only. - * A softer version of hard-light. Pure black or white does not result in pure black or white. - * - * @name Phaser.BlendModes.SOFT_LIGHT - * @type {number} - * @const - * @since 3.0.0 - */ - SOFT_LIGHT: 10, - - /** - * Difference blend mode. For Canvas only. - * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. - * - * @name Phaser.BlendModes.DIFFERENCE - * @type {number} - * @const - * @since 3.0.0 - */ - DIFFERENCE: 11, - - /** - * Exclusion blend mode. For Canvas only. - * Like difference, but with lower contrast. - * - * @name Phaser.BlendModes.EXCLUSION - * @type {number} - * @const - * @since 3.0.0 - */ - EXCLUSION: 12, - - /** - * Hue blend mode. For Canvas only. - * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. - * - * @name Phaser.BlendModes.HUE - * @type {number} - * @const - * @since 3.0.0 - */ - HUE: 13, - - /** - * Saturation blend mode. For Canvas only. - * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. - * - * @name Phaser.BlendModes.SATURATION - * @type {number} - * @const - * @since 3.0.0 - */ - SATURATION: 14, - - /** - * Color blend mode. For Canvas only. - * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. - * - * @name Phaser.BlendModes.COLOR - * @type {number} - * @const - * @since 3.0.0 - */ - COLOR: 15, - - /** - * Luminosity blend mode. For Canvas only. - * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. - * - * @name Phaser.BlendModes.LUMINOSITY - * @type {number} - * @const - * @since 3.0.0 - */ - LUMINOSITY: 16, - - /** - * Alpha erase blend mode. For Canvas and WebGL. - * - * @name Phaser.BlendModes.ERASE - * @type {number} - * @const - * @since 3.0.0 - */ - ERASE: 17, - - /** - * Source-in blend mode. For Canvas only. - * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. - * - * @name Phaser.BlendModes.SOURCE_IN - * @type {number} - * @const - * @since 3.0.0 - */ - SOURCE_IN: 18, - - /** - * Source-out blend mode. For Canvas only. - * The new shape is drawn where it doesn't overlap the existing canvas content. - * - * @name Phaser.BlendModes.SOURCE_OUT - * @type {number} - * @const - * @since 3.0.0 - */ - SOURCE_OUT: 19, - - /** - * Source-out blend mode. For Canvas only. - * The new shape is only drawn where it overlaps the existing canvas content. - * - * @name Phaser.BlendModes.SOURCE_ATOP - * @type {number} - * @const - * @since 3.0.0 - */ - SOURCE_ATOP: 20, - - /** - * Destination-over blend mode. For Canvas only. - * New shapes are drawn behind the existing canvas content. - * - * @name Phaser.BlendModes.DESTINATION_OVER - * @type {number} - * @const - * @since 3.0.0 - */ - DESTINATION_OVER: 21, - - /** - * Destination-in blend mode. For Canvas only. - * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. - * - * @name Phaser.BlendModes.DESTINATION_IN - * @type {number} - * @const - * @since 3.0.0 - */ - DESTINATION_IN: 22, - - /** - * Destination-out blend mode. For Canvas only. - * The existing content is kept where it doesn't overlap the new shape. - * - * @name Phaser.BlendModes.DESTINATION_OUT - * @type {number} - * @const - * @since 3.0.0 - */ - DESTINATION_OUT: 23, - - /** - * Destination-out blend mode. For Canvas only. - * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. - * - * @name Phaser.BlendModes.DESTINATION_ATOP - * @type {number} - * @const - * @since 3.0.0 - */ - DESTINATION_ATOP: 24, - - /** - * Lighten blend mode. For Canvas only. - * Where both shapes overlap the color is determined by adding color values. - * - * @name Phaser.BlendModes.LIGHTER - * @type {number} - * @const - * @since 3.0.0 - */ - LIGHTER: 25, - - /** - * Copy blend mode. For Canvas only. - * Only the new shape is shown. - * - * @name Phaser.BlendModes.COPY - * @type {number} - * @const - * @since 3.0.0 - */ - COPY: 26, - - /** - * Xor blend mode. For Canvas only. - * Shapes are made transparent where both overlap and drawn normal everywhere else. - * - * @name Phaser.BlendModes.XOR - * @type {number} - * @const - * @since 3.0.0 - */ - XOR: 27 - -}; - - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(4); - -/** - * Takes an angle in Phasers default clockwise format and converts it so that - * 0 is North, 90 is West, 180 is South and 270 is East, - * therefore running counter-clockwise instead of clockwise. - * - * You can pass in the angle from a Game Object using: - * - * ```javascript - * var converted = CounterClockwise(gameobject.rotation); - * ``` - * - * All values for this function are in radians. - * - * @function Phaser.Math.Angle.CounterClockwise - * @since 3.16.0 - * - * @param {number} angle - The angle to convert, in radians. - * - * @return {number} The converted angle, in radians. - */ -var CounterClockwise = function (angle) -{ - if (angle > Math.PI) - { - angle -= CONST.PI2; - } - - return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); -}; - -module.exports = CounterClockwise; - - -/***/ }), -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A representation of a vector in 3D space. - * - * A three-component vector. - * - * @class Vector3 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - */ -var Vector3 = new Class({ - - initialize: - - function Vector3 (x, y, z) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector3#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector3#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - /** - * The z component of this Vector. - * - * @name Phaser.Math.Vector3#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.z = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - } - }, - - /** - * Set this Vector to point up. - * - * Sets the y component of the vector to 1, and the others to 0. - * - * @method Phaser.Math.Vector3#up - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - up: function () - { - this.x = 0; - this.y = 1; - this.z = 0; - - return this; - }, - - /** - * Sets the components of this Vector to be the `Math.min` result from the given vector. - * - * @method Phaser.Math.Vector3#min - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to check the minimum values against. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - min: function (v) - { - this.x = Math.min(this.x, v.x); - this.y = Math.min(this.y, v.y); - this.z = Math.min(this.z, v.z); - - return this; - }, - - /** - * Sets the components of this Vector to be the `Math.max` result from the given vector. - * - * @method Phaser.Math.Vector3#max - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to check the maximum values against. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - max: function (v) - { - this.x = Math.max(this.x, v.x); - this.y = Math.max(this.y, v.y); - this.z = Math.max(this.z, v.z); - - return this; - }, - - /** - * Make a clone of this Vector3. - * - * @method Phaser.Math.Vector3#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. - */ - clone: function () - { - return new Vector3(this.x, this.y, this.z); - }, - - /** - * Adds the two given Vector3s and sets the results into this Vector3. - * - * @method Phaser.Math.Vector3#addVectors - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} a - The first Vector to add. - * @param {Phaser.Math.Vector3} b - The second Vector to add. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - addVectors: function (a, b) - { - this.x = a.x + b.x; - this.y = a.y + b.y; - this.z = a.z + b.z; - - return this; - }, - - /** - * Calculate the cross (vector) product of two given Vectors. - * - * @method Phaser.Math.Vector3#crossVectors - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} a - The first Vector to multiply. - * @param {Phaser.Math.Vector3} b - The second Vector to multiply. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - crossVectors: function (a, b) - { - var ax = a.x; - var ay = a.y; - var az = a.z; - var bx = b.x; - var by = b.y; - var bz = b.z; - - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict equality check against each Vector's components. - * - * @method Phaser.Math.Vector3#equals - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. - * - * @return {boolean} True if the two vectors strictly match, otherwise false. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector3#copy - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - copy: function (src) - { - this.x = src.x; - this.y = src.y; - this.z = src.z || 0; - - return this; - }, - - /** - * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. - * - * @method Phaser.Math.Vector3#set - * @since 3.0.0 - * - * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. - * @param {number} [y] - The y value to set for this Vector. - * @param {number} [z] - The z value to set for this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - set: function (x, y, z) - { - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - } - - return this; - }, - - /** - * Sets the components of this Vector3 from the position of the given Matrix4. - * - * @method Phaser.Math.Vector3#setFromMatrixPosition - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the position from. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - setFromMatrixPosition: function (m) - { - return this.fromArray(m.val, 12); - }, - - /** - * Sets the components of this Vector3 from the Matrix4 column specified. - * - * @method Phaser.Math.Vector3#setFromMatrixColumn - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the column from. - * @param {number} index - The column index. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - setFromMatrixColumn: function (mat4, index) - { - return this.fromArray(mat4.val, index * 4); - }, - - /** - * Sets the components of this Vector3 from the given array, based on the offset. - * - * Vector3.x = array[offset] - * Vector3.y = array[offset + 1] - * Vector3.z = array[offset + 2] - * - * @method Phaser.Math.Vector3#fromArray - * @since 3.50.0 - * - * @param {number[]} array - The array of values to get this Vector from. - * @param {number} [offset=0] - The offset index into the array. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - fromArray: function (array, offset) - { - if (offset === undefined) { offset = 0; } - - this.x = array[offset]; - this.y = array[offset + 1]; - this.z = array[offset + 2]; - - return this; - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector3#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - add: function (v) - { - this.x += v.x; - this.y += v.y; - this.z += v.z || 0; - - return this; - }, - - /** - * Add the given value to each component of this Vector. - * - * @method Phaser.Math.Vector3#addScalar - * @since 3.50.0 - * - * @param {number} s - The amount to add to this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - addScalar: function (s) - { - this.x += s; - this.y += s; - this.z += s; - - return this; - }, - - /** - * Add and scale a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector3#addScale - * @since 3.50.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. - * @param {number} scale - The amount to scale `v` by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - addScale: function (v, scale) - { - this.x += v.x * scale; - this.y += v.y * scale; - this.z += v.z * scale || 0; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector3#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - subtract: function (v) - { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z || 0; - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - multiply: function (v) - { - this.x *= v.x; - this.y *= v.y; - this.z *= v.z || 1; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector3#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - scale: function (scale) - { - if (isFinite(scale)) - { - this.x *= scale; - this.y *= scale; - this.z *= scale; - } - else - { - this.x = 0; - this.y = 0; - this.z = 0; - } - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#divide - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - divide: function (v) - { - this.x /= v.x; - this.y /= v.y; - this.z /= v.z || 1; - - return this; - }, - - /** - * Negate the `x`, `y` and `z` components of this Vector. - * - * @method Phaser.Math.Vector3#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector3#distance - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - - return Math.sqrt(dx * dx + dy * dy + dz * dz); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector3#distanceSq - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - - return dx * dx + dy * dy + dz * dz; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector3#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return Math.sqrt(x * x + y * y + z * z); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector3#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return x * x + y * y + z * z; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector3#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var len = x * x + y * y + z * z; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - this.z = z * len; - } - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector3#dot - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. - * - * @return {number} The dot product of this Vector and `v`. - */ - dot: function (v) - { - return this.x * v.x + this.y * v.y + this.z * v.z; - }, - - /** - * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. - * - * @method Phaser.Math.Vector3#cross - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector to cross product with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - cross: function (v) - { - var ax = this.x; - var ay = this.y; - var az = this.z; - var bx = v.x; - var by = v.y; - var bz = v.z; - - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - - return this; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector3#lerp - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - lerp: function (v, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - var az = this.z; - - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - - return this; - }, - - /** - * Takes a Matrix3 and applies it to this Vector3. - * - * @method Phaser.Math.Vector3#applyMatrix3 - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix3} mat3 - The Matrix3 to apply to this Vector3. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - applyMatrix3: function (mat3) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat3.val; - - this.x = m[0] * x + m[3] * y + m[6] * z; - this.y = m[1] * x + m[4] * y + m[7] * z; - this.z = m[2] * x + m[5] * y + m[8] * z; - - return this; - }, - - /** - * Takes a Matrix4 and applies it to this Vector3. - * - * @method Phaser.Math.Vector3#applyMatrix4 - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to apply to this Vector3. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - applyMatrix4: function (mat4) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat4.val; - - var w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]); - - this.x = (m[0] * x + m[4] * y + m[8] * z + m[12]) * w; - this.y = (m[1] * x + m[5] * y + m[9] * z + m[13]) * w; - this.z = (m[2] * x + m[6] * y + m[10] * z + m[14]) * w; - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector3#transformMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat3: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = x * m[0] + y * m[3] + z * m[6]; - this.y = x * m[1] + y * m[4] + z * m[7]; - this.z = x * m[2] + y * m[5] + z * m[8]; - - return this; - }, - - /** - * Transform this Vector with the given Matrix4. - * - * @method Phaser.Math.Vector3#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; - this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; - this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; - - return this; - }, - - /** - * Transforms the coordinates of this Vector3 with the given Matrix4. - * - * @method Phaser.Math.Vector3#transformCoordinates - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformCoordinates: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; - var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; - var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; - var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; - - this.x = tx / tw; - this.y = ty / tw; - this.z = tz / tw; - - return this; - }, - - /** - * Transform this Vector with the given Quaternion. - * - * @method Phaser.Math.Vector3#transformQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformQuat: function (q) - { - // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations - var x = this.x; - var y = this.y; - var z = this.z; - var qx = q.x; - var qy = q.y; - var qz = q.z; - var qw = q.w; - - // calculate quat * vec - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = -qx * x - qy * y - qz * z; - - // calculate result * inverse quat - this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; - this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; - this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; - - return this; - }, - - /** - * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, - * e.g. unprojecting a 2D point into 3D space. - * - * @method Phaser.Math.Vector3#project - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - project: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var a00 = m[0]; - var a01 = m[1]; - var a02 = m[2]; - var a03 = m[3]; - var a10 = m[4]; - var a11 = m[5]; - var a12 = m[6]; - var a13 = m[7]; - var a20 = m[8]; - var a21 = m[9]; - var a22 = m[10]; - var a23 = m[11]; - var a30 = m[12]; - var a31 = m[13]; - var a32 = m[14]; - var a33 = m[15]; - - var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); - - this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; - this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; - this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; - - return this; - }, - - /** - * Multiplies this Vector3 by the given view and projection matrices. - * - * @method Phaser.Math.Vector3#projectViewMatrix - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} viewMatrix - A View Matrix. - * @param {Phaser.Math.Matrix4} projectionMatrix - A Projection Matrix. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - projectViewMatrix: function (viewMatrix, projectionMatrix) - { - return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix); - }, - - /** - * Multiplies this Vector3 by the given inversed projection matrix and world matrix. - * - * @method Phaser.Math.Vector3#unprojectViewMatrix - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} projectionMatrix - An inversed Projection Matrix. - * @param {Phaser.Math.Matrix4} worldMatrix - A World View Matrix. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - unprojectViewMatrix: function (projectionMatrix, worldMatrix) - { - return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix); - }, - - /** - * Unproject this point from 2D space to 3D space. - * The point should have its x and y properties set to - * 2D screen space, and the z either at 0 (near plane) - * or 1 (far plane). The provided matrix is assumed to already - * be combined, i.e. projection * view * model. - * - * After this operation, this vector's (x, y, z) components will - * represent the unprojected 3D coordinate. - * - * @method Phaser.Math.Vector3#unproject - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. - * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - unproject: function (viewport, invProjectionView) - { - var viewX = viewport.x; - var viewY = viewport.y; - var viewWidth = viewport.z; - var viewHeight = viewport.w; - - var x = this.x - viewX; - var y = (viewHeight - this.y - 1) - viewY; - var z = this.z; - - this.x = (2 * x) / viewWidth - 1; - this.y = (2 * y) / viewHeight - 1; - this.z = 2 * z - 1; - - return this.project(invProjectionView); - }, - - /** - * Make this Vector the zero vector (0, 0, 0). - * - * @method Phaser.Math.Vector3#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - reset: function () - { - this.x = 0; - this.y = 0; - this.z = 0; - - return this; - } - -}); - -/** - * A static zero Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ZERO - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.ZERO = new Vector3(); - -/** - * A static right Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.RIGHT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.RIGHT = new Vector3(1, 0, 0); - -/** - * A static left Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.LEFT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.LEFT = new Vector3(-1, 0, 0); - -/** - * A static up Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.UP - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.UP = new Vector3(0, -1, 0); - -/** - * A static down Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.DOWN - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.DOWN = new Vector3(0, 1, 0); - -/** - * A static forward Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.FORWARD - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.FORWARD = new Vector3(0, 0, 1); - -/** - * A static back Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.BACK - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.BACK = new Vector3(0, 0, -1); - -/** - * A static one Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ONE - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.ONE = new Vector3(1, 1, 1); - -module.exports = Vector3; - - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(4); - -/** - * Convert the given angle in radians, to the equivalent angle in degrees. - * - * @function Phaser.Math.RadToDeg - * @since 3.0.0 - * - * @param {number} radians - The angle in radians to convert ot degrees. - * - * @return {number} The given angle converted to degrees. - */ -var RadToDeg = function (radians) -{ - return radians * CONST.RAD_TO_DEG; -}; - -module.exports = RadToDeg; - - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CheckMatrix = __webpack_require__(27); -var TransposeMatrix = __webpack_require__(62); - -/** - * Rotates the array matrix based on the given rotation value. - * - * The value can be given in degrees: 90, -90, 270, -270 or 180, - * or a string command: `rotateLeft`, `rotateRight` or `rotate180`. - * - * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.RotateMatrix - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array to rotate. - * @param {(number|string)} [direction=90] - The amount to rotate the matrix by. - * - * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. - */ -var RotateMatrix = function (matrix, direction) -{ - if (direction === undefined) { direction = 90; } - - if (!CheckMatrix(matrix)) - { - return null; - } - - if (typeof direction !== 'string') - { - direction = ((direction % 360) + 360) % 360; - } - - if (direction === 90 || direction === -270 || direction === 'rotateLeft') - { - matrix = TransposeMatrix(matrix); - matrix.reverse(); - } - else if (direction === -90 || direction === 270 || direction === 'rotateRight') - { - matrix.reverse(); - matrix = TransposeMatrix(matrix); - } - else if (Math.abs(direction) === 180 || direction === 'rotate180') - { - for (var i = 0; i < matrix.length; i++) - { - matrix[i].reverse(); - } - - matrix.reverse(); - } - - return matrix; -}; - -module.exports = RotateMatrix; - - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var OS = __webpack_require__(28); - -/** - * Determines the browser type and version running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.browser` from within any Scene. - * - * @typedef {object} Phaser.Device.Browser - * @since 3.0.0 - * - * @property {boolean} chrome - Set to true if running in Chrome. - * @property {boolean} edge - Set to true if running in Microsoft Edge browser. - * @property {boolean} firefox - Set to true if running in Firefox. - * @property {boolean} ie - Set to true if running in Internet Explorer 11 or less (not Edge). - * @property {boolean} mobileSafari - Set to true if running in Mobile Safari. - * @property {boolean} opera - Set to true if running in Opera. - * @property {boolean} safari - Set to true if running in Safari. - * @property {boolean} silk - Set to true if running in the Silk browser (as used on the Amazon Kindle) - * @property {boolean} trident - Set to true if running a Trident version of Internet Explorer (IE11+) - * @property {number} chromeVersion - If running in Chrome this will contain the major version number. - * @property {number} firefoxVersion - If running in Firefox this will contain the major version number. - * @property {number} ieVersion - If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Browser.trident and Browser.tridentVersion. - * @property {number} safariVersion - If running in Safari this will contain the major version number. - * @property {number} tridentVersion - If running in Internet Explorer 11 this will contain the major version number. See {@link http://msdn.microsoft.com/en-us/library/ie/ms537503(v=vs.85).aspx} - */ -var Browser = { - - chrome: false, - chromeVersion: 0, - edge: false, - firefox: false, - firefoxVersion: 0, - ie: false, - ieVersion: 0, - mobileSafari: false, - opera: false, - safari: false, - safariVersion: 0, - silk: false, - trident: false, - tridentVersion: 0, - es2019: false - -}; - -function init () -{ - var ua = navigator.userAgent; - - if ((/Edg\/\d+/).test(ua)) - { - Browser.edge = true; - Browser.es2019 = true; - } - else if ((/OPR/).test(ua)) { - Browser.opera = true; - Browser.es2019 = true; - } - else if ((/Chrome\/(\d+)/).test(ua) && !OS.windowsPhone) - { - Browser.chrome = true; - Browser.chromeVersion = parseInt(RegExp.$1, 10); - Browser.es2019 = (Browser.chromeVersion > 69); - } - else if ((/Firefox\D+(\d+)/).test(ua)) - { - Browser.firefox = true; - Browser.firefoxVersion = parseInt(RegExp.$1, 10); - Browser.es2019 = (Browser.firefoxVersion > 10); - } - else if ((/AppleWebKit/).test(ua) && OS.iOS) - { - Browser.mobileSafari = true; - } - else if ((/MSIE (\d+\.\d+);/).test(ua)) - { - Browser.ie = true; - Browser.ieVersion = parseInt(RegExp.$1, 10); - } - else if ((/Version\/(\d+\.\d+) Safari/).test(ua) && !OS.windowsPhone) - { - Browser.safari = true; - Browser.safariVersion = parseInt(RegExp.$1, 10); - Browser.es2019 = (Browser.safariVersion > 10); - } - else if ((/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/).test(ua)) - { - Browser.ie = true; - Browser.trident = true; - Browser.tridentVersion = parseInt(RegExp.$1, 10); - Browser.ieVersion = parseInt(RegExp.$3, 10); - } - - // Silk gets its own if clause because its ua also contains 'Safari' - if ((/Silk/).test(ua)) - { - Browser.silk = true; - } - - return Browser; +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; } -module.exports = init(); - - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var IsPlainObject = __webpack_require__(6); - -// @param {boolean} deep - Perform a deep copy? -// @param {object} target - The target object to copy to. -// @return {object} The extended object. - -/** - * This is a slightly modified version of http://api.jquery.com/jQuery.extend/ + * Return an array listing the events for which the emitter has registered + * listeners. * - * @function Phaser.Utils.Objects.Extend - * @since 3.0.0 - * - * @param {...*} [args] - The objects that will be mixed. - * - * @return {object} The extended object. + * @returns {Array} + * @public */ -var Extend = function () -{ - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; - // Handle a deep copy situation - if (typeof target === 'boolean') - { - deep = target; - target = arguments[1] || {}; + if (this._eventsCount === 0) return names; - // skip the boolean and the target - i = 2; - } + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } - // extend Phaser if only one argument is passed - if (length === i) - { - target = this; - --i; - } + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } - for (; i < length; i++) - { - // Only deal with non-null/undefined values - if ((options = arguments[i]) != null) - { - // Extend the base object - for (name in options) - { - src = target[name]; - copy = options[name]; - - // Prevent never-ending loop - if (target === copy) - { - continue; - } - - // Recurse if we're merging plain objects or arrays - if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) - { - if (copyIsArray) - { - copyIsArray = false; - clone = src && Array.isArray(src) ? src : []; - } - else - { - clone = src && IsPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[name] = Extend(deep, clone, copy); - - // Don't bring in undefined values - } - else if (copy !== undefined) - { - target[name] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -module.exports = Extend; - - -/***/ }), -/* 20 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Generate a random floating point number between the two given bounds, minimum inclusive, maximum exclusive. - * - * @function Phaser.Math.FloatBetween - * @since 3.0.0 - * - * @param {number} min - The lower bound for the float, inclusive. - * @param {number} max - The upper bound for the float exclusive. - * - * @return {number} A random float within the given range. - */ -var FloatBetween = function (min, max) -{ - return Math.random() * (max - min) + min; -}; - -module.exports = FloatBetween; - - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(4); - -/** - * Convert the given angle from degrees, to the equivalent angle in radians. - * - * @function Phaser.Math.DegToRad - * @since 3.0.0 - * - * @param {number} degrees - The angle (in degrees) to convert to radians. - * - * @return {number} The given angle converted to radians. - */ -var DegToRad = function (degrees) -{ - return degrees * CONST.DEG_TO_RAD; -}; - -module.exports = DegToRad; - - -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Vector3 = __webpack_require__(15); - -/** - * @ignore - */ -var EPSILON = 0.000001; - -/** - * @classdesc - * A four-dimensional matrix. - * - * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji - * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - * - * @class Matrix4 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. - */ -var Matrix4 = new Class({ - - initialize: - - function Matrix4 (m) - { - /** - * The matrix values. - * - * @name Phaser.Math.Matrix4#val - * @type {Float32Array} - * @since 3.0.0 - */ - this.val = new Float32Array(16); - - if (m) - { - // Assume Matrix4 with val: - this.copy(m); - } - else - { - // Default to identity - this.identity(); - } - }, - - /** - * Make a clone of this Matrix4. - * - * @method Phaser.Math.Matrix4#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} A clone of this Matrix4. - */ - clone: function () - { - return new Matrix4(this); - }, - - /** - * This method is an alias for `Matrix4.copy`. - * - * @method Phaser.Math.Matrix4#set - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. - * - * @return {this} This Matrix4. - */ - set: function (src) - { - return this.copy(src); - }, - - /** - * Sets all values of this Matrix4. - * - * @method Phaser.Math.Matrix4#setValues - * @since 3.50.0 - * - * @param {number} m00 - The m00 value. - * @param {number} m01 - The m01 value. - * @param {number} m02 - The m02 value. - * @param {number} m03 - The m03 value. - * @param {number} m10 - The m10 value. - * @param {number} m11 - The m11 value. - * @param {number} m12 - The m12 value. - * @param {number} m13 - The m13 value. - * @param {number} m20 - The m20 value. - * @param {number} m21 - The m21 value. - * @param {number} m22 - The m22 value. - * @param {number} m23 - The m23 value. - * @param {number} m30 - The m30 value. - * @param {number} m31 - The m31 value. - * @param {number} m32 - The m32 value. - * @param {number} m33 - The m33 value. - * - * @return {this} This Matrix4 instance. - */ - setValues: function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) - { - var out = this.val; - - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m03; - out[4] = m10; - out[5] = m11; - out[6] = m12; - out[7] = m13; - out[8] = m20; - out[9] = m21; - out[10] = m22; - out[11] = m23; - out[12] = m30; - out[13] = m31; - out[14] = m32; - out[15] = m33; - - return this; - }, - - /** - * Copy the values of a given Matrix into this Matrix. - * - * @method Phaser.Math.Matrix4#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. - * - * @return {this} This Matrix4. - */ - copy: function (src) - { - var a = src.val; - - return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); - }, - - /** - * Set the values of this Matrix from the given array. - * - * @method Phaser.Math.Matrix4#fromArray - * @since 3.0.0 - * - * @param {number[]} a - The array to copy the values from. Must have at least 16 elements. - * - * @return {this} This Matrix4. - */ - fromArray: function (a) - { - return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); - }, - - /** - * Reset this Matrix. - * - * Sets all values to `0`. - * - * @method Phaser.Math.Matrix4#zero - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - zero: function () - { - return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - }, - - /** - * Generates a transform matrix based on the given position, scale and rotation. - * - * @method Phaser.Math.Matrix4#transform - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} position - The position vector. - * @param {Phaser.Math.Vector3} scale - The scale vector. - * @param {Phaser.Math.Quaternion} rotation - The rotation quaternion. - * - * @return {this} This Matrix4. - */ - transform: function (position, scale, rotation) - { - var rotMatrix = _tempMat1.fromQuat(rotation); - - var rm = rotMatrix.val; - - var sx = scale.x; - var sy = scale.y; - var sz = scale.z; - - return this.setValues( - rm[0] * sx, - rm[1] * sx, - rm[2] * sx, - 0, - - rm[4] * sy, - rm[5] * sy, - rm[6] * sy, - 0, - - rm[8] * sz, - rm[9] * sz, - rm[10] * sz, - 0, - - position.x, - position.y, - position.z, - 1 - ); - }, - - /** - * Set the `x`, `y` and `z` values of this Matrix. - * - * @method Phaser.Math.Matrix4#xyz - * @since 3.0.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {number} z - The z value. - * - * @return {this} This Matrix4. - */ - xyz: function (x, y, z) - { - this.identity(); - - var out = this.val; - - out[12] = x; - out[13] = y; - out[14] = z; - - return this; - }, - - /** - * Set the scaling values of this Matrix. - * - * @method Phaser.Math.Matrix4#scaling - * @since 3.0.0 - * - * @param {number} x - The x scaling value. - * @param {number} y - The y scaling value. - * @param {number} z - The z scaling value. - * - * @return {this} This Matrix4. - */ - scaling: function (x, y, z) - { - this.zero(); - - var out = this.val; - - out[0] = x; - out[5] = y; - out[10] = z; - out[15] = 1; - - return this; - }, - - /** - * Reset this Matrix to an identity (default) matrix. - * - * @method Phaser.Math.Matrix4#identity - * @since 3.0.0 - * - * @return {this} This Matrix4. - */ - identity: function () - { - return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); - }, - - /** - * Transpose this Matrix. - * - * @method Phaser.Math.Matrix4#transpose - * @since 3.0.0 - * - * @return {this} This Matrix4. - */ - transpose: function () - { - var a = this.val; - - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a12 = a[6]; - var a13 = a[7]; - var a23 = a[11]; - - a[1] = a[4]; - a[2] = a[8]; - a[3] = a[12]; - a[4] = a01; - a[6] = a[9]; - a[7] = a[13]; - a[8] = a02; - a[9] = a12; - a[11] = a[14]; - a[12] = a03; - a[13] = a13; - a[14] = a23; - - return this; - }, - - /** - * Copies the given Matrix4 into this Matrix and then inverses it. - * - * @method Phaser.Math.Matrix4#getInverse - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to invert into this Matrix4. - * - * @return {this} This Matrix4. - */ - getInverse: function (m) - { - this.copy(m); - - return this.invert(); - }, - - /** - * Invert this Matrix. - * - * @method Phaser.Math.Matrix4#invert - * @since 3.0.0 - * - * @return {this} This Matrix4. - */ - invert: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) - { - return this; - } - - det = 1 / det; - - return this.setValues( - (a11 * b11 - a12 * b10 + a13 * b09) * det, - (a02 * b10 - a01 * b11 - a03 * b09) * det, - (a31 * b05 - a32 * b04 + a33 * b03) * det, - (a22 * b04 - a21 * b05 - a23 * b03) * det, - (a12 * b08 - a10 * b11 - a13 * b07) * det, - (a00 * b11 - a02 * b08 + a03 * b07) * det, - (a32 * b02 - a30 * b05 - a33 * b01) * det, - (a20 * b05 - a22 * b02 + a23 * b01) * det, - (a10 * b10 - a11 * b08 + a13 * b06) * det, - (a01 * b08 - a00 * b10 - a03 * b06) * det, - (a30 * b04 - a31 * b02 + a33 * b00) * det, - (a21 * b02 - a20 * b04 - a23 * b00) * det, - (a11 * b07 - a10 * b09 - a12 * b06) * det, - (a00 * b09 - a01 * b07 + a02 * b06) * det, - (a31 * b01 - a30 * b03 - a32 * b00) * det, - (a20 * b03 - a21 * b01 + a22 * b00) * det - ); - }, - - /** - * Calculate the adjoint, or adjugate, of this Matrix. - * - * @method Phaser.Math.Matrix4#adjoint - * @since 3.0.0 - * - * @return {this} This Matrix4. - */ - adjoint: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - return this.setValues( - (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)), - -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), - (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)), - -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), - -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)), - (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)), - -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)), - (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)), - (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)), - -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)), - (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)), - -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)), - -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)), - (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)), - -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)), - (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)) - ); - }, - - /** - * Calculate the determinant of this Matrix. - * - * @method Phaser.Math.Matrix4#determinant - * @since 3.0.0 - * - * @return {number} The determinant of this Matrix. - */ - determinant: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * @method Phaser.Math.Matrix4#multiply - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. - * - * @return {this} This Matrix4. - */ - multiply: function (src) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b = src.val; - - // Cache only the current line of the second matrix - var b0 = b[0]; - var b1 = b[1]; - var b2 = b[2]; - var b3 = b[3]; - - a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[4]; - b1 = b[5]; - b2 = b[6]; - b3 = b[7]; - - a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[8]; - b1 = b[9]; - b2 = b[10]; - b3 = b[11]; - - a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[12]; - b1 = b[13]; - b2 = b[14]; - b3 = b[15]; - - a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - return this; - }, - - /** - * Multiply the values of this Matrix4 by those given in the `src` argument. - * - * @method Phaser.Math.Matrix4#multiplyLocal - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. - * - * @return {this} This Matrix4. - */ - multiplyLocal: function (src) - { - var a = this.val; - var b = src.val; - - return this.setValues( - a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12], - a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13], - a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14], - a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15], - - a[4] * b[0] + a[5] * b[4] + a[6] * b[8] + a[7] * b[12], - a[4] * b[1] + a[5] * b[5] + a[6] * b[9] + a[7] * b[13], - a[4] * b[2] + a[5] * b[6] + a[6] * b[10] + a[7] * b[14], - a[4] * b[3] + a[5] * b[7] + a[6] * b[11] + a[7] * b[15], - - a[8] * b[0] + a[9] * b[4] + a[10] * b[8] + a[11] * b[12], - a[8] * b[1] + a[9] * b[5] + a[10] * b[9] + a[11] * b[13], - a[8] * b[2] + a[9] * b[6] + a[10] * b[10] + a[11] * b[14], - a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11] * b[15], - - a[12] * b[0] + a[13] * b[4] + a[14] * b[8] + a[15] * b[12], - a[12] * b[1] + a[13] * b[5] + a[14] * b[9] + a[15] * b[13], - a[12] * b[2] + a[13] * b[6] + a[14] * b[10] + a[15] * b[14], - a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15] - ); - }, - - /** - * Multiplies the given Matrix4 object with this Matrix. - * - * This is the same as calling `multiplyMatrices(m, this)`. - * - * @method Phaser.Math.Matrix4#premultiply - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to multiply with this one. - * - * @return {this} This Matrix4. - */ - premultiply: function (m) - { - return this.multiplyMatrices(m, this); - }, - - /** - * Multiplies the two given Matrix4 objects and stores the results in this Matrix. - * - * @method Phaser.Math.Matrix4#multiplyMatrices - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} a - The first Matrix4 to multiply. - * @param {Phaser.Math.Matrix4} b - The second Matrix4 to multiply. - * - * @return {this} This Matrix4. - */ - multiplyMatrices: function (a, b) - { - var am = a.val; - var bm = b.val; - - var a11 = am[0]; - var a12 = am[4]; - var a13 = am[8]; - var a14 = am[12]; - var a21 = am[1]; - var a22 = am[5]; - var a23 = am[9]; - var a24 = am[13]; - var a31 = am[2]; - var a32 = am[6]; - var a33 = am[10]; - var a34 = am[14]; - var a41 = am[3]; - var a42 = am[7]; - var a43 = am[11]; - var a44 = am[15]; - - var b11 = bm[0]; - var b12 = bm[4]; - var b13 = bm[8]; - var b14 = bm[12]; - var b21 = bm[1]; - var b22 = bm[5]; - var b23 = bm[9]; - var b24 = bm[13]; - var b31 = bm[2]; - var b32 = bm[6]; - var b33 = bm[10]; - var b34 = bm[14]; - var b41 = bm[3]; - var b42 = bm[7]; - var b43 = bm[11]; - var b44 = bm[15]; - - return this.setValues( - a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41, - a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41, - a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41, - a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41, - a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42, - a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42, - a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42, - a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42, - a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43, - a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43, - a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43, - a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43, - a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44, - a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44, - a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44, - a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44 - ); - }, - - /** - * Translate this Matrix using the given Vector. - * - * @method Phaser.Math.Matrix4#translate - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. - * - * @return {this} This Matrix4. - */ - translate: function (v) - { - return this.translateXYZ(v.x, v.y, v.z); - }, - - /** - * Translate this Matrix using the given values. - * - * @method Phaser.Math.Matrix4#translateXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {this} This Matrix4. - */ - translateXYZ: function (x, y, z) - { - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. - * - * @method Phaser.Math.Matrix4#scale - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. - * - * @return {this} This Matrix4. - */ - scale: function (v) - { - return this.scaleXYZ(v.x, v.y, v.z); - }, - - /** - * Apply a scale transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#scaleXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {this} This Matrix4. - */ - scaleXYZ: function (x, y, z) - { - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; - }, - - /** - * Derive a rotation matrix around the given axis. - * - * @method Phaser.Math.Matrix4#makeRotationAxis - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. - * @param {number} angle - The rotation angle in radians. - * - * @return {this} This Matrix4. - */ - makeRotationAxis: function (axis, angle) - { - // Based on http://www.gamedev.net/reference/articles/article1199.asp - - var c = Math.cos(angle); - var s = Math.sin(angle); - var t = 1 - c; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var tx = t * x; - var ty = t * y; - - return this.setValues( - tx * x + c, tx * y - s * z, tx * z + s * y, 0, - tx * y + s * z, ty * y + c, ty * z - s * x, 0, - tx * z - s * y, ty * z + s * x, t * z * z + c, 0, - 0, 0, 0, 1 - ); - }, - - /** - * Apply a rotation transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#rotate - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. - * - * @return {this} This Matrix4. - */ - rotate: function (rad, axis) - { - var a = this.val; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var len = Math.sqrt(x * x + y * y + z * z); - - if (Math.abs(len) < EPSILON) - { - return this; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - - var s = Math.sin(rad); - var c = Math.cos(rad); - var t = 1 - c; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - // Construct the elements of the rotation matrix - var b00 = x * x * t + c; - var b01 = y * x * t + z * s; - var b02 = z * x * t - y * s; - - var b10 = x * y * t - z * s; - var b11 = y * y * t + c; - var b12 = z * y * t + x * s; - - var b20 = x * z * t + y * s; - var b21 = y * z * t - x * s; - var b22 = z * z * t + c; - - // Perform rotation-specific matrix multiplication - return this.setValues( - a00 * b00 + a10 * b01 + a20 * b02, - a01 * b00 + a11 * b01 + a21 * b02, - a02 * b00 + a12 * b01 + a22 * b02, - a03 * b00 + a13 * b01 + a23 * b02, - a00 * b10 + a10 * b11 + a20 * b12, - a01 * b10 + a11 * b11 + a21 * b12, - a02 * b10 + a12 * b11 + a22 * b12, - a03 * b10 + a13 * b11 + a23 * b12, - a00 * b20 + a10 * b21 + a20 * b22, - a01 * b20 + a11 * b21 + a21 * b22, - a02 * b20 + a12 * b21 + a22 * b22, - a03 * b20 + a13 * b21 + a23 * b22, - a30, a31, a32, a33 - ); - }, - - /** - * Rotate this matrix on its X axis. - * - * @method Phaser.Math.Matrix4#rotateX - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * - * @return {this} This Matrix4. - */ - rotateX: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[4] = a10 * c + a20 * s; - a[5] = a11 * c + a21 * s; - a[6] = a12 * c + a22 * s; - a[7] = a13 * c + a23 * s; - a[8] = a20 * c - a10 * s; - a[9] = a21 * c - a11 * s; - a[10] = a22 * c - a12 * s; - a[11] = a23 * c - a13 * s; - - return this; - }, - - /** - * Rotate this matrix on its Y axis. - * - * @method Phaser.Math.Matrix4#rotateY - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {this} This Matrix4. - */ - rotateY: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c - a20 * s; - a[1] = a01 * c - a21 * s; - a[2] = a02 * c - a22 * s; - a[3] = a03 * c - a23 * s; - a[8] = a00 * s + a20 * c; - a[9] = a01 * s + a21 * c; - a[10] = a02 * s + a22 * c; - a[11] = a03 * s + a23 * c; - - return this; - }, - - /** - * Rotate this matrix on its Z axis. - * - * @method Phaser.Math.Matrix4#rotateZ - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {this} This Matrix4. - */ - rotateZ: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c + a10 * s; - a[1] = a01 * c + a11 * s; - a[2] = a02 * c + a12 * s; - a[3] = a03 * c + a13 * s; - a[4] = a10 * c - a00 * s; - a[5] = a11 * c - a01 * s; - a[6] = a12 * c - a02 * s; - a[7] = a13 * c - a03 * s; - - return this; - }, - - /** - * Set the values of this Matrix from the given rotation Quaternion and translation Vector. - * - * @method Phaser.Math.Matrix4#fromRotationTranslation - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. - * @param {Phaser.Math.Vector3} v - The Vector to set translation from. - * - * @return {this} This Matrix4. - */ - fromRotationTranslation: function (q, v) - { - // Quaternion math - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - return this.setValues( - 1 - (yy + zz), - xy + wz, - xz - wy, - 0, - - xy - wz, - 1 - (xx + zz), - yz + wx, - 0, - - xz + wy, - yz - wx, - 1 - (xx + yy), - 0, - - v.x, - v.y, - v.z, - 1 - ); - }, - - /** - * Set the values of this Matrix from the given Quaternion. - * - * @method Phaser.Math.Matrix4#fromQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. - * - * @return {this} This Matrix4. - */ - fromQuat: function (q) - { - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - return this.setValues( - 1 - (yy + zz), - xy + wz, - xz - wy, - 0, - - xy - wz, - 1 - (xx + zz), - yz + wx, - 0, - - xz + wy, - yz - wx, - 1 - (xx + yy), - 0, - - 0, - 0, - 0, - 1 - ); - }, - - /** - * Generate a frustum matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#frustum - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {this} This Matrix4. - */ - frustum: function (left, right, bottom, top, near, far) - { - var rl = 1 / (right - left); - var tb = 1 / (top - bottom); - var nf = 1 / (near - far); - - return this.setValues( - (near * 2) * rl, - 0, - 0, - 0, - - 0, - (near * 2) * tb, - 0, - 0, - - (right + left) * rl, - (top + bottom) * tb, - (far + near) * nf, - -1, - - 0, - 0, - (far * near * 2) * nf, - 0 - ); - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspective - * @since 3.0.0 - * - * @param {number} fovy - Vertical field of view in radians - * @param {number} aspect - Aspect ratio. Typically viewport width /height. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {this} This Matrix4. - */ - perspective: function (fovy, aspect, near, far) - { - var f = 1.0 / Math.tan(fovy / 2); - var nf = 1 / (near - far); - - return this.setValues( - f / aspect, - 0, - 0, - 0, - - 0, - f, - 0, - 0, - - 0, - 0, - (far + near) * nf, - -1, - - 0, - 0, - (2 * far * near) * nf, - 0 - ); - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspectiveLH - * @since 3.0.0 - * - * @param {number} width - The width of the frustum. - * @param {number} height - The height of the frustum. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {this} This Matrix4. - */ - perspectiveLH: function (width, height, near, far) - { - return this.setValues( - (2 * near) / width, - 0, - 0, - 0, - - 0, - (2 * near) / height, - 0, - 0, - - 0, - 0, - -far / (near - far), - 1, - - 0, - 0, - (near * far) / (near - far), - 0 - ); - }, - - /** - * Generate an orthogonal projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#ortho - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {this} This Matrix4. - */ - ortho: function (left, right, bottom, top, near, far) - { - var lr = left - right; - var bt = bottom - top; - var nf = near - far; - - // Avoid division by zero - lr = (lr === 0) ? lr : 1 / lr; - bt = (bt === 0) ? bt : 1 / bt; - nf = (nf === 0) ? nf : 1 / nf; - - return this.setValues( - -2 * lr, - 0, - 0, - 0, - - 0, - -2 * bt, - 0, - 0, - - 0, - 0, - 2 * nf, - 0, - - (left + right) * lr, - (top + bottom) * bt, - (far + near) * nf, - 1 - ); - }, - - /** - * Generate a right-handed look-at matrix with the given eye position, target and up axis. - * - * @method Phaser.Math.Matrix4#lookAtRH - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} eye - Position of the viewer. - * @param {Phaser.Math.Vector3} target - Point the viewer is looking at. - * @param {Phaser.Math.Vector3} up - vec3 pointing up. - * - * @return {this} This Matrix4. - */ - lookAtRH: function (eye, target, up) - { - var m = this.val; - - _z.subVectors(eye, target); - - if (_z.getLengthSquared() === 0) - { - // eye and target are in the same position - _z.z = 1; - } - - _z.normalize(); - _x.crossVectors(up, _z); - - if (_x.getLengthSquared() === 0) - { - // up and z are parallel - - if (Math.abs(up.z) === 1) - { - _z.x += 0.0001; - } - else - { - _z.z += 0.0001; - } - - _z.normalize(); - _x.crossVectors(up, _z); - } - - _x.normalize(); - _y.crossVectors(_z, _x); - - m[0] = _x.x; - m[1] = _x.y; - m[2] = _x.z; - m[4] = _y.x; - m[5] = _y.y; - m[6] = _y.z; - m[8] = _z.x; - m[9] = _z.y; - m[10] = _z.z; - - return this; - }, - - /** - * Generate a look-at matrix with the given eye position, focal point, and up axis. - * - * @method Phaser.Math.Matrix4#lookAt - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} eye - Position of the viewer - * @param {Phaser.Math.Vector3} center - Point the viewer is looking at - * @param {Phaser.Math.Vector3} up - vec3 pointing up. - * - * @return {this} This Matrix4. - */ - lookAt: function (eye, center, up) - { - var eyex = eye.x; - var eyey = eye.y; - var eyez = eye.z; - - var upx = up.x; - var upy = up.y; - var upz = up.z; - - var centerx = center.x; - var centery = center.y; - var centerz = center.z; - - if (Math.abs(eyex - centerx) < EPSILON && - Math.abs(eyey - centery) < EPSILON && - Math.abs(eyez - centerz) < EPSILON) - { - return this.identity(); - } - - var z0 = eyex - centerx; - var z1 = eyey - centery; - var z2 = eyez - centerz; - - var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); - - z0 *= len; - z1 *= len; - z2 *= len; - - var x0 = upy * z2 - upz * z1; - var x1 = upz * z0 - upx * z2; - var x2 = upx * z1 - upy * z0; - - len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); - - if (!len) - { - x0 = 0; - x1 = 0; - x2 = 0; - } - else - { - len = 1 / len; - x0 *= len; - x1 *= len; - x2 *= len; - } - - var y0 = z1 * x2 - z2 * x1; - var y1 = z2 * x0 - z0 * x2; - var y2 = z0 * x1 - z1 * x0; - - len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); - - if (!len) - { - y0 = 0; - y1 = 0; - y2 = 0; - } - else - { - len = 1 / len; - y0 *= len; - y1 *= len; - y2 *= len; - } - - return this.setValues( - x0, - y0, - z0, - 0, - - x1, - y1, - z1, - 0, - - x2, - y2, - z2, - 0, - - -(x0 * eyex + x1 * eyey + x2 * eyez), - -(y0 * eyex + y1 * eyey + y2 * eyez), - -(z0 * eyex + z1 * eyey + z2 * eyez), - 1 - ); - }, - - /** - * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. - * - * @method Phaser.Math.Matrix4#yawPitchRoll - * @since 3.0.0 - * - * @param {number} yaw - The yaw value. - * @param {number} pitch - The pitch value. - * @param {number} roll - The roll value. - * - * @return {this} This Matrix4. - */ - yawPitchRoll: function (yaw, pitch, roll) - { - this.zero(); - _tempMat1.zero(); - _tempMat2.zero(); - - var m0 = this.val; - var m1 = _tempMat1.val; - var m2 = _tempMat2.val; - - // Rotate Z - var s = Math.sin(roll); - var c = Math.cos(roll); - - m0[10] = 1; - m0[15] = 1; - m0[0] = c; - m0[1] = s; - m0[4] = -s; - m0[5] = c; - - // Rotate X - s = Math.sin(pitch); - c = Math.cos(pitch); - - m1[0] = 1; - m1[15] = 1; - m1[5] = c; - m1[10] = c; - m1[9] = -s; - m1[6] = s; - - // Rotate Y - s = Math.sin(yaw); - c = Math.cos(yaw); - - m2[5] = 1; - m2[15] = 1; - m2[0] = c; - m2[2] = -s; - m2[8] = s; - m2[10] = c; - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - return this; - }, - - /** - * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. - * - * @method Phaser.Math.Matrix4#setWorldMatrix - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. - * @param {Phaser.Math.Vector3} position - The position of the world matrix. - * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. - * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. - * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. - * - * @return {this} This Matrix4. - */ - setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) - { - this.yawPitchRoll(rotation.y, rotation.x, rotation.z); - - _tempMat1.scaling(scale.x, scale.y, scale.z); - _tempMat2.xyz(position.x, position.y, position.z); - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - if (viewMatrix) - { - this.multiplyLocal(viewMatrix); - } - - if (projectionMatrix) - { - this.multiplyLocal(projectionMatrix); - } - - return this; - }, - - /** - * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. - * - * @method Phaser.Math.Matrix4#multiplyToMat4 - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix4 to multiply with this one. - * @param {Phaser.Math.Matrix4} out - The receiving Matrix. - * - * @return {Phaser.Math.Matrix4} This `out` Matrix4. - */ - multiplyToMat4: function (src, out) - { - var a = this.val; - var b = src.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = b[0]; - var b01 = b[1]; - var b02 = b[2]; - var b03 = b[3]; - var b10 = b[4]; - var b11 = b[5]; - var b12 = b[6]; - var b13 = b[7]; - var b20 = b[8]; - var b21 = b[9]; - var b22 = b[10]; - var b23 = b[11]; - var b30 = b[12]; - var b31 = b[13]; - var b32 = b[14]; - var b33 = b[15]; - - return out.setValues( - b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, - b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31, - b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32, - b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33, - - b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, - b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, - b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, - b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, - - b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, - b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, - b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, - b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, - - b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, - b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, - b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, - b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 - ); - }, - - /** - * Takes the rotation and position vectors and builds this Matrix4 from them. - * - * @method Phaser.Math.Matrix4#fromRotationXYTranslation - * @since 3.50.0 - * - * @param {Phaser.Math.Vector3} rotation - The rotation vector. - * @param {Phaser.Math.Vector3} position - The position vector. - * @param {boolean} translateFirst - Should the operation translate then rotate (`true`), or rotate then translate? (`false`) - * - * @return {this} This Matrix4. - */ - fromRotationXYTranslation: function (rotation, position, translateFirst) - { - var x = position.x; - var y = position.y; - var z = position.z; - - var sx = Math.sin(rotation.x); - var cx = Math.cos(rotation.x); - - var sy = Math.sin(rotation.y); - var cy = Math.cos(rotation.y); - - var a30 = x; - var a31 = y; - var a32 = z; - - // Rotate X - - var b21 = -sx; - - // Rotate Y - - var c01 = 0 - b21 * sy; - - var c02 = 0 - cx * sy; - - var c21 = b21 * cy; - - var c22 = cx * cy; - - // Translate - if (!translateFirst) - { - // a30 = cy * x + 0 * y + sy * z; - a30 = cy * x + sy * z; - a31 = c01 * x + cx * y + c21 * z; - a32 = c02 * x + sx * y + c22 * z; - } - - return this.setValues( - cy, - c01, - c02, - 0, - 0, - cx, - sx, - 0, - sy, - c21, - c22, - 0, - a30, - a31, - a32, - 1 - ); - }, - - /** - * Returns the maximum axis scale from this Matrix4. - * - * @method Phaser.Math.Matrix4#getMaxScaleOnAxis - * @since 3.50.0 - * - * @return {number} The maximum axis scale. - */ - getMaxScaleOnAxis: function () - { - var m = this.val; - - var scaleXSq = m[0] * m[0] + m[1] * m[1] + m[2] * m[2]; - var scaleYSq = m[4] * m[4] + m[5] * m[5] + m[6] * m[6]; - var scaleZSq = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; - - return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); - } - -}); - -/** - * @ignore - */ -var _tempMat1 = new Matrix4(); - -/** - * @ignore - */ -var _tempMat2 = new Matrix4(); - -/** - * @ignore - */ -var _x = new Vector3(); - -/** - * @ignore - */ -var _y = new Vector3(); - -/** - * @ignore - */ -var _z = new Vector3(); - -module.exports = Matrix4; - - -/***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Scenes.Events - */ - -module.exports = { - - ADDED_TO_SCENE: __webpack_require__(188), - BOOT: __webpack_require__(189), - CREATE: __webpack_require__(190), - DESTROY: __webpack_require__(191), - PAUSE: __webpack_require__(192), - POST_UPDATE: __webpack_require__(193), - PRE_RENDER: __webpack_require__(194), - PRE_UPDATE: __webpack_require__(195), - READY: __webpack_require__(196), - REMOVED_FROM_SCENE: __webpack_require__(197), - RENDER: __webpack_require__(198), - RESUME: __webpack_require__(199), - SHUTDOWN: __webpack_require__(200), - SLEEP: __webpack_require__(201), - START: __webpack_require__(202), - TRANSITION_COMPLETE: __webpack_require__(203), - TRANSITION_INIT: __webpack_require__(204), - TRANSITION_OUT: __webpack_require__(205), - TRANSITION_START: __webpack_require__(206), - TRANSITION_WAKE: __webpack_require__(207), - UPDATE: __webpack_require__(208), - WAKE: __webpack_require__(209) - -}; - - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(10); -var Events = __webpack_require__(48); -var GetFastValue = __webpack_require__(9); -var GetURL = __webpack_require__(49); -var MergeXHRSettings = __webpack_require__(50); -var XHRLoader = __webpack_require__(222); -var XHRSettings = __webpack_require__(51); - -/** - * @classdesc - * The base File class used by all File Types that the Loader can support. - * You shouldn't create an instance of a File directly, but should extend it with your own class, setting a custom type and processing methods. - * - * @class File - * @memberof Phaser.Loader - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. - * @param {Phaser.Types.Loader.FileConfig} fileConfig - The file configuration object, as created by the file type. - */ -var File = new Class({ - - initialize: - - function File (loader, fileConfig) - { - /** - * A reference to the Loader that is going to load this file. - * - * @name Phaser.Loader.File#loader - * @type {Phaser.Loader.LoaderPlugin} - * @since 3.0.0 - */ - this.loader = loader; - - /** - * A reference to the Cache, or Texture Manager, that is going to store this file if it loads. - * - * @name Phaser.Loader.File#cache - * @type {(Phaser.Cache.BaseCache|Phaser.Textures.TextureManager)} - * @since 3.7.0 - */ - this.cache = GetFastValue(fileConfig, 'cache', false); - - /** - * The file type string (image, json, etc) for sorting within the Loader. - * - * @name Phaser.Loader.File#type - * @type {string} - * @since 3.0.0 - */ - this.type = GetFastValue(fileConfig, 'type', false); - - if (!this.type) - { - throw new Error('Invalid File type: ' + this.type); - } - - /** - * Unique cache key (unique within its file type) - * - * @name Phaser.Loader.File#key - * @type {string} - * @since 3.0.0 - */ - this.key = GetFastValue(fileConfig, 'key', false); - - var loadKey = this.key; - - if (loader.prefix && loader.prefix !== '') - { - this.key = loader.prefix + loadKey; - } - - if (!this.key) - { - throw new Error('Invalid File key: ' + this.key); - } - - var url = GetFastValue(fileConfig, 'url'); - - if (url === undefined) - { - url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); - } - else if (typeof url === 'string' && !url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)) - { - url = loader.path + url; - } - - /** - * The URL of the file, not including baseURL. - * - * Automatically has Loader.path prepended to it if a string. - * - * Can also be a JavaScript Object, such as the results of parsing JSON data. - * - * @name Phaser.Loader.File#url - * @type {object|string} - * @since 3.0.0 - */ - this.url = url; - - /** - * The final URL this file will load from, including baseURL and path. - * Set automatically when the Loader calls 'load' on this file. - * - * @name Phaser.Loader.File#src - * @type {string} - * @since 3.0.0 - */ - this.src = ''; - - /** - * The merged XHRSettings for this file. - * - * @name Phaser.Loader.File#xhrSettings - * @type {Phaser.Types.Loader.XHRSettingsObject} - * @since 3.0.0 - */ - this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined)); - - if (GetFastValue(fileConfig, 'xhrSettings', false)) - { - this.xhrSettings = MergeXHRSettings(this.xhrSettings, GetFastValue(fileConfig, 'xhrSettings', {})); - } - - /** - * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File. - * - * @name Phaser.Loader.File#xhrLoader - * @type {?XMLHttpRequest} - * @since 3.0.0 - */ - this.xhrLoader = null; - - /** - * The current state of the file. One of the FILE_CONST values. - * - * @name Phaser.Loader.File#state - * @type {number} - * @since 3.0.0 - */ - this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING; - - /** - * The total size of this file. - * Set by onProgress and only if loading via XHR. - * - * @name Phaser.Loader.File#bytesTotal - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.bytesTotal = 0; - - /** - * Updated as the file loads. - * Only set if loading via XHR. - * - * @name Phaser.Loader.File#bytesLoaded - * @type {number} - * @default -1 - * @since 3.0.0 - */ - this.bytesLoaded = -1; - - /** - * A percentage value between 0 and 1 indicating how much of this file has loaded. - * Only set if loading via XHR. - * - * @name Phaser.Loader.File#percentComplete - * @type {number} - * @default -1 - * @since 3.0.0 - */ - this.percentComplete = -1; - - /** - * For CORs based loading. - * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set) - * - * @name Phaser.Loader.File#crossOrigin - * @type {(string|undefined)} - * @since 3.0.0 - */ - this.crossOrigin = undefined; - - /** - * The processed file data, stored here after the file has loaded. - * - * @name Phaser.Loader.File#data - * @type {*} - * @since 3.0.0 - */ - this.data = undefined; - - /** - * A config object that can be used by file types to store transitional data. - * - * @name Phaser.Loader.File#config - * @type {*} - * @since 3.0.0 - */ - this.config = GetFastValue(fileConfig, 'config', {}); - - /** - * If this is a multipart file, i.e. an atlas and its json together, then this is a reference - * to the parent MultiFile. Set and used internally by the Loader or specific file types. - * - * @name Phaser.Loader.File#multiFile - * @type {?Phaser.Loader.MultiFile} - * @since 3.7.0 - */ - this.multiFile; - - /** - * Does this file have an associated linked file? Such as an image and a normal map. - * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't - * actually bound by data, where-as a linkFile is. - * - * @name Phaser.Loader.File#linkFile - * @type {?Phaser.Loader.File} - * @since 3.7.0 - */ - this.linkFile; - }, - - /** - * Links this File with another, so they depend upon each other for loading and processing. - * - * @method Phaser.Loader.File#setLink - * @since 3.7.0 - * - * @param {Phaser.Loader.File} fileB - The file to link to this one. - */ - setLink: function (fileB) - { - this.linkFile = fileB; - - fileB.linkFile = this; - }, - - /** - * Resets the XHRLoader instance this file is using. - * - * @method Phaser.Loader.File#resetXHR - * @since 3.0.0 - */ - resetXHR: function () - { - if (this.xhrLoader) - { - this.xhrLoader.onload = undefined; - this.xhrLoader.onerror = undefined; - this.xhrLoader.onprogress = undefined; - } - }, - - /** - * Called by the Loader, starts the actual file downloading. - * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. - * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. - * - * @method Phaser.Loader.File#load - * @since 3.0.0 - */ - load: function () - { - if (this.state === CONST.FILE_POPULATED) - { - // Can happen for example in a JSONFile if they've provided a JSON object instead of a URL - this.loader.nextFile(this, true); - } - else - { - this.state = CONST.FILE_LOADING; - - this.src = GetURL(this, this.loader.baseURL); - - if (this.src.indexOf('data:') === 0) - { - console.warn('Local data URIs are not supported: ' + this.key); - } - else - { - // The creation of this XHRLoader starts the load process going. - // It will automatically call the following, based on the load outcome: - // - // xhr.onload = this.onLoad - // xhr.onerror = this.onError - // xhr.onprogress = this.onProgress - - this.xhrLoader = XHRLoader(this, this.loader.xhr); - } - } - }, - - /** - * Called when the file finishes loading, is sent a DOM ProgressEvent. - * - * @method Phaser.Loader.File#onLoad - * @since 3.0.0 - * - * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event. - * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load. - */ - onLoad: function (xhr, event) - { - var isLocalFile = xhr.responseURL && this.loader.localSchemes.some(function (scheme) - { - return xhr.responseURL.indexOf(scheme) === 0; - }); - - var localFileOk = (isLocalFile && event.target.status === 0); - - var success = !(event.target && event.target.status !== 200) || localFileOk; - - // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called. - if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599) - { - success = false; - } - - this.state = CONST.FILE_LOADED; - - this.resetXHR(); - - this.loader.nextFile(this, success); - }, - - /** - * Called if the file errors while loading, is sent a DOM ProgressEvent. - * - * @method Phaser.Loader.File#onError - * @since 3.0.0 - * - * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event. - * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this error. - */ - onError: function () - { - this.resetXHR(); - - this.loader.nextFile(this, false); - }, - - /** - * Called during the file load progress. Is sent a DOM ProgressEvent. - * - * @method Phaser.Loader.File#onProgress - * @fires Phaser.Loader.Events#FILE_PROGRESS - * @since 3.0.0 - * - * @param {ProgressEvent} event - The DOM ProgressEvent. - */ - onProgress: function (event) - { - if (event.lengthComputable) - { - this.bytesLoaded = event.loaded; - this.bytesTotal = event.total; - - this.percentComplete = Math.min((this.bytesLoaded / this.bytesTotal), 1); - - this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete); - } - }, - - /** - * Usually overridden by the FileTypes and is called by Loader.nextFile. - * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage. - * - * @method Phaser.Loader.File#onProcess - * @since 3.0.0 - */ - onProcess: function () - { - this.state = CONST.FILE_PROCESSING; - - this.onProcessComplete(); - }, - - /** - * Called when the File has completed processing. - * Checks on the state of its multifile, if set. - * - * @method Phaser.Loader.File#onProcessComplete - * @since 3.7.0 - */ - onProcessComplete: function () - { - this.state = CONST.FILE_COMPLETE; - - if (this.multiFile) - { - this.multiFile.onFileComplete(this); - } - - this.loader.fileProcessComplete(this); - }, - - /** - * Called when the File has completed processing but it generated an error. - * Checks on the state of its multifile, if set. - * - * @method Phaser.Loader.File#onProcessError - * @since 3.7.0 - */ - onProcessError: function () - { - // eslint-disable-next-line no-console - console.error('Failed to process file: %s "%s"', this.type, this.key); - - this.state = CONST.FILE_ERRORED; - - if (this.multiFile) - { - this.multiFile.onFileFailed(this); - } - - this.loader.fileProcessComplete(this); - }, - - /** - * Checks if a key matching the one used by this file exists in the target Cache or not. - * This is called automatically by the LoaderPlugin to decide if the file can be safely - * loaded or will conflict. - * - * @method Phaser.Loader.File#hasCacheConflict - * @since 3.7.0 - * - * @return {boolean} `true` if adding this file will cause a conflict, otherwise `false`. - */ - hasCacheConflict: function () - { - return (this.cache && this.cache.exists(this.key)); - }, - - /** - * Adds this file to its target cache upon successful loading and processing. - * This method is often overridden by specific file types. - * - * @method Phaser.Loader.File#addToCache - * @since 3.7.0 - */ - addToCache: function () - { - if (this.cache && this.data) - { - this.cache.add(this.key, this.data); - } - }, - - /** - * Called once the file has been added to its cache and is now ready for deletion from the Loader. - * It will emit a `filecomplete` event from the LoaderPlugin. - * - * @method Phaser.Loader.File#pendingDestroy - * @fires Phaser.Loader.Events#FILE_COMPLETE - * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE - * @since 3.7.0 - */ - pendingDestroy: function (data) - { - if (this.state === CONST.FILE_PENDING_DESTROY) - { - return; - } - - if (data === undefined) { data = this.data; } - - var key = this.key; - var type = this.type; - - this.loader.emit(Events.FILE_COMPLETE, key, type, data); - this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data); - - this.loader.flagForRemoval(this); - - this.state = CONST.FILE_PENDING_DESTROY; - }, - - /** - * Destroy this File and any references it holds. - * - * @method Phaser.Loader.File#destroy - * @since 3.7.0 - */ - destroy: function () - { - this.loader = null; - this.cache = null; - this.xhrSettings = null; - this.multiFile = null; - this.linkFile = null; - this.data = null; - } - -}); - -/** - * Static method for creating object URL using URL API and setting it as image 'src' attribute. - * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader. - * - * @method Phaser.Loader.File.createObjectURL - * @static - * @since 3.7.0 - * - * @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL. - * @param {Blob} blob - A Blob object to create an object URL for. - * @param {string} defaultType - Default mime type used if blob type is not available. - */ -File.createObjectURL = function (image, blob, defaultType) -{ - if (typeof URL === 'function') - { - image.src = URL.createObjectURL(blob); - } - else - { - var reader = new FileReader(); - - reader.onload = function () - { - image.removeAttribute('crossOrigin'); - image.src = 'data:' + (blob.type || defaultType) + ';base64,' + reader.result.split(',')[1]; - }; - - reader.onerror = image.onerror; - - reader.readAsDataURL(blob); - } + return names; }; /** - * Static method for releasing an existing object URL which was previously created - * by calling {@link File#createObjectURL} method. + * Return the listeners registered for a given event. * - * @method Phaser.Loader.File.revokeObjectURL - * @static - * @since 3.7.0 - * - * @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked. + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public */ -File.revokeObjectURL = function (image) -{ - if (typeof URL === 'function') - { - URL.revokeObjectURL(image.src); - } +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + + return ee; }; -module.exports = File; - - -/***/ }), -/* 25 */ -/***/ (function(module, exports) { - /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; -var types = {}; - -/** - * @namespace Phaser.Loader.FileTypesManager - */ - -var FileTypesManager = { - - /** - * Static method called when a LoaderPlugin is created. - * - * Loops through the local types object and injects all of them as - * properties into the LoaderPlugin instance. - * - * @method Phaser.Loader.FileTypesManager.install - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into. - */ - install: function (loader) - { - for (var key in types) - { - loader[key] = types[key]; - } - }, - - /** - * Static method called directly by the File Types. - * - * The key is a reference to the function used to load the files via the Loader, i.e. `image`. - * - * @method Phaser.Loader.FileTypesManager.register - * @since 3.0.0 - * - * @param {string} key - The key that will be used as the method name in the LoaderPlugin. - * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked. - */ - register: function (key, factoryFunction) - { - types[key] = factoryFunction; - }, - - /** - * Removed all associated file types. - * - * @method Phaser.Loader.FileTypesManager.destroy - * @since 3.0.0 - */ - destroy: function () - { - types = {}; - } - + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; }; -module.exports = FileTypesManager; - - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public */ - -var Class = __webpack_require__(0); -var MATH_CONST = __webpack_require__(4); -var Vector2 = __webpack_require__(3); - -/** - * @classdesc - * A Matrix used for display transformations for rendering. - * - * It is represented like so: - * - * ``` - * | a | c | tx | - * | b | d | ty | - * | 0 | 0 | 1 | - * ``` - * - * @class TransformMatrix - * @memberof Phaser.GameObjects.Components - * @constructor - * @since 3.0.0 - * - * @param {number} [a=1] - The Scale X value. - * @param {number} [b=0] - The Skew Y value. - * @param {number} [c=0] - The Skew X value. - * @param {number} [d=1] - The Scale Y value. - * @param {number} [tx=0] - The Translate X value. - * @param {number} [ty=0] - The Translate Y value. - */ -var TransformMatrix = new Class({ - - initialize: - - function TransformMatrix (a, b, c, d, tx, ty) - { - if (a === undefined) { a = 1; } - if (b === undefined) { b = 0; } - if (c === undefined) { c = 0; } - if (d === undefined) { d = 1; } - if (tx === undefined) { tx = 0; } - if (ty === undefined) { ty = 0; } - - /** - * The matrix values. - * - * @name Phaser.GameObjects.Components.TransformMatrix#matrix - * @type {Float32Array} - * @since 3.0.0 - */ - this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]); - - /** - * The decomposed matrix. - * - * @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix - * @type {object} - * @since 3.0.0 - */ - this.decomposedMatrix = { - translateX: 0, - translateY: 0, - scaleX: 1, - scaleY: 1, - rotation: 0 - }; - - /** - * The temporary quad value cache. - * - * @name Phaser.GameObjects.Components.TransformMatrix#quad - * @type {Float32Array} - * @since 3.60.0 - */ - this.quad = new Float32Array(8); - }, - - /** - * The Scale X value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#a - * @type {number} - * @since 3.4.0 - */ - a: { - - get: function () - { - return this.matrix[0]; - }, - - set: function (value) - { - this.matrix[0] = value; - } - - }, - - /** - * The Skew Y value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#b - * @type {number} - * @since 3.4.0 - */ - b: { - - get: function () - { - return this.matrix[1]; - }, - - set: function (value) - { - this.matrix[1] = value; - } - - }, - - /** - * The Skew X value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#c - * @type {number} - * @since 3.4.0 - */ - c: { - - get: function () - { - return this.matrix[2]; - }, - - set: function (value) - { - this.matrix[2] = value; - } - - }, - - /** - * The Scale Y value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#d - * @type {number} - * @since 3.4.0 - */ - d: { - - get: function () - { - return this.matrix[3]; - }, - - set: function (value) - { - this.matrix[3] = value; - } - - }, - - /** - * The Translate X value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#e - * @type {number} - * @since 3.11.0 - */ - e: { - - get: function () - { - return this.matrix[4]; - }, - - set: function (value) - { - this.matrix[4] = value; - } - - }, - - /** - * The Translate Y value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#f - * @type {number} - * @since 3.11.0 - */ - f: { - - get: function () - { - return this.matrix[5]; - }, - - set: function (value) - { - this.matrix[5] = value; - } - - }, - - /** - * The Translate X value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#tx - * @type {number} - * @since 3.4.0 - */ - tx: { - - get: function () - { - return this.matrix[4]; - }, - - set: function (value) - { - this.matrix[4] = value; - } - - }, - - /** - * The Translate Y value. - * - * @name Phaser.GameObjects.Components.TransformMatrix#ty - * @type {number} - * @since 3.4.0 - */ - ty: { - - get: function () - { - return this.matrix[5]; - }, - - set: function (value) - { - this.matrix[5] = value; - } - - }, - - /** - * The rotation of the Matrix. Value is in radians. - * - * @name Phaser.GameObjects.Components.TransformMatrix#rotation - * @type {number} - * @readonly - * @since 3.4.0 - */ - rotation: { - - get: function () - { - return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1); - } - - }, - - /** - * The rotation of the Matrix, normalized to be within the Phaser right-handed - * clockwise rotation space. Value is in radians. - * - * @name Phaser.GameObjects.Components.TransformMatrix#rotationNormalized - * @type {number} - * @readonly - * @since 3.19.0 - */ - rotationNormalized: { - - get: function () - { - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - - if (a || b) - { - // var r = Math.sqrt(a * a + b * b); - - return (b > 0) ? Math.acos(a / this.scaleX) : -Math.acos(a / this.scaleX); - } - else if (c || d) - { - // var s = Math.sqrt(c * c + d * d); - - return MATH_CONST.TAU - ((d > 0) ? Math.acos(-c / this.scaleY) : -Math.acos(c / this.scaleY)); - } - else - { - return 0; - } - } - - }, - - /** - * The decomposed horizontal scale of the Matrix. This value is always positive. - * - * @name Phaser.GameObjects.Components.TransformMatrix#scaleX - * @type {number} - * @readonly - * @since 3.4.0 - */ - scaleX: { - - get: function () - { - return Math.sqrt((this.a * this.a) + (this.b * this.b)); - } - - }, - - /** - * The decomposed vertical scale of the Matrix. This value is always positive. - * - * @name Phaser.GameObjects.Components.TransformMatrix#scaleY - * @type {number} - * @readonly - * @since 3.4.0 - */ - scaleY: { - - get: function () - { - return Math.sqrt((this.c * this.c) + (this.d * this.d)); - } - - }, - - /** - * Reset the Matrix to an identity matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity - * @since 3.0.0 - * - * @return {this} This TransformMatrix. - */ - loadIdentity: function () - { - var matrix = this.matrix; - - matrix[0] = 1; - matrix[1] = 0; - matrix[2] = 0; - matrix[3] = 1; - matrix[4] = 0; - matrix[5] = 0; - - return this; - }, - - /** - * Translate the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#translate - * @since 3.0.0 - * - * @param {number} x - The horizontal translation value. - * @param {number} y - The vertical translation value. - * - * @return {this} This TransformMatrix. - */ - translate: function (x, y) - { - var matrix = this.matrix; - - matrix[4] = matrix[0] * x + matrix[2] * y + matrix[4]; - matrix[5] = matrix[1] * x + matrix[3] * y + matrix[5]; - - return this; - }, - - /** - * Scale the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#scale - * @since 3.0.0 - * - * @param {number} x - The horizontal scale value. - * @param {number} y - The vertical scale value. - * - * @return {this} This TransformMatrix. - */ - scale: function (x, y) - { - var matrix = this.matrix; - - matrix[0] *= x; - matrix[1] *= x; - matrix[2] *= y; - matrix[3] *= y; - - return this; - }, - - /** - * Rotate the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#rotate - * @since 3.0.0 - * - * @param {number} angle - The angle of rotation in radians. - * - * @return {this} This TransformMatrix. - */ - rotate: function (angle) - { - var sin = Math.sin(angle); - var cos = Math.cos(angle); - - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - - matrix[0] = a * cos + c * sin; - matrix[1] = b * cos + d * sin; - matrix[2] = a * -sin + c * cos; - matrix[3] = b * -sin + d * cos; - - return this; - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * If an `out` Matrix is given then the results will be stored in it. - * If it is not given, this matrix will be updated in place instead. - * Use an `out` Matrix if you do not wish to mutate this matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#multiply - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} rhs - The Matrix to multiply by. - * @param {Phaser.GameObjects.Components.TransformMatrix} [out] - An optional Matrix to store the results in. - * - * @return {(this|Phaser.GameObjects.Components.TransformMatrix)} Either this TransformMatrix, or the `out` Matrix, if given in the arguments. - */ - multiply: function (rhs, out) - { - var matrix = this.matrix; - var source = rhs.matrix; - - var localA = matrix[0]; - var localB = matrix[1]; - var localC = matrix[2]; - var localD = matrix[3]; - var localE = matrix[4]; - var localF = matrix[5]; - - var sourceA = source[0]; - var sourceB = source[1]; - var sourceC = source[2]; - var sourceD = source[3]; - var sourceE = source[4]; - var sourceF = source[5]; - - var destinationMatrix = (out === undefined) ? matrix : out.matrix; - - destinationMatrix[0] = (sourceA * localA) + (sourceB * localC); - destinationMatrix[1] = (sourceA * localB) + (sourceB * localD); - destinationMatrix[2] = (sourceC * localA) + (sourceD * localC); - destinationMatrix[3] = (sourceC * localB) + (sourceD * localD); - destinationMatrix[4] = (sourceE * localA) + (sourceF * localC) + localE; - destinationMatrix[5] = (sourceE * localB) + (sourceF * localD) + localF; - - return destinationMatrix; - }, - - /** - * Multiply this Matrix by the matrix given, including the offset. - * - * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`. - * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`. - * - * @method Phaser.GameObjects.Components.TransformMatrix#multiplyWithOffset - * @since 3.11.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from. - * @param {number} offsetX - Horizontal offset to factor in to the multiplication. - * @param {number} offsetY - Vertical offset to factor in to the multiplication. - * - * @return {this} This TransformMatrix. - */ - multiplyWithOffset: function (src, offsetX, offsetY) - { - var matrix = this.matrix; - var otherMatrix = src.matrix; - - var a0 = matrix[0]; - var b0 = matrix[1]; - var c0 = matrix[2]; - var d0 = matrix[3]; - var tx0 = matrix[4]; - var ty0 = matrix[5]; - - var pse = offsetX * a0 + offsetY * c0 + tx0; - var psf = offsetX * b0 + offsetY * d0 + ty0; - - var a1 = otherMatrix[0]; - var b1 = otherMatrix[1]; - var c1 = otherMatrix[2]; - var d1 = otherMatrix[3]; - var tx1 = otherMatrix[4]; - var ty1 = otherMatrix[5]; - - matrix[0] = a1 * a0 + b1 * c0; - matrix[1] = a1 * b0 + b1 * d0; - matrix[2] = c1 * a0 + d1 * c0; - matrix[3] = c1 * b0 + d1 * d0; - matrix[4] = tx1 * a0 + ty1 * c0 + pse; - matrix[5] = tx1 * b0 + ty1 * d0 + psf; - - return this; - }, - - /** - * Transform the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#transform - * @since 3.0.0 - * - * @param {number} a - The Scale X value. - * @param {number} b - The Shear Y value. - * @param {number} c - The Shear X value. - * @param {number} d - The Scale Y value. - * @param {number} tx - The Translate X value. - * @param {number} ty - The Translate Y value. - * - * @return {this} This TransformMatrix. - */ - transform: function (a, b, c, d, tx, ty) - { - var matrix = this.matrix; - - var a0 = matrix[0]; - var b0 = matrix[1]; - var c0 = matrix[2]; - var d0 = matrix[3]; - var tx0 = matrix[4]; - var ty0 = matrix[5]; - - matrix[0] = a * a0 + b * c0; - matrix[1] = a * b0 + b * d0; - matrix[2] = c * a0 + d * c0; - matrix[3] = c * b0 + d * d0; - matrix[4] = tx * a0 + ty * c0 + tx0; - matrix[5] = tx * b0 + ty * d0 + ty0; - - return this; - }, - - /** - * Transform a point in to the local space of this Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint - * @since 3.0.0 - * - * @param {number} x - The x coordinate of the point to transform. - * @param {number} y - The y coordinate of the point to transform. - * @param {Phaser.Types.Math.Vector2Like} [point] - Optional Point object to store the transformed coordinates in. - * - * @return {Phaser.Types.Math.Vector2Like} The Point containing the transformed coordinates. - */ - transformPoint: function (x, y, point) - { - if (point === undefined) { point = { x: 0, y: 0 }; } - - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - var tx = matrix[4]; - var ty = matrix[5]; - - point.x = x * a + y * c + tx; - point.y = x * b + y * d + ty; - - return point; - }, - - /** - * Invert the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#invert - * @since 3.0.0 - * - * @return {this} This TransformMatrix. - */ - invert: function () - { - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - var tx = matrix[4]; - var ty = matrix[5]; - - var n = a * d - b * c; - - matrix[0] = d / n; - matrix[1] = -b / n; - matrix[2] = -c / n; - matrix[3] = a / n; - matrix[4] = (c * ty - d * tx) / n; - matrix[5] = -(a * ty - b * tx) / n; - - return this; - }, - - /** - * Set the values of this Matrix to copy those of the matrix given. - * - * @method Phaser.GameObjects.Components.TransformMatrix#copyFrom - * @since 3.11.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from. - * - * @return {this} This TransformMatrix. - */ - copyFrom: function (src) - { - var matrix = this.matrix; - - matrix[0] = src.a; - matrix[1] = src.b; - matrix[2] = src.c; - matrix[3] = src.d; - matrix[4] = src.e; - matrix[5] = src.f; - - return this; - }, - - /** - * Set the values of this Matrix to copy those of the array given. - * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. - * - * @method Phaser.GameObjects.Components.TransformMatrix#copyFromArray - * @since 3.11.0 - * - * @param {array} src - The array of values to set into this matrix. - * - * @return {this} This TransformMatrix. - */ - copyFromArray: function (src) - { - var matrix = this.matrix; - - matrix[0] = src[0]; - matrix[1] = src[1]; - matrix[2] = src[2]; - matrix[3] = src[3]; - matrix[4] = src[4]; - matrix[5] = src[5]; - - return this; - }, - - /** - * Copy the values from this Matrix to the given Canvas Rendering Context. - * This will use the Context.transform method. - * - * @method Phaser.GameObjects.Components.TransformMatrix#copyToContext - * @since 3.12.0 - * - * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to. - * - * @return {CanvasRenderingContext2D} The Canvas Rendering Context. - */ - copyToContext: function (ctx) - { - var matrix = this.matrix; - - ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); - - return ctx; - }, - - /** - * Copy the values from this Matrix to the given Canvas Rendering Context. - * This will use the Context.setTransform method. - * - * @method Phaser.GameObjects.Components.TransformMatrix#setToContext - * @since 3.12.0 - * - * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to. - * - * @return {CanvasRenderingContext2D} The Canvas Rendering Context. - */ - setToContext: function (ctx) - { - var matrix = this.matrix; - - ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); - - return ctx; - }, - - /** - * Copy the values in this Matrix to the array given. - * - * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. - * - * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray - * @since 3.12.0 - * - * @param {array} [out] - The array to copy the matrix values in to. - * - * @return {array} An array where elements 0 to 5 contain the values from this matrix. - */ - copyToArray: function (out) - { - var matrix = this.matrix; - - if (out === undefined) - { - out = [ matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] ]; - } - else - { - out[0] = matrix[0]; - out[1] = matrix[1]; - out[2] = matrix[2]; - out[3] = matrix[3]; - out[4] = matrix[4]; - out[5] = matrix[5]; - } - - return out; - }, - - /** - * Set the values of this Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#setTransform - * @since 3.0.0 - * - * @param {number} a - The Scale X value. - * @param {number} b - The Shear Y value. - * @param {number} c - The Shear X value. - * @param {number} d - The Scale Y value. - * @param {number} tx - The Translate X value. - * @param {number} ty - The Translate Y value. - * - * @return {this} This TransformMatrix. - */ - setTransform: function (a, b, c, d, tx, ty) - { - var matrix = this.matrix; - - matrix[0] = a; - matrix[1] = b; - matrix[2] = c; - matrix[3] = d; - matrix[4] = tx; - matrix[5] = ty; - - return this; - }, - - /** - * Decompose this Matrix into its translation, scale and rotation values using QR decomposition. - * - * The result must be applied in the following order to reproduce the current matrix: - * - * translate -> rotate -> scale - * - * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix - * @since 3.0.0 - * - * @return {object} The decomposed Matrix. - */ - decomposeMatrix: function () - { - var decomposedMatrix = this.decomposedMatrix; - - var matrix = this.matrix; - - // a = scale X (1) - // b = shear Y (0) - // c = shear X (0) - // d = scale Y (1) - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - - var determ = a * d - b * c; - - decomposedMatrix.translateX = matrix[4]; - decomposedMatrix.translateY = matrix[5]; - - if (a || b) - { - var r = Math.sqrt(a * a + b * b); - - decomposedMatrix.rotation = (b > 0) ? Math.acos(a / r) : -Math.acos(a / r); - decomposedMatrix.scaleX = r; - decomposedMatrix.scaleY = determ / r; - } - else if (c || d) - { - var s = Math.sqrt(c * c + d * d); - - decomposedMatrix.rotation = Math.PI * 0.5 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s)); - decomposedMatrix.scaleX = determ / s; - decomposedMatrix.scaleY = s; - } - else - { - decomposedMatrix.rotation = 0; - decomposedMatrix.scaleX = 0; - decomposedMatrix.scaleY = 0; - } - - return decomposedMatrix; - }, - - /** - * Apply the identity, translate, rotate and scale operations on the Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#applyITRS - * @since 3.0.0 - * - * @param {number} x - The horizontal translation. - * @param {number} y - The vertical translation. - * @param {number} rotation - The angle of rotation in radians. - * @param {number} scaleX - The horizontal scale. - * @param {number} scaleY - The vertical scale. - * - * @return {this} This TransformMatrix. - */ - applyITRS: function (x, y, rotation, scaleX, scaleY) - { - var matrix = this.matrix; - - var radianSin = Math.sin(rotation); - var radianCos = Math.cos(rotation); - - // Translate - matrix[4] = x; - matrix[5] = y; - - // Rotate and Scale - matrix[0] = radianCos * scaleX; - matrix[1] = radianSin * scaleX; - matrix[2] = -radianSin * scaleY; - matrix[3] = radianCos * scaleY; - - return this; - }, - - /** - * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of - * the current matrix with its transformation applied. - * - * Can be used to translate points from world to local space. - * - * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse - * @since 3.12.0 - * - * @param {number} x - The x position to translate. - * @param {number} y - The y position to translate. - * @param {Phaser.Math.Vector2} [output] - A Vector2, or point-like object, to store the results in. - * - * @return {Phaser.Math.Vector2} The coordinates, inverse-transformed through this matrix. - */ - applyInverse: function (x, y, output) - { - if (output === undefined) { output = new Vector2(); } - - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - var tx = matrix[4]; - var ty = matrix[5]; - - var id = 1 / ((a * d) + (c * -b)); - - output.x = (d * id * x) + (-c * id * y) + (((ty * c) - (tx * d)) * id); - output.y = (a * id * y) + (-b * id * x) + (((-ty * a) + (tx * b)) * id); - - return output; - }, - - /** - * Performs the 8 calculations required to create the vertices of - * a quad based on this matrix and the given x/y/xw/yh values. - * - * The result is stored in `TransformMatrix.quad`, which is returned - * from this method. - * - * @method Phaser.GameObjects.Components.TransformMatrix#setQuad - * @since 3.60.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {number} xw - The xw value. - * @param {number} yh - The yh value. - * @param {boolean} roundPixels - Pass the results via Math.round? - * @param {Float32Array} [quad] - Optional Float32Array to store the results in. Otherwises uses the local quad array. - * - * @return {Float32Array} The quad Float32Array. - */ - setQuad: function (x, y, xw, yh, roundPixels, quad) - { - if (quad === undefined) { quad = this.quad; } - - var matrix = this.matrix; - - var a = matrix[0]; - var b = matrix[1]; - var c = matrix[2]; - var d = matrix[3]; - var e = matrix[4]; - var f = matrix[5]; - - quad[0] = x * a + y * c + e; - quad[1] = x * b + y * d + f; - - quad[2] = x * a + yh * c + e; - quad[3] = x * b + yh * d + f; - - quad[4] = xw * a + yh * c + e; - quad[5] = xw * b + yh * d + f; - - quad[6] = xw * a + y * c + e; - quad[7] = xw * b + y * d + f; - - if (roundPixels) - { - quad.forEach(function (value, index) - { - quad[index] = Math.round(value); - }); - } - - return quad; - }, - - /** - * Returns the X component of this matrix multiplied by the given values. - * This is the same as `x * a + y * c + e`. - * - * @method Phaser.GameObjects.Components.TransformMatrix#getX - * @since 3.12.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * - * @return {number} The calculated x value. - */ - getX: function (x, y) - { - return x * this.a + y * this.c + this.e; - }, - - /** - * Returns the Y component of this matrix multiplied by the given values. - * This is the same as `x * b + y * d + f`. - * - * @method Phaser.GameObjects.Components.TransformMatrix#getY - * @since 3.12.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * - * @return {number} The calculated y value. - */ - getY: function (x, y) - { - return x * this.b + y * this.d + this.f; - }, - - /** - * Returns the X component of this matrix multiplied by the given values. - * - * This is the same as `x * a + y * c + e`, optionally passing via `Math.round`. - * - * @method Phaser.GameObjects.Components.TransformMatrix#getXRound - * @since 3.50.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {boolean} [round=false] - Math.round the resulting value? - * - * @return {number} The calculated x value. - */ - getXRound: function (x, y, round) - { - var v = this.getX(x, y); - - if (round) - { - v = Math.round(v); - } - - return v; - }, - - /** - * Returns the Y component of this matrix multiplied by the given values. - * - * This is the same as `x * b + y * d + f`, optionally passing via `Math.round`. - * - * @method Phaser.GameObjects.Components.TransformMatrix#getYRound - * @since 3.50.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {boolean} [round=false] - Math.round the resulting value? - * - * @return {number} The calculated y value. - */ - getYRound: function (x, y, round) - { - var v = this.getY(x, y); - - if (round) - { - v = Math.round(v); - } - - return v; - }, - - /** - * Returns a string that can be used in a CSS Transform call as a `matrix` property. - * - * @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix - * @since 3.12.0 - * - * @return {string} A string containing the CSS Transform matrix values. - */ - getCSSMatrix: function () - { - var m = this.matrix; - - return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')'; - }, - - /** - * Destroys this Transform Matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#destroy - * @since 3.4.0 - */ - destroy: function () - { - this.matrix = null; - this.quad = null; - this.decomposedMatrix = null; +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; } -}); - -module.exports = TransformMatrix; - - -/***/ }), -/* 27 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if an array can be used as a matrix. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.CheckMatrix - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix] - * - * @param {T[][]} [matrix] - The array to check. - * - * @return {boolean} `true` if the given `matrix` array is a valid matrix. - */ -var CheckMatrix = function (matrix) -{ - if (!Array.isArray(matrix) || !Array.isArray(matrix[0])) - { - return false; + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; } - // How long is the first row? - var size = matrix[0].length; + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; - // Validate the rest of the rows are the same length - for (var i = 1; i < matrix.length; i++) - { - if (matrix[i].length !== size) - { - return false; - } + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } } + } - return true; + return true; }; -module.exports = CheckMatrix; - - -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process) {/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - /** - * Determines the operating system of the device running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.os` from within any Scene. + * Add a listener for a given event. * - * @typedef {object} Phaser.Device.OS - * @since 3.0.0 - * - * @property {boolean} android - Is running on android? - * @property {boolean} chromeOS - Is running on chromeOS? - * @property {boolean} cordova - Is the game running under Apache Cordova? - * @property {boolean} crosswalk - Is the game running under the Intel Crosswalk XDK? - * @property {boolean} desktop - Is running on a desktop? - * @property {boolean} ejecta - Is the game running under Ejecta? - * @property {boolean} electron - Is the game running under GitHub Electron? - * @property {boolean} iOS - Is running on iOS? - * @property {boolean} iPad - Is running on iPad? - * @property {boolean} iPhone - Is running on iPhone? - * @property {boolean} kindle - Is running on an Amazon Kindle? - * @property {boolean} linux - Is running on linux? - * @property {boolean} macOS - Is running on macOS? - * @property {boolean} node - Is the game running under Node.js? - * @property {boolean} nodeWebkit - Is the game running under Node-Webkit? - * @property {boolean} webApp - Set to true if running as a WebApp, i.e. within a WebView - * @property {boolean} windows - Is running on windows? - * @property {boolean} windowsPhone - Is running on a Windows Phone? - * @property {number} iOSVersion - If running in iOS this will contain the major version number. - * @property {number} pixelRatio - PixelRatio of the host device? + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public */ -var OS = { - - android: false, - chromeOS: false, - cordova: false, - crosswalk: false, - desktop: false, - ejecta: false, - electron: false, - iOS: false, - iOSVersion: 0, - iPad: false, - iPhone: false, - kindle: false, - linux: false, - macOS: false, - node: false, - nodeWebkit: false, - pixelRatio: 1, - webApp: false, - windows: false, - windowsPhone: false - +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); }; -function init () -{ - if (typeof importScripts === 'function') - { - return OS; +/** + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); +}; + +/** + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } } - var ua = navigator.userAgent; + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } - if ((/Windows/).test(ua)) - { - OS.windows = true; - } - else if ((/Mac OS/).test(ua) && !((/like Mac OS/).test(ua))) - { - // Because iOS 13 identifies as Mac OS: - if (navigator.maxTouchPoints && navigator.maxTouchPoints > 2) - { - OS.iOS = true; - OS.iPad = true; + return this; +}; - (navigator.appVersion).match(/Version\/(\d+)/); +/** + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; - OS.iOSVersion = parseInt(RegExp.$1, 10); - } - else - { - OS.macOS = true; - } - } - else if ((/Android/).test(ua)) - { - OS.android = true; - } - else if ((/Linux/).test(ua)) - { - OS.linux = true; - } - else if ((/iP[ao]d|iPhone/i).test(ua)) - { - OS.iOS = true; + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } - (navigator.appVersion).match(/OS (\d+)/); + return this; +}; - OS.iOSVersion = parseInt(RegExp.$1, 10); +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; - OS.iPhone = ua.toLowerCase().indexOf('iphone') !== -1; - OS.iPad = ua.toLowerCase().indexOf('ipad') !== -1; - } - else if ((/Kindle/).test(ua) || (/\bKF[A-Z][A-Z]+/).test(ua) || (/Silk.*Mobile Safari/).test(ua)) - { - OS.kindle = true; +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; - // This will NOT detect early generations of Kindle Fire, I think there is no reliable way... - // E.g. "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true" - } - else if ((/CrOS/).test(ua)) - { - OS.chromeOS = true; - } +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; - if ((/Windows Phone/i).test(ua) || (/IEMobile/i).test(ua)) - { - OS.android = false; - OS.iOS = false; - OS.macOS = false; - OS.windows = true; - OS.windowsPhone = true; - } - - var silk = (/Silk/).test(ua); - - if (OS.windows || OS.macOS || (OS.linux && !silk) || OS.chromeOS) - { - OS.desktop = true; - } - - // Windows Phone / Table reset - if (OS.windowsPhone || (((/Windows NT/i).test(ua)) && ((/Touch/i).test(ua)))) - { - OS.desktop = false; - } - - // WebApp mode in iOS - if (navigator.standalone) - { - OS.webApp = true; - } - - if (typeof importScripts !== 'function') - { - if (window.cordova !== undefined) - { - OS.cordova = true; - } - - if (window.ejecta !== undefined) - { - OS.ejecta = true; - } - } - - if (typeof process !== 'undefined' && process.versions && process.versions.node) - { - OS.node = true; - } - - if (OS.node && typeof process.versions === 'object') - { - OS.nodeWebkit = !!process.versions['node-webkit']; - - OS.electron = !!process.versions.electron; - } - - if ((/Crosswalk/).test(ua)) - { - OS.crosswalk = true; - } - - OS.pixelRatio = window['devicePixelRatio'] || 1; - - return OS; +// +// Expose the module. +// +if (true) { + module.exports = EventEmitter; } -module.exports = init(); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(300))) /***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Contains = __webpack_require__(318); -var GetPoint = __webpack_require__(67); -var GetPoints = __webpack_require__(319); -var GEOM_CONST = __webpack_require__(30); -var Line = __webpack_require__(320); -var Random = __webpack_require__(325); - -/** - * @classdesc - * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height) - * - * @class Rectangle - * @memberof Phaser.Geom - * @constructor - * @since 3.0.0 - * - * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. - * @param {number} [width=0] - The width of the Rectangle. - * @param {number} [height=0] - The height of the Rectangle. - */ -var Rectangle = new Class({ - - initialize: - - function Rectangle (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = 0; } - if (height === undefined) { height = 0; } - - /** - * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. - * Used for fast type comparisons. - * - * @name Phaser.Geom.Rectangle#type - * @type {number} - * @readonly - * @since 3.19.0 - */ - this.type = GEOM_CONST.RECTANGLE; - - /** - * The X coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = x; - - /** - * The Y coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = y; - - /** - * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. - * - * @name Phaser.Geom.Rectangle#width - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.width = width; - - /** - * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. - * - * @name Phaser.Geom.Rectangle#height - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.height = height; - }, - - /** - * Checks if the given point is inside the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#contains - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. - * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ - contains: function (x, y) - { - return Contains(this, x, y); - }, - - /** - * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * - * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * - * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. - * - * @method Phaser.Geom.Rectangle#getPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [output,$return] - * - * @param {number} position - The normalized distance into the Rectangle's perimeter to return. - * @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point. - * - * @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given. - */ - getPoint: function (position, output) - { - return GetPoint(this, position, output); - }, - - /** - * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. - * - * @method Phaser.Geom.Rectangle#getPoints - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point[]} O - [output,$return] - * - * @param {number} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. - * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. - * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points. - * - * @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided. - */ - getPoints: function (quantity, stepRate, output) - { - return GetPoints(this, quantity, stepRate, output); - }, - - /** - * Returns a random point within the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#getRandomPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [point,$return] - * - * @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point. - * - * @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided. - */ - getRandomPoint: function (point) - { - return Random(this, point); - }, - - /** - * Sets the position, width, and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setTo - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} y - The Y coordinate of the top left corner of the Rectangle. - * @param {number} width - The width of the Rectangle. - * @param {number} height - The height of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setTo: function (x, y, width, height) - { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - - return this; - }, - - /** - * Resets the position, width, and height of the Rectangle to 0. - * - * @method Phaser.Geom.Rectangle#setEmpty - * @since 3.0.0 - * - * @return {this} This Rectangle object. - */ - setEmpty: function () - { - return this.setTo(0, 0, 0, 0); - }, - - /** - * Sets the position of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setPosition - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setPosition: function (x, y) - { - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - }, - - /** - * Sets the width and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setSize - * @since 3.0.0 - * - * @param {number} width - The width to set the Rectangle to. - * @param {number} [height=width] - The height to set the Rectangle to. - * - * @return {this} This Rectangle object. - */ - setSize: function (width, height) - { - if (height === undefined) { height = width; } - - this.width = width; - this.height = height; - - return this; - }, - - /** - * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. - * - * @method Phaser.Geom.Rectangle#isEmpty - * @since 3.0.0 - * - * @return {boolean} `true` if the Rectangle is empty. A Rectangle object is empty if its width or height is less than or equal to 0. - */ - isEmpty: function () - { - return (this.width <= 0 || this.height <= 0); - }, - - /** - * Returns a Line object that corresponds to the top of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineA - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle. - */ - getLineA: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.y, this.right, this.y); - - return line; - }, - - /** - * Returns a Line object that corresponds to the right of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineB - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle. - */ - getLineB: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.y, this.right, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the bottom of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineC - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle. - */ - getLineC: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.bottom, this.x, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the left of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineD - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle. - */ - getLineD: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.bottom, this.x, this.y); - - return line; - }, - - /** - * The x coordinate of the left of the Rectangle. - * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. - * - * @name Phaser.Geom.Rectangle#left - * @type {number} - * @since 3.0.0 - */ - left: { - - get: function () - { - return this.x; - }, - - set: function (value) - { - if (value >= this.right) - { - this.width = 0; - } - else - { - this.width = this.right - value; - } - - this.x = value; - } - - }, - - /** - * The sum of the x and width properties. - * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. - * - * @name Phaser.Geom.Rectangle#right - * @type {number} - * @since 3.0.0 - */ - right: { - - get: function () - { - return this.x + this.width; - }, - - set: function (value) - { - if (value <= this.x) - { - this.width = 0; - } - else - { - this.width = value - this.x; - } - } - - }, - - /** - * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. - * However it does affect the height property, whereas changing the y value does not affect the height property. - * - * @name Phaser.Geom.Rectangle#top - * @type {number} - * @since 3.0.0 - */ - top: { - - get: function () - { - return this.y; - }, - - set: function (value) - { - if (value >= this.bottom) - { - this.height = 0; - } - else - { - this.height = (this.bottom - value); - } - - this.y = value; - } - - }, - - /** - * The sum of the y and height properties. - * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. - * - * @name Phaser.Geom.Rectangle#bottom - * @type {number} - * @since 3.0.0 - */ - bottom: { - - get: function () - { - return this.y + this.height; - }, - - set: function (value) - { - if (value <= this.y) - { - this.height = 0; - } - else - { - this.height = value - this.y; - } - } - - }, - - /** - * The x coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerX - * @type {number} - * @since 3.0.0 - */ - centerX: { - - get: function () - { - return this.x + (this.width / 2); - }, - - set: function (value) - { - this.x = value - (this.width / 2); - } - - }, - - /** - * The y coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerY - * @type {number} - * @since 3.0.0 - */ - centerY: { - - get: function () - { - return this.y + (this.height / 2); - }, - - set: function (value) - { - this.y = value - (this.height / 2); - } - - } - -}); - -module.exports = Rectangle; - - -/***/ }), -/* 30 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GEOM_CONST = { - - /** - * A Circle Geometry object type. - * - * @name Phaser.Geom.CIRCLE - * @type {number} - * @since 3.19.0 - */ - CIRCLE: 0, - - /** - * An Ellipse Geometry object type. - * - * @name Phaser.Geom.ELLIPSE - * @type {number} - * @since 3.19.0 - */ - ELLIPSE: 1, - - /** - * A Line Geometry object type. - * - * @name Phaser.Geom.LINE - * @type {number} - * @since 3.19.0 - */ - LINE: 2, - - /** - * A Point Geometry object type. - * - * @name Phaser.Geom.POINT - * @type {number} - * @since 3.19.0 - */ - POINT: 3, - - /** - * A Polygon Geometry object type. - * - * @name Phaser.Geom.POLYGON - * @type {number} - * @since 3.19.0 - */ - POLYGON: 4, - - /** - * A Rectangle Geometry object type. - * - * @name Phaser.Geom.RECTANGLE - * @type {number} - * @since 3.19.0 - */ - RECTANGLE: 5, - - /** - * A Triangle Geometry object type. - * - * @name Phaser.Geom.TRIANGLE - * @type {number} - * @since 3.19.0 - */ - TRIANGLE: 6 - -}; - -module.exports = GEOM_CONST; - - -/***/ }), -/* 31 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Find the angle of a segment from (x1, y1) -> (x2, y2). - * - * @function Phaser.Math.Angle.Between - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The angle in radians. - */ -var Between = function (x1, y1, x2, y2) -{ - return Math.atan2(y2 - y1, x2 - x1); -}; - -module.exports = Between; - - -/***/ }), -/* 32 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Normalize an angle to the [0, 2pi] range. - * - * @function Phaser.Math.Angle.Normalize - * @since 3.0.0 - * - * @param {number} angle - The angle to normalize, in radians. - * - * @return {number} The normalized angle, in radians. - */ -var Normalize = function (angle) -{ - angle = angle % (2 * Math.PI); - - if (angle >= 0) - { - return angle; - } - else - { - return angle + 2 * Math.PI; - } -}; - -module.exports = Normalize; - - -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MathWrap = __webpack_require__(7); - -/** - * Wrap an angle. - * - * Wraps the angle to a value in the range of -PI to PI. - * - * @function Phaser.Math.Angle.Wrap - * @since 3.0.0 - * - * @param {number} angle - The angle to wrap, in radians. - * - * @return {number} The wrapped angle, in radians. - */ -var Wrap = function (angle) -{ - return MathWrap(angle, -Math.PI, Math.PI); -}; - -module.exports = Wrap; - - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Wrap = __webpack_require__(7); - -/** - * Wrap an angle in degrees. - * - * Wraps the angle to a value in the range of -180 to 180. - * - * @function Phaser.Math.Angle.WrapDegrees - * @since 3.0.0 - * - * @param {number} angle - The angle to wrap, in degrees. - * - * @return {number} The wrapped angle, in degrees. - */ -var WrapDegrees = function (angle) -{ - return Wrap(angle, -180, 180); -}; - -module.exports = WrapDegrees; - - -/***/ }), -/* 35 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check whether the given values are fuzzily equal. - * - * Two numbers are fuzzily equal if their difference is less than `epsilon`. - * - * @function Phaser.Math.Fuzzy.Equal - * @since 3.0.0 - * - * @param {number} a - The first value. - * @param {number} b - The second value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`. - */ -var Equal = function (a, b, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return Math.abs(a - b) < epsilon; -}; - -module.exports = Equal; - - -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Factorial = __webpack_require__(37); - -/** - * Calculates the Bernstein basis from the three factorial coefficients. - * - * @function Phaser.Math.Bernstein - * @since 3.0.0 - * - * @param {number} n - The first value. - * @param {number} i - The second value. - * - * @return {number} The Bernstein basis of Factorial(n) / Factorial(i) / Factorial(n - i) - */ -var Bernstein = function (n, i) -{ - return Factorial(n) / Factorial(i) / Factorial(n - i); -}; - -module.exports = Bernstein; - - -/***/ }), -/* 37 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates the factorial of a given number for integer values greater than 0. - * - * @function Phaser.Math.Factorial - * @since 3.0.0 - * - * @param {number} value - A positive integer to calculate the factorial of. - * - * @return {number} The factorial of the given number. - */ -var Factorial = function (value) -{ - if (value === 0) - { - return 1; - } - - var res = value; - - while (--value) - { - res *= value; - } - - return res; -}; - -module.exports = Factorial; - - -/***/ }), -/* 38 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates a Catmull-Rom value from the given points, based on an alpha of 0.5. - * - * @function Phaser.Math.CatmullRom - * @since 3.0.0 - * - * @param {number} t - The amount to interpolate by. - * @param {number} p0 - The first control point. - * @param {number} p1 - The second control point. - * @param {number} p2 - The third control point. - * @param {number} p3 - The fourth control point. - * - * @return {number} The Catmull-Rom value. - */ -var CatmullRom = function (t, p0, p1, p2, p3) -{ - var v0 = (p2 - p0) * 0.5; - var v1 = (p3 - p1) * 0.5; - var t2 = t * t; - var t3 = t * t2; - - return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1; -}; - -module.exports = CatmullRom; - - -/***/ }), -/* 39 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates a linear (interpolation) value over t. - * - * @function Phaser.Math.Linear - * @since 3.0.0 - * - * @param {number} p0 - The first point. - * @param {number} p1 - The second point. - * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1. - * - * @return {number} The step t% of the way between p0 and p1. - */ -var Linear = function (p0, p1, t) -{ - return (p1 - p0) * t + p0; -}; - -module.exports = Linear; - - -/***/ }), -/* 40 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate a smooth interpolation percentage of `x` between `min` and `max`. - * - * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, - * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, - * between 0 and 1 otherwise. - * - * @function Phaser.Math.SmoothStep - * @since 3.0.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep} - * - * @param {number} x - The input value. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The percentage of interpolation, between 0 and 1. - */ -var SmoothStep = function (x, min, max) -{ - if (x <= min) - { - return 0; - } - - if (x >= max) - { - return 1; - } - - x = (x - min) / (max - min); - - return x * x * (3 - 2 * x); -}; - -module.exports = SmoothStep; - - -/***/ }), -/* 41 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate a smoother interpolation percentage of `x` between `min` and `max`. - * - * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, - * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, - * between 0 and 1 otherwise. - * - * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}. - * - * @function Phaser.Math.SmootherStep - * @since 3.0.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} - * - * @param {number} x - The input value. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The percentage of interpolation, between 0 and 1. - */ -var SmootherStep = function (x, min, max) -{ - x = Math.max(0, Math.min(1, (x - min) / (max - min))); - - return x * x * x * (x * (x * 6 - 15) + 10); -}; - -module.exports = SmootherStep; - - -/***/ }), -/* 42 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotate a `point` around `x` and `y` to the given `angle`, at the same distance. - * - * In polar notation, this maps a point from (r, t) to (r, angle), vs. the origin (x, y). - * - * @function Phaser.Math.RotateAround - * @since 3.0.0 - * - * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] - * - * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. - * @param {number} x - The horizontal coordinate to rotate around. - * @param {number} y - The vertical coordinate to rotate around. - * @param {number} angle - The angle of rotation in radians. - * - * @return {Phaser.Types.Math.Vector2Like} The given point. - */ -var RotateAround = function (point, x, y, angle) -{ - var c = Math.cos(angle); - var s = Math.sin(angle); - - var tx = point.x - x; - var ty = point.y - y; - - point.x = tx * c - ty * s + x; - point.y = tx * s + ty * c + y; - - return point; -}; - -module.exports = RotateAround; - - -/***/ }), -/* 43 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down. - * - * @function Phaser.Math.RoundAwayFromZero - * @since 3.0.0 - * - * @param {number} value - The number to round. - * - * @return {number} The rounded number, rounded away from zero. - */ -var RoundAwayFromZero = function (value) -{ - // "Opposite" of truncate. - return (value > 0) ? Math.ceil(value) : Math.floor(value); -}; - -module.exports = RoundAwayFromZero; - - -/***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Vector2 = __webpack_require__(3); - -/** - * Takes the `x` and `y` coordinates and transforms them into the same space as - * defined by the position, rotation and scale values. - * - * @function Phaser.Math.TransformXY - * @since 3.0.0 - * - * @param {number} x - The x coordinate to be transformed. - * @param {number} y - The y coordinate to be transformed. - * @param {number} positionX - Horizontal position of the transform point. - * @param {number} positionY - Vertical position of the transform point. - * @param {number} rotation - Rotation of the transform point, in radians. - * @param {number} scaleX - Horizontal scale of the transform point. - * @param {number} scaleY - Vertical scale of the transform point. - * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates. - * - * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point. - */ -var TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output) -{ - if (output === undefined) { output = new Vector2(); } - - var radianSin = Math.sin(rotation); - var radianCos = Math.cos(rotation); - - // Rotate and Scale - var a = radianCos * scaleX; - var b = radianSin * scaleX; - var c = -radianSin * scaleY; - var d = radianCos * scaleY; - - // Invert - var id = 1 / ((a * d) + (c * -b)); - - output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id); - output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id); - - return output; -}; - -module.exports = TransformXY; - - -/***/ }), -/* 45 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A three-dimensional matrix. - * - * Defaults to the identity matrix when instantiated. - * - * @class Matrix3 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from. - */ -var Matrix3 = new Class({ - - initialize: - - function Matrix3 (m) - { - /** - * The matrix values. - * - * @name Phaser.Math.Matrix3#val - * @type {Float32Array} - * @since 3.0.0 - */ - this.val = new Float32Array(9); - - if (m) - { - // Assume Matrix3 with val: - this.copy(m); - } - else - { - // Default to identity - this.identity(); - } - }, - - /** - * Make a clone of this Matrix3. - * - * @method Phaser.Math.Matrix3#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} A clone of this Matrix3. - */ - clone: function () - { - return new Matrix3(this); - }, - - /** - * This method is an alias for `Matrix3.copy`. - * - * @method Phaser.Math.Matrix3#set - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - set: function (src) - { - return this.copy(src); - }, - - /** - * Copy the values of a given Matrix into this Matrix. - * - * @method Phaser.Math.Matrix3#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - copy: function (src) - { - var out = this.val; - var a = src.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - - return this; - }, - - /** - * Copy the values of a given Matrix4 into this Matrix3. - * - * @method Phaser.Math.Matrix3#fromMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - fromMat4: function (m) - { - var a = m.val; - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[4]; - out[4] = a[5]; - out[5] = a[6]; - out[6] = a[8]; - out[7] = a[9]; - out[8] = a[10]; - - return this; - }, - - /** - * Set the values of this Matrix from the given array. - * - * @method Phaser.Math.Matrix3#fromArray - * @since 3.0.0 - * - * @param {array} a - The array to copy the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - fromArray: function (a) - { - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - - return this; - }, - - /** - * Reset this Matrix to an identity (default) matrix. - * - * @method Phaser.Math.Matrix3#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - identity: function () - { - var out = this.val; - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 1; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - - return this; - }, - - /** - * Transpose this Matrix. - * - * @method Phaser.Math.Matrix3#transpose - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - transpose: function () - { - var a = this.val; - var a01 = a[1]; - var a02 = a[2]; - var a12 = a[5]; - - a[1] = a[3]; - a[2] = a[6]; - a[3] = a01; - a[5] = a[7]; - a[6] = a02; - a[7] = a12; - - return this; - }, - - /** - * Invert this Matrix. - * - * @method Phaser.Math.Matrix3#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - invert: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - var b01 = a22 * a11 - a12 * a21; - var b11 = -a22 * a10 + a12 * a20; - var b21 = a21 * a10 - a11 * a20; - - // Calculate the determinant - var det = a00 * b01 + a01 * b11 + a02 * b21; - - if (!det) - { - return null; - } - - det = 1 / det; - - a[0] = b01 * det; - a[1] = (-a22 * a01 + a02 * a21) * det; - a[2] = (a12 * a01 - a02 * a11) * det; - a[3] = b11 * det; - a[4] = (a22 * a00 - a02 * a20) * det; - a[5] = (-a12 * a00 + a02 * a10) * det; - a[6] = b21 * det; - a[7] = (-a21 * a00 + a01 * a20) * det; - a[8] = (a11 * a00 - a01 * a10) * det; - - return this; - }, - - /** - * Calculate the adjoint, or adjugate, of this Matrix. - * - * @method Phaser.Math.Matrix3#adjoint - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - adjoint: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - a[0] = (a11 * a22 - a12 * a21); - a[1] = (a02 * a21 - a01 * a22); - a[2] = (a01 * a12 - a02 * a11); - a[3] = (a12 * a20 - a10 * a22); - a[4] = (a00 * a22 - a02 * a20); - a[5] = (a02 * a10 - a00 * a12); - a[6] = (a10 * a21 - a11 * a20); - a[7] = (a01 * a20 - a00 * a21); - a[8] = (a00 * a11 - a01 * a10); - - return this; - }, - - /** - * Calculate the determinant of this Matrix. - * - * @method Phaser.Math.Matrix3#determinant - * @since 3.0.0 - * - * @return {number} The determinant of this Matrix. - */ - determinant: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * @method Phaser.Math.Matrix3#multiply - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - multiply: function (src) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - var b = src.val; - - var b00 = b[0]; - var b01 = b[1]; - var b02 = b[2]; - var b10 = b[3]; - var b11 = b[4]; - var b12 = b[5]; - var b20 = b[6]; - var b21 = b[7]; - var b22 = b[8]; - - a[0] = b00 * a00 + b01 * a10 + b02 * a20; - a[1] = b00 * a01 + b01 * a11 + b02 * a21; - a[2] = b00 * a02 + b01 * a12 + b02 * a22; - - a[3] = b10 * a00 + b11 * a10 + b12 * a20; - a[4] = b10 * a01 + b11 * a11 + b12 * a21; - a[5] = b10 * a02 + b11 * a12 + b12 * a22; - - a[6] = b20 * a00 + b21 * a10 + b22 * a20; - a[7] = b20 * a01 + b21 * a11 + b22 * a21; - a[8] = b20 * a02 + b21 * a12 + b22 * a22; - - return this; - }, - - /** - * Translate this Matrix using the given Vector. - * - * @method Phaser.Math.Matrix3#translate - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - translate: function (v) - { - var a = this.val; - var x = v.x; - var y = v.y; - - a[6] = x * a[0] + y * a[3] + a[6]; - a[7] = x * a[1] + y * a[4] + a[7]; - a[8] = x * a[2] + y * a[5] + a[8]; - - return this; - }, - - /** - * Apply a rotation transformation to this Matrix. - * - * @method Phaser.Math.Matrix3#rotate - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - rotate: function (rad) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - - var s = Math.sin(rad); - var c = Math.cos(rad); - - a[0] = c * a00 + s * a10; - a[1] = c * a01 + s * a11; - a[2] = c * a02 + s * a12; - - a[3] = c * a10 - s * a00; - a[4] = c * a11 - s * a01; - a[5] = c * a12 - s * a02; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * Uses the `x` and `y` components of the given Vector to scale the Matrix. - * - * @method Phaser.Math.Matrix3#scale - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - scale: function (v) - { - var a = this.val; - var x = v.x; - var y = v.y; - - a[0] = x * a[0]; - a[1] = x * a[1]; - a[2] = x * a[2]; - - a[3] = y * a[3]; - a[4] = y * a[4]; - a[5] = y * a[5]; - - return this; - }, - - /** - * Set the values of this Matrix from the given Quaternion. - * - * @method Phaser.Math.Matrix3#fromQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - fromQuat: function (q) - { - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - var out = this.val; - - out[0] = 1 - (yy + zz); - out[3] = xy + wz; - out[6] = xz - wy; - - out[1] = xy - wz; - out[4] = 1 - (xx + zz); - out[7] = yz + wx; - - out[2] = xz + wy; - out[5] = yz - wx; - out[8] = 1 - (xx + yy); - - return this; - }, - - /** - * Set the values of this Matrix3 to be normalized from the given Matrix4. - * - * @method Phaser.Math.Matrix3#normalFromMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to normalize the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - normalFromMat4: function (m) - { - var a = m.val; - var out = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) - { - return null; - } - - det = 1 / det; - - out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - - out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - - out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - - return this; - } - -}); - -module.exports = Matrix3; - - -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); -var Matrix3 = __webpack_require__(45); -var NOOP = __webpack_require__(2); -var Vector3 = __webpack_require__(15); - -var EPSILON = 0.000001; - -// Some shared 'private' arrays -var siNext = new Int8Array([ 1, 2, 0 ]); -var tmp = new Float32Array([ 0, 0, 0 ]); - -var xUnitVec3 = new Vector3(1, 0, 0); -var yUnitVec3 = new Vector3(0, 1, 0); - -var tmpvec = new Vector3(); -var tmpMat3 = new Matrix3(); - -/** - * @classdesc - * A quaternion. - * - * @class Quaternion - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number} [x=0] - The x component. - * @param {number} [y=0] - The y component. - * @param {number} [z=0] - The z component. - * @param {number} [w=1] - The w component. - */ -var Quaternion = new Class({ - - initialize: - - function Quaternion (x, y, z, w) - { - /** - * The x component of this Quaternion. - * - * @name Phaser.Math.Quaternion#_x - * @type {number} - * @default 0 - * @private - * @since 3.50.0 - */ - - /** - * The y component of this Quaternion. - * - * @name Phaser.Math.Quaternion#_y - * @type {number} - * @default 0 - * @private - * @since 3.50.0 - */ - - /** - * The z component of this Quaternion. - * - * @name Phaser.Math.Quaternion#_z - * @type {number} - * @default 0 - * @private - * @since 3.50.0 - */ - - /** - * The w component of this Quaternion. - * - * @name Phaser.Math.Quaternion#_w - * @type {number} - * @default 0 - * @private - * @since 3.50.0 - */ - - /** - * This callback is invoked, if set, each time a value in this quaternion is changed. - * The callback is passed one argument, a reference to this quaternion. - * - * @name Phaser.Math.Quaternion#onChangeCallback - * @type {function} - * @since 3.50.0 - */ - this.onChangeCallback = NOOP; - - this.set(x, y, z, w); - }, - - /** - * The x component of this Quaternion. - * - * @name Phaser.Math.Quaternion#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - x: { - get: function () - { - return this._x; - }, - - set: function (value) - { - this._x = value; - - this.onChangeCallback(this); - } - }, - - /** - * The y component of this Quaternion. - * - * @name Phaser.Math.Quaternion#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - y: { - get: function () - { - return this._y; - }, - - set: function (value) - { - this._y = value; - - this.onChangeCallback(this); - } - }, - - /** - * The z component of this Quaternion. - * - * @name Phaser.Math.Quaternion#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - z: { - get: function () - { - return this._z; - }, - - set: function (value) - { - this._z = value; - - this.onChangeCallback(this); - } - }, - - /** - * The w component of this Quaternion. - * - * @name Phaser.Math.Quaternion#w - * @type {number} - * @default 0 - * @since 3.0.0 - */ - w: { - get: function () - { - return this._w; - }, - - set: function (value) - { - this._w = value; - - this.onChangeCallback(this); - } - }, - - /** - * Copy the components of a given Quaternion or Vector into this Quaternion. - * - * @method Phaser.Math.Quaternion#copy - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - copy: function (src) - { - return this.set(src); - }, - - /** - * Set the components of this Quaternion and optionally call the `onChangeCallback`. - * - * @method Phaser.Math.Quaternion#set - * @since 3.0.0 - * - * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components. - * @param {number} [y=0] - The y component. - * @param {number} [z=0] - The z component. - * @param {number} [w=0] - The w component. - * @param {boolean} [update=true] - Call the `onChangeCallback`? - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - set: function (x, y, z, w, update) - { - if (update === undefined) { update = true; } - - if (typeof x === 'object') - { - this._x = x.x || 0; - this._y = x.y || 0; - this._z = x.z || 0; - this._w = x.w || 0; - } - else - { - this._x = x || 0; - this._y = y || 0; - this._z = z || 0; - this._w = w || 0; - } - - if (update) - { - this.onChangeCallback(this); - } - - return this; - }, - - /** - * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise. - * - * @method Phaser.Math.Quaternion#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - add: function (v) - { - this._x += v.x; - this._y += v.y; - this._z += v.z; - this._w += v.w; - - this.onChangeCallback(this); - - return this; - }, - - /** - * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise. - * - * @method Phaser.Math.Quaternion#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - subtract: function (v) - { - this._x -= v.x; - this._y -= v.y; - this._z -= v.z; - this._w -= v.w; - - this.onChangeCallback(this); - - return this; - }, - - /** - * Scale this Quaternion by the given value. - * - * @method Phaser.Math.Quaternion#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Quaternion by. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - scale: function (scale) - { - this._x *= scale; - this._y *= scale; - this._z *= scale; - this._w *= scale; - - this.onChangeCallback(this); - - return this; - }, - - /** - * Calculate the length of this Quaternion. - * - * @method Phaser.Math.Quaternion#length - * @since 3.0.0 - * - * @return {number} The length of this Quaternion. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return Math.sqrt(x * x + y * y + z * z + w * w); - }, - - /** - * Calculate the length of this Quaternion squared. - * - * @method Phaser.Math.Quaternion#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Quaternion, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return x * x + y * y + z * z + w * w; - }, - - /** - * Normalize this Quaternion. - * - * @method Phaser.Math.Quaternion#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - var len = x * x + y * y + z * z + w * w; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this._x = x * len; - this._y = y * len; - this._z = z * len; - this._w = w * len; - } - - this.onChangeCallback(this); - - return this; - }, - - /** - * Calculate the dot product of this Quaternion and the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#dot - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion. - * - * @return {number} The dot product of this Quaternion and the given Quaternion or Vector. - */ - dot: function (v) - { - return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; - }, - - /** - * Linearly interpolate this Quaternion towards the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#lerp - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards. - * @param {number} [t=0] - The percentage of interpolation. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - lerp: function (v, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - return this.set( - ax + t * (v.x - ax), - ay + t * (v.y - ay), - az + t * (v.z - az), - aw + t * (v.w - aw) - ); - }, - - /** - * Rotates this Quaternion based on the two given vectors. - * - * @method Phaser.Math.Quaternion#rotationTo - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} a - The transform rotation vector. - * @param {Phaser.Math.Vector3} b - The target rotation vector. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotationTo: function (a, b) - { - var dot = a.x * b.x + a.y * b.y + a.z * b.z; - - if (dot < -0.999999) - { - if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON) - { - tmpvec.copy(yUnitVec3).cross(a); - } - - tmpvec.normalize(); - - return this.setAxisAngle(tmpvec, Math.PI); - - } - else if (dot > 0.999999) - { - return this.set(0, 0, 0, 1); - } - else - { - tmpvec.copy(a).cross(b); - - this._x = tmpvec.x; - this._y = tmpvec.y; - this._z = tmpvec.z; - this._w = 1 + dot; - - return this.normalize(); - } - }, - - /** - * Set the axes of this Quaternion. - * - * @method Phaser.Math.Quaternion#setAxes - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} view - The view axis. - * @param {Phaser.Math.Vector3} right - The right axis. - * @param {Phaser.Math.Vector3} up - The upwards axis. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setAxes: function (view, right, up) - { - var m = tmpMat3.val; - - m[0] = right.x; - m[3] = right.y; - m[6] = right.z; - - m[1] = up.x; - m[4] = up.y; - m[7] = up.z; - - m[2] = -view.x; - m[5] = -view.y; - m[8] = -view.z; - - return this.fromMat3(tmpMat3).normalize(); - }, - - /** - * Reset this Matrix to an identity (default) Quaternion. - * - * @method Phaser.Math.Quaternion#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - identity: function () - { - return this.set(0, 0, 0, 1); - }, - - /** - * Set the axis angle of this Quaternion. - * - * @method Phaser.Math.Quaternion#setAxisAngle - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} axis - The axis. - * @param {number} rad - The angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setAxisAngle: function (axis, rad) - { - rad = rad * 0.5; - - var s = Math.sin(rad); - - return this.set( - s * axis.x, - s * axis.y, - s * axis.z, - Math.cos(rad) - ); - }, - - /** - * Multiply this Quaternion by the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - multiply: function (b) - { - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bx = b.x; - var by = b.y; - var bz = b.z; - var bw = b.w; - - return this.set( - ax * bw + aw * bx + ay * bz - az * by, - ay * bw + aw * by + az * bx - ax * bz, - az * bw + aw * bz + ax * by - ay * bx, - aw * bw - ax * bx - ay * by - az * bz - ); - }, - - /** - * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#slerp - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards. - * @param {number} t - The percentage of interpolation. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - slerp: function (b, t) - { - // benchmarks: http://jsperf.com/quaternion-slerp-implementations - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bx = b.x; - var by = b.y; - var bz = b.z; - var bw = b.w; - - // calc cosine - var cosom = ax * bx + ay * by + az * bz + aw * bw; - - // adjust signs (if necessary) - if (cosom < 0) - { - cosom = -cosom; - bx = - bx; - by = - by; - bz = - bz; - bw = - bw; - } - - // "from" and "to" quaternions are very close - // ... so we can do a linear interpolation - var scale0 = 1 - t; - var scale1 = t; - - // calculate coefficients - if ((1 - cosom) > EPSILON) - { - // standard case (slerp) - var omega = Math.acos(cosom); - var sinom = Math.sin(omega); - - scale0 = Math.sin((1.0 - t) * omega) / sinom; - scale1 = Math.sin(t * omega) / sinom; - } - - // calculate final values - return this.set( - scale0 * ax + scale1 * bx, - scale0 * ay + scale1 * by, - scale0 * az + scale1 * bz, - scale0 * aw + scale1 * bw - ); - }, - - /** - * Invert this Quaternion. - * - * @method Phaser.Math.Quaternion#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - invert: function () - { - var a0 = this.x; - var a1 = this.y; - var a2 = this.z; - var a3 = this.w; - - var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; - var invDot = (dot) ? 1 / dot : 0; - - return this.set( - -a0 * invDot, - -a1 * invDot, - -a2 * invDot, - a3 * invDot - ); - }, - - /** - * Convert this Quaternion into its conjugate. - * - * Sets the x, y and z components. - * - * @method Phaser.Math.Quaternion#conjugate - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - conjugate: function () - { - this._x = -this.x; - this._y = -this.y; - this._z = -this.z; - - this.onChangeCallback(this); - - return this; - }, - - /** - * Rotate this Quaternion on the X axis. - * - * @method Phaser.Math.Quaternion#rotateX - * @since 3.0.0 - * - * @param {number} rad - The rotation angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotateX: function (rad) - { - rad *= 0.5; - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bx = Math.sin(rad); - var bw = Math.cos(rad); - - return this.set( - ax * bw + aw * bx, - ay * bw + az * bx, - az * bw - ay * bx, - aw * bw - ax * bx - ); - }, - - /** - * Rotate this Quaternion on the Y axis. - * - * @method Phaser.Math.Quaternion#rotateY - * @since 3.0.0 - * - * @param {number} rad - The rotation angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotateY: function (rad) - { - rad *= 0.5; - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var by = Math.sin(rad); - var bw = Math.cos(rad); - - return this.set( - ax * bw - az * by, - ay * bw + aw * by, - az * bw + ax * by, - aw * bw - ay * by - ); - }, - - /** - * Rotate this Quaternion on the Z axis. - * - * @method Phaser.Math.Quaternion#rotateZ - * @since 3.0.0 - * - * @param {number} rad - The rotation angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotateZ: function (rad) - { - rad *= 0.5; - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bz = Math.sin(rad); - var bw = Math.cos(rad); - - return this.set( - ax * bw + ay * bz, - ay * bw - ax * bz, - az * bw + aw * bz, - aw * bw - az * bz - ); - }, - - /** - * Create a unit (or rotation) Quaternion from its x, y, and z components. - * - * Sets the w component. - * - * @method Phaser.Math.Quaternion#calculateW - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - calculateW: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - this.w = -Math.sqrt(1.0 - x * x - y * y - z * z); - - return this; - }, - - /** - * Set this Quaternion from the given Euler, based on Euler order. - * - * @method Phaser.Math.Quaternion#setFromEuler - * @since 3.50.0 - * - * @param {Phaser.Math.Euler} euler - The Euler to convert from. - * @param {boolean} [update=true] - Run the `onChangeCallback`? - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setFromEuler: function (euler, update) - { - var x = euler.x / 2; - var y = euler.y / 2; - var z = euler.z / 2; - - var c1 = Math.cos(x); - var c2 = Math.cos(y); - var c3 = Math.cos(z); - - var s1 = Math.sin(x); - var s2 = Math.sin(y); - var s3 = Math.sin(z); - - switch (euler.order) - { - case 'XYZ': - { - this.set( - s1 * c2 * c3 + c1 * s2 * s3, - c1 * s2 * c3 - s1 * c2 * s3, - c1 * c2 * s3 + s1 * s2 * c3, - c1 * c2 * c3 - s1 * s2 * s3, - update - ); - - break; - } - - case 'YXZ': - { - this.set( - s1 * c2 * c3 + c1 * s2 * s3, - c1 * s2 * c3 - s1 * c2 * s3, - c1 * c2 * s3 - s1 * s2 * c3, - c1 * c2 * c3 + s1 * s2 * s3, - update - ); - - break; - } - - case 'ZXY': - { - this.set( - s1 * c2 * c3 - c1 * s2 * s3, - c1 * s2 * c3 + s1 * c2 * s3, - c1 * c2 * s3 + s1 * s2 * c3, - c1 * c2 * c3 - s1 * s2 * s3, - update - ); - - break; - } - - case 'ZYX': - { - this.set( - s1 * c2 * c3 - c1 * s2 * s3, - c1 * s2 * c3 + s1 * c2 * s3, - c1 * c2 * s3 - s1 * s2 * c3, - c1 * c2 * c3 + s1 * s2 * s3, - update - ); - - break; - } - - case 'YZX': - { - this.set( - s1 * c2 * c3 + c1 * s2 * s3, - c1 * s2 * c3 + s1 * c2 * s3, - c1 * c2 * s3 - s1 * s2 * c3, - c1 * c2 * c3 - s1 * s2 * s3, - update - ); - - break; - } - - case 'XZY': - { - this.set( - s1 * c2 * c3 - c1 * s2 * s3, - c1 * s2 * c3 - s1 * c2 * s3, - c1 * c2 * s3 + s1 * s2 * c3, - c1 * c2 * c3 + s1 * s2 * s3, - update - ); - - break; - } - } - - return this; - }, - - /** - * Sets the rotation of this Quaternion from the given Matrix4. - * - * @method Phaser.Math.Quaternion#setFromRotationMatrix - * @since 3.50.0 - * - * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to set the rotation from. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setFromRotationMatrix: function (mat4) - { - var m = mat4.val; - - var m11 = m[0]; - var m12 = m[4]; - var m13 = m[8]; - var m21 = m[1]; - var m22 = m[5]; - var m23 = m[9]; - var m31 = m[2]; - var m32 = m[6]; - var m33 = m[10]; - - var trace = m11 + m22 + m33; - var s; - - if (trace > 0) - { - s = 0.5 / Math.sqrt(trace + 1.0); - - this.set( - (m32 - m23) * s, - (m13 - m31) * s, - (m21 - m12) * s, - 0.25 / s - ); - } - else if (m11 > m22 && m11 > m33) - { - s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); - - this.set( - 0.25 * s, - (m12 + m21) / s, - (m13 + m31) / s, - (m32 - m23) / s - ); - } - else if (m22 > m33) - { - s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); - - this.set( - (m12 + m21) / s, - 0.25 * s, - (m23 + m32) / s, - (m13 - m31) / s - ); - } - else - { - s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); - - this.set( - (m13 + m31) / s, - (m23 + m32) / s, - 0.25 * s, - (m21 - m12) / s - ); - } - - return this; - }, - - /** - * Convert the given Matrix into this Quaternion. - * - * @method Phaser.Math.Quaternion#fromMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - fromMat3: function (mat) - { - // benchmarks: - // http://jsperf.com/typed-array-access-speed - // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion - - // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes - // article "Quaternion Calculus and Fast Animation". - var m = mat.val; - var fTrace = m[0] + m[4] + m[8]; - var fRoot; - - if (fTrace > 0) - { - // |w| > 1/2, may as well choose w > 1/2 - fRoot = Math.sqrt(fTrace + 1.0); // 2w - - this.w = 0.5 * fRoot; - - fRoot = 0.5 / fRoot; // 1/(4w) - - this._x = (m[7] - m[5]) * fRoot; - this._y = (m[2] - m[6]) * fRoot; - this._z = (m[3] - m[1]) * fRoot; - } - else - { - // |w| <= 1/2 - var i = 0; - - if (m[4] > m[0]) - { - i = 1; - } - - if (m[8] > m[i * 3 + i]) - { - i = 2; - } - - var j = siNext[i]; - var k = siNext[j]; - - // This isn't quite as clean without array access - fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); - tmp[i] = 0.5 * fRoot; - - fRoot = 0.5 / fRoot; - - tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; - tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; - - this._x = tmp[0]; - this._y = tmp[1]; - this._z = tmp[2]; - this._w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; - } - - this.onChangeCallback(this); - - return this; - } - -}); - -module.exports = Quaternion; - - -/***/ }), -/* 47 */ -/***/ (function(module, exports) { +/***/ 6937: +/***/ ((module) => { /*** IMPORTS FROM imports-loader ***/ @@ -22303,3907 +12382,9 @@ module.exports = spine; /***/ }), -/* 48 */ -/***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Loader.Events - */ - -module.exports = { - - ADD: __webpack_require__(212), - COMPLETE: __webpack_require__(213), - FILE_COMPLETE: __webpack_require__(214), - FILE_KEY_COMPLETE: __webpack_require__(215), - FILE_LOAD_ERROR: __webpack_require__(216), - FILE_LOAD: __webpack_require__(217), - FILE_PROGRESS: __webpack_require__(218), - POST_PROCESS: __webpack_require__(219), - PROGRESS: __webpack_require__(220), - START: __webpack_require__(221) - -}; - - -/***/ }), -/* 49 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Given a File and a baseURL value this returns the URL the File will use to download from. - * - * @function Phaser.Loader.GetURL - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - The File object. - * @param {string} baseURL - A default base URL. - * - * @return {string} The URL the File will use. - */ -var GetURL = function (file, baseURL) -{ - if (!file.url) - { - return false; - } - - if (file.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)) - { - return file.url; - } - else - { - return baseURL + file.url; - } -}; - -module.exports = GetURL; - - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Extend = __webpack_require__(19); -var XHRSettings = __webpack_require__(51); - -/** - * Takes two XHRSettings Objects and creates a new XHRSettings object from them. - * - * The new object is seeded by the values given in the global settings, but any setting in - * the local object overrides the global ones. - * - * @function Phaser.Loader.MergeXHRSettings - * @since 3.0.0 - * - * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object. - * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object. - * - * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object. - */ -var MergeXHRSettings = function (global, local) -{ - var output = (global === undefined) ? XHRSettings() : Extend({}, global); - - if (local) - { - for (var setting in local) - { - if (local[setting] !== undefined) - { - output[setting] = local[setting]; - } - } - } - - return output; -}; - -module.exports = MergeXHRSettings; - - -/***/ }), -/* 51 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Creates an XHRSettings Object with default values. - * - * @function Phaser.Loader.XHRSettings - * @since 3.0.0 - * - * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'. - * @param {boolean} [async=true] - Should the XHR request use async or not? - * @param {string} [user=''] - Optional username for the XHR request. - * @param {string} [password=''] - Optional password for the XHR request. - * @param {number} [timeout=0] - Optional XHR timeout value. - * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value. - * - * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. - */ -var XHRSettings = function (responseType, async, user, password, timeout, withCredentials) -{ - if (responseType === undefined) { responseType = ''; } - if (async === undefined) { async = true; } - if (user === undefined) { user = ''; } - if (password === undefined) { password = ''; } - if (timeout === undefined) { timeout = 0; } - if (withCredentials === undefined) { withCredentials = false; } - - // Before sending a request, set the xhr.responseType to "text", - // "arraybuffer", "blob", or "document", depending on your data needs. - // Note, setting xhr.responseType = '' (or omitting) will default the response to "text". - - return { - - // Ignored by the Loader, only used by File. - responseType: responseType, - - async: async, - - // credentials - user: user, - password: password, - - // timeout in ms (0 = no timeout) - timeout: timeout, - - // setRequestHeader - headers: undefined, - header: undefined, - headerValue: undefined, - requestedWith: false, - - // overrideMimeType - overrideMimeType: undefined, - - // withCredentials - withCredentials: withCredentials - - }; -}; - -module.exports = XHRSettings; - - -/***/ }), -/* 52 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for calculating and setting the size of a non-Frame based Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.ComputedSize - * @since 3.0.0 - */ - -var ComputedSize = { - - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - * - * @name Phaser.GameObjects.Components.ComputedSize#width - * @type {number} - * @since 3.0.0 - */ - width: 0, - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - * - * @name Phaser.GameObjects.Components.ComputedSize#height - * @type {number} - * @since 3.0.0 - */ - height: 0, - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.ComputedSize#displayWidth - * @type {number} - * @since 3.0.0 - */ - displayWidth: { - - get: function () - { - return this.scaleX * this.width; - }, - - set: function (value) - { - this.scaleX = value / this.width; - } - - }, - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.ComputedSize#displayHeight - * @type {number} - * @since 3.0.0 - */ - displayHeight: { - - get: function () - { - return this.scaleY * this.height; - }, - - set: function (value) - { - this.scaleY = value / this.height; - } - - }, - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * - * @method Phaser.GameObjects.Components.ComputedSize#setSize - * @since 3.4.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setSize: function (width, height) - { - this.width = width; - this.height = height; - - return this; - }, - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * - * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize - * @since 3.4.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setDisplaySize: function (width, height) - { - this.displayWidth = width; - this.displayHeight = height; - - return this; - } - -}; - -module.exports = ComputedSize; - - -/***/ }), -/* 53 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for setting the depth of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Depth - * @since 3.0.0 - */ - -var Depth = { - - /** - * Private internal value. Holds the depth of the Game Object. - * - * @name Phaser.GameObjects.Components.Depth#_depth - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - _depth: 0, - - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @name Phaser.GameObjects.Components.Depth#depth - * @type {number} - * @since 3.0.0 - */ - depth: { - - get: function () - { - return this._depth; - }, - - set: function (value) - { - if (this.displayList) - { - this.displayList.queueDepthSort(); - } - - this._depth = value; - } - - }, - - /** - * The depth of this Game Object within the Scene. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @method Phaser.GameObjects.Components.Depth#setDepth - * @since 3.0.0 - * - * @param {number} value - The depth of this Game Object. Ensure this value is only ever a number data-type. - * - * @return {this} This Game Object instance. - */ - setDepth: function (value) - { - if (value === undefined) { value = 0; } - - this.depth = value; - - return this; - } - -}; - -module.exports = Depth; - - -/***/ }), -/* 54 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for visually flipping a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Flip - * @since 3.0.0 - */ - -var Flip = { - - /** - * The horizontally flipped state of the Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @name Phaser.GameObjects.Components.Flip#flipX - * @type {boolean} - * @default false - * @since 3.0.0 - */ - flipX: false, - - /** - * The vertically flipped state of the Game Object. - * - * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @name Phaser.GameObjects.Components.Flip#flipY - * @type {boolean} - * @default false - * @since 3.0.0 - */ - flipY: false, - - /** - * Toggles the horizontal flipped state of this Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @method Phaser.GameObjects.Components.Flip#toggleFlipX - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - toggleFlipX: function () - { - this.flipX = !this.flipX; - - return this; - }, - - /** - * Toggles the vertical flipped state of this Game Object. - * - * @method Phaser.GameObjects.Components.Flip#toggleFlipY - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - toggleFlipY: function () - { - this.flipY = !this.flipY; - - return this; - }, - - /** - * Sets the horizontal flipped state of this Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @method Phaser.GameObjects.Components.Flip#setFlipX - * @since 3.0.0 - * - * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. - */ - setFlipX: function (value) - { - this.flipX = value; - - return this; - }, - - /** - * Sets the vertical flipped state of this Game Object. - * - * @method Phaser.GameObjects.Components.Flip#setFlipY - * @since 3.0.0 - * - * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. - */ - setFlipY: function (value) - { - this.flipY = value; - - return this; - }, - - /** - * Sets the horizontal and vertical flipped state of this Game Object. - * - * A Game Object that is flipped will render inversed on the flipped axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @method Phaser.GameObjects.Components.Flip#setFlip - * @since 3.0.0 - * - * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped. - * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. - */ - setFlip: function (x, y) - { - this.flipX = x; - this.flipY = y; - - return this; - }, - - /** - * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. - * - * @method Phaser.GameObjects.Components.Flip#resetFlip - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - resetFlip: function () - { - this.flipX = false; - this.flipY = false; - - return this; - } - -}; - -module.exports = Flip; - - -/***/ }), -/* 55 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for getting and setting the Scroll Factor of a Game Object. - * - * @namespace Phaser.GameObjects.Components.ScrollFactor - * @since 3.0.0 - */ - -var ScrollFactor = { - - /** - * The horizontal scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * - * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scrollFactorX: 1, - - /** - * The vertical scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * - * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scrollFactorY: 1, - - /** - * Sets the scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * - * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor - * @since 3.0.0 - * - * @param {number} x - The horizontal scroll factor of this Game Object. - * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. - * - * @return {this} This Game Object instance. - */ - setScrollFactor: function (x, y) - { - if (y === undefined) { y = x; } - - this.scrollFactorX = x; - this.scrollFactorY = y; - - return this; - } - -}; - -module.exports = ScrollFactor; - - -/***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MATH_CONST = __webpack_require__(4); -var TransformMatrix = __webpack_require__(26); -var TransformXY = __webpack_require__(44); -var WrapAngle = __webpack_require__(33); -var WrapAngleDegrees = __webpack_require__(34); -var Vector2 = __webpack_require__(3); - -// global bitmask flag for GameObject.renderMask (used by Scale) -var _FLAG = 4; // 0100 - -/** - * Provides methods used for getting and setting the position, scale and rotation of a Game Object. - * - * @namespace Phaser.GameObjects.Components.Transform - * @since 3.0.0 - */ - -var Transform = { - - /** - * A property indicating that a Game Object has this component. - * - * @name Phaser.GameObjects.Components.Transform#hasTransformComponent - * @type {boolean} - * @readonly - * @default true - * @since 3.60.0 - */ - hasTransformComponent: true, - - /** - * Private internal value. Holds the horizontal scale value. - * - * @name Phaser.GameObjects.Components.Transform#_scaleX - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _scaleX: 1, - - /** - * Private internal value. Holds the vertical scale value. - * - * @name Phaser.GameObjects.Components.Transform#_scaleY - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _scaleY: 1, - - /** - * Private internal value. Holds the rotation value in radians. - * - * @name Phaser.GameObjects.Components.Transform#_rotation - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - _rotation: 0, - - /** - * The x position of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - x: 0, - - /** - * The y position of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - y: 0, - - /** - * The z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#depth} instead. - * - * @name Phaser.GameObjects.Components.Transform#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - z: 0, - - /** - * The w position of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#w - * @type {number} - * @default 0 - * @since 3.0.0 - */ - w: 0, - - /** - * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object - * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * - * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this - * isn't the case, use the `scaleX` or `scaleY` properties instead. - * - * @name Phaser.GameObjects.Components.Transform#scale - * @type {number} - * @default 1 - * @since 3.18.0 - */ - scale: { - - get: function () - { - return (this._scaleX + this._scaleY) / 2; - }, - - set: function (value) - { - this._scaleX = value; - this._scaleY = value; - - if (value === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The horizontal scale of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#scaleX - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scaleX: { - - get: function () - { - return this._scaleX; - }, - - set: function (value) - { - this._scaleX = value; - - if (value === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The vertical scale of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#scaleY - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scaleY: { - - get: function () - { - return this._scaleY; - }, - - set: function (value) - { - this._scaleY = value; - - if (value === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The angle of this Game Object as expressed in degrees. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left - * and -90 is up. - * - * If you prefer to work in radians, see the `rotation` property instead. - * - * @name Phaser.GameObjects.Components.Transform#angle - * @type {number} - * @default 0 - * @since 3.0.0 - */ - angle: { - - get: function () - { - return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG); - }, - - set: function (value) - { - // value is in degrees - this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD; - } - }, - - /** - * The angle of this Game Object in radians. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left - * and -PI/2 is up. - * - * If you prefer to work in degrees, see the `angle` property instead. - * - * @name Phaser.GameObjects.Components.Transform#rotation - * @type {number} - * @default 1 - * @since 3.0.0 - */ - rotation: { - - get: function () - { - return this._rotation; - }, - - set: function (value) - { - // value is in radians - this._rotation = WrapAngle(value); - } - }, - - /** - * Sets the position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setPosition - * @since 3.0.0 - * - * @param {number} [x=0] - The x position of this Game Object. - * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value. - * @param {number} [z=0] - The z position of this Game Object. - * @param {number} [w=0] - The w position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setPosition: function (x, y, z, w) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = x; } - if (z === undefined) { z = 0; } - if (w === undefined) { w = 0; } - - this.x = x; - this.y = y; - this.z = z; - this.w = w; - - return this; - }, - - /** - * Copies an object's coordinates to this Game Object's position. - * - * @method Phaser.GameObjects.Components.Transform#copyPosition - * @since 3.50.0 - * - * @param {(Phaser.Types.Math.Vector2Like|Phaser.Types.Math.Vector3Like|Phaser.Types.Math.Vector4Like)} source - An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. - * - * @return {this} This Game Object instance. - */ - copyPosition: function (source) - { - if (source.x !== undefined) { this.x = source.x; } - if (source.y !== undefined) { this.y = source.y; } - if (source.z !== undefined) { this.z = source.z; } - if (source.w !== undefined) { this.w = source.w; } - - return this; - }, - - /** - * Sets the position of this Game Object to be a random position within the confines of - * the given area. - * - * If no area is specified a random position between 0 x 0 and the game width x height is used instead. - * - * The position does not factor in the size of this Game Object, meaning that only the origin is - * guaranteed to be within the area. - * - * @method Phaser.GameObjects.Components.Transform#setRandomPosition - * @since 3.8.0 - * - * @param {number} [x=0] - The x position of the top-left of the random area. - * @param {number} [y=0] - The y position of the top-left of the random area. - * @param {number} [width] - The width of the random area. - * @param {number} [height] - The height of the random area. - * - * @return {this} This Game Object instance. - */ - setRandomPosition: function (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = this.scene.sys.scale.width; } - if (height === undefined) { height = this.scene.sys.scale.height; } - - this.x = x + (Math.random() * width); - this.y = y + (Math.random() * height); - - return this; - }, - - /** - * Sets the rotation of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setRotation - * @since 3.0.0 - * - * @param {number} [radians=0] - The rotation of this Game Object, in radians. - * - * @return {this} This Game Object instance. - */ - setRotation: function (radians) - { - if (radians === undefined) { radians = 0; } - - this.rotation = radians; - - return this; - }, - - /** - * Sets the angle of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setAngle - * @since 3.0.0 - * - * @param {number} [degrees=0] - The rotation of this Game Object, in degrees. - * - * @return {this} This Game Object instance. - */ - setAngle: function (degrees) - { - if (degrees === undefined) { degrees = 0; } - - this.angle = degrees; - - return this; - }, - - /** - * Sets the scale of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setScale - * @since 3.0.0 - * - * @param {number} x - The horizontal scale of this Game Object. - * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value. - * - * @return {this} This Game Object instance. - */ - setScale: function (x, y) - { - if (x === undefined) { x = 1; } - if (y === undefined) { y = x; } - - this.scaleX = x; - this.scaleY = y; - - return this; - }, - - /** - * Sets the x position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setX - * @since 3.0.0 - * - * @param {number} [value=0] - The x position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setX: function (value) - { - if (value === undefined) { value = 0; } - - this.x = value; - - return this; - }, - - /** - * Sets the y position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setY - * @since 3.0.0 - * - * @param {number} [value=0] - The y position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setY: function (value) - { - if (value === undefined) { value = 0; } - - this.y = value; - - return this; - }, - - /** - * Sets the z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. - * - * @method Phaser.GameObjects.Components.Transform#setZ - * @since 3.0.0 - * - * @param {number} [value=0] - The z position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setZ: function (value) - { - if (value === undefined) { value = 0; } - - this.z = value; - - return this; - }, - - /** - * Sets the w position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setW - * @since 3.0.0 - * - * @param {number} [value=0] - The w position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setW: function (value) - { - if (value === undefined) { value = 0; } - - this.w = value; - - return this; - }, - - /** - * Gets the local transform matrix for this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix - * @since 3.4.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. - * - * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. - */ - getLocalTransformMatrix: function (tempMatrix) - { - if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } - - return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); - }, - - /** - * Gets the world transform matrix for this Game Object, factoring in any parent Containers. - * - * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix - * @since 3.4.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations. - * - * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. - */ - getWorldTransformMatrix: function (tempMatrix, parentMatrix) - { - if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } - if (parentMatrix === undefined) { parentMatrix = new TransformMatrix(); } - - var parent = this.parentContainer; - - if (!parent) - { - return this.getLocalTransformMatrix(tempMatrix); - } - - tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); - - while (parent) - { - parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY); - - parentMatrix.multiply(tempMatrix, tempMatrix); - - parent = parent.parentContainer; - } - - return tempMatrix; - }, - - /** - * Takes the given `x` and `y` coordinates and converts them into local space for this - * Game Object, taking into account parent and local transforms, and the Display Origin. - * - * The returned Vector2 contains the translated point in its properties. - * - * A Camera needs to be provided in order to handle modified scroll factors. If no - * camera is specified, it will use the `main` camera from the Scene to which this - * Game Object belongs. - * - * @method Phaser.GameObjects.Components.Transform#getLocalPoint - * @since 3.50.0 - * - * @param {number} x - The x position to translate. - * @param {number} y - The y position to translate. - * @param {Phaser.Math.Vector2} [point] - A Vector2, or point-like object, to store the results in. - * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera which is being tested against. If not given will use the Scene default camera. - * - * @return {Phaser.Math.Vector2} The translated point. - */ - getLocalPoint: function (x, y, point, camera) - { - if (!point) { point = new Vector2(); } - if (!camera) { camera = this.scene.sys.cameras.main; } - - var csx = camera.scrollX; - var csy = camera.scrollY; - - var px = x + (csx * this.scrollFactorX) - csx; - var py = y + (csy * this.scrollFactorY) - csy; - - if (this.parentContainer) - { - this.getWorldTransformMatrix().applyInverse(px, py, point); - } - else - { - TransformXY(px, py, this.x, this.y, this.rotation, this.scaleX, this.scaleY, point); - } - - // Normalize origin - if (this._originComponent) - { - point.x += this._displayOriginX; - point.y += this._displayOriginY; - } - - return point; - }, - - /** - * Gets the sum total rotation of all of this Game Objects parent Containers. - * - * The returned value is in radians and will be zero if this Game Object has no parent container. - * - * @method Phaser.GameObjects.Components.Transform#getParentRotation - * @since 3.18.0 - * - * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object. - */ - getParentRotation: function () - { - var rotation = 0; - - var parent = this.parentContainer; - - while (parent) - { - rotation += parent.rotation; - - parent = parent.parentContainer; - } - - return rotation; - } - -}; - -module.exports = Transform; - - -/***/ }), -/* 57 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// bitmask flag for GameObject.renderMask -var _FLAG = 1; // 0001 - -/** - * Provides methods used for setting the visibility of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Visible - * @since 3.0.0 - */ - -var Visible = { - - /** - * Private internal value. Holds the visible value. - * - * @name Phaser.GameObjects.Components.Visible#_visible - * @type {boolean} - * @private - * @default true - * @since 3.0.0 - */ - _visible: true, - - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * - * @name Phaser.GameObjects.Components.Visible#visible - * @type {boolean} - * @since 3.0.0 - */ - visible: { - - get: function () - { - return this._visible; - }, - - set: function (value) - { - if (value) - { - this._visible = true; - this.renderFlags |= _FLAG; - } - else - { - this._visible = false; - this.renderFlags &= ~_FLAG; - } - } - - }, - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * - * @method Phaser.GameObjects.Components.Visible#setVisible - * @since 3.0.0 - * - * @param {boolean} value - The visible state of the Game Object. - * - * @return {this} This Game Object instance. - */ - setVisible: function (value) - { - this.visible = value; - - return this; - } -}; - -module.exports = Visible; - - -/***/ }), -/* 58 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var ComponentsToJSON = __webpack_require__(59); -var DataManager = __webpack_require__(227); -var EventEmitter = __webpack_require__(234); -var Events = __webpack_require__(60); -var SceneEvents = __webpack_require__(23); - -/** - * @classdesc - * The base class that all Game Objects extend. - * You don't create GameObjects directly and they cannot be added to the display list. - * Instead, use them as the base for your own custom classes. - * - * @class GameObject - * @memberof Phaser.GameObjects - * @extends Phaser.Events.EventEmitter - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. - * @param {string} type - A textual representation of the type of Game Object, i.e. `sprite`. - */ -var GameObject = new Class({ - - Extends: EventEmitter, - - initialize: - - function GameObject (scene, type) - { - EventEmitter.call(this); - - /** - * A reference to the Scene to which this Game Object belongs. - * - * Game Objects can only belong to one Scene. - * - * You should consider this property as being read-only. You cannot move a - * Game Object to another Scene by simply changing it. - * - * @name Phaser.GameObjects.GameObject#scene - * @type {Phaser.Scene} - * @since 3.0.0 - */ - this.scene = scene; - - /** - * Holds a reference to the Display List that contains this Game Object. - * - * This is set automatically when this Game Object is added to a Scene or Layer. - * - * You should treat this property as being read-only. - * - * @name Phaser.GameObjects.GameObject#displayList - * @type {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} - * @default null - * @since 3.50.0 - */ - this.displayList = null; - - /** - * A textual representation of this Game Object, i.e. `sprite`. - * Used internally by Phaser but is available for your own custom classes to populate. - * - * @name Phaser.GameObjects.GameObject#type - * @type {string} - * @since 3.0.0 - */ - this.type = type; - - /** - * The current state of this Game Object. - * - * Phaser itself will never modify this value, although plugins may do so. - * - * Use this property to track the state of a Game Object during its lifetime. For example, it could change from - * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant - * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. - * If you need to store complex data about your Game Object, look at using the Data Component instead. - * - * @name Phaser.GameObjects.GameObject#state - * @type {(number|string)} - * @since 3.16.0 - */ - this.state = 0; - - /** - * The parent Container of this Game Object, if it has one. - * - * @name Phaser.GameObjects.GameObject#parentContainer - * @type {Phaser.GameObjects.Container} - * @since 3.4.0 - */ - this.parentContainer = null; - - /** - * The name of this Game Object. - * Empty by default and never populated by Phaser, this is left for developers to use. - * - * @name Phaser.GameObjects.GameObject#name - * @type {string} - * @default '' - * @since 3.0.0 - */ - this.name = ''; - - /** - * The active state of this Game Object. - * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. - * An active object is one which is having its logic and internal systems updated. - * - * @name Phaser.GameObjects.GameObject#active - * @type {boolean} - * @default true - * @since 3.0.0 - */ - this.active = true; - - /** - * The Tab Index of the Game Object. - * Reserved for future use by plugins and the Input Manager. - * - * @name Phaser.GameObjects.GameObject#tabIndex - * @type {number} - * @default -1 - * @since 3.0.0 - */ - this.tabIndex = -1; - - /** - * A Data Manager. - * It allows you to store, query and get key/value paired information specific to this Game Object. - * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. - * - * @name Phaser.GameObjects.GameObject#data - * @type {Phaser.Data.DataManager} - * @default null - * @since 3.0.0 - */ - this.data = null; - - /** - * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. - * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. - * If those components are not used by your custom class then you can use this bitmask as you wish. - * - * @name Phaser.GameObjects.GameObject#renderFlags - * @type {number} - * @default 15 - * @since 3.0.0 - */ - this.renderFlags = 15; - - /** - * A bitmask that controls if this Game Object is drawn by a Camera or not. - * Not usually set directly, instead call `Camera.ignore`, however you can - * set this property directly using the Camera.id property: - * - * @example - * this.cameraFilter |= camera.id - * - * @name Phaser.GameObjects.GameObject#cameraFilter - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.cameraFilter = 0; - - /** - * If this Game Object is enabled for input then this property will contain an InteractiveObject instance. - * Not usually set directly. Instead call `GameObject.setInteractive()`. - * - * @name Phaser.GameObjects.GameObject#input - * @type {?Phaser.Types.Input.InteractiveObject} - * @default null - * @since 3.0.0 - */ - this.input = null; - - /** - * If this Game Object is enabled for Arcade or Matter Physics then this property will contain a reference to a Physics Body. - * - * @name Phaser.GameObjects.GameObject#body - * @type {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|MatterJS.BodyType)} - * @default null - * @since 3.0.0 - */ - this.body = null; - - /** - * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`. - * This includes calls that may come from a Group, Container or the Scene itself. - * While it allows you to persist a Game Object across Scenes, please understand you are entirely - * responsible for managing references to and from this Game Object. - * - * @name Phaser.GameObjects.GameObject#ignoreDestroy - * @type {boolean} - * @default false - * @since 3.5.0 - */ - this.ignoreDestroy = false; - - this.on(Events.ADDED_TO_SCENE, this.addedToScene, this); - this.on(Events.REMOVED_FROM_SCENE, this.removedFromScene, this); - - // Tell the Scene to re-sort the children - scene.sys.queueDepthSort(); - }, - - /** - * Sets the `active` property of this Game Object and returns this Game Object for further chaining. - * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList. - * - * @method Phaser.GameObjects.GameObject#setActive - * @since 3.0.0 - * - * @param {boolean} value - True if this Game Object should be set as active, false if not. - * - * @return {this} This GameObject. - */ - setActive: function (value) - { - this.active = value; - - return this; - }, - - /** - * Sets the `name` property of this Game Object and returns this Game Object for further chaining. - * The `name` property is not populated by Phaser and is presented for your own use. - * - * @method Phaser.GameObjects.GameObject#setName - * @since 3.0.0 - * - * @param {string} value - The name to be given to this Game Object. - * - * @return {this} This GameObject. - */ - setName: function (value) - { - this.name = value; - - return this; - }, - - /** - * Sets the current state of this Game Object. - * - * Phaser itself will never modify the State of a Game Object, although plugins may do so. - * - * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. - * The state value should typically be an integer (ideally mapped to a constant - * in your game code), but could also be a string. It is recommended to keep it light and simple. - * If you need to store complex data about your Game Object, look at using the Data Component instead. - * - * @method Phaser.GameObjects.GameObject#setState - * @since 3.16.0 - * - * @param {(number|string)} value - The state of the Game Object. - * - * @return {this} This GameObject. - */ - setState: function (value) - { - this.state = value; - - return this; - }, - - /** - * Adds a Data Manager component to this Game Object. - * - * @method Phaser.GameObjects.GameObject#setDataEnabled - * @since 3.0.0 - * @see Phaser.Data.DataManager - * - * @return {this} This GameObject. - */ - setDataEnabled: function () - { - if (!this.data) - { - this.data = new DataManager(this); - } - - return this; - }, - - /** - * Allows you to store a key value pair within this Game Objects Data Manager. - * - * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled - * before setting the value. - * - * If the key doesn't already exist in the Data Manager then it is created. - * - * ```javascript - * sprite.setData('name', 'Red Gem Stone'); - * ``` - * - * You can also pass in an object of key value pairs as the first argument: - * - * ```javascript - * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); - * ``` - * - * To get a value back again you can call `getData`: - * - * ```javascript - * sprite.getData('gold'); - * ``` - * - * Or you can access the value directly via the `values` property, where it works like any other variable: - * - * ```javascript - * sprite.data.values.gold += 50; - * ``` - * - * When the value is first set, a `setdata` event is emitted from this Game Object. - * - * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. - * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. - * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. - * - * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. - * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. - * - * @method Phaser.GameObjects.GameObject#setData - * @since 3.0.0 - * - * @generic {any} T - * @genericUse {(string|T)} - [key] - * - * @param {(string|object)} key - The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. - * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored. - * - * @return {this} This GameObject. - */ - setData: function (key, value) - { - if (!this.data) - { - this.data = new DataManager(this); - } - - this.data.set(key, value); - - return this; - }, - - /** - * Increase a value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is increased from 0. - * - * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled - * before setting the value. - * - * If the key doesn't already exist in the Data Manager then it is created. - * - * When the value is first set, a `setdata` event is emitted from this Game Object. - * - * @method Phaser.GameObjects.GameObject#incData - * @since 3.23.0 - * - * @generic {any} T - * @genericUse {(string|T)} - [key] - * - * @param {(string|object)} key - The key to increase the value for. - * @param {*} [data] - The value to increase for the given key. - * - * @return {this} This GameObject. - */ - incData: function (key, value) - { - if (!this.data) - { - this.data = new DataManager(this); - } - - this.data.inc(key, value); - - return this; - }, - - /** - * Toggle a boolean value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is toggled from false. - * - * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled - * before setting the value. - * - * If the key doesn't already exist in the Data Manager then it is created. - * - * When the value is first set, a `setdata` event is emitted from this Game Object. - * - * @method Phaser.GameObjects.GameObject#toggleData - * @since 3.23.0 - * - * @generic {any} T - * @genericUse {(string|T)} - [key] - * - * @param {(string|object)} key - The key to toggle the value for. - * - * @return {this} This GameObject. - */ - toggleData: function (key) - { - if (!this.data) - { - this.data = new DataManager(this); - } - - this.data.toggle(key); - - return this; - }, - - /** - * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. - * - * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: - * - * ```javascript - * sprite.getData('gold'); - * ``` - * - * Or access the value directly: - * - * ```javascript - * sprite.data.values.gold; - * ``` - * - * You can also pass in an array of keys, in which case an array of values will be returned: - * - * ```javascript - * sprite.getData([ 'gold', 'armor', 'health' ]); - * ``` - * - * This approach is useful for destructuring arrays in ES6. - * - * @method Phaser.GameObjects.GameObject#getData - * @since 3.0.0 - * - * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys. - * - * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array. - */ - getData: function (key) - { - if (!this.data) - { - this.data = new DataManager(this); - } - - return this.data.get(key); - }, - - /** - * Pass this Game Object to the Input Manager to enable it for Input. - * - * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area - * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced - * input detection. - * - * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If - * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific - * shape for it to use. - * - * You can also provide an Input Configuration Object as the only argument to this method. - * - * @example - * sprite.setInteractive(); - * - * @example - * sprite.setInteractive(new Phaser.Geom.Circle(45, 46, 45), Phaser.Geom.Circle.Contains); - * - * @example - * graphics.setInteractive(new Phaser.Geom.Rectangle(0, 0, 128, 128), Phaser.Geom.Rectangle.Contains); - * - * @method Phaser.GameObjects.GameObject#setInteractive - * @since 3.0.0 - * - * @param {(Phaser.Types.Input.InputConfiguration|any)} [hitArea] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not given it will try to create a Rectangle based on the texture frame. - * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The callback that determines if the pointer is within the Hit Area shape or not. If you provide a shape you must also provide a callback. - * @param {boolean} [dropZone=false] - Should this Game Object be treated as a drop zone target? - * - * @return {this} This GameObject. - */ - setInteractive: function (hitArea, hitAreaCallback, dropZone) - { - this.scene.sys.input.enable(this, hitArea, hitAreaCallback, dropZone); - - return this; - }, - - /** - * If this Game Object has previously been enabled for input, this will disable it. - * - * An object that is disabled for input stops processing or being considered for - * input events, but can be turned back on again at any time by simply calling - * `setInteractive()` with no arguments provided. - * - * If want to completely remove interaction from this Game Object then use `removeInteractive` instead. - * - * @method Phaser.GameObjects.GameObject#disableInteractive - * @since 3.7.0 - * - * @return {this} This GameObject. - */ - disableInteractive: function () - { - this.scene.sys.input.disable(this); - - return this; - }, - - /** - * If this Game Object has previously been enabled for input, this will queue it - * for removal, causing it to no longer be interactive. The removal happens on - * the next game step, it is not immediate. - * - * The Interactive Object that was assigned to this Game Object will be destroyed, - * removed from the Input Manager and cleared from this Game Object. - * - * If you wish to re-enable this Game Object at a later date you will need to - * re-create its InteractiveObject by calling `setInteractive` again. - * - * If you wish to only temporarily stop an object from receiving input then use - * `disableInteractive` instead, as that toggles the interactive state, where-as - * this erases it completely. - * - * If you wish to resize a hit area, don't remove and then set it as being - * interactive. Instead, access the hitarea object directly and resize the shape - * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the - * shape is a Rectangle, which it is by default.) - * - * @method Phaser.GameObjects.GameObject#removeInteractive - * @since 3.7.0 - * - * @return {this} This GameObject. - */ - removeInteractive: function () - { - this.scene.sys.input.clear(this); - - this.input = undefined; - - return this; - }, - - /** - * This callback is invoked when this Game Object is added to a Scene. - * - * Can be overriden by custom Game Objects, but be aware of some Game Objects that - * will use this, such as Sprites, to add themselves into the Update List. - * - * You can also listen for the `ADDED_TO_SCENE` event from this Game Object. - * - * @method Phaser.GameObjects.GameObject#addedToScene - * @since 3.50.0 - */ - addedToScene: function () - { - }, - - /** - * This callback is invoked when this Game Object is removed from a Scene. - * - * Can be overriden by custom Game Objects, but be aware of some Game Objects that - * will use this, such as Sprites, to removed themselves from the Update List. - * - * You can also listen for the `REMOVED_FROM_SCENE` event from this Game Object. - * - * @method Phaser.GameObjects.GameObject#removedFromScene - * @since 3.50.0 - */ - removedFromScene: function () - { - }, - - /** - * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. - * - * @method Phaser.GameObjects.GameObject#update - * @since 3.0.0 - * - * @param {...*} [args] - args - */ - update: function () - { - }, - - /** - * Returns a JSON representation of the Game Object. - * - * @method Phaser.GameObjects.GameObject#toJSON - * @since 3.0.0 - * - * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. - */ - toJSON: function () - { - return ComponentsToJSON(this); - }, - - /** - * Compares the renderMask with the renderFlags to see if this Game Object will render or not. - * Also checks the Game Object against the given Cameras exclusion list. - * - * @method Phaser.GameObjects.GameObject#willRender - * @since 3.0.0 - * - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object. - * - * @return {boolean} True if the Game Object should be rendered, otherwise false. - */ - willRender: function (camera) - { - var listWillRender = (this.displayList && this.displayList.active) ? this.displayList.willRender(camera) : true; - - return !(!listWillRender || GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); - }, - - /** - * Returns an array containing the display list index of either this Game Object, or if it has one, - * its parent Container. It then iterates up through all of the parent containers until it hits the - * root of the display list (which is index 0 in the returned array). - * - * Used internally by the InputPlugin but also useful if you wish to find out the display depth of - * this Game Object and all of its ancestors. - * - * @method Phaser.GameObjects.GameObject#getIndexList - * @since 3.4.0 - * - * @return {number[]} An array of display list position indexes. - */ - getIndexList: function () - { - // eslint-disable-next-line consistent-this - var child = this; - var parent = this.parentContainer; - - var indexes = []; - - while (parent) - { - indexes.unshift(parent.getIndex(child)); - - child = parent; - - if (!parent.parentContainer) - { - break; - } - else - { - parent = parent.parentContainer; - } - } - - if (this.displayList) - { - indexes.unshift(this.displayList.getIndex(child)); - } - else - { - indexes.unshift(this.scene.sys.displayList.getIndex(child)); - } - - return indexes; - }, - - /** - * Adds this Game Object to the given Display List. - * - * If no Display List is specified, it will default to the Display List owned by the Scene to which - * this Game Object belongs. - * - * A Game Object can only exist on one Display List at any given time, but may move freely between them. - * - * If this Game Object is already on another Display List when this method is called, it will first - * be removed from it, before being added to the new list. - * - * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. - * - * If a Game Object isn't on any display list, it will not be rendered. If you just wish to temporarly - * disable it from rendering, consider using the `setVisible` method, instead. - * - * @method Phaser.GameObjects.GameObject#addToDisplayList - * @fires Phaser.Scenes.Events#ADDED_TO_SCENE - * @fires Phaser.GameObjects.Events#ADDED_TO_SCENE - * @since 3.53.0 - * - * @param {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} [displayList] - The Display List to add to. Defaults to the Scene Display List. - * - * @return {this} This Game Object. - */ - addToDisplayList: function (displayList) - { - if (displayList === undefined) { displayList = this.scene.sys.displayList; } - - if (this.displayList && this.displayList !== displayList) - { - this.removeFromDisplayList(); - } - - // Don't repeat if it's already on this list - if (!displayList.exists(this)) - { - this.displayList = displayList; - - displayList.add(this, true); - - displayList.queueDepthSort(); - - this.emit(Events.ADDED_TO_SCENE, this, this.scene); - - displayList.events.emit(SceneEvents.ADDED_TO_SCENE, this, this.scene); - } - - return this; - }, - - /** - * Adds this Game Object to the Update List belonging to the Scene. - * - * When a Game Object is added to the Update List it will have its `preUpdate` method called - * every game frame. This method is passed two parameters: `delta` and `time`. - * - * If you wish to run your own logic within `preUpdate` then you should always call - * `preUpdate.super(delta, time)` within it, or it may fail to process required operations, - * such as Sprite animations. - * - * @method Phaser.GameObjects.GameObject#addToUpdateList - * @since 3.53.0 - * - * @return {this} This Game Object. - */ - addToUpdateList: function () - { - if (this.scene && this.preUpdate) - { - this.scene.sys.updateList.add(this); - } - - return this; - }, - - /** - * Removes this Game Object from the Display List it is currently on. - * - * A Game Object can only exist on one Display List at any given time, but may move freely removed - * and added back at a later stage. - * - * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. - * - * If a Game Object isn't on any Display List, it will not be rendered. If you just wish to temporarly - * disable it from rendering, consider using the `setVisible` method, instead. - * - * @method Phaser.GameObjects.GameObject#removeFromDisplayList - * @fires Phaser.Scenes.Events#REMOVED_FROM_SCENE - * @fires Phaser.GameObjects.Events#REMOVED_FROM_SCENE - * @since 3.53.0 - * - * @return {this} This Game Object. - */ - removeFromDisplayList: function () - { - var displayList = this.displayList || this.scene.sys.displayList; - - if (displayList && displayList.exists(this)) - { - displayList.remove(this, true); - - displayList.queueDepthSort(); - - this.displayList = null; - - this.emit(Events.REMOVED_FROM_SCENE, this, this.scene); - - displayList.events.emit(SceneEvents.REMOVED_FROM_SCENE, this, this.scene); - } - - return this; - }, - - /** - * Removes this Game Object from the Scene's Update List. - * - * When a Game Object is on the Update List, it will have its `preUpdate` method called - * every game frame. Calling this method will remove it from the list, preventing this. - * - * Removing a Game Object from the Update List will stop most internal functions working. - * For example, removing a Sprite from the Update List will prevent it from being able to - * run animations. - * - * @method Phaser.GameObjects.GameObject#removeFromUpdateList - * @since 3.53.0 - * - * @return {this} This Game Object. - */ - removeFromUpdateList: function () - { - if (this.scene && this.preUpdate) - { - this.scene.sys.updateList.remove(this); - } - - return this; - }, - - /** - * Destroys this Game Object removing it from the Display List and Update List and - * severing all ties to parent resources. - * - * Also removes itself from the Input Manager and Physics Manager if previously enabled. - * - * Use this to remove a Game Object from your game if you don't ever plan to use it again. - * As long as no reference to it exists within your own code it should become free for - * garbage collection by the browser. - * - * If you just want to temporarily disable an object then look at using the - * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. - * - * @method Phaser.GameObjects.GameObject#destroy - * @fires Phaser.GameObjects.Events#DESTROY - * @since 3.0.0 - * - * @param {boolean} [fromScene=false] - `True` if this Game Object is being destroyed by the Scene, `false` if not. - */ - destroy: function (fromScene) - { - // This Game Object has already been destroyed - if (!this.scene || this.ignoreDestroy) - { - return; - } - - if (fromScene === undefined) { fromScene = false; } - - if (this.preDestroy) - { - this.preDestroy.call(this); - } - - this.emit(Events.DESTROY, this, fromScene); - - this.removeAllListeners(); - - if (this.postPipelines) - { - this.resetPostPipeline(true); - } - - this.removeFromDisplayList(); - this.removeFromUpdateList(); - - if (this.input) - { - this.scene.sys.input.clear(this); - - this.input = undefined; - } - - if (this.data) - { - this.data.destroy(); - - this.data = undefined; - } - - if (this.body) - { - this.body.destroy(); - - this.body = undefined; - } - - this.active = false; - this.visible = false; - - this.scene = undefined; - this.parentContainer = undefined; - } - -}); - -/** - * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. - * - * @constant {number} RENDER_MASK - * @memberof Phaser.GameObjects.GameObject - * @default - */ -GameObject.RENDER_MASK = 15; - -module.exports = GameObject; - - -/***/ }), -/* 59 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Build a JSON representation of the given Game Object. - * - * This is typically extended further by Game Object specific implementations. - * - * @method Phaser.GameObjects.Components.ToJSON - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON. - * - * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. - */ -var ToJSON = function (gameObject) -{ - var out = { - name: gameObject.name, - type: gameObject.type, - x: gameObject.x, - y: gameObject.y, - depth: gameObject.depth, - scale: { - x: gameObject.scaleX, - y: gameObject.scaleY - }, - origin: { - x: gameObject.originX, - y: gameObject.originY - }, - flipX: gameObject.flipX, - flipY: gameObject.flipY, - rotation: gameObject.rotation, - alpha: gameObject.alpha, - visible: gameObject.visible, - blendMode: gameObject.blendMode, - textureKey: '', - frameKey: '', - data: {} - }; - - if (gameObject.texture) - { - out.textureKey = gameObject.texture.key; - out.frameKey = gameObject.frame.name; - } - - return out; -}; - -module.exports = ToJSON; - - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.GameObjects.Events - */ - -module.exports = { - - ADDED_TO_SCENE: __webpack_require__(235), - DESTROY: __webpack_require__(236), - REMOVED_FROM_SCENE: __webpack_require__(237), - VIDEO_COMPLETE: __webpack_require__(238), - VIDEO_CREATED: __webpack_require__(239), - VIDEO_ERROR: __webpack_require__(240), - VIDEO_LOOP: __webpack_require__(241), - VIDEO_PLAY: __webpack_require__(242), - VIDEO_SEEKED: __webpack_require__(243), - VIDEO_SEEKING: __webpack_require__(244), - VIDEO_STOP: __webpack_require__(245), - VIDEO_TIMEOUT: __webpack_require__(246), - VIDEO_UNLOCKED: __webpack_require__(247) - -}; - - -/***/ }), -/* 61 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var TransformMatrix = __webpack_require__(26); - -var tempMatrix1 = new TransformMatrix(); -var tempMatrix2 = new TransformMatrix(); -var tempMatrix3 = new TransformMatrix(); - -var result = { camera: tempMatrix1, sprite: tempMatrix2, calc: tempMatrix3 }; - -/** - * Calculates the Transform Matrix of the given Game Object and Camera, factoring in - * the parent matrix if provided. - * - * Note that the object this results contains _references_ to the Transform Matrices, - * not new instances of them. Therefore, you should use their values immediately, or - * copy them to your own matrix, as they will be replaced as soon as another Game - * Object is rendered. - * - * @function Phaser.GameObjects.GetCalcMatrix - * @memberof Phaser.GameObjects - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} src - The Game Object to calculate the transform matrix for. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera being used to render the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - The transform matrix of the parent container, if any. - * - * @return {Phaser.Types.GameObjects.GetCalcMatrixResults} The results object containing the updated transform matrices. - */ -var GetCalcMatrix = function (src, camera, parentMatrix) -{ - var camMatrix = tempMatrix1; - var spriteMatrix = tempMatrix2; - var calcMatrix = tempMatrix3; - - spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - } - else - { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - - return result; -}; - -module.exports = GetCalcMatrix; - - -/***/ }), -/* 62 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Transposes the elements of the given matrix (array of arrays). - * - * The transpose of a matrix is a new matrix whose rows are the columns of the original. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.TransposeMatrix - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [array,$return] - * - * @param {T[][]} [array] - The array matrix to transpose. - * - * @return {T[][]} A new array matrix which is a transposed version of the given array. - */ -var TransposeMatrix = function (array) -{ - var sourceRowCount = array.length; - var sourceColCount = array[0].length; - - var result = new Array(sourceColCount); - - for (var i = 0; i < sourceColCount; i++) - { - result[i] = new Array(sourceRowCount); - - for (var j = sourceRowCount - 1; j > -1; j--) - { - result[i][j] = array[j][i]; - } - } - - return result; -}; - -module.exports = TransposeMatrix; - - -/***/ }), -/* 63 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the start of the array to the end, shifting all items in the process. - * The "rotation" happens to the left. - * - * @function Phaser.Utils.Array.RotateLeft - * @since 3.0.0 - * - * @param {array} array - The array to shift to the left. This array is modified in place. - * @param {number} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateLeft = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.shift(); - array.push(element); - } - - return element; -}; - -module.exports = RotateLeft; - - -/***/ }), -/* 64 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the end of the array to the start, shifting all items in the process. - * The "rotation" happens to the right. - * - * @function Phaser.Utils.Array.RotateRight - * @since 3.0.0 - * - * @param {array} array - The array to shift to the right. This array is modified in place. - * @param {number} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateRight = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.pop(); - array.unshift(element); - } - - return element; -}; - -module.exports = RotateRight; - - -/***/ }), -/* 65 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Shuffles the contents of the given array using the Fisher-Yates implementation. - * - * The original array is modified directly and returned. - * - * @function Phaser.Utils.Array.Shuffle - * @since 3.0.0 - * - * @generic T - * @genericUse {T[]} - [array,$return] - * - * @param {T[]} array - The array to shuffle. This array is modified in place. - * - * @return {T[]} The shuffled array. - */ -var Shuffle = function (array) -{ - for (var i = array.length - 1; i > 0; i--) - { - var j = Math.floor(Math.random() * (i + 1)); - var temp = array[i]; - array[i] = array[j]; - array[j] = temp; - } - - return array; -}; - -module.exports = Shuffle; - - -/***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(302); -var Smoothing = __webpack_require__(304); - -// The pool into which the canvas elements are placed. -var pool = []; - -// Automatically apply smoothing(false) to created Canvas elements -var _disableContextSmoothing = false; - -/** - * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. - * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, - * which is useless for some of the Phaser pipelines / renderer. - * - * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. - * Which means all instances of Phaser Games on the same page can share the one single pool. - * - * @namespace Phaser.Display.Canvas.CanvasPool - * @since 3.0.0 - */ -var CanvasPool = function () -{ - /** - * Creates a new Canvas DOM element, or pulls one from the pool if free. - * - * @function Phaser.Display.Canvas.CanvasPool.create - * @since 3.0.0 - * - * @param {*} parent - The parent of the Canvas object. - * @param {number} [width=1] - The width of the Canvas. - * @param {number} [height=1] - The height of the Canvas. - * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. - * @param {boolean} [selfParent=false] - Use the generated Canvas element as the parent? - * - * @return {HTMLCanvasElement} The canvas element that was created or pulled from the pool - */ - var create = function (parent, width, height, canvasType, selfParent) - { - if (width === undefined) { width = 1; } - if (height === undefined) { height = 1; } - if (canvasType === undefined) { canvasType = CONST.CANVAS; } - if (selfParent === undefined) { selfParent = false; } - - var canvas; - var container = first(canvasType); - - if (container === null) - { - container = { - parent: parent, - canvas: document.createElement('canvas'), - type: canvasType - }; - - if (canvasType === CONST.CANVAS) - { - pool.push(container); - } - - canvas = container.canvas; - } - else - { - container.parent = parent; - - canvas = container.canvas; - } - - if (selfParent) - { - container.parent = canvas; - } - - canvas.width = width; - canvas.height = height; - - if (_disableContextSmoothing && canvasType === CONST.CANVAS) - { - Smoothing.disable(canvas.getContext('2d')); - } - - return canvas; - }; - - /** - * Creates a new Canvas DOM element, or pulls one from the pool if free. - * - * @function Phaser.Display.Canvas.CanvasPool.create2D - * @since 3.0.0 - * - * @param {*} parent - The parent of the Canvas object. - * @param {number} [width=1] - The width of the Canvas. - * @param {number} [height=1] - The height of the Canvas. - * - * @return {HTMLCanvasElement} The created canvas. - */ - var create2D = function (parent, width, height) - { - return create(parent, width, height, CONST.CANVAS); - }; - - /** - * Creates a new Canvas DOM element, or pulls one from the pool if free. - * - * @function Phaser.Display.Canvas.CanvasPool.createWebGL - * @since 3.0.0 - * - * @param {*} parent - The parent of the Canvas object. - * @param {number} [width=1] - The width of the Canvas. - * @param {number} [height=1] - The height of the Canvas. - * - * @return {HTMLCanvasElement} The created WebGL canvas. - */ - var createWebGL = function (parent, width, height) - { - return create(parent, width, height, CONST.WEBGL); - }; - - /** - * Gets the first free canvas index from the pool. - * - * @function Phaser.Display.Canvas.CanvasPool.first - * @since 3.0.0 - * - * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. - * - * @return {HTMLCanvasElement} The first free canvas, or `null` if a WebGL canvas was requested or if the pool doesn't have free canvases. - */ - var first = function (canvasType) - { - if (canvasType === undefined) { canvasType = CONST.CANVAS; } - - if (canvasType === CONST.WEBGL) - { - return null; - } - - for (var i = 0; i < pool.length; i++) - { - var container = pool[i]; - - if (!container.parent && container.type === canvasType) - { - return container; - } - } - - return null; - }; - - /** - * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use. - * The canvas has its width and height set to 1, and its parent attribute nulled. - * - * @function Phaser.Display.Canvas.CanvasPool.remove - * @since 3.0.0 - * - * @param {*} parent - The canvas or the parent of the canvas to free. - */ - var remove = function (parent) - { - // Check to see if the parent is a canvas object - var isCanvas = parent instanceof HTMLCanvasElement; - - pool.forEach(function (container) - { - if ((isCanvas && container.canvas === parent) || (!isCanvas && container.parent === parent)) - { - container.parent = null; - container.canvas.width = 1; - container.canvas.height = 1; - } - }); - }; - - /** - * Gets the total number of used canvas elements in the pool. - * - * @function Phaser.Display.Canvas.CanvasPool.total - * @since 3.0.0 - * - * @return {number} The number of used canvases. - */ - var total = function () - { - var c = 0; - - pool.forEach(function (container) - { - if (container.parent) - { - c++; - } - }); - - return c; - }; - - /** - * Gets the total number of free canvas elements in the pool. - * - * @function Phaser.Display.Canvas.CanvasPool.free - * @since 3.0.0 - * - * @return {number} The number of free canvases. - */ - var free = function () - { - return pool.length - total(); - }; - - /** - * Disable context smoothing on any new Canvas element created. - * - * @function Phaser.Display.Canvas.CanvasPool.disableSmoothing - * @since 3.0.0 - */ - var disableSmoothing = function () - { - _disableContextSmoothing = true; - }; - - /** - * Enable context smoothing on any new Canvas element created. - * - * @function Phaser.Display.Canvas.CanvasPool.enableSmoothing - * @since 3.0.0 - */ - var enableSmoothing = function () - { - _disableContextSmoothing = false; - }; - - return { - create2D: create2D, - create: create, - createWebGL: createWebGL, - disableSmoothing: disableSmoothing, - enableSmoothing: enableSmoothing, - first: first, - free: free, - pool: pool, - remove: remove, - total: total - }; -}; - -// If we export the called function here, it'll only be invoked once (not every time it's required). -module.exports = CanvasPool(); - - -/***/ }), -/* 67 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Perimeter = __webpack_require__(68); -var Point = __webpack_require__(12); - -/** - * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * - * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * - * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. - * - * @function Phaser.Geom.Rectangle.GetPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [out,$return] - * - * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle to get the perimeter point from. - * @param {number} position - The normalized distance into the Rectangle's perimeter to return. - * @param {(Phaser.Geom.Point|object)} [out] - An object to update with the `x` and `y` coordinates of the point. - * - * @return {Phaser.Geom.Point} The updated `output` object, or a new Point if no `output` object was given. - */ -var GetPoint = function (rectangle, position, out) -{ - if (out === undefined) { out = new Point(); } - - if (position <= 0 || position >= 1) - { - out.x = rectangle.x; - out.y = rectangle.y; - - return out; - } - - var p = Perimeter(rectangle) * position; - - if (position > 0.5) - { - p -= (rectangle.width + rectangle.height); - - if (p <= rectangle.width) - { - // Face 3 - out.x = rectangle.right - p; - out.y = rectangle.bottom; - } - else - { - // Face 4 - out.x = rectangle.x; - out.y = rectangle.bottom - (p - rectangle.width); - } - } - else if (p <= rectangle.width) - { - // Face 1 - out.x = rectangle.x + p; - out.y = rectangle.y; - } - else - { - // Face 2 - out.x = rectangle.right; - out.y = rectangle.y + (p - rectangle.width); - } - - return out; -}; - -module.exports = GetPoint; - - -/***/ }), -/* 68 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates the perimeter of a Rectangle. - * - * @function Phaser.Geom.Rectangle.Perimeter - * @since 3.0.0 - * - * @param {Phaser.Geom.Rectangle} rect - The Rectangle to use. - * - * @return {number} The perimeter of the Rectangle, equal to `(width * 2) + (height * 2)`. - */ -var Perimeter = function (rect) -{ - return 2 * (rect.width + rect.height); -}; - -module.exports = Perimeter; - - -/***/ }), -/* 69 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Clamp = __webpack_require__(1); -var Extend = __webpack_require__(19); - -/** - * @classdesc - * A Frame is a section of a Texture. - * - * @class Frame - * @memberof Phaser.Textures - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Textures.Texture} texture - The Texture this Frame is a part of. - * @param {(number|string)} name - The name of this Frame. The name is unique within the Texture. - * @param {number} sourceIndex - The index of the TextureSource that this Frame is a part of. - * @param {number} x - The x coordinate of the top-left of this Frame. - * @param {number} y - The y coordinate of the top-left of this Frame. - * @param {number} width - The width of this Frame. - * @param {number} height - The height of this Frame. - */ -var Frame = new Class({ - - initialize: - - function Frame (texture, name, sourceIndex, x, y, width, height) - { - /** - * The Texture this Frame is a part of. - * - * @name Phaser.Textures.Frame#texture - * @type {Phaser.Textures.Texture} - * @since 3.0.0 - */ - this.texture = texture; - - /** - * The name of this Frame. - * The name is unique within the Texture. - * - * @name Phaser.Textures.Frame#name - * @type {string} - * @since 3.0.0 - */ - this.name = name; - - /** - * The TextureSource this Frame is part of. - * - * @name Phaser.Textures.Frame#source - * @type {Phaser.Textures.TextureSource} - * @since 3.0.0 - */ - this.source = texture.source[sourceIndex]; - - /** - * The index of the TextureSource in the Texture sources array. - * - * @name Phaser.Textures.Frame#sourceIndex - * @type {number} - * @since 3.0.0 - */ - this.sourceIndex = sourceIndex; - - /** - * A reference to the Texture Source WebGL Texture that this Frame is using. - * - * @name Phaser.Textures.Frame#glTexture - * @type {?WebGLTexture} - * @default null - * @since 3.11.0 - */ - this.glTexture = this.source.glTexture; - - /** - * X position within the source image to cut from. - * - * @name Phaser.Textures.Frame#cutX - * @type {number} - * @since 3.0.0 - */ - this.cutX; - - /** - * Y position within the source image to cut from. - * - * @name Phaser.Textures.Frame#cutY - * @type {number} - * @since 3.0.0 - */ - this.cutY; - - /** - * The width of the area in the source image to cut. - * - * @name Phaser.Textures.Frame#cutWidth - * @type {number} - * @since 3.0.0 - */ - this.cutWidth; - - /** - * The height of the area in the source image to cut. - * - * @name Phaser.Textures.Frame#cutHeight - * @type {number} - * @since 3.0.0 - */ - this.cutHeight; - - /** - * The X rendering offset of this Frame, taking trim into account. - * - * @name Phaser.Textures.Frame#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The Y rendering offset of this Frame, taking trim into account. - * - * @name Phaser.Textures.Frame#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - /** - * The rendering width of this Frame, taking trim into account. - * - * @name Phaser.Textures.Frame#width - * @type {number} - * @since 3.0.0 - */ - this.width; - - /** - * The rendering height of this Frame, taking trim into account. - * - * @name Phaser.Textures.Frame#height - * @type {number} - * @since 3.0.0 - */ - this.height; - - /** - * Half the width, floored. - * Precalculated for the renderer. - * - * @name Phaser.Textures.Frame#halfWidth - * @type {number} - * @since 3.0.0 - */ - this.halfWidth; - - /** - * Half the height, floored. - * Precalculated for the renderer. - * - * @name Phaser.Textures.Frame#halfHeight - * @type {number} - * @since 3.0.0 - */ - this.halfHeight; - - /** - * The x center of this frame, floored. - * - * @name Phaser.Textures.Frame#centerX - * @type {number} - * @since 3.0.0 - */ - this.centerX; - - /** - * The y center of this frame, floored. - * - * @name Phaser.Textures.Frame#centerY - * @type {number} - * @since 3.0.0 - */ - this.centerY; - - /** - * The horizontal pivot point of this Frame. - * - * @name Phaser.Textures.Frame#pivotX - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.pivotX = 0; - - /** - * The vertical pivot point of this Frame. - * - * @name Phaser.Textures.Frame#pivotY - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.pivotY = 0; - - /** - * Does this Frame have a custom pivot point? - * - * @name Phaser.Textures.Frame#customPivot - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.customPivot = false; - - /** - * **CURRENTLY UNSUPPORTED** - * - * Is this frame is rotated or not in the Texture? - * Rotation allows you to use rotated frames in texture atlas packing. - * It has nothing to do with Sprite rotation. - * - * @name Phaser.Textures.Frame#rotated - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.rotated = false; - - /** - * Over-rides the Renderer setting. - * -1 = use Renderer Setting - * 0 = No rounding - * 1 = Round - * - * @name Phaser.Textures.Frame#autoRound - * @type {number} - * @default -1 - * @since 3.0.0 - */ - this.autoRound = -1; - - /** - * Any Frame specific custom data can be stored here. - * - * @name Phaser.Textures.Frame#customData - * @type {object} - * @since 3.0.0 - */ - this.customData = {}; - - /** - * WebGL UV u0 value. - * - * @name Phaser.Textures.Frame#u0 - * @type {number} - * @default 0 - * @since 3.11.0 - */ - this.u0 = 0; - - /** - * WebGL UV v0 value. - * - * @name Phaser.Textures.Frame#v0 - * @type {number} - * @default 0 - * @since 3.11.0 - */ - this.v0 = 0; - - /** - * WebGL UV u1 value. - * - * @name Phaser.Textures.Frame#u1 - * @type {number} - * @default 0 - * @since 3.11.0 - */ - this.u1 = 0; - - /** - * WebGL UV v1 value. - * - * @name Phaser.Textures.Frame#v1 - * @type {number} - * @default 0 - * @since 3.11.0 - */ - this.v1 = 0; - - /** - * The un-modified source frame, trim and UV data. - * - * @name Phaser.Textures.Frame#data - * @type {object} - * @private - * @since 3.0.0 - */ - this.data = { - cut: { - x: 0, - y: 0, - w: 0, - h: 0, - r: 0, - b: 0 - }, - trim: false, - sourceSize: { - w: 0, - h: 0 - }, - spriteSourceSize: { - x: 0, - y: 0, - w: 0, - h: 0, - r: 0, - b: 0 - }, - radius: 0, - drawImage: { - x: 0, - y: 0, - width: 0, - height: 0 - } - }; - - this.setSize(width, height, x, y); - }, - - /** - * Sets the width, height, x and y of this Frame. - * - * This is called automatically by the constructor - * and should rarely be changed on-the-fly. - * - * @method Phaser.Textures.Frame#setSize - * @since 3.7.0 - * - * @param {number} width - The width of the frame before being trimmed. - * @param {number} height - The height of the frame before being trimmed. - * @param {number} [x=0] - The x coordinate of the top-left of this Frame. - * @param {number} [y=0] - The y coordinate of the top-left of this Frame. - * - * @return {this} This Frame object. - */ - setSize: function (width, height, x, y) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - - this.cutX = x; - this.cutY = y; - this.cutWidth = width; - this.cutHeight = height; - - this.width = width; - this.height = height; - - this.halfWidth = Math.floor(width * 0.5); - this.halfHeight = Math.floor(height * 0.5); - - this.centerX = Math.floor(width / 2); - this.centerY = Math.floor(height / 2); - - var data = this.data; - var cut = data.cut; - - cut.x = x; - cut.y = y; - cut.w = width; - cut.h = height; - cut.r = x + width; - cut.b = y + height; - - data.sourceSize.w = width; - data.sourceSize.h = height; - - data.spriteSourceSize.w = width; - data.spriteSourceSize.h = height; - - data.radius = 0.5 * Math.sqrt(width * width + height * height); - - var drawImage = data.drawImage; - - drawImage.x = x; - drawImage.y = y; - drawImage.width = width; - drawImage.height = height; - - return this.updateUVs(); - }, - - /** - * If the frame was trimmed when added to the Texture Atlas, this records the trim and source data. - * - * @method Phaser.Textures.Frame#setTrim - * @since 3.0.0 - * - * @param {number} actualWidth - The width of the frame before being trimmed. - * @param {number} actualHeight - The height of the frame before being trimmed. - * @param {number} destX - The destination X position of the trimmed frame for display. - * @param {number} destY - The destination Y position of the trimmed frame for display. - * @param {number} destWidth - The destination width of the trimmed frame for display. - * @param {number} destHeight - The destination height of the trimmed frame for display. - * - * @return {this} This Frame object. - */ - setTrim: function (actualWidth, actualHeight, destX, destY, destWidth, destHeight) - { - var data = this.data; - var ss = data.spriteSourceSize; - - // Store actual values - - data.trim = true; - - data.sourceSize.w = actualWidth; - data.sourceSize.h = actualHeight; - - ss.x = destX; - ss.y = destY; - ss.w = destWidth; - ss.h = destHeight; - ss.r = destX + destWidth; - ss.b = destY + destHeight; - - // Adjust properties - this.x = destX; - this.y = destY; - - this.width = destWidth; - this.height = destHeight; - - this.halfWidth = destWidth * 0.5; - this.halfHeight = destHeight * 0.5; - - this.centerX = Math.floor(destWidth / 2); - this.centerY = Math.floor(destHeight / 2); - - return this.updateUVs(); - }, - - /** - * Takes a crop data object and, based on the rectangular region given, calculates the - * required UV coordinates in order to crop this Frame for WebGL and Canvas rendering. - * - * This is called directly by the Game Object Texture Components `setCrop` method. - * Please use that method to crop a Game Object. - * - * @method Phaser.Textures.Frame#setCropUVs - * @since 3.11.0 - * - * @param {object} crop - The crop data object. This is the `GameObject._crop` property. - * @param {number} x - The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. - * @param {number} y - The y coordinate to start the crop from. Cannot be negative or exceed the Frame height. - * @param {number} width - The width of the crop rectangle. Cannot exceed the Frame width. - * @param {number} height - The height of the crop rectangle. Cannot exceed the Frame height. - * @param {boolean} flipX - Does the parent Game Object have flipX set? - * @param {boolean} flipY - Does the parent Game Object have flipY set? - * - * @return {object} The updated crop data object. - */ - setCropUVs: function (crop, x, y, width, height, flipX, flipY) - { - // Clamp the input values - - var cx = this.cutX; - var cy = this.cutY; - var cw = this.cutWidth; - var ch = this.cutHeight; - var rw = this.realWidth; - var rh = this.realHeight; - - x = Clamp(x, 0, rw); - y = Clamp(y, 0, rh); - - width = Clamp(width, 0, rw - x); - height = Clamp(height, 0, rh - y); - - var ox = cx + x; - var oy = cy + y; - var ow = width; - var oh = height; - - var data = this.data; - - if (data.trim) - { - var ss = data.spriteSourceSize; - - // Need to check for intersection between the cut area and the crop area - // If there is none, we set UV to be empty, otherwise set it to be the intersection area - - width = Clamp(width, 0, cw - x); - height = Clamp(height, 0, ch - y); - - var cropRight = x + width; - var cropBottom = y + height; - - var intersects = !(ss.r < x || ss.b < y || ss.x > cropRight || ss.y > cropBottom); - - if (intersects) - { - var ix = Math.max(ss.x, x); - var iy = Math.max(ss.y, y); - var iw = Math.min(ss.r, cropRight) - ix; - var ih = Math.min(ss.b, cropBottom) - iy; - - ow = iw; - oh = ih; - - if (flipX) - { - ox = cx + (cw - (ix - ss.x) - iw); - } - else - { - ox = cx + (ix - ss.x); - } - - if (flipY) - { - oy = cy + (ch - (iy - ss.y) - ih); - } - else - { - oy = cy + (iy - ss.y); - } - - x = ix; - y = iy; - - width = iw; - height = ih; - } - else - { - ox = 0; - oy = 0; - ow = 0; - oh = 0; - } - } - else - { - if (flipX) - { - ox = cx + (cw - x - width); - } - - if (flipY) - { - oy = cy + (ch - y - height); - } - } - - var tw = this.source.width; - var th = this.source.height; - - // Map the given coordinates into UV space, clamping to the 0-1 range. - - crop.u0 = Math.max(0, ox / tw); - crop.v0 = Math.max(0, oy / th); - crop.u1 = Math.min(1, (ox + ow) / tw); - crop.v1 = Math.min(1, (oy + oh) / th); - - crop.x = x; - crop.y = y; - - crop.cx = ox; - crop.cy = oy; - crop.cw = ow; - crop.ch = oh; - - crop.width = width; - crop.height = height; - - crop.flipX = flipX; - crop.flipY = flipY; - - return crop; - }, - - /** - * Takes a crop data object and recalculates the UVs based on the dimensions inside the crop object. - * Called automatically by `setFrame`. - * - * @method Phaser.Textures.Frame#updateCropUVs - * @since 3.11.0 - * - * @param {object} crop - The crop data object. This is the `GameObject._crop` property. - * @param {boolean} flipX - Does the parent Game Object have flipX set? - * @param {boolean} flipY - Does the parent Game Object have flipY set? - * - * @return {object} The updated crop data object. - */ - updateCropUVs: function (crop, flipX, flipY) - { - return this.setCropUVs(crop, crop.x, crop.y, crop.width, crop.height, flipX, flipY); - }, - - /** - * Directly sets the canvas and WebGL UV data for this frame. - * - * Use this if you need to override the values that are generated automatically - * when the Frame is created. - * - * @method Phaser.Textures.Frame#setUVs - * @since 3.50.0 - * - * @param {number} width - Width of this frame for the Canvas data. - * @param {number} height - Height of this frame for the Canvas data. - * @param {number} u0 - UV u0 value. - * @param {number} v0 - UV v0 value. - * @param {number} u1 - UV u1 value. - * @param {number} v1 - UV v1 value. - * - * @return {this} This Frame object. - */ - setUVs: function (width, height, u0, v0, u1, v1) - { - // Canvas data - - var cd = this.data.drawImage; - - cd.width = width; - cd.height = height; - - // WebGL data - - this.u0 = u0; - this.v0 = v0; - - this.u1 = u1; - this.v1 = v1; - - return this; - }, - - /** - * Updates the internal WebGL UV cache and the drawImage cache. - * - * @method Phaser.Textures.Frame#updateUVs - * @since 3.0.0 - * - * @return {this} This Frame object. - */ - updateUVs: function () - { - var cx = this.cutX; - var cy = this.cutY; - var cw = this.cutWidth; - var ch = this.cutHeight; - - // Canvas data - - var cd = this.data.drawImage; - - cd.width = cw; - cd.height = ch; - - // WebGL data - - var tw = this.source.width; - var th = this.source.height; - - this.u0 = cx / tw; - this.v0 = cy / th; - - this.u1 = (cx + cw) / tw; - this.v1 = (cy + ch) / th; - - return this; - }, - - /** - * Updates the internal WebGL UV cache. - * - * @method Phaser.Textures.Frame#updateUVsInverted - * @since 3.0.0 - * - * @return {this} This Frame object. - */ - updateUVsInverted: function () - { - var tw = this.source.width; - var th = this.source.height; - - this.u0 = (this.cutX + this.cutHeight) / tw; - this.v0 = this.cutY / th; - - this.u1 = this.cutX / tw; - this.v1 = (this.cutY + this.cutWidth) / th; - - return this; - }, - - /** - * Clones this Frame into a new Frame object. - * - * @method Phaser.Textures.Frame#clone - * @since 3.0.0 - * - * @return {Phaser.Textures.Frame} A clone of this Frame. - */ - clone: function () - { - var clone = new Frame(this.texture, this.name, this.sourceIndex); - - clone.cutX = this.cutX; - clone.cutY = this.cutY; - clone.cutWidth = this.cutWidth; - clone.cutHeight = this.cutHeight; - - clone.x = this.x; - clone.y = this.y; - - clone.width = this.width; - clone.height = this.height; - - clone.halfWidth = this.halfWidth; - clone.halfHeight = this.halfHeight; - - clone.centerX = this.centerX; - clone.centerY = this.centerY; - - clone.rotated = this.rotated; - - clone.data = Extend(true, clone.data, this.data); - - clone.updateUVs(); - - return clone; - }, - - /** - * Destroys this Frame by nulling its reference to the parent Texture and and data objects. - * - * @method Phaser.Textures.Frame#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.source = null; - this.texture = null; - this.glTexture = null; - this.customData = null; - this.data = null; - }, - - /** - * The width of the Frame in its un-trimmed, un-padded state, as prepared in the art package, - * before being packed. - * - * @name Phaser.Textures.Frame#realWidth - * @type {number} - * @readonly - * @since 3.0.0 - */ - realWidth: { - - get: function () - { - return this.data.sourceSize.w; - } - - }, - - /** - * The height of the Frame in its un-trimmed, un-padded state, as prepared in the art package, - * before being packed. - * - * @name Phaser.Textures.Frame#realHeight - * @type {number} - * @readonly - * @since 3.0.0 - */ - realHeight: { - - get: function () - { - return this.data.sourceSize.h; - } - - }, - - /** - * The radius of the Frame (derived from sqrt(w * w + h * h) / 2) - * - * @name Phaser.Textures.Frame#radius - * @type {number} - * @readonly - * @since 3.0.0 - */ - radius: { - - get: function () - { - return this.data.radius; - } - - }, - - /** - * Is the Frame trimmed or not? - * - * @name Phaser.Textures.Frame#trimmed - * @type {boolean} - * @readonly - * @since 3.0.0 - */ - trimmed: { - - get: function () - { - return this.data.trim; - } - - }, - - /** - * The Canvas drawImage data object. - * - * @name Phaser.Textures.Frame#canvasData - * @type {object} - * @readonly - * @since 3.0.0 - */ - canvasData: { - - get: function () - { - return this.data.drawImage; - } - - } - -}); - -module.exports = Frame; - - -/***/ }), -/* 70 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 3524: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -26211,21 +12392,282 @@ module.exports = Frame; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var BuildGameObject = __webpack_require__(71); -var Class = __webpack_require__(0); -var GetValue = __webpack_require__(8); -var ResizeEvent = __webpack_require__(185); -var ScenePlugin = __webpack_require__(186); -var SpineCanvas = __webpack_require__(47); -var SpineWebgl = __webpack_require__(47); +var Class = __webpack_require__(7473); +var GetFastValue = __webpack_require__(4597); +var ImageFile = __webpack_require__(6732); +var IsPlainObject = __webpack_require__(2482); +var JSONFile = __webpack_require__(704); +var MultiFile = __webpack_require__(3137); +var TextFile = __webpack_require__(1192); + +/** + * @typedef {object} Phaser.Loader.FileTypes.SpineFileConfig + * + * @property {string} key - The key of the file. Must be unique within both the Loader and the Texture Manager. + * @property {string|string[]} [jsonURL] - The absolute or relative URL to load the JSON file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @property {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @property {boolean} [preMultipliedAlpha=false] - Do the textures contain pre-multiplied alpha or not? + * @property {XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. + * @property {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. + */ + +/** + * @classdesc + * A Spine File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#spine method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spine. + * + * @class SpineFile + * @extends Phaser.Loader.MultiFile + * @memberof Phaser.Loader.FileTypes + * @constructor + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Loader.FileTypes.SpineFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [jsonURL] - The absolute or relative URL to load the JSON file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {boolean} [preMultipliedAlpha=false] - Do the textures contain pre-multiplied alpha or not? + * @param {XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. + * @param {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. + */ +var SpineFile = new Class({ + + Extends: MultiFile, + + initialize: + + function SpineFile (loader, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings) + { + var i; + var json; + var atlas; + var files = []; + var cache = loader.cacheManager.custom.spine; + + // atlas can be an array of atlas files, not just a single one + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + + json = new JSONFile(loader, { + key: key, + url: GetFastValue(config, 'jsonURL'), + extension: GetFastValue(config, 'jsonExtension', 'json'), + xhrSettings: GetFastValue(config, 'jsonXhrSettings') + }); + + atlasURL = GetFastValue(config, 'atlasURL'); + preMultipliedAlpha = GetFastValue(config, 'preMultipliedAlpha'); + + if (!Array.isArray(atlasURL)) + { + atlasURL = [ atlasURL ]; + } + + for (i = 0; i < atlasURL.length; i++) + { + atlas = new TextFile(loader, { + key: key + '!' + i, + url: atlasURL[i], + extension: GetFastValue(config, 'atlasExtension', 'atlas'), + xhrSettings: GetFastValue(config, 'atlasXhrSettings') + }); + + atlas.cache = cache; + + files.push(atlas); + } + } + else + { + json = new JSONFile(loader, key, jsonURL, jsonXhrSettings); + + if (!Array.isArray(atlasURL)) + { + atlasURL = [ atlasURL ]; + } + + for (i = 0; i < atlasURL.length; i++) + { + atlas = new TextFile(loader, key + '!' + i, atlasURL[i], atlasXhrSettings); + atlas.cache = cache; + + files.push(atlas); + } + } + + files.unshift(json); + + MultiFile.call(this, loader, 'spine', key, files); + + this.config.preMultipliedAlpha = preMultipliedAlpha; + }, + + /** + * Called by each File when it finishes loading. + * + * @method Phaser.Loader.FileTypes.SpineFile#onFileComplete + * @since 3.19.0 + * + * @param {Phaser.Loader.File} file - The File that has completed processing. + */ + onFileComplete: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.pending--; + + if (file.type === 'text') + { + // Inspect the data for the files to now load + var content = file.data.split('\n'); + + // Extract the textures + var textures = [ content[0] ]; + + for (var t = 0; t < content.length; t++) + { + var line = content[t]; + + if (line.trim() === '' && t < content.length - 1) + { + line = content[t + 1]; + + textures.push(line); + } + } + + var config = this.config; + var loader = this.loader; + + var currentBaseURL = loader.baseURL; + var currentPath = loader.path; + var currentPrefix = loader.prefix; + + var baseURL = GetFastValue(config, 'baseURL', this.baseURL); + var path = GetFastValue(config, 'path', file.src.match(/^.*\//))[0]; + var prefix = GetFastValue(config, 'prefix', this.prefix); + var textureXhrSettings = GetFastValue(config, 'textureXhrSettings'); + + loader.setBaseURL(baseURL); + loader.setPath(path); + loader.setPrefix(prefix); + + for (var i = 0; i < textures.length; i++) + { + var textureURL = textures[i]; + + var key = textureURL; + + var image = new ImageFile(loader, key, textureURL, textureXhrSettings); + + if (!loader.keyExists(image)) + { + this.addToMultiFile(image); + + loader.addFile(image); + } + } + + // Reset the loader settings + loader.setBaseURL(currentBaseURL); + loader.setPath(currentPath); + loader.setPrefix(currentPrefix); + } + } + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.SpineFile#addToCache + * @since 3.19.0 + */ + addToCache: function () + { + if (this.isReadyToProcess()) + { + var fileJSON = this.files[0]; + + fileJSON.addToCache(); + + var atlasCache; + var atlasKey = ''; + var combinedAtlasData = ''; + var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false; + var textureManager = this.loader.textureManager; + + for (var i = 1; i < this.files.length; i++) + { + var file = this.files[i]; + + if (file.type === 'text') + { + atlasKey = file.key.replace(/![\d]$/, ''); + + atlasCache = file.cache; + + combinedAtlasData = combinedAtlasData.concat(file.data); + } + else + { + var src = file.key.trim(); + var pos = src.indexOf('!'); + var key = src.substr(pos + 1); + + if (!textureManager.exists(key)) + { + textureManager.addImage(key, file.data); + } + } + + file.pendingDestroy(); + } + + atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlasData, prefix: this.prefix }); + + this.complete = true; + } + } + +}); + +module.exports = SpineFile; + + +/***/ }), + +/***/ 4513: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var BuildGameObject = __webpack_require__(2494); +var Class = __webpack_require__(7473); +var GetValue = __webpack_require__(5851); +var ResizeEvent = __webpack_require__(3527); +var ScenePlugin = __webpack_require__(5722); +var SpineCanvas = __webpack_require__(6937); +var SpineWebgl = __webpack_require__(6937); var Spine = { canvas: SpineCanvas, webgl: SpineWebgl }; -var SpineFile = __webpack_require__(210); -var SpineGameObject = __webpack_require__(226); -var SpineContainer = __webpack_require__(258); -var NOOP = __webpack_require__(2); +var SpineFile = __webpack_require__(3524); +var SpineGameObject = __webpack_require__(8332); +var SpineContainer = __webpack_require__(5782); +var NOOP = __webpack_require__(1984); /** * @classdesc @@ -26845,6 +13287,7 @@ var SpinePlugin = new Class({ * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the Spine json file. Used in replacement of the Loaders default XHR Settings. * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the Spine atlas file. Used in replacement of the Loaders default XHR Settings. * @param {object} [settings] - An external Settings configuration object { prefix: '' } + * * @return {Phaser.Loader.LoaderPlugin} The Loader instance. */ spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings, settings) @@ -27456,6454 +13899,9 @@ module.exports = SpinePlugin; /***/ }), -/* 71 */ -/***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BlendModes = __webpack_require__(13); -var GetAdvancedValue = __webpack_require__(72); - -/** - * Builds a Game Object using the provided configuration object. - * - * @function Phaser.GameObjects.BuildGameObject - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene. - * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject. - * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with. - * - * @return {Phaser.GameObjects.GameObject} The built Game Object. - */ -var BuildGameObject = function (scene, gameObject, config) -{ - // Position - - gameObject.x = GetAdvancedValue(config, 'x', 0); - gameObject.y = GetAdvancedValue(config, 'y', 0); - gameObject.depth = GetAdvancedValue(config, 'depth', 0); - - // Flip - - gameObject.flipX = GetAdvancedValue(config, 'flipX', false); - gameObject.flipY = GetAdvancedValue(config, 'flipY', false); - - // Scale - // Either: { scale: 2 } or { scale: { x: 2, y: 2 }} - - var scale = GetAdvancedValue(config, 'scale', null); - - if (typeof scale === 'number') - { - gameObject.setScale(scale); - } - else if (scale !== null) - { - gameObject.scaleX = GetAdvancedValue(scale, 'x', 1); - gameObject.scaleY = GetAdvancedValue(scale, 'y', 1); - } - - // ScrollFactor - // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }} - - var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null); - - if (typeof scrollFactor === 'number') - { - gameObject.setScrollFactor(scrollFactor); - } - else if (scrollFactor !== null) - { - gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1); - gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1); - } - - // Rotation - - gameObject.rotation = GetAdvancedValue(config, 'rotation', 0); - - var angle = GetAdvancedValue(config, 'angle', null); - - if (angle !== null) - { - gameObject.angle = angle; - } - - // Alpha - - gameObject.alpha = GetAdvancedValue(config, 'alpha', 1); - - // Origin - // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }} - - var origin = GetAdvancedValue(config, 'origin', null); - - if (typeof origin === 'number') - { - gameObject.setOrigin(origin); - } - else if (origin !== null) - { - var ox = GetAdvancedValue(origin, 'x', 0.5); - var oy = GetAdvancedValue(origin, 'y', 0.5); - - gameObject.setOrigin(ox, oy); - } - - // BlendMode - - gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL); - - // Visible - - gameObject.visible = GetAdvancedValue(config, 'visible', true); - - // Add to Scene - - var add = GetAdvancedValue(config, 'add', true); - - if (add) - { - scene.sys.displayList.add(gameObject); - } - - if (gameObject.preUpdate) - { - scene.sys.updateList.add(gameObject); - } - - return gameObject; -}; - -module.exports = BuildGameObject; - - -/***/ }), -/* 72 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MATH = __webpack_require__(73); -var GetValue = __webpack_require__(8); - -/** - * Retrieves a value from an object. Allows for more advanced selection options, including: - * - * Allowed types: - * - * Implicit - * { - * x: 4 - * } - * - * From function - * { - * x: function () - * } - * - * Randomly pick one element from the array - * { - * x: [a, b, c, d, e, f] - * } - * - * Random integer between min and max: - * { - * x: { randInt: [min, max] } - * } - * - * Random float between min and max: - * { - * x: { randFloat: [min, max] } - * } - * - * - * @function Phaser.Utils.Objects.GetAdvancedValue - * @since 3.0.0 - * - * @param {object} source - The object to retrieve the value from. - * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. - * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. - * - * @return {*} The value of the requested key. - */ -var GetAdvancedValue = function (source, key, defaultValue) -{ - var value = GetValue(source, key, null); - - if (value === null) - { - return defaultValue; - } - else if (Array.isArray(value)) - { - return MATH.RND.pick(value); - } - else if (typeof value === 'object') - { - if (value.hasOwnProperty('randInt')) - { - return MATH.RND.integerInRange(value.randInt[0], value.randInt[1]); - } - else if (value.hasOwnProperty('randFloat')) - { - return MATH.RND.realInRange(value.randFloat[0], value.randFloat[1]); - } - } - else if (typeof value === 'function') - { - return value(key); - } - - return value; -}; - -module.exports = GetAdvancedValue; - - -/***/ }), -/* 73 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(4); -var Extend = __webpack_require__(19); - -/** - * @namespace Phaser.Math - */ - -var PhaserMath = { - - // Collections of functions - Angle: __webpack_require__(74), - Distance: __webpack_require__(83), - Easing: __webpack_require__(91), - Fuzzy: __webpack_require__(136), - Interpolation: __webpack_require__(141), - Pow2: __webpack_require__(149), - Snap: __webpack_require__(153), - - // Expose the RNG Class - RandomDataGenerator: __webpack_require__(157), - - // Single functions - Average: __webpack_require__(158), - Bernstein: __webpack_require__(36), - Between: __webpack_require__(159), - CatmullRom: __webpack_require__(38), - CeilTo: __webpack_require__(160), - Clamp: __webpack_require__(1), - DegToRad: __webpack_require__(21), - Difference: __webpack_require__(161), - Euler: __webpack_require__(162), - Factorial: __webpack_require__(37), - FloatBetween: __webpack_require__(20), - FloorTo: __webpack_require__(163), - FromPercent: __webpack_require__(164), - GetSpeed: __webpack_require__(165), - IsEven: __webpack_require__(166), - IsEvenStrict: __webpack_require__(167), - Linear: __webpack_require__(39), - LinearXY: __webpack_require__(168), - MaxAdd: __webpack_require__(169), - Median: __webpack_require__(170), - MinSub: __webpack_require__(171), - Percent: __webpack_require__(172), - RadToDeg: __webpack_require__(16), - RandomXY: __webpack_require__(173), - RandomXYZ: __webpack_require__(174), - RandomXYZW: __webpack_require__(175), - Rotate: __webpack_require__(176), - RotateAround: __webpack_require__(42), - RotateAroundDistance: __webpack_require__(177), - RotateTo: __webpack_require__(178), - RoundAwayFromZero: __webpack_require__(43), - RoundTo: __webpack_require__(179), - SinCosTableGenerator: __webpack_require__(180), - SmootherStep: __webpack_require__(41), - SmoothStep: __webpack_require__(40), - ToXY: __webpack_require__(181), - TransformXY: __webpack_require__(44), - Within: __webpack_require__(182), - Wrap: __webpack_require__(7), - - // Vector classes - Vector2: __webpack_require__(3), - Vector3: __webpack_require__(15), - Vector4: __webpack_require__(183), - Matrix3: __webpack_require__(45), - Matrix4: __webpack_require__(22), - Quaternion: __webpack_require__(46), - RotateVec3: __webpack_require__(184) - -}; - -// Merge in the consts - -PhaserMath = Extend(false, PhaserMath, CONST); - -// Export it - -module.exports = PhaserMath; - - -/***/ }), -/* 74 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Angle - */ - -module.exports = { - - Between: __webpack_require__(31), - BetweenPoints: __webpack_require__(75), - BetweenPointsY: __webpack_require__(76), - BetweenY: __webpack_require__(77), - CounterClockwise: __webpack_require__(14), - Normalize: __webpack_require__(32), - Random: __webpack_require__(78), - RandomDegrees: __webpack_require__(79), - Reverse: __webpack_require__(80), - RotateTo: __webpack_require__(81), - ShortestBetween: __webpack_require__(82), - Wrap: __webpack_require__(33), - WrapDegrees: __webpack_require__(34) - -}; - - -/***/ }), -/* 75 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). - * - * Calculates the angle of the vector from the first point to the second point. - * - * @function Phaser.Math.Angle.BetweenPoints - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} point1 - The first point. - * @param {Phaser.Types.Math.Vector2Like} point2 - The second point. - * - * @return {number} The angle in radians. - */ -var BetweenPoints = function (point1, point2) -{ - return Math.atan2(point2.y - point1.y, point2.x - point1.x); -}; - -module.exports = BetweenPoints; - - -/***/ }), -/* 76 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). - * - * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate - * travels down the screen. - * - * @function Phaser.Math.Angle.BetweenPointsY - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} point1 - The first point. - * @param {Phaser.Types.Math.Vector2Like} point2 - The second point. - * - * @return {number} The angle in radians. - */ -var BetweenPointsY = function (point1, point2) -{ - return Math.atan2(point2.x - point1.x, point2.y - point1.y); -}; - -module.exports = BetweenPointsY; - - -/***/ }), -/* 77 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Find the angle of a segment from (x1, y1) -> (x2, y2). - * - * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate - * travels down the screen. - * - * @function Phaser.Math.Angle.BetweenY - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The angle in radians. - */ -var BetweenY = function (x1, y1, x2, y2) -{ - return Math.atan2(x2 - x1, y2 - y1); -}; - -module.exports = BetweenY; - - -/***/ }), -/* 78 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var FloatBetween = __webpack_require__(20); - -/** - * Returns a random angle in the range [-pi, pi]. - * - * @function Phaser.Math.Angle.Random - * @since 3.23.0 - * - * @return {number} The angle, in radians. - */ -var Random = function () -{ - return FloatBetween(-Math.PI, Math.PI); -}; - -module.exports = Random; - - -/***/ }), -/* 79 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var FloatBetween = __webpack_require__(20); - -/** - * Returns a random angle in the range [-180, 180]. - * - * @function Phaser.Math.Angle.RandomDegrees - * @since 3.23.0 - * - * @return {number} The angle, in degrees. - */ -var RandomDegrees = function () -{ - return FloatBetween(-180, 180); -}; - -module.exports = RandomDegrees; - - -/***/ }), -/* 80 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Normalize = __webpack_require__(32); - -/** - * Reverse the given angle. - * - * @function Phaser.Math.Angle.Reverse - * @since 3.0.0 - * - * @param {number} angle - The angle to reverse, in radians. - * - * @return {number} The reversed angle, in radians. - */ -var Reverse = function (angle) -{ - return Normalize(angle + Math.PI); -}; - -module.exports = Reverse; - - -/***/ }), -/* 81 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MATH_CONST = __webpack_require__(4); - -/** - * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. - * - * @function Phaser.Math.Angle.RotateTo - * @since 3.0.0 - * - * @param {number} currentAngle - The current angle, in radians. - * @param {number} targetAngle - The target angle to rotate to, in radians. - * @param {number} [lerp=0.05] - The lerp value to add to the current angle. - * - * @return {number} The adjusted angle. - */ -var RotateTo = function (currentAngle, targetAngle, lerp) -{ - if (lerp === undefined) { lerp = 0.05; } - - if (currentAngle === targetAngle) - { - return currentAngle; - } - - if (Math.abs(targetAngle - currentAngle) <= lerp || Math.abs(targetAngle - currentAngle) >= (MATH_CONST.PI2 - lerp)) - { - currentAngle = targetAngle; - } - else - { - if (Math.abs(targetAngle - currentAngle) > Math.PI) - { - if (targetAngle < currentAngle) - { - targetAngle += MATH_CONST.PI2; - } - else - { - targetAngle -= MATH_CONST.PI2; - } - } - - if (targetAngle > currentAngle) - { - currentAngle += lerp; - } - else if (targetAngle < currentAngle) - { - currentAngle -= lerp; - } - } - - return currentAngle; -}; - -module.exports = RotateTo; - - -/***/ }), -/* 82 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Gets the shortest angle between `angle1` and `angle2`. - * - * Both angles must be in the range -180 to 180, which is the same clamped - * range that `sprite.angle` uses, so you can pass in two sprite angles to - * this method and get the shortest angle back between the two of them. - * - * The angle returned will be in the same range. If the returned angle is - * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's - * a clockwise rotation. - * - * @function Phaser.Math.Angle.ShortestBetween - * @since 3.0.0 - * - * @param {number} angle1 - The first angle in the range -180 to 180. - * @param {number} angle2 - The second angle in the range -180 to 180. - * - * @return {number} The shortest angle, in degrees. If greater than zero it's a counter-clockwise rotation. - */ -var ShortestBetween = function (angle1, angle2) -{ - var difference = angle2 - angle1; - - if (difference === 0) - { - return 0; - } - - var times = Math.floor((difference - (-180)) / 360); - - return difference - (times * 360); - -}; - -module.exports = ShortestBetween; - - -/***/ }), -/* 83 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Distance - */ - -module.exports = { - - Between: __webpack_require__(84), - BetweenPoints: __webpack_require__(85), - BetweenPointsSquared: __webpack_require__(86), - Chebyshev: __webpack_require__(87), - Power: __webpack_require__(88), - Snake: __webpack_require__(89), - Squared: __webpack_require__(90) - -}; - - -/***/ }), -/* 84 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the distance between two sets of coordinates (points). - * - * @function Phaser.Math.Distance.Between - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The distance between each point. - */ -var DistanceBetween = function (x1, y1, x2, y2) -{ - var dx = x1 - x2; - var dy = y1 - y2; - - return Math.sqrt(dx * dx + dy * dy); -}; - -module.exports = DistanceBetween; - - -/***/ }), -/* 85 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the distance between two points. - * - * @function Phaser.Math.Distance.BetweenPoints - * @since 3.22.0 - * - * @param {Phaser.Types.Math.Vector2Like} a - The first point. - * @param {Phaser.Types.Math.Vector2Like} b - The second point. - * - * @return {number} The distance between the points. - */ -var DistanceBetweenPoints = function (a, b) -{ - var dx = a.x - b.x; - var dy = a.y - b.y; - - return Math.sqrt(dx * dx + dy * dy); -}; - -module.exports = DistanceBetweenPoints; - - -/***/ }), -/* 86 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the squared distance between two points. - * - * @function Phaser.Math.Distance.BetweenPointsSquared - * @since 3.22.0 - * - * @param {Phaser.Types.Math.Vector2Like} a - The first point. - * @param {Phaser.Types.Math.Vector2Like} b - The second point. - * - * @return {number} The squared distance between the points. - */ -var DistanceBetweenPointsSquared = function (a, b) -{ - var dx = a.x - b.x; - var dy = a.y - b.y; - - return dx * dx + dy * dy; -}; - -module.exports = DistanceBetweenPointsSquared; - - -/***/ }), -/* 87 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the Chebyshev distance between two sets of coordinates (points). - * - * Chebyshev distance (or chessboard distance) is the maximum of the horizontal and vertical distances. - * It's the effective distance when movement can be horizontal, vertical, or diagonal. - * - * @function Phaser.Math.Distance.Chebyshev - * @since 3.22.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The distance between each point. - */ -var ChebyshevDistance = function (x1, y1, x2, y2) -{ - return Math.max(Math.abs(x1 - x2), Math.abs(y1 - y2)); -}; - -module.exports = ChebyshevDistance; - - -/***/ }), -/* 88 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the distance between two sets of coordinates (points) to the power of `pow`. - * - * @function Phaser.Math.Distance.Power - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * @param {number} pow - The exponent. - * - * @return {number} The distance between each point. - */ -var DistancePower = function (x1, y1, x2, y2, pow) -{ - if (pow === undefined) { pow = 2; } - - return Math.sqrt(Math.pow(x2 - x1, pow) + Math.pow(y2 - y1, pow)); -}; - -module.exports = DistancePower; - - -/***/ }), -/* 89 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the snake distance between two sets of coordinates (points). - * - * Snake distance (rectilinear distance, Manhattan distance) is the sum of the horizontal and vertical distances. - * It's the effective distance when movement is allowed only horizontally or vertically (but not both). - * - * @function Phaser.Math.Distance.Snake - * @since 3.22.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The distance between each point. - */ -var SnakeDistance = function (x1, y1, x2, y2) -{ - return Math.abs(x1 - x2) + Math.abs(y1 - y2); -}; - -module.exports = SnakeDistance; - - -/***/ }), -/* 90 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the distance between two sets of coordinates (points), squared. - * - * @function Phaser.Math.Distance.Squared - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The distance between each point, squared. - */ -var DistanceSquared = function (x1, y1, x2, y2) -{ - var dx = x1 - x2; - var dy = y1 - y2; - - return dx * dx + dy * dy; -}; - -module.exports = DistanceSquared; - - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing - */ - -module.exports = { - - Back: __webpack_require__(92), - Bounce: __webpack_require__(96), - Circular: __webpack_require__(100), - Cubic: __webpack_require__(104), - Elastic: __webpack_require__(108), - Expo: __webpack_require__(112), - Linear: __webpack_require__(116), - Quadratic: __webpack_require__(118), - Quartic: __webpack_require__(122), - Quintic: __webpack_require__(126), - Sine: __webpack_require__(130), - Stepped: __webpack_require__(134) - -}; - - -/***/ }), -/* 92 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Back - */ - -module.exports = { - - In: __webpack_require__(93), - Out: __webpack_require__(94), - InOut: __webpack_require__(95) - -}; - - -/***/ }), -/* 93 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Back ease-in. - * - * @function Phaser.Math.Easing.Back.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [overshoot=1.70158] - The overshoot amount. - * - * @return {number} The tweened value. - */ -var In = function (v, overshoot) -{ - if (overshoot === undefined) { overshoot = 1.70158; } - - return v * v * ((overshoot + 1) * v - overshoot); -}; - -module.exports = In; - - -/***/ }), -/* 94 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Back ease-out. - * - * @function Phaser.Math.Easing.Back.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [overshoot=1.70158] - The overshoot amount. - * - * @return {number} The tweened value. - */ -var Out = function (v, overshoot) -{ - if (overshoot === undefined) { overshoot = 1.70158; } - - return --v * v * ((overshoot + 1) * v + overshoot) + 1; -}; - -module.exports = Out; - - -/***/ }), -/* 95 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Back ease-in/out. - * - * @function Phaser.Math.Easing.Back.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [overshoot=1.70158] - The overshoot amount. - * - * @return {number} The tweened value. - */ -var InOut = function (v, overshoot) -{ - if (overshoot === undefined) { overshoot = 1.70158; } - - var s = overshoot * 1.525; - - if ((v *= 2) < 1) - { - return 0.5 * (v * v * ((s + 1) * v - s)); - } - else - { - return 0.5 * ((v -= 2) * v * ((s + 1) * v + s) + 2); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Bounce - */ - -module.exports = { - - In: __webpack_require__(97), - Out: __webpack_require__(98), - InOut: __webpack_require__(99) - -}; - - -/***/ }), -/* 97 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Bounce ease-in. - * - * @function Phaser.Math.Easing.Bounce.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - v = 1 - v; - - if (v < 1 / 2.75) - { - return 1 - (7.5625 * v * v); - } - else if (v < 2 / 2.75) - { - return 1 - (7.5625 * (v -= 1.5 / 2.75) * v + 0.75); - } - else if (v < 2.5 / 2.75) - { - return 1 - (7.5625 * (v -= 2.25 / 2.75) * v + 0.9375); - } - else - { - return 1 - (7.5625 * (v -= 2.625 / 2.75) * v + 0.984375); - } -}; - -module.exports = In; - - -/***/ }), -/* 98 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Bounce ease-out. - * - * @function Phaser.Math.Easing.Bounce.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - if (v < 1 / 2.75) - { - return 7.5625 * v * v; - } - else if (v < 2 / 2.75) - { - return 7.5625 * (v -= 1.5 / 2.75) * v + 0.75; - } - else if (v < 2.5 / 2.75) - { - return 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375; - } - else - { - return 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375; - } -}; - -module.exports = Out; - - -/***/ }), -/* 99 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Bounce ease-in/out. - * - * @function Phaser.Math.Easing.Bounce.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - var reverse = false; - - if (v < 0.5) - { - v = 1 - (v * 2); - reverse = true; - } - else - { - v = (v * 2) - 1; - } - - if (v < 1 / 2.75) - { - v = 7.5625 * v * v; - } - else if (v < 2 / 2.75) - { - v = 7.5625 * (v -= 1.5 / 2.75) * v + 0.75; - } - else if (v < 2.5 / 2.75) - { - v = 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375; - } - else - { - v = 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375; - } - - if (reverse) - { - return (1 - v) * 0.5; - } - else - { - return v * 0.5 + 0.5; - } -}; - -module.exports = InOut; - - -/***/ }), -/* 100 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Circular - */ - -module.exports = { - - In: __webpack_require__(101), - Out: __webpack_require__(102), - InOut: __webpack_require__(103) - -}; - - -/***/ }), -/* 101 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Circular ease-in. - * - * @function Phaser.Math.Easing.Circular.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return 1 - Math.sqrt(1 - v * v); -}; - -module.exports = In; - - -/***/ }), -/* 102 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Circular ease-out. - * - * @function Phaser.Math.Easing.Circular.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return Math.sqrt(1 - (--v * v)); -}; - -module.exports = Out; - - -/***/ }), -/* 103 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Circular ease-in/out. - * - * @function Phaser.Math.Easing.Circular.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return -0.5 * (Math.sqrt(1 - v * v) - 1); - } - else - { - return 0.5 * (Math.sqrt(1 - (v -= 2) * v) + 1); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Cubic - */ - -module.exports = { - - In: __webpack_require__(105), - Out: __webpack_require__(106), - InOut: __webpack_require__(107) - -}; - - -/***/ }), -/* 105 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Cubic ease-in. - * - * @function Phaser.Math.Easing.Cubic.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return v * v * v; -}; - -module.exports = In; - - -/***/ }), -/* 106 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Cubic ease-out. - * - * @function Phaser.Math.Easing.Cubic.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return --v * v * v + 1; -}; - -module.exports = Out; - - -/***/ }), -/* 107 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Cubic ease-in/out. - * - * @function Phaser.Math.Easing.Cubic.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return 0.5 * v * v * v; - } - else - { - return 0.5 * ((v -= 2) * v * v + 2); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Elastic - */ - -module.exports = { - - In: __webpack_require__(109), - Out: __webpack_require__(110), - InOut: __webpack_require__(111) - -}; - - -/***/ }), -/* 109 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Elastic ease-in. - * - * @function Phaser.Math.Easing.Elastic.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. - * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. - * - * @return {number} The tweened value. - */ -var In = function (v, amplitude, period) -{ - if (amplitude === undefined) { amplitude = 0.1; } - if (period === undefined) { period = 0.1; } - - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - var s = period / 4; - - if (amplitude < 1) - { - amplitude = 1; - } - else - { - s = period * Math.asin(1 / amplitude) / (2 * Math.PI); - } - - return -(amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period)); - } -}; - -module.exports = In; - - -/***/ }), -/* 110 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Elastic ease-out. - * - * @function Phaser.Math.Easing.Elastic.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. - * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. - * - * @return {number} The tweened value. - */ -var Out = function (v, amplitude, period) -{ - if (amplitude === undefined) { amplitude = 0.1; } - if (period === undefined) { period = 0.1; } - - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - var s = period / 4; - - if (amplitude < 1) - { - amplitude = 1; - } - else - { - s = period * Math.asin(1 / amplitude) / (2 * Math.PI); - } - - return (amplitude * Math.pow(2, -10 * v) * Math.sin((v - s) * (2 * Math.PI) / period) + 1); - } -}; - -module.exports = Out; - - -/***/ }), -/* 111 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Elastic ease-in/out. - * - * @function Phaser.Math.Easing.Elastic.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. - * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. - * - * @return {number} The tweened value. - */ -var InOut = function (v, amplitude, period) -{ - if (amplitude === undefined) { amplitude = 0.1; } - if (period === undefined) { period = 0.1; } - - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - var s = period / 4; - - if (amplitude < 1) - { - amplitude = 1; - } - else - { - s = period * Math.asin(1 / amplitude) / (2 * Math.PI); - } - - if ((v *= 2) < 1) - { - return -0.5 * (amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period)); - } - else - { - return amplitude * Math.pow(2, -10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period) * 0.5 + 1; - } - } -}; - -module.exports = InOut; - - -/***/ }), -/* 112 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Expo - */ - -module.exports = { - - In: __webpack_require__(113), - Out: __webpack_require__(114), - InOut: __webpack_require__(115) - -}; - - -/***/ }), -/* 113 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Exponential ease-in. - * - * @function Phaser.Math.Easing.Expo.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return Math.pow(2, 10 * (v - 1)) - 0.001; -}; - -module.exports = In; - - -/***/ }), -/* 114 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Exponential ease-out. - * - * @function Phaser.Math.Easing.Expo.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return 1 - Math.pow(2, -10 * v); -}; - -module.exports = Out; - - -/***/ }), -/* 115 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Exponential ease-in/out. - * - * @function Phaser.Math.Easing.Expo.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return 0.5 * Math.pow(2, 10 * (v - 1)); - } - else - { - return 0.5 * (2 - Math.pow(2, -10 * (v - 1))); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 116 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -module.exports = __webpack_require__(117); - - -/***/ }), -/* 117 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Linear easing (no variation). - * - * @function Phaser.Math.Easing.Linear - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Linear = function (v) -{ - return v; -}; - -module.exports = Linear; - - -/***/ }), -/* 118 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Quadratic - */ - -module.exports = { - - In: __webpack_require__(119), - Out: __webpack_require__(120), - InOut: __webpack_require__(121) - -}; - - -/***/ }), -/* 119 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quadratic ease-in. - * - * @function Phaser.Math.Easing.Quadratic.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return v * v; -}; - -module.exports = In; - - -/***/ }), -/* 120 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quadratic ease-out. - * - * @function Phaser.Math.Easing.Quadratic.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return v * (2 - v); -}; - -module.exports = Out; - - -/***/ }), -/* 121 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quadratic ease-in/out. - * - * @function Phaser.Math.Easing.Quadratic.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return 0.5 * v * v; - } - else - { - return -0.5 * (--v * (v - 2) - 1); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 122 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Quartic - */ - -module.exports = { - - In: __webpack_require__(123), - Out: __webpack_require__(124), - InOut: __webpack_require__(125) - -}; - - -/***/ }), -/* 123 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quartic ease-in. - * - * @function Phaser.Math.Easing.Quartic.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return v * v * v * v; -}; - -module.exports = In; - - -/***/ }), -/* 124 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quartic ease-out. - * - * @function Phaser.Math.Easing.Quartic.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return 1 - (--v * v * v * v); -}; - -module.exports = Out; - - -/***/ }), -/* 125 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quartic ease-in/out. - * - * @function Phaser.Math.Easing.Quartic.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return 0.5 * v * v * v * v; - } - else - { - return -0.5 * ((v -= 2) * v * v * v - 2); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 126 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Quintic - */ - -module.exports = { - - In: __webpack_require__(127), - Out: __webpack_require__(128), - InOut: __webpack_require__(129) - -}; - - -/***/ }), -/* 127 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quintic ease-in. - * - * @function Phaser.Math.Easing.Quintic.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - return v * v * v * v * v; -}; - -module.exports = In; - - -/***/ }), -/* 128 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quintic ease-out. - * - * @function Phaser.Math.Easing.Quintic.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - return --v * v * v * v * v + 1; -}; - -module.exports = Out; - - -/***/ }), -/* 129 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Quintic ease-in/out. - * - * @function Phaser.Math.Easing.Quintic.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if ((v *= 2) < 1) - { - return 0.5 * v * v * v * v * v; - } - else - { - return 0.5 * ((v -= 2) * v * v * v * v + 2); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 130 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Sine - */ - -module.exports = { - - In: __webpack_require__(131), - Out: __webpack_require__(132), - InOut: __webpack_require__(133) - -}; - - -/***/ }), -/* 131 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Sinusoidal ease-in. - * - * @function Phaser.Math.Easing.Sine.In - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var In = function (v) -{ - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - return 1 - Math.cos(v * Math.PI / 2); - } -}; - -module.exports = In; - - -/***/ }), -/* 132 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Sinusoidal ease-out. - * - * @function Phaser.Math.Easing.Sine.Out - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var Out = function (v) -{ - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - return Math.sin(v * Math.PI / 2); - } -}; - -module.exports = Out; - - -/***/ }), -/* 133 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Sinusoidal ease-in/out. - * - * @function Phaser.Math.Easing.Sine.InOut - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * - * @return {number} The tweened value. - */ -var InOut = function (v) -{ - if (v === 0) - { - return 0; - } - else if (v === 1) - { - return 1; - } - else - { - return 0.5 * (1 - Math.cos(Math.PI * v)); - } -}; - -module.exports = InOut; - - -/***/ }), -/* 134 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Stepped - */ - -module.exports = __webpack_require__(135); - - -/***/ }), -/* 135 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Stepped easing. - * - * @function Phaser.Math.Easing.Stepped - * @since 3.0.0 - * - * @param {number} v - The value to be tweened. - * @param {number} [steps=1] - The number of steps in the ease. - * - * @return {number} The tweened value. - */ -var Stepped = function (v, steps) -{ - if (steps === undefined) { steps = 1; } - - if (v <= 0) - { - return 0; - } - else if (v >= 1) - { - return 1; - } - else - { - return (((steps * v) | 0) + 1) * (1 / steps); - } -}; - -module.exports = Stepped; - - -/***/ }), -/* 136 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Fuzzy - */ - -module.exports = { - - Ceil: __webpack_require__(137), - Equal: __webpack_require__(35), - Floor: __webpack_require__(138), - GreaterThan: __webpack_require__(139), - LessThan: __webpack_require__(140) - -}; - - -/***/ }), -/* 137 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the fuzzy ceiling of the given value. - * - * @function Phaser.Math.Fuzzy.Ceil - * @since 3.0.0 - * - * @param {number} value - The value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {number} The fuzzy ceiling of the value. - */ -var Ceil = function (value, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return Math.ceil(value - epsilon); -}; - -module.exports = Ceil; - - -/***/ }), -/* 138 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the fuzzy floor of the given value. - * - * @function Phaser.Math.Fuzzy.Floor - * @since 3.0.0 - * - * @param {number} value - The value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {number} The floor of the value. - */ -var Floor = function (value, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return Math.floor(value + epsilon); -}; - -module.exports = Floor; - - -/***/ }), -/* 139 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check whether `a` is fuzzily greater than `b`. - * - * `a` is fuzzily greater than `b` if it is more than `b - epsilon`. - * - * @function Phaser.Math.Fuzzy.GreaterThan - * @since 3.0.0 - * - * @param {number} a - The first value. - * @param {number} b - The second value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {boolean} `true` if `a` is fuzzily greater than than `b`, otherwise `false`. - */ -var GreaterThan = function (a, b, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return a > b - epsilon; -}; - -module.exports = GreaterThan; - - -/***/ }), -/* 140 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check whether `a` is fuzzily less than `b`. - * - * `a` is fuzzily less than `b` if it is less than `b + epsilon`. - * - * @function Phaser.Math.Fuzzy.LessThan - * @since 3.0.0 - * - * @param {number} a - The first value. - * @param {number} b - The second value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {boolean} `true` if `a` is fuzzily less than `b`, otherwise `false`. - */ -var LessThan = function (a, b, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return a < b + epsilon; -}; - -module.exports = LessThan; - - -/***/ }), -/* 141 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Interpolation - */ - -module.exports = { - - Bezier: __webpack_require__(142), - CatmullRom: __webpack_require__(143), - CubicBezier: __webpack_require__(144), - Linear: __webpack_require__(145), - QuadraticBezier: __webpack_require__(146), - SmoothStep: __webpack_require__(147), - SmootherStep: __webpack_require__(148) - -}; - - -/***/ }), -/* 142 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Bernstein = __webpack_require__(36); - -/** - * A bezier interpolation method. - * - * @function Phaser.Math.Interpolation.Bezier - * @since 3.0.0 - * - * @param {number[]} v - The input array of values to interpolate between. - * @param {number} k - The percentage of interpolation, between 0 and 1. - * - * @return {number} The interpolated value. - */ -var BezierInterpolation = function (v, k) -{ - var b = 0; - var n = v.length - 1; - - for (var i = 0; i <= n; i++) - { - b += Math.pow(1 - k, n - i) * Math.pow(k, i) * v[i] * Bernstein(n, i); - } - - return b; -}; - -module.exports = BezierInterpolation; - - -/***/ }), -/* 143 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CatmullRom = __webpack_require__(38); - -/** - * A Catmull-Rom interpolation method. - * - * @function Phaser.Math.Interpolation.CatmullRom - * @since 3.0.0 - * - * @param {number[]} v - The input array of values to interpolate between. - * @param {number} k - The percentage of interpolation, between 0 and 1. - * - * @return {number} The interpolated value. - */ -var CatmullRomInterpolation = function (v, k) -{ - var m = v.length - 1; - var f = m * k; - var i = Math.floor(f); - - if (v[0] === v[m]) - { - if (k < 0) - { - i = Math.floor(f = m * (1 + k)); - } - - return CatmullRom(f - i, v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m]); - } - else - { - if (k < 0) - { - return v[0] - (CatmullRom(-f, v[0], v[0], v[1], v[1]) - v[0]); - } - - if (k > 1) - { - return v[m] - (CatmullRom(f - m, v[m], v[m], v[m - 1], v[m - 1]) - v[m]); - } - - return CatmullRom(f - i, v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2]); - } -}; - -module.exports = CatmullRomInterpolation; - - -/***/ }), -/* 144 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @ignore - */ -function P0 (t, p) -{ - var k = 1 - t; - - return k * k * k * p; -} - -/** - * @ignore - */ -function P1 (t, p) -{ - var k = 1 - t; - - return 3 * k * k * t * p; -} - -/** - * @ignore - */ -function P2 (t, p) -{ - return 3 * (1 - t) * t * t * p; -} - -/** - * @ignore - */ -function P3 (t, p) -{ - return t * t * t * p; -} - -/** - * A cubic bezier interpolation method. - * - * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a - * - * @function Phaser.Math.Interpolation.CubicBezier - * @since 3.0.0 - * - * @param {number} t - The percentage of interpolation, between 0 and 1. - * @param {number} p0 - The start point. - * @param {number} p1 - The first control point. - * @param {number} p2 - The second control point. - * @param {number} p3 - The end point. - * - * @return {number} The interpolated value. - */ -var CubicBezierInterpolation = function (t, p0, p1, p2, p3) -{ - return P0(t, p0) + P1(t, p1) + P2(t, p2) + P3(t, p3); -}; - -module.exports = CubicBezierInterpolation; - - -/***/ }), -/* 145 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Linear = __webpack_require__(39); - -/** - * A linear interpolation method. - * - * @function Phaser.Math.Interpolation.Linear - * @since 3.0.0 - * @see {@link https://en.wikipedia.org/wiki/Linear_interpolation} - * - * @param {number[]} v - The input array of values to interpolate between. - * @param {!number} k - The percentage of interpolation, between 0 and 1. - * - * @return {!number} The interpolated value. - */ -var LinearInterpolation = function (v, k) -{ - var m = v.length - 1; - var f = m * k; - var i = Math.floor(f); - - if (k < 0) - { - return Linear(v[0], v[1], f); - } - else if (k > 1) - { - return Linear(v[m], v[m - 1], m - f); - } - else - { - return Linear(v[i], v[(i + 1 > m) ? m : i + 1], f - i); - } -}; - -module.exports = LinearInterpolation; - - -/***/ }), -/* 146 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @ignore - */ -function P0 (t, p) -{ - var k = 1 - t; - - return k * k * p; -} - -/** - * @ignore - */ -function P1 (t, p) -{ - return 2 * (1 - t) * t * p; -} - -/** - * @ignore - */ -function P2 (t, p) -{ - return t * t * p; -} - -// https://github.com/mrdoob/three.js/blob/master/src/extras/core/Interpolations.js - -/** - * A quadratic bezier interpolation method. - * - * @function Phaser.Math.Interpolation.QuadraticBezier - * @since 3.2.0 - * - * @param {number} t - The percentage of interpolation, between 0 and 1. - * @param {number} p0 - The start point. - * @param {number} p1 - The control point. - * @param {number} p2 - The end point. - * - * @return {number} The interpolated value. - */ -var QuadraticBezierInterpolation = function (t, p0, p1, p2) -{ - return P0(t, p0) + P1(t, p1) + P2(t, p2); -}; - -module.exports = QuadraticBezierInterpolation; - - -/***/ }), -/* 147 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SmoothStep = __webpack_require__(40); - -/** - * A Smooth Step interpolation method. - * - * @function Phaser.Math.Interpolation.SmoothStep - * @since 3.9.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep} - * - * @param {number} t - The percentage of interpolation, between 0 and 1. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The interpolated value. - */ -var SmoothStepInterpolation = function (t, min, max) -{ - return min + (max - min) * SmoothStep(t, 0, 1); -}; - -module.exports = SmoothStepInterpolation; - - -/***/ }), -/* 148 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SmootherStep = __webpack_require__(41); - -/** - * A Smoother Step interpolation method. - * - * @function Phaser.Math.Interpolation.SmootherStep - * @since 3.9.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} - * - * @param {number} t - The percentage of interpolation, between 0 and 1. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The interpolated value. - */ -var SmootherStepInterpolation = function (t, min, max) -{ - return min + (max - min) * SmootherStep(t, 0, 1); -}; - -module.exports = SmootherStepInterpolation; - - -/***/ }), -/* 149 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Pow2 - */ - -module.exports = { - - GetNext: __webpack_require__(150), - IsSize: __webpack_require__(151), - IsValue: __webpack_require__(152) - -}; - - -/***/ }), -/* 150 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Returns the nearest power of 2 to the given `value`. - * - * @function Phaser.Math.Pow2.GetNext - * @since 3.0.0 - * - * @param {number} value - The value. - * - * @return {number} The nearest power of 2 to `value`. - */ -var GetPowerOfTwo = function (value) -{ - var index = Math.log(value) / 0.6931471805599453; - - return (1 << Math.ceil(index)); -}; - -module.exports = GetPowerOfTwo; - - -/***/ }), -/* 151 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if the given `width` and `height` are a power of two. - * Useful for checking texture dimensions. - * - * @function Phaser.Math.Pow2.IsSize - * @since 3.0.0 - * - * @param {number} width - The width. - * @param {number} height - The height. - * - * @return {boolean} `true` if `width` and `height` are a power of two, otherwise `false`. - */ -var IsSizePowerOfTwo = function (width, height) -{ - return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0); -}; - -module.exports = IsSizePowerOfTwo; - - -/***/ }), -/* 152 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Tests the value and returns `true` if it is a power of two. - * - * @function Phaser.Math.Pow2.IsValue - * @since 3.0.0 - * - * @param {number} value - The value to check if it's a power of two. - * - * @return {boolean} Returns `true` if `value` is a power of two, otherwise `false`. - */ -var IsValuePowerOfTwo = function (value) -{ - return (value > 0 && (value & (value - 1)) === 0); -}; - -module.exports = IsValuePowerOfTwo; - - -/***/ }), -/* 153 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Snap - */ - -module.exports = { - - Ceil: __webpack_require__(154), - Floor: __webpack_require__(155), - To: __webpack_require__(156) - -}; - - -/***/ }), -/* 154 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Snap a value to nearest grid slice, using ceil. - * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`. - * As will `14` snap to `15`... but `16` will snap to `20`. - * - * @function Phaser.Math.Snap.Ceil - * @since 3.0.0 - * - * @param {number} value - The value to snap. - * @param {number} gap - The interval gap of the grid. - * @param {number} [start=0] - Optional starting offset for gap. - * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. - * - * @return {number} The snapped value. - */ -var SnapCeil = function (value, gap, start, divide) -{ - if (start === undefined) { start = 0; } - - if (gap === 0) - { - return value; - } - - value -= start; - value = gap * Math.ceil(value / gap); - - return (divide) ? (start + value) / gap : start + value; -}; - -module.exports = SnapCeil; - - -/***/ }), -/* 155 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Snap a value to nearest grid slice, using floor. - * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`. - * As will `14` snap to `10`... but `16` will snap to `15`. - * - * @function Phaser.Math.Snap.Floor - * @since 3.0.0 - * - * @param {number} value - The value to snap. - * @param {number} gap - The interval gap of the grid. - * @param {number} [start=0] - Optional starting offset for gap. - * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. - * - * @return {number} The snapped value. - */ -var SnapFloor = function (value, gap, start, divide) -{ - if (start === undefined) { start = 0; } - - if (gap === 0) - { - return value; - } - - value -= start; - value = gap * Math.floor(value / gap); - - return (divide) ? (start + value) / gap : start + value; -}; - -module.exports = SnapFloor; - - -/***/ }), -/* 156 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Snap a value to nearest grid slice, using rounding. - * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10` whereas `14` will snap to `15`. - * - * @function Phaser.Math.Snap.To - * @since 3.0.0 - * - * @param {number} value - The value to snap. - * @param {number} gap - The interval gap of the grid. - * @param {number} [start=0] - Optional starting offset for gap. - * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. - * - * @return {number} The snapped value. - */ -var SnapTo = function (value, gap, start, divide) -{ - if (start === undefined) { start = 0; } - - if (gap === 0) - { - return value; - } - - value -= start; - value = gap * Math.round(value / gap); - - return (divide) ? (start + value) / gap : start + value; -}; - -module.exports = SnapTo; - - -/***/ }), -/* 157 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A seeded Random Data Generator. - * - * Access via `Phaser.Math.RND` which is an instance of this class pre-defined - * by Phaser. Or, create your own instance to use as you require. - * - * The `Math.RND` generator is seeded by the Game Config property value `seed`. - * If no such config property exists, a random number is used. - * - * If you create your own instance of this class you should provide a seed for it. - * If no seed is given it will use a 'random' one based on Date.now. - * - * @class RandomDataGenerator - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {(string|string[])} [seeds] - The seeds to use for the random number generator. - */ -var RandomDataGenerator = new Class({ - - initialize: - - function RandomDataGenerator (seeds) - { - if (seeds === undefined) { seeds = [ (Date.now() * Math.random()).toString() ]; } - - /** - * Internal var. - * - * @name Phaser.Math.RandomDataGenerator#c - * @type {number} - * @default 1 - * @private - * @since 3.0.0 - */ - this.c = 1; - - /** - * Internal var. - * - * @name Phaser.Math.RandomDataGenerator#s0 - * @type {number} - * @default 0 - * @private - * @since 3.0.0 - */ - this.s0 = 0; - - /** - * Internal var. - * - * @name Phaser.Math.RandomDataGenerator#s1 - * @type {number} - * @default 0 - * @private - * @since 3.0.0 - */ - this.s1 = 0; - - /** - * Internal var. - * - * @name Phaser.Math.RandomDataGenerator#s2 - * @type {number} - * @default 0 - * @private - * @since 3.0.0 - */ - this.s2 = 0; - - /** - * Internal var. - * - * @name Phaser.Math.RandomDataGenerator#n - * @type {number} - * @default 0 - * @private - * @since 3.2.0 - */ - this.n = 0; - - /** - * Signs to choose from. - * - * @name Phaser.Math.RandomDataGenerator#signs - * @type {number[]} - * @since 3.0.0 - */ - this.signs = [ -1, 1 ]; - - if (seeds) - { - this.init(seeds); - } - }, - - /** - * Private random helper. - * - * @method Phaser.Math.RandomDataGenerator#rnd - * @since 3.0.0 - * @private - * - * @return {number} A random number. - */ - rnd: function () - { - var t = 2091639 * this.s0 + this.c * 2.3283064365386963e-10; // 2^-32 - - this.c = t | 0; - this.s0 = this.s1; - this.s1 = this.s2; - this.s2 = t - this.c; - - return this.s2; - }, - - /** - * Internal method that creates a seed hash. - * - * @method Phaser.Math.RandomDataGenerator#hash - * @since 3.0.0 - * @private - * - * @param {string} data - The value to hash. - * - * @return {number} The hashed value. - */ - hash: function (data) - { - var h; - var n = this.n; - - data = data.toString(); - - for (var i = 0; i < data.length; i++) - { - n += data.charCodeAt(i); - h = 0.02519603282416938 * n; - n = h >>> 0; - h -= n; - h *= n; - n = h >>> 0; - h -= n; - n += h * 0x100000000;// 2^32 - } - - this.n = n; - - return (n >>> 0) * 2.3283064365386963e-10;// 2^-32 - }, - - /** - * Initialize the state of the random data generator. - * - * @method Phaser.Math.RandomDataGenerator#init - * @since 3.0.0 - * - * @param {(string|string[])} seeds - The seeds to initialize the random data generator with. - */ - init: function (seeds) - { - if (typeof seeds === 'string') - { - this.state(seeds); - } - else - { - this.sow(seeds); - } - }, - - /** - * Reset the seed of the random data generator. - * - * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present. - * - * @method Phaser.Math.RandomDataGenerator#sow - * @since 3.0.0 - * - * @param {string[]} seeds - The array of seeds: the `toString()` of each value is used. - */ - sow: function (seeds) - { - // Always reset to default seed - this.n = 0xefc8249d; - this.s0 = this.hash(' '); - this.s1 = this.hash(' '); - this.s2 = this.hash(' '); - this.c = 1; - - if (!seeds) - { - return; - } - - // Apply any seeds - for (var i = 0; i < seeds.length && (seeds[i] != null); i++) - { - var seed = seeds[i]; - - this.s0 -= this.hash(seed); - this.s0 += ~~(this.s0 < 0); - this.s1 -= this.hash(seed); - this.s1 += ~~(this.s1 < 0); - this.s2 -= this.hash(seed); - this.s2 += ~~(this.s2 < 0); - } - }, - - /** - * Returns a random integer between 0 and 2^32. - * - * @method Phaser.Math.RandomDataGenerator#integer - * @since 3.0.0 - * - * @return {number} A random integer between 0 and 2^32. - */ - integer: function () - { - // 2^32 - return this.rnd() * 0x100000000; - }, - - /** - * Returns a random real number between 0 and 1. - * - * @method Phaser.Math.RandomDataGenerator#frac - * @since 3.0.0 - * - * @return {number} A random real number between 0 and 1. - */ - frac: function () - { - // 2^-53 - return this.rnd() + (this.rnd() * 0x200000 | 0) * 1.1102230246251565e-16; - }, - - /** - * Returns a random real number between 0 and 2^32. - * - * @method Phaser.Math.RandomDataGenerator#real - * @since 3.0.0 - * - * @return {number} A random real number between 0 and 2^32. - */ - real: function () - { - return this.integer() + this.frac(); - }, - - /** - * Returns a random integer between and including min and max. - * - * @method Phaser.Math.RandomDataGenerator#integerInRange - * @since 3.0.0 - * - * @param {number} min - The minimum value in the range. - * @param {number} max - The maximum value in the range. - * - * @return {number} A random number between min and max. - */ - integerInRange: function (min, max) - { - return Math.floor(this.realInRange(0, max - min + 1) + min); - }, - - /** - * Returns a random integer between and including min and max. - * This method is an alias for RandomDataGenerator.integerInRange. - * - * @method Phaser.Math.RandomDataGenerator#between - * @since 3.0.0 - * - * @param {number} min - The minimum value in the range. - * @param {number} max - The maximum value in the range. - * - * @return {number} A random number between min and max. - */ - between: function (min, max) - { - return Math.floor(this.realInRange(0, max - min + 1) + min); - }, - - /** - * Returns a random real number between min and max. - * - * @method Phaser.Math.RandomDataGenerator#realInRange - * @since 3.0.0 - * - * @param {number} min - The minimum value in the range. - * @param {number} max - The maximum value in the range. - * - * @return {number} A random number between min and max. - */ - realInRange: function (min, max) - { - return this.frac() * (max - min) + min; - }, - - /** - * Returns a random real number between -1 and 1. - * - * @method Phaser.Math.RandomDataGenerator#normal - * @since 3.0.0 - * - * @return {number} A random real number between -1 and 1. - */ - normal: function () - { - return 1 - (2 * this.frac()); - }, - - /** - * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368 - * - * @method Phaser.Math.RandomDataGenerator#uuid - * @since 3.0.0 - * - * @return {string} A valid RFC4122 version4 ID hex string - */ - uuid: function () - { - var a = ''; - var b = ''; - - for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-') - { - // eslint-disable-next-line no-empty - } - - return b; - }, - - /** - * Returns a random element from within the given array. - * - * @method Phaser.Math.RandomDataGenerator#pick - * @since 3.0.0 - * - * @generic T - * @genericUse {T[]} - [array] - * @genericUse {T} - [$return] - * - * @param {T[]} array - The array to pick a random element from. - * - * @return {T} A random member of the array. - */ - pick: function (array) - { - return array[this.integerInRange(0, array.length - 1)]; - }, - - /** - * Returns a sign to be used with multiplication operator. - * - * @method Phaser.Math.RandomDataGenerator#sign - * @since 3.0.0 - * - * @return {number} -1 or +1. - */ - sign: function () - { - return this.pick(this.signs); - }, - - /** - * Returns a random element from within the given array, favoring the earlier entries. - * - * @method Phaser.Math.RandomDataGenerator#weightedPick - * @since 3.0.0 - * - * @generic T - * @genericUse {T[]} - [array] - * @genericUse {T} - [$return] - * - * @param {T[]} array - The array to pick a random element from. - * - * @return {T} A random member of the array. - */ - weightedPick: function (array) - { - return array[~~(Math.pow(this.frac(), 2) * (array.length - 1) + 0.5)]; - }, - - /** - * Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified. - * - * @method Phaser.Math.RandomDataGenerator#timestamp - * @since 3.0.0 - * - * @param {number} min - The minimum value in the range. - * @param {number} max - The maximum value in the range. - * - * @return {number} A random timestamp between min and max. - */ - timestamp: function (min, max) - { - return this.realInRange(min || 946684800000, max || 1577862000000); - }, - - /** - * Returns a random angle between -180 and 180. - * - * @method Phaser.Math.RandomDataGenerator#angle - * @since 3.0.0 - * - * @return {number} A random number between -180 and 180. - */ - angle: function () - { - return this.integerInRange(-180, 180); - }, - - /** - * Returns a random rotation in radians, between -3.141 and 3.141 - * - * @method Phaser.Math.RandomDataGenerator#rotation - * @since 3.0.0 - * - * @return {number} A random number between -3.141 and 3.141 - */ - rotation: function () - { - return this.realInRange(-3.1415926, 3.1415926); - }, - - /** - * Gets or Sets the state of the generator. This allows you to retain the values - * that the generator is using between games, i.e. in a game save file. - * - * To seed this generator with a previously saved state you can pass it as the - * `seed` value in your game config, or call this method directly after Phaser has booted. - * - * Call this method with no parameters to return the current state. - * - * If providing a state it should match the same format that this method - * returns, which is a string with a header `!rnd` followed by the `c`, - * `s0`, `s1` and `s2` values respectively, each comma-delimited. - * - * @method Phaser.Math.RandomDataGenerator#state - * @since 3.0.0 - * - * @param {string} [state] - Generator state to be set. - * - * @return {string} The current state of the generator. - */ - state: function (state) - { - if (typeof state === 'string' && state.match(/^!rnd/)) - { - state = state.split(','); - - this.c = parseFloat(state[1]); - this.s0 = parseFloat(state[2]); - this.s1 = parseFloat(state[3]); - this.s2 = parseFloat(state[4]); - } - - return [ '!rnd', this.c, this.s0, this.s1, this.s2 ].join(','); - }, - - /** - * Shuffles the given array, using the current seed. - * - * @method Phaser.Math.RandomDataGenerator#shuffle - * @since 3.7.0 - * - * @generic T - * @genericUse {T[]} - [array,$return] - * - * @param {T[]} [array] - The array to be shuffled. - * - * @return {T[]} The shuffled array. - */ - shuffle: function (array) - { - var len = array.length - 1; - - for (var i = len; i > 0; i--) - { - var randomIndex = Math.floor(this.frac() * (i + 1)); - var itemAtIndex = array[randomIndex]; - - array[randomIndex] = array[i]; - array[i] = itemAtIndex; - } - - return array; - } - -}); - -module.exports = RandomDataGenerator; - - -/***/ }), -/* 158 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the mean average of the given values. - * - * @function Phaser.Math.Average - * @since 3.0.0 - * - * @param {number[]} values - The values to average. - * - * @return {number} The average value. - */ -var Average = function (values) -{ - var sum = 0; - - for (var i = 0; i < values.length; i++) - { - sum += (+values[i]); - } - - return sum / values.length; -}; - -module.exports = Average; - - -/***/ }), -/* 159 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Compute a random integer between the `min` and `max` values, inclusive. - * - * @function Phaser.Math.Between - * @since 3.0.0 - * - * @param {number} min - The minimum value. - * @param {number} max - The maximum value. - * - * @return {number} The random integer. - */ -var Between = function (min, max) -{ - return Math.floor(Math.random() * (max - min + 1) + min); -}; - -module.exports = Between; - - -/***/ }), -/* 160 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Ceils to some place comparative to a `base`, default is 10 for decimal place. - * - * The `place` is represented by the power applied to `base` to get that place. - * - * @function Phaser.Math.CeilTo - * @since 3.0.0 - * - * @param {number} value - The value to round. - * @param {number} [place=0] - The place to round to. - * @param {number} [base=10] - The base to round in. Default is 10 for decimal. - * - * @return {number} The rounded value. - */ -var CeilTo = function (value, place, base) -{ - if (place === undefined) { place = 0; } - if (base === undefined) { base = 10; } - - var p = Math.pow(base, -place); - - return Math.ceil(value * p) / p; -}; - -module.exports = CeilTo; - - -/***/ }), -/* 161 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates the positive difference of two given numbers. - * - * @function Phaser.Math.Difference - * @since 3.0.0 - * - * @param {number} a - The first number in the calculation. - * @param {number} b - The second number in the calculation. - * - * @return {number} The positive difference of the two given numbers. - */ -var Difference = function (a, b) -{ - return Math.abs(a - b); -}; - -module.exports = Difference; - - -/***/ }), -/* 162 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(1); -var Class = __webpack_require__(0); -var Matrix4 = __webpack_require__(22); -var NOOP = __webpack_require__(2); - -var tempMatrix = new Matrix4(); - -/** - * @classdesc - * - * @class Euler - * @memberof Phaser.Math - * @constructor - * @since 3.50.0 - * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - */ -var Euler = new Class({ - - initialize: - - function Euler (x, y, z, order) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (z === undefined) { z = 0; } - if (order === undefined) { order = Euler.DefaultOrder; } - - this._x = x; - this._y = y; - this._z = z; - this._order = order; - - this.onChangeCallback = NOOP; - }, - - x: { - get: function () - { - return this._x; - }, - - set: function (value) - { - this._x = value; - - this.onChangeCallback(this); - } - }, - - y: { - get: function () - { - return this._y; - }, - - set: function (value) - { - this._y = value; - - this.onChangeCallback(this); - } - }, - - z: { - get: function () - { - return this._z; - }, - - set: function (value) - { - this._z = value; - - this.onChangeCallback(this); - } - }, - - order: { - get: function () - { - return this._order; - }, - - set: function (value) - { - this._order = value; - - this.onChangeCallback(this); - } - }, - - set: function (x, y, z, order) - { - if (order === undefined) { order = this._order; } - - this._x = x; - this._y = y; - this._z = z; - this._order = order; - - this.onChangeCallback(this); - - return this; - }, - - copy: function (euler) - { - return this.set(euler.x, euler.y, euler.z, euler.order); - }, - - setFromQuaternion: function (quaternion, order, update) - { - if (order === undefined) { order = this._order; } - if (update === undefined) { update = false; } - - tempMatrix.fromQuat(quaternion); - - return this.setFromRotationMatrix(tempMatrix, order, update); - }, - - setFromRotationMatrix: function (matrix, order, update) - { - if (order === undefined) { order = this._order; } - if (update === undefined) { update = false; } - - var elements = matrix.val; - - // Upper 3x3 of matrix is un-scaled rotation matrix - var m11 = elements[0]; - var m12 = elements[4]; - var m13 = elements[8]; - var m21 = elements[1]; - var m22 = elements[5]; - var m23 = elements[9]; - var m31 = elements[2]; - var m32 = elements[6]; - var m33 = elements[10]; - - var x = 0; - var y = 0; - var z = 0; - var epsilon = 0.99999; - - switch (order) - { - case 'XYZ': - { - y = Math.asin(Clamp(m13, -1, 1)); - - if (Math.abs(m13) < epsilon) - { - x = Math.atan2(-m23, m33); - z = Math.atan2(-m12, m11); - } - else - { - x = Math.atan2(m32, m22); - } - - break; - } - - case 'YXZ': - { - x = Math.asin(-Clamp(m23, -1, 1)); - - if (Math.abs(m23) < epsilon) - { - y = Math.atan2(m13, m33); - z = Math.atan2(m21, m22); - } - else - { - y = Math.atan2(-m31, m11); - } - - break; - } - - case 'ZXY': - { - x = Math.asin(Clamp(m32, -1, 1)); - - if (Math.abs(m32) < epsilon) - { - y = Math.atan2(-m31, m33); - z = Math.atan2(-m12, m22); - } - else - { - z = Math.atan2(m21, m11); - } - - break; - } - - case 'ZYX': - { - y = Math.asin(-Clamp(m31, -1, 1)); - - if (Math.abs(m31) < epsilon) - { - x = Math.atan2(m32, m33); - z = Math.atan2(m21, m11); - } - else - { - z = Math.atan2(-m12, m22); - } - - break; - } - - case 'YZX': - { - z = Math.asin(Clamp(m21, -1, 1)); - - if (Math.abs(m21) < epsilon) - { - x = Math.atan2(-m23, m22); - y = Math.atan2(-m31, m11); - } - else - { - y = Math.atan2(m13, m33); - } - - break; - } - - case 'XZY': - { - z = Math.asin(-Clamp(m12, -1, 1)); - - if (Math.abs(m12) < epsilon) - { - x = Math.atan2(m32, m22); - y = Math.atan2(m13, m11); - } - else - { - x = Math.atan2(-m23, m33); - } - - break; - } - } - - this._x = x; - this._y = y; - this._z = z; - this._order = order; - - if (update) - { - this.onChangeCallback(this); - } - - return this; - } - -}); - -Euler.RotationOrders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ]; - -Euler.DefaultOrder = 'XYZ'; - -module.exports = Euler; - - -/***/ }), -/* 163 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Floors to some place comparative to a `base`, default is 10 for decimal place. - * - * The `place` is represented by the power applied to `base` to get that place. - * - * @function Phaser.Math.FloorTo - * @since 3.0.0 - * - * @param {number} value - The value to round. - * @param {number} [place=0] - The place to round to. - * @param {number} [base=10] - The base to round in. Default is 10 for decimal. - * - * @return {number} The rounded value. - */ -var FloorTo = function (value, place, base) -{ - if (place === undefined) { place = 0; } - if (base === undefined) { base = 10; } - - var p = Math.pow(base, -place); - - return Math.floor(value * p) / p; -}; - -module.exports = FloorTo; - - -/***/ }), -/* 164 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(1); - -/** - * Return a value based on the range between `min` and `max` and the percentage given. - * - * @function Phaser.Math.FromPercent - * @since 3.0.0 - * - * @param {number} percent - A value between 0 and 1 representing the percentage. - * @param {number} min - The minimum value. - * @param {number} [max] - The maximum value. - * - * @return {number} The value that is `percent` percent between `min` and `max`. - */ -var FromPercent = function (percent, min, max) -{ - percent = Clamp(percent, 0, 1); - - return (max - min) * percent + min; -}; - -module.exports = FromPercent; - - -/***/ }), -/* 165 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate a per-ms speed from a distance and time (given in seconds). - * - * @function Phaser.Math.GetSpeed - * @since 3.0.0 - * - * @param {number} distance - The distance. - * @param {number} time - The time, in seconds. - * - * @return {number} The speed, in distance per ms. - * - * @example - * // 400px over 1 second is 0.4 px/ms - * Phaser.Math.GetSpeed(400, 1) // -> 0.4 - */ -var GetSpeed = function (distance, time) -{ - return (distance / time) / 1000; -}; - -module.exports = GetSpeed; - - -/***/ }), -/* 166 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check if a given value is an even number. - * - * @function Phaser.Math.IsEven - * @since 3.0.0 - * - * @param {number} value - The number to perform the check with. - * - * @return {boolean} Whether the number is even or not. - */ -var IsEven = function (value) -{ - // Use abstract equality == for "is number" test - - // eslint-disable-next-line eqeqeq - return (value == parseFloat(value)) ? !(value % 2) : void 0; -}; - -module.exports = IsEven; - - -/***/ }), -/* 167 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check if a given value is an even number using a strict type check. - * - * @function Phaser.Math.IsEvenStrict - * @since 3.0.0 - * - * @param {number} value - The number to perform the check with. - * - * @return {boolean} Whether the number is even or not. - */ -var IsEvenStrict = function (value) -{ - // Use strict equality === for "is number" test - return (value === parseFloat(value)) ? !(value % 2) : void 0; -}; - -module.exports = IsEvenStrict; - - -/***/ }), -/* 168 */ -/***/ (function(module, exports) { - -/** - * @author Greg McLean - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Interpolates two given Vectors and returns a new Vector between them. - * - * Does not modify either of the passed Vectors. - * - * @function Phaser.Math.LinearXY - * @since 3.60.0 - * - * @param {Phaser.Math.Vector2} vector1 - Starting vector - * @param {Phaser.Math.Vector2} vector2 - Ending vector - * @param {number} [t=0] - The percentage between vector1 and vector2 to return, represented as a number between 0 and 1. - * - * @return {Phaser.Math.Vector2} The step t% of the way between vector1 and vector2. - */ -var LinearXY = function (vector1, vector2, t) -{ - if (t === undefined) { t = 0; } - - return vector1.clone().lerp(vector2, t); -}; - -module.exports = LinearXY; - - -/***/ }), -/* 169 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Add an `amount` to a `value`, limiting the maximum result to `max`. - * - * @function Phaser.Math.MaxAdd - * @since 3.0.0 - * - * @param {number} value - The value to add to. - * @param {number} amount - The amount to add. - * @param {number} max - The maximum value to return. - * - * @return {number} The resulting value. - */ -var MaxAdd = function (value, amount, max) -{ - return Math.min(value + amount, max); -}; - -module.exports = MaxAdd; - - -/***/ }), -/* 170 */ -/***/ (function(module, exports) { - -/** - * @author Vladislav Forsh - * @copyright 2021 RoboWhale - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the median of the given values. The values are sorted and the middle value is returned. - * In case of an even number of values, the average of the two middle values is returned. - * - * @function Phaser.Math.Median - * @since 3.54.0 - * - * @param {number[]} values - The values to average. - * - * @return {number} The median value. - */ -var Median = function (values) -{ - var valuesNum = values.length; - if (valuesNum === 0) - { - return 0; - } - - values.sort(function (a, b) { return a - b; }); - - var halfIndex = Math.floor(valuesNum / 2); - - return valuesNum % 2 === 0 - ? (values[halfIndex] + values[halfIndex - 1]) / 2 - : values[halfIndex]; -}; - -module.exports = Median; - - -/***/ }), -/* 171 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Subtract an `amount` from `value`, limiting the minimum result to `min`. - * - * @function Phaser.Math.MinSub - * @since 3.0.0 - * - * @param {number} value - The value to subtract from. - * @param {number} amount - The amount to subtract. - * @param {number} min - The minimum value to return. - * - * @return {number} The resulting value. - */ -var MinSub = function (value, amount, min) -{ - return Math.max(value - amount, min); -}; - -module.exports = MinSub; - - -/***/ }), -/* 172 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Work out what percentage `value` is of the range between `min` and `max`. - * If `max` isn't given then it will return the percentage of `value` to `min`. - * - * You can optionally specify an `upperMax` value, which is a mid-way point in the range that represents 100%, after which the % starts to go down to zero again. - * - * @function Phaser.Math.Percent - * @since 3.0.0 - * - * @param {number} value - The value to determine the percentage of. - * @param {number} min - The minimum value. - * @param {number} [max] - The maximum value. - * @param {number} [upperMax] - The mid-way point in the range that represents 100%. - * - * @return {number} A value between 0 and 1 representing the percentage. - */ -var Percent = function (value, min, max, upperMax) -{ - if (max === undefined) { max = min + 1; } - - var percentage = (value - min) / (max - min); - - if (percentage > 1) - { - if (upperMax !== undefined) - { - percentage = ((upperMax - value)) / (upperMax - max); - - if (percentage < 0) - { - percentage = 0; - } - } - else - { - percentage = 1; - } - } - else if (percentage < 0) - { - percentage = 0; - } - - return percentage; -}; - -module.exports = Percent; - - -/***/ }), -/* 173 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Compute a random unit vector. - * - * Computes random values for the given vector between -1 and 1 that can be used to represent a direction. - * - * Optionally accepts a scale value to scale the resulting vector by. - * - * @function Phaser.Math.RandomXY - * @since 3.0.0 - * - * @param {Phaser.Math.Vector2} vector - The Vector to compute random values for. - * @param {number} [scale=1] - The scale of the random values. - * - * @return {Phaser.Math.Vector2} The given Vector. - */ -var RandomXY = function (vector, scale) -{ - if (scale === undefined) { scale = 1; } - - var r = Math.random() * 2 * Math.PI; - - vector.x = Math.cos(r) * scale; - vector.y = Math.sin(r) * scale; - - return vector; -}; - -module.exports = RandomXY; - - -/***/ }), -/* 174 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Compute a random position vector in a spherical area, optionally defined by the given radius. - * - * @function Phaser.Math.RandomXYZ - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} vec3 - The Vector to compute random values for. - * @param {number} [radius=1] - The radius. - * - * @return {Phaser.Math.Vector3} The given Vector. - */ -var RandomXYZ = function (vec3, radius) -{ - if (radius === undefined) { radius = 1; } - - var r = Math.random() * 2 * Math.PI; - var z = (Math.random() * 2) - 1; - var zScale = Math.sqrt(1 - z * z) * radius; - - vec3.x = Math.cos(r) * zScale; - vec3.y = Math.sin(r) * zScale; - vec3.z = z * radius; - - return vec3; -}; - -module.exports = RandomXYZ; - - -/***/ }), -/* 175 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Compute a random four-dimensional vector. - * - * @function Phaser.Math.RandomXYZW - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} vec4 - The Vector to compute random values for. - * @param {number} [scale=1] - The scale of the random values. - * - * @return {Phaser.Math.Vector4} The given Vector. - */ -var RandomXYZW = function (vec4, scale) -{ - if (scale === undefined) { scale = 1; } - - vec4.x = (Math.random() * 2 - 1) * scale; - vec4.y = (Math.random() * 2 - 1) * scale; - vec4.z = (Math.random() * 2 - 1) * scale; - vec4.w = (Math.random() * 2 - 1) * scale; - - return vec4; -}; - -module.exports = RandomXYZW; - - -/***/ }), -/* 176 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotate a given point by a given angle around the origin (0, 0), in an anti-clockwise direction. - * - * @function Phaser.Math.Rotate - * @since 3.0.0 - * - * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. - * @param {number} angle - The angle to be rotated by in an anticlockwise direction. - * - * @return {Phaser.Geom.Point} The given point, rotated by the given angle in an anticlockwise direction. - */ -var Rotate = function (point, angle) -{ - var x = point.x; - var y = point.y; - - point.x = (x * Math.cos(angle)) - (y * Math.sin(angle)); - point.y = (x * Math.sin(angle)) + (y * Math.cos(angle)); - - return point; -}; - -module.exports = Rotate; - - -/***/ }), -/* 177 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotate a `point` around `x` and `y` by the given `angle` and `distance`. - * - * In polar notation, this maps a point from (r, t) to (distance, t + angle), vs. the origin (x, y). - * - * @function Phaser.Math.RotateAroundDistance - * @since 3.0.0 - * - * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] - * - * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. - * @param {number} x - The horizontal coordinate to rotate around. - * @param {number} y - The vertical coordinate to rotate around. - * @param {number} angle - The angle of rotation in radians. - * @param {number} distance - The distance from (x, y) to place the point at. - * - * @return {Phaser.Types.Math.Vector2Like} The given point. - */ -var RotateAroundDistance = function (point, x, y, angle, distance) -{ - var t = angle + Math.atan2(point.y - y, point.x - x); - - point.x = x + (distance * Math.cos(t)); - point.y = y + (distance * Math.sin(t)); - - return point; -}; - -module.exports = RotateAroundDistance; - - -/***/ }), -/* 178 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Position a `point` at the given `angle` and `distance` to (`x`, `y`). - * - * @function Phaser.Math.RotateTo - * @since 3.24.0 - * - * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] - * - * @param {Phaser.Types.Math.Vector2Like} point - The point to be positioned. - * @param {number} x - The horizontal coordinate to position from. - * @param {number} y - The vertical coordinate to position from. - * @param {number} angle - The angle of rotation in radians. - * @param {number} distance - The distance from (x, y) to place the point at. - * - * @return {Phaser.Types.Math.Vector2Like} The given point. - */ -var RotateTo = function (point, x, y, angle, distance) -{ - point.x = x + (distance * Math.cos(angle)); - point.y = y + (distance * Math.sin(angle)); - - return point; -}; - -module.exports = RotateTo; - - -/***/ }), -/* 179 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Round a value to the given precision. - * - * For example: - * - * ```javascript - * RoundTo(123.456, 0) = 123 - * RoundTo(123.456, 1) = 120 - * RoundTo(123.456, 2) = 100 - * ``` - * - * To round the decimal, i.e. to round to precision, pass in a negative `place`: - * - * ```javascript - * RoundTo(123.456789, 0) = 123 - * RoundTo(123.456789, -1) = 123.5 - * RoundTo(123.456789, -2) = 123.46 - * RoundTo(123.456789, -3) = 123.457 - * ``` - * - * @function Phaser.Math.RoundTo - * @since 3.0.0 - * - * @param {number} value - The value to round. - * @param {number} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. - * @param {number} [base=10] - The base to round in. Default is 10 for decimal. - * - * @return {number} The rounded value. - */ -var RoundTo = function (value, place, base) -{ - if (place === undefined) { place = 0; } - if (base === undefined) { base = 10; } - - var p = Math.pow(base, -place); - - return Math.round(value * p) / p; -}; - -module.exports = RoundTo; - - -/***/ }), -/* 180 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Generate a series of sine and cosine values. - * - * @function Phaser.Math.SinCosTableGenerator - * @since 3.0.0 - * - * @param {number} length - The number of values to generate. - * @param {number} [sinAmp=1] - The sine value amplitude. - * @param {number} [cosAmp=1] - The cosine value amplitude. - * @param {number} [frequency=1] - The frequency of the values. - * - * @return {Phaser.Types.Math.SinCosTable} The generated values. - */ -var SinCosTableGenerator = function (length, sinAmp, cosAmp, frequency) -{ - if (sinAmp === undefined) { sinAmp = 1; } - if (cosAmp === undefined) { cosAmp = 1; } - if (frequency === undefined) { frequency = 1; } - - frequency *= Math.PI / length; - - var cos = []; - var sin = []; - - for (var c = 0; c < length; c++) - { - cosAmp -= sinAmp * frequency; - sinAmp += cosAmp * frequency; - - cos[c] = cosAmp; - sin[c] = sinAmp; - } - - return { - sin: sin, - cos: cos, - length: length - }; -}; - -module.exports = SinCosTableGenerator; - - -/***/ }), -/* 181 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Vector2 = __webpack_require__(3); - -/** - * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid. - * - * For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2. - * - * If the given index is out of range an empty Vector2 is returned. - * - * @function Phaser.Math.ToXY - * @since 3.19.0 - * - * @param {number} index - The position within the grid to get the x/y value for. - * @param {number} width - The width of the grid. - * @param {number} height - The height of the grid. - * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created. - * - * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index. - */ -var ToXY = function (index, width, height, out) -{ - if (out === undefined) { out = new Vector2(); } - - var x = 0; - var y = 0; - var total = width * height; - - if (index > 0 && index <= total) - { - if (index > width - 1) - { - y = Math.floor(index / width); - x = index - (y * width); - } - else - { - x = index; - } - } - - return out.set(x, y); -}; - -module.exports = ToXY; - - -/***/ }), -/* 182 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if the two values are within the given `tolerance` of each other. - * - * @function Phaser.Math.Within - * @since 3.0.0 - * - * @param {number} a - The first value to use in the calculation. - * @param {number} b - The second value to use in the calculation. - * @param {number} tolerance - The tolerance. Anything equal to or less than this value is considered as being within range. - * - * @return {boolean} Returns `true` if `a` is less than or equal to the tolerance of `b`. - */ -var Within = function (a, b, tolerance) -{ - return (Math.abs(a - b) <= tolerance); -}; - -module.exports = Within; - - -/***/ }), -/* 183 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A representation of a vector in 4D space. - * - * A four-component vector. - * - * @class Vector4 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - * @param {number} [w] - The w component. - */ -var Vector4 = new Class({ - - initialize: - - function Vector4 (x, y, z, w) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector4#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector4#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - /** - * The z component of this Vector. - * - * @name Phaser.Math.Vector4#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.z = 0; - - /** - * The w component of this Vector. - * - * @name Phaser.Math.Vector4#w - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.w = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; - } - }, - - /** - * Make a clone of this Vector4. - * - * @method Phaser.Math.Vector4#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector4} A clone of this Vector4. - */ - clone: function () - { - return new Vector4(this.x, this.y, this.z, this.w); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector4#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - copy: function (src) - { - this.x = src.x; - this.y = src.y; - this.z = src.z || 0; - this.w = src.w || 0; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict quality check against each Vector's components. - * - * @method Phaser.Math.Vector4#equals - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} v - The vector to check equality with. - * - * @return {boolean} A boolean indicating whether the two Vectors are equal or not. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z) && (this.w === v.w)); - }, - - /** - * Set the `x`, `y`, `z` and `w` components of the this Vector to the given `x`, `y`, `z` and `w` values. - * - * @method Phaser.Math.Vector4#set - * @since 3.0.0 - * - * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y, z and w components. - * @param {number} y - The y value to set for this Vector. - * @param {number} z - The z value to set for this Vector. - * @param {number} w - The z value to set for this Vector. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - set: function (x, y, z, w) - { - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; - } - - return this; - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector4#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - add: function (v) - { - this.x += v.x; - this.y += v.y; - this.z += v.z || 0; - this.w += v.w || 0; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector4#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - subtract: function (v) - { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z || 0; - this.w -= v.w || 0; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector4#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - scale: function (scale) - { - this.x *= scale; - this.y *= scale; - this.z *= scale; - this.w *= scale; - - return this; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector4#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return Math.sqrt(x * x + y * y + z * z + w * w); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector4#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return x * x + y * y + z * z + w * w; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector4#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - var len = x * x + y * y + z * z + w * w; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - this.z = z * len; - this.w = w * len; - } - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector4#dot - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} v - The Vector4 to dot product with this Vector4. - * - * @return {number} The dot product of this Vector and the given Vector. - */ - dot: function (v) - { - return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector4#lerp - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} v - The Vector4 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - lerp: function (v, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - this.w = aw + t * (v.w - aw); - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector4#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - multiply: function (v) - { - this.x *= v.x; - this.y *= v.y; - this.z *= v.z || 1; - this.w *= v.w || 1; - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector4#divide - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - divide: function (v) - { - this.x /= v.x; - this.y /= v.y; - this.z /= v.z || 1; - this.w /= v.w || 1; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector4#distance - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - var dw = v.w - this.w || 0; - - return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector4#distanceSq - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - var dw = v.w - this.w || 0; - - return dx * dx + dy * dy + dz * dz + dw * dw; - }, - - /** - * Negate the `x`, `y`, `z` and `w` components of this Vector. - * - * @method Phaser.Math.Vector4#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; - this.w = -this.w; - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector4#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector4 with. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[8] * z + m[12] * w; - this.y = m[1] * x + m[5] * y + m[9] * z + m[13] * w; - this.z = m[2] * x + m[6] * y + m[10] * z + m[14] * w; - this.w = m[3] * x + m[7] * y + m[11] * z + m[15] * w; - - return this; - }, - - /** - * Transform this Vector with the given Quaternion. - * - * @method Phaser.Math.Vector4#transformQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - transformQuat: function (q) - { - var x = this.x; - var y = this.y; - var z = this.z; - var qx = q.x; - var qy = q.y; - var qz = q.z; - var qw = q.w; - - // calculate quat * vec - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = -qx * x - qy * y - qz * z; - - // calculate result * inverse quat - this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; - this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; - this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; - - return this; - }, - - /** - * Make this Vector the zero vector (0, 0, 0, 0). - * - * @method Phaser.Math.Vector4#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector4} This Vector4. - */ - reset: function () - { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 0; - - return this; - } - -}); - -Vector4.prototype.sub = Vector4.prototype.subtract; -Vector4.prototype.mul = Vector4.prototype.multiply; -Vector4.prototype.div = Vector4.prototype.divide; -Vector4.prototype.dist = Vector4.prototype.distance; -Vector4.prototype.distSq = Vector4.prototype.distanceSq; -Vector4.prototype.len = Vector4.prototype.length; -Vector4.prototype.lenSq = Vector4.prototype.lengthSq; - -module.exports = Vector4; - - -/***/ }), -/* 184 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Vector3 = __webpack_require__(15); -var Matrix4 = __webpack_require__(22); -var Quaternion = __webpack_require__(46); - -var tmpMat4 = new Matrix4(); -var tmpQuat = new Quaternion(); -var tmpVec3 = new Vector3(); - -/** - * Rotates a vector in place by axis angle. - * - * This is the same as transforming a point by an - * axis-angle quaternion, but it has higher precision. - * - * @function Phaser.Math.RotateVec3 - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} vec - The vector to be rotated. - * @param {Phaser.Math.Vector3} axis - The axis to rotate around. - * @param {number} radians - The angle of rotation in radians. - * - * @return {Phaser.Math.Vector3} The given vector. - */ -var RotateVec3 = function (vec, axis, radians) -{ - // Set the quaternion to our axis angle - tmpQuat.setAxisAngle(axis, radians); - - // Create a rotation matrix from the axis angle - tmpMat4.fromRotationTranslation(tmpQuat, tmpVec3.set(0, 0, 0)); - - // Multiply our vector by the rotation matrix - return vec.transformMat4(tmpMat4); -}; - -module.exports = RotateVec3; - - -/***/ }), -/* 185 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scale Manager Resize Event. - * - * This event is dispatched whenever the Scale Manager detects a resize event from the browser. - * It sends three parameters to the callback, each of them being Size components. You can read - * the `width`, `height`, `aspectRatio` and other properties of these components to help with - * scaling your own game content. - * - * @event Phaser.Scale.Events#RESIZE - * @type {string} - * @since 3.16.1 - * - * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas. - * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size. - * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode. - * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width. - * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height. - */ -module.exports = 'resize'; - - -/***/ }), -/* 186 */ -/***/ (function(module, exports, __webpack_require__) { - -/** -* @author Richard Davey -* @copyright 2013-2023 Photon Storm Ltd. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/ - -var BasePlugin = __webpack_require__(187); -var Class = __webpack_require__(0); -var SceneEvents = __webpack_require__(23); - -/** - * @classdesc - * A Scene Level Plugin is installed into every Scene and belongs to that Scene. - * It can listen for Scene events and respond to them. - * It can map itself to a Scene property, or into the Scene Systems, or both. - * - * @class ScenePlugin - * @memberof Phaser.Plugins - * @extends Phaser.Plugins.BasePlugin - * @constructor - * @since 3.8.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin. - * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager. - * @param {string} pluginKey - The key under which this plugin has been installed into the Scene Systems. - */ -var ScenePlugin = new Class({ - - Extends: BasePlugin, - - initialize: - - function ScenePlugin (scene, pluginManager, pluginKey) - { - BasePlugin.call(this, pluginManager); - - /** - * A reference to the Scene that has installed this plugin. - * Only set if it's a Scene Plugin, otherwise `null`. - * This property is only set when the plugin is instantiated and added to the Scene, not before. - * You can use it during the `boot` method. - * - * @name Phaser.Plugins.ScenePlugin#scene - * @type {?Phaser.Scene} - * @protected - * @since 3.8.0 - */ - this.scene = scene; - - /** - * A reference to the Scene Systems of the Scene that has installed this plugin. - * Only set if it's a Scene Plugin, otherwise `null`. - * This property is only set when the plugin is instantiated and added to the Scene, not before. - * You can use it during the `boot` method. - * - * @name Phaser.Plugins.ScenePlugin#systems - * @type {?Phaser.Scenes.Systems} - * @protected - * @since 3.8.0 - */ - this.systems = scene.sys; - - /** - * The key under which this plugin was installed into the Scene Systems. - * - * This property is only set when the plugin is instantiated and added to the Scene, not before. - * You can use it during the `boot` method. - * - * @name Phaser.Plugins.ScenePlugin#pluginKey - * @type {string} - * @readonly - * @since 3.54.0 - */ - this.pluginKey = pluginKey; - - scene.sys.events.once(SceneEvents.BOOT, this.boot, this); - }, - - /** - * This method is called when the Scene boots. It is only ever called once. - * - * By this point the plugin properties `scene` and `systems` will have already been set. - * - * In here you can listen for {@link Phaser.Scenes.Events Scene events} and set-up whatever you need for this plugin to run. - * Here are the Scene events you can listen to: - * - * - start - * - ready - * - preupdate - * - update - * - postupdate - * - resize - * - pause - * - resume - * - sleep - * - wake - * - transitioninit - * - transitionstart - * - transitioncomplete - * - transitionout - * - shutdown - * - destroy - * - * At the very least you should offer a destroy handler for when the Scene closes down, i.e: - * - * ```javascript - * var eventEmitter = this.systems.events; - * eventEmitter.once('destroy', this.sceneDestroy, this); - * ``` - * - * @method Phaser.Plugins.ScenePlugin#boot - * @since 3.8.0 - */ - boot: function () - { - }, - - /** - * Game instance has been destroyed. - * - * You must release everything in here, all references, all objects, free it all up. - * - * @method Phaser.Plugins.ScenePlugin#destroy - * @since 3.8.0 - */ - destroy: function () - { - this.pluginManager = null; - this.game = null; - this.scene = null; - this.systems = null; - } - -}); - -module.exports = ScenePlugin; - - -/***/ }), -/* 187 */ -/***/ (function(module, exports, __webpack_require__) { - -/** -* @author Richard Davey -* @copyright 2013-2023 Photon Storm Ltd. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/ - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A Global Plugin is installed just once into the Game owned Plugin Manager. - * It can listen for Game events and respond to them. - * - * @class BasePlugin - * @memberof Phaser.Plugins - * @constructor - * @since 3.8.0 - * - * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager. - */ -var BasePlugin = new Class({ - - initialize: - - function BasePlugin (pluginManager) - { - /** - * A handy reference to the Plugin Manager that is responsible for this plugin. - * Can be used as a route to gain access to game systems and events. - * - * @name Phaser.Plugins.BasePlugin#pluginManager - * @type {Phaser.Plugins.PluginManager} - * @protected - * @since 3.8.0 - */ - this.pluginManager = pluginManager; - - /** - * A reference to the Game instance this plugin is running under. - * - * @name Phaser.Plugins.BasePlugin#game - * @type {Phaser.Game} - * @protected - * @since 3.8.0 - */ - this.game = pluginManager.game; - }, - - /** - * The PluginManager calls this method on a Global Plugin when the plugin is first instantiated. - * It will never be called again on this instance. - * In here you can set-up whatever you need for this plugin to run. - * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this. - * On a Scene Plugin, this method is never called. Use {@link Phaser.Plugins.ScenePlugin#boot} instead. - * - * @method Phaser.Plugins.BasePlugin#init - * @since 3.8.0 - * - * @param {?any} [data] - A value specified by the user, if any, from the `data` property of the plugin's configuration object (if started at game boot) or passed in the PluginManager's `install` method (if started manually). - */ - init: function () - { - }, - - /** - * The PluginManager calls this method on a Global Plugin when the plugin is started. - * If a plugin is stopped, and then started again, this will get called again. - * Typically called immediately after `BasePlugin.init`. - * On a Scene Plugin, this method is never called. - * - * @method Phaser.Plugins.BasePlugin#start - * @since 3.8.0 - */ - start: function () - { - // Here are the game-level events you can listen to. - // At the very least you should offer a destroy handler for when the game closes down. - - // var eventEmitter = this.game.events; - - // eventEmitter.once('destroy', this.gameDestroy, this); - // eventEmitter.on('pause', this.gamePause, this); - // eventEmitter.on('resume', this.gameResume, this); - // eventEmitter.on('resize', this.gameResize, this); - // eventEmitter.on('prestep', this.gamePreStep, this); - // eventEmitter.on('step', this.gameStep, this); - // eventEmitter.on('poststep', this.gamePostStep, this); - // eventEmitter.on('prerender', this.gamePreRender, this); - // eventEmitter.on('postrender', this.gamePostRender, this); - }, - - /** - * The PluginManager calls this method on a Global Plugin when the plugin is stopped. - * The game code has requested that your plugin stop doing whatever it does. - * It is now considered as 'inactive' by the PluginManager. - * Handle that process here (i.e. stop listening for events, etc) - * If the plugin is started again then `BasePlugin.start` will be called again. - * On a Scene Plugin, this method is never called. - * - * @method Phaser.Plugins.BasePlugin#stop - * @since 3.8.0 - */ - stop: function () - { - }, - - /** - * Game instance has been destroyed. - * You must release everything in here, all references, all objects, free it all up. - * - * @method Phaser.Plugins.BasePlugin#destroy - * @since 3.8.0 - */ - destroy: function () - { - this.pluginManager = null; - this.game = null; - this.scene = null; - this.systems = null; - } - -}); - -module.exports = BasePlugin; - - -/***/ }), -/* 188 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Object Added to Scene Event. - * - * This event is dispatched when a Game Object is added to a Scene. - * - * Listen for it from a Scene using `this.events.on('addedtoscene', listener)`. - * - * @event Phaser.Scenes.Events#ADDED_TO_SCENE - * @type {string} - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene. - * @param {Phaser.Scene} scene - The Scene to which the Game Object was added. - */ -module.exports = 'addedtoscene'; - - -/***/ }), -/* 189 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Boot Event. - * - * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins. - * - * Listen to it from a Scene using `this.events.on('boot', listener)`. - * - * @event Phaser.Scenes.Events#BOOT - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - */ -module.exports = 'boot'; - - -/***/ }), -/* 190 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Create Event. - * - * This event is dispatched by a Scene after it has been created by the Scene Manager. - * - * If a Scene has a `create` method then this event is emitted _after_ that has run. - * - * If there is a transition, this event will be fired after the `TRANSITION_START` event. - * - * Listen to it from a Scene using `this.events.on('create', listener)`. - * - * @event Phaser.Scenes.Events#CREATE - * @type {string} - * @since 3.17.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event. - */ -module.exports = 'create'; - - -/***/ }), -/* 191 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Destroy Event. - * - * This event is dispatched by a Scene during the Scene Systems destroy process. - * - * Listen to it from a Scene using `this.events.on('destroy', listener)`. - * - * You should destroy any resources that may be in use by your Scene in this event handler. - * - * @event Phaser.Scenes.Events#DESTROY - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - */ -module.exports = 'destroy'; - - -/***/ }), -/* 192 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Pause Event. - * - * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an - * action from another Scene. - * - * Listen to it from a Scene using `this.events.on('pause', listener)`. - * - * @event Phaser.Scenes.Events#PAUSE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was paused. - */ -module.exports = 'pause'; - - -/***/ }), -/* 193 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Post Update Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('postupdate', listener)`. - * - * A Scene will only run its step if it is active. - * - * @event Phaser.Scenes.Events#POST_UPDATE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. - * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. - */ -module.exports = 'postupdate'; - - -/***/ }), -/* 194 */ -/***/ (function(module, exports) { - -/** - * @author samme - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Pre-Render Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to this event from a Scene using `this.events.on('prerender', listener)`. - * - * A Scene will only render if it is visible. - * - * This event is dispatched after the Scene Display List is sorted and before the Scene is rendered. - * - * @event Phaser.Scenes.Events#PRE_RENDER - * @type {string} - * @since 3.53.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. - */ -module.exports = 'prerender'; - - -/***/ }), -/* 195 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Pre Update Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('preupdate', listener)`. - * - * A Scene will only run its step if it is active. - * - * @event Phaser.Scenes.Events#PRE_UPDATE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. - * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. - */ -module.exports = 'preupdate'; - - -/***/ }), -/* 196 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Ready Event. - * - * This event is dispatched by a Scene during the Scene Systems start process. - * By this point in the process the Scene is now fully active and rendering. - * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event. - * - * Listen to it from a Scene using `this.events.on('ready', listener)`. - * - * @event Phaser.Scenes.Events#READY - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was started. - */ -module.exports = 'ready'; - - -/***/ }), -/* 197 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Object Removed from Scene Event. - * - * This event is dispatched when a Game Object is removed from a Scene. - * - * Listen for it from a Scene using `this.events.on('removedfromscene', listener)`. - * - * @event Phaser.Scenes.Events#REMOVED_FROM_SCENE - * @type {string} - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene. - * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed. - */ -module.exports = 'removedfromscene'; - - -/***/ }), -/* 198 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Render Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('render', listener)`. - * - * A Scene will only render if it is visible. - * - * By the time this event is dispatched, the Scene will have already been rendered. - * - * @event Phaser.Scenes.Events#RENDER - * @type {string} - * @since 3.0.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. - */ -module.exports = 'render'; - - -/***/ }), -/* 199 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Resume Event. - * - * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method, - * or as an action from another Scene. - * - * Listen to it from a Scene using `this.events.on('resume', listener)`. - * - * @event Phaser.Scenes.Events#RESUME - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was resumed. - */ -module.exports = 'resume'; - - -/***/ }), -/* 200 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Shutdown Event. - * - * This event is dispatched by a Scene during the Scene Systems shutdown process. - * - * Listen to it from a Scene using `this.events.on('shutdown', listener)`. - * - * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding - * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not - * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources. - * - * @event Phaser.Scenes.Events#SHUTDOWN - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was shutdown. - */ -module.exports = 'shutdown'; - - -/***/ }), -/* 201 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Sleep Event. - * - * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method, - * or as an action from another Scene. - * - * Listen to it from a Scene using `this.events.on('sleep', listener)`. - * - * @event Phaser.Scenes.Events#SLEEP - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was sent to sleep. - */ -module.exports = 'sleep'; - - -/***/ }), -/* 202 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Start Event. - * - * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins. - * - * Listen to it from a Scene using `this.events.on('start', listener)`. - * - * @event Phaser.Scenes.Events#START - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - */ -module.exports = 'start'; - - -/***/ }), -/* 203 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Transition Complete Event. - * - * This event is dispatched by the Target Scene of a transition. - * - * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration - * of the transition. - * - * Listen to it from a Scene using `this.events.on('transitioncomplete', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - * - * @event Phaser.Scenes.Events#TRANSITION_COMPLETE - * @type {string} - * @since 3.5.0 - * - * @param {Phaser.Scene} scene -The Scene on which the transitioned completed. - */ -module.exports = 'transitioncomplete'; - - -/***/ }), -/* 204 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Transition Init Event. - * - * This event is dispatched by the Target Scene of a transition. - * - * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method, - * this event is not dispatched. - * - * Listen to it from a Scene using `this.events.on('transitioninit', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - * - * @event Phaser.Scenes.Events#TRANSITION_INIT - * @type {string} - * @since 3.5.0 - * - * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. - * @param {number} duration - The duration of the transition in ms. - */ -module.exports = 'transitioninit'; - - -/***/ }), -/* 205 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Transition Out Event. - * - * This event is dispatched by a Scene when it initiates a transition to another Scene. - * - * Listen to it from a Scene using `this.events.on('transitionout', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - * - * @event Phaser.Scenes.Events#TRANSITION_OUT - * @type {string} - * @since 3.5.0 - * - * @param {Phaser.Scene} target - A reference to the Scene that is being transitioned to. - * @param {number} duration - The duration of the transition in ms. - */ -module.exports = 'transitionout'; - - -/***/ }), -/* 206 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Transition Start Event. - * - * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep. - * - * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method, - * this event is dispatched anyway. - * - * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is - * dispatched instead of this event. - * - * Listen to it from a Scene using `this.events.on('transitionstart', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - * - * @event Phaser.Scenes.Events#TRANSITION_START - * @type {string} - * @since 3.5.0 - * - * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. - * @param {number} duration - The duration of the transition in ms. - */ -module.exports = 'transitionstart'; - - -/***/ }), -/* 207 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Transition Wake Event. - * - * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before - * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead. - * - * Listen to it from a Scene using `this.events.on('transitionwake', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - * - * @event Phaser.Scenes.Events#TRANSITION_WAKE - * @type {string} - * @since 3.5.0 - * - * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. - * @param {number} duration - The duration of the transition in ms. - */ -module.exports = 'transitionwake'; - - -/***/ }), -/* 208 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Update Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists and the Scene is in a Running state, otherwise this is skipped. - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('update', listener)`. - * - * A Scene will only run its step if it is active. - * - * @event Phaser.Scenes.Events#UPDATE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. - * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. - */ -module.exports = 'update'; - - -/***/ }), -/* 209 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Scene Systems Wake Event. - * - * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method, - * or as an action from another Scene. - * - * Listen to it from a Scene using `this.events.on('wake', listener)`. - * - * @event Phaser.Scenes.Events#WAKE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. - * @param {any} [data] - An optional data object that was passed to this Scene when it was woken up. - */ -module.exports = 'wake'; - - -/***/ }), -/* 210 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 5782: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -33911,1735 +13909,406 @@ module.exports = 'wake'; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Class = __webpack_require__(0); -var GetFastValue = __webpack_require__(9); -var ImageFile = __webpack_require__(211); -var IsPlainObject = __webpack_require__(6); -var JSONFile = __webpack_require__(223); -var MultiFile = __webpack_require__(224); -var TextFile = __webpack_require__(225); - -/** - * @typedef {object} Phaser.Loader.FileTypes.SpineFileConfig - * - * @property {string} key - The key of the file. Must be unique within both the Loader and the Texture Manager. - * @property {string|string[]} [jsonURL] - The absolute or relative URL to load the JSON file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". - * @property {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @property {boolean} [preMultipliedAlpha=false] - Do the textures contain pre-multiplied alpha or not? - * @property {XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. - * @property {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. - */ +var Class = __webpack_require__(7473); +var Container = __webpack_require__(7361); +var SpineContainerRender = __webpack_require__(7738); /** * @classdesc - * A Spine File suitable for loading by the Loader. + * A Spine Container is a special kind of Container created specifically for Spine Game Objects. * - * These are created when you use the Phaser.Loader.LoaderPlugin#spine method and are not typically created directly. + * You have all of the same features of a standard Container, but the rendering functions are optimized specifically + * for Spine Game Objects. You must only add ever Spine Game Objects, or other Spine Containers, to this type of Container. + * Although Phaser will not prevent you from adding other types, they will not render and are likely to throw runtime errors. * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spine. + * To create one in a Scene, use the factory methods: * - * @class SpineFile - * @extends Phaser.Loader.MultiFile - * @memberof Phaser.Loader.FileTypes + * ```javascript + * this.add.spineContainer(); + * ``` + * + * or + * + * ```javascript + * this.make.spineContainer(); + * ``` + * + * Note that you should not nest Spine Containers inside regular Containers if you wish to use masks on the + * container children. You can, however, mask children of Spine Containers if they are embedded within other + * Spine Containers. In short, if you need masking, don't mix and match the types. + * + * See the Container documentation for further details about what Containers can do. + * + * @class SpineContainer + * @extends Phaser.GameObjects.Container * @constructor + * @since 3.50.0 * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Loader.FileTypes.SpineFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string|string[]} [jsonURL] - The absolute or relative URL to load the JSON file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". - * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @param {boolean} [preMultipliedAlpha=false] - Do the textures contain pre-multiplied alpha or not? - * @param {XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. - * @param {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Scene} scene - A reference to the Scene that this Game Object belongs to. + * @param {SpinePlugin} pluginManager - A reference to the Phaser Spine Plugin. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {SpineGameObject[]} [children] - An optional array of Spine Game Objects to add to this Container. */ -var SpineFile = new Class({ +var SpineContainer = new Class({ - Extends: MultiFile, + Extends: Container, + + Mixins: [ + SpineContainerRender + ], initialize: - function SpineFile (loader, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings) + function SpineContainer (scene, plugin, x, y, children) { - var i; - var json; - var atlas; - var files = []; - var cache = loader.cacheManager.custom.spine; + Container.call(this, scene, x, y, children); - // atlas can be an array of atlas files, not just a single one + // Same as SpineGameObject, to prevent the renderer from mis-typing it when batching + this.type = 'Spine'; - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - - json = new JSONFile(loader, { - key: key, - url: GetFastValue(config, 'jsonURL'), - extension: GetFastValue(config, 'jsonExtension', 'json'), - xhrSettings: GetFastValue(config, 'jsonXhrSettings') - }); - - atlasURL = GetFastValue(config, 'atlasURL'); - preMultipliedAlpha = GetFastValue(config, 'preMultipliedAlpha'); - - if (!Array.isArray(atlasURL)) - { - atlasURL = [ atlasURL ]; - } - - for (i = 0; i < atlasURL.length; i++) - { - atlas = new TextFile(loader, { - key: key + '!' + i, - url: atlasURL[i], - extension: GetFastValue(config, 'atlasExtension', 'atlas'), - xhrSettings: GetFastValue(config, 'atlasXhrSettings') - }); - - atlas.cache = cache; - - files.push(atlas); - } - } - else - { - json = new JSONFile(loader, key, jsonURL, jsonXhrSettings); - - if (!Array.isArray(atlasURL)) - { - atlasURL = [ atlasURL ]; - } - - for (i = 0; i < atlasURL.length; i++) - { - atlas = new TextFile(loader, key + '!' + i, atlasURL[i], atlasXhrSettings); - atlas.cache = cache; - - files.push(atlas); - } - } - - files.unshift(json); - - MultiFile.call(this, loader, 'spine', key, files); - - this.config.preMultipliedAlpha = preMultipliedAlpha; + /** + * A reference to the Spine Plugin. + * + * @name SpineContainer#plugin + * @type {SpinePlugin} + * @since 3.50.0 + */ + this.plugin = plugin; }, /** - * Called by each File when it finishes loading. + * Internal destroy handler, called as part of the destroy process. * - * @method Phaser.Loader.FileTypes.SpineFile#onFileComplete - * @since 3.19.0 - * - * @param {Phaser.Loader.File} file - The File that has completed processing. + * @method SpineContainer#preDestroy + * @protected + * @since 3.50.0 */ - onFileComplete: function (file) + preDestroy: function () { - var index = this.files.indexOf(file); + this.removeAll(!!this.exclusive); - if (index !== -1) - { - this.pending--; + this.localTransform.destroy(); + this.tempTransformMatrix.destroy(); - if (file.type === 'text') - { - // Inspect the data for the files to now load - var content = file.data.split('\n'); - - // Extract the textures - var textures = [ content[0] ]; - - for (var t = 0; t < content.length; t++) - { - var line = content[t]; - - if (line.trim() === '' && t < content.length - 1) - { - line = content[t + 1]; - - textures.push(line); - } - } - - var config = this.config; - var loader = this.loader; - - var currentBaseURL = loader.baseURL; - var currentPath = loader.path; - var currentPrefix = loader.prefix; - - var baseURL = GetFastValue(config, 'baseURL', this.baseURL); - var path = GetFastValue(config, 'path', file.src.match(/^.*\//))[0]; - var prefix = GetFastValue(config, 'prefix', this.prefix); - var textureXhrSettings = GetFastValue(config, 'textureXhrSettings'); - - loader.setBaseURL(baseURL); - loader.setPath(path); - loader.setPrefix(prefix); - - for (var i = 0; i < textures.length; i++) - { - var textureURL = textures[i]; - - var key = textureURL; - - var image = new ImageFile(loader, key, textureURL, textureXhrSettings); - - if (!loader.keyExists(image)) - { - this.addToMultiFile(image); - - loader.addFile(image); - } - } - - // Reset the loader settings - loader.setBaseURL(currentBaseURL); - loader.setPath(currentPath); - loader.setPrefix(currentPrefix); - } - } - }, - - /** - * Adds this file to its target cache upon successful loading and processing. - * - * @method Phaser.Loader.FileTypes.SpineFile#addToCache - * @since 3.19.0 - */ - addToCache: function () - { - if (this.isReadyToProcess()) - { - var fileJSON = this.files[0]; - - fileJSON.addToCache(); - - var atlasCache; - var atlasKey = ''; - var combinedAtlasData = ''; - var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false; - var textureManager = this.loader.textureManager; - - for (var i = 1; i < this.files.length; i++) - { - var file = this.files[i]; - - if (file.type === 'text') - { - atlasKey = file.key.replace(/![\d]$/, ''); - - atlasCache = file.cache; - - combinedAtlasData = combinedAtlasData.concat(file.data); - } - else - { - var src = file.key.trim(); - var pos = src.indexOf('!'); - var key = src.substr(pos + 1); - - if (!textureManager.exists(key)) - { - textureManager.addImage(key, file.data); - } - } - - file.pendingDestroy(); - } - - atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlasData, prefix: this.prefix }); - - this.complete = true; - } + this.list = []; + this._displayList = null; + this.plugin = null; } }); -module.exports = SpineFile; +module.exports = SpineContainer; /***/ }), -/* 211 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 7738: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); -var CONST = __webpack_require__(10); -var File = __webpack_require__(24); -var FileTypesManager = __webpack_require__(25); -var GetFastValue = __webpack_require__(9); -var IsPlainObject = __webpack_require__(6); -var GetURL = __webpack_require__(49); +var renderWebGL = __webpack_require__(1984); +var renderCanvas = __webpack_require__(1984); + +if (true) +{ + renderWebGL = __webpack_require__(434); +} + +if (false) +{} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), + +/***/ 434: +/***/ ((module) => { /** - * @classdesc - * A single Image File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image. - * - * @class ImageFile - * @extends Phaser.Loader.File - * @memberof Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets. + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ImageFile = new Class({ - Extends: File, +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method SpineContainerWebGLRenderer#renderWebGL + * @since 3.50.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {SpineContainer} container - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var SpineContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) +{ + var plugin = container.plugin; + var sceneRenderer = plugin.sceneRenderer; + var children = container.list; - initialize: - - function ImageFile (loader, key, url, xhrSettings, frameConfig) + if (children.length === 0) { - var extension = 'png'; - var normalMapURL; - - if (IsPlainObject(key)) + if (sceneRenderer.batcher.isDrawing && renderer.finalType) { - var config = key; + sceneRenderer.end(); - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - normalMapURL = GetFastValue(config, 'normalMap'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - frameConfig = GetFastValue(config, 'frameConfig'); + renderer.pipelines.rebind(); } - if (Array.isArray(url)) - { - normalMapURL = url[1]; - url = url[0]; - } - - var fileConfig = { - type: 'image', - cache: loader.textureManager, - extension: extension, - responseType: 'blob', - key: key, - url: url, - xhrSettings: xhrSettings, - config: frameConfig - }; - - File.call(this, loader, fileConfig); - - // Do we have a normal map to load as well? - if (normalMapURL) - { - var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig); - - normalMap.type = 'normalMap'; - - this.setLink(normalMap); - - loader.addFile(normalMap); - } - - this.useImageElementLoad = loader.imageLoadType === 'HTMLImageElement'; - - if (this.useImageElementLoad) - { - this.load = this.loadImage; - this.onProcess = this.onProcessImage; - } - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.ImageFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - this.state = CONST.FILE_PROCESSING; - - this.data = new Image(); - - this.data.crossOrigin = this.crossOrigin; - - var _this = this; - - this.data.onload = function () - { - File.revokeObjectURL(_this.data); - - _this.onProcessComplete(); - }; - - this.data.onerror = function () - { - File.revokeObjectURL(_this.data); - - _this.onProcessError(); - }; - - File.createObjectURL(this.data, this.xhrLoader.response, 'image/png'); - }, - - /** - * Handles image load processing. - * - * @method Phaser.Loader.FileTypes.ImageFile#onProcessImage - * @private - * @since 3.60.0 - */ - onProcessImage: function () - { - var result = this.state; - - this.state = CONST.FILE_PROCESSING; - - if (result === CONST.FILE_LOADED) - { - this.onProcessComplete(); - } - else - { - this.onProcessError(); - } - }, - - /** - * Loads the image using either XHR or an Image tag. - * - * @method Phaser.Loader.FileTypes.ImageFile#loadImage - * @private - * @since 3.60.0 - */ - loadImage: function () - { - this.state = CONST.FILE_LOADING; - - this.src = GetURL(this, this.loader.baseURL); - - if (this.src.indexOf('data:') === 0) - { - console.warn('Local data URIs are not supported: ' + this.key); - } - else - { - this.data = new Image(); - - this.data.crossOrigin = this.crossOrigin; - - var _this = this; - - this.data.onload = function () - { - _this.state = CONST.FILE_LOADED; - - _this.loader.nextFile(_this, true); - }; - - this.data.onerror = function () - { - _this.loader.nextFile(_this, false); - }; - - this.data.src = this.src; - } - }, - - /** - * Adds this file to its target cache upon successful loading and processing. - * - * @method Phaser.Loader.FileTypes.ImageFile#addToCache - * @since 3.7.0 - */ - addToCache: function () - { - // Check if we have a linked normal map - var linkFile = this.linkFile; - - if (linkFile) - { - // We do, but has it loaded? - if (linkFile.state >= CONST.FILE_COMPLETE) - { - // Both files have loaded - if (this.type === 'normalMap') - { - // linkFile.data = Image - // this.data = Normal Map - this.cache.addImage(this.key, linkFile.data, this.data); - } - else - { - // linkFile.data = Normal Map - // this.data = Image - this.cache.addImage(this.key, this.data, linkFile.data); - } - } - - // Nothing to do here, we'll use the linkFile `addToCache` call - // to process this pair - } - else - { - this.cache.addImage(this.key, this.data); - } + return; } -}); + camera.addToRenderList(container); -/** - * Adds an Image, or array of Images, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.image('logo', 'images/phaserLogo.png'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. - * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback - * of animated gifs to Canvas elements. - * - * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the Texture Manager first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.image({ - * key: 'logo', - * url: 'images/AtariLogo.png' - * }); - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details. - * - * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: - * - * ```javascript - * this.load.image('logo', 'images/AtariLogo.png'); - * // and later in your game ... - * this.add.image(x, y, 'logo'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and - * this is what you would use to retrieve the image from the Texture Manager. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" - * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, - * then you can specify it by providing an array as the `url` where the second element is the normal map: - * - * ```javascript - * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]); - * ``` - * - * Or, if you are using a config object use the `normalMap` property: - * - * ```javascript - * this.load.image({ - * key: 'logo', - * url: 'images/AtariLogo.png', - * normalMap: 'images/AtariLogo-n.png' - * }); - * ``` - * - * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. - * Normal maps are a WebGL only feature. - * - * In Phaser 3.60 a new property was added that allows you to control how images are loaded. By default, images are loaded via XHR as Blobs. - * However, you can set `loader.imageLoadType: "HTMLImageElement"` in the Game Configuration and instead, the Loader will load all images - * via the Image tag instead. - * - * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#image - * @fires Phaser.Loader.LoaderPlugin#ADD - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig|Phaser.Types.Loader.FileTypes.ImageFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {this} The Loader instance. - */ -FileTypesManager.register('image', function (key, url, xhrSettings) -{ - if (Array.isArray(key)) + var transformMatrix = container.localTransform; + + if (parentMatrix) { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new ImageFile(this, key[i])); - } + transformMatrix.loadIdentity(); + transformMatrix.multiply(parentMatrix); + transformMatrix.translate(container.x, container.y); + transformMatrix.rotate(container.rotation); + transformMatrix.scale(container.scaleX, container.scaleY); } else { - this.addFile(new ImageFile(this, key, url, xhrSettings)); + transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); } - return this; -}); + if (renderer.newType) + { + // flush + clear if this is a new type + renderer.pipelines.clear(); -module.exports = ImageFile; + sceneRenderer.begin(); + } + + var rendererNextType = renderer.nextTypeMatch; + + // Force these to avoid batch flushing during SpineGameObject.renderWebGL + renderer.nextTypeMatch = true; + renderer.newType = false; + + for (var i = 0; i < children.length; i++) + { + var child = children[i]; + + if (child.willRender(camera, container)) + { + var mask = child.mask; + + if (mask) + { + sceneRenderer.end(); + + renderer.pipelines.rebind(); + + mask.preRenderWebGL(renderer, child, camera); + + renderer.pipelines.clear(); + + sceneRenderer.begin(); + } + + child.renderWebGL(renderer, child, camera, transformMatrix, container); + + if (mask) + { + sceneRenderer.end(); + + renderer.pipelines.rebind(); + + mask.postRenderWebGL(renderer, camera); + + renderer.pipelines.clear(); + + sceneRenderer.begin(); + } + } + } + + renderer.nextTypeMatch = rendererNextType; + + if (!rendererNextType) + { + // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch + sceneRenderer.end(); + + // And rebind the previous pipeline + renderer.pipelines.rebind(); + } +}; + +module.exports = SpineContainerWebGLRenderer; /***/ }), -/* 212 */ -/***/ (function(module, exports) { + +/***/ 6576: +/***/ ((module) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * The Loader Plugin Add File Event. + * The Complete Event. * - * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue. - * - * Listen to it from a Scene using: `this.load.on('addfile', listener)`. - * - * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them. - * - * @event Phaser.Loader.Events#ADD - * @type {string} - * @since 3.0.0 - * - * @param {string} key - The unique key of the file that was added to the Loader. - * @param {string} type - The [file type]{@link Phaser.Loader.File#type} string of the file that was added to the Loader, i.e. `image`. - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - * @param {Phaser.Loader.File} file - A reference to the File which was added to the Loader. - */ -module.exports = 'addfile'; - - -/***/ }), -/* 213 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Loader Plugin Complete Event. - * - * This event is dispatched when the Loader has fully processed everything in the load queue. - * By this point every loaded file will now be in its associated cache and ready for use. - * - * Listen to it from a Scene using: `this.load.on('complete', listener)`. - * - * @event Phaser.Loader.Events#COMPLETE - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - * @param {number} totalComplete - The total number of files that successfully loaded. - * @param {number} totalFailed - The total number of files that failed to load. + * @event SpinePluginEvents#COMPLETE + * @since 3.19.0 */ module.exports = 'complete'; /***/ }), -/* 214 */ -/***/ (function(module, exports) { + +/***/ 8621: +/***/ ((module) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * The File Load Complete Event. + * The Dispose Event. * - * This event is dispatched by the Loader Plugin when _any_ file in the queue finishes loading. - * - * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`. - * - * Make sure you remove this listener when you have finished, or it will continue to fire if the Scene reloads. - * - * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. - * - * @event Phaser.Loader.Events#FILE_COMPLETE - * @type {string} - * @since 3.0.0 - * - * @param {string} key - The key of the file that just loaded and finished processing. - * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. - * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. + * @event SpinePluginEvents#DISPOSE + * @since 3.19.0 */ -module.exports = 'filecomplete'; +module.exports = 'dispose'; /***/ }), -/* 215 */ -/***/ (function(module, exports) { + +/***/ 8944: +/***/ ((module) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * The File Load Complete Event. + * The End Event. * - * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. - * - * It uses a special dynamic event name constructed from the key and type of the file. - * - * For example, if you have loaded an `image` with a key of `monster`, you can listen for it - * using the following: - * - * ```javascript - * this.load.on('filecomplete-image-monster', function (key, type, data) { - * // Your handler code - * }); - * ``` - * - * Or, if you have loaded a texture `atlas` with a key of `Level1`: - * - * ```javascript - * this.load.on('filecomplete-atlasjson-Level1', function (key, type, data) { - * // Your handler code - * }); - * ``` - * - * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`: - * - * ```javascript - * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) { - * // Your handler code - * }); - * ``` - * - * Make sure you remove your listeners when you have finished, or they will continue to fire if the Scene reloads. - * - * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event. - * - * @event Phaser.Loader.Events#FILE_KEY_COMPLETE - * @type {string} - * @since 3.0.0 - * - * @param {string} key - The key of the file that just loaded and finished processing. - * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. - * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. + * @event SpinePluginEvents#END + * @since 3.19.0 */ -module.exports = 'filecomplete-'; +module.exports = 'end'; /***/ }), -/* 216 */ -/***/ (function(module, exports) { + +/***/ 7494: +/***/ ((module) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * The File Load Error Event. + * The Custom Event Event. * - * This event is dispatched by the Loader Plugin when a file fails to load. - * - * Listen to it from a Scene using: `this.load.on('loaderror', listener)`. - * - * @event Phaser.Loader.Events#FILE_LOAD_ERROR - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + * @event SpinePluginEvents#EVENT + * @since 3.19.0 */ -module.exports = 'loaderror'; +module.exports = 'event'; /***/ }), -/* 217 */ -/***/ (function(module, exports) { + +/***/ 1908: +/***/ ((module) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * The File Load Event. + * The Interrupted Event. * - * This event is dispatched by the Loader Plugin when a file finishes loading, - * but _before_ it is processed and added to the internal Phaser caches. - * - * Listen to it from a Scene using: `this.load.on('load', listener)`. - * - * @event Phaser.Loader.Events#FILE_LOAD - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - A reference to the File which just finished loading. + * @event SpinePluginEvents#INTERRUPTED + * @since 3.19.0 */ -module.exports = 'load'; +module.exports = 'interrupted'; /***/ }), -/* 218 */ -/***/ (function(module, exports) { + +/***/ 5591: +/***/ ((module) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * The File Load Progress Event. + * The Start Event. * - * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and - * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen. - * - * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`. - * - * @event Phaser.Loader.Events#FILE_PROGRESS - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - A reference to the File which errored during load. - * @param {number} percentComplete - A value between 0 and 1 indicating how 'complete' this file is. - */ -module.exports = 'fileprogress'; - - -/***/ }), -/* 219 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Loader Plugin Post Process Event. - * - * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue. - * It is dispatched before the internal lists are cleared and each File is destroyed. - * - * Use this hook to perform any last minute processing of files that can only happen once the - * Loader has completed, but prior to it emitting the `complete` event. - * - * Listen to it from a Scene using: `this.load.on('postprocess', listener)`. - * - * @event Phaser.Loader.Events#POST_PROCESS - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - */ -module.exports = 'postprocess'; - - -/***/ }), -/* 220 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Loader Plugin Progress Event. - * - * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading. - * - * Listen to it from a Scene using: `this.load.on('progress', listener)`. - * - * @event Phaser.Loader.Events#PROGRESS - * @type {string} - * @since 3.0.0 - * - * @param {number} progress - The current progress of the load. A value between 0 and 1. - */ -module.exports = 'progress'; - - -/***/ }), -/* 221 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Loader Plugin Start Event. - * - * This event is dispatched when the Loader starts running. At this point load progress is zero. - * - * This event is dispatched even if there aren't any files in the load queue. - * - * Listen to it from a Scene using: `this.load.on('start', listener)`. - * - * @event Phaser.Loader.Events#START - * @type {string} - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @event SpinePluginEvents#START + * @since 3.19.0 */ module.exports = 'start'; /***/ }), -/* 222 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 5146: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MergeXHRSettings = __webpack_require__(50); - /** - * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings - * and starts the download of it. It uses the Files own XHRSettings and merges them - * with the global XHRSettings object to set the xhr values before download. - * - * @function Phaser.Loader.XHRLoader - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - The File to download. - * @param {Phaser.Types.Loader.XHRSettingsObject} globalXHRSettings - The global XHRSettings object. - * - * @return {XMLHttpRequest} The XHR object. + * @namespace SpinePluginEvents */ -var XHRLoader = function (file, globalXHRSettings) -{ - var config = MergeXHRSettings(globalXHRSettings, file.xhrSettings); - var xhr = new XMLHttpRequest(); +module.exports = { - xhr.open('GET', file.src, config.async, config.user, config.password); + COMPLETE: __webpack_require__(6576), + DISPOSE: __webpack_require__(8621), + END: __webpack_require__(8944), + EVENT: __webpack_require__(7494), + INTERRUPTED: __webpack_require__(1908), + START: __webpack_require__(5591) - xhr.responseType = file.xhrSettings.responseType; - xhr.timeout = config.timeout; - - if (config.headers) - { - for (var key in config.headers) - { - xhr.setRequestHeader(key, config.headers[key]); - } - } - - if (config.header && config.headerValue) - { - xhr.setRequestHeader(config.header, config.headerValue); - } - - if (config.requestedWith) - { - xhr.setRequestHeader('X-Requested-With', config.requestedWith); - } - - if (config.overrideMimeType) - { - xhr.overrideMimeType(config.overrideMimeType); - } - - if (config.withCredentials) - { - xhr.withCredentials = true; - } - - // After a successful request, the xhr.response property will contain the requested data as a DOMString, ArrayBuffer, Blob, or Document (depending on what was set for responseType.) - - xhr.onload = file.onLoad.bind(file, xhr); - xhr.onerror = file.onError.bind(file, xhr); - xhr.onprogress = file.onProgress.bind(file); - - // This is the only standard method, the ones above are browser additions (maybe not universal?) - // xhr.onreadystatechange - - xhr.send(); - - return xhr; }; -module.exports = XHRLoader; - /***/ }), -/* 223 */ -/***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(10); -var File = __webpack_require__(24); -var FileTypesManager = __webpack_require__(25); -var GetFastValue = __webpack_require__(9); -var GetValue = __webpack_require__(8); -var IsPlainObject = __webpack_require__(6); - -/** - * @classdesc - * A single JSON File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. - * - * @class JSONFile - * @extends Phaser.Loader.File - * @memberof Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. - */ -var JSONFile = new Class({ - - Extends: File, - - initialize: - - // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object - // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing - - function JSONFile (loader, key, url, xhrSettings, dataKey) - { - var extension = 'json'; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - dataKey = GetFastValue(config, 'dataKey', dataKey); - } - - var fileConfig = { - type: 'json', - cache: loader.cacheManager.json, - extension: extension, - responseType: 'text', - key: key, - url: url, - xhrSettings: xhrSettings, - config: dataKey - }; - - File.call(this, loader, fileConfig); - - // A JSON object has been provided (instead of a URL), so we'll use it directly as the File.data. No need to load it. - if (IsPlainObject(url)) - { - if (dataKey) - { - this.data = GetValue(url, dataKey); - } - else - { - this.data = url; - } - - this.state = CONST.FILE_POPULATED; - } - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.JSONFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - if (this.state !== CONST.FILE_POPULATED) - { - this.state = CONST.FILE_PROCESSING; - - try - { - var json = JSON.parse(this.xhrLoader.responseText); - } - catch (e) - { - this.onProcessError(); - - throw e; - } - - var key = this.config; - - if (typeof key === 'string') - { - this.data = GetValue(json, key, json); - } - else - { - this.data = json; - } - } - - this.onProcessComplete(); - } - -}); - -/** - * Adds a JSON file, or array of JSON files, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.json('wavedata', 'files/AlienWaveData.json'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the JSON Cache first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.json({ - * key: 'wavedata', - * url: 'files/AlienWaveData.json' - * }); - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. - * - * Once the file has finished loading you can access it from its Cache using its key: - * - * ```javascript - * this.load.json('wavedata', 'files/AlienWaveData.json'); - * // and later in your game ... - * var data = this.cache.json.get('wavedata'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and - * this is what you would use to retrieve the text from the JSON Cache. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" - * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, - * rather than the whole file. For example, if your JSON data had a structure like this: - * - * ```json - * { - * "level1": { - * "baddies": { - * "aliens": {}, - * "boss": {} - * } - * }, - * "level2": {}, - * "level3": {} - * } - * ``` - * - * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. - * - * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#json - * @fires Phaser.Loader.LoaderPlugin#ADD - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {this} The Loader instance. - */ -FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) -{ - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new JSONFile(this, key[i])); - } - } - else - { - this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); - } - - return this; -}); - -module.exports = JSONFile; - - -/***/ }), -/* 224 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(10); -var Events = __webpack_require__(48); - -/** - * @classdesc - * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after - * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. - * - * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. - * - * @class MultiFile - * @memberof Phaser.Loader - * @constructor - * @since 3.7.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. - * @param {string} type - The file type string for sorting within the Loader. - * @param {string} key - The key of the file within the loader. - * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile. - */ -var MultiFile = new Class({ - - initialize: - - function MultiFile (loader, type, key, files) - { - var finalFiles = []; - - // Clean out any potential 'null' or 'undefined' file entries - files.forEach(function (file) - { - if (file) - { - finalFiles.push(file); - } - }); - - /** - * A reference to the Loader that is going to load this file. - * - * @name Phaser.Loader.MultiFile#loader - * @type {Phaser.Loader.LoaderPlugin} - * @since 3.7.0 - */ - this.loader = loader; - - /** - * The file type string for sorting within the Loader. - * - * @name Phaser.Loader.MultiFile#type - * @type {string} - * @since 3.7.0 - */ - this.type = type; - - /** - * Unique cache key (unique within its file type) - * - * @name Phaser.Loader.MultiFile#key - * @type {string} - * @since 3.7.0 - */ - this.key = key; - - /** - * The current index being used by multi-file loaders to avoid key clashes. - * - * @name Phaser.Loader.MultiFile#multiKeyIndex - * @type {number} - * @private - * @since 3.20.0 - */ - this.multiKeyIndex = loader.multiKeyIndex++; - - /** - * Array of files that make up this MultiFile. - * - * @name Phaser.Loader.MultiFile#files - * @type {Phaser.Loader.File[]} - * @since 3.7.0 - */ - this.files = finalFiles; - - /** - * The current state of the file. One of the FILE_CONST values. - * - * @name Phaser.Loader.MultiFile#state - * @type {number} - * @since 3.60.0 - */ - this.state = CONST.FILE_PENDING; - - /** - * The completion status of this MultiFile. - * - * @name Phaser.Loader.MultiFile#complete - * @type {boolean} - * @default false - * @since 3.7.0 - */ - this.complete = false; - - /** - * The number of files to load. - * - * @name Phaser.Loader.MultiFile#pending - * @type {number} - * @since 3.7.0 - */ - - this.pending = finalFiles.length; - - /** - * The number of files that failed to load. - * - * @name Phaser.Loader.MultiFile#failed - * @type {number} - * @default 0 - * @since 3.7.0 - */ - this.failed = 0; - - /** - * A storage container for transient data that the loading files need. - * - * @name Phaser.Loader.MultiFile#config - * @type {any} - * @since 3.7.0 - */ - this.config = {}; - - /** - * A reference to the Loaders baseURL at the time this MultiFile was created. - * Used to populate child-files. - * - * @name Phaser.Loader.MultiFile#baseURL - * @type {string} - * @since 3.20.0 - */ - this.baseURL = loader.baseURL; - - /** - * A reference to the Loaders path at the time this MultiFile was created. - * Used to populate child-files. - * - * @name Phaser.Loader.MultiFile#path - * @type {string} - * @since 3.20.0 - */ - this.path = loader.path; - - /** - * A reference to the Loaders prefix at the time this MultiFile was created. - * Used to populate child-files. - * - * @name Phaser.Loader.MultiFile#prefix - * @type {string} - * @since 3.20.0 - */ - this.prefix = loader.prefix; - - // Link the files - for (var i = 0; i < finalFiles.length; i++) - { - finalFiles[i].multiFile = this; - } - }, - - /** - * Checks if this MultiFile is ready to process its children or not. - * - * @method Phaser.Loader.MultiFile#isReadyToProcess - * @since 3.7.0 - * - * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`. - */ - isReadyToProcess: function () - { - return (this.pending === 0 && this.failed === 0 && !this.complete); - }, - - /** - * Adds another child to this MultiFile, increases the pending count and resets the completion status. - * - * @method Phaser.Loader.MultiFile#addToMultiFile - * @since 3.7.0 - * - * @param {Phaser.Loader.File} files - The File to add to this MultiFile. - * - * @return {Phaser.Loader.MultiFile} This MultiFile instance. - */ - addToMultiFile: function (file) - { - this.files.push(file); - - file.multiFile = this; - - this.pending++; - - this.complete = false; - - return this; - }, - - /** - * Called by each File when it finishes loading. - * - * @method Phaser.Loader.MultiFile#onFileComplete - * @since 3.7.0 - * - * @param {Phaser.Loader.File} file - The File that has completed processing. - */ - onFileComplete: function (file) - { - var index = this.files.indexOf(file); - - if (index !== -1) - { - this.pending--; - } - }, - - /** - * Called by each File that fails to load. - * - * @method Phaser.Loader.MultiFile#onFileFailed - * @since 3.7.0 - * - * @param {Phaser.Loader.File} file - The File that has failed to load. - */ - onFileFailed: function (file) - { - var index = this.files.indexOf(file); - - if (index !== -1) - { - this.failed++; - - // eslint-disable-next-line no-console - console.error('File failed: %s "%s" (via %s "%s")', this.type, this.key, file.type, file.key); - } - }, - - /** - * Called once all children of this multi file have been added to their caches and is now - * ready for deletion from the Loader. - * - * It will emit a `filecomplete` event from the LoaderPlugin. - * - * @method Phaser.Loader.MultiFile#pendingDestroy - * @fires Phaser.Loader.Events#FILE_COMPLETE - * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE - * @since 3.60.0 - */ - pendingDestroy: function () - { - if (this.state === CONST.FILE_PENDING_DESTROY) - { - return; - } - - var key = this.key; - var type = this.type; - - this.loader.emit(Events.FILE_COMPLETE, key, type); - this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type); - - this.loader.flagForRemoval(this); - - for (var i = 0; i < this.files.length; i++) - { - this.files[i].pendingDestroy(); - } - - this.state = CONST.FILE_PENDING_DESTROY; - }, - - /** - * Destroy this Multi File and any references it holds. - * - * @method Phaser.Loader.MultiFile#destroy - * @since 3.60.0 - */ - destroy: function () - { - this.loader = null; - this.files = null; - this.config = null; - } - -}); - -module.exports = MultiFile; - - -/***/ }), -/* 225 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(10); -var File = __webpack_require__(24); -var FileTypesManager = __webpack_require__(25); -var GetFastValue = __webpack_require__(9); -var IsPlainObject = __webpack_require__(6); - -/** - * @classdesc - * A single Text File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text. - * - * @class TextFile - * @extends Phaser.Loader.File - * @memberof Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - */ -var TextFile = new Class({ - - Extends: File, - - initialize: - - function TextFile (loader, key, url, xhrSettings) - { - var type = 'text'; - var extension = 'txt'; - var cache = loader.cacheManager.text; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - type = GetFastValue(config, 'type', type); - cache = GetFastValue(config, 'cache', cache); - } - - var fileConfig = { - type: type, - cache: cache, - extension: extension, - responseType: 'text', - key: key, - url: url, - xhrSettings: xhrSettings - }; - - File.call(this, loader, fileConfig); - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.TextFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - this.state = CONST.FILE_PROCESSING; - - this.data = this.xhrLoader.responseText; - - this.onProcessComplete(); - } - -}); - -/** - * Adds a Text file, or array of Text files, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.text('story', 'files/IntroStory.txt'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the Text Cache. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the Text Cache first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.text({ - * key: 'story', - * url: 'files/IntroStory.txt' - * }); - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details. - * - * Once the file has finished loading you can access it from its Cache using its key: - * - * ```javascript - * this.load.text('story', 'files/IntroStory.txt'); - * // and later in your game ... - * var data = this.cache.text.get('story'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and - * this is what you would use to retrieve the text from the Text Cache. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" - * and no URL is given then the Loader will set the URL to be "story.txt". It will always add `.txt` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#text - * @fires Phaser.Loader.LoaderPlugin#ADD - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig|Phaser.Types.Loader.FileTypes.TextFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {this} The Loader instance. - */ -FileTypesManager.register('text', function (key, url, xhrSettings) -{ - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new TextFile(this, key[i])); - } - } - else - { - this.addFile(new TextFile(this, key, url, xhrSettings)); - } - - return this; -}); - -module.exports = TextFile; - - -/***/ }), -/* 226 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 8332: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -35647,21 +14316,21 @@ module.exports = TextFile; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var AngleBetween = __webpack_require__(31); -var Clamp = __webpack_require__(1); -var Class = __webpack_require__(0); -var ComponentsComputedSize = __webpack_require__(52); -var ComponentsDepth = __webpack_require__(53); -var ComponentsFlip = __webpack_require__(54); -var ComponentsScrollFactor = __webpack_require__(55); -var ComponentsTransform = __webpack_require__(56); -var ComponentsVisible = __webpack_require__(57); -var CounterClockwise = __webpack_require__(14); -var DegToRad = __webpack_require__(21); -var GameObject = __webpack_require__(58); -var RadToDeg = __webpack_require__(16); -var SpineEvents = __webpack_require__(248); -var SpineGameObjectRender = __webpack_require__(255); +var AngleBetween = __webpack_require__(6412); +var Clamp = __webpack_require__(2915); +var Class = __webpack_require__(7473); +var ComponentsComputedSize = __webpack_require__(1991); +var ComponentsDepth = __webpack_require__(3131); +var ComponentsFlip = __webpack_require__(9660); +var ComponentsScrollFactor = __webpack_require__(4627); +var ComponentsTransform = __webpack_require__(3212); +var ComponentsVisible = __webpack_require__(8414); +var CounterClockwise = __webpack_require__(3426); +var DegToRad = __webpack_require__(7149); +var GameObject = __webpack_require__(2273); +var RadToDeg = __webpack_require__(4208); +var SpineEvents = __webpack_require__(5146); +var SpineGameObjectRender = __webpack_require__(2762); /** * @classdesc @@ -37255,8 +15924,328 @@ module.exports = SpineGameObject; /***/ }), -/* 227 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 2762: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var renderWebGL = __webpack_require__(1984); +var renderCanvas = __webpack_require__(1984); +var renderDirect = __webpack_require__(1984); + +if (true) +{ + renderWebGL = __webpack_require__(4290); + renderDirect = __webpack_require__(780); +} + +if (false) +{} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas, + renderDirect: renderDirect + +}; + + +/***/ }), + +/***/ 780: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var Clamp = __webpack_require__(2915); +var CounterClockwise = __webpack_require__(3426); +var GetCalcMatrix = __webpack_require__(2208); +var RadToDeg = __webpack_require__(4208); +var Wrap = __webpack_require__(8445); + +/** + * Directly renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method SpineGameObject#renderDirect + * @since 3.50.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {SpineGameObject} src - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + * @param {SpineContainer} [container] - If this Spine object is in a Spine Container, this is a reference to it. + */ +var SpineGameObjectWebGLDirect = function (renderer, src, camera, parentMatrix, container) +{ + var plugin = src.plugin; + var skeleton = src.skeleton; + var sceneRenderer = plugin.sceneRenderer; + + // flush + clear previous pipeline if this is a new type + renderer.pipelines.clear(); + + sceneRenderer.begin(); + + var scrollFactorX = src.scrollFactorX; + var scrollFactorY = src.scrollFactorY; + var alpha = skeleton.color.a; + + if (container) + { + src.scrollFactorX = container.scrollFactorX; + src.scrollFactorY = container.scrollFactorY; + + skeleton.color.a = Clamp(alpha * container.alpha, 0, 1); + } + + camera.addToRenderList(src); + + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; + + var viewportHeight = renderer.height; + + skeleton.x = calcMatrix.tx; + skeleton.y = viewportHeight - calcMatrix.ty; + + skeleton.scaleX = calcMatrix.scaleX; + skeleton.scaleY = calcMatrix.scaleY; + + if (src.scaleX < 0) + { + skeleton.scaleX *= -1; + + // -180 degrees to account for the difference in Spine vs. Phaser rotation when inversely scaled + src.root.rotation = Wrap(RadToDeg(calcMatrix.rotationNormalized) - 180, 0, 360); + } + else + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360); + } + + if (src.scaleY < 0) + { + skeleton.scaleY *= -1; + + if (src.scaleX < 0) + { + src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2); + } + else + { + src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2); + } + } + + /* + if (renderer.currentFramebuffer !== null) + { + skeleton.y = calcMatrix.ty; + skeleton.scaleY *= -1; + } + */ + + skeleton.updateWorldTransform(); + + // Draw the current skeleton + + sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); + + if (container) + { + src.scrollFactorX = scrollFactorX; + src.scrollFactorY = scrollFactorY; + skeleton.color.a = alpha; + } + + if (plugin.drawDebug || src.drawDebug) + { + // Because if we don't, the bones render positions are completely wrong (*sigh*) + var oldX = skeleton.x; + var oldY = skeleton.y; + + skeleton.x = 0; + skeleton.y = 0; + + sceneRenderer.drawSkeletonDebug(skeleton, src.preMultipliedAlpha); + + skeleton.x = oldX; + skeleton.y = oldY; + } + + // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch + sceneRenderer.end(); + + // And rebind the previous pipeline + renderer.pipelines.rebind(); +}; + +module.exports = SpineGameObjectWebGLDirect; + + +/***/ }), + +/***/ 4290: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var Clamp = __webpack_require__(2915); +var CounterClockwise = __webpack_require__(3426); +var GetCalcMatrix = __webpack_require__(2208); +var RadToDeg = __webpack_require__(4208); +var Wrap = __webpack_require__(8445); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method SpineGameObject#renderWebGL + * @since 3.19.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {SpineGameObject} src - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + * @param {SpineContainer} [container] - If this Spine object is in a Spine Container, this is a reference to it. + */ +var SpineGameObjectWebGLRenderer = function (renderer, src, camera, parentMatrix, container) +{ + var plugin = src.plugin; + var skeleton = src.skeleton; + var sceneRenderer = plugin.sceneRenderer; + + if (renderer.newType) + { + // flush + clear previous pipeline if this is a new type + renderer.pipelines.clear(); + + sceneRenderer.begin(); + } + + var scrollFactorX = src.scrollFactorX; + var scrollFactorY = src.scrollFactorY; + var alpha = skeleton.color.a; + + if (container) + { + src.scrollFactorX = container.scrollFactorX; + src.scrollFactorY = container.scrollFactorY; + + skeleton.color.a = Clamp(alpha * container.alpha, 0, 1); + } + + camera.addToRenderList(src); + + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; + + var viewportHeight = renderer.height; + + skeleton.x = calcMatrix.tx; + skeleton.y = viewportHeight - calcMatrix.ty; + + skeleton.scaleX = calcMatrix.scaleX; + skeleton.scaleY = calcMatrix.scaleY; + + if (src.scaleX < 0) + { + skeleton.scaleX *= -1; + + // -180 degrees to account for the difference in Spine vs. Phaser rotation when inversely scaled + src.root.rotation = Wrap(RadToDeg(calcMatrix.rotationNormalized) - 180, 0, 360); + } + else + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360); + } + + if (src.scaleY < 0) + { + skeleton.scaleY *= -1; + + if (src.scaleX < 0) + { + src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2); + } + else + { + src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2); + } + } + + /* + if (renderer.currentFramebuffer !== null) + { + skeleton.y = calcMatrix.ty; + skeleton.scaleY *= -1; + } + */ + + skeleton.updateWorldTransform(); + + // Draw the current skeleton + + sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); + + if (container) + { + src.scrollFactorX = scrollFactorX; + src.scrollFactorY = scrollFactorY; + skeleton.color.a = alpha; + } + + if (plugin.drawDebug || src.drawDebug) + { + // Because if we don't, the bones render positions are completely wrong (*sigh*) + var oldX = skeleton.x; + var oldY = skeleton.y; + + skeleton.x = 0; + skeleton.y = 0; + + sceneRenderer.drawSkeletonDebug(skeleton, src.preMultipliedAlpha); + + skeleton.x = oldX; + skeleton.y = oldY; + } + + if (!renderer.nextTypeMatch) + { + // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch + sceneRenderer.end(); + + // And rebind the previous pipeline + renderer.pipelines.rebind(); + } +}; + +module.exports = SpineGameObjectWebGLRenderer; + + +/***/ }), + +/***/ 9454: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -37264,8 +16253,153 @@ module.exports = SpineGameObject; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); -var Events = __webpack_require__(228); +/** + * Global constants. + * + * @ignore + */ + +var CONST = { + + /** + * Phaser Release Version + * + * @name Phaser.VERSION + * @const + * @type {string} + * @since 3.0.0 + */ + VERSION: '3.60.0', + + BlendModes: __webpack_require__(8351), + + ScaleModes: __webpack_require__(8196), + + /** + * This setting will auto-detect if the browser is capable of suppporting WebGL. + * If it is, it will use the WebGL Renderer. If not, it will fall back to the Canvas Renderer. + * + * @name Phaser.AUTO + * @const + * @type {number} + * @since 3.0.0 + */ + AUTO: 0, + + /** + * Forces Phaser to only use the Canvas Renderer, regardless if the browser supports + * WebGL or not. + * + * @name Phaser.CANVAS + * @const + * @type {number} + * @since 3.0.0 + */ + CANVAS: 1, + + /** + * Forces Phaser to use the WebGL Renderer. If the browser does not support it, there is + * no fallback to Canvas with this setting, so you should trap it and display a suitable + * message to the user. + * + * @name Phaser.WEBGL + * @const + * @type {number} + * @since 3.0.0 + */ + WEBGL: 2, + + /** + * A Headless Renderer doesn't create either a Canvas or WebGL Renderer. However, it still + * absolutely relies on the DOM being present and available. This mode is meant for unit testing, + * not for running Phaser on the server, which is something you really shouldn't do. + * + * @name Phaser.HEADLESS + * @const + * @type {number} + * @since 3.0.0 + */ + HEADLESS: 3, + + /** + * In Phaser the value -1 means 'forever' in lots of cases, this const allows you to use it instead + * to help you remember what the value is doing in your code. + * + * @name Phaser.FOREVER + * @const + * @type {number} + * @since 3.0.0 + */ + FOREVER: -1, + + /** + * Direction constant. + * + * @name Phaser.NONE + * @const + * @type {number} + * @since 3.0.0 + */ + NONE: 4, + + /** + * Direction constant. + * + * @name Phaser.UP + * @const + * @type {number} + * @since 3.0.0 + */ + UP: 5, + + /** + * Direction constant. + * + * @name Phaser.DOWN + * @const + * @type {number} + * @since 3.0.0 + */ + DOWN: 6, + + /** + * Direction constant. + * + * @name Phaser.LEFT + * @const + * @type {number} + * @since 3.0.0 + */ + LEFT: 7, + + /** + * Direction constant. + * + * @name Phaser.RIGHT + * @const + * @type {number} + * @since 3.0.0 + */ + RIGHT: 8 + +}; + +module.exports = CONST; + + +/***/ }), + +/***/ 1081: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Events = __webpack_require__(6748); /** * @callback DataEachCallback @@ -37515,10 +16649,10 @@ var DataManager = new Class({ * @generic {any} T * @genericUse {(string|T)} - [key] * - * @param {(string|object)} key - The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored. - * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored. + * @param {(string|object)} key - The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. + * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ set: function (key, data) { @@ -37557,9 +16691,9 @@ var DataManager = new Class({ * @genericUse {(string|T)} - [key] * * @param {(string|object)} key - The key to increase the value for. - * @param {*} [data] - The value to increase for the given key. + * @param {number} [data=1] - The amount to increase the given key by. Pass a negative value to decrease the key. * - * @return {Phaser.Data.DataManager} This DataManager object. + * @return {this} This Data Manager instance. */ inc: function (key, data) { @@ -37574,6 +16708,7 @@ var DataManager = new Class({ } var value = this.get(key); + if (value === undefined) { value = 0; @@ -37600,7 +16735,7 @@ var DataManager = new Class({ * * @param {(string|object)} key - The key to toggle the value for. * - * @return {Phaser.Data.DataManager} This DataManager object. + * @return {this} This Data Manager instance. */ toggle: function (key) { @@ -37627,7 +16762,7 @@ var DataManager = new Class({ * @param {string} key - The key to set the value for. * @param {*} data - The value to set. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ setValue: function (key, data) { @@ -37691,7 +16826,7 @@ var DataManager = new Class({ * @param {*} [context] - Value to use as `this` when executing callback. * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ each: function (callback, context) { @@ -37728,7 +16863,7 @@ var DataManager = new Class({ * @param {Object.} data - The data to merge. * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ merge: function (data, overwrite) { @@ -37764,7 +16899,7 @@ var DataManager = new Class({ * * @param {(string|string[])} key - The key to remove, or an array of keys to remove. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ remove: function (key) { @@ -37798,7 +16933,7 @@ var DataManager = new Class({ * * @param {string} key - The key to set the value for. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ removeValue: function (key) { @@ -37870,7 +17005,7 @@ var DataManager = new Class({ * * @param {boolean} value - Whether to freeze or unfreeze the Data Manager. * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ setFreeze: function (value) { @@ -37885,7 +17020,7 @@ var DataManager = new Class({ * @method Phaser.Data.DataManager#reset * @since 3.0.0 * - * @return {this} This DataManager object. + * @return {this} This Data Manager instance. */ reset: function () { @@ -37971,33 +17106,9 @@ module.exports = DataManager; /***/ }), -/* 228 */ -/***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Data.Events - */ - -module.exports = { - - CHANGE_DATA: __webpack_require__(229), - CHANGE_DATA_KEY: __webpack_require__(230), - DESTROY: __webpack_require__(231), - REMOVE_DATA: __webpack_require__(232), - SET_DATA: __webpack_require__(233) - -}; - - -/***/ }), -/* 229 */ -/***/ (function(module, exports) { +/***/ 9044: +/***/ ((module) => { /** * @author Richard Davey @@ -38029,8 +17140,9 @@ module.exports = 'changedata'; /***/ }), -/* 230 */ -/***/ (function(module, exports) { + +/***/ 7801: +/***/ ((module) => { /** * @author Richard Davey @@ -38060,8 +17172,9 @@ module.exports = 'changedata-'; /***/ }), -/* 231 */ -/***/ (function(module, exports) { + +/***/ 4873: +/***/ ((module) => { /** * @author Richard Davey @@ -38082,8 +17195,9 @@ module.exports = 'destroy'; /***/ }), -/* 232 */ -/***/ (function(module, exports) { + +/***/ 9966: +/***/ ((module) => { /** * @author Richard Davey @@ -38111,8 +17225,9 @@ module.exports = 'removedata'; /***/ }), -/* 233 */ -/***/ (function(module, exports) { + +/***/ 4586: +/***/ ((module) => { /** * @author Richard Davey @@ -38140,351 +17255,9 @@ module.exports = 'setdata'; /***/ }), -/* 234 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -var has = Object.prototype.hasOwnProperty - , prefix = '~'; - -/** - * Constructor to create a storage for our `EE` objects. - * An `Events` instance is a plain object whose properties are event names. - * - * @constructor - * @private - */ -function Events() {} - -// -// We try to not inherit from `Object.prototype`. In some engines creating an -// instance in this way is faster than calling `Object.create(null)` directly. -// If `Object.create(null)` is not supported we prefix the event names with a -// character to make sure that the built-in object properties are not -// overridden or used as an attack vector. -// -if (Object.create) { - Events.prototype = Object.create(null); - - // - // This hack is needed because the `__proto__` property is still inherited in - // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. - // - if (!new Events().__proto__) prefix = false; -} - -/** - * Representation of a single event listener. - * - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} [once=false] Specify if the listener is a one-time listener. - * @constructor - * @private - */ -function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; -} - -/** - * Add a listener for a given event. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} once Specify if the listener is a one-time listener. - * @returns {EventEmitter} - * @private - */ -function addListener(emitter, event, fn, context, once) { - if (typeof fn !== 'function') { - throw new TypeError('The listener must be a function'); - } - - var listener = new EE(fn, context || emitter, once) - , evt = prefix ? prefix + event : event; - - if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; - else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); - else emitter._events[evt] = [emitter._events[evt], listener]; - - return emitter; -} - -/** - * Clear event by name. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} evt The Event name. - * @private - */ -function clearEvent(emitter, evt) { - if (--emitter._eventsCount === 0) emitter._events = new Events(); - else delete emitter._events[evt]; -} - -/** - * Minimal `EventEmitter` interface that is molded against the Node.js - * `EventEmitter` interface. - * - * @constructor - * @public - */ -function EventEmitter() { - this._events = new Events(); - this._eventsCount = 0; -} - -/** - * Return an array listing the events for which the emitter has registered - * listeners. - * - * @returns {Array} - * @public - */ -EventEmitter.prototype.eventNames = function eventNames() { - var names = [] - , events - , name; - - if (this._eventsCount === 0) return names; - - for (name in (events = this._events)) { - if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); - } - - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events)); - } - - return names; -}; - -/** - * Return the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Array} The registered listeners. - * @public - */ -EventEmitter.prototype.listeners = function listeners(event) { - var evt = prefix ? prefix + event : event - , handlers = this._events[evt]; - - if (!handlers) return []; - if (handlers.fn) return [handlers.fn]; - - for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { - ee[i] = handlers[i].fn; - } - - return ee; -}; - -/** - * Return the number of listeners listening to a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Number} The number of listeners. - * @public - */ -EventEmitter.prototype.listenerCount = function listenerCount(event) { - var evt = prefix ? prefix + event : event - , listeners = this._events[evt]; - - if (!listeners) return 0; - if (listeners.fn) return 1; - return listeners.length; -}; - -/** - * Calls each of the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Boolean} `true` if the event had listeners, else `false`. - * @public - */ -EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return false; - - var listeners = this._events[evt] - , len = arguments.length - , args - , i; - - if (listeners.fn) { - if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); - - switch (len) { - case 1: return listeners.fn.call(listeners.context), true; - case 2: return listeners.fn.call(listeners.context, a1), true; - case 3: return listeners.fn.call(listeners.context, a1, a2), true; - case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } - - for (i = 1, args = new Array(len -1); i < len; i++) { - args[i - 1] = arguments[i]; - } - - listeners.fn.apply(listeners.context, args); - } else { - var length = listeners.length - , j; - - for (i = 0; i < length; i++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); - - switch (len) { - case 1: listeners[i].fn.call(listeners[i].context); break; - case 2: listeners[i].fn.call(listeners[i].context, a1); break; - case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; - case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; - default: - if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { - args[j - 1] = arguments[j]; - } - - listeners[i].fn.apply(listeners[i].context, args); - } - } - } - - return true; -}; - -/** - * Add a listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.on = function on(event, fn, context) { - return addListener(this, event, fn, context, false); -}; - -/** - * Add a one-time listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.once = function once(event, fn, context) { - return addListener(this, event, fn, context, true); -}; - -/** - * Remove the listeners of a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn Only remove the listeners that match this function. - * @param {*} context Only remove the listeners that have this context. - * @param {Boolean} once Only remove one-time listeners. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return this; - if (!fn) { - clearEvent(this, evt); - return this; - } - - var listeners = this._events[evt]; - - if (listeners.fn) { - if ( - listeners.fn === fn && - (!once || listeners.once) && - (!context || listeners.context === context) - ) { - clearEvent(this, evt); - } - } else { - for (var i = 0, events = [], length = listeners.length; i < length; i++) { - if ( - listeners[i].fn !== fn || - (once && !listeners[i].once) || - (context && listeners[i].context !== context) - ) { - events.push(listeners[i]); - } - } - - // - // Reset the array, or remove it completely if we have no more listeners. - // - if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; - else clearEvent(this, evt); - } - - return this; -}; - -/** - * Remove all listeners, or those of the specified event. - * - * @param {(String|Symbol)} [event] The event name. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { - var evt; - - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) clearEvent(this, evt); - } else { - this._events = new Events(); - this._eventsCount = 0; - } - - return this; -}; - -// -// Alias methods names because people roll like that. -// -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; -EventEmitter.prototype.addListener = EventEmitter.prototype.on; - -// -// Expose the prefix. -// -EventEmitter.prefixed = prefix; - -// -// Allow `EventEmitter` to be imported as module namespace. -// -EventEmitter.EventEmitter = EventEmitter; - -// -// Expose the module. -// -if (true) { - module.exports = EventEmitter; -} - - -/***/ }), -/* 235 */ -/***/ (function(module, exports) { +/***/ 6748: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -38493,25 +17266,24 @@ if (true) { */ /** - * The Game Object Added to Scene Event. - * - * This event is dispatched when a Game Object is added to a Scene. - * - * Listen for it on a Game Object instance using `GameObject.on('addedtoscene', listener)`. - * - * @event Phaser.GameObjects.Events#ADDED_TO_SCENE - * @type {string} - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene. - * @param {Phaser.Scene} scene - The Scene to which the Game Object was added. + * @namespace Phaser.Data.Events */ -module.exports = 'addedtoscene'; + +module.exports = { + + CHANGE_DATA: __webpack_require__(9044), + CHANGE_DATA_KEY: __webpack_require__(7801), + DESTROY: __webpack_require__(4873), + REMOVE_DATA: __webpack_require__(9966), + SET_DATA: __webpack_require__(4586) + +}; /***/ }), -/* 236 */ -/***/ (function(module, exports) { + +/***/ 3004: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -38519,897 +17291,12859 @@ module.exports = 'addedtoscene'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var Browser = __webpack_require__(2776); + /** - * The Game Object Destroy Event. + * Determines the audio playback capabilities of the device running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.audio` from within any Scene. * - * This event is dispatched when a Game Object instance is being destroyed. - * - * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`. - * - * @event Phaser.GameObjects.Events#DESTROY - * @type {string} + * @typedef {object} Phaser.Device.Audio * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed. - * @param {boolean} fromScene - `True` if this Game Object is being destroyed by the Scene, `false` if not. + * @property {boolean} audioData - Can this device play HTML Audio tags? + * @property {boolean} dolby - Can this device play EC-3 Dolby Digital Plus files? + * @property {boolean} m4a - Can this device can play m4a files. + * @property {boolean} aac - Can this device can play aac files. + * @property {boolean} flac - Can this device can play flac files. + * @property {boolean} mp3 - Can this device play mp3 files? + * @property {boolean} ogg - Can this device play ogg files? + * @property {boolean} opus - Can this device play opus files? + * @property {boolean} wav - Can this device play wav files? + * @property {boolean} webAudio - Does this device have the Web Audio API? + * @property {boolean} webm - Can this device play webm files? */ -module.exports = 'destroy'; +var Audio = { - -/***/ }), -/* 237 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Object Removed from Scene Event. - * - * This event is dispatched when a Game Object is removed from a Scene. - * - * Listen for it on a Game Object instance using `GameObject.on('removedfromscene', listener)`. - * - * @event Phaser.GameObjects.Events#REMOVED_FROM_SCENE - * @type {string} - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene. - * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed. - */ -module.exports = 'removedfromscene'; - - -/***/ }), -/* 238 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Complete Event. - * - * This event is dispatched when a Video finishes playback by reaching the end of its duration. It - * is also dispatched if a video marker sequence is being played and reaches the end. - * - * Note that not all videos can fire this event. Live streams, for example, have no fixed duration, - * so never technically 'complete'. - * - * If a video is stopped from playback, via the `Video.stop` method, it will emit the - * `VIDEO_STOP` event instead of this one. - * - * Listen for it from a Video Game Object instance using `Video.on('complete', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_COMPLETE - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed playback. - */ -module.exports = 'complete'; - - -/***/ }), -/* 239 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Created Event. - * - * This event is dispatched when the texture for a Video has been created. This happens - * when enough of the video source has been loaded that the browser is able to render a - * frame from it. - * - * Listen for it from a Video Game Object instance using `Video.on('created', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_CREATED - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. - * @param {number} width - The width of the video. - * @param {number} height - The height of the video. - */ -module.exports = 'created'; - - -/***/ }), -/* 240 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Error Event. - * - * This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type. - * - * Listen for it from a Video Game Object instance using `Video.on('error', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_ERROR - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. - * @param {Event} event - The native DOM event the browser raised during playback. - */ -module.exports = 'error'; - - -/***/ }), -/* 241 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Loop Event. - * - * This event is dispatched when a Video that is currently playing has looped. This only - * happens if the `loop` parameter was specified, or the `setLoop` method was called, - * and if the video has a fixed duration. Video streams, for example, cannot loop, as - * they have no duration. - * - * Looping is based on the result of the Video `timeupdate` event. This event is not - * frame-accurate, due to the way browsers work, so please do not rely on this loop - * event to be time or frame precise. - * - * Listen for it from a Video Game Object instance using `Video.on('loop', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_LOOP - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which has looped. - */ -module.exports = 'loop'; - - -/***/ }), -/* 242 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Play Event. - * - * This event is dispatched when a Video begins playback. For videos that do not require - * interaction unlocking, this is usually as soon as the `Video.play` method is called. - * However, for videos that require unlocking, it is fired once playback begins after - * they've been unlocked. - * - * Listen for it from a Video Game Object instance using `Video.on('play', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_PLAY - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. - */ -module.exports = 'play'; - - -/***/ }), -/* 243 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Seeked Event. - * - * This event is dispatched when a Video completes seeking to a new point in its timeline. - * - * Listen for it from a Video Game Object instance using `Video.on('seeked', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_SEEKED - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed seeking. - */ -module.exports = 'seeked'; - - -/***/ }), -/* 244 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Seeking Event. - * - * This event is dispatched when a Video _begins_ seeking to a new point in its timeline. - * When the seek is complete, it will dispatch the `VIDEO_SEEKED` event to conclude. - * - * Listen for it from a Video Game Object instance using `Video.on('seeking', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_SEEKING - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which started seeking. - */ -module.exports = 'seeking'; - - -/***/ }), -/* 245 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Stopped Event. - * - * This event is dispatched when a Video is stopped from playback via a call to the `Video.stop` method, - * either directly via game code, or indirectly as the result of changing a video source or destroying it. - * - * Listen for it from a Video Game Object instance using `Video.on('stop', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_STOP - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which stopped playback. - */ -module.exports = 'stop'; - - -/***/ }), -/* 246 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Timeout Event. - * - * This event is dispatched when a Video has exhausted its allocated time while trying to connect to a video - * source to start playback. - * - * Listen for it from a Video Game Object instance using `Video.on('timeout', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_TIMEOUT - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which timed out. - */ -module.exports = 'timeout'; - - -/***/ }), -/* 247 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Video Game Object Unlocked Event. - * - * This event is dispatched when a Video that was prevented from playback due to the browsers - * Media Engagement Interaction policy, is unlocked by a user gesture. - * - * Listen for it from a Video Game Object instance using `Video.on('unlocked', listener)`. - * - * @event Phaser.GameObjects.Events#VIDEO_UNLOCKED - * @type {string} - * @since 3.20.0 - * - * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. - */ -module.exports = 'unlocked'; - - -/***/ }), -/* 248 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace SpinePluginEvents - */ - -module.exports = { - - COMPLETE: __webpack_require__(249), - DISPOSE: __webpack_require__(250), - END: __webpack_require__(251), - EVENT: __webpack_require__(252), - INTERRUPTED: __webpack_require__(253), - START: __webpack_require__(254) + flac: false, + aac: false, + audioData: false, + dolby: false, + m4a: false, + mp3: false, + ogg: false, + opus: false, + wav: false, + webAudio: false, + webm: false }; - -/***/ }), -/* 249 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Complete Event. - * - * @event SpinePluginEvents#COMPLETE - * @since 3.19.0 - */ -module.exports = 'complete'; - - -/***/ }), -/* 250 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Dispose Event. - * - * @event SpinePluginEvents#DISPOSE - * @since 3.19.0 - */ -module.exports = 'dispose'; - - -/***/ }), -/* 251 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The End Event. - * - * @event SpinePluginEvents#END - * @since 3.19.0 - */ -module.exports = 'end'; - - -/***/ }), -/* 252 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Custom Event Event. - * - * @event SpinePluginEvents#EVENT - * @since 3.19.0 - */ -module.exports = 'event'; - - -/***/ }), -/* 253 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Interrupted Event. - * - * @event SpinePluginEvents#INTERRUPTED - * @since 3.19.0 - */ -module.exports = 'interrupted'; - - -/***/ }), -/* 254 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Start Event. - * - * @event SpinePluginEvents#START - * @since 3.19.0 - */ -module.exports = 'start'; - - -/***/ }), -/* 255 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var renderWebGL = __webpack_require__(2); -var renderCanvas = __webpack_require__(2); -var renderDirect = __webpack_require__(2); - -if (true) +function init () { - renderWebGL = __webpack_require__(256); - renderDirect = __webpack_require__(257); + if (typeof importScripts === 'function') + { + return Audio; + } + + Audio.audioData = !!(window['Audio']); + + Audio.webAudio = !!(window['AudioContext'] || window['webkitAudioContext']); + + var audioElement = document.createElement('audio'); + var result = !!audioElement.canPlayType; + + try + { + if (result) + { + var CanPlay = function (type1, type2) + { + var canPlayType1 = audioElement.canPlayType('audio/' + type1).replace(/^no$/, ''); + + if (type2) + { + return Boolean(canPlayType1 || audioElement.canPlayType('audio/' + type2).replace(/^no$/, '')); + } + else + { + return Boolean(canPlayType1); + } + }; + + // wav Mimetypes accepted: + // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements + + Audio.ogg = CanPlay('ogg; codecs="vorbis"'); + Audio.opus = CanPlay('ogg; codecs="opus"', 'opus'); + Audio.mp3 = CanPlay('mpeg'); + Audio.wav = CanPlay('wav'); + Audio.m4a = CanPlay('x-m4a'); + Audio.aac = CanPlay('aac'); + Audio.flac = CanPlay('flac', 'x-flac'); + Audio.webm = CanPlay('webm; codecs="vorbis"'); + + if (audioElement.canPlayType('audio/mp4; codecs="ec-3"') !== '') + { + if (Browser.edge) + { + Audio.dolby = true; + } + else if (Browser.safari && Browser.safariVersion >= 9) + { + if ((/Mac OS X (\d+)_(\d+)/).test(navigator.userAgent)) + { + var major = parseInt(RegExp.$1, 10); + var minor = parseInt(RegExp.$2, 10); + + if ((major === 10 && minor >= 11) || major > 10) + { + Audio.dolby = true; + } + } + } + } + } + } + catch (e) + { + // Nothing to do here + } + + return Audio; } -if (false) -{} +module.exports = init(); + + +/***/ }), + +/***/ 2776: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var OS = __webpack_require__(5203); + +/** + * Determines the browser type and version running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.browser` from within any Scene. + * + * @typedef {object} Phaser.Device.Browser + * @since 3.0.0 + * + * @property {boolean} chrome - Set to true if running in Chrome. + * @property {boolean} edge - Set to true if running in Microsoft Edge browser. + * @property {boolean} firefox - Set to true if running in Firefox. + * @property {boolean} ie - Set to true if running in Internet Explorer 11 or less (not Edge). + * @property {boolean} mobileSafari - Set to true if running in Mobile Safari. + * @property {boolean} opera - Set to true if running in Opera. + * @property {boolean} safari - Set to true if running in Safari. + * @property {boolean} silk - Set to true if running in the Silk browser (as used on the Amazon Kindle) + * @property {boolean} trident - Set to true if running a Trident version of Internet Explorer (IE11+) + * @property {number} chromeVersion - If running in Chrome this will contain the major version number. + * @property {number} firefoxVersion - If running in Firefox this will contain the major version number. + * @property {number} ieVersion - If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Browser.trident and Browser.tridentVersion. + * @property {number} safariVersion - If running in Safari this will contain the major version number. + * @property {number} tridentVersion - If running in Internet Explorer 11 this will contain the major version number. See {@link http://msdn.microsoft.com/en-us/library/ie/ms537503(v=vs.85).aspx} + */ +var Browser = { + + chrome: false, + chromeVersion: 0, + edge: false, + firefox: false, + firefoxVersion: 0, + ie: false, + ieVersion: 0, + mobileSafari: false, + opera: false, + safari: false, + safariVersion: 0, + silk: false, + trident: false, + tridentVersion: 0, + es2019: false + +}; + +function init () +{ + var ua = navigator.userAgent; + + if ((/Edg\/\d+/).test(ua)) + { + Browser.edge = true; + Browser.es2019 = true; + } + else if ((/OPR/).test(ua)) + { + Browser.opera = true; + Browser.es2019 = true; + } + else if ((/Chrome\/(\d+)/).test(ua) && !OS.windowsPhone) + { + Browser.chrome = true; + Browser.chromeVersion = parseInt(RegExp.$1, 10); + Browser.es2019 = (Browser.chromeVersion > 69); + } + else if ((/Firefox\D+(\d+)/).test(ua)) + { + Browser.firefox = true; + Browser.firefoxVersion = parseInt(RegExp.$1, 10); + Browser.es2019 = (Browser.firefoxVersion > 10); + } + else if ((/AppleWebKit/).test(ua) && OS.iOS) + { + Browser.mobileSafari = true; + } + else if ((/MSIE (\d+\.\d+);/).test(ua)) + { + Browser.ie = true; + Browser.ieVersion = parseInt(RegExp.$1, 10); + } + else if ((/Version\/(\d+\.\d+) Safari/).test(ua) && !OS.windowsPhone) + { + Browser.safari = true; + Browser.safariVersion = parseInt(RegExp.$1, 10); + Browser.es2019 = (Browser.safariVersion > 10); + } + else if ((/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/).test(ua)) + { + Browser.ie = true; + Browser.trident = true; + Browser.tridentVersion = parseInt(RegExp.$1, 10); + Browser.ieVersion = parseInt(RegExp.$3, 10); + } + + // Silk gets its own if clause because its ua also contains 'Safari' + if ((/Silk/).test(ua)) + { + Browser.silk = true; + } + + return Browser; +} + +module.exports = init(); + + +/***/ }), + +/***/ 6505: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CanvasPool = __webpack_require__(8073); + +/** + * Determines the canvas features of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.canvasFeatures` from within any Scene. + * + * @typedef {object} Phaser.Device.CanvasFeatures + * @since 3.0.0 + * + * @property {boolean} supportInverseAlpha - Set to true if the browser supports inversed alpha. + * @property {boolean} supportNewBlendModes - Set to true if the browser supports new canvas blend modes. + */ +var CanvasFeatures = { + + supportInverseAlpha: false, + supportNewBlendModes: false + +}; + +function checkBlendMode () +{ + var pngHead = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/'; + var pngEnd = 'AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg=='; + + var magenta = new Image(); + + magenta.onload = function () + { + var yellow = new Image(); + + yellow.onload = function () + { + var canvas = CanvasPool.create2D(yellow, 6); + var context = canvas.getContext('2d', { willReadFrequently: true }); + + context.globalCompositeOperation = 'multiply'; + + context.drawImage(magenta, 0, 0); + context.drawImage(yellow, 2, 0); + + if (!context.getImageData(2, 0, 1, 1)) + { + return false; + } + + var data = context.getImageData(2, 0, 1, 1).data; + + CanvasPool.remove(yellow); + + CanvasFeatures.supportNewBlendModes = (data[0] === 255 && data[1] === 0 && data[2] === 0); + }; + + yellow.src = pngHead + '/wCKxvRF' + pngEnd; + }; + + magenta.src = pngHead + 'AP804Oa6' + pngEnd; + + return false; +} + +function checkInverseAlpha () +{ + var canvas = CanvasPool.create2D(this, 2); + var context = canvas.getContext('2d', { willReadFrequently: true }); + + context.fillStyle = 'rgba(10, 20, 30, 0.5)'; + + // Draw a single pixel + context.fillRect(0, 0, 1, 1); + + // Get the color values + var s1 = context.getImageData(0, 0, 1, 1); + + if (s1 === null) + { + return false; + } + + // Plot them to x2 + context.putImageData(s1, 1, 0); + + // Get those values + var s2 = context.getImageData(1, 0, 1, 1); + + var result = (s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]); + + CanvasPool.remove(this); + + // Compare and return + return result; +} + +function init () +{ + if (typeof importScripts !== 'function' && document !== undefined) + { + CanvasFeatures.supportNewBlendModes = checkBlendMode(); + CanvasFeatures.supportInverseAlpha = checkInverseAlpha(); + } + + return CanvasFeatures; +} + +module.exports = init(); + + +/***/ }), + +/***/ 6543: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var OS = __webpack_require__(5203); +var Browser = __webpack_require__(2776); +var CanvasPool = __webpack_require__(8073); + +/** + * Determines the features of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.features` from within any Scene. + * + * @typedef {object} Phaser.Device.Features + * @since 3.0.0 + * + * @property {boolean} canvas - Is canvas available? + * @property {?boolean} canvasBitBltShift - True if canvas supports a 'copy' bitblt onto itself when the source and destination regions overlap. + * @property {boolean} file - Is file available? + * @property {boolean} fileSystem - Is fileSystem available? + * @property {boolean} getUserMedia - Does the device support the getUserMedia API? + * @property {boolean} littleEndian - Is the device big or little endian? (only detected if the browser supports TypedArrays) + * @property {boolean} localStorage - Is localStorage available? + * @property {boolean} pointerLock - Is Pointer Lock available? + * @property {boolean} stableSort - Is Array.sort stable? + * @property {boolean} support32bit - Does the device context support 32bit pixel manipulation using array buffer views? + * @property {boolean} vibration - Does the device support the Vibration API? + * @property {boolean} webGL - Is webGL available? + * @property {boolean} worker - Is worker available? + */ +var Features = { + + canvas: false, + canvasBitBltShift: null, + file: false, + fileSystem: false, + getUserMedia: true, + littleEndian: false, + localStorage: false, + pointerLock: false, + stableSort: false, + support32bit: false, + vibration: false, + webGL: false, + worker: false + +}; + +// Check Little or Big Endian system. +// @author Matt DesLauriers (@mattdesl) +function checkIsLittleEndian () +{ + var a = new ArrayBuffer(4); + var b = new Uint8Array(a); + var c = new Uint32Array(a); + + b[0] = 0xa1; + b[1] = 0xb2; + b[2] = 0xc3; + b[3] = 0xd4; + + if (c[0] === 0xd4c3b2a1) + { + return true; + } + + if (c[0] === 0xa1b2c3d4) + { + return false; + } + else + { + // Could not determine endianness + return null; + } +} + +function init () +{ + if (typeof importScripts === 'function') + { + return Features; + } + + Features.canvas = !!window['CanvasRenderingContext2D']; + + try + { + Features.localStorage = !!localStorage.getItem; + } + catch (error) + { + Features.localStorage = false; + } + + Features.file = !!window['File'] && !!window['FileReader'] && !!window['FileList'] && !!window['Blob']; + Features.fileSystem = !!window['requestFileSystem']; + + var isUint8 = false; + + var testWebGL = function () + { + if (window['WebGLRenderingContext']) + { + try + { + var canvas = CanvasPool.createWebGL(this); + + var ctx = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); + + var canvas2D = CanvasPool.create2D(this); + + var ctx2D = canvas2D.getContext('2d', { willReadFrequently: true }); + + // Can't be done on a webgl context + var image = ctx2D.createImageData(1, 1); + + // Test to see if ImageData uses CanvasPixelArray or Uint8ClampedArray. + // @author Matt DesLauriers (@mattdesl) + isUint8 = image.data instanceof Uint8ClampedArray; + + CanvasPool.remove(canvas); + CanvasPool.remove(canvas2D); + + return !!ctx; + } + catch (e) + { + return false; + } + } + + return false; + }; + + Features.webGL = testWebGL(); + + Features.worker = !!window['Worker']; + + Features.pointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document; + + navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia; + + window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL; + + Features.getUserMedia = Features.getUserMedia && !!navigator.getUserMedia && !!window.URL; + + // Older versions of firefox (< 21) apparently claim support but user media does not actually work + if (Browser.firefox && Browser.firefoxVersion < 21) + { + Features.getUserMedia = false; + } + + // Excludes iOS versions as they generally wrap UIWebView (eg. Safari WebKit) and it + // is safer to not try and use the fast copy-over method. + if (!OS.iOS && (Browser.ie || Browser.firefox || Browser.chrome)) + { + Features.canvasBitBltShift = true; + } + + // Known not to work + if (Browser.safari || Browser.mobileSafari) + { + Features.canvasBitBltShift = false; + } + + navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate; + + if (navigator.vibrate) + { + Features.vibration = true; + } + + if (typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint32Array !== 'undefined') + { + Features.littleEndian = checkIsLittleEndian(); + } + + Features.support32bit = ( + typeof ArrayBuffer !== 'undefined' && + typeof Uint8ClampedArray !== 'undefined' && + typeof Int32Array !== 'undefined' && + Features.littleEndian !== null && + isUint8 + ); + + return Features; +} + +module.exports = init(); + + +/***/ }), + +/***/ 3922: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Determines the full screen support of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.fullscreen` from within any Scene. + * + * @typedef {object} Phaser.Device.Fullscreen + * @since 3.0.0 + * + * @property {boolean} available - Does the browser support the Full Screen API? + * @property {boolean} keyboard - Does the browser support access to the Keyboard during Full Screen mode? + * @property {string} cancel - If the browser supports the Full Screen API this holds the call you need to use to cancel it. + * @property {string} request - If the browser supports the Full Screen API this holds the call you need to use to activate it. + */ +var Fullscreen = { + + available: false, + cancel: '', + keyboard: false, + request: '' + +}; + +/** +* Checks for support of the Full Screen API. +* +* @ignore +*/ +function init () +{ + if (typeof importScripts === 'function') + { + return Fullscreen; + } + + var i; + + var suffix1 = 'Fullscreen'; + var suffix2 = 'FullScreen'; + + var fs = [ + 'request' + suffix1, + 'request' + suffix2, + 'webkitRequest' + suffix1, + 'webkitRequest' + suffix2, + 'msRequest' + suffix1, + 'msRequest' + suffix2, + 'mozRequest' + suffix2, + 'mozRequest' + suffix1 + ]; + + for (i = 0; i < fs.length; i++) + { + if (document.documentElement[fs[i]]) + { + Fullscreen.available = true; + Fullscreen.request = fs[i]; + break; + } + } + + var cfs = [ + 'cancel' + suffix2, + 'exit' + suffix1, + 'webkitCancel' + suffix2, + 'webkitExit' + suffix1, + 'msCancel' + suffix2, + 'msExit' + suffix1, + 'mozCancel' + suffix2, + 'mozExit' + suffix1 + ]; + + if (Fullscreen.available) + { + for (i = 0; i < cfs.length; i++) + { + if (document[cfs[i]]) + { + Fullscreen.cancel = cfs[i]; + break; + } + } + } + + // Keyboard Input? + // Safari 5.1 says it supports fullscreen keyboard, but is lying. + if (window['Element'] && Element['ALLOW_KEYBOARD_INPUT'] && !(/ Version\/5\.1(?:\.\d+)? Safari\//).test(navigator.userAgent)) + { + Fullscreen.keyboard = true; + } + + Object.defineProperty(Fullscreen, 'active', { get: function () { return !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement); } }); + + return Fullscreen; +} + +module.exports = init(); + + +/***/ }), + +/***/ 1454: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Browser = __webpack_require__(2776); + +/** + * Determines the input support of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.input` from within any Scene. + * + * @typedef {object} Phaser.Device.Input + * @since 3.0.0 + * + * @property {?string} wheelType - The newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll' + * @property {boolean} gamepads - Is navigator.getGamepads available? + * @property {boolean} mspointer - Is mspointer available? + * @property {boolean} touch - Is touch available? + */ +var Input = { + + gamepads: false, + mspointer: false, + touch: false, + wheelEvent: null + +}; + +function init () +{ + if (typeof importScripts === 'function') + { + return Input; + } + + if ('ontouchstart' in document.documentElement || (navigator.maxTouchPoints && navigator.maxTouchPoints >= 1)) + { + Input.touch = true; + } + + if (navigator.msPointerEnabled || navigator.pointerEnabled) + { + Input.mspointer = true; + } + + if (navigator.getGamepads) + { + Input.gamepads = true; + } + + // See https://developer.mozilla.org/en-US/docs/Web/Events/wheel + if ('onwheel' in window || (Browser.ie && 'WheelEvent' in window)) + { + // DOM3 Wheel Event: FF 17+, IE 9+, Chrome 31+, Safari 7+ + Input.wheelEvent = 'wheel'; + } + else if ('onmousewheel' in window) + { + // Non-FF legacy: IE 6-9, Chrome 1-31, Safari 5-7. + Input.wheelEvent = 'mousewheel'; + } + else if (Browser.firefox && 'MouseScrollEvent' in window) + { + // FF prior to 17. This should probably be scrubbed. + Input.wheelEvent = 'DOMMouseScroll'; + } + + return Input; +} + +module.exports = init(); + + +/***/ }), + +/***/ 5203: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Determines the operating system of the device running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.os` from within any Scene. + * + * @typedef {object} Phaser.Device.OS + * @since 3.0.0 + * + * @property {boolean} android - Is running on android? + * @property {boolean} chromeOS - Is running on chromeOS? + * @property {boolean} cordova - Is the game running under Apache Cordova? + * @property {boolean} crosswalk - Is the game running under the Intel Crosswalk XDK? + * @property {boolean} desktop - Is running on a desktop? + * @property {boolean} ejecta - Is the game running under Ejecta? + * @property {boolean} electron - Is the game running under GitHub Electron? + * @property {boolean} iOS - Is running on iOS? + * @property {boolean} iPad - Is running on iPad? + * @property {boolean} iPhone - Is running on iPhone? + * @property {boolean} kindle - Is running on an Amazon Kindle? + * @property {boolean} linux - Is running on linux? + * @property {boolean} macOS - Is running on macOS? + * @property {boolean} node - Is the game running under Node.js? + * @property {boolean} nodeWebkit - Is the game running under Node-Webkit? + * @property {boolean} webApp - Set to true if running as a WebApp, i.e. within a WebView + * @property {boolean} windows - Is running on windows? + * @property {boolean} windowsPhone - Is running on a Windows Phone? + * @property {number} iOSVersion - If running in iOS this will contain the major version number. + * @property {number} pixelRatio - PixelRatio of the host device? + */ +var OS = { + + android: false, + chromeOS: false, + cordova: false, + crosswalk: false, + desktop: false, + ejecta: false, + electron: false, + iOS: false, + iOSVersion: 0, + iPad: false, + iPhone: false, + kindle: false, + linux: false, + macOS: false, + node: false, + nodeWebkit: false, + pixelRatio: 1, + webApp: false, + windows: false, + windowsPhone: false + +}; + +function init () +{ + if (typeof importScripts === 'function') + { + return OS; + } + + var ua = navigator.userAgent; + + if ((/Windows/).test(ua)) + { + OS.windows = true; + } + else if ((/Mac OS/).test(ua) && !((/like Mac OS/).test(ua))) + { + // Because iOS 13 identifies as Mac OS: + if (navigator.maxTouchPoints && navigator.maxTouchPoints > 2) + { + OS.iOS = true; + OS.iPad = true; + + (navigator.appVersion).match(/Version\/(\d+)/); + + OS.iOSVersion = parseInt(RegExp.$1, 10); + } + else + { + OS.macOS = true; + } + } + else if ((/Android/).test(ua)) + { + OS.android = true; + } + else if ((/Linux/).test(ua)) + { + OS.linux = true; + } + else if ((/iP[ao]d|iPhone/i).test(ua)) + { + OS.iOS = true; + + (navigator.appVersion).match(/OS (\d+)/); + + OS.iOSVersion = parseInt(RegExp.$1, 10); + + OS.iPhone = ua.toLowerCase().indexOf('iphone') !== -1; + OS.iPad = ua.toLowerCase().indexOf('ipad') !== -1; + } + else if ((/Kindle/).test(ua) || (/\bKF[A-Z][A-Z]+/).test(ua) || (/Silk.*Mobile Safari/).test(ua)) + { + OS.kindle = true; + + // This will NOT detect early generations of Kindle Fire, I think there is no reliable way... + // E.g. "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true" + } + else if ((/CrOS/).test(ua)) + { + OS.chromeOS = true; + } + + if ((/Windows Phone/i).test(ua) || (/IEMobile/i).test(ua)) + { + OS.android = false; + OS.iOS = false; + OS.macOS = false; + OS.windows = true; + OS.windowsPhone = true; + } + + var silk = (/Silk/).test(ua); + + if (OS.windows || OS.macOS || (OS.linux && !silk) || OS.chromeOS) + { + OS.desktop = true; + } + + // Windows Phone / Table reset + if (OS.windowsPhone || (((/Windows NT/i).test(ua)) && ((/Touch/i).test(ua)))) + { + OS.desktop = false; + } + + // WebApp mode in iOS + if (navigator.standalone) + { + OS.webApp = true; + } + + if (typeof importScripts !== 'function') + { + if (window.cordova !== undefined) + { + OS.cordova = true; + } + + if (window.ejecta !== undefined) + { + OS.ejecta = true; + } + } + + if (typeof process !== 'undefined' && process.versions && process.versions.node) + { + OS.node = true; + } + + if (OS.node && typeof process.versions === 'object') + { + OS.nodeWebkit = !!process.versions['node-webkit']; + + OS.electron = !!process.versions.electron; + } + + if ((/Crosswalk/).test(ua)) + { + OS.crosswalk = true; + } + + OS.pixelRatio = window['devicePixelRatio'] || 1; + + return OS; +} + +module.exports = init(); + + +/***/ }), + +/***/ 2131: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetFastValue = __webpack_require__(4597); + +/** + * Determines the video support of the browser running this Phaser Game instance. + * + * These values are read-only and populated during the boot sequence of the game. + * + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.video` from within any Scene. + * + * In Phaser 3.20 the properties were renamed to drop the 'Video' suffix. + * + * @typedef {object} Phaser.Device.Video + * @since 3.0.0 + * + * @property {boolean} h264 - Can this device play h264 mp4 video files? + * @property {boolean} hls - Can this device play hls video files? + * @property {boolean} mp4 - Can this device play h264 mp4 video files? + * @property {boolean} m4v - Can this device play m4v (typically mp4) video files? + * @property {boolean} ogg - Can this device play ogg video files? + * @property {boolean} vp9 - Can this device play vp9 video files? + * @property {boolean} webm - Can this device play webm video files? + * @property {function} getVideoURL - Returns the first video URL that can be played by this browser. + */ +var Video = { + + h264: false, + hls: false, + mp4: false, + m4v: false, + ogg: false, + vp9: false, + webm: false, + hasRequestVideoFrame: false + +}; + +function init () +{ + if (typeof importScripts === 'function') + { + return Video; + } + + var videoElement = document.createElement('video'); + var result = !!videoElement.canPlayType; + var no = /^no$/; + + try + { + if (result) + { + if (videoElement.canPlayType('video/ogg; codecs="theora"').replace(no, '')) + { + Video.ogg = true; + } + + if (videoElement.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(no, '')) + { + // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546 + Video.h264 = true; + Video.mp4 = true; + } + + if (videoElement.canPlayType('video/x-m4v').replace(no, '')) + { + Video.m4v = true; + } + + if (videoElement.canPlayType('video/webm; codecs="vp8, vorbis"').replace(no, '')) + { + Video.webm = true; + } + + if (videoElement.canPlayType('video/webm; codecs="vp9"').replace(no, '')) + { + Video.vp9 = true; + } + + if (videoElement.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(no, '')) + { + Video.hls = true; + } + } + } + catch (e) + { + // Nothing to do + } + + if (videoElement.parentNode) + { + videoElement.parentNode.removeChild(videoElement); + } + + Video.getVideoURL = function (urls) + { + if (!Array.isArray(urls)) + { + urls = [ urls ]; + } + + for (var i = 0; i < urls.length; i++) + { + var url = GetFastValue(urls[i], 'url', urls[i]); + + if (url.indexOf('blob:') === 0) + { + return { + url: url, + type: '' + }; + } + + var videoType; + + if (url.indexOf('data:') === 0) + { + videoType = url.split(',')[0].match(/\/(.*?);/); + } + else + { + videoType = url.match(/\.([a-zA-Z0-9]+)($|\?)/); + } + + videoType = GetFastValue(urls[i], 'type', (videoType) ? videoType[1] : '').toLowerCase(); + + if (Video[videoType]) + { + return { + url: url, + type: videoType + }; + } + } + + return null; + }; + + return Video; +} + +module.exports = init(); + + +/***/ }), + +/***/ 9356: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// This singleton is instantiated as soon as Phaser loads, +// before a Phaser.Game instance has even been created. +// Which means all instances of Phaser Games can share it, +// without having to re-poll the device all over again + +/** + * @namespace Phaser.Device + * @since 3.0.0 + */ + +/** + * @typedef {object} Phaser.DeviceConf + * + * @property {Phaser.Device.OS} os - The OS Device functions. + * @property {Phaser.Device.Browser} browser - The Browser Device functions. + * @property {Phaser.Device.Features} features - The Features Device functions. + * @property {Phaser.Device.Input} input - The Input Device functions. + * @property {Phaser.Device.Audio} audio - The Audio Device functions. + * @property {Phaser.Device.Video} video - The Video Device functions. + * @property {Phaser.Device.Fullscreen} fullscreen - The Fullscreen Device functions. + * @property {Phaser.Device.CanvasFeatures} canvasFeatures - The Canvas Device functions. + */ module.exports = { - renderWebGL: renderWebGL, - renderCanvas: renderCanvas, - renderDirect: renderDirect + os: __webpack_require__(5203), + browser: __webpack_require__(2776), + features: __webpack_require__(6543), + input: __webpack_require__(1454), + audio: __webpack_require__(3004), + video: __webpack_require__(2131), + fullscreen: __webpack_require__(3922), + canvasFeatures: __webpack_require__(6505) }; /***/ }), -/* 256 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 5686: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(1); -var CounterClockwise = __webpack_require__(14); -var GetCalcMatrix = __webpack_require__(61); -var RadToDeg = __webpack_require__(16); -var Wrap = __webpack_require__(7); +var Class = __webpack_require__(7473); -/** - * Renders this Game Object with the WebGL Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * @method SpineGameObject#renderWebGL - * @since 3.19.0 - * @private - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {SpineGameObject} src - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - * @param {SpineContainer} [container] - If this Spine object is in a Spine Container, this is a reference to it. - */ -var SpineGameObjectWebGLRenderer = function (renderer, src, camera, parentMatrix, container) -{ - var plugin = src.plugin; - var skeleton = src.skeleton; - var sceneRenderer = plugin.sceneRenderer; - - if (renderer.newType) - { - // flush + clear previous pipeline if this is a new type - renderer.pipelines.clear(); - - sceneRenderer.begin(); - } - - var scrollFactorX = src.scrollFactorX; - var scrollFactorY = src.scrollFactorY; - var alpha = skeleton.color.a; - - if (container) - { - src.scrollFactorX = container.scrollFactorX; - src.scrollFactorY = container.scrollFactorY; - - skeleton.color.a = Clamp(alpha * container.alpha, 0, 1); - } - - camera.addToRenderList(src); - - var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; - - var viewportHeight = renderer.height; - - skeleton.x = calcMatrix.tx; - skeleton.y = viewportHeight - calcMatrix.ty; - - skeleton.scaleX = calcMatrix.scaleX; - skeleton.scaleY = calcMatrix.scaleY; - - if (src.scaleX < 0) - { - skeleton.scaleX *= -1; - - // -180 degrees to account for the difference in Spine vs. Phaser rotation when inversely scaled - src.root.rotation = Wrap(RadToDeg(calcMatrix.rotationNormalized) - 180, 0, 360); - } - else - { - // +90 degrees to account for the difference in Spine vs. Phaser rotation - src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360); - } - - if (src.scaleY < 0) - { - skeleton.scaleY *= -1; - - if (src.scaleX < 0) - { - src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2); - } - else - { - src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2); - } - } - - /* - if (renderer.currentFramebuffer !== null) - { - skeleton.y = calcMatrix.ty; - skeleton.scaleY *= -1; - } - */ - - skeleton.updateWorldTransform(); - - // Draw the current skeleton - - sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); - - if (container) - { - src.scrollFactorX = scrollFactorX; - src.scrollFactorY = scrollFactorY; - skeleton.color.a = alpha; - } - - if (plugin.drawDebug || src.drawDebug) - { - // Because if we don't, the bones render positions are completely wrong (*sigh*) - var oldX = skeleton.x; - var oldY = skeleton.y; - - skeleton.x = 0; - skeleton.y = 0; - - sceneRenderer.drawSkeletonDebug(skeleton, src.preMultipliedAlpha); - - skeleton.x = oldX; - skeleton.y = oldY; - } - - if (!renderer.nextTypeMatch) - { - // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch - sceneRenderer.end(); - - // And rebind the previous pipeline - renderer.pipelines.rebind(); - } -}; - -module.exports = SpineGameObjectWebGLRenderer; - - -/***/ }), -/* 257 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var Clamp = __webpack_require__(1); -var CounterClockwise = __webpack_require__(14); -var GetCalcMatrix = __webpack_require__(61); -var RadToDeg = __webpack_require__(16); -var Wrap = __webpack_require__(7); - -/** - * Directly renders this Game Object with the WebGL Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * @method SpineGameObject#renderDirect - * @since 3.50.0 - * @private - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {SpineGameObject} src - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - * @param {SpineContainer} [container] - If this Spine object is in a Spine Container, this is a reference to it. - */ -var SpineGameObjectWebGLDirect = function (renderer, src, camera, parentMatrix, container) -{ - var plugin = src.plugin; - var skeleton = src.skeleton; - var sceneRenderer = plugin.sceneRenderer; - - // flush + clear previous pipeline if this is a new type - renderer.pipelines.clear(); - - sceneRenderer.begin(); - - var scrollFactorX = src.scrollFactorX; - var scrollFactorY = src.scrollFactorY; - var alpha = skeleton.color.a; - - if (container) - { - src.scrollFactorX = container.scrollFactorX; - src.scrollFactorY = container.scrollFactorY; - - skeleton.color.a = Clamp(alpha * container.alpha, 0, 1); - } - - camera.addToRenderList(src); - - var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; - - var viewportHeight = renderer.height; - - skeleton.x = calcMatrix.tx; - skeleton.y = viewportHeight - calcMatrix.ty; - - skeleton.scaleX = calcMatrix.scaleX; - skeleton.scaleY = calcMatrix.scaleY; - - if (src.scaleX < 0) - { - skeleton.scaleX *= -1; - - // -180 degrees to account for the difference in Spine vs. Phaser rotation when inversely scaled - src.root.rotation = Wrap(RadToDeg(calcMatrix.rotationNormalized) - 180, 0, 360); - } - else - { - // +90 degrees to account for the difference in Spine vs. Phaser rotation - src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360); - } - - if (src.scaleY < 0) - { - skeleton.scaleY *= -1; - - if (src.scaleX < 0) - { - src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2); - } - else - { - src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2); - } - } - - /* - if (renderer.currentFramebuffer !== null) - { - skeleton.y = calcMatrix.ty; - skeleton.scaleY *= -1; - } - */ - - skeleton.updateWorldTransform(); - - // Draw the current skeleton - - sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); - - if (container) - { - src.scrollFactorX = scrollFactorX; - src.scrollFactorY = scrollFactorY; - skeleton.color.a = alpha; - } - - if (plugin.drawDebug || src.drawDebug) - { - // Because if we don't, the bones render positions are completely wrong (*sigh*) - var oldX = skeleton.x; - var oldY = skeleton.y; - - skeleton.x = 0; - skeleton.y = 0; - - sceneRenderer.drawSkeletonDebug(skeleton, src.preMultipliedAlpha); - - skeleton.x = oldX; - skeleton.y = oldY; - } - - // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch - sceneRenderer.end(); - - // And rebind the previous pipeline - renderer.pipelines.rebind(); -}; - -module.exports = SpineGameObjectWebGLDirect; - - -/***/ }), -/* 258 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var Class = __webpack_require__(0); -var Container = __webpack_require__(259); -var SpineContainerRender = __webpack_require__(344); +var tempMatrix = new Float32Array(20); /** * @classdesc - * A Spine Container is a special kind of Container created specifically for Spine Game Objects. + * The ColorMatrix class creates a 5x4 matrix that can be used in shaders and graphics + * operations. It provides methods required to modify the color values, such as adjusting + * the brightness, setting a sepia tone, hue rotation and more. * - * You have all of the same features of a standard Container, but the rendering functions are optimized specifically - * for Spine Game Objects. You must only add ever Spine Game Objects, or other Spine Containers, to this type of Container. - * Although Phaser will not prevent you from adding other types, they will not render and are likely to throw runtime errors. + * Use the method `getData` to return a Float32Array containing the current color values. * - * To create one in a Scene, use the factory methods: - * - * ```javascript - * this.add.spineContainer(); - * ``` - * - * or - * - * ```javascript - * this.make.spineContainer(); - * ``` - * - * Note that you should not nest Spine Containers inside regular Containers if you wish to use masks on the - * container children. You can, however, mask children of Spine Containers if they are embedded within other - * Spine Containers. In short, if you need masking, don't mix and match the types. - * - * See the Container documentation for further details about what Containers can do. - * - * @class SpineContainer - * @extends Phaser.GameObjects.Container + * @class ColorMatrix + * @memberof Phaser.Display * @constructor * @since 3.50.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene that this Game Object belongs to. - * @param {SpinePlugin} pluginManager - A reference to the Phaser Spine Plugin. - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {SpineGameObject[]} [children] - An optional array of Spine Game Objects to add to this Container. */ -var SpineContainer = new Class({ - - Extends: Container, - - Mixins: [ - SpineContainerRender - ], +var ColorMatrix = new Class({ initialize: - function SpineContainer (scene, plugin, x, y, children) + function ColorMatrix () { - Container.call(this, scene, x, y, children); - - // Same as SpineGameObject, to prevent the renderer from mis-typing it when batching - this.type = 'Spine'; - /** - * A reference to the Spine Plugin. + * Internal ColorMatrix array. * - * @name SpineContainer#plugin - * @type {SpinePlugin} + * @name Phaser.Display.ColorMatrix#_matrix + * @type {Float32Array} + * @private * @since 3.50.0 */ - this.plugin = plugin; + this._matrix = new Float32Array(20); + + /** + * The value that determines how much of the original color is used + * when mixing the colors. A value between 0 (all original) and 1 (all final) + * + * @name Phaser.Display.ColorMatrix#alpha + * @type {number} + * @since 3.50.0 + */ + this.alpha = 1; + + /** + * Is the ColorMatrix array dirty? + * + * @name Phaser.Display.ColorMatrix#_dirty + * @type {boolean} + * @private + * @since 3.50.0 + */ + this._dirty = true; + + /** + * The matrix data as a Float32Array. + * + * Returned by the `getData` method. + * + * @name Phaser.Display.ColorMatrix#data + * @type {Float32Array} + * @private + * @since 3.50.0 + */ + this._data = new Float32Array(20); + + this.reset(); }, /** - * Internal destroy handler, called as part of the destroy process. + * Sets this ColorMatrix from the given array of color values. * - * @method SpineContainer#preDestroy - * @protected + * @method Phaser.Display.ColorMatrix#set * @since 3.50.0 + * + * @param {(number[]|Float32Array)} value - The ColorMatrix values to set. Must have 20 elements. + * + * @return {this} This ColorMatrix instance. */ - preDestroy: function () + set: function (value) { - this.removeAll(!!this.exclusive); + this._matrix.set(value); - this.localTransform.destroy(); - this.tempTransformMatrix.destroy(); + this._dirty = true; - this.list = []; - this._displayList = null; - this.plugin = null; + return this; + }, + + /** + * Resets the ColorMatrix to default values and also resets + * the `alpha` property back to 1. + * + * @method Phaser.Display.ColorMatrix#reset + * @since 3.50.0 + * + * @return {this} This ColorMatrix instance. + */ + reset: function () + { + var m = this._matrix; + + m.fill(0); + + m[0] = 1; + m[6] = 1; + m[12] = 1; + m[18] = 1; + + this.alpha = 1; + + this._dirty = true; + + return this; + }, + + /** + * Gets the ColorMatrix as a Float32Array. + * + * Can be used directly as a 1fv shader uniform value. + * + * @method Phaser.Display.ColorMatrix#getData + * @since 3.50.0 + * + * @return {Float32Array} The ColorMatrix as a Float32Array. + */ + getData: function () + { + var data = this._data; + + if (this._dirty) + { + data.set(this._matrix); + + data[4] /= 255; + data[9] /= 255; + data[14] /= 255; + data[19] /= 255; + + this._dirty = false; + } + + return data; + }, + + /** + * Changes the brightness of this ColorMatrix by the given amount. + * + * @method Phaser.Display.ColorMatrix#brightness + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of brightness to apply to this ColorMatrix. Between 0 (black) and 1. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + brightness: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var b = value; + + return this.multiply([ + b, 0, 0, 0, 0, + 0, b, 0, 0, 0, + 0, 0, b, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Changes the saturation of this ColorMatrix by the given amount. + * + * @method Phaser.Display.ColorMatrix#saturate + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of saturation to apply to this ColorMatrix. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + saturate: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var x = (value * 2 / 3) + 1; + var y = ((x - 1) * -0.5); + + return this.multiply([ + x, y, y, 0, 0, + y, x, y, 0, 0, + y, y, x, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Desaturates this ColorMatrix (removes color from it). + * + * @method Phaser.Display.ColorMatrix#saturation + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + desaturate: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.saturate(-1, multiply); + }, + + /** + * Rotates the hues of this ColorMatrix by the value given. + * + * @method Phaser.Display.ColorMatrix#hue + * @since 3.50.0 + * + * @param {number} [rotation=0] - The amount of hue rotation to apply to this ColorMatrix, in degrees. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + hue: function (rotation, multiply) + { + if (rotation === undefined) { rotation = 0; } + if (multiply === undefined) { multiply = false; } + + rotation = rotation / 180 * Math.PI; + + var cos = Math.cos(rotation); + var sin = Math.sin(rotation); + var lumR = 0.213; + var lumG = 0.715; + var lumB = 0.072; + + return this.multiply([ + lumR + cos * (1 - lumR) + sin * (-lumR),lumG + cos * (-lumG) + sin * (-lumG),lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0, + lumR + cos * (-lumR) + sin * (0.143),lumG + cos * (1 - lumG) + sin * (0.140),lumB + cos * (-lumB) + sin * (-0.283), 0, 0, + lumR + cos * (-lumR) + sin * (-(1 - lumR)),lumG + cos * (-lumG) + sin * (lumG),lumB + cos * (1 - lumB) + sin * (lumB), 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Sets this ColorMatrix to be grayscale. + * + * @method Phaser.Display.ColorMatrix#grayscale + * @since 3.50.0 + * + * @param {number} [value=1] - The grayscale scale (0 is black). + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + grayscale: function (value, multiply) + { + if (value === undefined) { value = 1; } + if (multiply === undefined) { multiply = false; } + + return this.saturate(-value, multiply); + }, + + /** + * Sets this ColorMatrix to be black and white. + * + * @method Phaser.Display.ColorMatrix#blackWhite + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + blackWhite: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.BLACK_WHITE, multiply); + }, + + /** + * Change the contrast of this ColorMatrix by the amount given. + * + * @method Phaser.Display.ColorMatrix#contrast + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of contrast to apply to this ColorMatrix. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + contrast: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var v = value + 1; + var o = -0.5 * (v - 1); + + return this.multiply([ + v, 0, 0, 0, o, + 0, v, 0, 0, o, + 0, 0, v, 0, o, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Converts this ColorMatrix to have negative values. + * + * @method Phaser.Display.ColorMatrix#negative + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + negative: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.NEGATIVE, multiply); + }, + + /** + * Apply a desaturated luminance to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#desaturateLuminance + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + desaturateLuminance: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.DESATURATE_LUMINANCE, multiply); + }, + + /** + * Applies a sepia tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#sepia + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + sepia: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.SEPIA, multiply); + }, + + /** + * Applies a night vision tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#night + * @since 3.50.0 + * + * @param {number} [intensity=0.1] - The intensity of this effect. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + night: function (intensity, multiply) + { + if (intensity === undefined) { intensity = 0.1; } + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + intensity * (-2.0), -intensity, 0, 0, 0, + -intensity, 0, intensity, 0, 0, + 0, intensity, intensity * 2.0, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a trippy color tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#lsd + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + lsd: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.LSD, multiply); + }, + + /** + * Applies a brown tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#brown + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + brown: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.BROWN, multiply); + }, + + /** + * Applies a vintage pinhole color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#vintagePinhole + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + vintagePinhole: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.VINTAGE, multiply); + }, + + /** + * Applies a kodachrome color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#kodachrome + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + kodachrome: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.KODACHROME, multiply); + }, + + /** + * Applies a technicolor color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#technicolor + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + technicolor: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.TECHNICOLOR, multiply); + }, + + /** + * Applies a polaroid color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#polaroid + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + polaroid: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.POLAROID, multiply); + }, + + /** + * Shifts the values of this ColorMatrix into BGR order. + * + * @method Phaser.Display.ColorMatrix#shiftToBGR + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + shiftToBGR: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply(ColorMatrix.SHIFT_BGR, multiply); + }, + + /** + * Multiplies the two given matrices. + * + * @method Phaser.Display.ColorMatrix#multiply + * @since 3.50.0 + * + * @param {number[]} a - The 5x4 array to multiply with ColorMatrix._matrix. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + multiply: function (a, multiply) + { + if (multiply === undefined) { multiply = false; } + + // Duplicate _matrix into c + + if (!multiply) + { + this.reset(); + } + + var m = this._matrix; + var c = tempMatrix; + + // copy _matrix to tempMatrox + c.set(m); + + m.set([ + // R + (c[0] * a[0]) + (c[1] * a[5]) + (c[2] * a[10]) + (c[3] * a[15]), + (c[0] * a[1]) + (c[1] * a[6]) + (c[2] * a[11]) + (c[3] * a[16]), + (c[0] * a[2]) + (c[1] * a[7]) + (c[2] * a[12]) + (c[3] * a[17]), + (c[0] * a[3]) + (c[1] * a[8]) + (c[2] * a[13]) + (c[3] * a[18]), + (c[0] * a[4]) + (c[1] * a[9]) + (c[2] * a[14]) + (c[3] * a[19]) + c[4], + + // G + (c[5] * a[0]) + (c[6] * a[5]) + (c[7] * a[10]) + (c[8] * a[15]), + (c[5] * a[1]) + (c[6] * a[6]) + (c[7] * a[11]) + (c[8] * a[16]), + (c[5] * a[2]) + (c[6] * a[7]) + (c[7] * a[12]) + (c[8] * a[17]), + (c[5] * a[3]) + (c[6] * a[8]) + (c[7] * a[13]) + (c[8] * a[18]), + (c[5] * a[4]) + (c[6] * a[9]) + (c[7] * a[14]) + (c[8] * a[19]) + c[9], + + // B + (c[10] * a[0]) + (c[11] * a[5]) + (c[12] * a[10]) + (c[13] * a[15]), + (c[10] * a[1]) + (c[11] * a[6]) + (c[12] * a[11]) + (c[13] * a[16]), + (c[10] * a[2]) + (c[11] * a[7]) + (c[12] * a[12]) + (c[13] * a[17]), + (c[10] * a[3]) + (c[11] * a[8]) + (c[12] * a[13]) + (c[13] * a[18]), + (c[10] * a[4]) + (c[11] * a[9]) + (c[12] * a[14]) + (c[13] * a[19]) + c[14], + + // A + (c[15] * a[0]) + (c[16] * a[5]) + (c[17] * a[10]) + (c[18] * a[15]), + (c[15] * a[1]) + (c[16] * a[6]) + (c[17] * a[11]) + (c[18] * a[16]), + (c[15] * a[2]) + (c[16] * a[7]) + (c[17] * a[12]) + (c[18] * a[17]), + (c[15] * a[3]) + (c[16] * a[8]) + (c[17] * a[13]) + (c[18] * a[18]), + (c[15] * a[4]) + (c[16] * a[9]) + (c[17] * a[14]) + (c[18] * a[19]) + c[19] + + ]); + + this._dirty = true; + + return this; } }); -module.exports = SpineContainer; +/** + * A constant array used by the ColorMatrix class for black_white operations. + * + * @name Phaser.Display.ColorMatrix.BLACK_WHITE + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.BLACK_WHITE = [ 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for negative operations. + * + * @name Phaser.Display.ColorMatrix.NEGATIVE + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.NEGATIVE = [ -1, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for desatured luminance operations. + * + * @name Phaser.Display.ColorMatrix.DESATURATE_LUMINANCE + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.DESATURATE_LUMINANCE = [ 0.2764723, 0.9297080, 0.0938197, 0, -37.1, 0.2764723, 0.9297080, 0.0938197, 0, -37.1, 0.2764723, 0.9297080, 0.0938197, 0, -37.1, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for sepia operations. + * + * @name Phaser.Display.ColorMatrix.SEPIA + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.SEPIA = [ 0.393, 0.7689999, 0.18899999, 0, 0, 0.349, 0.6859999, 0.16799999, 0, 0, 0.272, 0.5339999, 0.13099999, 0, 0, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for lsd operations. + * + * @name Phaser.Display.ColorMatrix.LSD + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.LSD = [ 2, -0.4, 0.5, 0, 0, -0.5, 2, -0.4, 0, 0, -0.4, -0.5, 3, 0, 0, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for brown operations. + * + * @name Phaser.Display.ColorMatrix.BROWN + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.BROWN = [ 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873, -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127, 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for vintage pinhole operations. + * + * @name Phaser.Display.ColorMatrix.VINTAGE + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.VINTAGE = [ 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123, 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591, 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for kodachrome operations. + * + * @name Phaser.Display.ColorMatrix.KODACHROME + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.KODACHROME = [ 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502, -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203, -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for technicolor operations. + * + * @name Phaser.Display.ColorMatrix.TECHNICOLOR + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.TECHNICOLOR = [ 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337, -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398, -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for polaroid shift operations. + * + * @name Phaser.Display.ColorMatrix.POLAROID + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.POLAROID = [ 1.438, -0.062, -0.062, 0, 0, -0.122, 1.378, -0.122, 0, 0, -0.016, -0.016, 1.483, 0, 0, 0, 0, 0, 1, 0 ]; + +/** + * A constant array used by the ColorMatrix class for shift BGR operations. + * + * @name Phaser.Display.ColorMatrix.SHIFT_BGR + * @const + * @type {number[]} + * @since 3.60.0 + */ +ColorMatrix.SHIFT_BGR = [ 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 ]; + +module.exports = ColorMatrix; /***/ }), -/* 259 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8073: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(9454); +var Smoothing = __webpack_require__(2150); + +// The pool into which the canvas elements are placed. +var pool = []; + +// Automatically apply smoothing(false) to created Canvas elements +var _disableContextSmoothing = false; + +/** + * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. + * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, + * which is useless for some of the Phaser pipelines / renderer. + * + * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. + * Which means all instances of Phaser Games on the same page can share the one single pool. + * + * @namespace Phaser.Display.Canvas.CanvasPool + * @since 3.0.0 + */ +var CanvasPool = function () +{ + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.create + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. + * @param {boolean} [selfParent=false] - Use the generated Canvas element as the parent? + * + * @return {HTMLCanvasElement} The canvas element that was created or pulled from the pool + */ + var create = function (parent, width, height, canvasType, selfParent) + { + if (width === undefined) { width = 1; } + if (height === undefined) { height = 1; } + if (canvasType === undefined) { canvasType = CONST.CANVAS; } + if (selfParent === undefined) { selfParent = false; } + + var canvas; + var container = first(canvasType); + + if (container === null) + { + container = { + parent: parent, + canvas: document.createElement('canvas'), + type: canvasType + }; + + if (canvasType === CONST.CANVAS) + { + pool.push(container); + } + + canvas = container.canvas; + } + else + { + container.parent = parent; + + canvas = container.canvas; + } + + if (selfParent) + { + container.parent = canvas; + } + + canvas.width = width; + canvas.height = height; + + if (_disableContextSmoothing && canvasType === CONST.CANVAS) + { + Smoothing.disable(canvas.getContext('2d', { willReadFrequently: false })); + } + + return canvas; + }; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.create2D + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * + * @return {HTMLCanvasElement} The created canvas. + */ + var create2D = function (parent, width, height) + { + return create(parent, width, height, CONST.CANVAS); + }; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.createWebGL + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * + * @return {HTMLCanvasElement} The created WebGL canvas. + */ + var createWebGL = function (parent, width, height) + { + return create(parent, width, height, CONST.WEBGL); + }; + + /** + * Gets the first free canvas index from the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.first + * @since 3.0.0 + * + * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. + * + * @return {HTMLCanvasElement} The first free canvas, or `null` if a WebGL canvas was requested or if the pool doesn't have free canvases. + */ + var first = function (canvasType) + { + if (canvasType === undefined) { canvasType = CONST.CANVAS; } + + if (canvasType === CONST.WEBGL) + { + return null; + } + + for (var i = 0; i < pool.length; i++) + { + var container = pool[i]; + + if (!container.parent && container.type === canvasType) + { + return container; + } + } + + return null; + }; + + /** + * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use. + * The canvas has its width and height set to 1, and its parent attribute nulled. + * + * @function Phaser.Display.Canvas.CanvasPool.remove + * @since 3.0.0 + * + * @param {*} parent - The canvas or the parent of the canvas to free. + */ + var remove = function (parent) + { + // Check to see if the parent is a canvas object + var isCanvas = parent instanceof HTMLCanvasElement; + + pool.forEach(function (container) + { + if ((isCanvas && container.canvas === parent) || (!isCanvas && container.parent === parent)) + { + container.parent = null; + container.canvas.width = 1; + container.canvas.height = 1; + } + }); + }; + + /** + * Gets the total number of used canvas elements in the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.total + * @since 3.0.0 + * + * @return {number} The number of used canvases. + */ + var total = function () + { + var c = 0; + + pool.forEach(function (container) + { + if (container.parent) + { + c++; + } + }); + + return c; + }; + + /** + * Gets the total number of free canvas elements in the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.free + * @since 3.0.0 + * + * @return {number} The number of free canvases. + */ + var free = function () + { + return pool.length - total(); + }; + + /** + * Disable context smoothing on any new Canvas element created. + * + * @function Phaser.Display.Canvas.CanvasPool.disableSmoothing + * @since 3.0.0 + */ + var disableSmoothing = function () + { + _disableContextSmoothing = true; + }; + + /** + * Enable context smoothing on any new Canvas element created. + * + * @function Phaser.Display.Canvas.CanvasPool.enableSmoothing + * @since 3.0.0 + */ + var enableSmoothing = function () + { + _disableContextSmoothing = false; + }; + + return { + create2D: create2D, + create: create, + createWebGL: createWebGL, + disableSmoothing: disableSmoothing, + enableSmoothing: enableSmoothing, + first: first, + free: free, + pool: pool, + remove: remove, + total: total + }; +}; + +// If we export the called function here, it'll only be invoked once (not every time it's required). +module.exports = CanvasPool(); + + +/***/ }), + +/***/ 2150: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Browser specific prefix, so not going to change between contexts, only between browsers +var prefix = ''; + +/** + * @namespace Phaser.Display.Canvas.Smoothing + * @since 3.0.0 + */ +var Smoothing = function () +{ + /** + * Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set. + * + * @function Phaser.Display.Canvas.Smoothing.getPrefix + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The canvas context to check. + * + * @return {string} The name of the property on the context which controls image smoothing (either `imageSmoothingEnabled` or a vendor-prefixed version thereof), or `null` if not supported. + */ + var getPrefix = function (context) + { + var vendors = [ 'i', 'webkitI', 'msI', 'mozI', 'oI' ]; + + for (var i = 0; i < vendors.length; i++) + { + var s = vendors[i] + 'mageSmoothingEnabled'; + + if (s in context) + { + return s; + } + } + + return null; + }; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * + * @function Phaser.Display.Canvas.Smoothing.enable + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to enable smoothing. + * + * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. + */ + var enable = function (context) + { + if (prefix === '') + { + prefix = getPrefix(context); + } + + if (prefix) + { + context[prefix] = true; + } + + return context; + }; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * + * @function Phaser.Display.Canvas.Smoothing.disable + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to disable smoothing. + * + * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. + */ + var disable = function (context) + { + if (prefix === '') + { + prefix = getPrefix(context); + } + + if (prefix) + { + context[prefix] = false; + } + + return context; + }; + + /** + * Returns `true` if the given context has image smoothing enabled, otherwise returns `false`. + * Returns null if no smoothing prefix is available. + * + * @function Phaser.Display.Canvas.Smoothing.isEnabled + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context to check. + * + * @return {?boolean} `true` if smoothing is enabled on the context, otherwise `false`. `null` if not supported. + */ + var isEnabled = function (context) + { + return (prefix !== null) ? context[prefix] : null; + }; + + return { + disable: disable, + enable: enable, + getPrefix: getPrefix, + isEnabled: isEnabled + }; + +}; + +module.exports = Smoothing(); + + +/***/ }), + +/***/ 7499: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var GameObjectFactory = __webpack_require__(3649); + +/** + * @classdesc + * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. + * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask, + * not a clipping path. It is only available when using the WebGL Renderer. + * + * A Bitmap Mask can use any Game Object or Dynamic Texture to determine the alpha of each pixel of the masked Game Object(s). + * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha + * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the + * Bitmap Mask doesn't matter. + * + * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an + * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means + * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects. + * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the + * corresponding pixel in the mask. + * + * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, + * combine Geometry Masks and Blend Modes together. + * + * The Bitmap Mask's location matches the location of its Game Object, not the location of the + * masked objects. Moving or transforming the underlying Game Object will change the mask + * (and affect the visibility of any masked objects), whereas moving or transforming a masked object + * will not affect the mask. + * + * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a + * Scene's display list, it will only be used for the mask and its full texture will not be directly + * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will + * render as a normal Game Object and will also serve as a mask. + * + * @class BitmapMask + * @memberof Phaser.Display.Masks + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this mask is being added. + * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Dynamic Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. + * @param {number} [x] - If creating a Game Object, the horizontal position in the world. + * @param {number} [y] - If creating a Game Object, the vertical position in the world. + * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. + */ +var BitmapMask = new Class({ + + initialize: + + function BitmapMask (scene, maskObject, x, y, texture, frame) + { + if (!maskObject) + { + maskObject = scene.sys.make.image({ x: x, y: y, key: texture, frame: frame, add: false }); + } + + /** + * The Game Object that is used as the mask. Must use a texture, such as a Sprite. + * + * @name Phaser.Display.Masks.BitmapMask#bitmapMask + * @type {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} + * @since 3.0.0 + */ + this.bitmapMask = maskObject; + + /** + * Whether to invert the masks alpha. + * + * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. + * + * Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. + * + * @name Phaser.Display.Masks.BitmapMask#invertAlpha + * @type {boolean} + * @since 3.1.2 + */ + this.invertAlpha = false; + + /** + * Is this mask a stencil mask? This is false by default and should not be changed. + * + * @name Phaser.Display.Masks.BitmapMask#isStencil + * @type {boolean} + * @readonly + * @since 3.17.0 + */ + this.isStencil = false; + }, + + /** + * Sets a new Game Object or Dynamic Texture for this Bitmap Mask to use. + * + * If a Game Object it must have a texture, such as a Sprite. + * + * You can update the source of the mask as often as you like. + * + * @method Phaser.Display.Masks.BitmapMask#setBitmap + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} maskObject - The Game Object or Dynamic Texture that will be used as the mask. If a Game Object, it must have a texture, such as a Sprite. + */ + setBitmap: function (maskObject) + { + this.bitmapMask = maskObject; + }, + + /** + * Prepares the WebGL Renderer to render a Game Object with this mask applied. + * + * This renders the masking Game Object to the mask framebuffer and switches to the main framebuffer so that the masked Game Object will be rendered to it instead of being rendered directly to the frame. + * + * @method Phaser.Display.Masks.BitmapMask#preRenderWebGL + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to prepare. + * @param {Phaser.GameObjects.GameObject} maskedObject - The masked Game Object which will be drawn. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. + */ + preRenderWebGL: function (renderer, maskedObject, camera) + { + renderer.pipelines.BITMAPMASK_PIPELINE.beginMask(this, maskedObject, camera); + }, + + /** + * Finalizes rendering of a masked Game Object. + * + * This resets the previously bound framebuffer and switches the WebGL Renderer to the Bitmap Mask Pipeline, which uses a special fragment shader to apply the masking effect. + * + * @method Phaser.Display.Masks.BitmapMask#postRenderWebGL + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to clean up. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. + * @param {Phaser.Renderer.WebGL.RenderTarget} [renderTarget] - Optional WebGL RenderTarget. + */ + postRenderWebGL: function (renderer, camera, renderTarget) + { + renderer.pipelines.BITMAPMASK_PIPELINE.endMask(this, camera, renderTarget); + }, + + /** + * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * + * @method Phaser.Display.Masks.BitmapMask#preRenderCanvas + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to. + * @param {Phaser.GameObjects.GameObject} mask - The masked Game Object which would be rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. + */ + preRenderCanvas: function () + { + // NOOP + }, + + /** + * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * + * @method Phaser.Display.Masks.BitmapMask#postRenderCanvas + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to. + */ + postRenderCanvas: function () + { + // NOOP + }, + + /** + * Destroys this BitmapMask and nulls any references it holds. + * + * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, + * so be sure to call `clearMask` on any Game Object using it, before destroying it. + * + * @method Phaser.Display.Masks.BitmapMask#destroy + * @since 3.7.0 + */ + destroy: function () + { + this.bitmapMask = null; + } + +}); + +/** + * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. + * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask, + * not a clipping path. It is only available when using the WebGL Renderer. + * + * A Bitmap Mask can use any Game Object, or Dynamic Texture, to determine the alpha of each pixel of the masked Game Object(s). + * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha + * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the + * Bitmap Mask doesn't matter. + * + * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an + * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means + * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects + * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the + * corresponding pixel in the mask. + * + * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, + * combine Geometry Masks and Blend Modes together. + * + * The Bitmap Mask's location matches the location of its Game Object, not the location of the + * masked objects. Moving or transforming the underlying Game Object will change the mask + * (and affect the visibility of any masked objects), whereas moving or transforming a masked object + * will not affect the mask. + * + * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a + * Scene's display list, it will only be used for the mask and its full texture will not be directly + * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will + * render as a normal Game Object and will also serve as a mask. + * + * @method Phaser.GameObjects.GameObjectFactory#bitmapMask + * @since 3.60.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. + * @param {number} [x] - If creating a Game Object, the horizontal position in the world. + * @param {number} [y] - If creating a Game Object, the vertical position in the world. + * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.Display.Masks.BitmapMask} The Bitmap Mask that was created. + */ +GameObjectFactory.register('bitmapMask', function (maskObject, x, y, key, frame) +{ + return new BitmapMask(this.scene, maskObject, x, y, key, frame); +}); + +module.exports = BitmapMask; + + +/***/ }), + +/***/ 6726: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect + * a visible pixel from the geometry mask. The mask is essentially a clipping path which can only + * make a masked pixel fully visible or fully invisible without changing its alpha (opacity). + * + * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) + * should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed + * if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and + * alpha of the pixel from the Geometry Mask do not matter. + * + * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. + * Moving or transforming the underlying Graphics object will change the mask (and affect the visibility + * of any masked objects), whereas moving or transforming a masked object will not affect the mask. + * You can think of the Geometry Mask (or rather, of its Graphics object) as an invisible curtain placed + * in front of all masked objects which has its own visual properties and, naturally, respects the camera's + * visual properties, but isn't affected by and doesn't follow the masked objects by itself. + * + * @class GeometryMask + * @memberof Phaser.Display.Masks + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - This parameter is not used. + * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List. + */ +var GeometryMask = new Class({ + + initialize: + + function GeometryMask (scene, graphicsGeometry) + { + /** + * The Graphics object which describes the Geometry Mask. + * + * @name Phaser.Display.Masks.GeometryMask#geometryMask + * @type {Phaser.GameObjects.Graphics} + * @since 3.0.0 + */ + this.geometryMask = graphicsGeometry; + + /** + * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels + * drawn to the Geometry Mask. + * + * This is a WebGL only feature. + * + * @name Phaser.Display.Masks.GeometryMask#invertAlpha + * @type {boolean} + * @since 3.16.0 + */ + this.invertAlpha = false; + + /** + * Is this mask a stencil mask? + * + * @name Phaser.Display.Masks.GeometryMask#isStencil + * @type {boolean} + * @readonly + * @since 3.17.0 + */ + this.isStencil = true; + + /** + * The current stencil level. This can change dynamically at runtime + * and is set in the applyStencil method. + * + * @name Phaser.Display.Masks.GeometryMask#level + * @type {boolean} + * @since 3.17.0 + */ + this.level = 0; + }, + + /** + * Sets a new Graphics object for the Geometry Mask. + * + * @method Phaser.Display.Masks.GeometryMask#setShape + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. + * + * @return {this} This Geometry Mask + */ + setShape: function (graphicsGeometry) + { + this.geometryMask = graphicsGeometry; + + return this; + }, + + /** + * Sets the `invertAlpha` property of this Geometry Mask. + * + * Inverting the alpha essentially flips the way the mask works. + * + * This is a WebGL only feature. + * + * @method Phaser.Display.Masks.GeometryMask#setInvertAlpha + * @since 3.17.0 + * + * @param {boolean} [value=true] - Invert the alpha of this mask? + * + * @return {this} This Geometry Mask + */ + setInvertAlpha: function (value) + { + if (value === undefined) { value = true; } + + this.invertAlpha = value; + + return this; + }, + + /** + * Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask. + * + * @method Phaser.Display.Masks.GeometryMask#preRenderWebGL + * @since 3.0.0 + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. + * @param {Phaser.GameObjects.GameObject} child - The Game Object being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. + */ + preRenderWebGL: function (renderer, child, camera) + { + var gl = renderer.gl; + + // Force flushing before drawing to stencil buffer + renderer.flush(); + + if (renderer.maskStack.length === 0) + { + gl.enable(gl.STENCIL_TEST); + gl.clear(gl.STENCIL_BUFFER_BIT); + + renderer.maskCount = 0; + } + + if (renderer.currentCameraMask.mask !== this) + { + renderer.currentMask.mask = this; + } + + renderer.maskStack.push({ mask: this, camera: camera }); + + this.applyStencil(renderer, camera, true); + + renderer.maskCount++; + }, + + /** + * Applies the current stencil mask to the renderer. + * + * @method Phaser.Display.Masks.GeometryMask#applyStencil + * @since 3.17.0 + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. + * @param {boolean} inc - Is this an INCR stencil or a DECR stencil? + */ + applyStencil: function (renderer, camera, inc) + { + var gl = renderer.gl; + var geometryMask = this.geometryMask; + var level = renderer.maskCount; + var mask = 0xff; + + gl.colorMask(false, false, false, false); + + if (inc) + { + gl.stencilFunc(gl.EQUAL, level, mask); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR); + + // Do this _after_ we set the stencilFunc + level++; + } + else + { + gl.stencilFunc(gl.EQUAL, level + 1, mask); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR); + } + + this.level = level; + + // Write stencil buffer + geometryMask.renderWebGL(renderer, geometryMask, camera); + + renderer.flush(); + + gl.colorMask(true, true, true, true); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + + if (this.invertAlpha) + { + gl.stencilFunc(gl.NOTEQUAL, level, mask); + } + else + { + gl.stencilFunc(gl.EQUAL, level, mask); + } + }, + + /** + * Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it. + * + * @method Phaser.Display.Masks.GeometryMask#postRenderWebGL + * @since 3.0.0 + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw flush. + */ + postRenderWebGL: function (renderer) + { + var gl = renderer.gl; + + renderer.maskStack.pop(); + + renderer.maskCount--; + + // Force flush before disabling stencil test + renderer.flush(); + + var current = renderer.currentMask; + + if (renderer.maskStack.length === 0) + { + // If this is the only mask in the stack, flush and disable + current.mask = null; + + gl.disable(gl.STENCIL_TEST); + } + else + { + var prev = renderer.maskStack[renderer.maskStack.length - 1]; + + prev.mask.applyStencil(renderer, prev.camera, false); + + if (renderer.currentCameraMask.mask !== prev.mask) + { + current.mask = prev.mask; + current.camera = prev.camera; + } + else + { + current.mask = null; + } + } + }, + + /** + * Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object. + * + * @method Phaser.Display.Masks.GeometryMask#preRenderCanvas + * @since 3.0.0 + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance to set the clipping path on. + * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. + */ + preRenderCanvas: function (renderer, mask, camera) + { + var geometryMask = this.geometryMask; + + renderer.currentContext.save(); + + geometryMask.renderCanvas(renderer, geometryMask, camera, null, null, true); + + renderer.currentContext.clip(); + }, + + /** + * Restore the canvas context's previous clipping path, thus turning off the mask for it. + * + * @method Phaser.Display.Masks.GeometryMask#postRenderCanvas + * @since 3.0.0 + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance being restored. + */ + postRenderCanvas: function (renderer) + { + renderer.currentContext.restore(); + }, + + /** + * Destroys this GeometryMask and nulls any references it holds. + * + * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, + * so be sure to call `clearMask` on any Game Object using it, before destroying it. + * + * @method Phaser.Display.Masks.GeometryMask#destroy + * @since 3.7.0 + */ + destroy: function () + { + this.geometryMask = null; + } + +}); + +module.exports = GeometryMask; + + +/***/ }), + +/***/ 7340: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Barrel FX Controller. + * + * This FX controller manages the barrel distortion effect for a Game Object. + * + * A barrel effect allows you to apply either a 'pinch' or 'expand' distortion to + * a Game Object. The amount of the effect can be modified in real-time. + * + * A Barrel effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBarrel(); + * sprite.postFX.addBarrel(); + * ``` + * + * @class Barrel + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [amount=1] - The amount of distortion applied to the barrel effect. A value of 1 is no distortion. Typically keep this within +- 1. + */ +var Barrel = new Class({ + + Extends: Controller, + + initialize: + + function Barrel (gameObject, amount) + { + if (amount === undefined) { amount = 1; } + + Controller.call(this, FX_CONST.BARREL, gameObject); + + /** + * The amount of distortion applied to the barrel effect. + * + * Typically keep this within the range 1 (no distortion) to +- 1. + * + * @name Phaser.FX.Barrel#amount + * @type {number} + * @since 3.60.0 + */ + this.amount = amount; + } + +}); + +module.exports = Barrel; + + +/***/ }), + +/***/ 5170: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Bloom FX Controller. + * + * This FX controller manages the bloom effect for a Game Object. + * + * Bloom is an effect used to reproduce an imaging artifact of real-world cameras. + * The effect produces fringes of light extending from the borders of bright areas in an image, + * contributing to the illusion of an extremely bright light overwhelming the + * camera or eye capturing the scene. + * + * A Bloom effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBloom(); + * sprite.postFX.addBloom(); + * ``` + * + * @class Bloom + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [color=0xffffff] - The color of the Bloom, as a hex value. + * @param {number} [offsetX=1] - The horizontal offset of the bloom effect. + * @param {number} [offsetY=1] - The vertical offset of the bloom effect. + * @param {number} [blurStrength=1] - The strength of the blur process of the bloom effect. + * @param {number} [strength=1] - The strength of the blend process of the bloom effect. + * @param {number} [steps=4] - The number of steps to run the Bloom effect for. This value should always be an integer. + */ +var Bloom = new Class({ + + Extends: Controller, + + initialize: + + function Bloom (gameObject, color, offsetX, offsetY, blurStrength, strength, steps) + { + if (offsetX === undefined) { offsetX = 1; } + if (offsetY === undefined) { offsetY = 1; } + if (blurStrength === undefined) { blurStrength = 1; } + if (strength === undefined) { strength = 1; } + if (steps === undefined) { steps = 4; } + + Controller.call(this, FX_CONST.BLOOM, gameObject); + + /** + * The number of steps to run the Bloom effect for. + * + * This value should always be an integer. + * + * It defaults to 4. The higher the value, the smoother the Bloom, + * but at the cost of exponentially more gl operations. + * + * Keep this to the lowest possible number you can have it, while + * still looking correct for your game. + * + * @name Phaser.FX.Bloom#steps + * @type {number} + * @since 3.60.0 + */ + this.steps = steps; + + /** + * The horizontal offset of the bloom effect. + * + * @name Phaser.FX.Bloom#offsetX + * @type {number} + * @since 3.60.0 + */ + this.offsetX = offsetX; + + /** + * The vertical offset of the bloom effect. + * + * @name Phaser.FX.Bloom#offsetY + * @type {number} + * @since 3.60.0 + */ + this.offsetY = offsetY; + + /** + * The strength of the blur process of the bloom effect. + * + * @name Phaser.FX.Bloom#blurStrength + * @type {number} + * @since 3.60.0 + */ + this.blurStrength = blurStrength; + + /** + * The strength of the blend process of the bloom effect. + * + * @name Phaser.FX.Bloom#strength + * @type {number} + * @since 3.60.0 + */ + this.strength = strength; + + /** + * The internal gl color array. + * + * @name Phaser.FX.Bloom#glcolor + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor = [ 1, 1, 1 ]; + + if (color !== undefined && color !== null) + { + this.color = color; + } + }, + + /** + * The color of the bloom as a number value. + * + * @name Phaser.FX.Bloom#color + * @type {number} + * @since 3.60.0 + */ + color: { + + get: function () + { + var color = this.glcolor; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + } + +}); + +module.exports = Bloom; + + +/***/ }), + +/***/ 4199: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Blur FX Controller. + * + * This FX controller manages the blur effect for a Game Object. + * + * A Gaussian blur is the result of blurring an image by a Gaussian function. It is a widely used effect, + * typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a + * smooth blur resembling that of viewing the image through a translucent screen, distinctly different + * from the bokeh effect produced by an out-of-focus lens or the shadow of an object under usual illumination. + * + * A Blur effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBlur(); + * sprite.postFX.addBlur(); + * ``` + * + * @class Blur + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [quality=0] - The quality of the blur effect. Can be either 0 for Low Quality, 1 for Medium Quality or 2 for High Quality. + * @param {number} [x=2] - The horizontal offset of the blur effect. + * @param {number} [y=2] - The vertical offset of the blur effect. + * @param {number} [strength=1] - The strength of the blur effect. + * @param {number} [color=0xffffff] - The color of the blur, as a hex value. + * @param {number} [steps=4] - The number of steps to run the blur effect for. This value should always be an integer. + */ +var Blur = new Class({ + + Extends: Controller, + + initialize: + + function Blur (gameObject, quality, x, y, strength, color, steps) + { + if (quality === undefined) { quality = 0; } + if (x === undefined) { x = 2; } + if (y === undefined) { y = 2; } + if (strength === undefined) { strength = 1; } + if (steps === undefined) { steps = 4; } + + Controller.call(this, FX_CONST.BLUR, gameObject); + + /** + * The quality of the blur effect. + * + * This can be: + * + * 0 for Low Quality + * 1 for Medium Quality + * 2 for High Quality + * + * The higher the quality, the more complex shader is used + * and the more processing time is spent on the GPU calculating + * the final blur. This value is used in conjunction with the + * `steps` value, as one has a direct impact on the other. + * + * Keep this value as low as you can, while still achieving the + * desired effect you need for your game. + * + * @name Phaser.FX.Blur#quality + * @type {number} + * @since 3.60.0 + */ + this.quality = 0; + + /** + * The horizontal offset of the blur effect. + * + * @name Phaser.FX.Blur#x + * @type {number} + * @since 3.60.0 + */ + this.x = x; + + /** + * The vertical offset of the blur effect. + * + * @name Phaser.FX.Blur#y + * @type {number} + * @since 3.60.0 + */ + this.y = y; + + /** + * The number of steps to run the Blur effect for. + * + * This value should always be an integer. + * + * It defaults to 4. The higher the value, the smoother the blur, + * but at the cost of exponentially more gl operations. + * + * Keep this to the lowest possible number you can have it, while + * still looking correct for your game. + * + * @name Phaser.FX.Blur#steps + * @type {number} + * @since 3.60.0 + */ + this.steps = steps; + + /** + * The strength of the blur effect. + * + * @name Phaser.FX.Blur#strength + * @type {number} + * @since 3.60.0 + */ + this.strength = strength; + + /** + * The internal gl color array. + * + * @name Phaser.FX.Blur#glcolor + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor = [ 1, 1, 1 ]; + + if (color !== undefined && color !== null) + { + this.color = color; + } + }, + + /** + * The color of the blur as a number value. + * + * @name Phaser.FX.Blur#color + * @type {number} + * @since 3.60.0 + */ + color: { + + get: function () + { + var color = this.glcolor; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + } + +}); + +module.exports = Blur; + + +/***/ }), + +/***/ 3132: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Bokeh FX Controller. + * + * This FX controller manages the bokeh effect for a Game Object. + * + * Bokeh refers to a visual effect that mimics the photographic technique of creating a shallow depth of field. + * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground + * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering + * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. + * + * This effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature + * effect by blurring everything except a small area of the image. This effect is achieved by blurring the + * top and bottom elements, while keeping the center area in focus. + * + * A Bokeh effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addBokeh(); + * sprite.postFX.addBokeh(); + * ``` + * + * @class Bokeh + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [radius=0.5] - The radius of the bokeh effect. + * @param {number} [amount=1] - The amount of the bokeh effect. + * @param {number} [contrast=0.2] - The color contrast of the bokeh effect. + * @param {boolean} [isTiltShift=false] - Is this a bokeh or Tile Shift effect? + * @param {number} [blurX=1] - If Tilt Shift, the amount of horizontal blur. + * @param {number} [blurY=1] - If Tilt Shift, the amount of vertical blur. + * @param {number} [strength=1] - If Tilt Shift, the strength of the blur. + */ +var Bokeh = new Class({ + + Extends: Controller, + + initialize: + + function Bokeh (gameObject, radius, amount, contrast, isTiltShift, blurX, blurY, strength) + { + if (radius === undefined) { radius = 0.5; } + if (amount === undefined) { amount = 1; } + if (contrast === undefined) { contrast = 0.2; } + if (isTiltShift === undefined) { isTiltShift = false; } + if (blurX === undefined) { blurX = 1; } + if (blurY === undefined) { blurY = 1; } + if (strength === undefined) { strength = 1; } + + Controller.call(this, FX_CONST.BOKEH, gameObject); + + /** + * The radius of the bokeh effect. + * + * This is a float value, where a radius of 0 will result in no effect being applied, + * and a radius of 1 will result in a strong bokeh. However, you can exceed this value + * for even stronger effects. + * + * @name Phaser.FX.Bokeh#radius + * @type {number} + * @since 3.60.0 + */ + this.radius = radius; + + /** + * The amount, or strength, of the bokeh effect. Defaults to 1. + * + * @name Phaser.FX.Bokeh#amount + * @type {number} + * @since 3.60.0 + */ + this.amount = amount; + + /** + * The color contrast, or brightness, of the bokeh effect. Defaults to 0.2. + * + * @name Phaser.FX.Bokeh#contrast + * @type {number} + * @since 3.60.0 + */ + this.contrast = contrast; + + /** + * Is this a Tilt Shift effect or a standard bokeh effect? + * + * @name Phaser.FX.Bokeh#isTiltShift + * @type {boolean} + * @since 3.60.0 + */ + this.isTiltShift = isTiltShift; + + /** + * If a Tilt Shift effect this controls the strength of the blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#strength + * @type {number} + * @since 3.60.0 + */ + this.strength = strength; + + /** + * If a Tilt Shift effect this controls the amount of horizontal blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#blurX + * @type {number} + * @since 3.60.0 + */ + this.blurX = blurX; + + /** + * If a Tilt Shift effect this controls the amount of vertical blur. + * + * Setting this value on a non-Tilt Shift effect will have no effect. + * + * @name Phaser.FX.Bokeh#blurY + * @type {number} + * @since 3.60.0 + */ + this.blurY = blurY; + } + +}); + +module.exports = Bokeh; + + +/***/ }), + +/***/ 6610: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Circle FX Controller. + * + * This FX controller manages the circle effect for a Game Object. + * + * This effect will draw a circle around the texture of the Game Object, effectively masking off + * any area outside of the circle without the need for an actual mask. You can control the thickness + * of the circle, the color of the circle and the color of the background, should the texture be + * transparent. You can also control the feathering applied to the circle, allowing for a harsh or soft edge. + * + * Please note that adding this effect to a Game Object will not change the input area or physics body of + * the Game Object, should it have one. + * + * A Circle effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addCircle(); + * sprite.postFX.addCircle(); + * ``` + * + * @class Circle + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [thickness=8] - The width of the circle around the texture, in pixels. + * @param {number} [color=0xfeedb6] - The color of the circular ring, given as a number value. + * @param {number} [backgroundColor=0xff0000] - The color of the background, behind the texture, given as a number value. + * @param {number} [scale=1] - The scale of the circle. The default scale is 1, which is a circle the full size of the underlying texture. + * @param {number} [feather=0.005] - The amount of feathering to apply to the circle from the ring. + */ +var Circle = new Class({ + + Extends: Controller, + + initialize: + + function Circle (gameObject, thickness, color, backgroundColor, scale, feather) + { + if (thickness === undefined) { thickness = 8; } + if (scale === undefined) { scale = 1; } + if (feather === undefined) { feather = 0.005; } + + Controller.call(this, FX_CONST.CIRCLE, gameObject); + + /** + * The scale of the circle. The default scale is 1, which is a circle + * the full size of the underlying texture. Reduce this value to create + * a smaller circle, or increase it to create a circle that extends off + * the edges of the texture. + * + * @name Phaser.FX.Circle#scale + * @type {number} + * @since 3.60.0 + */ + this.scale = scale; + + /** + * The amount of feathering to apply to the circle from the ring, + * extending into the middle of the circle. The default is 0.005, + * which is a very low amount of feathering just making sure the ring + * has a smooth edge. Increase this amount to a value such as 0.5 + * or 0.025 for larger amounts of feathering. + * + * @name Phaser.FX.Circle#feather + * @type {number} + * @since 3.60.0 + */ + this.feather = feather; + + /** + * The width of the circle around the texture, in pixels. This value + * doesn't factor in the feather, which can extend the thickness + * internally depending on its value. + * + * @name Phaser.FX.Circle#thickness + * @type {number} + * @since 3.60.0 + */ + this.thickness = thickness; + + /** + * The internal gl color array for the ring color. + * + * @name Phaser.FX.Circle#glcolor + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor = [ 1, 0.2, 0.7 ]; + + /** + * The internal gl color array for the background color. + * + * @name Phaser.FX.Circle#glcolor2 + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor2 = [ 1, 0, 0, 0.4 ]; + + if (color !== undefined && color !== null) + { + this.color = color; + } + + if (backgroundColor !== undefined && backgroundColor !== null) + { + this.backgroundColor = backgroundColor; + } + }, + + /** + * The color of the circular ring, given as a number value. + * + * @name Phaser.FX.Circle#color + * @type {number} + * @since 3.60.0 + */ + color: { + + get: function () + { + var color = this.glcolor; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + }, + + /** + * The color of the background, behind the texture, given as a number value. + * + * @name Phaser.FX.Circle#backgroundColor + * @type {number} + * @since 3.60.0 + */ + backgroundColor: { + + get: function () + { + var color = this.glcolor2; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor2; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + } + +}); + +module.exports = Circle; + + +/***/ }), + +/***/ 4931: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var BaseColorMatrix = __webpack_require__(5686); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The ColorMatrix FX Controller. + * + * This FX controller manages the color matrix effect for a Game Object. + * + * The color matrix effect is a visual technique that involves manipulating the colors of an image + * or scene using a mathematical matrix. This process can adjust hue, saturation, brightness, and contrast, + * allowing developers to create various stylistic appearances or mood settings within the game. + * Common applications include simulating different lighting conditions, applying color filters, + * or achieving a specific visual style. + * + * A ColorMatrix effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addColorMatrix(); + * sprite.postFX.addColorMatrix(); + * ``` + * + * @class ColorMatrix + * @extends Phaser.Display.ColorMatrix + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + */ +var ColorMatrix = new Class({ + + Extends: BaseColorMatrix, + + initialize: + + function ColorMatrix (gameObject) + { + BaseColorMatrix.call(this); + + /** + * The FX_CONST type of this effect. + * + * @name Phaser.FX.ColorMatrix#type + * @type {number} + * @since 3.60.0 + */ + this.type = FX_CONST.COLOR_MATRIX; + + /** + * A reference to the Game Object that owns this effect. + * + * @name Phaser.FX.ColorMatrix#gameObject + * @type {Phaser.GameObjects.GameObject} + * @since 3.60.0 + */ + this.gameObject = gameObject; + + /** + * Toggle this boolean to enable or disable this effect, + * without removing and adding it from the Game Object. + * + * @name Phaser.FX.ColorMatrix#active + * @type {boolean} + * @since 3.60.0 + */ + this.active = true; + }, + + destroy: function () + { + this.gameObject = null; + this._matrix = null; + this._data = null; + } + +}); + +module.exports = ColorMatrix; + + +/***/ }), + +/***/ 6128: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * FX Controller is the base class that all built-in FX use. + * + * You should not normally create an instance of this class directly, but instead use one of the built-in FX that extend it. + * + * @class Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {number} type - The FX Type constant. + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + */ +var Controller = new Class({ + + initialize: + + function Controller (type, gameObject) + { + /** + * The FX_CONST type of this effect. + * + * @name Phaser.FX.Controller#type + * @type {number} + * @since 3.60.0 + */ + this.type = type; + + /** + * A reference to the Game Object that owns this effect. + * + * @name Phaser.FX.Controller#gameObject + * @type {Phaser.GameObjects.GameObject} + * @since 3.60.0 + */ + this.gameObject = gameObject; + + /** + * Toggle this boolean to enable or disable this effect, + * without removing and adding it from the Game Object. + * + * Only works for Pre FX. + * + * Post FX are always active. + * + * @name Phaser.FX.Controller#active + * @type {boolean} + * @since 3.60.0 + */ + this.active = true; + }, + + /** + * Sets the active state of this FX Controller. + * + * A disabled FX Controller will not be updated. + * + * @method Phaser.FX.Controller#setActive + * @since 3.60.0 + * + * @param {boolean} value - `true` to enable this FX Controller, or `false` to disable it. + * + * @return {this} This FX Controller instance. + */ + setActive: function (value) + { + this.active = value; + + return this; + }, + + /** + * Destroys this FX Controller. + * + * @method Phaser.FX.Controller#destroy + * @since 3.60.0 + */ + destroy: function () + { + this.gameObject = null; + this.active = false; + } + +}); + +module.exports = Controller; + + +/***/ }), + +/***/ 9195: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Displacement FX Controller. + * + * This FX controller manages the displacement effect for a Game Object. + * + * The displacement effect is a visual technique that alters the position of pixels in an image + * or texture based on the values of a displacement map. This effect is used to create the illusion + * of depth, surface irregularities, or distortion in otherwise flat elements. It can be applied to + * characters, objects, or backgrounds to enhance realism, convey movement, or achieve various + * stylistic appearances. + * + * A Displacement effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addDisplacement(); + * sprite.postFX.addDisplacement(); + * ``` + * + * @class Displacement + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * @param {number} [x=0.005] - The amount of horizontal displacement to apply. A very small float number, such as 0.005. + * @param {number} [y=0.005] - The amount of vertical displacement to apply. A very small float number, such as 0.005. + */ +var Displacement = new Class({ + + Extends: Controller, + + initialize: + + function Displacement (gameObject, texture, x, y) + { + if (texture === undefined) { texture = '__WHITE'; } + if (x === undefined) { x = 0.005; } + if (y === undefined) { y = 0.005; } + + Controller.call(this, FX_CONST.DISPLACEMENT, gameObject); + + /** + * The amount of horizontal displacement to apply. + * + * @name Phaser.FX.Displacement#x + * @type {number} + * @since 3.60.0 + */ + this.x = x; + + /** + * The amount of vertical displacement to apply. + * + * @name Phaser.FX.Displacement#y + * @type {number} + * @since 3.60.0 + */ + this.y = y; + + /** + * The underlying WebGLTexture used for displacement. + * + * @name Phaser.FX.Displacement#glTexture + * @type {WebGLTexture} + * @since 3.60.0 + */ + this.glTexture; + + this.setTexture(texture); + }, + + /** + * Sets the Texture to be used for the displacement effect. + * + * You can only use a whole texture, not a frame from a texture atlas or sprite sheet. + * + * @method Phaser.GameObjects.Components.FX#setTexture + * @since 3.60.0 + * + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * + * @return {this} This FX Controller. + */ + setTexture: function (texture) + { + var phaserTexture = this.gameObject.scene.sys.textures.getFrame(texture); + + if (phaserTexture) + { + this.glTexture = phaserTexture.glTexture; + } + + return this; + } + +}); + +module.exports = Displacement; + + +/***/ }), + +/***/ 445: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Glow FX Controller. + * + * This FX controller manages the glow effect for a Game Object. + * + * The glow effect is a visual technique that creates a soft, luminous halo around game objects, + * characters, or UI elements. This effect is used to emphasize importance, enhance visual appeal, + * or convey a sense of energy, magic, or otherworldly presence. The effect can also be set on + * the inside of the Game Object. The color and strength of the glow can be modified. + * + * A Glow effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addGlow(); + * sprite.postFX.addGlow(); + * ``` + * + * @class Glow + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [color=0xffffff] - The color of the glow effect as a number value. + * @param {number} [outerStrength=4] - The strength of the glow outward from the edge of the Sprite. + * @param {number} [innerStrength=0] - The strength of the glow inward from the edge of the Sprite. + * @param {boolean} [knockout=false] - If `true` only the glow is drawn, not the texture itself. + */ +var Glow = new Class({ + + Extends: Controller, + + initialize: + + function Glow (gameObject, color, outerStrength, innerStrength, knockout) + { + if (outerStrength === undefined) { outerStrength = 4; } + if (innerStrength === undefined) { innerStrength = 0; } + if (knockout === undefined) { knockout = false; } + + Controller.call(this, FX_CONST.GLOW, gameObject); + + /** + * The strength of the glow outward from the edge of the Sprite. + * + * @name Phaser.FX.Glow#outerStrength + * @type {number} + * @since 3.60.0 + */ + this.outerStrength = outerStrength; + + /** + * The strength of the glow inward from the edge of the Sprite. + * + * @name Phaser.FX.Glow#innerStrength + * @type {number} + * @since 3.60.0 + */ + this.innerStrength = innerStrength; + + /** + * If `true` only the glow is drawn, not the texture itself. + * + * @name Phaser.FX.Glow#knockout + * @type {number} + * @since 3.60.0 + */ + this.knockout = knockout; + + /** + * A 4 element array of gl color values. + * + * @name Phaser.FX.Glow#glcolor + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor = [ 1, 1, 1, 1 ]; + + if (color !== undefined) + { + this.color = color; + } + }, + + /** + * The color of the glow as a number value. + * + * @name Phaser.FX.Glow#color + * @type {number} + * @since 3.60.0 + */ + color: { + + get: function () + { + var color = this.glcolor; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + } + +}); + +module.exports = Glow; + + +/***/ }), + +/***/ 7724: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Gradient FX Controller. + * + * This FX controller manages the gradient effect for a Game Object. + * + * The gradient overlay effect is a visual technique where a smooth color transition is applied over Game Objects, + * such as sprites or UI components. This effect is used to enhance visual appeal, emphasize depth, or create + * stylistic and atmospheric variations. It can also be utilized to convey information, such as representing + * progress or health status through color changes. + * + * A Gradient effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addGradient(); + * sprite.postFX.addGradient(); + * ``` + * + * @class Gradient + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [color1=0xff0000] - The first gradient color, given as a number value. + * @param {number} [color2=0x00ff00] - The second gradient color, given as a number value. + * @param {number} [alpha=0.2] - The alpha value of the gradient effect. + * @param {number} [fromX=0] - The horizontal position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [fromY=0] - The vertical position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [toX=0] - The horizontal position the gradient will end at. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [toY=1] - The vertical position the gradient will end at. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [size=0] - How many 'chunks' the gradient is divided in to, as spread over the entire height of the texture. Leave this at zero for a smooth gradient, or set higher for a more retro chunky effect. + */ +var Gradient = new Class({ + + Extends: Controller, + + initialize: + + function Gradient (gameObject, color1, color2, alpha, fromX, fromY, toX, toY, size) + { + if (alpha === undefined) { alpha = 0.2; } + if (fromX === undefined) { fromX = 0; } + if (fromY === undefined) { fromY = 0; } + if (toX === undefined) { toX = 0; } + if (toY === undefined) { toY = 1; } + if (size === undefined) { size = 0; } + + Controller.call(this, FX_CONST.GRADIENT, gameObject); + + /** + * The alpha value of the gradient effect. + * + * @name Phaser.FX.Gradient#alpha + * @type {number} + * @since 3.60.0 + */ + this.alpha = alpha; + + /** + * Sets how many 'chunks' the gradient is divided in to, as spread over the + * entire height of the texture. Leave this at zero for a smooth gradient, + * or set to a higher number to split the gradient into that many sections, giving + * a more banded 'retro' effect. + * + * @name Phaser.FX.Gradient#size + * @type {number} + * @since 3.60.0 + */ + this.size = size; + + /** + * The horizontal position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * + * @name Phaser.FX.Gradient#fromX + * @type {number} + * @since 3.60.0 + */ + this.fromX = fromX; + + /** + * The vertical position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * + * @name Phaser.FX.Gradient#fromY + * @type {number} + * @since 3.60.0 + */ + this.fromY = fromY; + + /** + * The horizontal position the gradient will end. This value is noralized, between 0 and 1 and is not in pixels. + * + * @name Phaser.FX.Gradient#toX + * @type {number} + * @since 3.60.0 + */ + this.toX = toX; + + /** + * The vertical position the gradient will end. This value is noralized, between 0 and 1 and is not in pixels. + * + * @name Phaser.FX.Gradient#toY + * @type {number} + * @since 3.60.0 + */ + this.toY = toY; + + /** + * The internal gl color array for the starting color. + * + * @name Phaser.FX.Gradient#glcolor1 + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor1 = [ 255, 0, 0 ]; + + /** + * The internal gl color array for the ending color. + * + * @name Phaser.FX.Gradient#glcolor2 + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor2 = [ 0, 255, 0 ]; + + if (color1 !== undefined && color1 !== null) + { + this.color1 = color1; + } + + if (color2 !== undefined && color2 !== null) + { + this.color2 = color2; + } + }, + + /** + * The first gradient color, given as a number value. + * + * @name Phaser.FX.Gradient#color1 + * @type {number} + * @since 3.60.0 + */ + color1: { + + get: function () + { + var color = this.glcolor1; + + return (((color[0]) << 16) + ((color[1]) << 8) + (color[2] | 0)); + }, + + set: function (value) + { + var color = this.glcolor1; + + color[0] = ((value >> 16) & 0xFF); + color[1] = ((value >> 8) & 0xFF); + color[2] = (value & 0xFF); + } + + }, + + /** + * The second gradient color, given as a number value. + * + * @name Phaser.FX.Gradient#color2 + * @type {number} + * @since 3.60.0 + */ + color2: { + + get: function () + { + var color = this.glcolor2; + + return (((color[0]) << 16) + ((color[1]) << 8) + (color[2] | 0)); + }, + + set: function (value) + { + var color = this.glcolor2; + + color[0] = ((value >> 16) & 0xFF); + color[1] = ((value >> 8) & 0xFF); + color[2] = (value & 0xFF); + } + + } + +}); + +module.exports = Gradient; + + +/***/ }), + +/***/ 4412: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Pixelate FX Controller. + * + * This FX controller manages the pixelate effect for a Game Object. + * + * The pixelate effect is a visual technique that deliberately reduces the resolution or detail of an image, + * creating a blocky or mosaic appearance composed of large, visible pixels. This effect can be used for stylistic + * purposes, as a homage to retro gaming, or as a means to obscure certain elements within the game, such as + * during a transition or to censor specific content. + * + * A Pixelate effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addPixelate(); + * sprite.postFX.addPixelate(); + * ``` + * + * @class Pixelate + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [amount=1] - The amount of pixelation to apply. + */ +var Pixelate = new Class({ + + Extends: Controller, + + initialize: + + function Pixelate (gameObject, amount) + { + if (amount === undefined) { amount = 1; } + + Controller.call(this, FX_CONST.PIXELATE, gameObject); + + /** + * The amount of pixelation to apply. + * + * @name Phaser.FX.Pixelate#amount + * @type {number} + * @since 3.60.0 + */ + this.amount = amount; + } + +}); + +module.exports = Pixelate; + + +/***/ }), + +/***/ 75: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Shadow FX Controller. + * + * This FX controller manages the shadow effect for a Game Object. + * + * The shadow effect is a visual technique used to create the illusion of depth and realism by adding darker, + * offset silhouettes or shapes beneath game objects, characters, or environments. These simulated shadows + * help to enhance the visual appeal and immersion, making the 2D game world appear more dynamic and three-dimensional. + * + * A Shadow effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addShadow(); + * sprite.postFX.addShadow(); + * ``` + * + * @class Shadow + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [x=0] - The horizontal offset of the shadow effect. + * @param {number} [y=0] - The vertical offset of the shadow effect. + * @param {number} [decay=0.1] - The amount of decay for shadow effect. + * @param {number} [power=1] - The power of the shadow effect. + * @param {number} [color=0x000000] - The color of the shadow. + * @param {number} [samples=6] - The number of samples that the shadow effect will run for. An integer between 1 and 12. + * @param {number} [intensity=1] - The intensity of the shadow effect. + */ +var Shadow = new Class({ + + Extends: Controller, + + initialize: + + function Shadow (gameObject, x, y, decay, power, color, samples, intensity) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (decay === undefined) { decay = 0.1; } + if (power === undefined) { power = 1; } + if (samples === undefined) { samples = 6; } + if (intensity === undefined) { intensity = 1; } + + Controller.call(this, FX_CONST.SHADOW, gameObject); + + /** + * The horizontal offset of the shadow effect. + * + * @name Phaser.FX.Shadow#x + * @type {number} + * @since 3.60.0 + */ + this.x = x; + + /** + * The vertical offset of the shadow effect. + * + * @name Phaser.FX.Shadow#y + * @type {number} + * @since 3.60.0 + */ + this.y = y; + + /** + * The amount of decay for the shadow effect. + * + * @name Phaser.FX.Shadow#decay + * @type {number} + * @since 3.60.0 + */ + this.decay = decay; + + /** + * The power of the shadow effect. + * + * @name Phaser.FX.Shadow#power + * @type {number} + * @since 3.60.0 + */ + this.power = power; + + /** + * The internal gl color array. + * + * @name Phaser.FX.Shadow#glcolor + * @type {number[]} + * @since 3.60.0 + */ + this.glcolor = [ 0, 0, 0, 1 ]; + + /** + * The number of samples that the shadow effect will run for. + * + * This should be an integer with a minimum value of 1 and a maximum of 12. + * + * @name Phaser.FX.Shadow#samples + * @type {number} + * @since 3.60.0 + */ + this.samples = samples; + + /** + * The intensity of the shadow effect. + * + * @name Phaser.FX.Shadow#intensity + * @type {number} + * @since 3.60.0 + */ + this.intensity = intensity; + + if (color !== undefined) + { + this.color = color; + } + }, + + /** + * The color of the shadow. + * + * @name Phaser.FX.Shadow#color + * @type {number} + * @since 3.60.0 + */ + color: { + + get: function () + { + var color = this.glcolor; + + return (((color[0] * 255) << 16) + ((color[1] * 255) << 8) + (color[2] * 255 | 0)); + }, + + set: function (value) + { + var color = this.glcolor; + + color[0] = ((value >> 16) & 0xFF) / 255; + color[1] = ((value >> 8) & 0xFF) / 255; + color[2] = (value & 0xFF) / 255; + } + + } + +}); + +module.exports = Shadow; + + +/***/ }), + +/***/ 8734: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Shine FX Controller. + * + * This FX controller manages the shift effect for a Game Object. + * + * The shine effect is a visual technique that simulates the appearance of reflective + * or glossy surfaces by passing a light beam across a Game Object. This effect is used to + * enhance visual appeal, emphasize certain features, and create a sense of depth or + * material properties. + * + * A Shine effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addShine(); + * sprite.postFX.addShine(); + * ``` + * + * @class Shine + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [speed=0.5] - The speed of the Shine effect. + * @param {number} [lineWidth=0.5] - The line width of the Shine effect. + * @param {number} [gradient=3] - The gradient of the Shine effect. + * @param {boolean} [reveal=false] - Does this Shine effect reveal or get added to its target? + */ +var Shine = new Class({ + + Extends: Controller, + + initialize: + + function Shine (gameObject, speed, lineWidth, gradient, reveal) + { + if (speed === undefined) { speed = 0.5; } + if (lineWidth === undefined) { lineWidth = 0.5; } + if (gradient === undefined) { gradient = 3; } + if (reveal === undefined) { reveal = false; } + + Controller.call(this, FX_CONST.SHINE, gameObject); + + /** + * The speed of the Shine effect. + * + * @name Phaser.FX.Shine#speed + * @type {number} + * @since 3.60.0 + */ + this.speed = speed; + + /** + * The line width of the Shine effect. + * + * @name Phaser.FX.Shine#lineWidth + * @type {number} + * @since 3.60.0 + */ + this.lineWidth = lineWidth; + + /** + * The gradient of the Shine effect. + * + * @name Phaser.FX.Shine#gradient + * @type {number} + * @since 3.60.0 + */ + this.gradient = gradient; + + /** + * Does this Shine effect reveal or get added to its target? + * + * @name Phaser.FX.Shine#reveal + * @type {boolean} + * @since 3.60.0 + */ + this.reveal = reveal; + } + +}); + +module.exports = Shine; + + +/***/ }), + +/***/ 2437: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Vignette FX Controller. + * + * This FX controller manages the vignette effect for a Game Object. + * + * The vignette effect is a visual technique where the edges of the screen, or a Game Object, gradually darken or blur, + * creating a frame-like appearance. This effect is used to draw the player's focus towards the central action or subject, + * enhance immersion, and provide a cinematic or artistic quality to the game's visuals. + * + * A Vignette effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addVignette(); + * sprite.postFX.addVignette(); + * ``` + * + * @class Vignette + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [x=0.5] - The horizontal offset of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [y=0.5] - The vertical offset of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [radius=0.5] - The radius of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [strength=0.5] - The strength of the vignette effect. + */ +var Vignette = new Class({ + + Extends: Controller, + + initialize: + + function Vignette (gameObject, x, y, radius, strength) + { + if (x === undefined) { x = 0.5; } + if (y === undefined) { y = 0.5; } + if (radius === undefined) { radius = 0.5; } + if (strength === undefined) { strength = 0.5; } + + Controller.call(this, FX_CONST.VIGNETTE, gameObject); + + /** + * The horizontal offset of the vignette effect. This value is normalized to the range 0 to 1. + * + * @name Phaser.FX.Vignette#x + * @type {number} + * @since 3.60.0 + */ + this.x = x; + + /** + * The vertical offset of the vignette effect. This value is normalized to the range 0 to 1. + * + * @name Phaser.FX.Vignette#y + * @type {number} + * @since 3.60.0 + */ + this.y = y; + + /** + * The radius of the vignette effect. This value is normalized to the range 0 to 1. + * + * @name Phaser.FX.Vignette#radius + * @type {number} + * @since 3.60.0 + */ + this.radius = radius; + + /** + * The strength of the vignette effect. + * + * @name Phaser.FX.Vignette#strength + * @type {number} + * @since 3.60.0 + */ + this.strength = strength; + } + +}); + +module.exports = Vignette; + + +/***/ }), + +/***/ 5984: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Controller = __webpack_require__(6128); +var FX_CONST = __webpack_require__(1571); + +/** + * @classdesc + * The Wipe FX Controller. + * + * This FX controller manages the wipe effect for a Game Object. + * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * + * A Wipe effect is added to a Game Object via the FX component: + * + * ```js + * const sprite = this.add.sprite(); + * + * sprite.preFX.addWipe(); + * sprite.postFX.addWipe(); + * sprite.preFX.addReveal(); + * sprite.postFX.addReveal(); + * ``` + * + * @class Wipe + * @extends Phaser.FX.Controller + * @memberof Phaser.FX + * @constructor + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx. + * @param {number} [wipeWidth=0.1] - The width of the wipe effect. This value is normalized in the range 0 to 1. + * @param {number} [direction=0] - The direction of the wipe effect. Either 0 or 1. Set in conjunction with the axis property. + * @param {number} [axis=0] - The axis of the wipe effect. Either 0 or 1. Set in conjunction with the direction property. + * @param {boolean} [reveal=false] - Is this a reveal (true) or a fade (false) effect? + */ +var Wipe = new Class({ + + Extends: Controller, + + initialize: + + function Wipe (gameObject, wipeWidth, direction, axis, reveal) + { + if (wipeWidth === undefined) { wipeWidth = 0.1; } + if (direction === undefined) { direction = 0; } + if (axis === undefined) { axis = 0; } + if (reveal === undefined) { reveal = false; } + + Controller.call(this, FX_CONST.WIPE, gameObject); + + /** + * The progress of the Wipe effect. This value is normalized to the range 0 to 1. + * + * Adjust this value to make the wipe transition (i.e. via a Tween) + * + * @name Phaser.FX.Wipe#progress + * @type {number} + * @since 3.60.0 + */ + this.progress = 0; + + /** + * The width of the wipe effect. This value is normalized in the range 0 to 1. + * + * @name Phaser.FX.Wipe#wipeWidth + * @type {number} + * @since 3.60.0 + */ + this.wipeWidth = wipeWidth; + + /** + * The direction of the wipe effect. Either 0 or 1. Set in conjunction with the axis property. + * + * @name Phaser.FX.Wipe#direction + * @type {number} + * @since 3.60.0 + */ + this.direction = direction; + + /** + * The axis of the wipe effect. Either 0 or 1. Set in conjunction with the direction property. + * + * @name Phaser.FX.Wipe#axis + * @type {number} + * @since 3.60.0 + */ + this.axis = axis; + + /** + * Is this a reveal (true) or a fade (false) effect? + * + * @name Phaser.FX.Wipe#reveal + * @type {boolean} + * @since 3.60.0 + */ + this.reveal = reveal; + } + +}); + +module.exports = Wipe; + + +/***/ }), + +/***/ 1571: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FX_CONST = { + + /** + * The Glow FX. + * + * @name Phaser.FX.GLOW + * @type {number} + * @const + * @since 3.60.0 + */ + GLOW: 4, + + /** + * The Shadow FX. + * + * @name Phaser.FX.SHADOW + * @type {number} + * @const + * @since 3.60.0 + */ + SHADOW: 5, + + /** + * The Pixelate FX. + * + * @name Phaser.FX.PIXELATE + * @type {number} + * @const + * @since 3.60.0 + */ + PIXELATE: 6, + + /** + * The Vignette FX. + * + * @name Phaser.FX.VIGNETTE + * @type {number} + * @const + * @since 3.60.0 + */ + VIGNETTE: 7, + + /** + * The Shine FX. + * + * @name Phaser.FX.SHINE + * @type {number} + * @const + * @since 3.60.0 + */ + SHINE: 8, + + /** + * The Blur FX. + * + * @name Phaser.FX.BLUR + * @type {number} + * @const + * @since 3.60.0 + */ + BLUR: 9, // uses 3 shaders, slots 9, 10 and 11 + + /** + * The Gradient FX. + * + * @name Phaser.FX.GRADIENT + * @type {number} + * @const + * @since 3.60.0 + */ + GRADIENT: 12, + + /** + * The Bloom FX. + * + * @name Phaser.FX.BLOOM + * @type {number} + * @const + * @since 3.60.0 + */ + BLOOM: 13, + + /** + * The Color Matrix FX. + * + * @name Phaser.FX.COLOR_MATRIX + * @type {number} + * @const + * @since 3.60.0 + */ + COLOR_MATRIX: 14, + + /** + * The Circle FX. + * + * @name Phaser.FX.CIRCLE + * @type {number} + * @const + * @since 3.60.0 + */ + CIRCLE: 15, + + /** + * The Barrel FX. + * + * @name Phaser.FX.BARREL + * @type {number} + * @const + * @since 3.60.0 + */ + BARREL: 16, + + /** + * The Displacement FX. + * + * @name Phaser.FX.DISPLACEMENT + * @type {number} + * @const + * @since 3.60.0 + */ + DISPLACEMENT: 17, + + /** + * The Wipe FX. + * + * @name Phaser.FX.WIPE + * @type {number} + * @const + * @since 3.60.0 + */ + WIPE: 18, + + /** + * The Bokeh and Tilt Shift FX. + * + * @name Phaser.FX.BOKEH + * @type {number} + * @const + * @since 3.60.0 + */ + BOKEH: 19 + +}; + +module.exports = FX_CONST; + + +/***/ }), + +/***/ 7347: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(1030); +var FX_CONST = __webpack_require__(1571); + +/** + * @namespace Phaser.FX + */ + +var FX = { + + Barrel: __webpack_require__(7340), + Controller: __webpack_require__(6128), + Bloom: __webpack_require__(5170), + Blur: __webpack_require__(4199), + Bokeh: __webpack_require__(3132), + Circle: __webpack_require__(6610), + ColorMatrix: __webpack_require__(4931), + Displacement: __webpack_require__(9195), + Glow: __webpack_require__(445), + Gradient: __webpack_require__(7724), + Pixelate: __webpack_require__(4412), + Shadow: __webpack_require__(75), + Shine: __webpack_require__(8734), + Vignette: __webpack_require__(2437), + Wipe: __webpack_require__(5984) + +}; + +FX = Extend(false, FX, FX_CONST); + +module.exports = FX; + + +/***/ }), + +/***/ 2494: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(8351); +var GetAdvancedValue = __webpack_require__(8361); + +/** + * Builds a Game Object using the provided configuration object. + * + * @function Phaser.GameObjects.BuildGameObject + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene. + * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject. + * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with. + * + * @return {Phaser.GameObjects.GameObject} The built Game Object. + */ +var BuildGameObject = function (scene, gameObject, config) +{ + // Position + + gameObject.x = GetAdvancedValue(config, 'x', 0); + gameObject.y = GetAdvancedValue(config, 'y', 0); + gameObject.depth = GetAdvancedValue(config, 'depth', 0); + + // Flip + + gameObject.flipX = GetAdvancedValue(config, 'flipX', false); + gameObject.flipY = GetAdvancedValue(config, 'flipY', false); + + // Scale + // Either: { scale: 2 } or { scale: { x: 2, y: 2 }} + + var scale = GetAdvancedValue(config, 'scale', null); + + if (typeof scale === 'number') + { + gameObject.setScale(scale); + } + else if (scale !== null) + { + gameObject.scaleX = GetAdvancedValue(scale, 'x', 1); + gameObject.scaleY = GetAdvancedValue(scale, 'y', 1); + } + + // ScrollFactor + // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }} + + var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null); + + if (typeof scrollFactor === 'number') + { + gameObject.setScrollFactor(scrollFactor); + } + else if (scrollFactor !== null) + { + gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1); + gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1); + } + + // Rotation + + gameObject.rotation = GetAdvancedValue(config, 'rotation', 0); + + var angle = GetAdvancedValue(config, 'angle', null); + + if (angle !== null) + { + gameObject.angle = angle; + } + + // Alpha + + gameObject.alpha = GetAdvancedValue(config, 'alpha', 1); + + // Origin + // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }} + + var origin = GetAdvancedValue(config, 'origin', null); + + if (typeof origin === 'number') + { + gameObject.setOrigin(origin); + } + else if (origin !== null) + { + var ox = GetAdvancedValue(origin, 'x', 0.5); + var oy = GetAdvancedValue(origin, 'y', 0.5); + + gameObject.setOrigin(ox, oy); + } + + // BlendMode + + gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL); + + // Visible + + gameObject.visible = GetAdvancedValue(config, 'visible', true); + + // Add to Scene + + var add = GetAdvancedValue(config, 'add', true); + + if (add) + { + scene.sys.displayList.add(gameObject); + } + + if (gameObject.preUpdate) + { + scene.sys.updateList.add(gameObject); + } + + return gameObject; +}; + +module.exports = BuildGameObject; + + +/***/ }), + +/***/ 2273: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var ComponentsToJSON = __webpack_require__(6125); +var DataManager = __webpack_require__(1081); +var EventEmitter = __webpack_require__(4399); +var Events = __webpack_require__(3389); +var SceneEvents = __webpack_require__(204); + +/** + * @classdesc + * The base class that all Game Objects extend. + * You don't create GameObjects directly and they cannot be added to the display list. + * Instead, use them as the base for your own custom classes. + * + * @class GameObject + * @memberof Phaser.GameObjects + * @extends Phaser.Events.EventEmitter + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. + * @param {string} type - A textual representation of the type of Game Object, i.e. `sprite`. + */ +var GameObject = new Class({ + + Extends: EventEmitter, + + initialize: + + function GameObject (scene, type) + { + EventEmitter.call(this); + + /** + * A reference to the Scene to which this Game Object belongs. + * + * Game Objects can only belong to one Scene. + * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. + * + * @name Phaser.GameObjects.GameObject#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * Holds a reference to the Display List that contains this Game Object. + * + * This is set automatically when this Game Object is added to a Scene or Layer. + * + * You should treat this property as being read-only. + * + * @name Phaser.GameObjects.GameObject#displayList + * @type {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} + * @default null + * @since 3.50.0 + */ + this.displayList = null; + + /** + * A textual representation of this Game Object, i.e. `sprite`. + * Used internally by Phaser but is available for your own custom classes to populate. + * + * @name Phaser.GameObjects.GameObject#type + * @type {string} + * @since 3.0.0 + */ + this.type = type; + + /** + * The current state of this Game Object. + * + * Phaser itself will never modify this value, although plugins may do so. + * + * Use this property to track the state of a Game Object during its lifetime. For example, it could change from + * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant + * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * + * @name Phaser.GameObjects.GameObject#state + * @type {(number|string)} + * @since 3.16.0 + */ + this.state = 0; + + /** + * The parent Container of this Game Object, if it has one. + * + * @name Phaser.GameObjects.GameObject#parentContainer + * @type {Phaser.GameObjects.Container} + * @since 3.4.0 + */ + this.parentContainer = null; + + /** + * The name of this Game Object. + * Empty by default and never populated by Phaser, this is left for developers to use. + * + * @name Phaser.GameObjects.GameObject#name + * @type {string} + * @default '' + * @since 3.0.0 + */ + this.name = ''; + + /** + * The active state of this Game Object. + * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. + * An active object is one which is having its logic and internal systems updated. + * + * @name Phaser.GameObjects.GameObject#active + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.active = true; + + /** + * The Tab Index of the Game Object. + * Reserved for future use by plugins and the Input Manager. + * + * @name Phaser.GameObjects.GameObject#tabIndex + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.tabIndex = -1; + + /** + * A Data Manager. + * It allows you to store, query and get key/value paired information specific to this Game Object. + * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. + * + * @name Phaser.GameObjects.GameObject#data + * @type {Phaser.Data.DataManager} + * @default null + * @since 3.0.0 + */ + this.data = null; + + /** + * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. + * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. + * If those components are not used by your custom class then you can use this bitmask as you wish. + * + * @name Phaser.GameObjects.GameObject#renderFlags + * @type {number} + * @default 15 + * @since 3.0.0 + */ + this.renderFlags = 15; + + /** + * A bitmask that controls if this Game Object is drawn by a Camera or not. + * Not usually set directly, instead call `Camera.ignore`, however you can + * set this property directly using the Camera.id property: + * + * @example + * this.cameraFilter |= camera.id + * + * @name Phaser.GameObjects.GameObject#cameraFilter + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.cameraFilter = 0; + + /** + * If this Game Object is enabled for input then this property will contain an InteractiveObject instance. + * Not usually set directly. Instead call `GameObject.setInteractive()`. + * + * @name Phaser.GameObjects.GameObject#input + * @type {?Phaser.Types.Input.InteractiveObject} + * @default null + * @since 3.0.0 + */ + this.input = null; + + /** + * If this Game Object is enabled for Arcade or Matter Physics then this property will contain a reference to a Physics Body. + * + * @name Phaser.GameObjects.GameObject#body + * @type {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|MatterJS.BodyType)} + * @default null + * @since 3.0.0 + */ + this.body = null; + + /** + * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`. + * This includes calls that may come from a Group, Container or the Scene itself. + * While it allows you to persist a Game Object across Scenes, please understand you are entirely + * responsible for managing references to and from this Game Object. + * + * @name Phaser.GameObjects.GameObject#ignoreDestroy + * @type {boolean} + * @default false + * @since 3.5.0 + */ + this.ignoreDestroy = false; + + this.on(Events.ADDED_TO_SCENE, this.addedToScene, this); + this.on(Events.REMOVED_FROM_SCENE, this.removedFromScene, this); + + // Tell the Scene to re-sort the children + scene.sys.queueDepthSort(); + }, + + /** + * Sets the `active` property of this Game Object and returns this Game Object for further chaining. + * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList. + * + * @method Phaser.GameObjects.GameObject#setActive + * @since 3.0.0 + * + * @param {boolean} value - True if this Game Object should be set as active, false if not. + * + * @return {this} This GameObject. + */ + setActive: function (value) + { + this.active = value; + + return this; + }, + + /** + * Sets the `name` property of this Game Object and returns this Game Object for further chaining. + * The `name` property is not populated by Phaser and is presented for your own use. + * + * @method Phaser.GameObjects.GameObject#setName + * @since 3.0.0 + * + * @param {string} value - The name to be given to this Game Object. + * + * @return {this} This GameObject. + */ + setName: function (value) + { + this.name = value; + + return this; + }, + + /** + * Sets the current state of this Game Object. + * + * Phaser itself will never modify the State of a Game Object, although plugins may do so. + * + * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. + * The state value should typically be an integer (ideally mapped to a constant + * in your game code), but could also be a string. It is recommended to keep it light and simple. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * + * @method Phaser.GameObjects.GameObject#setState + * @since 3.16.0 + * + * @param {(number|string)} value - The state of the Game Object. + * + * @return {this} This GameObject. + */ + setState: function (value) + { + this.state = value; + + return this; + }, + + /** + * Adds a Data Manager component to this Game Object. + * + * @method Phaser.GameObjects.GameObject#setDataEnabled + * @since 3.0.0 + * @see Phaser.Data.DataManager + * + * @return {this} This GameObject. + */ + setDataEnabled: function () + { + if (!this.data) + { + this.data = new DataManager(this); + } + + return this; + }, + + /** + * Allows you to store a key value pair within this Game Objects Data Manager. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * sprite.setData('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `getData`: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * sprite.data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * + * @method Phaser.GameObjects.GameObject#setData + * @since 3.0.0 + * + * @generic {any} T + * @genericUse {(string|T)} - [key] + * + * @param {(string|object)} key - The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. + * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored. + * + * @return {this} This GameObject. + */ + setData: function (key, value) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.set(key, value); + + return this; + }, + + /** + * Increase a value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is increased from 0. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * @method Phaser.GameObjects.GameObject#incData + * @since 3.23.0 + * + * @generic {any} T + * @genericUse {(string|T)} - [key] + * + * @param {(string|object)} key - The key to increase the value for. + * @param {*} [data] - The value to increase for the given key. + * + * @return {this} This GameObject. + */ + incData: function (key, value) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.inc(key, value); + + return this; + }, + + /** + * Toggle a boolean value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is toggled from false. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * @method Phaser.GameObjects.GameObject#toggleData + * @since 3.23.0 + * + * @generic {any} T + * @genericUse {(string|T)} - [key] + * + * @param {(string|object)} key - The key to toggle the value for. + * + * @return {this} This GameObject. + */ + toggleData: function (key) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.toggle(key); + + return this; + }, + + /** + * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * sprite.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * sprite.getData([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.GameObjects.GameObject#getData + * @since 3.0.0 + * + * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys. + * + * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array. + */ + getData: function (key) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + return this.data.get(key); + }, + + /** + * Pass this Game Object to the Input Manager to enable it for Input. + * + * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area + * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced + * input detection. + * + * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If + * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific + * shape for it to use. + * + * You can also provide an Input Configuration Object as the only argument to this method. + * + * @example + * sprite.setInteractive(); + * + * @example + * sprite.setInteractive(new Phaser.Geom.Circle(45, 46, 45), Phaser.Geom.Circle.Contains); + * + * @example + * graphics.setInteractive(new Phaser.Geom.Rectangle(0, 0, 128, 128), Phaser.Geom.Rectangle.Contains); + * + * @method Phaser.GameObjects.GameObject#setInteractive + * @since 3.0.0 + * + * @param {(Phaser.Types.Input.InputConfiguration|any)} [hitArea] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not given it will try to create a Rectangle based on the texture frame. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The callback that determines if the pointer is within the Hit Area shape or not. If you provide a shape you must also provide a callback. + * @param {boolean} [dropZone=false] - Should this Game Object be treated as a drop zone target? + * + * @return {this} This GameObject. + */ + setInteractive: function (hitArea, hitAreaCallback, dropZone) + { + this.scene.sys.input.enable(this, hitArea, hitAreaCallback, dropZone); + + return this; + }, + + /** + * If this Game Object has previously been enabled for input, this will disable it. + * + * An object that is disabled for input stops processing or being considered for + * input events, but can be turned back on again at any time by simply calling + * `setInteractive()` with no arguments provided. + * + * If want to completely remove interaction from this Game Object then use `removeInteractive` instead. + * + * @method Phaser.GameObjects.GameObject#disableInteractive + * @since 3.7.0 + * + * @return {this} This GameObject. + */ + disableInteractive: function () + { + this.scene.sys.input.disable(this); + + return this; + }, + + /** + * If this Game Object has previously been enabled for input, this will queue it + * for removal, causing it to no longer be interactive. The removal happens on + * the next game step, it is not immediate. + * + * The Interactive Object that was assigned to this Game Object will be destroyed, + * removed from the Input Manager and cleared from this Game Object. + * + * If you wish to re-enable this Game Object at a later date you will need to + * re-create its InteractiveObject by calling `setInteractive` again. + * + * If you wish to only temporarily stop an object from receiving input then use + * `disableInteractive` instead, as that toggles the interactive state, where-as + * this erases it completely. + * + * If you wish to resize a hit area, don't remove and then set it as being + * interactive. Instead, access the hitarea object directly and resize the shape + * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the + * shape is a Rectangle, which it is by default.) + * + * @method Phaser.GameObjects.GameObject#removeInteractive + * @since 3.7.0 + * + * @return {this} This GameObject. + */ + removeInteractive: function () + { + this.scene.sys.input.clear(this); + + this.input = undefined; + + return this; + }, + + /** + * This callback is invoked when this Game Object is added to a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to add themselves into the Update List. + * + * You can also listen for the `ADDED_TO_SCENE` event from this Game Object. + * + * @method Phaser.GameObjects.GameObject#addedToScene + * @since 3.50.0 + */ + addedToScene: function () + { + }, + + /** + * This callback is invoked when this Game Object is removed from a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to removed themselves from the Update List. + * + * You can also listen for the `REMOVED_FROM_SCENE` event from this Game Object. + * + * @method Phaser.GameObjects.GameObject#removedFromScene + * @since 3.50.0 + */ + removedFromScene: function () + { + }, + + /** + * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. + * + * @method Phaser.GameObjects.GameObject#update + * @since 3.0.0 + * + * @param {...*} [args] - args + */ + update: function () + { + }, + + /** + * Returns a JSON representation of the Game Object. + * + * @method Phaser.GameObjects.GameObject#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ + toJSON: function () + { + return ComponentsToJSON(this); + }, + + /** + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * Also checks the Game Object against the given Cameras exclusion list. + * + * @method Phaser.GameObjects.GameObject#willRender + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object. + * + * @return {boolean} True if the Game Object should be rendered, otherwise false. + */ + willRender: function (camera) + { + var listWillRender = (this.displayList && this.displayList.active) ? this.displayList.willRender(camera) : true; + + return !(!listWillRender || GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); + }, + + /** + * Returns an array containing the display list index of either this Game Object, or if it has one, + * its parent Container. It then iterates up through all of the parent containers until it hits the + * root of the display list (which is index 0 in the returned array). + * + * Used internally by the InputPlugin but also useful if you wish to find out the display depth of + * this Game Object and all of its ancestors. + * + * @method Phaser.GameObjects.GameObject#getIndexList + * @since 3.4.0 + * + * @return {number[]} An array of display list position indexes. + */ + getIndexList: function () + { + // eslint-disable-next-line consistent-this + var child = this; + var parent = this.parentContainer; + + var indexes = []; + + while (parent) + { + indexes.unshift(parent.getIndex(child)); + + child = parent; + + if (!parent.parentContainer) + { + break; + } + else + { + parent = parent.parentContainer; + } + } + + if (this.displayList) + { + indexes.unshift(this.displayList.getIndex(child)); + } + else + { + indexes.unshift(this.scene.sys.displayList.getIndex(child)); + } + + return indexes; + }, + + /** + * Adds this Game Object to the given Display List. + * + * If no Display List is specified, it will default to the Display List owned by the Scene to which + * this Game Object belongs. + * + * A Game Object can only exist on one Display List at any given time, but may move freely between them. + * + * If this Game Object is already on another Display List when this method is called, it will first + * be removed from it, before being added to the new list. + * + * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. + * + * If a Game Object isn't on any display list, it will not be rendered. If you just wish to temporarly + * disable it from rendering, consider using the `setVisible` method, instead. + * + * @method Phaser.GameObjects.GameObject#addToDisplayList + * @fires Phaser.Scenes.Events#ADDED_TO_SCENE + * @fires Phaser.GameObjects.Events#ADDED_TO_SCENE + * @since 3.53.0 + * + * @param {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} [displayList] - The Display List to add to. Defaults to the Scene Display List. + * + * @return {this} This Game Object. + */ + addToDisplayList: function (displayList) + { + if (displayList === undefined) { displayList = this.scene.sys.displayList; } + + if (this.displayList && this.displayList !== displayList) + { + this.removeFromDisplayList(); + } + + // Don't repeat if it's already on this list + if (!displayList.exists(this)) + { + this.displayList = displayList; + + displayList.add(this, true); + + displayList.queueDepthSort(); + + this.emit(Events.ADDED_TO_SCENE, this, this.scene); + + displayList.events.emit(SceneEvents.ADDED_TO_SCENE, this, this.scene); + } + + return this; + }, + + /** + * Adds this Game Object to the Update List belonging to the Scene. + * + * When a Game Object is added to the Update List it will have its `preUpdate` method called + * every game frame. This method is passed two parameters: `delta` and `time`. + * + * If you wish to run your own logic within `preUpdate` then you should always call + * `super.preUpdate(delta, time)` within it, or it may fail to process required operations, + * such as Sprite animations. + * + * @method Phaser.GameObjects.GameObject#addToUpdateList + * @since 3.53.0 + * + * @return {this} This Game Object. + */ + addToUpdateList: function () + { + if (this.scene && this.preUpdate) + { + this.scene.sys.updateList.add(this); + } + + return this; + }, + + /** + * Removes this Game Object from the Display List it is currently on. + * + * A Game Object can only exist on one Display List at any given time, but may move freely removed + * and added back at a later stage. + * + * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. + * + * If a Game Object isn't on any Display List, it will not be rendered. If you just wish to temporarly + * disable it from rendering, consider using the `setVisible` method, instead. + * + * @method Phaser.GameObjects.GameObject#removeFromDisplayList + * @fires Phaser.Scenes.Events#REMOVED_FROM_SCENE + * @fires Phaser.GameObjects.Events#REMOVED_FROM_SCENE + * @since 3.53.0 + * + * @return {this} This Game Object. + */ + removeFromDisplayList: function () + { + var displayList = this.displayList || this.scene.sys.displayList; + + if (displayList && displayList.exists(this)) + { + displayList.remove(this, true); + + displayList.queueDepthSort(); + + this.displayList = null; + + this.emit(Events.REMOVED_FROM_SCENE, this, this.scene); + + displayList.events.emit(SceneEvents.REMOVED_FROM_SCENE, this, this.scene); + } + + return this; + }, + + /** + * Removes this Game Object from the Scene's Update List. + * + * When a Game Object is on the Update List, it will have its `preUpdate` method called + * every game frame. Calling this method will remove it from the list, preventing this. + * + * Removing a Game Object from the Update List will stop most internal functions working. + * For example, removing a Sprite from the Update List will prevent it from being able to + * run animations. + * + * @method Phaser.GameObjects.GameObject#removeFromUpdateList + * @since 3.53.0 + * + * @return {this} This Game Object. + */ + removeFromUpdateList: function () + { + if (this.scene && this.preUpdate) + { + this.scene.sys.updateList.remove(this); + } + + return this; + }, + + /** + * Destroys this Game Object removing it from the Display List and Update List and + * severing all ties to parent resources. + * + * Also removes itself from the Input Manager and Physics Manager if previously enabled. + * + * Use this to remove a Game Object from your game if you don't ever plan to use it again. + * As long as no reference to it exists within your own code it should become free for + * garbage collection by the browser. + * + * If you just want to temporarily disable an object then look at using the + * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. + * + * @method Phaser.GameObjects.GameObject#destroy + * @fires Phaser.GameObjects.Events#DESTROY + * @since 3.0.0 + * + * @param {boolean} [fromScene=false] - `True` if this Game Object is being destroyed by the Scene, `false` if not. + */ + destroy: function (fromScene) + { + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) + { + return; + } + + if (fromScene === undefined) { fromScene = false; } + + if (this.preDestroy) + { + this.preDestroy.call(this); + } + + this.emit(Events.DESTROY, this, fromScene); + + this.removeAllListeners(); + + if (this.postPipelines) + { + this.resetPostPipeline(true); + } + + this.removeFromDisplayList(); + this.removeFromUpdateList(); + + if (this.input) + { + this.scene.sys.input.clear(this); + + this.input = undefined; + } + + if (this.data) + { + this.data.destroy(); + + this.data = undefined; + } + + if (this.body) + { + this.body.destroy(); + + this.body = undefined; + } + + if (this.preFX) + { + this.preFX.destroy(); + + this.preFX = undefined; + } + + if (this.postFX) + { + this.postFX.destroy(); + + this.postFX = undefined; + } + + this.active = false; + this.visible = false; + + this.scene = undefined; + this.parentContainer = undefined; + } + +}); + +/** + * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. + * + * @constant {number} RENDER_MASK + * @memberof Phaser.GameObjects.GameObject + * @default + */ +GameObject.RENDER_MASK = 15; + +module.exports = GameObject; + + +/***/ }), + +/***/ 3649: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var PluginCache = __webpack_require__(8456); +var SceneEvents = __webpack_require__(204); + +/** + * @classdesc + * The Game Object Factory is a Scene plugin that allows you to quickly create many common + * types of Game Objects and have them automatically registered with the Scene. + * + * Game Objects directly register themselves with the Factory and inject their own creation + * methods into the class. + * + * @class GameObjectFactory + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object Factory belongs. + */ +var GameObjectFactory = new Class({ + + initialize: + + function GameObjectFactory (scene) + { + /** + * The Scene to which this Game Object Factory belongs. + * + * @name Phaser.GameObjects.GameObjectFactory#scene + * @type {Phaser.Scene} + * @protected + * @since 3.0.0 + */ + this.scene = scene; + + /** + * A reference to the Scene.Systems. + * + * @name Phaser.GameObjects.GameObjectFactory#systems + * @type {Phaser.Scenes.Systems} + * @protected + * @since 3.0.0 + */ + this.systems = scene.sys; + + /** + * A reference to the Scene Event Emitter. + * + * @name Phaser.GameObjects.GameObjectFactory#events + * @type {Phaser.Events.EventEmitter} + * @protected + * @since 3.50.0 + */ + this.events = scene.sys.events; + + /** + * A reference to the Scene Display List. + * + * @name Phaser.GameObjects.GameObjectFactory#displayList + * @type {Phaser.GameObjects.DisplayList} + * @protected + * @since 3.0.0 + */ + this.displayList; + + /** + * A reference to the Scene Update List. + * + * @name Phaser.GameObjects.GameObjectFactory#updateList + * @type {Phaser.GameObjects.UpdateList} + * @protected + * @since 3.0.0 + */ + this.updateList; + + this.events.once(SceneEvents.BOOT, this.boot, this); + this.events.on(SceneEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.GameObjects.GameObjectFactory#boot + * @private + * @since 3.5.1 + */ + boot: function () + { + this.displayList = this.systems.displayList; + this.updateList = this.systems.updateList; + + this.events.once(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.GameObjects.GameObjectFactory#start + * @private + * @since 3.5.0 + */ + start: function () + { + this.events.once(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * Adds an existing Game Object to this Scene. + * + * If the Game Object renders, it will be added to the Display List. + * If it has a `preUpdate` method, it will be added to the Update List. + * + * @method Phaser.GameObjects.GameObjectFactory#existing + * @since 3.0.0 + * + * @generic {(Phaser.GameObjects.GameObject|Phaser.GameObjects.Group|Phaser.GameObjects.Layer)} G - [child,$return] + * + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.Group|Phaser.GameObjects.Layer)} child - The child to be added to this Scene. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was added. + */ + existing: function (child) + { + if (child.renderCanvas || child.renderWebGL) + { + this.displayList.add(child); + } + + // For when custom objects have overridden `preUpdate` but don't hook into the ADDED_TO_SCENE event: + // Adding to the list multiple times is safe, as it won't add duplicates into the list anyway. + if (child.preUpdate) + { + this.updateList.add(child); + } + + return child; + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.GameObjects.GameObjectFactory#shutdown + * @private + * @since 3.0.0 + */ + shutdown: function () + { + this.events.off(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.GameObjects.GameObjectFactory#destroy + * @private + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.events.off(SceneEvents.START, this.start, this); + + this.scene = null; + this.systems = null; + this.events = null; + + this.displayList = null; + this.updateList = null; + } + +}); + +/** + * Static method called directly by the Game Object factory functions. + * With this method you can register a custom GameObject factory in the GameObjectFactory, + * providing a name (`factoryType`) and the constructor (`factoryFunction`) in order + * to be called when you call to Phaser.Scene.add[ factoryType ] method. + * + * @method Phaser.GameObjects.GameObjectFactory.register + * @static + * @since 3.0.0 + * + * @param {string} factoryType - The key of the factory that you will use to call to Phaser.Scene.add[ factoryType ] method. + * @param {function} factoryFunction - The constructor function to be called when you invoke to the Phaser.Scene.add method. + */ +GameObjectFactory.register = function (factoryType, factoryFunction) +{ + if (!GameObjectFactory.prototype.hasOwnProperty(factoryType)) + { + GameObjectFactory.prototype[factoryType] = factoryFunction; + } +}; + +/** + * Static method called directly by the Game Object factory functions. + * With this method you can remove a custom GameObject factory registered in the GameObjectFactory, + * providing a its `factoryType`. + * + * @method Phaser.GameObjects.GameObjectFactory.remove + * @static + * @since 3.0.0 + * + * @param {string} factoryType - The key of the factory that you want to remove from the GameObjectFactory. + */ +GameObjectFactory.remove = function (factoryType) +{ + if (GameObjectFactory.prototype.hasOwnProperty(factoryType)) + { + delete GameObjectFactory.prototype[factoryType]; + } +}; + +PluginCache.register('GameObjectFactory', GameObjectFactory, 'add'); + +module.exports = GameObjectFactory; + + +/***/ }), + +/***/ 2208: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var TransformMatrix = __webpack_require__(4227); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); + +var result = { camera: tempMatrix1, sprite: tempMatrix2, calc: tempMatrix3 }; + +/** + * Calculates the Transform Matrix of the given Game Object and Camera, factoring in + * the parent matrix if provided. + * + * Note that the object this results contains _references_ to the Transform Matrices, + * not new instances of them. Therefore, you should use their values immediately, or + * copy them to your own matrix, as they will be replaced as soon as another Game + * Object is rendered. + * + * @function Phaser.GameObjects.GetCalcMatrix + * @memberof Phaser.GameObjects + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} src - The Game Object to calculate the transform matrix for. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera being used to render the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - The transform matrix of the parent container, if any. + * + * @return {Phaser.Types.GameObjects.GetCalcMatrixResults} The results object containing the updated transform matrices. + */ +var GetCalcMatrix = function (src, camera, parentMatrix) +{ + var camMatrix = tempMatrix1; + var spriteMatrix = tempMatrix2; + var calcMatrix = tempMatrix3; + + spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = src.x; + spriteMatrix.f = src.y; + } + else + { + spriteMatrix.e -= camera.scrollX * src.scrollFactorX; + spriteMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + + return result; +}; + +module.exports = GetCalcMatrix; + + +/***/ }), + +/***/ 4344: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(2915); + +// bitmask flag for GameObject.renderMask +var _FLAG = 2; // 0010 + +/** + * Provides methods used for setting the alpha properties of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Alpha + * @since 3.0.0 + */ + +var Alpha = { + + /** + * Private internal value. Holds the global alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alpha + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alpha: 1, + + /** + * Private internal value. Holds the top-left alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaTL + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaTL: 1, + + /** + * Private internal value. Holds the top-right alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaTR + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaTR: 1, + + /** + * Private internal value. Holds the bottom-left alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaBL + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaBL: 1, + + /** + * Private internal value. Holds the bottom-right alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaBR + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaBR: 1, + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + * + * @method Phaser.GameObjects.Components.Alpha#clearAlpha + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + clearAlpha: function () + { + return this.setAlpha(1); + }, + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * + * @method Phaser.GameObjects.Components.Alpha#setAlpha + * @since 3.0.0 + * + * @param {number} [topLeft=1] - The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. + * @param {number} [topRight] - The alpha value used for the top-right of the Game Object. WebGL only. + * @param {number} [bottomLeft] - The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param {number} [bottomRight] - The alpha value used for the bottom-right of the Game Object. WebGL only. + * + * @return {this} This Game Object instance. + */ + setAlpha: function (topLeft, topRight, bottomLeft, bottomRight) + { + if (topLeft === undefined) { topLeft = 1; } + + // Treat as if there is only one alpha value for the whole Game Object + if (topRight === undefined) + { + this.alpha = topLeft; + } + else + { + this._alphaTL = Clamp(topLeft, 0, 1); + this._alphaTR = Clamp(topRight, 0, 1); + this._alphaBL = Clamp(bottomLeft, 0, 1); + this._alphaBR = Clamp(bottomRight, 0, 1); + } + + return this; + }, + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + * + * @name Phaser.GameObjects.Components.Alpha#alpha + * @type {number} + * @since 3.0.0 + */ + alpha: { + + get: function () + { + return this._alpha; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alpha = v; + this._alphaTL = v; + this._alphaTR = v; + this._alphaBL = v; + this._alphaBR = v; + + if (v === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaTopLeft + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaTopLeft: { + + get: function () + { + return this._alphaTL; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaTL = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaTopRight + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaTopRight: { + + get: function () + { + return this._alphaTR; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaTR = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaBottomLeft + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaBottomLeft: { + + get: function () + { + return this._alphaBL; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaBL = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaBottomRight + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaBottomRight: { + + get: function () + { + return this._alphaBR; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaBR = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + } + +}; + +module.exports = Alpha; + + +/***/ }), + +/***/ 4518: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(2915); + +// bitmask flag for GameObject.renderMask +var _FLAG = 2; // 0010 + +/** + * Provides methods used for setting the alpha property of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.AlphaSingle + * @since 3.22.0 + */ + +var AlphaSingle = { + + /** + * Private internal value. Holds the global alpha value. + * + * @name Phaser.GameObjects.Components.AlphaSingle#_alpha + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alpha: 1, + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + * + * @method Phaser.GameObjects.Components.AlphaSingle#clearAlpha + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + clearAlpha: function () + { + return this.setAlpha(1); + }, + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * @method Phaser.GameObjects.Components.AlphaSingle#setAlpha + * @since 3.0.0 + * + * @param {number} [value=1] - The alpha value applied across the whole Game Object. + * + * @return {this} This Game Object instance. + */ + setAlpha: function (value) + { + if (value === undefined) { value = 1; } + + this.alpha = value; + + return this; + }, + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + * + * @name Phaser.GameObjects.Components.AlphaSingle#alpha + * @type {number} + * @since 3.0.0 + */ + alpha: { + + get: function () + { + return this._alpha; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alpha = v; + + if (v === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + } + +}; + +module.exports = AlphaSingle; + + +/***/ }), + +/***/ 5173: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(8351); + +/** + * Provides methods used for setting the blend mode of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.BlendMode + * @since 3.0.0 + */ + +var BlendMode = { + + /** + * Private internal value. Holds the current blend mode. + * + * @name Phaser.GameObjects.Components.BlendMode#_blendMode + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + _blendMode: BlendModes.NORMAL, + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * NORMAL + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + * + * @name Phaser.GameObjects.Components.BlendMode#blendMode + * @type {(Phaser.BlendModes|string|number)} + * @since 3.0.0 + */ + blendMode: { + + get: function () + { + return this._blendMode; + }, + + set: function (value) + { + if (typeof value === 'string') + { + value = BlendModes[value]; + } + + value |= 0; + + if (value >= -1) + { + this._blendMode = value; + } + } + + }, + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * NORMAL + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * + * @method Phaser.GameObjects.Components.BlendMode#setBlendMode + * @since 3.0.0 + * + * @param {(string|Phaser.BlendModes|number)} value - The BlendMode value. Either a string, a CONST or a number. + * + * @return {this} This Game Object instance. + */ + setBlendMode: function (value) + { + this.blendMode = value; + + return this; + } + +}; + +module.exports = BlendMode; + + +/***/ }), + +/***/ 1991: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for calculating and setting the size of a non-Frame based Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.ComputedSize + * @since 3.0.0 + */ + +var ComputedSize = { + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + * + * @name Phaser.GameObjects.Components.ComputedSize#width + * @type {number} + * @since 3.0.0 + */ + width: 0, + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + * + * @name Phaser.GameObjects.Components.ComputedSize#height + * @type {number} + * @since 3.0.0 + */ + height: 0, + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.ComputedSize#displayWidth + * @type {number} + * @since 3.0.0 + */ + displayWidth: { + + get: function () + { + return this.scaleX * this.width; + }, + + set: function (value) + { + this.scaleX = value / this.width; + } + + }, + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.ComputedSize#displayHeight + * @type {number} + * @since 3.0.0 + */ + displayHeight: { + + get: function () + { + return this.scaleY * this.height; + }, + + set: function (value) + { + this.scaleY = value / this.height; + } + + }, + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Components.ComputedSize#setSize + * @since 3.4.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setSize: function (width, height) + { + this.width = width; + this.height = height; + + return this; + }, + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * + * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize + * @since 3.4.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDisplaySize: function (width, height) + { + this.displayWidth = width; + this.displayHeight = height; + + return this; + } + +}; + +module.exports = ComputedSize; + + +/***/ }), + +/***/ 8305: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the texture of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Crop + * @since 3.12.0 + */ + +var Crop = { + + /** + * The Texture this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Crop#texture + * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} + * @since 3.0.0 + */ + texture: null, + + /** + * The Texture Frame this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Crop#frame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + frame: null, + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + * + * @name Phaser.GameObjects.Components.Crop#isCropped + * @type {boolean} + * @since 3.11.0 + */ + isCropped: false, + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * + * @method Phaser.GameObjects.Components.Crop#setCrop + * @since 3.11.0 + * + * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param {number} [y] - The y coordinate to start the crop from. + * @param {number} [width] - The width of the crop rectangle in pixels. + * @param {number} [height] - The height of the crop rectangle in pixels. + * + * @return {this} This Game Object instance. + */ + setCrop: function (x, y, width, height) + { + if (x === undefined) + { + this.isCropped = false; + } + else if (this.frame) + { + if (typeof x === 'number') + { + this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY); + } + else + { + var rect = x; + + this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY); + } + + this.isCropped = true; + } + + return this; + }, + + /** + * Internal method that returns a blank, well-formed crop object for use by a Game Object. + * + * @method Phaser.GameObjects.Components.Crop#resetCropObject + * @private + * @since 3.12.0 + * + * @return {object} The crop object. + */ + resetCropObject: function () + { + return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 }; + } + +}; + +module.exports = Crop; + + +/***/ }), + +/***/ 3131: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the depth of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Depth + * @since 3.0.0 + */ + +var Depth = { + + /** + * Private internal value. Holds the depth of the Game Object. + * + * @name Phaser.GameObjects.Components.Depth#_depth + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + _depth: 0, + + /** + * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * + * @name Phaser.GameObjects.Components.Depth#depth + * @type {number} + * @since 3.0.0 + */ + depth: { + + get: function () + { + return this._depth; + }, + + set: function (value) + { + if (this.displayList) + { + this.displayList.queueDepthSort(); + } + + this._depth = value; + } + + }, + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * + * @method Phaser.GameObjects.Components.Depth#setDepth + * @since 3.0.0 + * + * @param {number} value - The depth of this Game Object. Ensure this value is only ever a number data-type. + * + * @return {this} This Game Object instance. + */ + setDepth: function (value) + { + if (value === undefined) { value = 0; } + + this.depth = value; + + return this; + } + +}; + +module.exports = Depth; + + +/***/ }), + +/***/ 1626: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Effects = __webpack_require__(7347); +var SpliceOne = __webpack_require__(8935); + +/** + * @classdesc + * The FX Component features a set of methods used for applying a range of special built-in effects to a Game Object. + * + * The effects include the following: + * + * * Barrel Distortion + * * Bloom + * * Blur + * * Bokeh / Tilt Shift + * * Circle Outline + * * Color Matrix + * * Glow + * * Displacement + * * Gradient + * * Pixelate + * * Shine + * * Shadow + * * Vignette + * * Wipe / Reveal + * + * All Game Objects support Post FX. These are effects applied after the Game Object has been rendered. + * + * Texture-based Game Objects also support Pre FX, including: + * + * * Image + * * Sprite + * * TileSprite + * * Text + * * RenderTexture + * * Video + * + * And any Game Object that extends the above. + * + * The difference between Pre FX and Post FX are that all Post FX take place in a canvas (renderer) sized frame buffer, + * after the Game Object has been rendered. Pre FX, however, take place in a texture sized frame buffer, which is sized + * based on the Game Object itself. The end result is then composited back to the main game canvas. For intensive effects, + * such as blur, bloom or glow, which can require many iterations, this is a much more efficient way to apply the effect, + * as only it only has to work on a Game Object sized texture and not all pixels in the canvas. + * + * In short, you should always try and use a Pre FX if you can. + * + * Due to the way that FX work they can be stacked-up. For example, you can apply a blur to a Game Object, then apply + * a bloom effect to the same Game Object. The bloom effect will be applied to the blurred texture, not the original. + * Keep the order in mind when stacking effects. + * + * All effects are WebGL only and do not have canvas counterparts. + * + * As you can appreciate, some effects are more expensive than others. For example, a bloom effect is going to be more + * expensive than a simple color matrix effect, so please consider using them wisely and performance test your target + * platforms early on in production. + * + * This component is created automatically by the `PostPipeline` class and does not need to be instantiated directly. + * + * @class FX + * @memberof Phaser.GameObjects.Components + * @constructor + * @since 3.60.0 + * @webglOnly + * + * @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that owns this FX Component. + * @param {boolean} isPost - Is this a Pre or Post FX Component? + */ +var FX = new Class({ + + initialize: + + function FX (gameObject, isPost) + { + /** + * A reference to the Game Object that owns this FX Component. + * + * @name Phaser.GameObjects.Components.FX#gameObject + * @type {Phaser.GameObjects.GameObject} + * @readonly + * @since 3.60.0 + */ + this.gameObject = gameObject; + + /** + * Is this a Post FX Controller? or a Pre FX Controller? + * + * @name Phaser.GameObjects.Components.FX#isPost + * @type {boolean} + * @readonly + * @since 3.60.0 + */ + this.isPost = isPost; + + /** + * Has this FX Component been enabled? + * + * You should treat this property as read-only, although it is toggled + * automaticaly during internal use. + * + * @name Phaser.GameObjects.Components.FX#enabled + * @type {boolean} + * @since 3.60.0 + */ + this.enabled = false; + + /** + * An array containing all of the Pre FX Controllers that + * have been added to this FX Component. They are processed in + * the order they are added. + * + * This array is empty if this is a Post FX Component. + * + * @name Phaser.GameObjects.Components.FX#list + * @type {Phaser.FX.Controller[]} + * @since 3.60.0 + */ + this.list = []; + + /** + * The amount of extra padding to be applied to this Game Object + * when it is being rendered by a PreFX Pipeline. + * + * Lots of FX require additional spacing added to the texture the + * Game Object uses, for example a glow or shadow effect, and this + * method allows you to control how much extra padding is included + * in addition to the texture size. + * + * You do not need to set this if you're only using Post FX. + * + * @name Phaser.GameObjects.Components.FX#padding + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.padding = 0; + }, + + /** + * Sets the amount of extra padding to be applied to this Game Object + * when it is being rendered by a PreFX Pipeline. + * + * Lots of FX require additional spacing added to the texture the + * Game Object uses, for example a glow or shadow effect, and this + * method allows you to control how much extra padding is included + * in addition to the texture size. + * + * You do not need to set this if you're only using Post FX. + * + * @method Phaser.GameObjects.Components.FX#setPadding + * @webglOnly + * @since 3.60.0 + * + * @param {number} [padding=0] - The amount of padding to add to this Game Object. + * + * @return {this} This Game Object instance. + */ + setPadding: function (padding) + { + if (padding === undefined) { padding = 0; } + + this.padding = padding; + + return this.gameObject; + }, + + /** + * This callback is invoked when this Game Object is copied by a PreFX Pipeline. + * + * This happens when the pipeline uses its `copySprite` method. + * + * It's invoked prior to the copy, allowing you to set shader uniforms, etc on the pipeline. + * + * @method Phaser.GameObjects.Components.FX#onFXCopy + * @since 3.60.0 + * + * @param {Phaser.Renderer.WebGL.Pipelines.PreFXPipeline} pipeline - The PreFX Pipeline that invoked this callback. + */ + onFXCopy: function () + { + }, + + /** + * This callback is invoked when this Game Object is rendered by a PreFX Pipeline. + * + * This happens when the pipeline uses its `drawSprite` method. + * + * It's invoked prior to the draw, allowing you to set shader uniforms, etc on the pipeline. + * + * @method Phaser.GameObjects.Components.FX#onFX + * @since 3.60.0 + * + * @param {Phaser.Renderer.WebGL.Pipelines.PreFXPipeline} pipeline - The PreFX Pipeline that invoked this callback. + */ + onFX: function () + { + }, + + /** + * Enables this FX Component and applies the FXPipeline to the parent Game Object. + * + * This is called automatically whenever you call a method such as `addBloom`, etc. + * + * You can check the `enabled` property to see if the Game Object is already enabled, or not. + * + * This only applies to Pre FX. Post FX are always enabled. + * + * @method Phaser.GameObjects.Components.FX#enable + * @since 3.60.0 + * + * @param {number} [padding=0] - The amount of padding to add to this Game Object. + */ + enable: function (padding) + { + if (this.isPost) + { + return; + } + + var renderer = this.gameObject.scene.sys.renderer; + + if (renderer && renderer.pipelines) + { + this.gameObject.pipeline = renderer.pipelines.FX_PIPELINE; + + if (padding !== undefined) + { + this.padding = padding; + } + + this.enabled = true; + } + else + { + this.enabled = false; + } + }, + + /** + * Destroys and removes all FX Controllers that are part of this FX Component, + * then disables it. + * + * If this is a Pre FX Component it will only remove Pre FX. + * If this is a Post FX Component it will only remove Post FX. + * + * To remove both at once use the `GameObject.clearFX` method instead. + * + * @method Phaser.GameObjects.Components.FX#clear + * @since 3.60.0 + * + * @return {this} This Game Object instance. + */ + clear: function () + { + if (this.isPost) + { + this.gameObject.resetPostPipeline(true); + } + else + { + var list = this.list; + + for (var i = 0; i < list.length; i++) + { + list[i].destroy(); + } + + this.list = []; + } + + this.enabled = false; + + return this.gameObject; + }, + + /** + * Searches for the given FX Controller within this FX Component. + * + * If found, the controller is removed from this component and then destroyed. + * + * @method Phaser.GameObjects.Components.FX#remove + * @since 3.60.0 + * + * @generic {Phaser.FX.Controller} T + * @genericUse {T} - [fx] + * + * @param {Phaser.FX.Controller} fx - The FX Controller to remove from this FX Component. + * + * @return {this} This Game Object instance. + */ + remove: function (fx) + { + var i; + + if (this.isPost) + { + var pipelines = this.gameObject.getPostPipeline(String(fx.type)); + + if (!Array.isArray(pipelines)) + { + pipelines = [ pipelines ]; + } + + for (i = 0; i < pipelines.length; i++) + { + var pipeline = pipelines[i]; + + if (pipeline.controller === fx) + { + this.gameObject.removePostPipeline(pipeline); + + fx.destroy(); + + break; + } + } + } + else + { + var list = this.list; + + for (i = 0; i < list.length; i++) + { + if (list[i] === fx) + { + SpliceOne(list, i); + + fx.destroy(); + } + } + } + + return this.gameObject; + }, + + /** + * Disables this FX Component. + * + * This will reset the pipeline on the Game Object that owns this component back to its + * default and flag this component as disabled. + * + * You can re-enable it again by calling `enable` for Pre FX or by adding an FX for Post FX. + * + * Optionally, set `clear` to destroy all current FX Controllers. + * + * @method Phaser.GameObjects.Components.FX#disable + * @since 3.60.0 + * + * @param {boolean} [clear=false] - Destroy and remove all FX Controllers that are part of this component. + * + * @return {this} This Game Object instance. + */ + disable: function (clear) + { + if (clear === undefined) { clear = false; } + + if (!this.isPost) + { + this.gameObject.resetPipeline(); + } + + this.enabled = false; + + if (clear) + { + this.clear(); + } + + return this.gameObject; + }, + + /** + * Adds the given FX Controler to this FX Component. + * + * Note that adding an FX Controller does not remove any existing FX. They all stack-up + * on-top of each other. If you don't want this, make sure to call either `remove` or + * `clear` first. + * + * @method Phaser.GameObjects.Components.FX#add + * @since 3.60.0 + * + * @generic {Phaser.FX.Controller} T + * @genericUse {T} - [fx] + * + * @param {Phaser.FX.Controller} fx - The FX Controller to add to this FX Component. + * @param {object} [config] - Optional configuration object that is passed to the pipeline during instantiation. + * + * @return {Phaser.FX.Controller} The FX Controller. + */ + add: function (fx, config) + { + if (this.isPost) + { + var type = String(fx.type); + + this.gameObject.setPostPipeline(type, config); + + var pipeline = this.gameObject.getPostPipeline(type); + + if (pipeline) + { + if (Array.isArray(pipeline)) + { + pipeline = pipeline.pop(); + } + + pipeline.controller = fx; + + return fx; + } + } + else + { + if (!this.enabled) + { + this.enable(); + } + + this.list.push(fx); + + return fx; + } + }, + + /** + * Adds a Glow effect. + * + * The glow effect is a visual technique that creates a soft, luminous halo around game objects, + * characters, or UI elements. This effect is used to emphasize importance, enhance visual appeal, + * or convey a sense of energy, magic, or otherworldly presence. The effect can also be set on + * the inside of the Game Object. The color and strength of the glow can be modified. + * + * @method Phaser.GameObjects.Components.FX#addGlow + * @since 3.60.0 + * + * @param {number} [color=0xffffff] - The color of the glow effect as a number value. + * @param {number} [outerStrength=4] - The strength of the glow outward from the edge of the Sprite. + * @param {number} [innerStrength=0] - The strength of the glow inward from the edge of the Sprite. + * @param {boolean} [knockout=false] - If `true` only the glow is drawn, not the texture itself. + * @param {number} [quality=0.1] - Only available for PostFX. Sets the quality of this Glow effect. Default is 0.1. Cannot be changed post-creation. + * @param {number} [distance=10] - Only available for PostFX. Sets the distance of this Glow effect. Default is 10. Cannot be changed post-creation. + * + * @return {Phaser.FX.Glow} The Glow FX Controller. + */ + addGlow: function (color, outerStrength, innerStrength, knockout, quality, distance) + { + return this.add(new Effects.Glow(this.gameObject, color, outerStrength, innerStrength, knockout), { quality: quality, distance: distance }); + }, + + /** + * Adds a Shadow effect. + * + * The shadow effect is a visual technique used to create the illusion of depth and realism by adding darker, + * offset silhouettes or shapes beneath game objects, characters, or environments. These simulated shadows + * help to enhance the visual appeal and immersion, making the 2D game world appear more dynamic and three-dimensional. + * + * @method Phaser.GameObjects.Components.FX#addShadow + * @since 3.60.0 + * + * @param {number} [x=0] - The horizontal offset of the shadow effect. + * @param {number} [y=0] - The vertical offset of the shadow effect. + * @param {number} [decay=0.1] - The amount of decay for shadow effect. + * @param {number} [power=1] - The power of the shadow effect. + * @param {number} [color=0x000000] - The color of the shadow. + * @param {number} [samples=6] - The number of samples that the shadow effect will run for. An integer between 1 and 12. + * @param {number} [intensity=1] - The intensity of the shadow effect. + * + * @return {Phaser.FX.Shadow} The Shadow FX Controller. + */ + addShadow: function (x, y, decay, power, color, samples, intensity) + { + return this.add(new Effects.Shadow(this.gameObject, x, y, decay, power, color, samples, intensity)); + }, + + /** + * Adds a Pixelate effect. + * + * The pixelate effect is a visual technique that deliberately reduces the resolution or detail of an image, + * creating a blocky or mosaic appearance composed of large, visible pixels. This effect can be used for stylistic + * purposes, as a homage to retro gaming, or as a means to obscure certain elements within the game, such as + * during a transition or to censor specific content. + * + * @method Phaser.GameObjects.Components.FX#addPixelate + * @since 3.60.0 + * + * @param {number} [amount=1] - The amount of pixelation to apply. + * + * @return {Phaser.FX.Pixelate} The Pixelate FX Controller. + */ + addPixelate: function (amount) + { + return this.add(new Effects.Pixelate(this.gameObject, amount)); + }, + + /** + * Adds a Vignette effect. + * + * The vignette effect is a visual technique where the edges of the screen, or a Game Object, gradually darken or blur, + * creating a frame-like appearance. This effect is used to draw the player's focus towards the central action or subject, + * enhance immersion, and provide a cinematic or artistic quality to the game's visuals. + * + * @method Phaser.GameObjects.Components.FX#addVignette + * @since 3.60.0 + * + * @param {number} [x=0.5] - The horizontal offset of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [y=0.5] - The vertical offset of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [radius=0.5] - The radius of the vignette effect. This value is normalized to the range 0 to 1. + * @param {number} [strength=0.5] - The strength of the vignette effect. + * + * @return {Phaser.FX.Vignette} The Vignette FX Controller. + */ + addVignette: function (x, y, radius, strength) + { + return this.add(new Effects.Vignette(this.gameObject, x, y, radius, strength)); + }, + + /** + * Adds a Shine effect. + * + * The shine effect is a visual technique that simulates the appearance of reflective + * or glossy surfaces by passing a light beam across a Game Object. This effect is used to + * enhance visual appeal, emphasize certain features, and create a sense of depth or + * material properties. + * + * @method Phaser.GameObjects.Components.FX#addShine + * @since 3.60.0 + * + * @param {number} [speed=0.5] - The speed of the Shine effect. + * @param {number} [lineWidth=0.5] - The line width of the Shine effect. + * @param {number} [gradient=3] - The gradient of the Shine effect. + * @param {boolean} [reveal=false] - Does this Shine effect reveal or get added to its target? + * + * @return {Phaser.FX.Shine} The Shine FX Controller. + */ + addShine: function (speed, lineWidth, gradient, reveal) + { + return this.add(new Effects.Shine(this.gameObject, speed, lineWidth, gradient, reveal)); + }, + + /** + * Adds a Blur effect. + * + * A Gaussian blur is the result of blurring an image by a Gaussian function. It is a widely used effect, + * typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a + * smooth blur resembling that of viewing the image through a translucent screen, distinctly different + * from the bokeh effect produced by an out-of-focus lens or the shadow of an object under usual illumination. + * + * @method Phaser.GameObjects.Components.FX#addBlur + * @since 3.60.0 + * + * @param {number} [quality=0] - The quality of the blur effect. Can be either 0 for Low Quality, 1 for Medium Quality or 2 for High Quality. + * @param {number} [x=2] - The horizontal offset of the blur effect. + * @param {number} [y=2] - The vertical offset of the blur effect. + * @param {number} [strength=1] - The strength of the blur effect. + * @param {number} [color=0xffffff] - The color of the blur, as a hex value. + * @param {number} [steps=4] - The number of steps to run the blur effect for. This value should always be an integer. + * + * @return {Phaser.FX.Blur} The Blur FX Controller. + */ + addBlur: function (quality, x, y, strength, color, steps) + { + return this.add(new Effects.Blur(this.gameObject, quality, x, y, strength, color, steps)); + }, + + /** + * Adds a Gradient effect. + * + * The gradient overlay effect is a visual technique where a smooth color transition is applied over Game Objects, + * such as sprites or UI components. This effect is used to enhance visual appeal, emphasize depth, or create + * stylistic and atmospheric variations. It can also be utilized to convey information, such as representing + * progress or health status through color changes. + * + * @method Phaser.GameObjects.Components.FX#addGradient + * @since 3.60.0 + * + * @param {number} [color1=0xff0000] - The first gradient color, given as a number value. + * @param {number} [color2=0x00ff00] - The second gradient color, given as a number value. + * @param {number} [alpha=0.2] - The alpha value of the gradient effect. + * @param {number} [fromX=0] - The horizontal position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [fromY=0] - The vertical position the gradient will start from. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [toX=0] - The horizontal position the gradient will end at. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [toY=1] - The vertical position the gradient will end at. This value is noralized, between 0 and 1 and is not in pixels. + * @param {number} [size=0] - How many 'chunks' the gradient is divided in to, as spread over the entire height of the texture. Leave this at zero for a smooth gradient, or set higher for a more retro chunky effect. + * + * @return {Phaser.FX.Gradient} The Gradient FX Controller. + */ + addGradient: function (color1, color2, alpha, fromX, fromY, toX, toY, size) + { + return this.add(new Effects.Gradient(this.gameObject, color1, color2, alpha, fromX, fromY, toX, toY, size)); + }, + + /** + * Adds a Bloom effect. + * + * Bloom is an effect used to reproduce an imaging artifact of real-world cameras. + * The effect produces fringes of light extending from the borders of bright areas in an image, + * contributing to the illusion of an extremely bright light overwhelming the + * camera or eye capturing the scene. + * + * @method Phaser.GameObjects.Components.FX#addBloom + * @since 3.60.0 + * + * @param {number} [color] - The color of the Bloom, as a hex value. + * @param {number} [offsetX=1] - The horizontal offset of the bloom effect. + * @param {number} [offsetY=1] - The vertical offset of the bloom effect. + * @param {number} [blurStrength=1] - The strength of the blur process of the bloom effect. + * @param {number} [strength=1] - The strength of the blend process of the bloom effect. + * @param {number} [steps=4] - The number of steps to run the Bloom effect for. This value should always be an integer. + * + * @return {Phaser.FX.Bloom} The Bloom FX Controller. + */ + addBloom: function (color, offsetX, offsetY, blurStrength, strength, steps) + { + return this.add(new Effects.Bloom(this.gameObject, color, offsetX, offsetY, blurStrength, strength, steps)); + }, + + /** + * Adds a ColorMatrix effect. + * + * The color matrix effect is a visual technique that involves manipulating the colors of an image + * or scene using a mathematical matrix. This process can adjust hue, saturation, brightness, and contrast, + * allowing developers to create various stylistic appearances or mood settings within the game. + * Common applications include simulating different lighting conditions, applying color filters, + * or achieving a specific visual style. + * + * @method Phaser.GameObjects.Components.FX#addColorMatrix + * @since 3.60.0 + * + * @return {Phaser.FX.ColorMatrix} The ColorMatrix FX Controller. + */ + addColorMatrix: function () + { + return this.add(new Effects.ColorMatrix(this.gameObject)); + }, + + /** + * Adds a Circle effect. + * + * This effect will draw a circle around the texture of the Game Object, effectively masking off + * any area outside of the circle without the need for an actual mask. You can control the thickness + * of the circle, the color of the circle and the color of the background, should the texture be + * transparent. You can also control the feathering applied to the circle, allowing for a harsh or soft edge. + * + * Please note that adding this effect to a Game Object will not change the input area or physics body of + * the Game Object, should it have one. + * + * @method Phaser.GameObjects.Components.FX#addCircle + * @since 3.60.0 + * + * @param {number} [thickness=8] - The width of the circle around the texture, in pixels. + * @param {number} [color=0xfeedb6] - The color of the circular ring, given as a number value. + * @param {number} [backgroundColor=0xff0000] - The color of the background, behind the texture, given as a number value. + * @param {number} [scale=1] - The scale of the circle. The default scale is 1, which is a circle the full size of the underlying texture. + * @param {number} [feather=0.005] - The amount of feathering to apply to the circle from the ring. + * + * @return {Phaser.FX.Circle} The Circle FX Controller. + */ + addCircle: function (thickness, color, backgroundColor, scale, feather) + { + return this.add(new Effects.Circle(this.gameObject, thickness, color, backgroundColor, scale, feather)); + }, + + /** + * Adds a Barrel effect. + * + * A barrel effect allows you to apply either a 'pinch' or 'expand' distortion to + * a Game Object. The amount of the effect can be modified in real-time. + * + * @method Phaser.GameObjects.Components.FX#addBarrel + * @since 3.60.0 + * + * @param {number} [amount=1] - The amount of distortion applied to the barrel effect. A value of 1 is no distortion. Typically keep this within +- 1. + * + * @return {Phaser.FX.Barrel} The Barrel FX Controller. + */ + addBarrel: function (amount) + { + return this.add(new Effects.Barrel(this.gameObject, amount)); + }, + + /** + * Adds a Displacement effect. + * + * The displacement effect is a visual technique that alters the position of pixels in an image + * or texture based on the values of a displacement map. This effect is used to create the illusion + * of depth, surface irregularities, or distortion in otherwise flat elements. It can be applied to + * characters, objects, or backgrounds to enhance realism, convey movement, or achieve various + * stylistic appearances. + * + * @method Phaser.GameObjects.Components.FX#addDisplacement + * @since 3.60.0 + * + * @param {string} [texture='__WHITE'] - The unique string-based key of the texture to use for displacement, which must exist in the Texture Manager. + * @param {number} [x=0.005] - The amount of horizontal displacement to apply. A very small float number, such as 0.005. + * @param {number} [y=0.005] - The amount of vertical displacement to apply. A very small float number, such as 0.005. + * + * @return {Phaser.FX.Displacement} The Displacement FX Controller. + */ + addDisplacement: function (texture, x, y) + { + return this.add(new Effects.Displacement(this.gameObject, texture, x, y)); + }, + + /** + * Adds a Wipe effect. + * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * + * @method Phaser.GameObjects.Components.FX#addWipe + * @since 3.60.0 + * + * @param {number} [wipeWidth=0.1] - The width of the wipe effect. This value is normalized in the range 0 to 1. + * @param {number} [direction=0] - The direction of the wipe effect. Either 0 or 1. Set in conjunction with the axis property. + * @param {number} [axis=0] - The axis of the wipe effect. Either 0 or 1. Set in conjunction with the direction property. + * + * @return {Phaser.FX.Wipe} The Wipe FX Controller. + */ + addWipe: function (wipeWidth, direction, axis) + { + return this.add(new Effects.Wipe(this.gameObject, wipeWidth, direction, axis)); + }, + + /** + * Adds a Reveal Wipe effect. + * + * The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements + * in the game, such as images, text, or scene transitions. This effect is often used to create + * a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition + * between game states. + * + * You can set both the direction and the axis of the wipe effect. The following combinations are possible: + * + * * left to right: direction 0, axis 0 + * * right to left: direction 1, axis 0 + * * top to bottom: direction 1, axis 1 + * * bottom to top: direction 1, axis 0 + * + * It is up to you to set the `progress` value yourself, i.e. via a Tween, in order to transition the effect. + * + * @method Phaser.GameObjects.Components.FX#addReveal + * @since 3.60.0 + * + * @param {number} [wipeWidth=0.1] - The width of the wipe effect. This value is normalized in the range 0 to 1. + * @param {number} [direction=0] - The direction of the wipe effect. Either 0 or 1. Set in conjunction with the axis property. + * @param {number} [axis=0] - The axis of the wipe effect. Either 0 or 1. Set in conjunction with the direction property. + * + * @return {Phaser.FX.Wipe} The Wipe FX Controller. + */ + addReveal: function (wipeWidth, direction, axis) + { + return this.add(new Effects.Wipe(this.gameObject, wipeWidth, direction, axis, true)); + }, + + /** + * Adds a Bokeh effect. + * + * Bokeh refers to a visual effect that mimics the photographic technique of creating a shallow depth of field. + * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground + * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering + * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. + * + * See also Tilt Shift. + * + * @method Phaser.GameObjects.Components.FX#addBokeh + * @since 3.60.0 + * + * @param {number} [radius=0.5] - The radius of the bokeh effect. + * @param {number} [amount=1] - The amount of the bokeh effect. + * @param {number} [contrast=0.2] - The color contrast of the bokeh effect. + * + * @return {Phaser.FX.Bokeh} The Bokeh FX Controller. + */ + addBokeh: function (radius, amount, contrast) + { + return this.add(new Effects.Bokeh(this.gameObject, radius, amount, contrast)); + }, + + /** + * Adds a Tilt Shift effect. + * + * This Bokeh effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature + * effect by blurring everything except a small area of the image. This effect is achieved by blurring the + * top and bottom elements, while keeping the center area in focus. + * + * See also Bokeh. + * + * @method Phaser.GameObjects.Components.FX#addTiltShift + * @since 3.60.0 + * + * @param {number} [radius=0.5] - The radius of the bokeh effect. + * @param {number} [amount=1] - The amount of the bokeh effect. + * @param {number} [contrast=0.2] - The color contrast of the bokeh effect. + * @param {number} [blurX=1] - The amount of horizontal blur. + * @param {number} [blurY=1] - The amount of vertical blur. + * @param {number} [strength=1] - The strength of the blur. + * + * @return {Phaser.FX.Bokeh} The Bokeh TiltShift FX Controller. + */ + addTiltShift: function (radius, amount, contrast, blurX, blurY, strength) + { + return this.add(new Effects.Bokeh(this.gameObject, radius, amount, contrast, true, blurX, blurY, strength)); + }, + + /** + * Destroys this FX Component. + * + * Called automatically when Game Objects are destroyed. + * + * @method Phaser.GameObjects.Components.FX#destroy + * @since 3.60.0 + */ + destroy: function () + { + this.clear(); + + this.gameObject = null; + } + +}); + +module.exports = FX; + + +/***/ }), + +/***/ 9660: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for visually flipping a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Flip + * @since 3.0.0 + */ + +var Flip = { + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @name Phaser.GameObjects.Components.Flip#flipX + * @type {boolean} + * @default false + * @since 3.0.0 + */ + flipX: false, + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @name Phaser.GameObjects.Components.Flip#flipY + * @type {boolean} + * @default false + * @since 3.0.0 + */ + flipY: false, + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#toggleFlipX + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + toggleFlipX: function () + { + this.flipX = !this.flipX; + + return this; + }, + + /** + * Toggles the vertical flipped state of this Game Object. + * + * @method Phaser.GameObjects.Components.Flip#toggleFlipY + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + toggleFlipY: function () + { + this.flipY = !this.flipY; + + return this; + }, + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#setFlipX + * @since 3.0.0 + * + * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlipX: function (value) + { + this.flipX = value; + + return this; + }, + + /** + * Sets the vertical flipped state of this Game Object. + * + * @method Phaser.GameObjects.Components.Flip#setFlipY + * @since 3.0.0 + * + * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlipY: function (value) + { + this.flipY = value; + + return this; + }, + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#setFlip + * @since 3.0.0 + * + * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlip: function (x, y) + { + this.flipX = x; + this.flipY = y; + + return this; + }, + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + * + * @method Phaser.GameObjects.Components.Flip#resetFlip + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + resetFlip: function () + { + this.flipX = false; + this.flipY = false; + + return this; + } + +}; + +module.exports = Flip; + + +/***/ }), + +/***/ 3671: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(1392); +var RotateAround = __webpack_require__(9876); +var Vector2 = __webpack_require__(2529); + +/** + * Provides methods used for obtaining the bounds of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.GetBounds + * @since 3.0.0 + */ + +var GetBounds = { + + /** + * Processes the bounds output vector before returning it. + * + * @method Phaser.GameObjects.Components.GetBounds#prepareBoundsOutput + * @private + * @since 3.18.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} output - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + prepareBoundsOutput: function (output, includeParent) + { + if (includeParent === undefined) { includeParent = false; } + + if (this.rotation !== 0) + { + RotateAround(output, this.x, this.y, this.rotation); + } + + if (includeParent && this.parentContainer) + { + var parentMatrix = this.parentContainer.getBoundsTransformMatrix(); + + parentMatrix.transformPoint(output.x, output.y, output); + } + + return output; + }, + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getCenter + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getCenter: function (output, includeParent) + { + if (output === undefined) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX) + (this.displayWidth / 2); + output.y = this.y - (this.displayHeight * this.originY) + (this.displayHeight / 2); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getTopLeft + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getTopLeft: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX); + output.y = this.y - (this.displayHeight * this.originY); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getTopCenter + * @since 3.18.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getTopCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2); + output.y = this.y - (this.displayHeight * this.originY); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getTopRight + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getTopRight: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; + output.y = this.y - (this.displayHeight * this.originY); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getLeftCenter + * @since 3.18.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getLeftCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX); + output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getRightCenter + * @since 3.18.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getRightCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; + output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getBottomLeft + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getBottomLeft: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX); + output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getBottomCenter + * @since 3.18.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getBottomCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2); + output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * + * @method Phaser.GameObjects.Components.GetBounds#getBottomRight + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} O - [output,$return] + * + * @param {Phaser.Types.Math.Vector2Like} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {Phaser.Types.Math.Vector2Like} The values stored in the output object. + */ + getBottomRight: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; + output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bounds of this Game Object, regardless of origin. + * + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * + * @method Phaser.GameObjects.Components.GetBounds#getBounds + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [output,$return] + * + * @param {(Phaser.Geom.Rectangle|object)} [output] - An object to store the values in. If not provided a new Rectangle will be created. + * + * @return {(Phaser.Geom.Rectangle|object)} The values stored in the output object. + */ + getBounds: function (output) + { + if (output === undefined) { output = new Rectangle(); } + + // We can use the output object to temporarily store the x/y coords in: + + var TLx, TLy, TRx, TRy, BLx, BLy, BRx, BRy; + + // Instead of doing a check if parent container is + // defined per corner we only do it once. + if (this.parentContainer) + { + var parentMatrix = this.parentContainer.getBoundsTransformMatrix(); + + this.getTopLeft(output); + parentMatrix.transformPoint(output.x, output.y, output); + + TLx = output.x; + TLy = output.y; + + this.getTopRight(output); + parentMatrix.transformPoint(output.x, output.y, output); + + TRx = output.x; + TRy = output.y; + + this.getBottomLeft(output); + parentMatrix.transformPoint(output.x, output.y, output); + + BLx = output.x; + BLy = output.y; + + this.getBottomRight(output); + parentMatrix.transformPoint(output.x, output.y, output); + + BRx = output.x; + BRy = output.y; + } + else + { + this.getTopLeft(output); + + TLx = output.x; + TLy = output.y; + + this.getTopRight(output); + + TRx = output.x; + TRy = output.y; + + this.getBottomLeft(output); + + BLx = output.x; + BLy = output.y; + + this.getBottomRight(output); + + BRx = output.x; + BRy = output.y; + } + + output.x = Math.min(TLx, TRx, BLx, BRx); + output.y = Math.min(TLy, TRy, BLy, BRy); + output.width = Math.max(TLx, TRx, BLx, BRx) - output.x; + output.height = Math.max(TLy, TRy, BLy, BRy) - output.y; + + return output; + } + +}; + +module.exports = GetBounds; + + +/***/ }), + +/***/ 2246: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BitmapMask = __webpack_require__(7499); +var GeometryMask = __webpack_require__(6726); + +/** + * Provides methods used for getting and setting the mask of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Mask + * @since 3.0.0 + */ + +var Mask = { + + /** + * The Mask this Game Object is using during render. + * + * @name Phaser.GameObjects.Components.Mask#mask + * @type {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} + * @since 3.0.0 + */ + mask: null, + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * + * @method Phaser.GameObjects.Components.Mask#setMask + * @since 3.6.2 + * + * @param {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} mask - The mask this Game Object will use when rendering. + * + * @return {this} This Game Object instance. + */ + setMask: function (mask) + { + this.mask = mask; + + return this; + }, + + /** + * Clears the mask that this Game Object was using. + * + * @method Phaser.GameObjects.Components.Mask#clearMask + * @since 3.6.2 + * + * @param {boolean} [destroyMask=false] - Destroy the mask before clearing it? + * + * @return {this} This Game Object instance. + */ + clearMask: function (destroyMask) + { + if (destroyMask === undefined) { destroyMask = false; } + + if (destroyMask && this.mask) + { + this.mask.destroy(); + } + + this.mask = null; + + return this; + }, + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one, or a Dynamic Texture. + * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable texture-based Game Object. + * + * @method Phaser.GameObjects.Components.Mask#createBitmapMask + * @since 3.6.2 + * + * @generic {Phaser.GameObjects.GameObject} G + * @generic {Phaser.Textures.DynamicTexture} T + * @genericUse {(G|T|null)} [maskObject] + * + * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Dynamic Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. + * @param {number} [x] - If creating a Game Object, the horizontal position in the world. + * @param {number} [y] - If creating a Game Object, the vertical position in the world. + * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created. + */ + createBitmapMask: function (maskObject, x, y, texture, frame) + { + if (maskObject === undefined && (this.texture || this.shader || this.geom)) + { + // eslint-disable-next-line consistent-this + maskObject = this; + } + + return new BitmapMask(this.scene, maskObject, x, y, texture, frame); + }, + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * + * @method Phaser.GameObjects.Components.Mask#createGeometryMask + * @since 3.6.2 + * + * @generic {Phaser.GameObjects.Graphics} G + * @generic {Phaser.GameObjects.Shape} S + * @genericUse {(G|S)} [graphics] + * + * @param {Phaser.GameObjects.Graphics|Phaser.GameObjects.Shape} [graphics] - A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask. + * + * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. + */ + createGeometryMask: function (graphics) + { + if (graphics === undefined && (this.type === 'Graphics' || this.geom)) + { + // eslint-disable-next-line consistent-this + graphics = this; + } + + return new GeometryMask(this.scene, graphics); + } + +}; + +module.exports = Mask; + + +/***/ }), + +/***/ 5085: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the origin of a Game Object. + * Values are normalized, given in the range 0 to 1. + * Display values contain the calculated pixel values. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Origin + * @since 3.0.0 + */ + +var Origin = { + + /** + * A property indicating that a Game Object has this component. + * + * @name Phaser.GameObjects.Components.Origin#_originComponent + * @type {boolean} + * @private + * @default true + * @since 3.2.0 + */ + _originComponent: true, + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + * Set this value with `setOrigin()`. + * + * @name Phaser.GameObjects.Components.Origin#originX + * @type {number} + * @readonly + * @default 0.5 + * @since 3.0.0 + */ + originX: 0.5, + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + * Set this value with `setOrigin()`. + * + * @name Phaser.GameObjects.Components.Origin#originY + * @type {number} + * @readonly + * @default 0.5 + * @since 3.0.0 + */ + originY: 0.5, + + // private + read only + _displayOriginX: 0, + _displayOriginY: 0, + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + * + * @name Phaser.GameObjects.Components.Origin#displayOriginX + * @type {number} + * @since 3.0.0 + */ + displayOriginX: { + + get: function () + { + return this._displayOriginX; + }, + + set: function (value) + { + this._displayOriginX = value; + this.originX = value / this.width; + } + + }, + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + * + * @name Phaser.GameObjects.Components.Origin#displayOriginY + * @type {number} + * @since 3.0.0 + */ + displayOriginY: { + + get: function () + { + return this._displayOriginY; + }, + + set: function (value) + { + this._displayOriginY = value; + this.originY = value / this.height; + } + + }, + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * + * @method Phaser.GameObjects.Components.Origin#setOrigin + * @since 3.0.0 + * + * @param {number} [x=0.5] - The horizontal origin value. + * @param {number} [y=x] - The vertical origin value. If not defined it will be set to the value of `x`. + * + * @return {this} This Game Object instance. + */ + setOrigin: function (x, y) + { + if (x === undefined) { x = 0.5; } + if (y === undefined) { y = x; } + + this.originX = x; + this.originY = y; + + return this.updateDisplayOrigin(); + }, + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + * + * @method Phaser.GameObjects.Components.Origin#setOriginFromFrame + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + setOriginFromFrame: function () + { + if (!this.frame || !this.frame.customPivot) + { + return this.setOrigin(); + } + else + { + this.originX = this.frame.pivotX; + this.originY = this.frame.pivotY; + } + + return this.updateDisplayOrigin(); + }, + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * + * @method Phaser.GameObjects.Components.Origin#setDisplayOrigin + * @since 3.0.0 + * + * @param {number} [x=0] - The horizontal display origin value. + * @param {number} [y=x] - The vertical display origin value. If not defined it will be set to the value of `x`. + * + * @return {this} This Game Object instance. + */ + setDisplayOrigin: function (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + + this.displayOriginX = x; + this.displayOriginY = y; + + return this; + }, + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + * + * @method Phaser.GameObjects.Components.Origin#updateDisplayOrigin + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + updateDisplayOrigin: function () + { + this._displayOriginX = this.originX * this.width; + this._displayOriginY = this.originY * this.height; + + return this; + } + +}; + +module.exports = Origin; + + +/***/ }), + +/***/ 77: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DegToRad = __webpack_require__(7149); +var GetBoolean = __webpack_require__(1864); +var GetValue = __webpack_require__(5851); +var TWEEN_CONST = __webpack_require__(3747); +var Vector2 = __webpack_require__(2529); + +/** + * Provides methods used for managing a Game Object following a Path. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.PathFollower + * @since 3.17.0 + */ + +var PathFollower = { + + /** + * The Path this PathFollower is following. It can only follow one Path at a time. + * + * @name Phaser.GameObjects.Components.PathFollower#path + * @type {Phaser.Curves.Path} + * @since 3.0.0 + */ + path: null, + + /** + * Should the PathFollower automatically rotate to point in the direction of the Path? + * + * @name Phaser.GameObjects.Components.PathFollower#rotateToPath + * @type {boolean} + * @default false + * @since 3.0.0 + */ + rotateToPath: false, + + /** + * If the PathFollower is rotating to match the Path (@see Phaser.GameObjects.PathFollower#rotateToPath) + * this value is added to the rotation value. This allows you to rotate objects to a path but control + * the angle of the rotation as well. + * + * @name Phaser.GameObjects.PathFollower#pathRotationOffset + * @type {number} + * @default 0 + * @since 3.0.0 + */ + pathRotationOffset: 0, + + /** + * An additional vector to add to the PathFollowers position, allowing you to offset it from the + * Path coordinates. + * + * @name Phaser.GameObjects.PathFollower#pathOffset + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + pathOffset: null, + + /** + * A Vector2 that stores the current point of the path the follower is on. + * + * @name Phaser.GameObjects.PathFollower#pathVector + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + pathVector: null, + + /** + * The distance the follower has traveled from the previous point to the current one, at the last update. + * + * @name Phaser.GameObjects.PathFollower#pathDelta + * @type {Phaser.Math.Vector2} + * @since 3.23.0 + */ + pathDelta: null, + + /** + * The Tween used for following the Path. + * + * @name Phaser.GameObjects.PathFollower#pathTween + * @type {Phaser.Tweens.Tween} + * @since 3.0.0 + */ + pathTween: null, + + /** + * Settings for the PathFollower. + * + * @name Phaser.GameObjects.PathFollower#pathConfig + * @type {?Phaser.Types.GameObjects.PathFollower.PathConfig} + * @default null + * @since 3.0.0 + */ + pathConfig: null, + + /** + * Records the direction of the follower so it can change direction. + * + * @name Phaser.GameObjects.PathFollower#_prevDirection + * @type {number} + * @private + * @since 3.0.0 + */ + _prevDirection: TWEEN_CONST.PLAYING_FORWARD, + + /** + * Set the Path that this PathFollower should follow. + * + * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings. + * + * @method Phaser.GameObjects.Components.PathFollower#setPath + * @since 3.0.0 + * + * @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time. + * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config] - Settings for the PathFollower. + * + * @return {this} This Game Object. + */ + setPath: function (path, config) + { + if (config === undefined) { config = this.pathConfig; } + + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.stop(); + } + + this.path = path; + + if (config) + { + this.startFollow(config); + } + + return this; + }, + + /** + * Set whether the PathFollower should automatically rotate to point in the direction of the Path. + * + * @method Phaser.GameObjects.Components.PathFollower#setRotateToPath + * @since 3.0.0 + * + * @param {boolean} value - Whether the PathFollower should automatically rotate to point in the direction of the Path. + * @param {number} [offset=0] - Rotation offset in degrees. + * + * @return {this} This Game Object. + */ + setRotateToPath: function (value, offset) + { + if (offset === undefined) { offset = 0; } + + this.rotateToPath = value; + + this.pathRotationOffset = offset; + + return this; + }, + + /** + * Is this PathFollower actively following a Path or not? + * + * To be considered as `isFollowing` it must be currently moving on a Path, and not paused. + * + * @method Phaser.GameObjects.Components.PathFollower#isFollowing + * @since 3.0.0 + * + * @return {boolean} `true` is this PathFollower is actively following a Path, otherwise `false`. + */ + isFollowing: function () + { + var tween = this.pathTween; + + return (tween && tween.isPlaying()); + }, + + /** + * Starts this PathFollower following its given Path. + * + * @method Phaser.GameObjects.Components.PathFollower#startFollow + * @since 3.3.0 + * + * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config={}] - The duration of the follow, or a PathFollower config object. + * @param {number} [startAt=0] - Optional start position of the follow, between 0 and 1. + * + * @return {this} This Game Object. + */ + startFollow: function (config, startAt) + { + if (config === undefined) { config = {}; } + if (startAt === undefined) { startAt = 0; } + + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.stop(); + } + + if (typeof config === 'number') + { + config = { duration: config }; + } + + // Override in case they've been specified in the config + config.from = GetValue(config, 'from', 0); + config.to = GetValue(config, 'to', 1); + + var positionOnPath = GetBoolean(config, 'positionOnPath', false); + + this.rotateToPath = GetBoolean(config, 'rotateToPath', false); + this.pathRotationOffset = GetValue(config, 'rotationOffset', 0); + + // This works, but it's not an ideal way of doing it as the follower jumps position + var seek = GetValue(config, 'startAt', startAt); + + if (seek) + { + config.onStart = function (tween) + { + var tweenData = tween.data[0]; + tweenData.progress = seek; + tweenData.elapsed = tweenData.duration * seek; + var v = tweenData.ease(tweenData.progress); + tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); + tweenData.setTargetValue(); + }; + } + + if (!this.pathOffset) + { + this.pathOffset = new Vector2(this.x, this.y); + } + + if (!this.pathVector) + { + this.pathVector = new Vector2(); + } + + if (!this.pathDelta) + { + this.pathDelta = new Vector2(); + } + + this.pathDelta.reset(); + + config.persist = true; + + this.pathTween = this.scene.sys.tweens.addCounter(config); + + // The starting point of the path, relative to this follower + this.path.getStartPoint(this.pathOffset); + + if (positionOnPath) + { + this.x = this.pathOffset.x; + this.y = this.pathOffset.y; + } + + this.pathOffset.x = this.x - this.pathOffset.x; + this.pathOffset.y = this.y - this.pathOffset.y; + + this._prevDirection = TWEEN_CONST.PLAYING_FORWARD; + + if (this.rotateToPath) + { + // Set the rotation now (in case the tween has a delay on it, etc) + var nextPoint = this.path.getPoint(0.1); + + this.rotation = Math.atan2(nextPoint.y - this.y, nextPoint.x - this.x) + DegToRad(this.pathRotationOffset); + } + + this.pathConfig = config; + + return this; + }, + + /** + * Pauses this PathFollower. It will still continue to render, but it will remain motionless at the + * point on the Path at which you paused it. + * + * @method Phaser.GameObjects.Components.PathFollower#pauseFollow + * @since 3.3.0 + * + * @return {this} This Game Object. + */ + pauseFollow: function () + { + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.pause(); + } + + return this; + }, + + /** + * Resumes a previously paused PathFollower. + * + * If the PathFollower was not paused this has no effect. + * + * @method Phaser.GameObjects.Components.PathFollower#resumeFollow + * @since 3.3.0 + * + * @return {this} This Game Object. + */ + resumeFollow: function () + { + var tween = this.pathTween; + + if (tween && tween.isPaused()) + { + tween.resume(); + } + + return this; + }, + + /** + * Stops this PathFollower from following the path any longer. + * + * This will invoke any 'stop' conditions that may exist on the Path, or for the follower. + * + * @method Phaser.GameObjects.Components.PathFollower#stopFollow + * @since 3.3.0 + * + * @return {this} This Game Object. + */ + stopFollow: function () + { + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.stop(); + } + + return this; + }, + + /** + * Internal update handler that advances this PathFollower along the path. + * + * Called automatically by the Scene step, should not typically be called directly. + * + * @method Phaser.GameObjects.Components.PathFollower#pathUpdate + * @since 3.17.0 + */ + pathUpdate: function () + { + var tween = this.pathTween; + + if (tween) + { + var tweenData = tween.data[0]; + var pathDelta = this.pathDelta; + var pathVector = this.pathVector; + + pathDelta.copy(pathVector).negate(); + + if (tweenData.state === TWEEN_CONST.COMPLETE) + { + this.path.getPoint(tweenData.end, pathVector); + + pathDelta.add(pathVector); + pathVector.add(this.pathOffset); + + this.setPosition(pathVector.x, pathVector.y); + + return; + } + else if (tweenData.state !== TWEEN_CONST.PLAYING_FORWARD && tweenData.state !== TWEEN_CONST.PLAYING_BACKWARD) + { + // If delayed, etc then bail out + return; + } + + this.path.getPoint(tween.getValue(), pathVector); + + pathDelta.add(pathVector); + pathVector.add(this.pathOffset); + + var oldX = this.x; + var oldY = this.y; + + this.setPosition(pathVector.x, pathVector.y); + + var speedX = this.x - oldX; + var speedY = this.y - oldY; + + if (speedX === 0 && speedY === 0) + { + // Bail out early + return; + } + + if (tweenData.state !== this._prevDirection) + { + // We've changed direction, so don't do a rotate this frame + this._prevDirection = tweenData.state; + + return; + } + + if (this.rotateToPath) + { + this.rotation = Math.atan2(speedY, speedX) + DegToRad(this.pathRotationOffset); + } + } + } + +}; + +module.exports = PathFollower; + + +/***/ }), + +/***/ 986: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DeepCopy = __webpack_require__(3911); + +/** + * Provides methods used for setting the WebGL rendering pipeline of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Pipeline + * @webglOnly + * @since 3.0.0 + */ + +var Pipeline = { + + /** + * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. + * + * @name Phaser.GameObjects.Components.Pipeline#defaultPipeline + * @type {Phaser.Renderer.WebGL.WebGLPipeline} + * @default null + * @webglOnly + * @since 3.0.0 + */ + defaultPipeline: null, + + /** + * The current WebGL pipeline of this Game Object. + * + * @name Phaser.GameObjects.Components.Pipeline#pipeline + * @type {Phaser.Renderer.WebGL.WebGLPipeline} + * @default null + * @webglOnly + * @since 3.0.0 + */ + pipeline: null, + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + * + * @name Phaser.GameObjects.Components.Pipeline#pipelineData + * @type {object} + * @webglOnly + * @since 3.50.0 + */ + pipelineData: null, + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * + * @method Phaser.GameObjects.Components.Pipeline#initPipeline + * @webglOnly + * @since 3.0.0 + * + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - Either the string-based name of the pipeline, or a pipeline instance to set. + * + * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. + */ + initPipeline: function (pipeline) + { + this.pipelineData = {}; + + var renderer = this.scene.sys.renderer; + + if (!renderer) + { + return false; + } + + var pipelines = renderer.pipelines; + + if (pipelines) + { + if (pipeline === undefined) + { + pipeline = pipelines.default; + } + + var instance = pipelines.get(pipeline); + + if (instance) + { + this.defaultPipeline = instance; + this.pipeline = instance; + + return true; + } + } + + return false; + }, + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * @method Phaser.GameObjects.Components.Pipeline#setPipeline + * @webglOnly + * @since 3.0.0 + * + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set. + * @param {object} [pipelineData] - Optional pipeline data object that is set in to the `pipelineData` property of this Game Object. + * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. + * + * @return {this} This Game Object instance. + */ + setPipeline: function (pipeline, pipelineData, copyData) + { + var renderer = this.scene.sys.renderer; + + if (!renderer) + { + return this; + } + + var pipelines = renderer.pipelines; + + if (pipelines) + { + var instance = pipelines.get(pipeline); + + if (instance) + { + this.pipeline = instance; + } + + if (pipelineData) + { + this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; + } + } + + return this; + }, + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * @method Phaser.GameObjects.Components.Pipeline#setPipelineData + * @webglOnly + * @since 3.50.0 + * + * @param {string} key - The key of the pipeline data to set, update, or delete. + * @param {any} [value] - The value to be set with the key. If `undefined` then `key` will be deleted from the object. + * + * @return {this} This Game Object instance. + */ + setPipelineData: function (key, value) + { + var data = this.pipelineData; + + if (value === undefined) + { + delete data[key]; + } + else + { + data[key] = value; + } + + return this; + }, + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * + * @method Phaser.GameObjects.Components.Pipeline#resetPipeline + * @webglOnly + * @since 3.0.0 + * + * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? + * + * @return {boolean} `true` if the pipeline was reset successfully, otherwise `false`. + */ + resetPipeline: function (resetData) + { + if (resetData === undefined) { resetData = false; } + + this.pipeline = this.defaultPipeline; + + if (resetData) + { + this.pipelineData = {}; + } + + return (this.pipeline !== null); + }, + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + * + * @method Phaser.GameObjects.Components.Pipeline#getPipelineName + * @webglOnly + * @since 3.0.0 + * + * @return {string} The string-based name of the pipeline being used by this Game Object. + */ + getPipelineName: function () + { + return this.pipeline.name; + } + +}; + +module.exports = Pipeline; + + +/***/ }), + +/***/ 4461: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DeepCopy = __webpack_require__(3911); +var FX = __webpack_require__(1626); +var SpliceOne = __webpack_require__(8935); + +/** + * Provides methods used for setting the WebGL rendering post pipeline of a Game Object. + * + * @namespace Phaser.GameObjects.Components.PostPipeline + * @webglOnly + * @since 3.60.0 + */ + +var PostPipeline = { + + /** + * Does this Game Object have any Post Pipelines set? + * + * @name Phaser.GameObjects.Components.PostPipeline#hasPostPipeline + * @type {boolean} + * @webglOnly + * @since 3.60.0 + */ + hasPostPipeline: false, + + /** + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. + * + * @name Phaser.GameObjects.Components.PostPipeline#postPipelines + * @type {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]} + * @webglOnly + * @since 3.60.0 + */ + postPipelines: null, + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + * + * @name Phaser.GameObjects.Components.PostPipeline#postPipelineData + * @type {object} + * @webglOnly + * @since 3.60.0 + */ + postPipelineData: null, + + /** + * The Pre FX component of this Game Object. + * + * This component allows you to apply a variety of built-in effects to this Game Object, such + * as glow, blur, bloom, displacements, vignettes and more. You access them via this property, + * for example: + * + * ```js + * const player = this.add.sprite(); + * player.preFX.addBloom(); + * ``` + * + * Only the following Game Objects support Pre FX: + * + * * Image + * * Sprite + * * TileSprite + * * Text + * * RenderTexture + * * Video + * + * All FX are WebGL only and do not have Canvas counterparts. + * + * Please see the FX Class for more details and available methods. + * + * @name Phaser.GameObjects.Components.PostPipeline#preFX + * @type {?Phaser.GameObjects.Components.FX} + * @webglOnly + * @since 3.60.0 + */ + preFX: null, + + /** + * The Post FX component of this Game Object. + * + * This component allows you to apply a variety of built-in effects to this Game Object, such + * as glow, blur, bloom, displacements, vignettes and more. You access them via this property, + * for example: + * + * ```js + * const player = this.add.sprite(); + * player.postFX.addBloom(); + * ``` + * + * All FX are WebGL only and do not have Canvas counterparts. + * + * Please see the FX Class for more details and available methods. + * + * This property is always `null` until the `initPostPipeline` method is called. + * + * @name Phaser.GameObjects.Components.PostPipeline#postFX + * @type {Phaser.GameObjects.Components.FX} + * @webglOnly + * @since 3.60.0 + */ + postFX: null, + + /** + * This should only be called during the instantiation of the Game Object. + * + * It is called by default by all core Game Objects and doesn't need + * calling again. + * + * After that, use `setPostPipeline`. + * + * @method Phaser.GameObjects.Components.PostPipeline#initPostPipeline + * @webglOnly + * @since 3.60.0 + * + * @param {boolean} [preFX=false] - Does this Game Object support Pre FX? + */ + initPostPipeline: function (preFX) + { + this.postPipelines = []; + this.postPipelineData = {}; + + this.postFX = new FX(this, true); + + if (preFX) + { + this.preFX = new FX(this, false); + } + }, + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also set the `postPipelineData` property, if the parameter is given. + * + * @method Phaser.GameObjects.Components.PostPipeline#setPostPipeline + * @webglOnly + * @since 3.60.0 + * + * @param {(string|string[]|function|function[]|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} pipelines - Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param {object} [pipelineData] - Optional pipeline data object that is set in to the `postPipelineData` property of this Game Object. + * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `postPipelineData` property of this Game Object? If `false` it will be set by reference instead. + * + * @return {this} This Game Object instance. + */ + setPostPipeline: function (pipelines, pipelineData, copyData) + { + var renderer = this.scene.sys.renderer; + + if (!renderer) + { + return this; + } + + var pipelineManager = renderer.pipelines; + + if (pipelineManager) + { + if (!Array.isArray(pipelines)) + { + pipelines = [ pipelines ]; + } + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelineManager.getPostPipeline(pipelines[i], this, pipelineData); + + if (instance) + { + this.postPipelines.push(instance); + } + } + + if (pipelineData) + { + this.postPipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; + } + } + + this.hasPostPipeline = (this.postPipelines.length > 0); + + return this; + }, + + /** + * Adds an entry to the `postPipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * @method Phaser.GameObjects.Components.PostPipeline#setPostPipelineData + * @webglOnly + * @since 3.60.0 + * + * @param {string} key - The key of the pipeline data to set, update, or delete. + * @param {any} [value] - The value to be set with the key. If `undefined` then `key` will be deleted from the object. + * + * @return {this} This Game Object instance. + */ + setPostPipelineData: function (key, value) + { + var data = this.postPipelineData; + + if (value === undefined) + { + delete data[key]; + } + else + { + data[key] = value; + } + + return this; + }, + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * + * @method Phaser.GameObjects.Components.PostPipeline#getPostPipeline + * @webglOnly + * @since 3.60.0 + * + * @param {(string|function|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline)} pipeline - The string-based name of the pipeline, or a pipeline class. + * + * @return {(Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} An array of all the Post Pipelines matching the name. This array will be empty if there was no match. If there was only one single match, that pipeline is returned directly, not in an array. + */ + getPostPipeline: function (pipeline) + { + var isString = (typeof pipeline === 'string'); + + var pipelines = this.postPipelines; + + var results = []; + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelines[i]; + + if ((isString && instance.name === pipeline) || (!isString && instance instanceof pipeline)) + { + results.push(instance); + } + } + + return (results.length === 1) ? results[0] : results; + }, + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * + * @method Phaser.GameObjects.Components.PostPipeline#resetPostPipeline + * @webglOnly + * @since 3.60.0 + * + * @param {boolean} [resetData=false] - Reset the `postPipelineData` object to being an empty object? + */ + resetPostPipeline: function (resetData) + { + if (resetData === undefined) { resetData = false; } + + var pipelines = this.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + pipelines[i].destroy(); + } + + this.postPipelines = []; + this.hasPostPipeline = false; + + if (resetData) + { + this.postPipelineData = {}; + } + }, + + /** + * Removes a type of Post Pipeline instances from this Game Object, based on the given name, and destroys them. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * + * @method Phaser.GameObjects.Components.PostPipeline#removePostPipeline + * @webglOnly + * @since 3.60.0 + * + * @param {string|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} pipeline - The string-based name of the pipeline, or a pipeline class. + * + * @return {this} This Game Object. + */ + removePostPipeline: function (pipeline) + { + var isString = (typeof pipeline === 'string'); + + var pipelines = this.postPipelines; + + for (var i = pipelines.length - 1; i >= 0; i--) + { + var instance = pipelines[i]; + + if ( + (isString && instance.name === pipeline) || + (!isString && instance === pipeline)) + { + instance.destroy(); + + SpliceOne(pipelines, i); + } + } + + this.hasPostPipeline = (this.postPipelines.length > 0); + + return this; + }, + + /** + * Removes all Pre and Post FX Controllers from this Game Object. + * + * If you wish to remove a single controller, use the `preFX.remove(fx)` or `postFX.remove(fx)` methods instead. + * + * If you wish to clear a single controller, use the `preFX.clear()` or `postFX.clear()` methods instead. + * + * @method Phaser.GameObjects.Components.PostPipeline#clearFX + * @webglOnly + * @since 3.60.0 + * + * @return {this} This Game Object. + */ + clearFX: function () + { + if (this.preFX) + { + this.preFX.clear(); + } + + if (this.postFX) + { + this.postFX.clear(); + } + + return this; + } + +}; + +module.exports = PostPipeline; + + +/***/ }), + +/***/ 4627: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the Scroll Factor of a Game Object. + * + * @namespace Phaser.GameObjects.Components.ScrollFactor + * @since 3.0.0 + */ + +var ScrollFactor = { + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scrollFactorX: 1, + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scrollFactorY: 1, + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor + * @since 3.0.0 + * + * @param {number} x - The horizontal scroll factor of this Game Object. + * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. + * + * @return {this} This Game Object instance. + */ + setScrollFactor: function (x, y) + { + if (y === undefined) { y = x; } + + this.scrollFactorX = x; + this.scrollFactorY = y; + + return this; + } + +}; + +module.exports = ScrollFactor; + + +/***/ }), + +/***/ 1868: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the size of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Size + * @since 3.0.0 + */ + +var Size = { + + /** + * A property indicating that a Game Object has this component. + * + * @name Phaser.GameObjects.Components.Size#_sizeComponent + * @type {boolean} + * @private + * @default true + * @since 3.2.0 + */ + _sizeComponent: true, + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + * + * @name Phaser.GameObjects.Components.Size#width + * @type {number} + * @since 3.0.0 + */ + width: 0, + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + * + * @name Phaser.GameObjects.Components.Size#height + * @type {number} + * @since 3.0.0 + */ + height: 0, + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.Size#displayWidth + * @type {number} + * @since 3.0.0 + */ + displayWidth: { + + get: function () + { + return Math.abs(this.scaleX * this.frame.realWidth); + }, + + set: function (value) + { + this.scaleX = value / this.frame.realWidth; + } + + }, + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.Size#displayHeight + * @type {number} + * @since 3.0.0 + */ + displayHeight: { + + get: function () + { + return Math.abs(this.scaleY * this.frame.realHeight); + }, + + set: function (value) + { + this.scaleY = value / this.frame.realHeight; + } + + }, + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Components.Size#setSizeToFrame + * @since 3.0.0 + * + * @param {Phaser.Textures.Frame|boolean} [frame] - The frame to base the size of this Game Object on. + * + * @return {this} This Game Object instance. + */ + setSizeToFrame: function (frame) + { + if (!frame) { frame = this.frame; } + + this.width = frame.realWidth; + this.height = frame.realHeight; + + var input = this.input; + + if (input && !input.customHitArea) + { + input.hitArea.width = this.width; + input.hitArea.height = this.height; + } + + return this; + }, + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Components.Size#setSize + * @since 3.0.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setSize: function (width, height) + { + this.width = width; + this.height = height; + + return this; + }, + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * + * @method Phaser.GameObjects.Components.Size#setDisplaySize + * @since 3.0.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDisplaySize: function (width, height) + { + this.displayWidth = width; + this.displayHeight = height; + + return this; + } + +}; + +module.exports = Size; + + +/***/ }), + +/***/ 4976: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Frame = __webpack_require__(2362); + +// bitmask flag for GameObject.renderMask +var _FLAG = 8; // 1000 + +/** + * Provides methods used for getting and setting the texture of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Texture + * @since 3.0.0 + */ + +var Texture = { + + /** + * The Texture this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Texture#texture + * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} + * @since 3.0.0 + */ + texture: null, + + /** + * The Texture Frame this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Texture#frame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + frame: null, + + /** + * Internal flag. Not to be set by this Game Object. + * + * @name Phaser.GameObjects.Components.Texture#isCropped + * @type {boolean} + * @private + * @since 3.11.0 + */ + isCropped: false, + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * @method Phaser.GameObjects.Components.Texture#setTexture + * @since 3.0.0 + * + * @param {(string|Phaser.Textures.Texture)} key - The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. + * + * @return {this} This Game Object instance. + */ + setTexture: function (key, frame) + { + this.texture = this.scene.sys.textures.get(key); + + return this.setFrame(frame); + }, + + /** + * Sets the frame this Game Object will use to render with. + * + * If you pass a string or index then the Frame has to belong to the current Texture being used + * by this Game Object. + * + * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * + * @method Phaser.GameObjects.Components.Texture#setFrame + * @since 3.0.0 + * + * @param {(string|number|Phaser.Textures.Frame)} frame - The name or index of the frame within the Texture, or a Frame instance. + * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? + * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? + * + * @return {this} This Game Object instance. + */ + setFrame: function (frame, updateSize, updateOrigin) + { + if (updateSize === undefined) { updateSize = true; } + if (updateOrigin === undefined) { updateOrigin = true; } + + if (frame instanceof Frame) + { + this.texture = this.scene.sys.textures.get(frame.texture.key); + + this.frame = frame; + } + else + { + this.frame = this.texture.get(frame); + } + + if (!this.frame.cutWidth || !this.frame.cutHeight) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + + if (this._sizeComponent && updateSize) + { + this.setSizeToFrame(); + } + + if (this._originComponent && updateOrigin) + { + if (this.frame.customPivot) + { + this.setOrigin(this.frame.pivotX, this.frame.pivotY); + } + else + { + this.updateDisplayOrigin(); + } + } + + return this; + } + +}; + +module.exports = Texture; + + +/***/ }), + +/***/ 9243: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Frame = __webpack_require__(2362); + +// bitmask flag for GameObject.renderMask +var _FLAG = 8; // 1000 + +/** + * Provides methods used for getting and setting the texture of a Game Object. + * + * @namespace Phaser.GameObjects.Components.TextureCrop + * @since 3.0.0 + */ + +var TextureCrop = { + + /** + * The Texture this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.TextureCrop#texture + * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} + * @since 3.0.0 + */ + texture: null, + + /** + * The Texture Frame this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.TextureCrop#frame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + frame: null, + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + * + * @name Phaser.GameObjects.Components.TextureCrop#isCropped + * @type {boolean} + * @since 3.11.0 + */ + isCropped: false, + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * + * @method Phaser.GameObjects.Components.TextureCrop#setCrop + * @since 3.11.0 + * + * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param {number} [y] - The y coordinate to start the crop from. + * @param {number} [width] - The width of the crop rectangle in pixels. + * @param {number} [height] - The height of the crop rectangle in pixels. + * + * @return {this} This Game Object instance. + */ + setCrop: function (x, y, width, height) + { + if (x === undefined) + { + this.isCropped = false; + } + else if (this.frame) + { + if (typeof x === 'number') + { + this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY); + } + else + { + var rect = x; + + this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY); + } + + this.isCropped = true; + } + + return this; + }, + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * @method Phaser.GameObjects.Components.TextureCrop#setTexture + * @since 3.0.0 + * + * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. + * + * @return {this} This Game Object instance. + */ + setTexture: function (key, frame) + { + this.texture = this.scene.sys.textures.get(key); + + return this.setFrame(frame); + }, + + /** + * Sets the frame this Game Object will use to render with. + * + * If you pass a string or index then the Frame has to belong to the current Texture being used + * by this Game Object. + * + * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * + * @method Phaser.GameObjects.Components.TextureCrop#setFrame + * @since 3.0.0 + * + * @param {(string|number|Phaser.Textures.Frame)} frame - The name or index of the frame within the Texture, or a Frame instance. + * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? + * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? + * + * @return {this} This Game Object instance. + */ + setFrame: function (frame, updateSize, updateOrigin) + { + if (updateSize === undefined) { updateSize = true; } + if (updateOrigin === undefined) { updateOrigin = true; } + + if (frame instanceof Frame) + { + this.texture = this.scene.sys.textures.get(frame.texture.key); + + this.frame = frame; + } + else + { + this.frame = this.texture.get(frame); + } + + if (!this.frame.cutWidth || !this.frame.cutHeight) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + + if (this._sizeComponent && updateSize) + { + this.setSizeToFrame(); + } + + if (this._originComponent && updateOrigin) + { + if (this.frame.customPivot) + { + this.setOrigin(this.frame.pivotX, this.frame.pivotY); + } + else + { + this.updateDisplayOrigin(); + } + } + + if (this.isCropped) + { + this.frame.updateCropUVs(this._crop, this.flipX, this.flipY); + } + + return this; + }, + + /** + * Internal method that returns a blank, well-formed crop object for use by a Game Object. + * + * @method Phaser.GameObjects.Components.TextureCrop#resetCropObject + * @private + * @since 3.12.0 + * + * @return {object} The crop object. + */ + resetCropObject: function () + { + return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 }; + } + +}; + +module.exports = TextureCrop; + + +/***/ }), + +/***/ 5693: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the tint of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Tint + * @webglOnly + * @since 3.0.0 + */ + +var Tint = { + + /** + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + * + * @name Phaser.GameObjects.Components.Tint#tintTopLeft + * @type {number} + * @default 0xffffff + * @since 3.0.0 + */ + tintTopLeft: 0xffffff, + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + * + * @name Phaser.GameObjects.Components.Tint#tintTopRight + * @type {number} + * @default 0xffffff + * @since 3.0.0 + */ + tintTopRight: 0xffffff, + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + * + * @name Phaser.GameObjects.Components.Tint#tintBottomLeft + * @type {number} + * @default 0xffffff + * @since 3.0.0 + */ + tintBottomLeft: 0xffffff, + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + * + * @name Phaser.GameObjects.Components.Tint#tintBottomRight + * @type {number} + * @default 0xffffff + * @since 3.0.0 + */ + tintBottomRight: 0xffffff, + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. + * + * @name Phaser.GameObjects.Components.Tint#tintFill + * @type {boolean} + * @default false + * @since 3.11.0 + */ + tintFill: false, + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + * + * @method Phaser.GameObjects.Components.Tint#clearTint + * @webglOnly + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + clearTint: function () + { + this.setTint(0xffffff); + + return this; + }, + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * + * @method Phaser.GameObjects.Components.Tint#setTint + * @webglOnly + * @since 3.0.0 + * + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. + * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * + * @return {this} This Game Object instance. + */ + setTint: function (topLeft, topRight, bottomLeft, bottomRight) + { + if (topLeft === undefined) { topLeft = 0xffffff; } + + if (topRight === undefined) + { + topRight = topLeft; + bottomLeft = topLeft; + bottomRight = topLeft; + } + + this.tintTopLeft = topLeft; + this.tintTopRight = topRight; + this.tintBottomLeft = bottomLeft; + this.tintBottomRight = bottomRight; + + this.tintFill = false; + + return this; + }, + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * + * @method Phaser.GameObjects.Components.Tint#setTintFill + * @webglOnly + * @since 3.11.0 + * + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. + * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * + * @return {this} This Game Object instance. + */ + setTintFill: function (topLeft, topRight, bottomLeft, bottomRight) + { + this.setTint(topLeft, topRight, bottomLeft, bottomRight); + + this.tintFill = true; + + return this; + }, + + /** + * The tint value being applied to the whole of the Game Object. + * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. + * + * @name Phaser.GameObjects.Components.Tint#tint + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + tint: { + + set: function (value) + { + this.setTint(value, value, value, value); + } + }, + + /** + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. + * + * @name Phaser.GameObjects.Components.Tint#isTinted + * @type {boolean} + * @webglOnly + * @readonly + * @since 3.11.0 + */ + isTinted: { + + get: function () + { + var white = 0xffffff; + + return ( + this.tintFill || + this.tintTopLeft !== white || + this.tintTopRight !== white || + this.tintBottomLeft !== white || + this.tintBottomRight !== white + ); + } + + } + +}; + +module.exports = Tint; + + +/***/ }), + +/***/ 6125: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Build a JSON representation of the given Game Object. + * + * This is typically extended further by Game Object specific implementations. + * + * @method Phaser.GameObjects.Components.ToJSON + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON. + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ +var ToJSON = function (gameObject) +{ + var out = { + name: gameObject.name, + type: gameObject.type, + x: gameObject.x, + y: gameObject.y, + depth: gameObject.depth, + scale: { + x: gameObject.scaleX, + y: gameObject.scaleY + }, + origin: { + x: gameObject.originX, + y: gameObject.originY + }, + flipX: gameObject.flipX, + flipY: gameObject.flipY, + rotation: gameObject.rotation, + alpha: gameObject.alpha, + visible: gameObject.visible, + blendMode: gameObject.blendMode, + textureKey: '', + frameKey: '', + data: {} + }; + + if (gameObject.texture) + { + out.textureKey = gameObject.texture.key; + out.frameKey = gameObject.frame.name; + } + + return out; +}; + +module.exports = ToJSON; + + +/***/ }), + +/***/ 3212: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(7425); +var TransformMatrix = __webpack_require__(4227); +var TransformXY = __webpack_require__(7556); +var WrapAngle = __webpack_require__(3692); +var WrapAngleDegrees = __webpack_require__(2820); +var Vector2 = __webpack_require__(2529); + +// global bitmask flag for GameObject.renderMask (used by Scale) +var _FLAG = 4; // 0100 + +/** + * Provides methods used for getting and setting the position, scale and rotation of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Transform + * @since 3.0.0 + */ + +var Transform = { + + /** + * A property indicating that a Game Object has this component. + * + * @name Phaser.GameObjects.Components.Transform#hasTransformComponent + * @type {boolean} + * @readonly + * @default true + * @since 3.60.0 + */ + hasTransformComponent: true, + + /** + * Private internal value. Holds the horizontal scale value. + * + * @name Phaser.GameObjects.Components.Transform#_scaleX + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _scaleX: 1, + + /** + * Private internal value. Holds the vertical scale value. + * + * @name Phaser.GameObjects.Components.Transform#_scaleY + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _scaleY: 1, + + /** + * Private internal value. Holds the rotation value in radians. + * + * @name Phaser.GameObjects.Components.Transform#_rotation + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + _rotation: 0, + + /** + * The x position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: 0, + + /** + * The y position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: 0, + + /** + * The z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#depth} instead. + * + * @name Phaser.GameObjects.Components.Transform#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: 0, + + /** + * The w position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: 0, + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + * + * @name Phaser.GameObjects.Components.Transform#scale + * @type {number} + * @default 1 + * @since 3.18.0 + */ + scale: { + + get: function () + { + return (this._scaleX + this._scaleY) / 2; + }, + + set: function (value) + { + this._scaleX = value; + this._scaleY = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The horizontal scale of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#scaleX + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scaleX: { + + get: function () + { + return this._scaleX; + }, + + set: function (value) + { + this._scaleX = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else if (this._scaleY !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The vertical scale of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#scaleY + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scaleY: { + + get: function () + { + return this._scaleY; + }, + + set: function (value) + { + this._scaleY = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else if (this._scaleX !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The angle of this Game Object as expressed in degrees. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left + * and -90 is up. + * + * If you prefer to work in radians, see the `rotation` property instead. + * + * @name Phaser.GameObjects.Components.Transform#angle + * @type {number} + * @default 0 + * @since 3.0.0 + */ + angle: { + + get: function () + { + return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG); + }, + + set: function (value) + { + // value is in degrees + this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD; + } + }, + + /** + * The angle of this Game Object in radians. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left + * and -PI/2 is up. + * + * If you prefer to work in degrees, see the `angle` property instead. + * + * @name Phaser.GameObjects.Components.Transform#rotation + * @type {number} + * @default 1 + * @since 3.0.0 + */ + rotation: { + + get: function () + { + return this._rotation; + }, + + set: function (value) + { + // value is in radians + this._rotation = WrapAngle(value); + } + }, + + /** + * Sets the position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setPosition + * @since 3.0.0 + * + * @param {number} [x=0] - The x position of this Game Object. + * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value. + * @param {number} [z=0] - The z position of this Game Object. + * @param {number} [w=0] - The w position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setPosition: function (x, y, z, w) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + if (z === undefined) { z = 0; } + if (w === undefined) { w = 0; } + + this.x = x; + this.y = y; + this.z = z; + this.w = w; + + return this; + }, + + /** + * Copies an object's coordinates to this Game Object's position. + * + * @method Phaser.GameObjects.Components.Transform#copyPosition + * @since 3.50.0 + * + * @param {(Phaser.Types.Math.Vector2Like|Phaser.Types.Math.Vector3Like|Phaser.Types.Math.Vector4Like)} source - An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + * + * @return {this} This Game Object instance. + */ + copyPosition: function (source) + { + if (source.x !== undefined) { this.x = source.x; } + if (source.y !== undefined) { this.y = source.y; } + if (source.z !== undefined) { this.z = source.z; } + if (source.w !== undefined) { this.w = source.w; } + + return this; + }, + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * + * @method Phaser.GameObjects.Components.Transform#setRandomPosition + * @since 3.8.0 + * + * @param {number} [x=0] - The x position of the top-left of the random area. + * @param {number} [y=0] - The y position of the top-left of the random area. + * @param {number} [width] - The width of the random area. + * @param {number} [height] - The height of the random area. + * + * @return {this} This Game Object instance. + */ + setRandomPosition: function (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.scene.sys.scale.width; } + if (height === undefined) { height = this.scene.sys.scale.height; } + + this.x = x + (Math.random() * width); + this.y = y + (Math.random() * height); + + return this; + }, + + /** + * Sets the rotation of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setRotation + * @since 3.0.0 + * + * @param {number} [radians=0] - The rotation of this Game Object, in radians. + * + * @return {this} This Game Object instance. + */ + setRotation: function (radians) + { + if (radians === undefined) { radians = 0; } + + this.rotation = radians; + + return this; + }, + + /** + * Sets the angle of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setAngle + * @since 3.0.0 + * + * @param {number} [degrees=0] - The rotation of this Game Object, in degrees. + * + * @return {this} This Game Object instance. + */ + setAngle: function (degrees) + { + if (degrees === undefined) { degrees = 0; } + + this.angle = degrees; + + return this; + }, + + /** + * Sets the scale of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setScale + * @since 3.0.0 + * + * @param {number} [x=1] - The horizontal scale of this Game Object. + * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value. + * + * @return {this} This Game Object instance. + */ + setScale: function (x, y) + { + if (x === undefined) { x = 1; } + if (y === undefined) { y = x; } + + this.scaleX = x; + this.scaleY = y; + + return this; + }, + + /** + * Sets the x position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setX + * @since 3.0.0 + * + * @param {number} [value=0] - The x position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setX: function (value) + { + if (value === undefined) { value = 0; } + + this.x = value; + + return this; + }, + + /** + * Sets the y position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setY + * @since 3.0.0 + * + * @param {number} [value=0] - The y position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setY: function (value) + { + if (value === undefined) { value = 0; } + + this.y = value; + + return this; + }, + + /** + * Sets the z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. + * + * @method Phaser.GameObjects.Components.Transform#setZ + * @since 3.0.0 + * + * @param {number} [value=0] - The z position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setZ: function (value) + { + if (value === undefined) { value = 0; } + + this.z = value; + + return this; + }, + + /** + * Sets the w position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setW + * @since 3.0.0 + * + * @param {number} [value=0] - The w position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setW: function (value) + { + if (value === undefined) { value = 0; } + + this.w = value; + + return this; + }, + + /** + * Gets the local transform matrix for this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix + * @since 3.4.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. + * + * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. + */ + getLocalTransformMatrix: function (tempMatrix) + { + if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } + + return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); + }, + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * + * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix + * @since 3.4.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations. + * + * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. + */ + getWorldTransformMatrix: function (tempMatrix, parentMatrix) + { + if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } + + var parent = this.parentContainer; + + if (!parent) + { + return this.getLocalTransformMatrix(tempMatrix); + } + + if (!parentMatrix) + { + parentMatrix = new TransformMatrix(); + } + + tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); + + while (parent) + { + parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY); + + parentMatrix.multiply(tempMatrix, tempMatrix); + + parent = parent.parentContainer; + } + + return tempMatrix; + }, + + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * + * @method Phaser.GameObjects.Components.Transform#getLocalPoint + * @since 3.50.0 + * + * @param {number} x - The x position to translate. + * @param {number} y - The y position to translate. + * @param {Phaser.Math.Vector2} [point] - A Vector2, or point-like object, to store the results in. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera which is being tested against. If not given will use the Scene default camera. + * + * @return {Phaser.Math.Vector2} The translated point. + */ + getLocalPoint: function (x, y, point, camera) + { + if (!point) { point = new Vector2(); } + if (!camera) { camera = this.scene.sys.cameras.main; } + + var csx = camera.scrollX; + var csy = camera.scrollY; + + var px = x + (csx * this.scrollFactorX) - csx; + var py = y + (csy * this.scrollFactorY) - csy; + + if (this.parentContainer) + { + this.getWorldTransformMatrix().applyInverse(px, py, point); + } + else + { + TransformXY(px, py, this.x, this.y, this.rotation, this.scaleX, this.scaleY, point); + } + + // Normalize origin + if (this._originComponent) + { + point.x += this._displayOriginX; + point.y += this._displayOriginY; + } + + return point; + }, + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + * + * @method Phaser.GameObjects.Components.Transform#getParentRotation + * @since 3.18.0 + * + * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object. + */ + getParentRotation: function () + { + var rotation = 0; + + var parent = this.parentContainer; + + while (parent) + { + rotation += parent.rotation; + + parent = parent.parentContainer; + } + + return rotation; + } + +}; + +module.exports = Transform; + + +/***/ }), + +/***/ 4227: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var MATH_CONST = __webpack_require__(7425); +var Vector2 = __webpack_require__(2529); + +/** + * @classdesc + * A Matrix used for display transformations for rendering. + * + * It is represented like so: + * + * ``` + * | a | c | tx | + * | b | d | ty | + * | 0 | 0 | 1 | + * ``` + * + * @class TransformMatrix + * @memberof Phaser.GameObjects.Components + * @constructor + * @since 3.0.0 + * + * @param {number} [a=1] - The Scale X value. + * @param {number} [b=0] - The Skew Y value. + * @param {number} [c=0] - The Skew X value. + * @param {number} [d=1] - The Scale Y value. + * @param {number} [tx=0] - The Translate X value. + * @param {number} [ty=0] - The Translate Y value. + */ +var TransformMatrix = new Class({ + + initialize: + + function TransformMatrix (a, b, c, d, tx, ty) + { + if (a === undefined) { a = 1; } + if (b === undefined) { b = 0; } + if (c === undefined) { c = 0; } + if (d === undefined) { d = 1; } + if (tx === undefined) { tx = 0; } + if (ty === undefined) { ty = 0; } + + /** + * The matrix values. + * + * @name Phaser.GameObjects.Components.TransformMatrix#matrix + * @type {Float32Array} + * @since 3.0.0 + */ + this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]); + + /** + * The decomposed matrix. + * + * @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix + * @type {object} + * @since 3.0.0 + */ + this.decomposedMatrix = { + translateX: 0, + translateY: 0, + scaleX: 1, + scaleY: 1, + rotation: 0 + }; + + /** + * The temporary quad value cache. + * + * @name Phaser.GameObjects.Components.TransformMatrix#quad + * @type {Float32Array} + * @since 3.60.0 + */ + this.quad = new Float32Array(8); + }, + + /** + * The Scale X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#a + * @type {number} + * @since 3.4.0 + */ + a: { + + get: function () + { + return this.matrix[0]; + }, + + set: function (value) + { + this.matrix[0] = value; + } + + }, + + /** + * The Skew Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#b + * @type {number} + * @since 3.4.0 + */ + b: { + + get: function () + { + return this.matrix[1]; + }, + + set: function (value) + { + this.matrix[1] = value; + } + + }, + + /** + * The Skew X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#c + * @type {number} + * @since 3.4.0 + */ + c: { + + get: function () + { + return this.matrix[2]; + }, + + set: function (value) + { + this.matrix[2] = value; + } + + }, + + /** + * The Scale Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#d + * @type {number} + * @since 3.4.0 + */ + d: { + + get: function () + { + return this.matrix[3]; + }, + + set: function (value) + { + this.matrix[3] = value; + } + + }, + + /** + * The Translate X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#e + * @type {number} + * @since 3.11.0 + */ + e: { + + get: function () + { + return this.matrix[4]; + }, + + set: function (value) + { + this.matrix[4] = value; + } + + }, + + /** + * The Translate Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#f + * @type {number} + * @since 3.11.0 + */ + f: { + + get: function () + { + return this.matrix[5]; + }, + + set: function (value) + { + this.matrix[5] = value; + } + + }, + + /** + * The Translate X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#tx + * @type {number} + * @since 3.4.0 + */ + tx: { + + get: function () + { + return this.matrix[4]; + }, + + set: function (value) + { + this.matrix[4] = value; + } + + }, + + /** + * The Translate Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#ty + * @type {number} + * @since 3.4.0 + */ + ty: { + + get: function () + { + return this.matrix[5]; + }, + + set: function (value) + { + this.matrix[5] = value; + } + + }, + + /** + * The rotation of the Matrix. Value is in radians. + * + * @name Phaser.GameObjects.Components.TransformMatrix#rotation + * @type {number} + * @readonly + * @since 3.4.0 + */ + rotation: { + + get: function () + { + return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1); + } + + }, + + /** + * The rotation of the Matrix, normalized to be within the Phaser right-handed + * clockwise rotation space. Value is in radians. + * + * @name Phaser.GameObjects.Components.TransformMatrix#rotationNormalized + * @type {number} + * @readonly + * @since 3.19.0 + */ + rotationNormalized: { + + get: function () + { + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + + if (a || b) + { + // var r = Math.sqrt(a * a + b * b); + + return (b > 0) ? Math.acos(a / this.scaleX) : -Math.acos(a / this.scaleX); + } + else if (c || d) + { + // var s = Math.sqrt(c * c + d * d); + + return MATH_CONST.TAU - ((d > 0) ? Math.acos(-c / this.scaleY) : -Math.acos(c / this.scaleY)); + } + else + { + return 0; + } + } + + }, + + /** + * The decomposed horizontal scale of the Matrix. This value is always positive. + * + * @name Phaser.GameObjects.Components.TransformMatrix#scaleX + * @type {number} + * @readonly + * @since 3.4.0 + */ + scaleX: { + + get: function () + { + return Math.sqrt((this.a * this.a) + (this.b * this.b)); + } + + }, + + /** + * The decomposed vertical scale of the Matrix. This value is always positive. + * + * @name Phaser.GameObjects.Components.TransformMatrix#scaleY + * @type {number} + * @readonly + * @since 3.4.0 + */ + scaleY: { + + get: function () + { + return Math.sqrt((this.c * this.c) + (this.d * this.d)); + } + + }, + + /** + * Reset the Matrix to an identity matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity + * @since 3.0.0 + * + * @return {this} This TransformMatrix. + */ + loadIdentity: function () + { + var matrix = this.matrix; + + matrix[0] = 1; + matrix[1] = 0; + matrix[2] = 0; + matrix[3] = 1; + matrix[4] = 0; + matrix[5] = 0; + + return this; + }, + + /** + * Translate the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#translate + * @since 3.0.0 + * + * @param {number} x - The horizontal translation value. + * @param {number} y - The vertical translation value. + * + * @return {this} This TransformMatrix. + */ + translate: function (x, y) + { + var matrix = this.matrix; + + matrix[4] = matrix[0] * x + matrix[2] * y + matrix[4]; + matrix[5] = matrix[1] * x + matrix[3] * y + matrix[5]; + + return this; + }, + + /** + * Scale the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#scale + * @since 3.0.0 + * + * @param {number} x - The horizontal scale value. + * @param {number} y - The vertical scale value. + * + * @return {this} This TransformMatrix. + */ + scale: function (x, y) + { + var matrix = this.matrix; + + matrix[0] *= x; + matrix[1] *= x; + matrix[2] *= y; + matrix[3] *= y; + + return this; + }, + + /** + * Rotate the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#rotate + * @since 3.0.0 + * + * @param {number} angle - The angle of rotation in radians. + * + * @return {this} This TransformMatrix. + */ + rotate: function (angle) + { + var sin = Math.sin(angle); + var cos = Math.cos(angle); + + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + + matrix[0] = a * cos + c * sin; + matrix[1] = b * cos + d * sin; + matrix[2] = a * -sin + c * cos; + matrix[3] = b * -sin + d * cos; + + return this; + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * If an `out` Matrix is given then the results will be stored in it. + * If it is not given, this matrix will be updated in place instead. + * Use an `out` Matrix if you do not wish to mutate this matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#multiply + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} rhs - The Matrix to multiply by. + * @param {Phaser.GameObjects.Components.TransformMatrix} [out] - An optional Matrix to store the results in. + * + * @return {(this|Phaser.GameObjects.Components.TransformMatrix)} Either this TransformMatrix, or the `out` Matrix, if given in the arguments. + */ + multiply: function (rhs, out) + { + var matrix = this.matrix; + var source = rhs.matrix; + + var localA = matrix[0]; + var localB = matrix[1]; + var localC = matrix[2]; + var localD = matrix[3]; + var localE = matrix[4]; + var localF = matrix[5]; + + var sourceA = source[0]; + var sourceB = source[1]; + var sourceC = source[2]; + var sourceD = source[3]; + var sourceE = source[4]; + var sourceF = source[5]; + + var destinationMatrix = (out === undefined) ? matrix : out.matrix; + + destinationMatrix[0] = (sourceA * localA) + (sourceB * localC); + destinationMatrix[1] = (sourceA * localB) + (sourceB * localD); + destinationMatrix[2] = (sourceC * localA) + (sourceD * localC); + destinationMatrix[3] = (sourceC * localB) + (sourceD * localD); + destinationMatrix[4] = (sourceE * localA) + (sourceF * localC) + localE; + destinationMatrix[5] = (sourceE * localB) + (sourceF * localD) + localF; + + return destinationMatrix; + }, + + /** + * Multiply this Matrix by the matrix given, including the offset. + * + * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`. + * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#multiplyWithOffset + * @since 3.11.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from. + * @param {number} offsetX - Horizontal offset to factor in to the multiplication. + * @param {number} offsetY - Vertical offset to factor in to the multiplication. + * + * @return {this} This TransformMatrix. + */ + multiplyWithOffset: function (src, offsetX, offsetY) + { + var matrix = this.matrix; + var otherMatrix = src.matrix; + + var a0 = matrix[0]; + var b0 = matrix[1]; + var c0 = matrix[2]; + var d0 = matrix[3]; + var tx0 = matrix[4]; + var ty0 = matrix[5]; + + var pse = offsetX * a0 + offsetY * c0 + tx0; + var psf = offsetX * b0 + offsetY * d0 + ty0; + + var a1 = otherMatrix[0]; + var b1 = otherMatrix[1]; + var c1 = otherMatrix[2]; + var d1 = otherMatrix[3]; + var tx1 = otherMatrix[4]; + var ty1 = otherMatrix[5]; + + matrix[0] = a1 * a0 + b1 * c0; + matrix[1] = a1 * b0 + b1 * d0; + matrix[2] = c1 * a0 + d1 * c0; + matrix[3] = c1 * b0 + d1 * d0; + matrix[4] = tx1 * a0 + ty1 * c0 + pse; + matrix[5] = tx1 * b0 + ty1 * d0 + psf; + + return this; + }, + + /** + * Transform the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#transform + * @since 3.0.0 + * + * @param {number} a - The Scale X value. + * @param {number} b - The Shear Y value. + * @param {number} c - The Shear X value. + * @param {number} d - The Scale Y value. + * @param {number} tx - The Translate X value. + * @param {number} ty - The Translate Y value. + * + * @return {this} This TransformMatrix. + */ + transform: function (a, b, c, d, tx, ty) + { + var matrix = this.matrix; + + var a0 = matrix[0]; + var b0 = matrix[1]; + var c0 = matrix[2]; + var d0 = matrix[3]; + var tx0 = matrix[4]; + var ty0 = matrix[5]; + + matrix[0] = a * a0 + b * c0; + matrix[1] = a * b0 + b * d0; + matrix[2] = c * a0 + d * c0; + matrix[3] = c * b0 + d * d0; + matrix[4] = tx * a0 + ty * c0 + tx0; + matrix[5] = tx * b0 + ty * d0 + ty0; + + return this; + }, + + /** + * Transform a point in to the local space of this Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint + * @since 3.0.0 + * + * @param {number} x - The x coordinate of the point to transform. + * @param {number} y - The y coordinate of the point to transform. + * @param {Phaser.Types.Math.Vector2Like} [point] - Optional Point object to store the transformed coordinates in. + * + * @return {Phaser.Types.Math.Vector2Like} The Point containing the transformed coordinates. + */ + transformPoint: function (x, y, point) + { + if (point === undefined) { point = { x: 0, y: 0 }; } + + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + var tx = matrix[4]; + var ty = matrix[5]; + + point.x = x * a + y * c + tx; + point.y = x * b + y * d + ty; + + return point; + }, + + /** + * Invert the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#invert + * @since 3.0.0 + * + * @return {this} This TransformMatrix. + */ + invert: function () + { + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + var tx = matrix[4]; + var ty = matrix[5]; + + var n = a * d - b * c; + + matrix[0] = d / n; + matrix[1] = -b / n; + matrix[2] = -c / n; + matrix[3] = a / n; + matrix[4] = (c * ty - d * tx) / n; + matrix[5] = -(a * ty - b * tx) / n; + + return this; + }, + + /** + * Set the values of this Matrix to copy those of the matrix given. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyFrom + * @since 3.11.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from. + * + * @return {this} This TransformMatrix. + */ + copyFrom: function (src) + { + var matrix = this.matrix; + + matrix[0] = src.a; + matrix[1] = src.b; + matrix[2] = src.c; + matrix[3] = src.d; + matrix[4] = src.e; + matrix[5] = src.f; + + return this; + }, + + /** + * Set the values of this Matrix to copy those of the array given. + * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyFromArray + * @since 3.11.0 + * + * @param {array} src - The array of values to set into this matrix. + * + * @return {this} This TransformMatrix. + */ + copyFromArray: function (src) + { + var matrix = this.matrix; + + matrix[0] = src[0]; + matrix[1] = src[1]; + matrix[2] = src[2]; + matrix[3] = src[3]; + matrix[4] = src[4]; + matrix[5] = src[5]; + + return this; + }, + + /** + * Copy the values from this Matrix to the given Canvas Rendering Context. + * This will use the Context.transform method. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyToContext + * @since 3.12.0 + * + * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to. + * + * @return {CanvasRenderingContext2D} The Canvas Rendering Context. + */ + copyToContext: function (ctx) + { + var matrix = this.matrix; + + ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); + + return ctx; + }, + + /** + * Copy the values from this Matrix to the given Canvas Rendering Context. + * This will use the Context.setTransform method. + * + * @method Phaser.GameObjects.Components.TransformMatrix#setToContext + * @since 3.12.0 + * + * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to. + * + * @return {CanvasRenderingContext2D} The Canvas Rendering Context. + */ + setToContext: function (ctx) + { + var matrix = this.matrix; + + ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); + + return ctx; + }, + + /** + * Copy the values in this Matrix to the array given. + * + * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray + * @since 3.12.0 + * + * @param {array} [out] - The array to copy the matrix values in to. + * + * @return {array} An array where elements 0 to 5 contain the values from this matrix. + */ + copyToArray: function (out) + { + var matrix = this.matrix; + + if (out === undefined) + { + out = [ matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] ]; + } + else + { + out[0] = matrix[0]; + out[1] = matrix[1]; + out[2] = matrix[2]; + out[3] = matrix[3]; + out[4] = matrix[4]; + out[5] = matrix[5]; + } + + return out; + }, + + /** + * Set the values of this Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#setTransform + * @since 3.0.0 + * + * @param {number} a - The Scale X value. + * @param {number} b - The Shear Y value. + * @param {number} c - The Shear X value. + * @param {number} d - The Scale Y value. + * @param {number} tx - The Translate X value. + * @param {number} ty - The Translate Y value. + * + * @return {this} This TransformMatrix. + */ + setTransform: function (a, b, c, d, tx, ty) + { + var matrix = this.matrix; + + matrix[0] = a; + matrix[1] = b; + matrix[2] = c; + matrix[3] = d; + matrix[4] = tx; + matrix[5] = ty; + + return this; + }, + + /** + * Decompose this Matrix into its translation, scale and rotation values using QR decomposition. + * + * The result must be applied in the following order to reproduce the current matrix: + * + * translate -> rotate -> scale + * + * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix + * @since 3.0.0 + * + * @return {Phaser.Types.GameObjects.DecomposeMatrixResults} The decomposed Matrix. + */ + decomposeMatrix: function () + { + var decomposedMatrix = this.decomposedMatrix; + + var matrix = this.matrix; + + // a = scale X (1) + // b = shear Y (0) + // c = shear X (0) + // d = scale Y (1) + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + + var determ = a * d - b * c; + + decomposedMatrix.translateX = matrix[4]; + decomposedMatrix.translateY = matrix[5]; + + if (a || b) + { + var r = Math.sqrt(a * a + b * b); + + decomposedMatrix.rotation = (b > 0) ? Math.acos(a / r) : -Math.acos(a / r); + decomposedMatrix.scaleX = r; + decomposedMatrix.scaleY = determ / r; + } + else if (c || d) + { + var s = Math.sqrt(c * c + d * d); + + decomposedMatrix.rotation = Math.PI * 0.5 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s)); + decomposedMatrix.scaleX = determ / s; + decomposedMatrix.scaleY = s; + } + else + { + decomposedMatrix.rotation = 0; + decomposedMatrix.scaleX = 0; + decomposedMatrix.scaleY = 0; + } + + return decomposedMatrix; + }, + + /** + * Apply the identity, translate, rotate and scale operations on the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#applyITRS + * @since 3.0.0 + * + * @param {number} x - The horizontal translation. + * @param {number} y - The vertical translation. + * @param {number} rotation - The angle of rotation in radians. + * @param {number} scaleX - The horizontal scale. + * @param {number} scaleY - The vertical scale. + * + * @return {this} This TransformMatrix. + */ + applyITRS: function (x, y, rotation, scaleX, scaleY) + { + var matrix = this.matrix; + + var radianSin = Math.sin(rotation); + var radianCos = Math.cos(rotation); + + // Translate + matrix[4] = x; + matrix[5] = y; + + // Rotate and Scale + matrix[0] = radianCos * scaleX; + matrix[1] = radianSin * scaleX; + matrix[2] = -radianSin * scaleY; + matrix[3] = radianCos * scaleY; + + return this; + }, + + /** + * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of + * the current matrix with its transformation applied. + * + * Can be used to translate points from world to local space. + * + * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse + * @since 3.12.0 + * + * @param {number} x - The x position to translate. + * @param {number} y - The y position to translate. + * @param {Phaser.Math.Vector2} [output] - A Vector2, or point-like object, to store the results in. + * + * @return {Phaser.Math.Vector2} The coordinates, inverse-transformed through this matrix. + */ + applyInverse: function (x, y, output) + { + if (output === undefined) { output = new Vector2(); } + + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + var tx = matrix[4]; + var ty = matrix[5]; + + var id = 1 / ((a * d) + (c * -b)); + + output.x = (d * id * x) + (-c * id * y) + (((ty * c) - (tx * d)) * id); + output.y = (a * id * y) + (-b * id * x) + (((-ty * a) + (tx * b)) * id); + + return output; + }, + + /** + * Performs the 8 calculations required to create the vertices of + * a quad based on this matrix and the given x/y/xw/yh values. + * + * The result is stored in `TransformMatrix.quad`, which is returned + * from this method. + * + * @method Phaser.GameObjects.Components.TransformMatrix#setQuad + * @since 3.60.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {number} xw - The xw value. + * @param {number} yh - The yh value. + * @param {boolean} roundPixels - Pass the results via Math.round? + * @param {Float32Array} [quad] - Optional Float32Array to store the results in. Otherwises uses the local quad array. + * + * @return {Float32Array} The quad Float32Array. + */ + setQuad: function (x, y, xw, yh, roundPixels, quad) + { + if (quad === undefined) { quad = this.quad; } + + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + var e = matrix[4]; + var f = matrix[5]; + + quad[0] = x * a + y * c + e; + quad[1] = x * b + y * d + f; + + quad[2] = x * a + yh * c + e; + quad[3] = x * b + yh * d + f; + + quad[4] = xw * a + yh * c + e; + quad[5] = xw * b + yh * d + f; + + quad[6] = xw * a + y * c + e; + quad[7] = xw * b + y * d + f; + + if (roundPixels) + { + quad.forEach(function (value, index) + { + quad[index] = Math.round(value); + }); + } + + return quad; + }, + + /** + * Returns the X component of this matrix multiplied by the given values. + * This is the same as `x * a + y * c + e`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getX + * @since 3.12.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * + * @return {number} The calculated x value. + */ + getX: function (x, y) + { + return x * this.a + y * this.c + this.e; + }, + + /** + * Returns the Y component of this matrix multiplied by the given values. + * This is the same as `x * b + y * d + f`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getY + * @since 3.12.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * + * @return {number} The calculated y value. + */ + getY: function (x, y) + { + return x * this.b + y * this.d + this.f; + }, + + /** + * Returns the X component of this matrix multiplied by the given values. + * + * This is the same as `x * a + y * c + e`, optionally passing via `Math.round`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getXRound + * @since 3.50.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {boolean} [round=false] - Math.round the resulting value? + * + * @return {number} The calculated x value. + */ + getXRound: function (x, y, round) + { + var v = this.getX(x, y); + + if (round) + { + v = Math.round(v); + } + + return v; + }, + + /** + * Returns the Y component of this matrix multiplied by the given values. + * + * This is the same as `x * b + y * d + f`, optionally passing via `Math.round`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getYRound + * @since 3.50.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {boolean} [round=false] - Math.round the resulting value? + * + * @return {number} The calculated y value. + */ + getYRound: function (x, y, round) + { + var v = this.getY(x, y); + + if (round) + { + v = Math.round(v); + } + + return v; + }, + + /** + * Returns a string that can be used in a CSS Transform call as a `matrix` property. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix + * @since 3.12.0 + * + * @return {string} A string containing the CSS Transform matrix values. + */ + getCSSMatrix: function () + { + var m = this.matrix; + + return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')'; + }, + + /** + * Destroys this Transform Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#destroy + * @since 3.4.0 + */ + destroy: function () + { + this.matrix = null; + this.quad = null; + this.decomposedMatrix = null; + } + +}); + +module.exports = TransformMatrix; + + +/***/ }), + +/***/ 8414: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// bitmask flag for GameObject.renderMask +var _FLAG = 1; // 0001 + +/** + * Provides methods used for setting the visibility of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Visible + * @since 3.0.0 + */ + +var Visible = { + + /** + * Private internal value. Holds the visible value. + * + * @name Phaser.GameObjects.Components.Visible#_visible + * @type {boolean} + * @private + * @default true + * @since 3.0.0 + */ + _visible: true, + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * + * @name Phaser.GameObjects.Components.Visible#visible + * @type {boolean} + * @since 3.0.0 + */ + visible: { + + get: function () + { + return this._visible; + }, + + set: function (value) + { + if (value) + { + this._visible = true; + this.renderFlags |= _FLAG; + } + else + { + this._visible = false; + this.renderFlags &= ~_FLAG; + } + } + + }, + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * + * @method Phaser.GameObjects.Components.Visible#setVisible + * @since 3.0.0 + * + * @param {boolean} value - The visible state of the Game Object. + * + * @return {this} This Game Object instance. + */ + setVisible: function (value) + { + this.visible = value; + + return this; + } +}; + +module.exports = Visible; + + +/***/ }), + +/***/ 4286: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Components + */ + +module.exports = { + + Alpha: __webpack_require__(4344), + AlphaSingle: __webpack_require__(4518), + BlendMode: __webpack_require__(5173), + ComputedSize: __webpack_require__(1991), + Crop: __webpack_require__(8305), + Depth: __webpack_require__(3131), + Flip: __webpack_require__(9660), + FX: __webpack_require__(1626), + GetBounds: __webpack_require__(3671), + Mask: __webpack_require__(2246), + Origin: __webpack_require__(5085), + PathFollower: __webpack_require__(77), + Pipeline: __webpack_require__(986), + PostPipeline: __webpack_require__(4461), + ScrollFactor: __webpack_require__(4627), + Size: __webpack_require__(1868), + Texture: __webpack_require__(4976), + TextureCrop: __webpack_require__(9243), + Tint: __webpack_require__(5693), + ToJSON: __webpack_require__(6125), + Transform: __webpack_require__(3212), + TransformMatrix: __webpack_require__(4227), + Visible: __webpack_require__(8414) + +}; + + +/***/ }), + +/***/ 7361: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -39418,16 +30152,16 @@ module.exports = SpineContainer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(260); -var BlendModes = __webpack_require__(13); -var Class = __webpack_require__(0); -var Components = __webpack_require__(311); -var Events = __webpack_require__(60); -var GameObject = __webpack_require__(58); -var Rectangle = __webpack_require__(29); -var Render = __webpack_require__(341); -var Union = __webpack_require__(343); -var Vector2 = __webpack_require__(3); +var ArrayUtils = __webpack_require__(1953); +var BlendModes = __webpack_require__(8351); +var Class = __webpack_require__(7473); +var Components = __webpack_require__(4286); +var Events = __webpack_require__(3389); +var GameObject = __webpack_require__(2273); +var Rectangle = __webpack_require__(1392); +var Render = __webpack_require__(3232); +var Union = __webpack_require__(9422); +var Vector2 = __webpack_require__(2529); /** * @classdesc @@ -39483,7 +30217,7 @@ var Vector2 = __webpack_require__(3); * @extends Phaser.GameObjects.Components.ComputedSize * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Mask - * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.PostPipeline * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible * @@ -39502,7 +30236,7 @@ var Container = new Class({ Components.ComputedSize, Components.Depth, Components.Mask, - Components.Pipeline, + Components.PostPipeline, Components.Transform, Components.Visible, Render @@ -39657,12 +30391,10 @@ var Container = new Class({ */ this.scrollFactorY = 1; - this.initPipeline(); + this.initPostPipeline(); this.setPosition(x, y); - this.clearAlpha(); - this.setBlendMode(BlendModes.SKIP_CHECK); if (children) @@ -40875,266 +31607,194 @@ module.exports = Container; /***/ }), -/* 260 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 3232: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> * @copyright 2013-2023 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * @namespace Phaser.Utils.Array - */ +var NOOP = __webpack_require__(1984); +var renderWebGL = NOOP; +var renderCanvas = NOOP; + +if (true) +{ + renderWebGL = __webpack_require__(4343); +} + +if (false) +{} module.exports = { - Matrix: __webpack_require__(261), - - Add: __webpack_require__(270), - AddAt: __webpack_require__(271), - BringToTop: __webpack_require__(272), - CountAllMatching: __webpack_require__(273), - Each: __webpack_require__(274), - EachInRange: __webpack_require__(275), - FindClosestInSorted: __webpack_require__(276), - Flatten: __webpack_require__(277), - GetAll: __webpack_require__(278), - GetFirst: __webpack_require__(279), - GetRandom: __webpack_require__(280), - MoveDown: __webpack_require__(281), - MoveTo: __webpack_require__(282), - MoveUp: __webpack_require__(283), - MoveAbove: __webpack_require__(284), - MoveBelow: __webpack_require__(285), - NumberArray: __webpack_require__(286), - NumberArrayStep: __webpack_require__(287), - QuickSelect: __webpack_require__(288), - Range: __webpack_require__(289), - Remove: __webpack_require__(290), - RemoveAt: __webpack_require__(291), - RemoveBetween: __webpack_require__(292), - RemoveRandomElement: __webpack_require__(293), - Replace: __webpack_require__(294), - RotateLeft: __webpack_require__(63), - RotateRight: __webpack_require__(64), - SafeRange: __webpack_require__(5), - SendToBack: __webpack_require__(295), - SetAll: __webpack_require__(296), - Shuffle: __webpack_require__(65), - SortByDigits: __webpack_require__(297), - SpliceOne: __webpack_require__(11), - StableSort: __webpack_require__(298), - Swap: __webpack_require__(310) + renderWebGL: renderWebGL, + renderCanvas: renderCanvas }; /***/ }), -/* 261 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 4343: +/***/ ((module) => { /** * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> * @copyright 2013-2023 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * @namespace Phaser.Utils.Array.Matrix + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Container#renderWebGL + * @since 3.4.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ - -module.exports = { - - CheckMatrix: __webpack_require__(27), - MatrixToString: __webpack_require__(262), - ReverseColumns: __webpack_require__(264), - ReverseRows: __webpack_require__(265), - Rotate180: __webpack_require__(266), - RotateLeft: __webpack_require__(267), - RotateMatrix: __webpack_require__(17), - RotateRight: __webpack_require__(268), - Translate: __webpack_require__(269), - TransposeMatrix: __webpack_require__(62) - -}; - - -/***/ }), -/* 262 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Pad = __webpack_require__(263); -var CheckMatrix = __webpack_require__(27); - -/** - * Generates a string (which you can pass to console.log) from the given Array Matrix. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.MatrixToString - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix] - * - * @param {T[][]} [matrix] - A 2-dimensional array. - * - * @return {string} A string representing the matrix. - */ -var MatrixToString = function (matrix) +var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) { - var str = ''; + camera.addToRenderList(container); - if (!CheckMatrix(matrix)) + var children = container.list; + var childCount = children.length; + + if (childCount === 0) { - return str; + return; } - for (var r = 0; r < matrix.length; r++) + var transformMatrix = container.localTransform; + + if (parentMatrix) { - for (var c = 0; c < matrix[r].length; c++) + transformMatrix.loadIdentity(); + transformMatrix.multiply(parentMatrix); + transformMatrix.translate(container.x, container.y); + transformMatrix.rotate(container.rotation); + transformMatrix.scale(container.scaleX, container.scaleY); + } + else + { + transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); + } + + renderer.pipelines.preBatch(container); + + var containerHasBlendMode = (container.blendMode !== -1); + + if (!containerHasBlendMode) + { + // If Container is SKIP_TEST then set blend mode to be Normal + renderer.setBlendMode(0); + } + + var alpha = container.alpha; + + var scrollFactorX = container.scrollFactorX; + var scrollFactorY = container.scrollFactorY; + + for (var i = 0; i < childCount; i++) + { + var child = children[i]; + + if (!child.willRender(camera)) { - var cell = matrix[r][c].toString(); - - if (cell !== 'undefined') - { - str += Pad(cell, 2); - } - else - { - str += '?'; - } - - if (c < matrix[r].length - 1) - { - str += ' |'; - } + continue; } - if (r < matrix.length - 1) + var childAlphaTopLeft; + var childAlphaTopRight; + var childAlphaBottomLeft; + var childAlphaBottomRight; + + if (child.alphaTopLeft !== undefined) { - str += '\n'; + childAlphaTopLeft = child.alphaTopLeft; + childAlphaTopRight = child.alphaTopRight; + childAlphaBottomLeft = child.alphaBottomLeft; + childAlphaBottomRight = child.alphaBottomRight; + } + else + { + var childAlpha = child.alpha; - for (var i = 0; i < matrix[r].length; i++) - { - str += '---'; - - if (i < matrix[r].length - 1) - { - str += '+'; - } - } - - str += '\n'; + childAlphaTopLeft = childAlpha; + childAlphaTopRight = childAlpha; + childAlphaBottomLeft = childAlpha; + childAlphaBottomRight = childAlpha; } - } + var childScrollFactorX = child.scrollFactorX; + var childScrollFactorY = child.scrollFactorY; - return str; -}; - -module.exports = MatrixToString; - - -/***/ }), -/* 263 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Takes the given string and pads it out, to the length required, using the character - * specified. For example if you need a string to be 6 characters long, you can call: - * - * `pad('bob', 6, '-', 2)` - * - * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right. - * - * You can also use it to pad numbers (they are always returned as strings): - * - * `pad(512, 6, '0', 1)` - * - * Would return: `000512` with the string padded to the left. - * - * If you don't specify a direction it'll pad to both sides: - * - * `pad('c64', 7, '*')` - * - * Would return: `**c64**` - * - * @function Phaser.Utils.String.Pad - * @since 3.0.0 - * - * @param {string|number|object} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. - * @param {number} [len=0] - The number of characters to be added. - * @param {string} [pad=" "] - The string to pad it out with (defaults to a space). - * @param {number} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). - * - * @return {string} The padded string. - */ -var Pad = function (str, len, pad, dir) -{ - if (len === undefined) { len = 0; } - if (pad === undefined) { pad = ' '; } - if (dir === undefined) { dir = 3; } - - str = str.toString(); - - var padlen = 0; - - if (len + 1 >= str.length) - { - switch (dir) + if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode) { - case 1: - str = new Array(len + 1 - str.length).join(pad) + str; - break; - - case 3: - var right = Math.ceil((padlen = len - str.length) / 2); - var left = padlen - right; - str = new Array(left + 1).join(pad) + str + new Array(right + 1).join(pad); - break; - - default: - str = str + new Array(len + 1 - str.length).join(pad); - break; + // If Container doesn't have its own blend mode, then a child can have one + renderer.setBlendMode(child.blendMode); } + + var mask = child.mask; + + if (mask) + { + mask.preRenderWebGL(renderer, child, camera); + } + + var type = child.type; + + if (type !== renderer.currentType) + { + renderer.newType = true; + renderer.currentType = type; + } + + renderer.nextTypeMatch = (i < childCount - 1) ? (children[i + 1].type === renderer.currentType) : false; + + // Set parent values + child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); + + child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha); + + // Render + child.renderWebGL(renderer, child, camera, transformMatrix, container); + + // Restore original values + + child.setAlpha(childAlphaTopLeft, childAlphaTopRight, childAlphaBottomLeft, childAlphaBottomRight); + + child.setScrollFactor(childScrollFactorX, childScrollFactorY); + + if (mask) + { + mask.postRenderWebGL(renderer, camera); + } + + renderer.newType = false; } - return str; + renderer.pipelines.postBatch(container); }; -module.exports = Pad; +module.exports = ContainerWebGLRenderer; /***/ }), -/* 264 */ -/***/ (function(module, exports) { + +/***/ 6608: +/***/ ((module) => { /** * @author Richard Davey @@ -41143,323 +31803,26 @@ module.exports = Pad; */ /** - * Reverses the columns in the given Array Matrix. + * The Game Object Added to Scene Event. * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: + * This event is dispatched when a Game Object is added to a Scene. * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` + * Listen for it on a Game Object instance using `GameObject.on('addedtoscene', listener)`. * - * @function Phaser.Utils.Array.Matrix.ReverseColumns - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array matrix to reverse the columns for. - * - * @return {T[][]} The column reversed matrix. - */ -var ReverseColumns = function (matrix) -{ - return matrix.reverse(); -}; - -module.exports = ReverseColumns; - - -/***/ }), -/* 265 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Reverses the rows in the given Array Matrix. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.ReverseRows - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array matrix to reverse the rows for. - * - * @return {T[][]} The column reversed matrix. - */ -var ReverseRows = function (matrix) -{ - for (var i = 0; i < matrix.length; i++) - { - matrix[i].reverse(); - } - - return matrix; -}; - -module.exports = ReverseRows; - - -/***/ }), -/* 266 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var RotateMatrix = __webpack_require__(17); - -/** - * Rotates the array matrix 180 degrees. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.Rotate180 - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array to rotate. - * - * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. - */ -var Rotate180 = function (matrix) -{ - return RotateMatrix(matrix, 180); -}; - -module.exports = Rotate180; - - -/***/ }), -/* 267 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var RotateMatrix = __webpack_require__(17); - -/** - * Rotates the array matrix to the left (or 90 degrees) - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.RotateLeft - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array to rotate. - * - * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. - */ -var RotateLeft = function (matrix) -{ - return RotateMatrix(matrix, 90); -}; - -module.exports = RotateLeft; - - -/***/ }), -/* 268 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var RotateMatrix = __webpack_require__(17); - -/** - * Rotates the array matrix to the left (or -90 degrees) - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.RotateRight - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array to rotate. - * - * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. - */ -var RotateRight = function (matrix) -{ - return RotateMatrix(matrix, -90); -}; - -module.exports = RotateRight; - - -/***/ }), -/* 269 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var RotateLeft = __webpack_require__(63); -var RotateRight = __webpack_require__(64); - -/** - * Translates the given Array Matrix by shifting each column and row the - * amount specified. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.Translate + * @event Phaser.GameObjects.Events#ADDED_TO_SCENE + * @type {string} * @since 3.50.0 * - * @generic T - * @genericUse {T[][]} - [matrix,$return] - * - * @param {T[][]} [matrix] - The array matrix to translate. - * @param {number} [x=0] - The amount to horizontally translate the matrix by. - * @param {number} [y=0] - The amount to vertically translate the matrix by. - * - * @return {T[][]} The translated matrix. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene. + * @param {Phaser.Scene} scene - The Scene to which the Game Object was added. */ -var TranslateMatrix = function (matrix, x, y) -{ - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - - // Vertical translation - - if (y !== 0) - { - if (y < 0) - { - // Shift Up - RotateLeft(matrix, Math.abs(y)); - } - else - { - // Shift Down - RotateRight(matrix, y); - } - } - - // Horizontal translation - - if (x !== 0) - { - for (var i = 0; i < matrix.length; i++) - { - var row = matrix[i]; - - if (x < 0) - { - RotateLeft(row, Math.abs(x)); - } - else - { - RotateRight(row, x); - } - } - } - - return matrix; -}; - -module.exports = TranslateMatrix; +module.exports = 'addedtoscene'; /***/ }), -/* 270 */ -/***/ (function(module, exports) { + +/***/ 4265: +/***/ ((module) => { /** * @author Richard Davey @@ -41468,513 +31831,26 @@ module.exports = TranslateMatrix; */ /** - * Adds the given item, or array of items, to the array. + * The Game Object Destroy Event. * - * Each item must be unique within the array. + * This event is dispatched when a Game Object instance is being destroyed. * - * The array is modified in-place and returned. + * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`. * - * You can optionally specify a limit to the maximum size of the array. If the quantity of items being - * added will take the array length over this limit, it will stop adding once the limit is reached. - * - * You can optionally specify a callback to be invoked for each item successfully added to the array. - * - * @function Phaser.Utils.Array.Add - * @since 3.4.0 - * - * @param {array} array - The array to be added to. - * @param {any|any[]} item - The item, or array of items, to add to the array. Each item must be unique within the array. - * @param {number} [limit] - Optional limit which caps the size of the array. - * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {array} The input array. - */ -var Add = function (array, item, limit, callback, context) -{ - if (context === undefined) { context = array; } - - if (limit > 0) - { - var remaining = limit - array.length; - - // There's nothing more we can do here, the array is full - if (remaining <= 0) - { - return null; - } - } - - // Fast path to avoid array mutation and iteration - if (!Array.isArray(item)) - { - if (array.indexOf(item) === -1) - { - array.push(item); - - if (callback) - { - callback.call(context, item); - } - - return item; - } - else - { - return null; - } - } - - // If we got this far, we have an array of items to insert - - // Ensure all the items are unique - var itemLength = item.length - 1; - - while (itemLength >= 0) - { - if (array.indexOf(item[itemLength]) !== -1) - { - // Already exists in array, so remove it - item.splice(itemLength, 1); - } - - itemLength--; - } - - // Anything left? - itemLength = item.length; - - if (itemLength === 0) - { - return null; - } - - if (limit > 0 && itemLength > remaining) - { - item.splice(remaining); - - itemLength = remaining; - } - - for (var i = 0; i < itemLength; i++) - { - var entry = item[i]; - - array.push(entry); - - if (callback) - { - callback.call(context, entry); - } - } - - return item; -}; - -module.exports = Add; - - -/***/ }), -/* 271 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Adds the given item, or array of items, to the array starting at the index specified. - * - * Each item must be unique within the array. - * - * Existing elements in the array are shifted up. - * - * The array is modified in-place and returned. - * - * You can optionally specify a limit to the maximum size of the array. If the quantity of items being - * added will take the array length over this limit, it will stop adding once the limit is reached. - * - * You can optionally specify a callback to be invoked for each item successfully added to the array. - * - * @function Phaser.Utils.Array.AddAt - * @since 3.4.0 - * - * @param {array} array - The array to be added to. - * @param {any|any[]} item - The item, or array of items, to add to the array. - * @param {number} [index=0] - The index in the array where the item will be inserted. - * @param {number} [limit] - Optional limit which caps the size of the array. - * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {array} The input array. - */ -var AddAt = function (array, item, index, limit, callback, context) -{ - if (index === undefined) { index = 0; } - if (context === undefined) { context = array; } - - if (limit > 0) - { - var remaining = limit - array.length; - - // There's nothing more we can do here, the array is full - if (remaining <= 0) - { - return null; - } - } - - // Fast path to avoid array mutation and iteration - if (!Array.isArray(item)) - { - if (array.indexOf(item) === -1) - { - array.splice(index, 0, item); - - if (callback) - { - callback.call(context, item); - } - - return item; - } - else - { - return null; - } - } - - // If we got this far, we have an array of items to insert - - // Ensure all the items are unique - var itemLength = item.length - 1; - - while (itemLength >= 0) - { - if (array.indexOf(item[itemLength]) !== -1) - { - // Already exists in array, so remove it - item.pop(); - } - - itemLength--; - } - - // Anything left? - itemLength = item.length; - - if (itemLength === 0) - { - return null; - } - - // Truncate to the limit - if (limit > 0 && itemLength > remaining) - { - item.splice(remaining); - - itemLength = remaining; - } - - for (var i = itemLength - 1; i >= 0; i--) - { - var entry = item[i]; - - array.splice(index, 0, entry); - - if (callback) - { - callback.call(context, entry); - } - } - - return item; -}; - -module.exports = AddAt; - - -/***/ }), -/* 272 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given element to the top of the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.BringToTop - * @since 3.4.0 - * - * @param {array} array - The array. - * @param {*} item - The element to move. - * - * @return {*} The element that was moved. - */ -var BringToTop = function (array, item) -{ - var currentIndex = array.indexOf(item); - - if (currentIndex !== -1 && currentIndex < array.length) - { - array.splice(currentIndex, 1); - array.push(item); - } - - return item; -}; - -module.exports = BringToTop; - - -/***/ }), -/* 273 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Returns the total number of elements in the array which have a property matching the given value. - * - * @function Phaser.Utils.Array.CountAllMatching - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {string} property - The property to test on each array element. - * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {number} [startIndex] - An optional start index to search from. - * @param {number} [endIndex] - An optional end index to search to. - * - * @return {number} The total number of elements with properties matching the given value. - */ -var CountAllMatching = function (array, property, value, startIndex, endIndex) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - - var total = 0; - - if (SafeRange(array, startIndex, endIndex)) - { - for (var i = startIndex; i < endIndex; i++) - { - var child = array[i]; - - if (child[property] === value) - { - total++; - } - } - } - - return total; -}; - -module.exports = CountAllMatching; - - -/***/ }), -/* 274 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Passes each element in the array to the given callback. - * - * @function Phaser.Utils.Array.Each - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {function} callback - A callback to be invoked for each item in the array. - * @param {object} context - The context in which the callback is invoked. - * @param {...*} [args] - Additional arguments that will be passed to the callback, after the current array item. - * - * @return {array} The input array. - */ -var Each = function (array, callback, context) -{ - var i; - var args = [ null ]; - - for (i = 3; i < arguments.length; i++) - { - args.push(arguments[i]); - } - - for (i = 0; i < array.length; i++) - { - args[0] = array[i]; - - callback.apply(context, args); - } - - return array; -}; - -module.exports = Each; - - -/***/ }), -/* 275 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Passes each element in the array, between the start and end indexes, to the given callback. - * - * @function Phaser.Utils.Array.EachInRange - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {function} callback - A callback to be invoked for each item in the array. - * @param {object} context - The context in which the callback is invoked. - * @param {number} startIndex - The start index to search from. - * @param {number} endIndex - The end index to search to. - * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. - * - * @return {array} The input array. - */ -var EachInRange = function (array, callback, context, startIndex, endIndex) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - - if (SafeRange(array, startIndex, endIndex)) - { - var i; - var args = [ null ]; - - for (i = 5; i < arguments.length; i++) - { - args.push(arguments[i]); - } - - for (i = startIndex; i < endIndex; i++) - { - args[0] = array[i]; - - callback.apply(context, args); - } - } - - return array; -}; - -module.exports = EachInRange; - - -/***/ }), -/* 276 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Searches a pre-sorted array for the closet value to the given number. - * - * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, - * and will check for the closest value of those to the given number. - * - * @function Phaser.Utils.Array.FindClosestInSorted + * @event Phaser.GameObjects.Events#DESTROY + * @type {string} * @since 3.0.0 * - * @param {number} value - The value to search for in the array. - * @param {array} array - The array to search, which must be sorted. - * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. - * - * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed. + * @param {boolean} fromScene - `True` if this Game Object is being destroyed by the Scene, `false` if not. */ -var FindClosestInSorted = function (value, array, key) -{ - if (!array.length) - { - return NaN; - } - else if (array.length === 1) - { - return array[0]; - } - - var i = 1; - var low; - var high; - - if (key) - { - if (value < array[0][key]) - { - return array[0]; - } - - while (array[i][key] < value) - { - i++; - } - } - else - { - while (array[i] < value) - { - i++; - } - } - - if (i > array.length) - { - i = array.length; - } - - if (key) - { - low = array[i - 1][key]; - high = array[i][key]; - - return ((high - value) <= (value - low)) ? array[i] : array[i - 1]; - } - else - { - low = array[i - 1]; - high = array[i]; - - return ((high - value) <= (value - low)) ? high : low; - } -}; - -module.exports = FindClosestInSorted; +module.exports = 'destroy'; /***/ }), -/* 277 */ -/***/ (function(module, exports) { + +/***/ 8671: +/***/ ((module) => { /** * @author Richard Davey @@ -41983,162 +31859,151 @@ module.exports = FindClosestInSorted; */ /** - * Takes an array and flattens it, returning a shallow-copy flattened array. + * The Game Object Removed from Scene Event. * - * @function Phaser.Utils.Array.Flatten + * This event is dispatched when a Game Object is removed from a Scene. + * + * Listen for it on a Game Object instance using `GameObject.on('removedfromscene', listener)`. + * + * @event Phaser.GameObjects.Events#REMOVED_FROM_SCENE + * @type {string} + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene. + * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed. + */ +module.exports = 'removedfromscene'; + + +/***/ }), + +/***/ 3420: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Complete Event. + * + * This event is dispatched when a Video finishes playback by reaching the end of its duration. It + * is also dispatched if a video marker sequence is being played and reaches the end. + * + * Note that not all videos can fire this event. Live streams, for example, have no fixed duration, + * so never technically 'complete'. + * + * If a video is stopped from playback, via the `Video.stop` method, it will emit the + * `VIDEO_STOP` event instead of this one. + * + * Listen for it from a Video Game Object instance using `Video.on('complete', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_COMPLETE + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed playback. + */ +module.exports = 'complete'; + + +/***/ }), + +/***/ 601: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Created Event. + * + * This event is dispatched when the texture for a Video has been created. This happens + * when enough of the video source has been loaded that the browser is able to render a + * frame from it. + * + * Listen for it from a Video Game Object instance using `Video.on('created', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_CREATED + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. + * @param {number} width - The width of the video. + * @param {number} height - The height of the video. + */ +module.exports = 'created'; + + +/***/ }), + +/***/ 7919: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Error Event. + * + * This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type. + * + * Listen for it from a Video Game Object instance using `Video.on('error', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_ERROR + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. + * @param {DOMException|string} event - The native DOM event the browser raised during playback. + */ +module.exports = 'error'; + + +/***/ }), + +/***/ 6231: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Locked Event. + * + * This event is dispatched when a Video was attempted to be played, but the browser prevented it + * from doing so due to the Media Engagement Interaction policy. + * + * If you get this event you will need to wait for the user to interact with the browser before + * the video will play. This is a browser security measure to prevent autoplaying videos with + * audio. An interaction includes a mouse click, a touch, or a key press. + * + * Listen for it from a Video Game Object instance using `Video.on('locked', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_LOCKED + * @type {string} * @since 3.60.0 * - * @param {array} array - The array to flatten. - * @param {array} [output] - An array to hold the results in. - * - * @return {array} The flattened output array. + * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. */ -var Flatten = function (array, output) -{ - if (output === undefined) { output = []; } - - for (var i = 0; i < array.length; i++) - { - if (Array.isArray(array[i])) - { - Flatten(array[i], output); - } - else - { - output.push(array[i]); - } - } - - return output; -}; - -module.exports = Flatten; +module.exports = 'locked'; /***/ }), -/* 278 */ -/***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Returns all elements in the array. - * - * You can optionally specify a matching criteria using the `property` and `value` arguments. - * - * For example: `getAll('visible', true)` would return only elements that have their visible property set. - * - * Optionally you can specify a start and end index. For example if the array had 100 elements, - * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only - * the first 50 elements. - * - * @function Phaser.Utils.Array.GetAll - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {string} [property] - The property to test on each array element. - * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {number} [startIndex] - An optional start index to search from. - * @param {number} [endIndex] - An optional end index to search to. - * - * @return {array} All matching elements from the array. - */ -var GetAll = function (array, property, value, startIndex, endIndex) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - - var output = []; - - if (SafeRange(array, startIndex, endIndex)) - { - for (var i = startIndex; i < endIndex; i++) - { - var child = array[i]; - - if (!property || - (property && value === undefined && child.hasOwnProperty(property)) || - (property && value !== undefined && child[property] === value)) - { - output.push(child); - } - } - } - - return output; -}; - -module.exports = GetAll; - - -/***/ }), -/* 279 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Returns the first element in the array. - * - * You can optionally specify a matching criteria using the `property` and `value` arguments. - * - * For example: `getAll('visible', true)` would return the first element that had its `visible` property set. - * - * Optionally you can specify a start and end index. For example if the array had 100 elements, - * and you set `startIndex` to 0 and `endIndex` to 50, it would search only the first 50 elements. - * - * @function Phaser.Utils.Array.GetFirst - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {string} [property] - The property to test on each array element. - * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {number} [startIndex=0] - An optional start index to search from. - * @param {number} [endIndex=array.length] - An optional end index to search up to (but not included) - * - * @return {object} The first matching element from the array, or `null` if no element could be found in the range given. - */ -var GetFirst = function (array, property, value, startIndex, endIndex) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - - if (SafeRange(array, startIndex, endIndex)) - { - for (var i = startIndex; i < endIndex; i++) - { - var child = array[i]; - - if (!property || - (property && value === undefined && child.hasOwnProperty(property)) || - (property && value !== undefined && child[property] === value)) - { - return child; - } - } - } - - return null; -}; - -module.exports = GetFirst; - - -/***/ }), -/* 280 */ -/***/ (function(module, exports) { +/***/ 5241: +/***/ ((module) => { /** * @author Richard Davey @@ -42147,722 +32012,464 @@ module.exports = GetFirst; */ /** - * Returns a Random element from the array. + * The Video Game Object Loop Event. * - * @function Phaser.Utils.Array.GetRandom + * This event is dispatched when a Video that is currently playing has looped. This only + * happens if the `loop` parameter was specified, or the `setLoop` method was called, + * and if the video has a fixed duration. Video streams, for example, cannot loop, as + * they have no duration. + * + * Looping is based on the result of the Video `timeupdate` event. This event is not + * frame-accurate, due to the way browsers work, so please do not rely on this loop + * event to be time or frame precise. + * + * Listen for it from a Video Game Object instance using `Video.on('loop', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_LOOP + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which has looped. + */ +module.exports = 'loop'; + + +/***/ }), + +/***/ 8325: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Playing Event. + * + * The playing event is fired after playback is first started, + * and whenever it is restarted. For example it is fired when playback + * resumes after having been paused or delayed due to lack of data. + * + * Listen for it from a Video Game Object instance using `Video.on('playing', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_PLAYING + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. + */ +module.exports = 'playing'; + + +/***/ }), + +/***/ 3356: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Play Event. + * + * This event is dispatched when a Video begins playback. For videos that do not require + * interaction unlocking, this is usually as soon as the `Video.play` method is called. + * However, for videos that require unlocking, it is fired once playback begins after + * they've been unlocked. + * + * Listen for it from a Video Game Object instance using `Video.on('play', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_PLAY + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. + */ +module.exports = 'play'; + + +/***/ }), + +/***/ 7513: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Seeked Event. + * + * This event is dispatched when a Video completes seeking to a new point in its timeline. + * + * Listen for it from a Video Game Object instance using `Video.on('seeked', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_SEEKED + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed seeking. + */ +module.exports = 'seeked'; + + +/***/ }), + +/***/ 5788: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Seeking Event. + * + * This event is dispatched when a Video _begins_ seeking to a new point in its timeline. + * When the seek is complete, it will dispatch the `VIDEO_SEEKED` event to conclude. + * + * Listen for it from a Video Game Object instance using `Video.on('seeking', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_SEEKING + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started seeking. + */ +module.exports = 'seeking'; + + +/***/ }), + +/***/ 7111: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Stalled Event. + * + * This event is dispatched by a Video Game Object when the video playback stalls. + * + * This can happen if the video is buffering. + * + * If will fire for any of the following native DOM events: + * + * `stalled` + * `suspend` + * `waiting` + * + * Listen for it from a Video Game Object instance using `Video.on('stalled', listener)`. + * + * Note that being stalled isn't always a negative thing. A video can be stalled if it + * has downloaded enough data in to its buffer to not need to download any more until + * the current batch of frames have rendered. + * + * @event Phaser.GameObjects.Events#VIDEO_STALLED + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. + * @param {Event} event - The native DOM event the browser raised during playback. + */ +module.exports = 'stalled'; + + +/***/ }), + +/***/ 8118: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Stopped Event. + * + * This event is dispatched when a Video is stopped from playback via a call to the `Video.stop` method, + * either directly via game code, or indirectly as the result of changing a video source or destroying it. + * + * Listen for it from a Video Game Object instance using `Video.on('stop', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_STOP + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which stopped playback. + */ +module.exports = 'stop'; + + +/***/ }), + +/***/ 9184: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Texture Ready Event. + * + * This event is dispatched by a Video Game Object when it has finished creating its texture. + * + * This happens when the video has finished loading enough data for its first frame. + * + * If you wish to use the Video texture elsewhere in your game, such as as a Sprite texture, + * then you should listen for this event first, before creating the Sprites that use it. + * + * Listen for it from a Video Game Object instance using `Video.on('textureready', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_TEXTURE + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object that emitted the event. + * @param {Phaser.Textures.Texture} texture - The Texture that was created. + */ +module.exports = 'textureready'; + + +/***/ }), + +/***/ 4287: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Unlocked Event. + * + * This event is dispatched when a Video that was prevented from playback due to the browsers + * Media Engagement Interaction policy, is unlocked by a user gesture. + * + * Listen for it from a Video Game Object instance using `Video.on('unlocked', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_UNLOCKED + * @type {string} + * @since 3.20.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. + */ +module.exports = 'unlocked'; + + +/***/ }), + +/***/ 857: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Video Game Object Unsupported Event. + * + * This event is dispatched by a Video Game Object if the media source + * (which may be specified as a MediaStream, MediaSource, Blob, or File, + * for example) doesn't represent a supported media format. + * + * Listen for it from a Video Game Object instance using `Video.on('unsupported', listener)`. + * + * @event Phaser.GameObjects.Events#VIDEO_UNSUPPORTED + * @type {string} + * @since 3.60.0 + * + * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. + * @param {DOMException|string} event - The native DOM event the browser raised during playback. + */ +module.exports = 'unsupported'; + + +/***/ }), + +/***/ 3389: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Events + */ + +module.exports = { + + ADDED_TO_SCENE: __webpack_require__(6608), + DESTROY: __webpack_require__(4265), + REMOVED_FROM_SCENE: __webpack_require__(8671), + VIDEO_COMPLETE: __webpack_require__(3420), + VIDEO_CREATED: __webpack_require__(601), + VIDEO_ERROR: __webpack_require__(7919), + VIDEO_LOCKED: __webpack_require__(6231), + VIDEO_LOOP: __webpack_require__(5241), + VIDEO_PLAY: __webpack_require__(3356), + VIDEO_PLAYING: __webpack_require__(8325), + VIDEO_SEEKED: __webpack_require__(7513), + VIDEO_SEEKING: __webpack_require__(5788), + VIDEO_STALLED: __webpack_require__(7111), + VIDEO_STOP: __webpack_require__(8118), + VIDEO_TEXTURE: __webpack_require__(9184), + VIDEO_UNLOCKED: __webpack_require__(4287), + VIDEO_UNSUPPORTED: __webpack_require__(857) + +}; + + +/***/ }), + +/***/ 1643: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GEOM_CONST = { + + /** + * A Circle Geometry object type. + * + * @name Phaser.Geom.CIRCLE + * @type {number} + * @since 3.19.0 + */ + CIRCLE: 0, + + /** + * An Ellipse Geometry object type. + * + * @name Phaser.Geom.ELLIPSE + * @type {number} + * @since 3.19.0 + */ + ELLIPSE: 1, + + /** + * A Line Geometry object type. + * + * @name Phaser.Geom.LINE + * @type {number} + * @since 3.19.0 + */ + LINE: 2, + + /** + * A Point Geometry object type. + * + * @name Phaser.Geom.POINT + * @type {number} + * @since 3.19.0 + */ + POINT: 3, + + /** + * A Polygon Geometry object type. + * + * @name Phaser.Geom.POLYGON + * @type {number} + * @since 3.19.0 + */ + POLYGON: 4, + + /** + * A Rectangle Geometry object type. + * + * @name Phaser.Geom.RECTANGLE + * @type {number} + * @since 3.19.0 + */ + RECTANGLE: 5, + + /** + * A Triangle Geometry object type. + * + * @name Phaser.Geom.TRIANGLE + * @type {number} + * @since 3.19.0 + */ + TRIANGLE: 6 + +}; + +module.exports = GEOM_CONST; + + +/***/ }), + +/***/ 8881: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(7655); + +/** + * Get a point on a line that's a given percentage along its length. + * + * @function Phaser.Geom.Line.GetPoint * @since 3.0.0 * - * @param {array} array - The array to select the random entry from. - * @param {number} [startIndex=0] - An optional start index. - * @param {number} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from. + * @generic {Phaser.Geom.Point} O - [out,$return] * - * @return {*} A random element from the array, or `null` if no element could be found in the range given. + * @param {Phaser.Geom.Line} line - The line. + * @param {number} position - A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line. + * @param {(Phaser.Geom.Point|object)} [out] - An optional point, or point-like object, to store the coordinates of the point on the line. + * + * @return {(Phaser.Geom.Point|object)} The point on the line. */ -var GetRandom = function (array, startIndex, length) +var GetPoint = function (line, position, out) { - if (startIndex === undefined) { startIndex = 0; } - if (length === undefined) { length = array.length; } + if (out === undefined) { out = new Point(); } - var randomIndex = startIndex + Math.floor(Math.random() * length); - - return (array[randomIndex] === undefined) ? null : array[randomIndex]; -}; - -module.exports = GetRandom; - - -/***/ }), -/* 281 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given array element down one place in the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.MoveDown - * @since 3.4.0 - * - * @param {array} array - The input array. - * @param {*} item - The element to move down the array. - * - * @return {array} The input array. - */ -var MoveDown = function (array, item) -{ - var currentIndex = array.indexOf(item); - - if (currentIndex > 0) - { - var item2 = array[currentIndex - 1]; - - var index2 = array.indexOf(item2); - - array[currentIndex] = item2; - array[index2] = item; - } - - return array; -}; - -module.exports = MoveDown; - - -/***/ }), -/* 282 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves an element in an array to a new position within the same array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.MoveTo - * @since 3.4.0 - * - * @param {array} array - The array. - * @param {*} item - The element to move. - * @param {number} index - The new index that the element will be moved to. - * - * @return {*} The element that was moved. - */ -var MoveTo = function (array, item, index) -{ - var currentIndex = array.indexOf(item); - - if (currentIndex === -1 || index < 0 || index >= array.length) - { - throw new Error('Supplied index out of bounds'); - } - - if (currentIndex !== index) - { - // Remove - array.splice(currentIndex, 1); - - // Add in new location - array.splice(index, 0, item); - } - - return item; -}; - -module.exports = MoveTo; - - -/***/ }), -/* 283 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given array element up one place in the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.MoveUp - * @since 3.4.0 - * - * @param {array} array - The input array. - * @param {*} item - The element to move up the array. - * - * @return {array} The input array. - */ -var MoveUp = function (array, item) -{ - var currentIndex = array.indexOf(item); - - if (currentIndex !== -1 && currentIndex < array.length - 1) - { - // The element one above `item` in the array - var item2 = array[currentIndex + 1]; - var index2 = array.indexOf(item2); - - array[currentIndex] = item2; - array[index2] = item; - } - - return array; -}; - -module.exports = MoveUp; - - -/***/ }), -/* 284 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given array element above another one in the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.MoveAbove - * @since 3.55.0 - * - * @param {array} array - The input array. - * @param {*} item1 - The element to move above base element. - * @param {*} item2 - The base element. - * - * - * @return {array} The input array. - */ -var MoveAbove = function (array, item1, item2) -{ - if (item1 === item2) - { - return array; - } - - var currentIndex = array.indexOf(item1); - var baseIndex = array.indexOf(item2); - - if (currentIndex < 0 || baseIndex < 0) - { - throw new Error('Supplied items must be elements of the same array'); - } - - if (currentIndex > baseIndex) - { - // item1 is already above item2 - return array; - } - - // Remove - array.splice(currentIndex, 1); - - // Add in new location - if (baseIndex === array.length - 1) - { - array.push(item1); - } - else - { - array.splice(baseIndex, 0, item1); - } - - return array; -}; - -module.exports = MoveAbove; - - -/***/ }), -/* 285 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given array element below another one in the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.MoveBelow - * @since 3.55.0 - * - * @param {array} array - The input array. - * @param {*} item1 - The element to move below base element. - * @param {*} item2 - The base element. - * - * - * @return {array} The input array. - */ -var MoveBelow = function (array, item1, item2) -{ - if (item1 === item2) - { - return array; - } - - var currentIndex = array.indexOf(item1); - var baseIndex = array.indexOf(item2); - - if (currentIndex < 0 || baseIndex < 0) - { - throw new Error('Supplied items must be elements of the same array'); - } - - if (currentIndex < baseIndex) - { - // item1 is already below item2 - return array; - } - - // Remove - array.splice(currentIndex, 1); - - // Add in new location - if (baseIndex === 0) - { - array.unshift(item1); - } - else - { - array.splice(baseIndex, 0, item1); - } - - return array; -}; - -module.exports = MoveBelow; - - -/***/ }), -/* 286 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Create an array representing the range of numbers (usually integers), between, and inclusive of, - * the given `start` and `end` arguments. For example: - * - * `var array = Phaser.Utils.Array.NumberArray(2, 4); // array = [2, 3, 4]` - * `var array = Phaser.Utils.Array.NumberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` - * `var array = Phaser.Utils.Array.NumberArray(8, 2); // array = [8, 7, 6, 5, 4, 3, 2]` - * - * This is equivalent to `Phaser.Utils.Array.NumberArrayStep(start, end, 1)`. - * - * You can optionally provide a prefix and / or suffix string. If given the array will contain - * strings, not integers. For example: - * - * `var array = Phaser.Utils.Array.NumberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` - * `var array = Phaser.Utils.Array.NumberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` - * - * @function Phaser.Utils.Array.NumberArray - * @since 3.0.0 - * - * @param {number} start - The minimum value the array starts with. - * @param {number} end - The maximum value the array contains. - * @param {string} [prefix] - Optional prefix to place before the number. If provided the array will contain strings, not integers. - * @param {string} [suffix] - Optional suffix to place after the number. If provided the array will contain strings, not integers. - * - * @return {(number[]|string[])} The array of number values, or strings if a prefix or suffix was provided. - */ -var NumberArray = function (start, end, prefix, suffix) -{ - var result = []; - - var i; - var asString = false; - - if (prefix || suffix) - { - asString = true; - - if (!prefix) - { - prefix = ''; - } - - if (!suffix) - { - suffix = ''; - } - } - - if (end < start) - { - for (i = start; i >= end; i--) - { - if (asString) - { - result.push(prefix + i.toString() + suffix); - } - else - { - result.push(i); - } - } - } - else - { - for (i = start; i <= end; i++) - { - if (asString) - { - result.push(prefix + i.toString() + suffix); - } - else - { - result.push(i); - } - } - } - - return result; -}; - -module.exports = NumberArray; - - -/***/ }), -/* 287 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var RoundAwayFromZero = __webpack_require__(43); - -/** - * Create an array of numbers (positive and/or negative) progressing from `start` - * up to but not including `end` by advancing by `step`. - * - * If `start` is less than `end` a zero-length range is created unless a negative `step` is specified. - * - * Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0; - * for forward compatibility make sure to pass in actual numbers. - * - * @example - * NumberArrayStep(4); - * // => [0, 1, 2, 3] - * - * NumberArrayStep(1, 5); - * // => [1, 2, 3, 4] - * - * NumberArrayStep(0, 20, 5); - * // => [0, 5, 10, 15] - * - * NumberArrayStep(0, -4, -1); - * // => [0, -1, -2, -3] - * - * NumberArrayStep(1, 4, 0); - * // => [1, 1, 1] - * - * NumberArrayStep(0); - * // => [] - * - * @function Phaser.Utils.Array.NumberArrayStep - * @since 3.0.0 - * - * @param {number} [start=0] - The start of the range. - * @param {number} [end=null] - The end of the range. - * @param {number} [step=1] - The value to increment or decrement by. - * - * @return {number[]} The array of number values. - */ -var NumberArrayStep = function (start, end, step) -{ - if (start === undefined) { start = 0; } - if (end === undefined) { end = null; } - if (step === undefined) { step = 1; } - - if (end === null) - { - end = start; - start = 0; - } - - var result = []; - - var total = Math.max(RoundAwayFromZero((end - start) / (step || 1)), 0); - - for (var i = 0; i < total; i++) - { - result.push(start); - start += step; - } - - return result; -}; - -module.exports = NumberArrayStep; - - -/***/ }), -/* 288 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @ignore - */ -function swap (arr, i, j) -{ - var tmp = arr[i]; - arr[i] = arr[j]; - arr[j] = tmp; -} - -/** - * @ignore - */ -function defaultCompare (a, b) -{ - return a < b ? -1 : a > b ? 1 : 0; -} - -/** - * A [Floyd-Rivest](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm) quick selection algorithm. - * - * Rearranges the array items so that all items in the [left, k] range are smaller than all items in [k, right]; - * The k-th element will have the (k - left + 1)th smallest value in [left, right]. - * - * The array is modified in-place. - * - * Based on code by [Vladimir Agafonkin](https://www.npmjs.com/~mourner) - * - * @function Phaser.Utils.Array.QuickSelect - * @since 3.0.0 - * - * @param {array} arr - The array to sort. - * @param {number} k - The k-th element index. - * @param {number} [left=0] - The index of the left part of the range. - * @param {number} [right] - The index of the right part of the range. - * @param {function} [compare] - An optional comparison function. Is passed two elements and should return 0, 1 or -1. - */ -var QuickSelect = function (arr, k, left, right, compare) -{ - if (left === undefined) { left = 0; } - if (right === undefined) { right = arr.length - 1; } - if (compare === undefined) { compare = defaultCompare; } - - while (right > left) - { - if (right - left > 600) - { - var n = right - left + 1; - var m = k - left + 1; - var z = Math.log(n); - var s = 0.5 * Math.exp(2 * z / 3); - var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1); - var newLeft = Math.max(left, Math.floor(k - m * s / n + sd)); - var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd)); - - QuickSelect(arr, k, newLeft, newRight, compare); - } - - var t = arr[k]; - var i = left; - var j = right; - - swap(arr, left, k); - - if (compare(arr[right], t) > 0) - { - swap(arr, left, right); - } - - while (i < j) - { - swap(arr, i, j); - - i++; - j--; - - while (compare(arr[i], t) < 0) - { - i++; - } - - while (compare(arr[j], t) > 0) - { - j--; - } - } - - if (compare(arr[left], t) === 0) - { - swap(arr, left, j); - } - else - { - j++; - swap(arr, j, right); - } - - if (j <= k) - { - left = j + 1; - } - - if (k <= j) - { - right = j - 1; - } - } -}; - -module.exports = QuickSelect; - - -/***/ }), -/* 289 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GetValue = __webpack_require__(8); -var Shuffle = __webpack_require__(65); - -var BuildChunk = function (a, b, qty) -{ - var out = []; - - for (var aIndex = 0; aIndex < a.length; aIndex++) - { - for (var bIndex = 0; bIndex < b.length; bIndex++) - { - for (var i = 0; i < qty; i++) - { - out.push({ a: a[aIndex], b: b[bIndex] }); - } - } - } + out.x = line.x1 + (line.x2 - line.x1) * position; + out.y = line.y1 + (line.y2 - line.y1) * position; return out; }; -/** - * Creates an array populated with a range of values, based on the given arguments and configuration object. - * - * Range ([a,b,c], [1,2,3]) = - * a1, a2, a3, b1, b2, b3, c1, c2, c3 - * - * Range ([a,b], [1,2,3], qty = 3) = - * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3 - * - * Range ([a,b,c], [1,2,3], repeat x1) = - * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3 - * - * Range ([a,b], [1,2], repeat -1 = endless, max = 14) = - * Maybe if max is set then repeat goes to -1 automatically? - * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements) - * - * Range ([a], [1,2,3,4,5], random = true) = - * a4, a1, a5, a2, a3 - * - * Range ([a, b], [1,2,3], random = true) = - * b3, a2, a1, b1, a3, b2 - * - * Range ([a, b, c], [1,2,3], randomB = true) = - * a3, a1, a2, b2, b3, b1, c1, c3, c2 - * - * Range ([a], [1,2,3,4,5], yoyo = true) = - * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1 - * - * Range ([a, b], [1,2,3], yoyo = true) = - * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1 - * - * @function Phaser.Utils.Array.Range - * @since 3.0.0 - * - * @param {array} a - The first array of range elements. - * @param {array} b - The second array of range elements. - * @param {object} [options] - A range configuration object. Can contain: repeat, random, randomB, yoyo, max, qty. - * - * @return {array} An array of arranged elements. - */ -var Range = function (a, b, options) -{ - var max = GetValue(options, 'max', 0); - var qty = GetValue(options, 'qty', 1); - var random = GetValue(options, 'random', false); - var randomB = GetValue(options, 'randomB', false); - var repeat = GetValue(options, 'repeat', 0); - var yoyo = GetValue(options, 'yoyo', false); - - var out = []; - - if (randomB) - { - Shuffle(b); - } - - // Endless repeat, so limit by max - if (repeat === -1) - { - if (max === 0) - { - repeat = 0; - } - else - { - // Work out how many repeats we need - var total = (a.length * b.length) * qty; - - if (yoyo) - { - total *= 2; - } - - repeat = Math.ceil(max / total); - } - } - - for (var i = 0; i <= repeat; i++) - { - var chunk = BuildChunk(a, b, qty); - - if (random) - { - Shuffle(chunk); - } - - out = out.concat(chunk); - - if (yoyo) - { - chunk.reverse(); - - out = out.concat(chunk); - } - } - - if (max) - { - out.splice(max); - } - - return out; -}; - -module.exports = Range; +module.exports = GetPoint; /***/ }), -/* 290 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 4479: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -42870,3183 +32477,53 @@ module.exports = Range; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(11); +var Length = __webpack_require__(4771); +var Point = __webpack_require__(7655); /** - * Removes the given item, or array of items, from the array. + * Get a number of points along a line's length. * - * The array is modified in-place. + * Provide a `quantity` to get an exact number of points along the line. * - * You can optionally specify a callback to be invoked for each item successfully removed from the array. + * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when + * providing a `stepRate`. * - * @function Phaser.Utils.Array.Remove - * @since 3.4.0 - * - * @param {array} array - The array to be modified. - * @param {*|Array.<*>} item - The item, or array of items, to be removed from the array. - * @param {function} [callback] - A callback to be invoked for each item successfully removed from the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {*|Array.<*>} The item, or array of items, that were successfully removed from the array. - */ -var Remove = function (array, item, callback, context) -{ - if (context === undefined) { context = array; } - - var index; - - // Fast path to avoid array mutation and iteration - if (!Array.isArray(item)) - { - index = array.indexOf(item); - - if (index !== -1) - { - SpliceOne(array, index); - - if (callback) - { - callback.call(context, item); - } - - return item; - } - else - { - return null; - } - } - - // If we got this far, we have an array of items to remove - - var itemLength = item.length - 1; - var removed = []; - - while (itemLength >= 0) - { - var entry = item[itemLength]; - - index = array.indexOf(entry); - - if (index !== -1) - { - SpliceOne(array, index); - - removed.push(entry); - - if (callback) - { - callback.call(context, entry); - } - } - - itemLength--; - } - - return removed; -}; - -module.exports = Remove; - - -/***/ }), -/* 291 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SpliceOne = __webpack_require__(11); - -/** - * Removes the item from the given position in the array. - * - * The array is modified in-place. - * - * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array. - * - * @function Phaser.Utils.Array.RemoveAt - * @since 3.4.0 - * - * @param {array} array - The array to be modified. - * @param {number} index - The array index to remove the item from. The index must be in bounds or it will throw an error. - * @param {function} [callback] - A callback to be invoked for the item removed from the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {*} The item that was removed. - */ -var RemoveAt = function (array, index, callback, context) -{ - if (context === undefined) { context = array; } - - if (index < 0 || index > array.length - 1) - { - throw new Error('Index out of bounds'); - } - - var item = SpliceOne(array, index); - - if (callback) - { - callback.call(context, item); - } - - return item; -}; - -module.exports = RemoveAt; - - -/***/ }), -/* 292 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Removes the item within the given range in the array. - * - * The array is modified in-place. - * - * You can optionally specify a callback to be invoked for the item/s successfully removed from the array. - * - * @function Phaser.Utils.Array.RemoveBetween - * @since 3.4.0 - * - * @param {array} array - The array to be modified. - * @param {number} startIndex - The start index to remove from. - * @param {number} endIndex - The end index to remove to. - * @param {function} [callback] - A callback to be invoked for the item removed from the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {Array.<*>} An array of items that were removed. - */ -var RemoveBetween = function (array, startIndex, endIndex, callback, context) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - if (context === undefined) { context = array; } - - if (SafeRange(array, startIndex, endIndex)) - { - var size = endIndex - startIndex; - - var removed = array.splice(startIndex, size); - - if (callback) - { - for (var i = 0; i < removed.length; i++) - { - var entry = removed[i]; - - callback.call(context, entry); - } - } - - return removed; - } - else - { - return []; - } -}; - -module.exports = RemoveBetween; - - -/***/ }), -/* 293 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SpliceOne = __webpack_require__(11); - -/** - * Removes a random object from the given array and returns it. - * Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index. - * - * @function Phaser.Utils.Array.RemoveRandomElement - * @since 3.0.0 - * - * @param {array} array - The array to removed a random element from. - * @param {number} [start=0] - The array index to start the search from. - * @param {number} [length=array.length] - Optional restriction on the number of elements to randomly select from. - * - * @return {object} The random element that was removed, or `null` if there were no array elements that fell within the given range. - */ -var RemoveRandomElement = function (array, start, length) -{ - if (start === undefined) { start = 0; } - if (length === undefined) { length = array.length; } - - var randomIndex = start + Math.floor(Math.random() * length); - - return SpliceOne(array, randomIndex); -}; - -module.exports = RemoveRandomElement; - - -/***/ }), -/* 294 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Replaces an element of the array with the new element. - * The new element cannot already be a member of the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.Replace - * @since 3.4.0 - * - * @param {array} array - The array to search within. - * @param {*} oldChild - The element in the array that will be replaced. - * @param {*} newChild - The element to be inserted into the array at the position of `oldChild`. - * - * @return {boolean} Returns true if the oldChild was successfully replaced, otherwise returns false. - */ -var Replace = function (array, oldChild, newChild) -{ - var index1 = array.indexOf(oldChild); - var index2 = array.indexOf(newChild); - - if (index1 !== -1 && index2 === -1) - { - array[index1] = newChild; - - return true; - } - else - { - return false; - } -}; - -module.exports = Replace; - - -/***/ }), -/* 295 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the given element to the bottom of the array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.SendToBack - * @since 3.4.0 - * - * @param {array} array - The array. - * @param {*} item - The element to move. - * - * @return {*} The element that was moved. - */ -var SendToBack = function (array, item) -{ - var currentIndex = array.indexOf(item); - - if (currentIndex !== -1 && currentIndex > 0) - { - array.splice(currentIndex, 1); - array.unshift(item); - } - - return item; -}; - -module.exports = SendToBack; - - -/***/ }), -/* 296 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SafeRange = __webpack_require__(5); - -/** - * Scans the array for elements with the given property. If found, the property is set to the `value`. - * - * For example: `SetAll('visible', true)` would set all elements that have a `visible` property to `false`. - * - * Optionally you can specify a start and end index. For example if the array had 100 elements, - * and you set `startIndex` to 0 and `endIndex` to 50, it would update only the first 50 elements. - * - * @function Phaser.Utils.Array.SetAll - * @since 3.4.0 - * - * @param {array} array - The array to search. - * @param {string} property - The property to test for on each array element. - * @param {*} value - The value to set the property to. - * @param {number} [startIndex] - An optional start index to search from. - * @param {number} [endIndex] - An optional end index to search to. - * - * @return {array} The input array. - */ -var SetAll = function (array, property, value, startIndex, endIndex) -{ - if (startIndex === undefined) { startIndex = 0; } - if (endIndex === undefined) { endIndex = array.length; } - - if (SafeRange(array, startIndex, endIndex)) - { - for (var i = startIndex; i < endIndex; i++) - { - var entry = array[i]; - - if (entry.hasOwnProperty(property)) - { - entry[property] = value; - } - } - } - - return array; -}; - -module.exports = SetAll; - - -/***/ }), -/* 297 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Takes the given array and runs a numeric sort on it, ignoring any non-digits that - * may be in the entries. - * - * You should only run this on arrays containing strings. - * - * @function Phaser.Utils.Array.SortByDigits - * @since 3.50.0 - * - * @param {string[]} array - The input array of strings. - * - * @return {string[]} The sorted input array. - */ -var SortByDigits = function (array) -{ - var re = /\D/g; - - array.sort(function (a, b) - { - return (parseInt(a.replace(re, ''), 10) - parseInt(b.replace(re, ''), 10)); - }); - - return array; -}; - -module.exports = SortByDigits; - - -/***/ }), -/* 298 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author Angry Bytes (and contributors) - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Device = __webpack_require__(299); - -/** - * The comparator function. - * - * @ignore - * - * @param {*} a - The first item to test. - * @param {*} b - The second itemt to test. - * - * @return {boolean} True if they localCompare, otherwise false. - */ -function Compare (a, b) -{ - return String(a).localeCompare(b); -} - -/** - * Process the array contents. - * - * @ignore - * - * @param {array} array - The array to process. - * @param {function} compare - The comparison function. - * - * @return {array} - The processed array. - */ -function Process (array, compare) -{ - // Short-circuit when there's nothing to sort. - var len = array.length; - - if (len <= 1) - { - return array; - } - - // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. - // Chunks are the size of the left or right hand in merge sort. - // Stop when the left-hand covers all of the array. - var buffer = new Array(len); - - for (var chk = 1; chk < len; chk *= 2) - { - RunPass(array, compare, chk, buffer); - - var tmp = array; - - array = buffer; - - buffer = tmp; - } - - return array; -} - -/** - * Run a single pass with the given chunk size. - * - * @ignore - * - * @param {array} arr - The array to run the pass on. - * @param {function} comp - The comparison function. - * @param {number} chk - The number of iterations. - * @param {array} result - The array to store the result in. - */ -function RunPass (arr, comp, chk, result) -{ - var len = arr.length; - var i = 0; - - // Step size / double chunk size. - var dbl = chk * 2; - - // Bounds of the left and right chunks. - var l, r, e; - - // Iterators over the left and right chunk. - var li, ri; - - // Iterate over pairs of chunks. - for (l = 0; l < len; l += dbl) - { - r = l + chk; - e = r + chk; - - if (r > len) - { - r = len; - } - - if (e > len) - { - e = len; - } - - // Iterate both chunks in parallel. - li = l; - ri = r; - - while (true) - { - // Compare the chunks. - if (li < r && ri < e) - { - // This works for a regular `sort()` compatible comparator, - // but also for a simple comparator like: `a > b` - if (comp(arr[li], arr[ri]) <= 0) - { - result[i++] = arr[li++]; - } - else - { - result[i++] = arr[ri++]; - } - } - else if (li < r) - { - // Nothing to compare, just flush what's left. - result[i++] = arr[li++]; - } - else if (ri < e) - { - result[i++] = arr[ri++]; - } - else - { - // Both iterators are at the chunk ends. - break; - } - } - } -} - -/** - * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. - * - * This is an implementation of merge sort, without recursion. - * - * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable - * - * @function Phaser.Utils.Array.StableSort - * @since 3.0.0 - * - * @param {array} array - The input array to be sorted. - * @param {function} [compare] - The comparison function. - * - * @return {array} The sorted result. - */ -var StableSort = function (array, compare) -{ - if (compare === undefined) { compare = Compare; } - - // Short-circuit when there's nothing to sort. - if (!array || array.length < 2) - { - return array; - } - - if (Device.features.stableSort) - { - return array.sort(compare); - } - - var result = Process(array, compare); - - // This simply copies back if the result isn't in the original array, which happens on an odd number of passes. - if (result !== array) - { - RunPass(result, null, array.length, array); - } - - return array; -}; - -module.exports = StableSort; - - -/***/ }), -/* 299 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// This singleton is instantiated as soon as Phaser loads, -// before a Phaser.Game instance has even been created. -// Which means all instances of Phaser Games can share it, -// without having to re-poll the device all over again - -/** - * @namespace Phaser.Device - * @since 3.0.0 - */ - -/** - * @typedef {object} Phaser.DeviceConf - * - * @property {Phaser.Device.OS} os - The OS Device functions. - * @property {Phaser.Device.Browser} browser - The Browser Device functions. - * @property {Phaser.Device.Features} features - The Features Device functions. - * @property {Phaser.Device.Input} input - The Input Device functions. - * @property {Phaser.Device.Audio} audio - The Audio Device functions. - * @property {Phaser.Device.Video} video - The Video Device functions. - * @property {Phaser.Device.Fullscreen} fullscreen - The Fullscreen Device functions. - * @property {Phaser.Device.CanvasFeatures} canvasFeatures - The Canvas Device functions. - */ - -module.exports = { - - os: __webpack_require__(28), - browser: __webpack_require__(18), - features: __webpack_require__(301), - input: __webpack_require__(305), - audio: __webpack_require__(306), - video: __webpack_require__(307), - fullscreen: __webpack_require__(308), - canvasFeatures: __webpack_require__(309) - -}; - - -/***/ }), -/* 300 */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), -/* 301 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var OS = __webpack_require__(28); -var Browser = __webpack_require__(18); -var CanvasPool = __webpack_require__(66); - -/** - * Determines the features of the browser running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.features` from within any Scene. - * - * @typedef {object} Phaser.Device.Features - * @since 3.0.0 - * - * @property {boolean} canvas - Is canvas available? - * @property {?boolean} canvasBitBltShift - True if canvas supports a 'copy' bitblt onto itself when the source and destination regions overlap. - * @property {boolean} file - Is file available? - * @property {boolean} fileSystem - Is fileSystem available? - * @property {boolean} getUserMedia - Does the device support the getUserMedia API? - * @property {boolean} littleEndian - Is the device big or little endian? (only detected if the browser supports TypedArrays) - * @property {boolean} localStorage - Is localStorage available? - * @property {boolean} pointerLock - Is Pointer Lock available? - * @property {boolean} stableSort - Is Array.sort stable? - * @property {boolean} support32bit - Does the device context support 32bit pixel manipulation using array buffer views? - * @property {boolean} vibration - Does the device support the Vibration API? - * @property {boolean} webGL - Is webGL available? - * @property {boolean} worker - Is worker available? - */ -var Features = { - - canvas: false, - canvasBitBltShift: null, - file: false, - fileSystem: false, - getUserMedia: true, - littleEndian: false, - localStorage: false, - pointerLock: false, - stableSort: false, - support32bit: false, - vibration: false, - webGL: false, - worker: false - -}; - -// Check Little or Big Endian system. -// @author Matt DesLauriers (@mattdesl) -function checkIsLittleEndian () -{ - var a = new ArrayBuffer(4); - var b = new Uint8Array(a); - var c = new Uint32Array(a); - - b[0] = 0xa1; - b[1] = 0xb2; - b[2] = 0xc3; - b[3] = 0xd4; - - if (c[0] === 0xd4c3b2a1) - { - return true; - } - - if (c[0] === 0xa1b2c3d4) - { - return false; - } - else - { - // Could not determine endianness - return null; - } -} - -function init () -{ - if (typeof importScripts === 'function') - { - return Features; - } - - Features.canvas = !!window['CanvasRenderingContext2D']; - - try - { - Features.localStorage = !!localStorage.getItem; - } - catch (error) - { - Features.localStorage = false; - } - - Features.file = !!window['File'] && !!window['FileReader'] && !!window['FileList'] && !!window['Blob']; - Features.fileSystem = !!window['requestFileSystem']; - - var isUint8 = false; - - var testWebGL = function () - { - if (window['WebGLRenderingContext']) - { - try - { - var canvas = CanvasPool.createWebGL(this); - - var ctx = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); - - var canvas2D = CanvasPool.create2D(this); - - var ctx2D = canvas2D.getContext('2d', { willReadFrequently: true }); - - // Can't be done on a webgl context - var image = ctx2D.createImageData(1, 1); - - // Test to see if ImageData uses CanvasPixelArray or Uint8ClampedArray. - // @author Matt DesLauriers (@mattdesl) - isUint8 = image.data instanceof Uint8ClampedArray; - - CanvasPool.remove(canvas); - CanvasPool.remove(canvas2D); - - return !!ctx; - } - catch (e) - { - return false; - } - } - - return false; - }; - - Features.webGL = testWebGL(); - - Features.worker = !!window['Worker']; - - Features.pointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document; - - navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia; - - window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL; - - Features.getUserMedia = Features.getUserMedia && !!navigator.getUserMedia && !!window.URL; - - // Older versions of firefox (< 21) apparently claim support but user media does not actually work - if (Browser.firefox && Browser.firefoxVersion < 21) - { - Features.getUserMedia = false; - } - - // Excludes iOS versions as they generally wrap UIWebView (eg. Safari WebKit) and it - // is safer to not try and use the fast copy-over method. - if (!OS.iOS && (Browser.ie || Browser.firefox || Browser.chrome)) - { - Features.canvasBitBltShift = true; - } - - // Known not to work - if (Browser.safari || Browser.mobileSafari) - { - Features.canvasBitBltShift = false; - } - - navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate; - - if (navigator.vibrate) - { - Features.vibration = true; - } - - if (typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint32Array !== 'undefined') - { - Features.littleEndian = checkIsLittleEndian(); - } - - Features.support32bit = ( - typeof ArrayBuffer !== 'undefined' && - typeof Uint8ClampedArray !== 'undefined' && - typeof Int32Array !== 'undefined' && - Features.littleEndian !== null && - isUint8 - ); - - return Features; -} - -module.exports = init(); - - -/***/ }), -/* 302 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Global constants. - * - * @ignore - */ - -var CONST = { - - /** - * Phaser Release Version - * - * @name Phaser.VERSION - * @const - * @type {string} - * @since 3.0.0 - */ - VERSION: '3.60.0-beta.18', - - BlendModes: __webpack_require__(13), - - ScaleModes: __webpack_require__(303), - - /** - * This setting will auto-detect if the browser is capable of suppporting WebGL. - * If it is, it will use the WebGL Renderer. If not, it will fall back to the Canvas Renderer. - * - * @name Phaser.AUTO - * @const - * @type {number} - * @since 3.0.0 - */ - AUTO: 0, - - /** - * Forces Phaser to only use the Canvas Renderer, regardless if the browser supports - * WebGL or not. - * - * @name Phaser.CANVAS - * @const - * @type {number} - * @since 3.0.0 - */ - CANVAS: 1, - - /** - * Forces Phaser to use the WebGL Renderer. If the browser does not support it, there is - * no fallback to Canvas with this setting, so you should trap it and display a suitable - * message to the user. - * - * @name Phaser.WEBGL - * @const - * @type {number} - * @since 3.0.0 - */ - WEBGL: 2, - - /** - * A Headless Renderer doesn't create either a Canvas or WebGL Renderer. However, it still - * absolutely relies on the DOM being present and available. This mode is meant for unit testing, - * not for running Phaser on the server, which is something you really shouldn't do. - * - * @name Phaser.HEADLESS - * @const - * @type {number} - * @since 3.0.0 - */ - HEADLESS: 3, - - /** - * In Phaser the value -1 means 'forever' in lots of cases, this const allows you to use it instead - * to help you remember what the value is doing in your code. - * - * @name Phaser.FOREVER - * @const - * @type {number} - * @since 3.0.0 - */ - FOREVER: -1, - - /** - * Direction constant. - * - * @name Phaser.NONE - * @const - * @type {number} - * @since 3.0.0 - */ - NONE: 4, - - /** - * Direction constant. - * - * @name Phaser.UP - * @const - * @type {number} - * @since 3.0.0 - */ - UP: 5, - - /** - * Direction constant. - * - * @name Phaser.DOWN - * @const - * @type {number} - * @since 3.0.0 - */ - DOWN: 6, - - /** - * Direction constant. - * - * @name Phaser.LEFT - * @const - * @type {number} - * @since 3.0.0 - */ - LEFT: 7, - - /** - * Direction constant. - * - * @name Phaser.RIGHT - * @const - * @type {number} - * @since 3.0.0 - */ - RIGHT: 8 - -}; - -module.exports = CONST; - - -/***/ }), -/* 303 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Phaser Scale Modes. - * - * @namespace Phaser.ScaleModes - * @since 3.0.0 - */ - -var ScaleModes = { - - /** - * Default Scale Mode (Linear). - * - * @name Phaser.ScaleModes.DEFAULT - * @type {number} - * @readonly - * @since 3.0.0 - */ - DEFAULT: 0, - - /** - * Linear Scale Mode. - * - * @name Phaser.ScaleModes.LINEAR - * @type {number} - * @readonly - * @since 3.0.0 - */ - LINEAR: 0, - - /** - * Nearest Scale Mode. - * - * @name Phaser.ScaleModes.NEAREST - * @type {number} - * @readonly - * @since 3.0.0 - */ - NEAREST: 1 - -}; - -module.exports = ScaleModes; - - -/***/ }), -/* 304 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Browser specific prefix, so not going to change between contexts, only between browsers -var prefix = ''; - -/** - * @namespace Phaser.Display.Canvas.Smoothing - * @since 3.0.0 - */ -var Smoothing = function () -{ - /** - * Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set. - * - * @function Phaser.Display.Canvas.Smoothing.getPrefix - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The canvas context to check. - * - * @return {string} The name of the property on the context which controls image smoothing (either `imageSmoothingEnabled` or a vendor-prefixed version thereof), or `null` if not supported. - */ - var getPrefix = function (context) - { - var vendors = [ 'i', 'webkitI', 'msI', 'mozI', 'oI' ]; - - for (var i = 0; i < vendors.length; i++) - { - var s = vendors[i] + 'mageSmoothingEnabled'; - - if (s in context) - { - return s; - } - } - - return null; - }; - - /** - * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. - * By default browsers have image smoothing enabled, which isn't always what you visually want, especially - * when using pixel art in a game. Note that this sets the property on the context itself, so that any image - * drawn to the context will be affected. This sets the property across all current browsers but support is - * patchy on earlier browsers, especially on mobile. - * - * @function Phaser.Display.Canvas.Smoothing.enable - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to enable smoothing. - * - * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. - */ - var enable = function (context) - { - if (prefix === '') - { - prefix = getPrefix(context); - } - - if (prefix) - { - context[prefix] = true; - } - - return context; - }; - - /** - * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. - * By default browsers have image smoothing enabled, which isn't always what you visually want, especially - * when using pixel art in a game. Note that this sets the property on the context itself, so that any image - * drawn to the context will be affected. This sets the property across all current browsers but support is - * patchy on earlier browsers, especially on mobile. - * - * @function Phaser.Display.Canvas.Smoothing.disable - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to disable smoothing. - * - * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. - */ - var disable = function (context) - { - if (prefix === '') - { - prefix = getPrefix(context); - } - - if (prefix) - { - context[prefix] = false; - } - - return context; - }; - - /** - * Returns `true` if the given context has image smoothing enabled, otherwise returns `false`. - * Returns null if no smoothing prefix is available. - * - * @function Phaser.Display.Canvas.Smoothing.isEnabled - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context to check. - * - * @return {?boolean} `true` if smoothing is enabled on the context, otherwise `false`. `null` if not supported. - */ - var isEnabled = function (context) - { - return (prefix !== null) ? context[prefix] : null; - }; - - return { - disable: disable, - enable: enable, - getPrefix: getPrefix, - isEnabled: isEnabled - }; - -}; - -module.exports = Smoothing(); - - -/***/ }), -/* 305 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Browser = __webpack_require__(18); - -/** - * Determines the input support of the browser running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.input` from within any Scene. - * - * @typedef {object} Phaser.Device.Input - * @since 3.0.0 - * - * @property {?string} wheelType - The newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll' - * @property {boolean} gamepads - Is navigator.getGamepads available? - * @property {boolean} mspointer - Is mspointer available? - * @property {boolean} touch - Is touch available? - */ -var Input = { - - gamepads: false, - mspointer: false, - touch: false, - wheelEvent: null - -}; - -function init () -{ - if (typeof importScripts === 'function') - { - return Input; - } - - if ('ontouchstart' in document.documentElement || (navigator.maxTouchPoints && navigator.maxTouchPoints >= 1)) - { - Input.touch = true; - } - - if (navigator.msPointerEnabled || navigator.pointerEnabled) - { - Input.mspointer = true; - } - - if (navigator.getGamepads) - { - Input.gamepads = true; - } - - // See https://developer.mozilla.org/en-US/docs/Web/Events/wheel - if ('onwheel' in window || (Browser.ie && 'WheelEvent' in window)) - { - // DOM3 Wheel Event: FF 17+, IE 9+, Chrome 31+, Safari 7+ - Input.wheelEvent = 'wheel'; - } - else if ('onmousewheel' in window) - { - // Non-FF legacy: IE 6-9, Chrome 1-31, Safari 5-7. - Input.wheelEvent = 'mousewheel'; - } - else if (Browser.firefox && 'MouseScrollEvent' in window) - { - // FF prior to 17. This should probably be scrubbed. - Input.wheelEvent = 'DOMMouseScroll'; - } - - return Input; -} - -module.exports = init(); - - -/***/ }), -/* 306 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Browser = __webpack_require__(18); - -/** - * Determines the audio playback capabilities of the device running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.audio` from within any Scene. - * - * @typedef {object} Phaser.Device.Audio - * @since 3.0.0 - * - * @property {boolean} audioData - Can this device play HTML Audio tags? - * @property {boolean} dolby - Can this device play EC-3 Dolby Digital Plus files? - * @property {boolean} m4a - Can this device can play m4a files. - * @property {boolean} aac - Can this device can play aac files. - * @property {boolean} flac - Can this device can play flac files. - * @property {boolean} mp3 - Can this device play mp3 files? - * @property {boolean} ogg - Can this device play ogg files? - * @property {boolean} opus - Can this device play opus files? - * @property {boolean} wav - Can this device play wav files? - * @property {boolean} webAudio - Does this device have the Web Audio API? - * @property {boolean} webm - Can this device play webm files? - */ -var Audio = { - - flac: false, - aac: false, - audioData: false, - dolby: false, - m4a: false, - mp3: false, - ogg: false, - opus: false, - wav: false, - webAudio: false, - webm: false - -}; - -function init () -{ - if (typeof importScripts === 'function') - { - return Audio; - } - - Audio.audioData = !!(window['Audio']); - - Audio.webAudio = !!(window['AudioContext'] || window['webkitAudioContext']); - - var audioElement = document.createElement('audio'); - var result = !!audioElement.canPlayType; - - try - { - if (result) - { - var CanPlay = function (type1, type2) - { - var canPlayType1 = audioElement.canPlayType('audio/' + type1).replace(/^no$/, ''); - - if (type2) - { - return Boolean(canPlayType1 || audioElement.canPlayType('audio/' + type2).replace(/^no$/, '')); - } - else - { - return Boolean(canPlayType1); - } - }; - - // wav Mimetypes accepted: - // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements - - Audio.ogg = CanPlay('ogg; codecs="vorbis"'); - Audio.opus = CanPlay('ogg; codecs="opus"', 'opus'); - Audio.mp3 = CanPlay('mpeg'); - Audio.wav = CanPlay('wav'); - Audio.m4a = CanPlay('x-m4a'); - Audio.aac = CanPlay('aac'); - Audio.flac = CanPlay('flac', 'x-flac'); - Audio.webm = CanPlay('webm; codecs="vorbis"'); - - if (audioElement.canPlayType('audio/mp4; codecs="ec-3"') !== '') - { - if (Browser.edge) - { - Audio.dolby = true; - } - else if (Browser.safari && Browser.safariVersion >= 9) - { - if ((/Mac OS X (\d+)_(\d+)/).test(navigator.userAgent)) - { - var major = parseInt(RegExp.$1, 10); - var minor = parseInt(RegExp.$2, 10); - - if ((major === 10 && minor >= 11) || major > 10) - { - Audio.dolby = true; - } - } - } - } - } - } - catch (e) - { - // Nothing to do here - } - - return Audio; -} - -module.exports = init(); - - -/***/ }), -/* 307 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Determines the video support of the browser running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.video` from within any Scene. - * - * In Phaser 3.20 the properties were renamed to drop the 'Video' suffix. - * - * @typedef {object} Phaser.Device.Video - * @since 3.0.0 - * - * @property {boolean} h264 - Can this device play h264 mp4 video files? - * @property {boolean} hls - Can this device play hls video files? - * @property {boolean} mp4 - Can this device play h264 mp4 video files? - * @property {boolean} m4v - Can this device play m4v (typically mp4) video files? - * @property {boolean} ogg - Can this device play ogg video files? - * @property {boolean} vp9 - Can this device play vp9 video files? - * @property {boolean} webm - Can this device play webm video files? - */ -var Video = { - - h264: false, - hls: false, - mp4: false, - m4v: false, - ogg: false, - vp9: false, - webm: false - -}; - -function init () -{ - if (typeof importScripts === 'function') - { - return Video; - } - - var videoElement = document.createElement('video'); - var result = !!videoElement.canPlayType; - var no = /^no$/; - - try - { - if (result) - { - if (videoElement.canPlayType('video/ogg; codecs="theora"').replace(no, '')) - { - Video.ogg = true; - } - - if (videoElement.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(no, '')) - { - // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546 - Video.h264 = true; - Video.mp4 = true; - } - - if (videoElement.canPlayType('video/x-m4v').replace(no, '')) - { - Video.m4v = true; - } - - if (videoElement.canPlayType('video/webm; codecs="vp8, vorbis"').replace(no, '')) - { - Video.webm = true; - } - - if (videoElement.canPlayType('video/webm; codecs="vp9"').replace(no, '')) - { - Video.vp9 = true; - } - - if (videoElement.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(no, '')) - { - Video.hls = true; - } - } - } - catch (e) - { - // Nothing to do - } - - return Video; -} - -module.exports = init(); - - -/***/ }), -/* 308 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Determines the full screen support of the browser running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.fullscreen` from within any Scene. - * - * @typedef {object} Phaser.Device.Fullscreen - * @since 3.0.0 - * - * @property {boolean} available - Does the browser support the Full Screen API? - * @property {boolean} keyboard - Does the browser support access to the Keyboard during Full Screen mode? - * @property {string} cancel - If the browser supports the Full Screen API this holds the call you need to use to cancel it. - * @property {string} request - If the browser supports the Full Screen API this holds the call you need to use to activate it. - */ -var Fullscreen = { - - available: false, - cancel: '', - keyboard: false, - request: '' - -}; - -/** -* Checks for support of the Full Screen API. -* -* @ignore -*/ -function init () -{ - if (typeof importScripts === 'function') - { - return Fullscreen; - } - - var i; - - var suffix1 = 'Fullscreen'; - var suffix2 = 'FullScreen'; - - var fs = [ - 'request' + suffix1, - 'request' + suffix2, - 'webkitRequest' + suffix1, - 'webkitRequest' + suffix2, - 'msRequest' + suffix1, - 'msRequest' + suffix2, - 'mozRequest' + suffix2, - 'mozRequest' + suffix1 - ]; - - for (i = 0; i < fs.length; i++) - { - if (document.documentElement[fs[i]]) - { - Fullscreen.available = true; - Fullscreen.request = fs[i]; - break; - } - } - - var cfs = [ - 'cancel' + suffix2, - 'exit' + suffix1, - 'webkitCancel' + suffix2, - 'webkitExit' + suffix1, - 'msCancel' + suffix2, - 'msExit' + suffix1, - 'mozCancel' + suffix2, - 'mozExit' + suffix1 - ]; - - if (Fullscreen.available) - { - for (i = 0; i < cfs.length; i++) - { - if (document[cfs[i]]) - { - Fullscreen.cancel = cfs[i]; - break; - } - } - } - - // Keyboard Input? - // Safari 5.1 says it supports fullscreen keyboard, but is lying. - if (window['Element'] && Element['ALLOW_KEYBOARD_INPUT'] && !(/ Version\/5\.1(?:\.\d+)? Safari\//).test(navigator.userAgent)) - { - Fullscreen.keyboard = true; - } - - Object.defineProperty(Fullscreen, 'active', { get: function () { return !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement); } }); - - return Fullscreen; -} - -module.exports = init(); - - -/***/ }), -/* 309 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CanvasPool = __webpack_require__(66); - -/** - * Determines the canvas features of the browser running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.canvasFeatures` from within any Scene. - * - * @typedef {object} Phaser.Device.CanvasFeatures - * @since 3.0.0 - * - * @property {boolean} supportInverseAlpha - Set to true if the browser supports inversed alpha. - * @property {boolean} supportNewBlendModes - Set to true if the browser supports new canvas blend modes. - */ -var CanvasFeatures = { - - supportInverseAlpha: false, - supportNewBlendModes: false - -}; - -function checkBlendMode () -{ - var pngHead = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/'; - var pngEnd = 'AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg=='; - - var magenta = new Image(); - - magenta.onload = function () - { - var yellow = new Image(); - - yellow.onload = function () - { - var canvas = CanvasPool.create2D(yellow, 6); - var context = canvas.getContext('2d', { willReadFrequently: true }); - - context.globalCompositeOperation = 'multiply'; - - context.drawImage(magenta, 0, 0); - context.drawImage(yellow, 2, 0); - - if (!context.getImageData(2, 0, 1, 1)) - { - return false; - } - - var data = context.getImageData(2, 0, 1, 1).data; - - CanvasPool.remove(yellow); - - CanvasFeatures.supportNewBlendModes = (data[0] === 255 && data[1] === 0 && data[2] === 0); - }; - - yellow.src = pngHead + '/wCKxvRF' + pngEnd; - }; - - magenta.src = pngHead + 'AP804Oa6' + pngEnd; - - return false; -} - -function checkInverseAlpha () -{ - var canvas = CanvasPool.create2D(this, 2); - var context = canvas.getContext('2d', { willReadFrequently: true }); - - context.fillStyle = 'rgba(10, 20, 30, 0.5)'; - - // Draw a single pixel - context.fillRect(0, 0, 1, 1); - - // Get the color values - var s1 = context.getImageData(0, 0, 1, 1); - - if (s1 === null) - { - return false; - } - - // Plot them to x2 - context.putImageData(s1, 1, 0); - - // Get those values - var s2 = context.getImageData(1, 0, 1, 1); - - var result = (s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]); - - CanvasPool.remove(this); - - // Compare and return - return result; -} - -function init () -{ - if (typeof importScripts !== 'function' && document !== undefined) - { - CanvasFeatures.supportNewBlendModes = checkBlendMode(); - CanvasFeatures.supportInverseAlpha = checkInverseAlpha(); - } - - return CanvasFeatures; -} - -module.exports = init(); - - -/***/ }), -/* 310 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Swaps the position of two elements in the given array. - * The elements must exist in the same array. - * The array is modified in-place. - * - * @function Phaser.Utils.Array.Swap - * @since 3.4.0 - * - * @param {array} array - The input array. - * @param {*} item1 - The first element to swap. - * @param {*} item2 - The second element to swap. - * - * @return {array} The input array. - */ -var Swap = function (array, item1, item2) -{ - if (item1 === item2) - { - return array; - } - - var index1 = array.indexOf(item1); - var index2 = array.indexOf(item2); - - if (index1 < 0 || index2 < 0) - { - throw new Error('Supplied items must be elements of the same array'); - } - - array[index1] = item2; - array[index2] = item1; - - return array; -}; - -module.exports = Swap; - - -/***/ }), -/* 311 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.GameObjects.Components - */ - -module.exports = { - - Alpha: __webpack_require__(312), - AlphaSingle: __webpack_require__(313), - BlendMode: __webpack_require__(314), - ComputedSize: __webpack_require__(52), - Crop: __webpack_require__(315), - Depth: __webpack_require__(53), - Flip: __webpack_require__(54), - FX: __webpack_require__(316), - GetBounds: __webpack_require__(317), - Mask: __webpack_require__(326), - Origin: __webpack_require__(331), - PathFollower: __webpack_require__(332), - Pipeline: __webpack_require__(335), - ScrollFactor: __webpack_require__(55), - Size: __webpack_require__(337), - Texture: __webpack_require__(338), - TextureCrop: __webpack_require__(339), - Tint: __webpack_require__(340), - ToJSON: __webpack_require__(59), - Transform: __webpack_require__(56), - TransformMatrix: __webpack_require__(26), - Visible: __webpack_require__(57) - -}; - - -/***/ }), -/* 312 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(1); - -// bitmask flag for GameObject.renderMask -var _FLAG = 2; // 0010 - -/** - * Provides methods used for setting the alpha properties of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Alpha - * @since 3.0.0 - */ - -var Alpha = { - - /** - * Private internal value. Holds the global alpha value. - * - * @name Phaser.GameObjects.Components.Alpha#_alpha - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alpha: 1, - - /** - * Private internal value. Holds the top-left alpha value. - * - * @name Phaser.GameObjects.Components.Alpha#_alphaTL - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alphaTL: 1, - - /** - * Private internal value. Holds the top-right alpha value. - * - * @name Phaser.GameObjects.Components.Alpha#_alphaTR - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alphaTR: 1, - - /** - * Private internal value. Holds the bottom-left alpha value. - * - * @name Phaser.GameObjects.Components.Alpha#_alphaBL - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alphaBL: 1, - - /** - * Private internal value. Holds the bottom-right alpha value. - * - * @name Phaser.GameObjects.Components.Alpha#_alphaBR - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alphaBR: 1, - - /** - * Clears all alpha values associated with this Game Object. - * - * Immediately sets the alpha levels back to 1 (fully opaque). - * - * @method Phaser.GameObjects.Components.Alpha#clearAlpha - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - clearAlpha: function () - { - return this.setAlpha(1); - }, - - /** - * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. - * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * - * If your game is running under WebGL you can optionally specify four different alpha values, each of which - * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. - * - * @method Phaser.GameObjects.Components.Alpha#setAlpha - * @since 3.0.0 - * - * @param {number} [topLeft=1] - The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. - * @param {number} [topRight] - The alpha value used for the top-right of the Game Object. WebGL only. - * @param {number} [bottomLeft] - The alpha value used for the bottom-left of the Game Object. WebGL only. - * @param {number} [bottomRight] - The alpha value used for the bottom-right of the Game Object. WebGL only. - * - * @return {this} This Game Object instance. - */ - setAlpha: function (topLeft, topRight, bottomLeft, bottomRight) - { - if (topLeft === undefined) { topLeft = 1; } - - // Treat as if there is only one alpha value for the whole Game Object - if (topRight === undefined) - { - this.alpha = topLeft; - } - else - { - this._alphaTL = Clamp(topLeft, 0, 1); - this._alphaTR = Clamp(topRight, 0, 1); - this._alphaBL = Clamp(bottomLeft, 0, 1); - this._alphaBR = Clamp(bottomRight, 0, 1); - } - - return this; - }, - - /** - * The alpha value of the Game Object. - * - * This is a global value, impacting the entire Game Object, not just a region of it. - * - * @name Phaser.GameObjects.Components.Alpha#alpha - * @type {number} - * @since 3.0.0 - */ - alpha: { - - get: function () - { - return this._alpha; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alpha = v; - this._alphaTL = v; - this._alphaTR = v; - this._alphaBL = v; - this._alphaBR = v; - - if (v === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The alpha value starting from the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Alpha#alphaTopLeft - * @type {number} - * @webglOnly - * @since 3.0.0 - */ - alphaTopLeft: { - - get: function () - { - return this._alphaTL; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alphaTL = v; - - if (v !== 0) - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The alpha value starting from the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Alpha#alphaTopRight - * @type {number} - * @webglOnly - * @since 3.0.0 - */ - alphaTopRight: { - - get: function () - { - return this._alphaTR; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alphaTR = v; - - if (v !== 0) - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The alpha value starting from the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Alpha#alphaBottomLeft - * @type {number} - * @webglOnly - * @since 3.0.0 - */ - alphaBottomLeft: { - - get: function () - { - return this._alphaBL; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alphaBL = v; - - if (v !== 0) - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The alpha value starting from the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Alpha#alphaBottomRight - * @type {number} - * @webglOnly - * @since 3.0.0 - */ - alphaBottomRight: { - - get: function () - { - return this._alphaBR; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alphaBR = v; - - if (v !== 0) - { - this.renderFlags |= _FLAG; - } - } - - } - -}; - -module.exports = Alpha; - - -/***/ }), -/* 313 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(1); - -// bitmask flag for GameObject.renderMask -var _FLAG = 2; // 0010 - -/** - * Provides methods used for setting the alpha property of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.AlphaSingle - * @since 3.22.0 - */ - -var AlphaSingle = { - - /** - * Private internal value. Holds the global alpha value. - * - * @name Phaser.GameObjects.Components.AlphaSingle#_alpha - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _alpha: 1, - - /** - * Clears all alpha values associated with this Game Object. - * - * Immediately sets the alpha levels back to 1 (fully opaque). - * - * @method Phaser.GameObjects.Components.AlphaSingle#clearAlpha - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - clearAlpha: function () - { - return this.setAlpha(1); - }, - - /** - * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. - * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * - * @method Phaser.GameObjects.Components.AlphaSingle#setAlpha - * @since 3.0.0 - * - * @param {number} [value=1] - The alpha value applied across the whole Game Object. - * - * @return {this} This Game Object instance. - */ - setAlpha: function (value) - { - if (value === undefined) { value = 1; } - - this.alpha = value; - - return this; - }, - - /** - * The alpha value of the Game Object. - * - * This is a global value, impacting the entire Game Object, not just a region of it. - * - * @name Phaser.GameObjects.Components.AlphaSingle#alpha - * @type {number} - * @since 3.0.0 - */ - alpha: { - - get: function () - { - return this._alpha; - }, - - set: function (value) - { - var v = Clamp(value, 0, 1); - - this._alpha = v; - - if (v === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - } - -}; - -module.exports = AlphaSingle; - - -/***/ }), -/* 314 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BlendModes = __webpack_require__(13); - -/** - * Provides methods used for setting the blend mode of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.BlendMode - * @since 3.0.0 - */ - -var BlendMode = { - - /** - * Private internal value. Holds the current blend mode. - * - * @name Phaser.GameObjects.Components.BlendMode#_blendMode - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - _blendMode: BlendModes.NORMAL, - - /** - * Sets the Blend Mode being used by this Game Object. - * - * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * - * Under WebGL only the following Blend Modes are available: - * - * * NORMAL - * * ADD - * * MULTIPLY - * * SCREEN - * * ERASE - * - * Canvas has more available depending on browser support. - * - * You can also create your own custom Blend Modes in WebGL. - * - * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending - * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these - * reasons try to be careful about the construction of your Scene and the frequency of which blend modes - * are used. - * - * @name Phaser.GameObjects.Components.BlendMode#blendMode - * @type {(Phaser.BlendModes|string|number)} - * @since 3.0.0 - */ - blendMode: { - - get: function () - { - return this._blendMode; - }, - - set: function (value) - { - if (typeof value === 'string') - { - value = BlendModes[value]; - } - - value |= 0; - - if (value >= -1) - { - this._blendMode = value; - } - } - - }, - - /** - * Sets the Blend Mode being used by this Game Object. - * - * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * - * Under WebGL only the following Blend Modes are available: - * - * * NORMAL - * * ADD - * * MULTIPLY - * * SCREEN - * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * - * Canvas has more available depending on browser support. - * - * You can also create your own custom Blend Modes in WebGL. - * - * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending - * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these - * reasons try to be careful about the construction of your Scene and the frequency in which blend modes - * are used. - * - * @method Phaser.GameObjects.Components.BlendMode#setBlendMode - * @since 3.0.0 - * - * @param {(string|Phaser.BlendModes|number)} value - The BlendMode value. Either a string, a CONST or a number. - * - * @return {this} This Game Object instance. - */ - setBlendMode: function (value) - { - this.blendMode = value; - - return this; - } - -}; - -module.exports = BlendMode; - - -/***/ }), -/* 315 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for getting and setting the texture of a Game Object. - * - * @namespace Phaser.GameObjects.Components.Crop - * @since 3.12.0 - */ - -var Crop = { - - /** - * The Texture this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.Crop#texture - * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} - * @since 3.0.0 - */ - texture: null, - - /** - * The Texture Frame this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.Crop#frame - * @type {Phaser.Textures.Frame} - * @since 3.0.0 - */ - frame: null, - - /** - * A boolean flag indicating if this Game Object is being cropped or not. - * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. - * Equally, calling `setCrop` with no arguments will reset the crop and disable it. - * - * @name Phaser.GameObjects.Components.Crop#isCropped - * @type {boolean} - * @since 3.11.0 - */ - isCropped: false, - - /** - * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * - * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * - * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just - * changes what is shown when rendered. - * - * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * - * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left - * half of it, you could call `setCrop(0, 0, 400, 600)`. - * - * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop - * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * - * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * - * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * - * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow - * the renderer to skip several internal calculations. - * - * @method Phaser.GameObjects.Components.Crop#setCrop - * @since 3.11.0 - * - * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. - * @param {number} [y] - The y coordinate to start the crop from. - * @param {number} [width] - The width of the crop rectangle in pixels. - * @param {number} [height] - The height of the crop rectangle in pixels. - * - * @return {this} This Game Object instance. - */ - setCrop: function (x, y, width, height) - { - if (x === undefined) - { - this.isCropped = false; - } - else if (this.frame) - { - if (typeof x === 'number') - { - this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY); - } - else - { - var rect = x; - - this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY); - } - - this.isCropped = true; - } - - return this; - }, - - /** - * Internal method that returns a blank, well-formed crop object for use by a Game Object. - * - * @method Phaser.GameObjects.Components.Crop#resetCropObject - * @private - * @since 3.12.0 - * - * @return {object} The crop object. - */ - resetCropObject: function () - { - return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 }; - } - -}; - -module.exports = Crop; - - -/***/ }), -/* 316 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for setting the FX values of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.FX - * @webglOnly - * @since 3.60.0 - */ - -var FX = { - - /** - * The amount of extra padding to be applied to this Game Object - * when it is being rendered by a SpriteFX Pipeline. - * - * Lots of FX require additional spacing added to the texture the - * Game Object uses, for example a glow or shadow effect, and this - * method allows you to control how much extra padding is included - * in addition to the texture size. - * - * @name Phaser.GameObjects.Components.FX#fxPadding - * @type {number} - * @default 0 - * @since 3.60.0 - */ - fxPadding: 0, - - /** - * Sets the amount of extra padding to be applied to this Game Object - * when it is being rendered by a SpriteFX Pipeline. - * - * Lots of FX require additional spacing added to the texture the - * Game Object uses, for example a glow or shadow effect, and this - * method allows you to control how much extra padding is included - * in addition to the texture size. - * - * @method Phaser.GameObjects.Components.FX#setFXPadding - * @webglOnly - * @since 3.60.0 - * - * @param {number} [padding=0] - The amount of padding to add to the texture. - * - * @return {this} This Game Object instance. - */ - setFXPadding: function (padding) - { - if (padding === undefined) { padding = 0; } - - this.fxPadding = padding; - - return this; - }, - - /** - * This callback is invoked when this Game Object is copied by a SpriteFX Pipeline. - * - * This happens when the pipeline uses its `copySprite` method. - * - * It's invoked prior to the copy, allowing you to set shader uniforms, etc on the pipeline. - * - * @method Phaser.GameObjects.Components.FX#onFXCopy - * @webglOnly - * @since 3.60.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline} pipeline - The SpriteFX Pipeline that invoked this callback. - */ - onFXCopy: function () - { - }, - - /** - * This callback is invoked when this Game Object is rendered by a SpriteFX Pipeline. - * - * This happens when the pipeline uses its `drawSprite` method. - * - * It's invoked prior to the draw, allowing you to set shader uniforms, etc on the pipeline. - * - * @method Phaser.GameObjects.Components.FX#onFX - * @webglOnly - * @since 3.60.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline} pipeline - The SpriteFX Pipeline that invoked this callback. - */ - onFX: function () - { - } - -}; - -module.exports = FX; - - -/***/ }), -/* 317 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Rectangle = __webpack_require__(29); -var RotateAround = __webpack_require__(42); -var Vector2 = __webpack_require__(3); - -/** - * Provides methods used for obtaining the bounds of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.GetBounds - * @since 3.0.0 - */ - -var GetBounds = { - - /** - * Processes the bounds output vector before returning it. - * - * @method Phaser.GameObjects.Components.GetBounds#prepareBoundsOutput - * @private - * @since 3.18.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} output - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - prepareBoundsOutput: function (output, includeParent) - { - if (includeParent === undefined) { includeParent = false; } - - if (this.rotation !== 0) - { - RotateAround(output, this.x, this.y, this.rotation); - } - - if (includeParent && this.parentContainer) - { - var parentMatrix = this.parentContainer.getBoundsTransformMatrix(); - - parentMatrix.transformPoint(output.x, output.y, output); - } - - return output; - }, - - /** - * Gets the center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getCenter - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getCenter: function (output) - { - if (output === undefined) { output = new Vector2(); } - - output.x = this.x - (this.displayWidth * this.originX) + (this.displayWidth / 2); - output.y = this.y - (this.displayHeight * this.originY) + (this.displayHeight / 2); - - return output; - }, - - /** - * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getTopLeft - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getTopLeft: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = this.x - (this.displayWidth * this.originX); - output.y = this.y - (this.displayHeight * this.originY); - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the top-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getTopCenter - * @since 3.18.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getTopCenter: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2); - output.y = this.y - (this.displayHeight * this.originY); - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getTopRight - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getTopRight: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; - output.y = this.y - (this.displayHeight * this.originY); - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the left-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getLeftCenter - * @since 3.18.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getLeftCenter: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = this.x - (this.displayWidth * this.originX); - output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2); - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the right-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getRightCenter - * @since 3.18.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getRightCenter: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; - output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2); - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getBottomLeft - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getBottomLeft: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = this.x - (this.displayWidth * this.originX); - output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getBottomCenter - * @since 3.18.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getBottomCenter: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2); - output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * - * @method Phaser.GameObjects.Components.GetBounds#getBottomRight - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? - * - * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. - */ - getBottomRight: function (output, includeParent) - { - if (!output) { output = new Vector2(); } - - output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; - output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; - - return this.prepareBoundsOutput(output, includeParent); - }, - - /** - * Gets the bounds of this Game Object, regardless of origin. - * The values are stored and returned in a Rectangle, or Rectangle-like, object. - * - * @method Phaser.GameObjects.Components.GetBounds#getBounds - * @since 3.0.0 - * - * @generic {Phaser.Geom.Rectangle} O - [output,$return] - * - * @param {(Phaser.Geom.Rectangle|object)} [output] - An object to store the values in. If not provided a new Rectangle will be created. - * - * @return {(Phaser.Geom.Rectangle|object)} The values stored in the output object. - */ - getBounds: function (output) - { - if (output === undefined) { output = new Rectangle(); } - - // We can use the output object to temporarily store the x/y coords in: - - var TLx, TLy, TRx, TRy, BLx, BLy, BRx, BRy; - - // Instead of doing a check if parent container is - // defined per corner we only do it once. - if (this.parentContainer) - { - var parentMatrix = this.parentContainer.getBoundsTransformMatrix(); - - this.getTopLeft(output); - parentMatrix.transformPoint(output.x, output.y, output); - - TLx = output.x; - TLy = output.y; - - this.getTopRight(output); - parentMatrix.transformPoint(output.x, output.y, output); - - TRx = output.x; - TRy = output.y; - - this.getBottomLeft(output); - parentMatrix.transformPoint(output.x, output.y, output); - - BLx = output.x; - BLy = output.y; - - this.getBottomRight(output); - parentMatrix.transformPoint(output.x, output.y, output); - - BRx = output.x; - BRy = output.y; - } - else - { - this.getTopLeft(output); - - TLx = output.x; - TLy = output.y; - - this.getTopRight(output); - - TRx = output.x; - TRy = output.y; - - this.getBottomLeft(output); - - BLx = output.x; - BLy = output.y; - - this.getBottomRight(output); - - BRx = output.x; - BRy = output.y; - } - - output.x = Math.min(TLx, TRx, BLx, BRx); - output.y = Math.min(TLy, TRy, BLy, BRy); - output.width = Math.max(TLx, TRx, BLx, BRx) - output.x; - output.height = Math.max(TLy, TRy, BLy, BRy) - output.y; - - return output; - } - -}; - -module.exports = GetBounds; - - -/***/ }), -/* 318 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if a given point is inside a Rectangle's bounds. - * - * @function Phaser.Geom.Rectangle.Contains - * @since 3.0.0 - * - * @param {Phaser.Geom.Rectangle} rect - The Rectangle to check. - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. - * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ -var Contains = function (rect, x, y) -{ - if (rect.width <= 0 || rect.height <= 0) - { - return false; - } - - return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); -}; - -module.exports = Contains; - - -/***/ }), -/* 319 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GetPoint = __webpack_require__(67); -var Perimeter = __webpack_require__(68); - -/** - * Return an array of points from the perimeter of the rectangle, each spaced out based on the quantity or step required. - * - * @function Phaser.Geom.Rectangle.GetPoints + * @function Phaser.Geom.Line.GetPoints * @since 3.0.0 * * @generic {Phaser.Geom.Point[]} O - [out,$return] * - * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from. - * @param {number} step - Step between points. Used to calculate the number of points to return when quantity is falsey. Ignored if quantity is positive. - * @param {number} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points. - * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in. + * @param {Phaser.Geom.Line} line - The line. + * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. + * @param {(array|Phaser.Geom.Point[])} [out] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. * - * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle. + * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line. */ -var GetPoints = function (rectangle, quantity, stepRate, out) +var GetPoints = function (line, quantity, stepRate, out) { if (out === undefined) { out = []; } // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead. if (!quantity && stepRate > 0) { - quantity = Perimeter(rectangle) / stepRate; + quantity = Length(line) / stepRate; } + var x1 = line.x1; + var y1 = line.y1; + + var x2 = line.x2; + var y2 = line.y2; + for (var i = 0; i < quantity; i++) { var position = i / quantity; - out.push(GetPoint(rectangle, position)); + var x = x1 + (x2 - x1) * position; + var y = y1 + (y2 - y1) * position; + + out.push(new Point(x, y)); } return out; @@ -46056,8 +32533,9 @@ module.exports = GetPoints; /***/ }), -/* 320 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 4771: +/***/ ((module) => { /** * @author Richard Davey @@ -46065,12 +32543,41 @@ module.exports = GetPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); -var GetPoint = __webpack_require__(321); -var GetPoints = __webpack_require__(322); -var GEOM_CONST = __webpack_require__(30); -var Random = __webpack_require__(324); -var Vector2 = __webpack_require__(3); +/** + * Calculate the length of the given line. + * + * @function Phaser.Geom.Line.Length + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line to calculate the length of. + * + * @return {number} The length of the line. + */ +var Length = function (line) +{ + return Math.sqrt((line.x2 - line.x1) * (line.x2 - line.x1) + (line.y2 - line.y1) * (line.y2 - line.y1)); +}; + +module.exports = Length; + + +/***/ }), + +/***/ 284: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var GetPoint = __webpack_require__(8881); +var GetPoints = __webpack_require__(4479); +var GEOM_CONST = __webpack_require__(1643); +var Random = __webpack_require__(3915); +var Vector2 = __webpack_require__(2529); /** * @classdesc @@ -46393,8 +32900,9 @@ module.exports = Line; /***/ }), -/* 321 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 3915: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -46402,139 +32910,7 @@ module.exports = Line; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(12); - -/** - * Get a point on a line that's a given percentage along its length. - * - * @function Phaser.Geom.Line.GetPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [out,$return] - * - * @param {Phaser.Geom.Line} line - The line. - * @param {number} position - A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line. - * @param {(Phaser.Geom.Point|object)} [out] - An optional point, or point-like object, to store the coordinates of the point on the line. - * - * @return {(Phaser.Geom.Point|object)} The point on the line. - */ -var GetPoint = function (line, position, out) -{ - if (out === undefined) { out = new Point(); } - - out.x = line.x1 + (line.x2 - line.x1) * position; - out.y = line.y1 + (line.y2 - line.y1) * position; - - return out; -}; - -module.exports = GetPoint; - - -/***/ }), -/* 322 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Length = __webpack_require__(323); -var Point = __webpack_require__(12); - -/** - * Get a number of points along a line's length. - * - * Provide a `quantity` to get an exact number of points along the line. - * - * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when - * providing a `stepRate`. - * - * @function Phaser.Geom.Line.GetPoints - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point[]} O - [out,$return] - * - * @param {Phaser.Geom.Line} line - The line. - * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. - * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. - * @param {(array|Phaser.Geom.Point[])} [out] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. - * - * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line. - */ -var GetPoints = function (line, quantity, stepRate, out) -{ - if (out === undefined) { out = []; } - - // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead. - if (!quantity && stepRate > 0) - { - quantity = Length(line) / stepRate; - } - - var x1 = line.x1; - var y1 = line.y1; - - var x2 = line.x2; - var y2 = line.y2; - - for (var i = 0; i < quantity; i++) - { - var position = i / quantity; - - var x = x1 + (x2 - x1) * position; - var y = y1 + (y2 - y1) * position; - - out.push(new Point(x, y)); - } - - return out; -}; - -module.exports = GetPoints; - - -/***/ }), -/* 323 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate the length of the given line. - * - * @function Phaser.Geom.Line.Length - * @since 3.0.0 - * - * @param {Phaser.Geom.Line} line - The line to calculate the length of. - * - * @return {number} The length of the line. - */ -var Length = function (line) -{ - return Math.sqrt((line.x2 - line.x1) * (line.x2 - line.x1) + (line.y2 - line.y1) * (line.y2 - line.y1)); -}; - -module.exports = Length; - - -/***/ }), -/* 324 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Point = __webpack_require__(12); +var Point = __webpack_require__(7655); /** * Returns a random point on a given Line. @@ -46565,8 +32941,9 @@ module.exports = Random; /***/ }), -/* 325 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 7655: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -46574,7 +32951,300 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(12); +var Class = __webpack_require__(7473); +var GEOM_CONST = __webpack_require__(1643); + +/** + * @classdesc + * Defines a Point in 2D space, with an x and y component. + * + * @class Point + * @memberof Phaser.Geom + * @constructor + * @since 3.0.0 + * + * @param {number} [x=0] - The x coordinate of this Point. + * @param {number} [y=x] - The y coordinate of this Point. + */ +var Point = new Class({ + + initialize: + + function Point (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + + /** + * The geometry constant type of this object: `GEOM_CONST.POINT`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Point#type + * @type {number} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.POINT; + + /** + * The x coordinate of this Point. + * + * @name Phaser.Geom.Point#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = x; + + /** + * The y coordinate of this Point. + * + * @name Phaser.Geom.Point#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = y; + }, + + /** + * Set the x and y coordinates of the point to the given values. + * + * @method Phaser.Geom.Point#setTo + * @since 3.0.0 + * + * @param {number} [x=0] - The x coordinate of this Point. + * @param {number} [y=x] - The y coordinate of this Point. + * + * @return {this} This Point object. + */ + setTo: function (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + } + +}); + +module.exports = Point; + + +/***/ }), + +/***/ 5956: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if a given point is inside a Rectangle's bounds. + * + * @function Phaser.Geom.Rectangle.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to check. + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. + * + * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. + */ +var Contains = function (rect, x, y) +{ + if (rect.width <= 0 || rect.height <= 0) + { + return false; + } + + return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); +}; + +module.exports = Contains; + + +/***/ }), + +/***/ 716: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Perimeter = __webpack_require__(7120); +var Point = __webpack_require__(7655); + +/** + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * + * @function Phaser.Geom.Rectangle.GetPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle to get the perimeter point from. + * @param {number} position - The normalized distance into the Rectangle's perimeter to return. + * @param {(Phaser.Geom.Point|object)} [out] - An object to update with the `x` and `y` coordinates of the point. + * + * @return {Phaser.Geom.Point} The updated `output` object, or a new Point if no `output` object was given. + */ +var GetPoint = function (rectangle, position, out) +{ + if (out === undefined) { out = new Point(); } + + if (position <= 0 || position >= 1) + { + out.x = rectangle.x; + out.y = rectangle.y; + + return out; + } + + var p = Perimeter(rectangle) * position; + + if (position > 0.5) + { + p -= (rectangle.width + rectangle.height); + + if (p <= rectangle.width) + { + // Face 3 + out.x = rectangle.right - p; + out.y = rectangle.bottom; + } + else + { + // Face 4 + out.x = rectangle.x; + out.y = rectangle.bottom - (p - rectangle.width); + } + } + else if (p <= rectangle.width) + { + // Face 1 + out.x = rectangle.x + p; + out.y = rectangle.y; + } + else + { + // Face 2 + out.x = rectangle.right; + out.y = rectangle.y + (p - rectangle.width); + } + + return out; +}; + +module.exports = GetPoint; + + +/***/ }), + +/***/ 8151: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetPoint = __webpack_require__(716); +var Perimeter = __webpack_require__(7120); + +/** + * Return an array of points from the perimeter of the rectangle, each spaced out based on the quantity or step required. + * + * @function Phaser.Geom.Rectangle.GetPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point[]} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from. + * @param {number} step - Step between points. Used to calculate the number of points to return when quantity is falsey. Ignored if quantity is positive. + * @param {number} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points. + * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in. + * + * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle. + */ +var GetPoints = function (rectangle, quantity, stepRate, out) +{ + if (out === undefined) { out = []; } + + // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead. + if (!quantity && stepRate > 0) + { + quantity = Perimeter(rectangle) / stepRate; + } + + for (var i = 0; i < quantity; i++) + { + var position = i / quantity; + + out.push(GetPoint(rectangle, position)); + } + + return out; +}; + +module.exports = GetPoints; + + +/***/ }), + +/***/ 7120: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the perimeter of a Rectangle. + * + * @function Phaser.Geom.Rectangle.Perimeter + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to use. + * + * @return {number} The perimeter of the Rectangle, equal to `(width * 2) + (height * 2)`. + */ +var Perimeter = function (rect) +{ + return 2 * (rect.width + rect.height); +}; + +module.exports = Perimeter; + + +/***/ }), + +/***/ 2161: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(7655); /** * Returns a random point within a Rectangle. @@ -46603,8 +33273,9 @@ module.exports = Random; /***/ }), -/* 326 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 1392: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -46612,402 +33283,1123 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapMask = __webpack_require__(327); -var GeometryMask = __webpack_require__(330); - -/** - * Provides methods used for getting and setting the mask of a Game Object. - * - * @namespace Phaser.GameObjects.Components.Mask - * @since 3.0.0 - */ - -var Mask = { - - /** - * The Mask this Game Object is using during render. - * - * @name Phaser.GameObjects.Components.Mask#mask - * @type {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} - * @since 3.0.0 - */ - mask: null, - - /** - * Sets the mask that this Game Object will use to render with. - * - * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. - * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. - * - * If a mask is already set on this Game Object it will be immediately replaced. - * - * Masks are positioned in global space and are not relative to the Game Object to which they - * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * - * Masks have no impact on physics or input detection. They are purely a rendering component - * that allows you to limit what is visible during the render pass. - * - * @method Phaser.GameObjects.Components.Mask#setMask - * @since 3.6.2 - * - * @param {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} mask - The mask this Game Object will use when rendering. - * - * @return {this} This Game Object instance. - */ - setMask: function (mask) - { - this.mask = mask; - - return this; - }, - - /** - * Clears the mask that this Game Object was using. - * - * @method Phaser.GameObjects.Components.Mask#clearMask - * @since 3.6.2 - * - * @param {boolean} [destroyMask=false] - Destroy the mask before clearing it? - * - * @return {this} This Game Object instance. - */ - clearMask: function (destroyMask) - { - if (destroyMask === undefined) { destroyMask = false; } - - if (destroyMask && this.mask) - { - this.mask.destroy(); - } - - this.mask = null; - - return this; - }, - - /** - * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, - * including this one, or a Dynamic Texture. - * - * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. - * - * To create the mask you need to pass in a reference to a renderable Game Object. - * A renderable Game Object is one that uses a texture to render with, such as an - * Image, Sprite, Render Texture or BitmapText. - * - * If you do not provide a renderable object, and this Game Object has a texture, - * it will use itself as the object. This means you can call this method to create - * a Bitmap Mask from any renderable texture-based Game Object. - * - * @method Phaser.GameObjects.Components.Mask#createBitmapMask - * @since 3.6.2 - * - * @generic {Phaser.GameObjects.GameObject} G - * @generic {Phaser.Textures.DynamicTexture} T - * @genericUse {(G|T|null)} [maskObject] - * - * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Dynamic Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. - * @param {number} [x] - If creating a Game Object, the horizontal position in the world. - * @param {number} [y] - If creating a Game Object, the vertical position in the world. - * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. - * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. - * - * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created. - */ - createBitmapMask: function (maskObject, x, y, texture, frame) - { - if (maskObject === undefined && (this.texture || this.shader || this.geom)) - { - // eslint-disable-next-line consistent-this - maskObject = this; - } - - return new BitmapMask(this.scene, maskObject, x, y, texture, frame); - }, - - /** - * Creates and returns a Geometry Mask. This mask can be used by any Game Object, - * including this one. - * - * To create the mask you need to pass in a reference to a Graphics Game Object. - * - * If you do not provide a graphics object, and this Game Object is an instance - * of a Graphics object, then it will use itself to create the mask. - * - * This means you can call this method to create a Geometry Mask from any Graphics Game Object. - * - * @method Phaser.GameObjects.Components.Mask#createGeometryMask - * @since 3.6.2 - * - * @generic {Phaser.GameObjects.Graphics} G - * @generic {Phaser.GameObjects.Shape} S - * @genericUse {(G|S)} [graphics] - * - * @param {Phaser.GameObjects.Graphics|Phaser.GameObjects.Shape} [graphics] - A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask. - * - * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. - */ - createGeometryMask: function (graphics) - { - if (graphics === undefined && (this.type === 'Graphics' || this.geom)) - { - // eslint-disable-next-line consistent-this - graphics = this; - } - - return new GeometryMask(this.scene, graphics); - } - -}; - -module.exports = Mask; - - -/***/ }), -/* 327 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var GameObjectFactory = __webpack_require__(328); +var Class = __webpack_require__(7473); +var Contains = __webpack_require__(5956); +var GetPoint = __webpack_require__(716); +var GetPoints = __webpack_require__(8151); +var GEOM_CONST = __webpack_require__(1643); +var Line = __webpack_require__(284); +var Random = __webpack_require__(2161); /** * @classdesc - * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. - * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask, - * not a clipping path. It is only available when using the WebGL Renderer. + * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height) * - * A Bitmap Mask can use any Game Object or Dynamic Texture to determine the alpha of each pixel of the masked Game Object(s). - * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha - * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the - * Bitmap Mask doesn't matter. - * - * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an - * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means - * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects - * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the - * corresponding pixel in the mask. - * - * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, - * combine Geometry Masks and Blend Modes together. - * - * The Bitmap Mask's location matches the location of its Game Object, not the location of the - * masked objects. Moving or transforming the underlying Game Object will change the mask - * (and affect the visibility of any masked objects), whereas moving or transforming a masked object - * will not affect the mask. - * - * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a - * Scene's display list, it will only be used for the mask and its full texture will not be directly - * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will - * render as a normal Game Object and will also serve as a mask. - * - * @class BitmapMask - * @memberof Phaser.Display.Masks + * @class Rectangle + * @memberof Phaser.Geom * @constructor * @since 3.0.0 * - * @param {Phaser.Scene} scene - The Scene to which this mask is being added. - * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Dynamic Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. - * @param {number} [x] - If creating a Game Object, the horizontal position in the world. - * @param {number} [y] - If creating a Game Object, the vertical position in the world. - * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. - * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. + * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. + * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. + * @param {number} [width=0] - The width of the Rectangle. + * @param {number} [height=0] - The height of the Rectangle. */ -var BitmapMask = new Class({ +var Rectangle = new Class({ initialize: - function BitmapMask (scene, maskObject, x, y, texture, frame) + function Rectangle (x, y, width, height) { - if (!maskObject) + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = 0; } + if (height === undefined) { height = 0; } + + /** + * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Rectangle#type + * @type {number} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.RECTANGLE; + + /** + * The X coordinate of the top left corner of the Rectangle. + * + * @name Phaser.Geom.Rectangle#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = x; + + /** + * The Y coordinate of the top left corner of the Rectangle. + * + * @name Phaser.Geom.Rectangle#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = y; + + /** + * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. + * + * @name Phaser.Geom.Rectangle#width + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.width = width; + + /** + * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. + * + * @name Phaser.Geom.Rectangle#height + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.height = height; + }, + + /** + * Checks if the given point is inside the Rectangle's bounds. + * + * @method Phaser.Geom.Rectangle#contains + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. + * + * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. + */ + contains: function (x, y) + { + return Contains(this, x, y); + }, + + /** + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * + * @method Phaser.Geom.Rectangle#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [output,$return] + * + * @param {number} position - The normalized distance into the Rectangle's perimeter to return. + * @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point. + * + * @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given. + */ + getPoint: function (position, output) + { + return GetPoint(this, position, output); + }, + + /** + * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. + * + * @method Phaser.Geom.Rectangle#getPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point[]} O - [output,$return] + * + * @param {number} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. + * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points. + * + * @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided. + */ + getPoints: function (quantity, stepRate, output) + { + return GetPoints(this, quantity, stepRate, output); + }, + + /** + * Returns a random point within the Rectangle's bounds. + * + * @method Phaser.Geom.Rectangle#getRandomPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [point,$return] + * + * @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point. + * + * @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided. + */ + getRandomPoint: function (point) + { + return Random(this, point); + }, + + /** + * Sets the position, width, and height of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setTo + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the top left corner of the Rectangle. + * @param {number} y - The Y coordinate of the top left corner of the Rectangle. + * @param {number} width - The width of the Rectangle. + * @param {number} height - The height of the Rectangle. + * + * @return {this} This Rectangle object. + */ + setTo: function (x, y, width, height) + { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + + return this; + }, + + /** + * Resets the position, width, and height of the Rectangle to 0. + * + * @method Phaser.Geom.Rectangle#setEmpty + * @since 3.0.0 + * + * @return {this} This Rectangle object. + */ + setEmpty: function () + { + return this.setTo(0, 0, 0, 0); + }, + + /** + * Sets the position of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setPosition + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the top left corner of the Rectangle. + * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. + * + * @return {this} This Rectangle object. + */ + setPosition: function (x, y) + { + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + }, + + /** + * Sets the width and height of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setSize + * @since 3.0.0 + * + * @param {number} width - The width to set the Rectangle to. + * @param {number} [height=width] - The height to set the Rectangle to. + * + * @return {this} This Rectangle object. + */ + setSize: function (width, height) + { + if (height === undefined) { height = width; } + + this.width = width; + this.height = height; + + return this; + }, + + /** + * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. + * + * @method Phaser.Geom.Rectangle#isEmpty + * @since 3.0.0 + * + * @return {boolean} `true` if the Rectangle is empty. A Rectangle object is empty if its width or height is less than or equal to 0. + */ + isEmpty: function () + { + return (this.width <= 0 || this.height <= 0); + }, + + /** + * Returns a Line object that corresponds to the top of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineA + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle. + */ + getLineA: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.x, this.y, this.right, this.y); + + return line; + }, + + /** + * Returns a Line object that corresponds to the right of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineB + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle. + */ + getLineB: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.right, this.y, this.right, this.bottom); + + return line; + }, + + /** + * Returns a Line object that corresponds to the bottom of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineC + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle. + */ + getLineC: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.right, this.bottom, this.x, this.bottom); + + return line; + }, + + /** + * Returns a Line object that corresponds to the left of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineD + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle. + */ + getLineD: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.x, this.bottom, this.x, this.y); + + return line; + }, + + /** + * The x coordinate of the left of the Rectangle. + * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. + * + * @name Phaser.Geom.Rectangle#left + * @type {number} + * @since 3.0.0 + */ + left: { + + get: function () { - maskObject = scene.sys.make.image({ x: x, y: y, key: texture, frame: frame, add: false }); + return this.x; + }, + + set: function (value) + { + if (value >= this.right) + { + this.width = 0; + } + else + { + this.width = this.right - value; + } + + this.x = value; + } + + }, + + /** + * The sum of the x and width properties. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. + * + * @name Phaser.Geom.Rectangle#right + * @type {number} + * @since 3.0.0 + */ + right: { + + get: function () + { + return this.x + this.width; + }, + + set: function (value) + { + if (value <= this.x) + { + this.width = 0; + } + else + { + this.width = value - this.x; + } + } + + }, + + /** + * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. + * However it does affect the height property, whereas changing the y value does not affect the height property. + * + * @name Phaser.Geom.Rectangle#top + * @type {number} + * @since 3.0.0 + */ + top: { + + get: function () + { + return this.y; + }, + + set: function (value) + { + if (value >= this.bottom) + { + this.height = 0; + } + else + { + this.height = (this.bottom - value); + } + + this.y = value; + } + + }, + + /** + * The sum of the y and height properties. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. + * + * @name Phaser.Geom.Rectangle#bottom + * @type {number} + * @since 3.0.0 + */ + bottom: { + + get: function () + { + return this.y + this.height; + }, + + set: function (value) + { + if (value <= this.y) + { + this.height = 0; + } + else + { + this.height = value - this.y; + } + } + + }, + + /** + * The x coordinate of the center of the Rectangle. + * + * @name Phaser.Geom.Rectangle#centerX + * @type {number} + * @since 3.0.0 + */ + centerX: { + + get: function () + { + return this.x + (this.width / 2); + }, + + set: function (value) + { + this.x = value - (this.width / 2); + } + + }, + + /** + * The y coordinate of the center of the Rectangle. + * + * @name Phaser.Geom.Rectangle#centerY + * @type {number} + * @since 3.0.0 + */ + centerY: { + + get: function () + { + return this.y + (this.height / 2); + }, + + set: function (value) + { + this.y = value - (this.height / 2); + } + + } + +}); + +module.exports = Rectangle; + + +/***/ }), + +/***/ 9422: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(1392); + +/** + * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union. + * + * @function Phaser.Geom.Rectangle.Union + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to use. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to use. + * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the union in. + * + * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided. + */ +var Union = function (rectA, rectB, out) +{ + if (out === undefined) { out = new Rectangle(); } + + // Cache vars so we can use one of the input rects as the output rect + var x = Math.min(rectA.x, rectB.x); + var y = Math.min(rectA.y, rectB.y); + var w = Math.max(rectA.right, rectB.right) - x; + var h = Math.max(rectA.bottom, rectB.bottom) - y; + + return out.setTo(x, y, w, h); +}; + +module.exports = Union; + + +/***/ }), + +/***/ 1593: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var CONST = __webpack_require__(4359); +var Events = __webpack_require__(1179); +var GetFastValue = __webpack_require__(4597); +var GetURL = __webpack_require__(5593); +var MergeXHRSettings = __webpack_require__(7410); +var XHRLoader = __webpack_require__(5874); +var XHRSettings = __webpack_require__(707); + +/** + * @classdesc + * The base File class used by all File Types that the Loader can support. + * You shouldn't create an instance of a File directly, but should extend it with your own class, setting a custom type and processing methods. + * + * @class File + * @memberof Phaser.Loader + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. + * @param {Phaser.Types.Loader.FileConfig} fileConfig - The file configuration object, as created by the file type. + */ +var File = new Class({ + + initialize: + + function File (loader, fileConfig) + { + /** + * A reference to the Loader that is going to load this file. + * + * @name Phaser.Loader.File#loader + * @type {Phaser.Loader.LoaderPlugin} + * @since 3.0.0 + */ + this.loader = loader; + + /** + * A reference to the Cache, or Texture Manager, that is going to store this file if it loads. + * + * @name Phaser.Loader.File#cache + * @type {(Phaser.Cache.BaseCache|Phaser.Textures.TextureManager)} + * @since 3.7.0 + */ + this.cache = GetFastValue(fileConfig, 'cache', false); + + /** + * The file type string (image, json, etc) for sorting within the Loader. + * + * @name Phaser.Loader.File#type + * @type {string} + * @since 3.0.0 + */ + this.type = GetFastValue(fileConfig, 'type', false); + + if (!this.type) + { + throw new Error('Invalid File type: ' + this.type); } /** - * The Game Object that is used as the mask. Must use a texture, such as a Sprite. + * Unique cache key (unique within its file type) * - * @name Phaser.Display.Masks.BitmapMask#bitmapMask - * @type {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} + * @name Phaser.Loader.File#key + * @type {string} * @since 3.0.0 */ - this.bitmapMask = maskObject; + this.key = GetFastValue(fileConfig, 'key', false); + + var loadKey = this.key; + + if (loader.prefix && loader.prefix !== '') + { + this.key = loader.prefix + loadKey; + } + + if (!this.key) + { + throw new Error('Invalid File key: ' + this.key); + } + + var url = GetFastValue(fileConfig, 'url'); + + if (url === undefined) + { + url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); + } + else if (typeof url === 'string' && !url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)) + { + url = loader.path + url; + } /** - * Whether to invert the masks alpha. + * The URL of the file, not including baseURL. * - * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. + * Automatically has Loader.path prepended to it if a string. * - * Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. + * Can also be a JavaScript Object, such as the results of parsing JSON data. * - * @name Phaser.Display.Masks.BitmapMask#invertAlpha - * @type {boolean} - * @since 3.1.2 + * @name Phaser.Loader.File#url + * @type {object|string} + * @since 3.0.0 */ - this.invertAlpha = false; + this.url = url; /** - * Is this mask a stencil mask? This is false by default and should not be changed. + * The final URL this file will load from, including baseURL and path. + * Set automatically when the Loader calls 'load' on this file. * - * @name Phaser.Display.Masks.BitmapMask#isStencil - * @type {boolean} - * @readonly - * @since 3.17.0 + * @name Phaser.Loader.File#src + * @type {string} + * @since 3.0.0 */ - this.isStencil = false; + this.src = ''; + + /** + * The merged XHRSettings for this file. + * + * @name Phaser.Loader.File#xhrSettings + * @type {Phaser.Types.Loader.XHRSettingsObject} + * @since 3.0.0 + */ + this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined)); + + if (GetFastValue(fileConfig, 'xhrSettings', false)) + { + this.xhrSettings = MergeXHRSettings(this.xhrSettings, GetFastValue(fileConfig, 'xhrSettings', {})); + } + + /** + * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File. + * + * @name Phaser.Loader.File#xhrLoader + * @type {?XMLHttpRequest} + * @since 3.0.0 + */ + this.xhrLoader = null; + + /** + * The current state of the file. One of the FILE_CONST values. + * + * @name Phaser.Loader.File#state + * @type {number} + * @since 3.0.0 + */ + this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING; + + /** + * The total size of this file. + * Set by onProgress and only if loading via XHR. + * + * @name Phaser.Loader.File#bytesTotal + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.bytesTotal = 0; + + /** + * Updated as the file loads. + * Only set if loading via XHR. + * + * @name Phaser.Loader.File#bytesLoaded + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.bytesLoaded = -1; + + /** + * A percentage value between 0 and 1 indicating how much of this file has loaded. + * Only set if loading via XHR. + * + * @name Phaser.Loader.File#percentComplete + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.percentComplete = -1; + + /** + * For CORs based loading. + * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set) + * + * @name Phaser.Loader.File#crossOrigin + * @type {(string|undefined)} + * @since 3.0.0 + */ + this.crossOrigin = undefined; + + /** + * The processed file data, stored here after the file has loaded. + * + * @name Phaser.Loader.File#data + * @type {*} + * @since 3.0.0 + */ + this.data = undefined; + + /** + * A config object that can be used by file types to store transitional data. + * + * @name Phaser.Loader.File#config + * @type {*} + * @since 3.0.0 + */ + this.config = GetFastValue(fileConfig, 'config', {}); + + /** + * If this is a multipart file, i.e. an atlas and its json together, then this is a reference + * to the parent MultiFile. Set and used internally by the Loader or specific file types. + * + * @name Phaser.Loader.File#multiFile + * @type {?Phaser.Loader.MultiFile} + * @since 3.7.0 + */ + this.multiFile; + + /** + * Does this file have an associated linked file? Such as an image and a normal map. + * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't + * actually bound by data, where-as a linkFile is. + * + * @name Phaser.Loader.File#linkFile + * @type {?Phaser.Loader.File} + * @since 3.7.0 + */ + this.linkFile; }, /** - * Sets a new Game Object or Dynamic Texture for this Bitmap Mask to use. + * Links this File with another, so they depend upon each other for loading and processing. * - * If a Game Object it must have a texture, such as a Sprite. + * @method Phaser.Loader.File#setLink + * @since 3.7.0 * - * You can update the source of the mask as often as you like. + * @param {Phaser.Loader.File} fileB - The file to link to this one. + */ + setLink: function (fileB) + { + this.linkFile = fileB; + + fileB.linkFile = this; + }, + + /** + * Resets the XHRLoader instance this file is using. * - * @method Phaser.Display.Masks.BitmapMask#setBitmap + * @method Phaser.Loader.File#resetXHR + * @since 3.0.0 + */ + resetXHR: function () + { + if (this.xhrLoader) + { + this.xhrLoader.onload = undefined; + this.xhrLoader.onerror = undefined; + this.xhrLoader.onprogress = undefined; + } + }, + + /** + * Called by the Loader, starts the actual file downloading. + * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. + * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. + * + * @method Phaser.Loader.File#load + * @since 3.0.0 + */ + load: function () + { + if (this.state === CONST.FILE_POPULATED) + { + // Can happen for example in a JSONFile if they've provided a JSON object instead of a URL + this.loader.nextFile(this, true); + } + else + { + this.state = CONST.FILE_LOADING; + + this.src = GetURL(this, this.loader.baseURL); + + if (this.src.indexOf('data:') === 0) + { + console.warn('Local data URIs are not supported: ' + this.key); + } + else + { + // The creation of this XHRLoader starts the load process going. + // It will automatically call the following, based on the load outcome: + // + // xhr.onload = this.onLoad + // xhr.onerror = this.onError + // xhr.onprogress = this.onProgress + + this.xhrLoader = XHRLoader(this, this.loader.xhr); + } + } + }, + + /** + * Called when the file finishes loading, is sent a DOM ProgressEvent. + * + * @method Phaser.Loader.File#onLoad * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} maskObject - The Game Object or Dynamic Texture that will be used as the mask. If a Game Object, it must have a texture, such as a Sprite. + * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event. + * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load. */ - setBitmap: function (maskObject) + onLoad: function (xhr, event) { - this.bitmapMask = maskObject; + var isLocalFile = xhr.responseURL && this.loader.localSchemes.some(function (scheme) + { + return xhr.responseURL.indexOf(scheme) === 0; + }); + + var localFileOk = (isLocalFile && event.target.status === 0); + + var success = !(event.target && event.target.status !== 200) || localFileOk; + + // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called. + if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599) + { + success = false; + } + + this.state = CONST.FILE_LOADED; + + this.resetXHR(); + + this.loader.nextFile(this, success); }, /** - * Prepares the WebGL Renderer to render a Game Object with this mask applied. + * Called if the file errors while loading, is sent a DOM ProgressEvent. * - * This renders the masking Game Object to the mask framebuffer and switches to the main framebuffer so that the masked Game Object will be rendered to it instead of being rendered directly to the frame. - * - * @method Phaser.Display.Masks.BitmapMask#preRenderWebGL + * @method Phaser.Loader.File#onError * @since 3.0.0 * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to prepare. - * @param {Phaser.GameObjects.GameObject} maskedObject - The masked Game Object which will be drawn. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. + * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event. + * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this error. */ - preRenderWebGL: function (renderer, maskedObject, camera) + onError: function () { - renderer.pipelines.BITMAPMASK_PIPELINE.beginMask(this, maskedObject, camera); + this.resetXHR(); + + this.loader.nextFile(this, false); }, /** - * Finalizes rendering of a masked Game Object. + * Called during the file load progress. Is sent a DOM ProgressEvent. * - * This resets the previously bound framebuffer and switches the WebGL Renderer to the Bitmap Mask Pipeline, which uses a special fragment shader to apply the masking effect. - * - * @method Phaser.Display.Masks.BitmapMask#postRenderWebGL + * @method Phaser.Loader.File#onProgress + * @fires Phaser.Loader.Events#FILE_PROGRESS * @since 3.0.0 * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to clean up. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. - * @param {Phaser.Renderer.WebGL.RenderTarget} [renderTarget] - Optional WebGL RenderTarget. + * @param {ProgressEvent} event - The DOM ProgressEvent. */ - postRenderWebGL: function (renderer, camera, renderTarget) + onProgress: function (event) { - renderer.pipelines.BITMAPMASK_PIPELINE.endMask(this, camera, renderTarget); + if (event.lengthComputable) + { + this.bytesLoaded = event.loaded; + this.bytesTotal = event.total; + + this.percentComplete = Math.min((this.bytesLoaded / this.bytesTotal), 1); + + this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete); + } }, /** - * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * Usually overridden by the FileTypes and is called by Loader.nextFile. + * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage. * - * @method Phaser.Display.Masks.BitmapMask#preRenderCanvas + * @method Phaser.Loader.File#onProcess * @since 3.0.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to. - * @param {Phaser.GameObjects.GameObject} mask - The masked Game Object which would be rendered. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. */ - preRenderCanvas: function () + onProcess: function () { - // NOOP + this.state = CONST.FILE_PROCESSING; + + this.onProcessComplete(); }, /** - * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * Called when the File has completed processing. + * Checks on the state of its multifile, if set. * - * @method Phaser.Display.Masks.BitmapMask#postRenderCanvas - * @since 3.0.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to. + * @method Phaser.Loader.File#onProcessComplete + * @since 3.7.0 */ - postRenderCanvas: function () + onProcessComplete: function () { - // NOOP + this.state = CONST.FILE_COMPLETE; + + if (this.multiFile) + { + this.multiFile.onFileComplete(this); + } + + this.loader.fileProcessComplete(this); }, /** - * Destroys this BitmapMask and nulls any references it holds. + * Called when the File has completed processing but it generated an error. + * Checks on the state of its multifile, if set. * - * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, - * so be sure to call `clearMask` on any Game Object using it, before destroying it. + * @method Phaser.Loader.File#onProcessError + * @since 3.7.0 + */ + onProcessError: function () + { + // eslint-disable-next-line no-console + console.error('Failed to process file: %s "%s"', this.type, this.key); + + this.state = CONST.FILE_ERRORED; + + if (this.multiFile) + { + this.multiFile.onFileFailed(this); + } + + this.loader.fileProcessComplete(this); + }, + + /** + * Checks if a key matching the one used by this file exists in the target Cache or not. + * This is called automatically by the LoaderPlugin to decide if the file can be safely + * loaded or will conflict. * - * @method Phaser.Display.Masks.BitmapMask#destroy + * @method Phaser.Loader.File#hasCacheConflict + * @since 3.7.0 + * + * @return {boolean} `true` if adding this file will cause a conflict, otherwise `false`. + */ + hasCacheConflict: function () + { + return (this.cache && this.cache.exists(this.key)); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * This method is often overridden by specific file types. + * + * @method Phaser.Loader.File#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + if (this.cache && this.data) + { + this.cache.add(this.key, this.data); + } + }, + + /** + * Called once the file has been added to its cache and is now ready for deletion from the Loader. + * It will emit a `filecomplete` event from the LoaderPlugin. + * + * @method Phaser.Loader.File#pendingDestroy + * @fires Phaser.Loader.Events#FILE_COMPLETE + * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE + * @since 3.7.0 + */ + pendingDestroy: function (data) + { + if (this.state === CONST.FILE_PENDING_DESTROY) + { + return; + } + + if (data === undefined) { data = this.data; } + + var key = this.key; + var type = this.type; + + this.loader.emit(Events.FILE_COMPLETE, key, type, data); + this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data); + + this.loader.flagForRemoval(this); + + this.state = CONST.FILE_PENDING_DESTROY; + }, + + /** + * Destroy this File and any references it holds. + * + * @method Phaser.Loader.File#destroy * @since 3.7.0 */ destroy: function () { - this.bitmapMask = null; + this.loader = null; + this.cache = null; + this.xhrSettings = null; + this.multiFile = null; + this.linkFile = null; + this.data = null; } }); /** - * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. - * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask, - * not a clipping path. It is only available when using the WebGL Renderer. + * Static method for creating object URL using URL API and setting it as image 'src' attribute. + * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader. * - * A Bitmap Mask can use any Game Object, or Dynamic Texture, to determine the alpha of each pixel of the masked Game Object(s). - * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha - * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the - * Bitmap Mask doesn't matter. + * @method Phaser.Loader.File.createObjectURL + * @static + * @since 3.7.0 * - * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an - * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means - * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects - * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the - * corresponding pixel in the mask. - * - * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, - * combine Geometry Masks and Blend Modes together. - * - * The Bitmap Mask's location matches the location of its Game Object, not the location of the - * masked objects. Moving or transforming the underlying Game Object will change the mask - * (and affect the visibility of any masked objects), whereas moving or transforming a masked object - * will not affect the mask. - * - * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a - * Scene's display list, it will only be used for the mask and its full texture will not be directly - * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will - * render as a normal Game Object and will also serve as a mask. - * - * @method Phaser.GameObjects.GameObjectFactory#bitmapMask - * @since 3.60.0 - * - * @param {(Phaser.GameObjects.GameObject|Phaser.Textures.DynamicTexture)} [maskObject] - The Game Object or Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. - * @param {number} [x] - If creating a Game Object, the horizontal position in the world. - * @param {number} [y] - If creating a Game Object, the vertical position in the world. - * @param {(string|Phaser.Textures.Texture)} [texture] - If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. - * @param {(string|number|Phaser.Textures.Frame)} [frame] - If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. - * - * @return {Phaser.Display.Masks.BitmapMask} The Bitmap Mask that was created. + * @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL. + * @param {Blob} blob - A Blob object to create an object URL for. + * @param {string} defaultType - Default mime type used if blob type is not available. */ -GameObjectFactory.register('bitmapMask', function (maskObject, x, y, key, frame) +File.createObjectURL = function (image, blob, defaultType) { - return new BitmapMask(this.scene, maskObject, x, y, key, frame); -}); + if (typeof URL === 'function') + { + image.src = URL.createObjectURL(blob); + } + else + { + var reader = new FileReader(); -module.exports = BitmapMask; + reader.onload = function () + { + image.removeAttribute('crossOrigin'); + image.src = 'data:' + (blob.type || defaultType) + ';base64,' + reader.result.split(',')[1]; + }; + + reader.onerror = image.onerror; + + reader.readAsDataURL(blob); + } +}; + +/** + * Static method for releasing an existing object URL which was previously created + * by calling {@link File#createObjectURL} method. + * + * @method Phaser.Loader.File.revokeObjectURL + * @static + * @since 3.7.0 + * + * @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked. + */ +File.revokeObjectURL = function (image) +{ + if (typeof URL === 'function') + { + URL.revokeObjectURL(image.src); + } +}; + +module.exports = File; /***/ }), -/* 328 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 9845: +/***/ ((module) => { /** * @author Richard Davey @@ -47015,232 +34407,13484 @@ module.exports = BitmapMask; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(329); -var SceneEvents = __webpack_require__(23); +var types = {}; /** - * @classdesc - * The Game Object Factory is a Scene plugin that allows you to quickly create many common - * types of Game Objects and have them automatically registered with the Scene. - * - * Game Objects directly register themselves with the Factory and inject their own creation - * methods into the class. - * - * @class GameObjectFactory - * @memberof Phaser.GameObjects - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object Factory belongs. + * @namespace Phaser.Loader.FileTypesManager */ -var GameObjectFactory = new Class({ - initialize: - - function GameObjectFactory (scene) - { - /** - * The Scene to which this Game Object Factory belongs. - * - * @name Phaser.GameObjects.GameObjectFactory#scene - * @type {Phaser.Scene} - * @protected - * @since 3.0.0 - */ - this.scene = scene; - - /** - * A reference to the Scene.Systems. - * - * @name Phaser.GameObjects.GameObjectFactory#systems - * @type {Phaser.Scenes.Systems} - * @protected - * @since 3.0.0 - */ - this.systems = scene.sys; - - /** - * A reference to the Scene Event Emitter. - * - * @name Phaser.GameObjects.GameObjectFactory#events - * @type {Phaser.Events.EventEmitter} - * @protected - * @since 3.50.0 - */ - this.events = scene.sys.events; - - /** - * A reference to the Scene Display List. - * - * @name Phaser.GameObjects.GameObjectFactory#displayList - * @type {Phaser.GameObjects.DisplayList} - * @protected - * @since 3.0.0 - */ - this.displayList; - - /** - * A reference to the Scene Update List. - * - * @name Phaser.GameObjects.GameObjectFactory#updateList - * @type {Phaser.GameObjects.UpdateList} - * @protected - * @since 3.0.0 - */ - this.updateList; - - this.events.once(SceneEvents.BOOT, this.boot, this); - this.events.on(SceneEvents.START, this.start, this); - }, +var FileTypesManager = { /** - * This method is called automatically, only once, when the Scene is first created. - * Do not invoke it directly. + * Static method called when a LoaderPlugin is created. * - * @method Phaser.GameObjects.GameObjectFactory#boot - * @private - * @since 3.5.1 - */ - boot: function () - { - this.displayList = this.systems.displayList; - this.updateList = this.systems.updateList; - - this.events.once(SceneEvents.DESTROY, this.destroy, this); - }, - - /** - * This method is called automatically by the Scene when it is starting up. - * It is responsible for creating local systems, properties and listening for Scene events. - * Do not invoke it directly. + * Loops through the local types object and injects all of them as + * properties into the LoaderPlugin instance. * - * @method Phaser.GameObjects.GameObjectFactory#start - * @private - * @since 3.5.0 - */ - start: function () - { - this.events.once(SceneEvents.SHUTDOWN, this.shutdown, this); - }, - - /** - * Adds an existing Game Object to this Scene. - * - * If the Game Object renders, it will be added to the Display List. - * If it has a `preUpdate` method, it will be added to the Update List. - * - * @method Phaser.GameObjects.GameObjectFactory#existing + * @method Phaser.Loader.FileTypesManager.install * @since 3.0.0 * - * @generic {(Phaser.GameObjects.GameObject|Phaser.GameObjects.Group|Phaser.GameObjects.Layer)} G - [child,$return] - * - * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.Group|Phaser.GameObjects.Layer)} child - The child to be added to this Scene. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that was added. + * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into. */ - existing: function (child) + install: function (loader) { - if (child.renderCanvas || child.renderWebGL) + for (var key in types) { - this.displayList.add(child); + loader[key] = types[key]; } - - // For when custom objects have overridden `preUpdate` but don't hook into the ADDED_TO_SCENE event: - // Adding to the list multiple times is safe, as it won't add duplicates into the list anyway. - if (child.preUpdate) - { - this.updateList.add(child); - } - - return child; }, /** - * The Scene that owns this plugin is shutting down. - * We need to kill and reset all internal properties as well as stop listening to Scene events. + * Static method called directly by the File Types. * - * @method Phaser.GameObjects.GameObjectFactory#shutdown - * @private + * The key is a reference to the function used to load the files via the Loader, i.e. `image`. + * + * @method Phaser.Loader.FileTypesManager.register * @since 3.0.0 + * + * @param {string} key - The key that will be used as the method name in the LoaderPlugin. + * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked. */ - shutdown: function () + register: function (key, factoryFunction) { - this.events.off(SceneEvents.SHUTDOWN, this.shutdown, this); + types[key] = factoryFunction; }, /** - * The Scene that owns this plugin is being destroyed. - * We need to shutdown and then kill off all external references. + * Removed all associated file types. * - * @method Phaser.GameObjects.GameObjectFactory#destroy - * @private + * @method Phaser.Loader.FileTypesManager.destroy * @since 3.0.0 */ destroy: function () { - this.shutdown(); + types = {}; + } - this.events.off(SceneEvents.START, this.start, this); +}; - this.scene = null; - this.systems = null; - this.events = null; +module.exports = FileTypesManager; - this.displayList = null; - this.updateList = null; + +/***/ }), + +/***/ 5593: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Given a File and a baseURL value this returns the URL the File will use to download from. + * + * @function Phaser.Loader.GetURL + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - The File object. + * @param {string} baseURL - A default base URL. + * + * @return {string} The URL the File will use. + */ +var GetURL = function (file, baseURL) +{ + if (!file.url) + { + return false; + } + + if (file.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)) + { + return file.url; + } + else + { + return baseURL + file.url; + } +}; + +module.exports = GetURL; + + +/***/ }), + +/***/ 7410: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(1030); +var XHRSettings = __webpack_require__(707); + +/** + * Takes two XHRSettings Objects and creates a new XHRSettings object from them. + * + * The new object is seeded by the values given in the global settings, but any setting in + * the local object overrides the global ones. + * + * @function Phaser.Loader.MergeXHRSettings + * @since 3.0.0 + * + * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object. + * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object. + */ +var MergeXHRSettings = function (global, local) +{ + var output = (global === undefined) ? XHRSettings() : Extend({}, global); + + if (local) + { + for (var setting in local) + { + if (local[setting] !== undefined) + { + output[setting] = local[setting]; + } + } + } + + return output; +}; + +module.exports = MergeXHRSettings; + + +/***/ }), + +/***/ 3137: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var CONST = __webpack_require__(4359); +var Events = __webpack_require__(1179); + +/** + * @classdesc + * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after + * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. + * + * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. + * + * @class MultiFile + * @memberof Phaser.Loader + * @constructor + * @since 3.7.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. + * @param {string} type - The file type string for sorting within the Loader. + * @param {string} key - The key of the file within the loader. + * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile. + */ +var MultiFile = new Class({ + + initialize: + + function MultiFile (loader, type, key, files) + { + var finalFiles = []; + + // Clean out any potential 'null' or 'undefined' file entries + files.forEach(function (file) + { + if (file) + { + finalFiles.push(file); + } + }); + + /** + * A reference to the Loader that is going to load this file. + * + * @name Phaser.Loader.MultiFile#loader + * @type {Phaser.Loader.LoaderPlugin} + * @since 3.7.0 + */ + this.loader = loader; + + /** + * The file type string for sorting within the Loader. + * + * @name Phaser.Loader.MultiFile#type + * @type {string} + * @since 3.7.0 + */ + this.type = type; + + /** + * Unique cache key (unique within its file type) + * + * @name Phaser.Loader.MultiFile#key + * @type {string} + * @since 3.7.0 + */ + this.key = key; + + /** + * The current index being used by multi-file loaders to avoid key clashes. + * + * @name Phaser.Loader.MultiFile#multiKeyIndex + * @type {number} + * @private + * @since 3.20.0 + */ + this.multiKeyIndex = loader.multiKeyIndex++; + + /** + * Array of files that make up this MultiFile. + * + * @name Phaser.Loader.MultiFile#files + * @type {Phaser.Loader.File[]} + * @since 3.7.0 + */ + this.files = finalFiles; + + /** + * The current state of the file. One of the FILE_CONST values. + * + * @name Phaser.Loader.MultiFile#state + * @type {number} + * @since 3.60.0 + */ + this.state = CONST.FILE_PENDING; + + /** + * The completion status of this MultiFile. + * + * @name Phaser.Loader.MultiFile#complete + * @type {boolean} + * @default false + * @since 3.7.0 + */ + this.complete = false; + + /** + * The number of files to load. + * + * @name Phaser.Loader.MultiFile#pending + * @type {number} + * @since 3.7.0 + */ + + this.pending = finalFiles.length; + + /** + * The number of files that failed to load. + * + * @name Phaser.Loader.MultiFile#failed + * @type {number} + * @default 0 + * @since 3.7.0 + */ + this.failed = 0; + + /** + * A storage container for transient data that the loading files need. + * + * @name Phaser.Loader.MultiFile#config + * @type {any} + * @since 3.7.0 + */ + this.config = {}; + + /** + * A reference to the Loaders baseURL at the time this MultiFile was created. + * Used to populate child-files. + * + * @name Phaser.Loader.MultiFile#baseURL + * @type {string} + * @since 3.20.0 + */ + this.baseURL = loader.baseURL; + + /** + * A reference to the Loaders path at the time this MultiFile was created. + * Used to populate child-files. + * + * @name Phaser.Loader.MultiFile#path + * @type {string} + * @since 3.20.0 + */ + this.path = loader.path; + + /** + * A reference to the Loaders prefix at the time this MultiFile was created. + * Used to populate child-files. + * + * @name Phaser.Loader.MultiFile#prefix + * @type {string} + * @since 3.20.0 + */ + this.prefix = loader.prefix; + + // Link the files + for (var i = 0; i < finalFiles.length; i++) + { + finalFiles[i].multiFile = this; + } + }, + + /** + * Checks if this MultiFile is ready to process its children or not. + * + * @method Phaser.Loader.MultiFile#isReadyToProcess + * @since 3.7.0 + * + * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`. + */ + isReadyToProcess: function () + { + return (this.pending === 0 && this.failed === 0 && !this.complete); + }, + + /** + * Adds another child to this MultiFile, increases the pending count and resets the completion status. + * + * @method Phaser.Loader.MultiFile#addToMultiFile + * @since 3.7.0 + * + * @param {Phaser.Loader.File} files - The File to add to this MultiFile. + * + * @return {Phaser.Loader.MultiFile} This MultiFile instance. + */ + addToMultiFile: function (file) + { + this.files.push(file); + + file.multiFile = this; + + this.pending++; + + this.complete = false; + + return this; + }, + + /** + * Called by each File when it finishes loading. + * + * @method Phaser.Loader.MultiFile#onFileComplete + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The File that has completed processing. + */ + onFileComplete: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.pending--; + } + }, + + /** + * Called by each File that fails to load. + * + * @method Phaser.Loader.MultiFile#onFileFailed + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The File that has failed to load. + */ + onFileFailed: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.failed++; + + // eslint-disable-next-line no-console + console.error('File failed: %s "%s" (via %s "%s")', this.type, this.key, file.type, file.key); + } + }, + + /** + * Called once all children of this multi file have been added to their caches and is now + * ready for deletion from the Loader. + * + * It will emit a `filecomplete` event from the LoaderPlugin. + * + * @method Phaser.Loader.MultiFile#pendingDestroy + * @fires Phaser.Loader.Events#FILE_COMPLETE + * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE + * @since 3.60.0 + */ + pendingDestroy: function () + { + if (this.state === CONST.FILE_PENDING_DESTROY) + { + return; + } + + var key = this.key; + var type = this.type; + + this.loader.emit(Events.FILE_COMPLETE, key, type); + this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type); + + this.loader.flagForRemoval(this); + + for (var i = 0; i < this.files.length; i++) + { + this.files[i].pendingDestroy(); + } + + this.state = CONST.FILE_PENDING_DESTROY; + }, + + /** + * Destroy this Multi File and any references it holds. + * + * @method Phaser.Loader.MultiFile#destroy + * @since 3.60.0 + */ + destroy: function () + { + this.loader = null; + this.files = null; + this.config = null; + } + +}); + +module.exports = MultiFile; + + +/***/ }), + +/***/ 5874: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MergeXHRSettings = __webpack_require__(7410); + +/** + * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings + * and starts the download of it. It uses the Files own XHRSettings and merges them + * with the global XHRSettings object to set the xhr values before download. + * + * @function Phaser.Loader.XHRLoader + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - The File to download. + * @param {Phaser.Types.Loader.XHRSettingsObject} globalXHRSettings - The global XHRSettings object. + * + * @return {XMLHttpRequest} The XHR object. + */ +var XHRLoader = function (file, globalXHRSettings) +{ + var config = MergeXHRSettings(globalXHRSettings, file.xhrSettings); + + var xhr = new XMLHttpRequest(); + + xhr.open('GET', file.src, config.async, config.user, config.password); + + xhr.responseType = file.xhrSettings.responseType; + xhr.timeout = config.timeout; + + if (config.headers) + { + for (var key in config.headers) + { + xhr.setRequestHeader(key, config.headers[key]); + } + } + + if (config.header && config.headerValue) + { + xhr.setRequestHeader(config.header, config.headerValue); + } + + if (config.requestedWith) + { + xhr.setRequestHeader('X-Requested-With', config.requestedWith); + } + + if (config.overrideMimeType) + { + xhr.overrideMimeType(config.overrideMimeType); + } + + if (config.withCredentials) + { + xhr.withCredentials = true; + } + + // After a successful request, the xhr.response property will contain the requested data as a DOMString, ArrayBuffer, Blob, or Document (depending on what was set for responseType.) + + xhr.onload = file.onLoad.bind(file, xhr); + xhr.onerror = file.onError.bind(file, xhr); + xhr.onprogress = file.onProgress.bind(file); + + // This is the only standard method, the ones above are browser additions (maybe not universal?) + // xhr.onreadystatechange + + xhr.send(); + + return xhr; +}; + +module.exports = XHRLoader; + + +/***/ }), + +/***/ 707: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Creates an XHRSettings Object with default values. + * + * @function Phaser.Loader.XHRSettings + * @since 3.0.0 + * + * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'. + * @param {boolean} [async=true] - Should the XHR request use async or not? + * @param {string} [user=''] - Optional username for the XHR request. + * @param {string} [password=''] - Optional password for the XHR request. + * @param {number} [timeout=0] - Optional XHR timeout value. + * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. + */ +var XHRSettings = function (responseType, async, user, password, timeout, withCredentials) +{ + if (responseType === undefined) { responseType = ''; } + if (async === undefined) { async = true; } + if (user === undefined) { user = ''; } + if (password === undefined) { password = ''; } + if (timeout === undefined) { timeout = 0; } + if (withCredentials === undefined) { withCredentials = false; } + + // Before sending a request, set the xhr.responseType to "text", + // "arraybuffer", "blob", or "document", depending on your data needs. + // Note, setting xhr.responseType = '' (or omitting) will default the response to "text". + + return { + + // Ignored by the Loader, only used by File. + responseType: responseType, + + async: async, + + // credentials + user: user, + password: password, + + // timeout in ms (0 = no timeout) + timeout: timeout, + + // setRequestHeader + headers: undefined, + header: undefined, + headerValue: undefined, + requestedWith: false, + + // overrideMimeType + overrideMimeType: undefined, + + // withCredentials + withCredentials: withCredentials + + }; +}; + +module.exports = XHRSettings; + + +/***/ }), + +/***/ 4359: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FILE_CONST = { + + /** + * The Loader is idle. + * + * @name Phaser.Loader.LOADER_IDLE + * @type {number} + * @since 3.0.0 + */ + LOADER_IDLE: 0, + + /** + * The Loader is actively loading. + * + * @name Phaser.Loader.LOADER_LOADING + * @type {number} + * @since 3.0.0 + */ + LOADER_LOADING: 1, + + /** + * The Loader is processing files is has loaded. + * + * @name Phaser.Loader.LOADER_PROCESSING + * @type {number} + * @since 3.0.0 + */ + LOADER_PROCESSING: 2, + + /** + * The Loader has completed loading and processing. + * + * @name Phaser.Loader.LOADER_COMPLETE + * @type {number} + * @since 3.0.0 + */ + LOADER_COMPLETE: 3, + + /** + * The Loader is shutting down. + * + * @name Phaser.Loader.LOADER_SHUTDOWN + * @type {number} + * @since 3.0.0 + */ + LOADER_SHUTDOWN: 4, + + /** + * The Loader has been destroyed. + * + * @name Phaser.Loader.LOADER_DESTROYED + * @type {number} + * @since 3.0.0 + */ + LOADER_DESTROYED: 5, + + /** + * File is in the load queue but not yet started. + * + * @name Phaser.Loader.FILE_PENDING + * @type {number} + * @since 3.0.0 + */ + FILE_PENDING: 10, + + /** + * File has been started to load by the loader (onLoad called) + * + * @name Phaser.Loader.FILE_LOADING + * @type {number} + * @since 3.0.0 + */ + FILE_LOADING: 11, + + /** + * File has loaded successfully, awaiting processing. + * + * @name Phaser.Loader.FILE_LOADED + * @type {number} + * @since 3.0.0 + */ + FILE_LOADED: 12, + + /** + * File failed to load. + * + * @name Phaser.Loader.FILE_FAILED + * @type {number} + * @since 3.0.0 + */ + FILE_FAILED: 13, + + /** + * File is being processed (onProcess callback) + * + * @name Phaser.Loader.FILE_PROCESSING + * @type {number} + * @since 3.0.0 + */ + FILE_PROCESSING: 14, + + /** + * The File has errored somehow during processing. + * + * @name Phaser.Loader.FILE_ERRORED + * @type {number} + * @since 3.0.0 + */ + FILE_ERRORED: 16, + + /** + * File has finished processing. + * + * @name Phaser.Loader.FILE_COMPLETE + * @type {number} + * @since 3.0.0 + */ + FILE_COMPLETE: 17, + + /** + * File has been destroyed. + * + * @name Phaser.Loader.FILE_DESTROYED + * @type {number} + * @since 3.0.0 + */ + FILE_DESTROYED: 18, + + /** + * File was populated from local data and doesn't need an HTTP request. + * + * @name Phaser.Loader.FILE_POPULATED + * @type {number} + * @since 3.0.0 + */ + FILE_POPULATED: 19, + + /** + * File is pending being destroyed. + * + * @name Phaser.Loader.FILE_PENDING_DESTROY + * @type {number} + * @since 3.60.0 + */ + FILE_PENDING_DESTROY: 20 + +}; + +module.exports = FILE_CONST; + + +/***/ }), + +/***/ 462: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Add File Event. + * + * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue. + * + * Listen to it from a Scene using: `this.load.on('addfile', listener)`. + * + * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them. + * + * @event Phaser.Loader.Events#ADD + * @type {string} + * @since 3.0.0 + * + * @param {string} key - The unique key of the file that was added to the Loader. + * @param {string} type - The [file type]{@link Phaser.Loader.File#type} string of the file that was added to the Loader, i.e. `image`. + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @param {Phaser.Loader.File} file - A reference to the File which was added to the Loader. + */ +module.exports = 'addfile'; + + +/***/ }), + +/***/ 7297: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Complete Event. + * + * This event is dispatched when the Loader has fully processed everything in the load queue. + * By this point every loaded file will now be in its associated cache and ready for use. + * + * Listen to it from a Scene using: `this.load.on('complete', listener)`. + * + * @event Phaser.Loader.Events#COMPLETE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @param {number} totalComplete - The total number of files that successfully loaded. + * @param {number} totalFailed - The total number of files that failed to load. + */ +module.exports = 'complete'; + + +/***/ }), + +/***/ 8660: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Complete Event. + * + * This event is dispatched by the Loader Plugin when _any_ file in the queue finishes loading. + * + * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`. + * + * Make sure you remove this listener when you have finished, or it will continue to fire if the Scene reloads. + * + * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. + * + * @event Phaser.Loader.Events#FILE_COMPLETE + * @type {string} + * @since 3.0.0 + * + * @param {string} key - The key of the file that just loaded and finished processing. + * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. + * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. + */ +module.exports = 'filecomplete'; + + +/***/ }), + +/***/ 6484: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Complete Event. + * + * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. + * + * It uses a special dynamic event name constructed from the key and type of the file. + * + * For example, if you have loaded an `image` with a key of `monster`, you can listen for it + * using the following: + * + * ```javascript + * this.load.on('filecomplete-image-monster', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Or, if you have loaded a texture `atlas` with a key of `Level1`: + * + * ```javascript + * this.load.on('filecomplete-atlasjson-Level1', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`: + * + * ```javascript + * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Make sure you remove your listeners when you have finished, or they will continue to fire if the Scene reloads. + * + * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event. + * + * @event Phaser.Loader.Events#FILE_KEY_COMPLETE + * @type {string} + * @since 3.0.0 + * + * @param {string} key - The key of the file that just loaded and finished processing. + * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. + * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. + */ +module.exports = 'filecomplete-'; + + +/***/ }), + +/***/ 7972: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Error Event. + * + * This event is dispatched by the Loader Plugin when a file fails to load. + * + * Listen to it from a Scene using: `this.load.on('loaderror', listener)`. + * + * @event Phaser.Loader.Events#FILE_LOAD_ERROR + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + */ +module.exports = 'loaderror'; + + +/***/ }), + +/***/ 1906: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Event. + * + * This event is dispatched by the Loader Plugin when a file finishes loading, + * but _before_ it is processed and added to the internal Phaser caches. + * + * Listen to it from a Scene using: `this.load.on('load', listener)`. + * + * @event Phaser.Loader.Events#FILE_LOAD + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which just finished loading. + */ +module.exports = 'load'; + + +/***/ }), + +/***/ 1441: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Progress Event. + * + * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and + * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen. + * + * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`. + * + * @event Phaser.Loader.Events#FILE_PROGRESS + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + * @param {number} percentComplete - A value between 0 and 1 indicating how 'complete' this file is. + */ +module.exports = 'fileprogress'; + + +/***/ }), + +/***/ 1072: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Post Process Event. + * + * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue. + * It is dispatched before the internal lists are cleared and each File is destroyed. + * + * Use this hook to perform any last minute processing of files that can only happen once the + * Loader has completed, but prior to it emitting the `complete` event. + * + * Listen to it from a Scene using: `this.load.on('postprocess', listener)`. + * + * @event Phaser.Loader.Events#POST_PROCESS + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'postprocess'; + + +/***/ }), + +/***/ 1927: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Progress Event. + * + * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading. + * + * Listen to it from a Scene using: `this.load.on('progress', listener)`. + * + * @event Phaser.Loader.Events#PROGRESS + * @type {string} + * @since 3.0.0 + * + * @param {number} progress - The current progress of the load. A value between 0 and 1. + */ +module.exports = 'progress'; + + +/***/ }), + +/***/ 6597: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Start Event. + * + * This event is dispatched when the Loader starts running. At this point load progress is zero. + * + * This event is dispatched even if there aren't any files in the load queue. + * + * Listen to it from a Scene using: `this.load.on('start', listener)`. + * + * @event Phaser.Loader.Events#START + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'start'; + + +/***/ }), + +/***/ 1179: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Loader.Events + */ + +module.exports = { + + ADD: __webpack_require__(462), + COMPLETE: __webpack_require__(7297), + FILE_COMPLETE: __webpack_require__(8660), + FILE_KEY_COMPLETE: __webpack_require__(6484), + FILE_LOAD_ERROR: __webpack_require__(7972), + FILE_LOAD: __webpack_require__(1906), + FILE_PROGRESS: __webpack_require__(1441), + POST_PROCESS: __webpack_require__(1072), + PROGRESS: __webpack_require__(1927), + START: __webpack_require__(6597) + +}; + + +/***/ }), + +/***/ 6732: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var CONST = __webpack_require__(4359); +var File = __webpack_require__(1593); +var FileTypesManager = __webpack_require__(9845); +var GetFastValue = __webpack_require__(4597); +var IsPlainObject = __webpack_require__(2482); +var GetURL = __webpack_require__(5593); + +/** + * @classdesc + * A single Image File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image. + * + * @class ImageFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets. + */ +var ImageFile = new Class({ + + Extends: File, + + initialize: + + function ImageFile (loader, key, url, xhrSettings, frameConfig) + { + var extension = 'png'; + var normalMapURL; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + normalMapURL = GetFastValue(config, 'normalMap'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + frameConfig = GetFastValue(config, 'frameConfig'); + } + + if (Array.isArray(url)) + { + normalMapURL = url[1]; + url = url[0]; + } + + var fileConfig = { + type: 'image', + cache: loader.textureManager, + extension: extension, + responseType: 'blob', + key: key, + url: url, + xhrSettings: xhrSettings, + config: frameConfig + }; + + File.call(this, loader, fileConfig); + + // Do we have a normal map to load as well? + if (normalMapURL) + { + var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig); + + normalMap.type = 'normalMap'; + + this.setLink(normalMap); + + loader.addFile(normalMap); + } + + this.useImageElementLoad = loader.imageLoadType === 'HTMLImageElement'; + + if (this.useImageElementLoad) + { + this.load = this.loadImage; + this.onProcess = this.onProcessImage; + } + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.ImageFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = new Image(); + + this.data.crossOrigin = this.crossOrigin; + + var _this = this; + + this.data.onload = function () + { + File.revokeObjectURL(_this.data); + + _this.onProcessComplete(); + }; + + this.data.onerror = function () + { + File.revokeObjectURL(_this.data); + + _this.onProcessError(); + }; + + File.createObjectURL(this.data, this.xhrLoader.response, 'image/png'); + }, + + /** + * Handles image load processing. + * + * @method Phaser.Loader.FileTypes.ImageFile#onProcessImage + * @private + * @since 3.60.0 + */ + onProcessImage: function () + { + var result = this.state; + + this.state = CONST.FILE_PROCESSING; + + if (result === CONST.FILE_LOADED) + { + this.onProcessComplete(); + } + else + { + this.onProcessError(); + } + }, + + /** + * Loads the image using either XHR or an Image tag. + * + * @method Phaser.Loader.FileTypes.ImageFile#loadImage + * @private + * @since 3.60.0 + */ + loadImage: function () + { + this.state = CONST.FILE_LOADING; + + this.src = GetURL(this, this.loader.baseURL); + + if (this.src.indexOf('data:') === 0) + { + console.warn('Local data URIs are not supported: ' + this.key); + } + else + { + this.data = new Image(); + + this.data.crossOrigin = this.crossOrigin; + + var _this = this; + + this.data.onload = function () + { + _this.state = CONST.FILE_LOADED; + + _this.loader.nextFile(_this, true); + }; + + this.data.onerror = function () + { + _this.loader.nextFile(_this, false); + }; + + this.data.src = this.src; + } + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.ImageFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + // Check if we have a linked normal map + var linkFile = this.linkFile; + + if (linkFile) + { + // We do, but has it loaded? + if (linkFile.state >= CONST.FILE_COMPLETE) + { + // Both files have loaded + if (this.type === 'normalMap') + { + // linkFile.data = Image + // this.data = Normal Map + this.cache.addImage(this.key, linkFile.data, this.data); + } + else + { + // linkFile.data = Normal Map + // this.data = Image + this.cache.addImage(this.key, this.data, linkFile.data); + } + } + + // Nothing to do here, we'll use the linkFile `addToCache` call + // to process this pair + } + else + { + this.cache.addImage(this.key, this.data); + } } }); /** - * Static method called directly by the Game Object factory functions. - * With this method you can register a custom GameObject factory in the GameObjectFactory, - * providing a name (`factoryType`) and the constructor (`factoryFunction`) in order - * to be called when you call to Phaser.Scene.add[ factoryType ] method. + * Adds an Image, or array of Images, to the current load queue. * - * @method Phaser.GameObjects.GameObjectFactory.register - * @static + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.image('logo', 'images/phaserLogo.png'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback + * of animated gifs to Canvas elements. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.image('logo', 'images/AtariLogo.png'); + * // and later in your game ... + * this.add.image(x, y, 'logo'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png', + * normalMap: 'images/AtariLogo-n.png' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * In Phaser 3.60 a new property was added that allows you to control how images are loaded. By default, images are loaded via XHR as Blobs. + * However, you can set `loader.imageLoadType: "HTMLImageElement"` in the Game Configuration and instead, the Loader will load all images + * via the Image tag instead. + * + * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#image + * @fires Phaser.Loader.LoaderPlugin#ADD * @since 3.0.0 * - * @param {string} factoryType - The key of the factory that you will use to call to Phaser.Scene.add[ factoryType ] method. - * @param {function} factoryFunction - The constructor function to be called when you invoke to the Phaser.Scene.add method. - */ -GameObjectFactory.register = function (factoryType, factoryFunction) -{ - if (!GameObjectFactory.prototype.hasOwnProperty(factoryType)) - { - GameObjectFactory.prototype[factoryType] = factoryFunction; - } -}; - -/** - * Static method called directly by the Game Object factory functions. - * With this method you can remove a custom GameObject factory registered in the GameObjectFactory, - * providing a its `factoryType`. + * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig|Phaser.Types.Loader.FileTypes.ImageFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * - * @method Phaser.GameObjects.GameObjectFactory.remove - * @static - * @since 3.0.0 - * - * @param {string} factoryType - The key of the factory that you want to remove from the GameObjectFactory. + * @return {this} The Loader instance. */ -GameObjectFactory.remove = function (factoryType) +FileTypesManager.register('image', function (key, url, xhrSettings) { - if (GameObjectFactory.prototype.hasOwnProperty(factoryType)) + if (Array.isArray(key)) { - delete GameObjectFactory.prototype[factoryType]; + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new ImageFile(this, key[i])); + } + } + else + { + this.addFile(new ImageFile(this, key, url, xhrSettings)); } -}; -PluginCache.register('GameObjectFactory', GameObjectFactory, 'add'); + return this; +}); -module.exports = GameObjectFactory; +module.exports = ImageFile; /***/ }), -/* 329 */ -/***/ (function(module, exports) { + +/***/ 704: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var CONST = __webpack_require__(4359); +var File = __webpack_require__(1593); +var FileTypesManager = __webpack_require__(9845); +var GetFastValue = __webpack_require__(4597); +var GetValue = __webpack_require__(5851); +var IsPlainObject = __webpack_require__(2482); + +/** + * @classdesc + * A single JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. + * + * @class JSONFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + */ +var JSONFile = new Class({ + + Extends: File, + + initialize: + + // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object + // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing + + function JSONFile (loader, key, url, xhrSettings, dataKey) + { + var extension = 'json'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + dataKey = GetFastValue(config, 'dataKey', dataKey); + } + + var fileConfig = { + type: 'json', + cache: loader.cacheManager.json, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings, + config: dataKey + }; + + File.call(this, loader, fileConfig); + + // A JSON object has been provided (instead of a URL), so we'll use it directly as the File.data. No need to load it. + if (IsPlainObject(url)) + { + if (dataKey) + { + this.data = GetValue(url, dataKey); + } + else + { + this.data = url; + } + + this.state = CONST.FILE_POPULATED; + } + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.JSONFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + if (this.state !== CONST.FILE_POPULATED) + { + this.state = CONST.FILE_PROCESSING; + + try + { + var json = JSON.parse(this.xhrLoader.responseText); + } + catch (e) + { + this.onProcessError(); + + throw e; + } + + var key = this.config; + + if (typeof key === 'string') + { + this.data = GetValue(json, key, json); + } + else + { + this.data = json; + } + } + + this.onProcessComplete(); + } + +}); + +/** + * Adds a JSON file, or array of JSON files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.json({ + * key: 'wavedata', + * url: 'files/AlienWaveData.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * // and later in your game ... + * var data = this.cache.json.get('wavedata'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#json + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {this} The Loader instance. + */ +FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new JSONFile(this, key[i])); + } + } + else + { + this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); + } + + return this; +}); + +module.exports = JSONFile; + + +/***/ }), + +/***/ 1192: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var CONST = __webpack_require__(4359); +var File = __webpack_require__(1593); +var FileTypesManager = __webpack_require__(9845); +var GetFastValue = __webpack_require__(4597); +var IsPlainObject = __webpack_require__(2482); + +/** + * @classdesc + * A single Text File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text. + * + * @class TextFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var TextFile = new Class({ + + Extends: File, + + initialize: + + function TextFile (loader, key, url, xhrSettings) + { + var type = 'text'; + var extension = 'txt'; + var cache = loader.cacheManager.text; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + type = GetFastValue(config, 'type', type); + cache = GetFastValue(config, 'cache', cache); + } + + var fileConfig = { + type: type, + cache: cache, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.TextFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = this.xhrLoader.responseText; + + this.onProcessComplete(); + } + +}); + +/** + * Adds a Text file, or array of Text files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.text('story', 'files/IntroStory.txt'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Text Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.text({ + * key: 'story', + * url: 'files/IntroStory.txt' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.text('story', 'files/IntroStory.txt'); + * // and later in your game ... + * var data = this.cache.text.get('story'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Text Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.txt". It will always add `.txt` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#text + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig|Phaser.Types.Loader.FileTypes.TextFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {this} The Loader instance. + */ +FileTypesManager.register('text', function (key, url, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new TextFile(this, key[i])); + } + } + else + { + this.addFile(new TextFile(this, key, url, xhrSettings)); + } + + return this; +}); + +module.exports = TextFile; + + +/***/ }), + +/***/ 3136: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the mean average of the given values. + * + * @function Phaser.Math.Average + * @since 3.0.0 + * + * @param {number[]} values - The values to average. + * + * @return {number} The average value. + */ +var Average = function (values) +{ + var sum = 0; + + for (var i = 0; i < values.length; i++) + { + sum += (+values[i]); + } + + return sum / values.length; +}; + +module.exports = Average; + + +/***/ }), + +/***/ 785: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Factorial = __webpack_require__(3916); + +/** + * Calculates the Bernstein basis from the three factorial coefficients. + * + * @function Phaser.Math.Bernstein + * @since 3.0.0 + * + * @param {number} n - The first value. + * @param {number} i - The second value. + * + * @return {number} The Bernstein basis of Factorial(n) / Factorial(i) / Factorial(n - i) + */ +var Bernstein = function (n, i) +{ + return Factorial(n) / Factorial(i) / Factorial(n - i); +}; + +module.exports = Bernstein; + + +/***/ }), + +/***/ 7025: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random integer between the `min` and `max` values, inclusive. + * + * @function Phaser.Math.Between + * @since 3.0.0 + * + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. + * + * @return {number} The random integer. + */ +var Between = function (min, max) +{ + return Math.floor(Math.random() * (max - min + 1) + min); +}; + +module.exports = Between; + + +/***/ }), + +/***/ 48: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a Catmull-Rom value from the given points, based on an alpha of 0.5. + * + * @function Phaser.Math.CatmullRom + * @since 3.0.0 + * + * @param {number} t - The amount to interpolate by. + * @param {number} p0 - The first control point. + * @param {number} p1 - The second control point. + * @param {number} p2 - The third control point. + * @param {number} p3 - The fourth control point. + * + * @return {number} The Catmull-Rom value. + */ +var CatmullRom = function (t, p0, p1, p2, p3) +{ + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + var t2 = t * t; + var t3 = t * t2; + + return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1; +}; + +module.exports = CatmullRom; + + +/***/ }), + +/***/ 5035: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Ceils to some place comparative to a `base`, default is 10 for decimal place. + * + * The `place` is represented by the power applied to `base` to get that place. + * + * @function Phaser.Math.CeilTo + * @since 3.0.0 + * + * @param {number} value - The value to round. + * @param {number} [place=0] - The place to round to. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. + * + * @return {number} The rounded value. + */ +var CeilTo = function (value, place, base) +{ + if (place === undefined) { place = 0; } + if (base === undefined) { base = 10; } + + var p = Math.pow(base, -place); + + return Math.ceil(value * p) / p; +}; + +module.exports = CeilTo; + + +/***/ }), + +/***/ 2915: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Force a value within the boundaries by clamping it to the range `min`, `max`. + * + * @function Phaser.Math.Clamp + * @since 3.0.0 + * + * @param {number} value - The value to be clamped. + * @param {number} min - The minimum bounds. + * @param {number} max - The maximum bounds. + * + * @return {number} The clamped value. + */ +var Clamp = function (value, min, max) +{ + return Math.max(min, Math.min(max, value)); +}; + +module.exports = Clamp; + + +/***/ }), + +/***/ 7149: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(7425); + +/** + * Convert the given angle from degrees, to the equivalent angle in radians. + * + * @function Phaser.Math.DegToRad + * @since 3.0.0 + * + * @param {number} degrees - The angle (in degrees) to convert to radians. + * + * @return {number} The given angle converted to radians. + */ +var DegToRad = function (degrees) +{ + return degrees * CONST.DEG_TO_RAD; +}; + +module.exports = DegToRad; + + +/***/ }), + +/***/ 2975: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the positive difference of two given numbers. + * + * @function Phaser.Math.Difference + * @since 3.0.0 + * + * @param {number} a - The first number in the calculation. + * @param {number} b - The second number in the calculation. + * + * @return {number} The positive difference of the two given numbers. + */ +var Difference = function (a, b) +{ + return Math.abs(a - b); +}; + +module.exports = Difference; + + +/***/ }), + +/***/ 2107: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(2915); +var Class = __webpack_require__(7473); +var Matrix4 = __webpack_require__(9652); +var NOOP = __webpack_require__(1984); + +var tempMatrix = new Matrix4(); + +/** + * @classdesc + * + * @class Euler + * @memberof Phaser.Math + * @constructor + * @since 3.50.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Euler = new Class({ + + initialize: + + function Euler (x, y, z, order) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (z === undefined) { z = 0; } + if (order === undefined) { order = Euler.DefaultOrder; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback = NOOP; + }, + + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + order: { + get: function () + { + return this._order; + }, + + set: function (value) + { + this._order = value; + + this.onChangeCallback(this); + } + }, + + set: function (x, y, z, order) + { + if (order === undefined) { order = this._order; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback(this); + + return this; + }, + + copy: function (euler) + { + return this.set(euler.x, euler.y, euler.z, euler.order); + }, + + setFromQuaternion: function (quaternion, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + tempMatrix.fromQuat(quaternion); + + return this.setFromRotationMatrix(tempMatrix, order, update); + }, + + setFromRotationMatrix: function (matrix, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + var elements = matrix.val; + + // Upper 3x3 of matrix is un-scaled rotation matrix + var m11 = elements[0]; + var m12 = elements[4]; + var m13 = elements[8]; + var m21 = elements[1]; + var m22 = elements[5]; + var m23 = elements[9]; + var m31 = elements[2]; + var m32 = elements[6]; + var m33 = elements[10]; + + var x = 0; + var y = 0; + var z = 0; + var epsilon = 0.99999; + + switch (order) + { + case 'XYZ': + { + y = Math.asin(Clamp(m13, -1, 1)); + + if (Math.abs(m13) < epsilon) + { + x = Math.atan2(-m23, m33); + z = Math.atan2(-m12, m11); + } + else + { + x = Math.atan2(m32, m22); + } + + break; + } + + case 'YXZ': + { + x = Math.asin(-Clamp(m23, -1, 1)); + + if (Math.abs(m23) < epsilon) + { + y = Math.atan2(m13, m33); + z = Math.atan2(m21, m22); + } + else + { + y = Math.atan2(-m31, m11); + } + + break; + } + + case 'ZXY': + { + x = Math.asin(Clamp(m32, -1, 1)); + + if (Math.abs(m32) < epsilon) + { + y = Math.atan2(-m31, m33); + z = Math.atan2(-m12, m22); + } + else + { + z = Math.atan2(m21, m11); + } + + break; + } + + case 'ZYX': + { + y = Math.asin(-Clamp(m31, -1, 1)); + + if (Math.abs(m31) < epsilon) + { + x = Math.atan2(m32, m33); + z = Math.atan2(m21, m11); + } + else + { + z = Math.atan2(-m12, m22); + } + + break; + } + + case 'YZX': + { + z = Math.asin(Clamp(m21, -1, 1)); + + if (Math.abs(m21) < epsilon) + { + x = Math.atan2(-m23, m22); + y = Math.atan2(-m31, m11); + } + else + { + y = Math.atan2(m13, m33); + } + + break; + } + + case 'XZY': + { + z = Math.asin(-Clamp(m12, -1, 1)); + + if (Math.abs(m12) < epsilon) + { + x = Math.atan2(m32, m22); + y = Math.atan2(m13, m11); + } + else + { + x = Math.atan2(-m23, m33); + } + + break; + } + } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + if (update) + { + this.onChangeCallback(this); + } + + return this; + } + +}); + +Euler.RotationOrders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ]; + +Euler.DefaultOrder = 'XYZ'; + +module.exports = Euler; + + +/***/ }), + +/***/ 3916: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the factorial of a given number for integer values greater than 0. + * + * @function Phaser.Math.Factorial + * @since 3.0.0 + * + * @param {number} value - A positive integer to calculate the factorial of. + * + * @return {number} The factorial of the given number. + */ +var Factorial = function (value) +{ + if (value === 0) + { + return 1; + } + + var res = value; + + while (--value) + { + res *= value; + } + + return res; +}; + +module.exports = Factorial; + + +/***/ }), + +/***/ 104: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Generate a random floating point number between the two given bounds, minimum inclusive, maximum exclusive. + * + * @function Phaser.Math.FloatBetween + * @since 3.0.0 + * + * @param {number} min - The lower bound for the float, inclusive. + * @param {number} max - The upper bound for the float exclusive. + * + * @return {number} A random float within the given range. + */ +var FloatBetween = function (min, max) +{ + return Math.random() * (max - min) + min; +}; + +module.exports = FloatBetween; + + +/***/ }), + +/***/ 4941: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Floors to some place comparative to a `base`, default is 10 for decimal place. + * + * The `place` is represented by the power applied to `base` to get that place. + * + * @function Phaser.Math.FloorTo + * @since 3.0.0 + * + * @param {number} value - The value to round. + * @param {number} [place=0] - The place to round to. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. + * + * @return {number} The rounded value. + */ +var FloorTo = function (value, place, base) +{ + if (place === undefined) { place = 0; } + if (base === undefined) { base = 10; } + + var p = Math.pow(base, -place); + + return Math.floor(value * p) / p; +}; + +module.exports = FloorTo; + + +/***/ }), + +/***/ 1555: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(2915); + +/** + * Return a value based on the range between `min` and `max` and the percentage given. + * + * @function Phaser.Math.FromPercent + * @since 3.0.0 + * + * @param {number} percent - A value between 0 and 1 representing the percentage. + * @param {number} min - The minimum value. + * @param {number} [max] - The maximum value. + * + * @return {number} The value that is `percent` percent between `min` and `max`. + */ +var FromPercent = function (percent, min, max) +{ + percent = Clamp(percent, 0, 1); + + return (max - min) * percent + min; +}; + +module.exports = FromPercent; + + +/***/ }), + +/***/ 5005: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate a per-ms speed from a distance and time (given in seconds). + * + * @function Phaser.Math.GetSpeed + * @since 3.0.0 + * + * @param {number} distance - The distance. + * @param {number} time - The time, in seconds. + * + * @return {number} The speed, in distance per ms. + * + * @example + * // 400px over 1 second is 0.4 px/ms + * Phaser.Math.GetSpeed(400, 1) // -> 0.4 + */ +var GetSpeed = function (distance, time) +{ + return (distance / time) / 1000; +}; + +module.exports = GetSpeed; + + +/***/ }), + +/***/ 3702: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check if a given value is an even number. + * + * @function Phaser.Math.IsEven + * @since 3.0.0 + * + * @param {number} value - The number to perform the check with. + * + * @return {boolean} Whether the number is even or not. + */ +var IsEven = function (value) +{ + // Use abstract equality == for "is number" test + + // eslint-disable-next-line eqeqeq + return (value == parseFloat(value)) ? !(value % 2) : void 0; +}; + +module.exports = IsEven; + + +/***/ }), + +/***/ 8820: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check if a given value is an even number using a strict type check. + * + * @function Phaser.Math.IsEvenStrict + * @since 3.0.0 + * + * @param {number} value - The number to perform the check with. + * + * @return {boolean} Whether the number is even or not. + */ +var IsEvenStrict = function (value) +{ + // Use strict equality === for "is number" test + return (value === parseFloat(value)) ? !(value % 2) : void 0; +}; + +module.exports = IsEvenStrict; + + +/***/ }), + +/***/ 1743: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a linear (interpolation) value over t. + * + * @function Phaser.Math.Linear + * @since 3.0.0 + * + * @param {number} p0 - The first point. + * @param {number} p1 - The second point. + * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1. + * + * @return {number} The step t% of the way between p0 and p1. + */ +var Linear = function (p0, p1, t) +{ + return (p1 - p0) * t + p0; +}; + +module.exports = Linear; + + +/***/ }), + +/***/ 3416: +/***/ ((module) => { + +/** + * @author Greg McLean + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Interpolates two given Vectors and returns a new Vector between them. + * + * Does not modify either of the passed Vectors. + * + * @function Phaser.Math.LinearXY + * @since 3.60.0 + * + * @param {Phaser.Math.Vector2} vector1 - Starting vector + * @param {Phaser.Math.Vector2} vector2 - Ending vector + * @param {number} [t=0] - The percentage between vector1 and vector2 to return, represented as a number between 0 and 1. + * + * @return {Phaser.Math.Vector2} The step t% of the way between vector1 and vector2. + */ +var LinearXY = function (vector1, vector2, t) +{ + if (t === undefined) { t = 0; } + + return vector1.clone().lerp(vector2, t); +}; + +module.exports = LinearXY; + + +/***/ }), + +/***/ 2149: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A three-dimensional matrix. + * + * Defaults to the identity matrix when instantiated. + * + * @class Matrix3 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from. + */ +var Matrix3 = new Class({ + + initialize: + + function Matrix3 (m) + { + /** + * The matrix values. + * + * @name Phaser.Math.Matrix3#val + * @type {Float32Array} + * @since 3.0.0 + */ + this.val = new Float32Array(9); + + if (m) + { + // Assume Matrix3 with val: + this.copy(m); + } + else + { + // Default to identity + this.identity(); + } + }, + + /** + * Make a clone of this Matrix3. + * + * @method Phaser.Math.Matrix3#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} A clone of this Matrix3. + */ + clone: function () + { + return new Matrix3(this); + }, + + /** + * This method is an alias for `Matrix3.copy`. + * + * @method Phaser.Math.Matrix3#set + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * Copy the values of a given Matrix into this Matrix. + * + * @method Phaser.Math.Matrix3#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + copy: function (src) + { + var out = this.val; + var a = src.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + + return this; + }, + + /** + * Copy the values of a given Matrix4 into this Matrix3. + * + * @method Phaser.Math.Matrix3#fromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromMat4: function (m) + { + var a = m.val; + var out = this.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + + return this; + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix3#fromArray + * @since 3.0.0 + * + * @param {array} a - The array to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromArray: function (a) + { + var out = this.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix3#identity + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + identity: function () + { + var out = this.val; + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + + return this; + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix3#transpose + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + transpose: function () + { + var a = this.val; + var a01 = a[1]; + var a02 = a[2]; + var a12 = a[5]; + + a[1] = a[3]; + a[2] = a[6]; + a[3] = a01; + a[5] = a[7]; + a[6] = a02; + a[7] = a12; + + return this; + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix3#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + var b01 = a22 * a11 - a12 * a21; + var b11 = -a22 * a10 + a12 * a20; + var b21 = a21 * a10 - a11 * a20; + + // Calculate the determinant + var det = a00 * b01 + a01 * b11 + a02 * b21; + + if (!det) + { + return null; + } + + det = 1 / det; + + a[0] = b01 * det; + a[1] = (-a22 * a01 + a02 * a21) * det; + a[2] = (a12 * a01 - a02 * a11) * det; + a[3] = b11 * det; + a[4] = (a22 * a00 - a02 * a20) * det; + a[5] = (-a12 * a00 + a02 * a10) * det; + a[6] = b21 * det; + a[7] = (-a21 * a00 + a01 * a20) * det; + a[8] = (a11 * a00 - a01 * a10) * det; + + return this; + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix3#adjoint + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + a[0] = (a11 * a22 - a12 * a21); + a[1] = (a02 * a21 - a01 * a22); + a[2] = (a01 * a12 - a02 * a11); + a[3] = (a12 * a20 - a10 * a22); + a[4] = (a00 * a22 - a02 * a20); + a[5] = (a02 * a10 - a00 * a12); + a[6] = (a10 * a21 - a11 * a20); + a[7] = (a01 * a20 - a00 * a21); + a[8] = (a00 * a11 - a01 * a10); + + return this; + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix3#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix3#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + var b = src.val; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b10 = b[3]; + var b11 = b[4]; + var b12 = b[5]; + var b20 = b[6]; + var b21 = b[7]; + var b22 = b[8]; + + a[0] = b00 * a00 + b01 * a10 + b02 * a20; + a[1] = b00 * a01 + b01 * a11 + b02 * a21; + a[2] = b00 * a02 + b01 * a12 + b02 * a22; + + a[3] = b10 * a00 + b11 * a10 + b12 * a20; + a[4] = b10 * a01 + b11 * a11 + b12 * a21; + a[5] = b10 * a02 + b11 * a12 + b12 * a22; + + a[6] = b20 * a00 + b21 * a10 + b22 * a20; + a[7] = b20 * a01 + b21 * a11 + b22 * a21; + a[8] = b20 * a02 + b21 * a12 + b22 * a22; + + return this; + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix3#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + translate: function (v) + { + var a = this.val; + var x = v.x; + var y = v.y; + + a[6] = x * a[0] + y * a[3] + a[6]; + a[7] = x * a[1] + y * a[4] + a[7]; + a[8] = x * a[2] + y * a[5] + a[8]; + + return this; + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix3#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + rotate: function (rad) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + + var s = Math.sin(rad); + var c = Math.cos(rad); + + a[0] = c * a00 + s * a10; + a[1] = c * a01 + s * a11; + a[2] = c * a02 + s * a12; + + a[3] = c * a10 - s * a00; + a[4] = c * a11 - s * a01; + a[5] = c * a12 - s * a02; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x` and `y` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix3#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + scale: function (v) + { + var a = this.val; + var x = v.x; + var y = v.y; + + a[0] = x * a[0]; + a[1] = x * a[1]; + a[2] = x * a[2]; + + a[3] = y * a[3]; + a[4] = y * a[4]; + a[5] = y * a[5]; + + return this; + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix3#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromQuat: function (q) + { + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + var out = this.val; + + out[0] = 1 - (yy + zz); + out[3] = xy + wz; + out[6] = xz - wy; + + out[1] = xy - wz; + out[4] = 1 - (xx + zz); + out[7] = yz + wx; + + out[2] = xz + wy; + out[5] = yz - wx; + out[8] = 1 - (xx + yy); + + return this; + }, + + /** + * Set the values of this Matrix3 to be normalized from the given Matrix4. + * + * @method Phaser.Math.Matrix3#normalFromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to normalize the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + normalFromMat4: function (m) + { + var a = m.val; + var out = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) + { + return null; + } + + det = 1 / det; + + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + + return this; + } + +}); + +module.exports = Matrix3; + + +/***/ }), + +/***/ 9652: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Vector3 = __webpack_require__(5689); + +/** + * @ignore + */ +var EPSILON = 0.000001; + +/** + * @classdesc + * A four-dimensional matrix. + * + * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji + * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + * + * @class Matrix4 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. + */ +var Matrix4 = new Class({ + + initialize: + + function Matrix4 (m) + { + /** + * The matrix values. + * + * @name Phaser.Math.Matrix4#val + * @type {Float32Array} + * @since 3.0.0 + */ + this.val = new Float32Array(16); + + if (m) + { + // Assume Matrix4 with val: + this.copy(m); + } + else + { + // Default to identity + this.identity(); + } + }, + + /** + * Make a clone of this Matrix4. + * + * @method Phaser.Math.Matrix4#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} A clone of this Matrix4. + */ + clone: function () + { + return new Matrix4(this); + }, + + /** + * This method is an alias for `Matrix4.copy`. + * + * @method Phaser.Math.Matrix4#set + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. + * + * @return {this} This Matrix4. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * Sets all values of this Matrix4. + * + * @method Phaser.Math.Matrix4#setValues + * @since 3.50.0 + * + * @param {number} m00 - The m00 value. + * @param {number} m01 - The m01 value. + * @param {number} m02 - The m02 value. + * @param {number} m03 - The m03 value. + * @param {number} m10 - The m10 value. + * @param {number} m11 - The m11 value. + * @param {number} m12 - The m12 value. + * @param {number} m13 - The m13 value. + * @param {number} m20 - The m20 value. + * @param {number} m21 - The m21 value. + * @param {number} m22 - The m22 value. + * @param {number} m23 - The m23 value. + * @param {number} m30 - The m30 value. + * @param {number} m31 - The m31 value. + * @param {number} m32 - The m32 value. + * @param {number} m33 - The m33 value. + * + * @return {this} This Matrix4 instance. + */ + setValues: function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) + { + var out = this.val; + + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + + return this; + }, + + /** + * Copy the values of a given Matrix into this Matrix. + * + * @method Phaser.Math.Matrix4#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. + * + * @return {this} This Matrix4. + */ + copy: function (src) + { + var a = src.val; + + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix4#fromArray + * @since 3.0.0 + * + * @param {number[]} a - The array to copy the values from. Must have at least 16 elements. + * + * @return {this} This Matrix4. + */ + fromArray: function (a) + { + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Reset this Matrix. + * + * Sets all values to `0`. + * + * @method Phaser.Math.Matrix4#zero + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + zero: function () + { + return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + }, + + /** + * Generates a transform matrix based on the given position, scale and rotation. + * + * @method Phaser.Math.Matrix4#transform + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {Phaser.Math.Vector3} scale - The scale vector. + * @param {Phaser.Math.Quaternion} rotation - The rotation quaternion. + * + * @return {this} This Matrix4. + */ + transform: function (position, scale, rotation) + { + var rotMatrix = _tempMat1.fromQuat(rotation); + + var rm = rotMatrix.val; + + var sx = scale.x; + var sy = scale.y; + var sz = scale.z; + + return this.setValues( + rm[0] * sx, + rm[1] * sx, + rm[2] * sx, + 0, + + rm[4] * sy, + rm[5] * sy, + rm[6] * sy, + 0, + + rm[8] * sz, + rm[9] * sz, + rm[10] * sz, + 0, + + position.x, + position.y, + position.z, + 1 + ); + }, + + /** + * Set the `x`, `y` and `z` values of this Matrix. + * + * @method Phaser.Math.Matrix4#xyz + * @since 3.0.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {number} z - The z value. + * + * @return {this} This Matrix4. + */ + xyz: function (x, y, z) + { + this.identity(); + + var out = this.val; + + out[12] = x; + out[13] = y; + out[14] = z; + + return this; + }, + + /** + * Set the scaling values of this Matrix. + * + * @method Phaser.Math.Matrix4#scaling + * @since 3.0.0 + * + * @param {number} x - The x scaling value. + * @param {number} y - The y scaling value. + * @param {number} z - The z scaling value. + * + * @return {this} This Matrix4. + */ + scaling: function (x, y, z) + { + this.zero(); + + var out = this.val; + + out[0] = x; + out[5] = y; + out[10] = z; + out[15] = 1; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix4#identity + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + identity: function () + { + return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix4#transpose + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + transpose: function () + { + var a = this.val; + + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a12 = a[6]; + var a13 = a[7]; + var a23 = a[11]; + + a[1] = a[4]; + a[2] = a[8]; + a[3] = a[12]; + a[4] = a01; + a[6] = a[9]; + a[7] = a[13]; + a[8] = a02; + a[9] = a12; + a[11] = a[14]; + a[12] = a03; + a[13] = a13; + a[14] = a23; + + return this; + }, + + /** + * Copies the given Matrix4 into this Matrix and then inverses it. + * + * @method Phaser.Math.Matrix4#getInverse + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to invert into this Matrix4. + * + * @return {this} This Matrix4. + */ + getInverse: function (m) + { + this.copy(m); + + return this.invert(); + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix4#invert + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) + { + return this; + } + + det = 1 / det; + + return this.setValues( + (a11 * b11 - a12 * b10 + a13 * b09) * det, + (a02 * b10 - a01 * b11 - a03 * b09) * det, + (a31 * b05 - a32 * b04 + a33 * b03) * det, + (a22 * b04 - a21 * b05 - a23 * b03) * det, + (a12 * b08 - a10 * b11 - a13 * b07) * det, + (a00 * b11 - a02 * b08 + a03 * b07) * det, + (a32 * b02 - a30 * b05 - a33 * b01) * det, + (a20 * b05 - a22 * b02 + a23 * b01) * det, + (a10 * b10 - a11 * b08 + a13 * b06) * det, + (a01 * b08 - a00 * b10 - a03 * b06) * det, + (a30 * b04 - a31 * b02 + a33 * b00) * det, + (a21 * b02 - a20 * b04 - a23 * b00) * det, + (a11 * b07 - a10 * b09 - a12 * b06) * det, + (a00 * b09 - a01 * b07 + a02 * b06) * det, + (a31 * b01 - a30 * b03 - a32 * b00) * det, + (a20 * b03 - a21 * b01 + a22 * b00) * det + ); + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix4#adjoint + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + return this.setValues( + (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)), + -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), + (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)), + -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), + -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)), + (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)), + -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)), + (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)), + (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)), + -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)), + (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)), + -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)), + -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)), + (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)), + -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)), + (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)) + ); + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix4#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix4#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. + * + * @return {this} This Matrix4. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b = src.val; + + // Cache only the current line of the second matrix + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + + a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + + a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + + a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + + a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + return this; + }, + + /** + * Multiply the values of this Matrix4 by those given in the `src` argument. + * + * @method Phaser.Math.Matrix4#multiplyLocal + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. + * + * @return {this} This Matrix4. + */ + multiplyLocal: function (src) + { + var a = this.val; + var b = src.val; + + return this.setValues( + a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12], + a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13], + a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14], + a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15], + + a[4] * b[0] + a[5] * b[4] + a[6] * b[8] + a[7] * b[12], + a[4] * b[1] + a[5] * b[5] + a[6] * b[9] + a[7] * b[13], + a[4] * b[2] + a[5] * b[6] + a[6] * b[10] + a[7] * b[14], + a[4] * b[3] + a[5] * b[7] + a[6] * b[11] + a[7] * b[15], + + a[8] * b[0] + a[9] * b[4] + a[10] * b[8] + a[11] * b[12], + a[8] * b[1] + a[9] * b[5] + a[10] * b[9] + a[11] * b[13], + a[8] * b[2] + a[9] * b[6] + a[10] * b[10] + a[11] * b[14], + a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11] * b[15], + + a[12] * b[0] + a[13] * b[4] + a[14] * b[8] + a[15] * b[12], + a[12] * b[1] + a[13] * b[5] + a[14] * b[9] + a[15] * b[13], + a[12] * b[2] + a[13] * b[6] + a[14] * b[10] + a[15] * b[14], + a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15] + ); + }, + + /** + * Multiplies the given Matrix4 object with this Matrix. + * + * This is the same as calling `multiplyMatrices(m, this)`. + * + * @method Phaser.Math.Matrix4#premultiply + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to multiply with this one. + * + * @return {this} This Matrix4. + */ + premultiply: function (m) + { + return this.multiplyMatrices(m, this); + }, + + /** + * Multiplies the two given Matrix4 objects and stores the results in this Matrix. + * + * @method Phaser.Math.Matrix4#multiplyMatrices + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} a - The first Matrix4 to multiply. + * @param {Phaser.Math.Matrix4} b - The second Matrix4 to multiply. + * + * @return {this} This Matrix4. + */ + multiplyMatrices: function (a, b) + { + var am = a.val; + var bm = b.val; + + var a11 = am[0]; + var a12 = am[4]; + var a13 = am[8]; + var a14 = am[12]; + var a21 = am[1]; + var a22 = am[5]; + var a23 = am[9]; + var a24 = am[13]; + var a31 = am[2]; + var a32 = am[6]; + var a33 = am[10]; + var a34 = am[14]; + var a41 = am[3]; + var a42 = am[7]; + var a43 = am[11]; + var a44 = am[15]; + + var b11 = bm[0]; + var b12 = bm[4]; + var b13 = bm[8]; + var b14 = bm[12]; + var b21 = bm[1]; + var b22 = bm[5]; + var b23 = bm[9]; + var b24 = bm[13]; + var b31 = bm[2]; + var b32 = bm[6]; + var b33 = bm[10]; + var b34 = bm[14]; + var b41 = bm[3]; + var b42 = bm[7]; + var b43 = bm[11]; + var b44 = bm[15]; + + return this.setValues( + a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41, + a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41, + a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41, + a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41, + a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42, + a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42, + a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42, + a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42, + a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43, + a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43, + a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43, + a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43, + a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44, + a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44, + a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44, + a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44 + ); + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix4#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {this} This Matrix4. + */ + translate: function (v) + { + return this.translateXYZ(v.x, v.y, v.z); + }, + + /** + * Translate this Matrix using the given values. + * + * @method Phaser.Math.Matrix4#translateXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + translateXYZ: function (x, y, z) + { + var a = this.val; + + a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix4#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {this} This Matrix4. + */ + scale: function (v) + { + return this.scaleXYZ(v.x, v.y, v.z); + }, + + /** + * Apply a scale transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#scaleXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + scaleXYZ: function (x, y, z) + { + var a = this.val; + + a[0] = a[0] * x; + a[1] = a[1] * x; + a[2] = a[2] * x; + a[3] = a[3] * x; + + a[4] = a[4] * y; + a[5] = a[5] * y; + a[6] = a[6] * y; + a[7] = a[7] * y; + + a[8] = a[8] * z; + a[9] = a[9] * z; + a[10] = a[10] * z; + a[11] = a[11] * z; + + return this; + }, + + /** + * Derive a rotation matrix around the given axis. + * + * @method Phaser.Math.Matrix4#makeRotationAxis + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. + * @param {number} angle - The rotation angle in radians. + * + * @return {this} This Matrix4. + */ + makeRotationAxis: function (axis, angle) + { + // Based on http://www.gamedev.net/reference/articles/article1199.asp + + var c = Math.cos(angle); + var s = Math.sin(angle); + var t = 1 - c; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var tx = t * x; + var ty = t * y; + + return this.setValues( + tx * x + c, tx * y - s * z, tx * z + s * y, 0, + tx * y + s * z, ty * y + c, ty * z - s * x, 0, + tx * z - s * y, ty * z + s * x, t * z * z + c, 0, + 0, 0, 0, 1 + ); + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. + * + * @return {this} This Matrix4. + */ + rotate: function (rad, axis) + { + var a = this.val; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var len = Math.sqrt(x * x + y * y + z * z); + + if (Math.abs(len) < EPSILON) + { + return this; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + + var s = Math.sin(rad); + var c = Math.cos(rad); + var t = 1 - c; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + // Construct the elements of the rotation matrix + var b00 = x * x * t + c; + var b01 = y * x * t + z * s; + var b02 = z * x * t - y * s; + + var b10 = x * y * t - z * s; + var b11 = y * y * t + c; + var b12 = z * y * t + x * s; + + var b20 = x * z * t + y * s; + var b21 = y * z * t - x * s; + var b22 = z * z * t + c; + + // Perform rotation-specific matrix multiplication + return this.setValues( + a00 * b00 + a10 * b01 + a20 * b02, + a01 * b00 + a11 * b01 + a21 * b02, + a02 * b00 + a12 * b01 + a22 * b02, + a03 * b00 + a13 * b01 + a23 * b02, + a00 * b10 + a10 * b11 + a20 * b12, + a01 * b10 + a11 * b11 + a21 * b12, + a02 * b10 + a12 * b11 + a22 * b12, + a03 * b10 + a13 * b11 + a23 * b12, + a00 * b20 + a10 * b21 + a20 * b22, + a01 * b20 + a11 * b21 + a21 * b22, + a02 * b20 + a12 * b21 + a22 * b22, + a03 * b20 + a13 * b21 + a23 * b22, + a30, a31, a32, a33 + ); + }, + + /** + * Rotate this matrix on its X axis. + * + * @method Phaser.Math.Matrix4#rotateX + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {this} This Matrix4. + */ + rotateX: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[4] = a10 * c + a20 * s; + a[5] = a11 * c + a21 * s; + a[6] = a12 * c + a22 * s; + a[7] = a13 * c + a23 * s; + a[8] = a20 * c - a10 * s; + a[9] = a21 * c - a11 * s; + a[10] = a22 * c - a12 * s; + a[11] = a23 * c - a13 * s; + + return this; + }, + + /** + * Rotate this matrix on its Y axis. + * + * @method Phaser.Math.Matrix4#rotateY + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateY: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c - a20 * s; + a[1] = a01 * c - a21 * s; + a[2] = a02 * c - a22 * s; + a[3] = a03 * c - a23 * s; + a[8] = a00 * s + a20 * c; + a[9] = a01 * s + a21 * c; + a[10] = a02 * s + a22 * c; + a[11] = a03 * s + a23 * c; + + return this; + }, + + /** + * Rotate this matrix on its Z axis. + * + * @method Phaser.Math.Matrix4#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateZ: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c + a10 * s; + a[1] = a01 * c + a11 * s; + a[2] = a02 * c + a12 * s; + a[3] = a03 * c + a13 * s; + a[4] = a10 * c - a00 * s; + a[5] = a11 * c - a01 * s; + a[6] = a12 * c - a02 * s; + a[7] = a13 * c - a03 * s; + + return this; + }, + + /** + * Set the values of this Matrix from the given rotation Quaternion and translation Vector. + * + * @method Phaser.Math.Matrix4#fromRotationTranslation + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. + * @param {Phaser.Math.Vector3} v - The Vector to set translation from. + * + * @return {this} This Matrix4. + */ + fromRotationTranslation: function (q, v) + { + // Quaternion math + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + v.x, + v.y, + v.z, + 1 + ); + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix4#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {this} This Matrix4. + */ + fromQuat: function (q) + { + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + 0, + 0, + 0, + 1 + ); + }, + + /** + * Generate a frustum matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#frustum + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + frustum: function (left, right, bottom, top, near, far) + { + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + + return this.setValues( + (near * 2) * rl, + 0, + 0, + 0, + + 0, + (near * 2) * tb, + 0, + 0, + + (right + left) * rl, + (top + bottom) * tb, + (far + near) * nf, + -1, + + 0, + 0, + (far * near * 2) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspective + * @since 3.0.0 + * + * @param {number} fovy - Vertical field of view in radians + * @param {number} aspect - Aspect ratio. Typically viewport width /height. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspective: function (fovy, aspect, near, far) + { + var f = 1.0 / Math.tan(fovy / 2); + var nf = 1 / (near - far); + + return this.setValues( + f / aspect, + 0, + 0, + 0, + + 0, + f, + 0, + 0, + + 0, + 0, + (far + near) * nf, + -1, + + 0, + 0, + (2 * far * near) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspectiveLH + * @since 3.0.0 + * + * @param {number} width - The width of the frustum. + * @param {number} height - The height of the frustum. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspectiveLH: function (width, height, near, far) + { + return this.setValues( + (2 * near) / width, + 0, + 0, + 0, + + 0, + (2 * near) / height, + 0, + 0, + + 0, + 0, + -far / (near - far), + 1, + + 0, + 0, + (near * far) / (near - far), + 0 + ); + }, + + /** + * Generate an orthogonal projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#ortho + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + ortho: function (left, right, bottom, top, near, far) + { + var lr = left - right; + var bt = bottom - top; + var nf = near - far; + + // Avoid division by zero + lr = (lr === 0) ? lr : 1 / lr; + bt = (bt === 0) ? bt : 1 / bt; + nf = (nf === 0) ? nf : 1 / nf; + + return this.setValues( + -2 * lr, + 0, + 0, + 0, + + 0, + -2 * bt, + 0, + 0, + + 0, + 0, + 2 * nf, + 0, + + (left + right) * lr, + (top + bottom) * bt, + (far + near) * nf, + 1 + ); + }, + + /** + * Generate a right-handed look-at matrix with the given eye position, target and up axis. + * + * @method Phaser.Math.Matrix4#lookAtRH + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer. + * @param {Phaser.Math.Vector3} target - Point the viewer is looking at. + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAtRH: function (eye, target, up) + { + var m = this.val; + + _z.subVectors(eye, target); + + if (_z.getLengthSquared() === 0) + { + // eye and target are in the same position + _z.z = 1; + } + + _z.normalize(); + _x.crossVectors(up, _z); + + if (_x.getLengthSquared() === 0) + { + // up and z are parallel + + if (Math.abs(up.z) === 1) + { + _z.x += 0.0001; + } + else + { + _z.z += 0.0001; + } + + _z.normalize(); + _x.crossVectors(up, _z); + } + + _x.normalize(); + _y.crossVectors(_z, _x); + + m[0] = _x.x; + m[1] = _x.y; + m[2] = _x.z; + m[4] = _y.x; + m[5] = _y.y; + m[6] = _y.z; + m[8] = _z.x; + m[9] = _z.y; + m[10] = _z.z; + + return this; + }, + + /** + * Generate a look-at matrix with the given eye position, focal point, and up axis. + * + * @method Phaser.Math.Matrix4#lookAt + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer + * @param {Phaser.Math.Vector3} center - Point the viewer is looking at + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAt: function (eye, center, up) + { + var eyex = eye.x; + var eyey = eye.y; + var eyez = eye.z; + + var upx = up.x; + var upy = up.y; + var upz = up.z; + + var centerx = center.x; + var centery = center.y; + var centerz = center.z; + + if (Math.abs(eyex - centerx) < EPSILON && + Math.abs(eyey - centery) < EPSILON && + Math.abs(eyez - centerz) < EPSILON) + { + return this.identity(); + } + + var z0 = eyex - centerx; + var z1 = eyey - centery; + var z2 = eyez - centerz; + + var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + + z0 *= len; + z1 *= len; + z2 *= len; + + var x0 = upy * z2 - upz * z1; + var x1 = upz * z0 - upx * z2; + var x2 = upx * z1 - upy * z0; + + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + + if (!len) + { + x0 = 0; + x1 = 0; + x2 = 0; + } + else + { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + var y0 = z1 * x2 - z2 * x1; + var y1 = z2 * x0 - z0 * x2; + var y2 = z0 * x1 - z1 * x0; + + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + + if (!len) + { + y0 = 0; + y1 = 0; + y2 = 0; + } + else + { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + return this.setValues( + x0, + y0, + z0, + 0, + + x1, + y1, + z1, + 0, + + x2, + y2, + z2, + 0, + + -(x0 * eyex + x1 * eyey + x2 * eyez), + -(y0 * eyex + y1 * eyey + y2 * eyez), + -(z0 * eyex + z1 * eyey + z2 * eyez), + 1 + ); + }, + + /** + * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. + * + * @method Phaser.Math.Matrix4#yawPitchRoll + * @since 3.0.0 + * + * @param {number} yaw - The yaw value. + * @param {number} pitch - The pitch value. + * @param {number} roll - The roll value. + * + * @return {this} This Matrix4. + */ + yawPitchRoll: function (yaw, pitch, roll) + { + this.zero(); + _tempMat1.zero(); + _tempMat2.zero(); + + var m0 = this.val; + var m1 = _tempMat1.val; + var m2 = _tempMat2.val; + + // Rotate Z + var s = Math.sin(roll); + var c = Math.cos(roll); + + m0[10] = 1; + m0[15] = 1; + m0[0] = c; + m0[1] = s; + m0[4] = -s; + m0[5] = c; + + // Rotate X + s = Math.sin(pitch); + c = Math.cos(pitch); + + m1[0] = 1; + m1[15] = 1; + m1[5] = c; + m1[10] = c; + m1[9] = -s; + m1[6] = s; + + // Rotate Y + s = Math.sin(yaw); + c = Math.cos(yaw); + + m2[5] = 1; + m2[15] = 1; + m2[0] = c; + m2[2] = -s; + m2[8] = s; + m2[10] = c; + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + return this; + }, + + /** + * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. + * + * @method Phaser.Math.Matrix4#setWorldMatrix + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. + * @param {Phaser.Math.Vector3} position - The position of the world matrix. + * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. + * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. + * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. + * + * @return {this} This Matrix4. + */ + setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) + { + this.yawPitchRoll(rotation.y, rotation.x, rotation.z); + + _tempMat1.scaling(scale.x, scale.y, scale.z); + _tempMat2.xyz(position.x, position.y, position.z); + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + if (viewMatrix) + { + this.multiplyLocal(viewMatrix); + } + + if (projectionMatrix) + { + this.multiplyLocal(projectionMatrix); + } + + return this; + }, + + /** + * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. + * + * @method Phaser.Math.Matrix4#multiplyToMat4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix4 to multiply with this one. + * @param {Phaser.Math.Matrix4} out - The receiving Matrix. + * + * @return {Phaser.Math.Matrix4} This `out` Matrix4. + */ + multiplyToMat4: function (src, out) + { + var a = this.val; + var b = src.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b03 = b[3]; + var b10 = b[4]; + var b11 = b[5]; + var b12 = b[6]; + var b13 = b[7]; + var b20 = b[8]; + var b21 = b[9]; + var b22 = b[10]; + var b23 = b[11]; + var b30 = b[12]; + var b31 = b[13]; + var b32 = b[14]; + var b33 = b[15]; + + return out.setValues( + b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, + b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31, + b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32, + b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33, + + b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, + b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, + b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, + b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, + + b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, + b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, + b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, + b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, + + b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, + b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, + b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, + b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 + ); + }, + + /** + * Takes the rotation and position vectors and builds this Matrix4 from them. + * + * @method Phaser.Math.Matrix4#fromRotationXYTranslation + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation vector. + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {boolean} translateFirst - Should the operation translate then rotate (`true`), or rotate then translate? (`false`) + * + * @return {this} This Matrix4. + */ + fromRotationXYTranslation: function (rotation, position, translateFirst) + { + var x = position.x; + var y = position.y; + var z = position.z; + + var sx = Math.sin(rotation.x); + var cx = Math.cos(rotation.x); + + var sy = Math.sin(rotation.y); + var cy = Math.cos(rotation.y); + + var a30 = x; + var a31 = y; + var a32 = z; + + // Rotate X + + var b21 = -sx; + + // Rotate Y + + var c01 = 0 - b21 * sy; + + var c02 = 0 - cx * sy; + + var c21 = b21 * cy; + + var c22 = cx * cy; + + // Translate + if (!translateFirst) + { + // a30 = cy * x + 0 * y + sy * z; + a30 = cy * x + sy * z; + a31 = c01 * x + cx * y + c21 * z; + a32 = c02 * x + sx * y + c22 * z; + } + + return this.setValues( + cy, + c01, + c02, + 0, + 0, + cx, + sx, + 0, + sy, + c21, + c22, + 0, + a30, + a31, + a32, + 1 + ); + }, + + /** + * Returns the maximum axis scale from this Matrix4. + * + * @method Phaser.Math.Matrix4#getMaxScaleOnAxis + * @since 3.50.0 + * + * @return {number} The maximum axis scale. + */ + getMaxScaleOnAxis: function () + { + var m = this.val; + + var scaleXSq = m[0] * m[0] + m[1] * m[1] + m[2] * m[2]; + var scaleYSq = m[4] * m[4] + m[5] * m[5] + m[6] * m[6]; + var scaleZSq = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; + + return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); + } + +}); + +/** + * @ignore + */ +var _tempMat1 = new Matrix4(); + +/** + * @ignore + */ +var _tempMat2 = new Matrix4(); + +/** + * @ignore + */ +var _x = new Vector3(); + +/** + * @ignore + */ +var _y = new Vector3(); + +/** + * @ignore + */ +var _z = new Vector3(); + +module.exports = Matrix4; + + +/***/ }), + +/***/ 3733: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Add an `amount` to a `value`, limiting the maximum result to `max`. + * + * @function Phaser.Math.MaxAdd + * @since 3.0.0 + * + * @param {number} value - The value to add to. + * @param {number} amount - The amount to add. + * @param {number} max - The maximum value to return. + * + * @return {number} The resulting value. + */ +var MaxAdd = function (value, amount, max) +{ + return Math.min(value + amount, max); +}; + +module.exports = MaxAdd; + + +/***/ }), + +/***/ 44: +/***/ ((module) => { + +/** + * @author Vladislav Forsh + * @copyright 2021 RoboWhale + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the median of the given values. The values are sorted and the middle value is returned. + * In case of an even number of values, the average of the two middle values is returned. + * + * @function Phaser.Math.Median + * @since 3.54.0 + * + * @param {number[]} values - The values to average. + * + * @return {number} The median value. + */ +var Median = function (values) +{ + var valuesNum = values.length; + if (valuesNum === 0) + { + return 0; + } + + values.sort(function (a, b) { return a - b; }); + + var halfIndex = Math.floor(valuesNum / 2); + + return valuesNum % 2 === 0 + ? (values[halfIndex] + values[halfIndex - 1]) / 2 + : values[halfIndex]; +}; + +module.exports = Median; + + +/***/ }), + +/***/ 5385: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Subtract an `amount` from `value`, limiting the minimum result to `min`. + * + * @function Phaser.Math.MinSub + * @since 3.0.0 + * + * @param {number} value - The value to subtract from. + * @param {number} amount - The amount to subtract. + * @param {number} min - The minimum value to return. + * + * @return {number} The resulting value. + */ +var MinSub = function (value, amount, min) +{ + return Math.max(value - amount, min); +}; + +module.exports = MinSub; + + +/***/ }), + +/***/ 8585: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Work out what percentage `value` is of the range between `min` and `max`. + * If `max` isn't given then it will return the percentage of `value` to `min`. + * + * You can optionally specify an `upperMax` value, which is a mid-way point in the range that represents 100%, after which the % starts to go down to zero again. + * + * @function Phaser.Math.Percent + * @since 3.0.0 + * + * @param {number} value - The value to determine the percentage of. + * @param {number} min - The minimum value. + * @param {number} [max] - The maximum value. + * @param {number} [upperMax] - The mid-way point in the range that represents 100%. + * + * @return {number} A value between 0 and 1 representing the percentage. + */ +var Percent = function (value, min, max, upperMax) +{ + if (max === undefined) { max = min + 1; } + + var percentage = (value - min) / (max - min); + + if (percentage > 1) + { + if (upperMax !== undefined) + { + percentage = ((upperMax - value)) / (upperMax - max); + + if (percentage < 0) + { + percentage = 0; + } + } + else + { + percentage = 1; + } + } + else if (percentage < 0) + { + percentage = 0; + } + + return percentage; +}; + +module.exports = Percent; + + +/***/ }), + +/***/ 372: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(7473); +var Matrix3 = __webpack_require__(2149); +var NOOP = __webpack_require__(1984); +var Vector3 = __webpack_require__(5689); + +var EPSILON = 0.000001; + +// Some shared 'private' arrays +var siNext = new Int8Array([ 1, 2, 0 ]); +var tmp = new Float32Array([ 0, 0, 0 ]); + +var xUnitVec3 = new Vector3(1, 0, 0); +var yUnitVec3 = new Vector3(0, 1, 0); + +var tmpvec = new Vector3(); +var tmpMat3 = new Matrix3(); + +/** + * @classdesc + * A quaternion. + * + * @class Quaternion + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x=0] - The x component. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=1] - The w component. + */ +var Quaternion = new Class({ + + initialize: + + function Quaternion (x, y, z, w) + { + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_x + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_y + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_z + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_w + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * This callback is invoked, if set, each time a value in this quaternion is changed. + * The callback is passed one argument, a reference to this quaternion. + * + * @name Phaser.Math.Quaternion#onChangeCallback + * @type {function} + * @since 3.50.0 + */ + this.onChangeCallback = NOOP; + + this.set(x, y, z, w); + }, + + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: { + get: function () + { + return this._w; + }, + + set: function (value) + { + this._w = value; + + this.onChangeCallback(this); + } + }, + + /** + * Copy the components of a given Quaternion or Vector into this Quaternion. + * + * @method Phaser.Math.Quaternion#copy + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + copy: function (src) + { + return this.set(src); + }, + + /** + * Set the components of this Quaternion and optionally call the `onChangeCallback`. + * + * @method Phaser.Math.Quaternion#set + * @since 3.0.0 + * + * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=0] - The w component. + * @param {boolean} [update=true] - Call the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + set: function (x, y, z, w, update) + { + if (update === undefined) { update = true; } + + if (typeof x === 'object') + { + this._x = x.x || 0; + this._y = x.y || 0; + this._z = x.z || 0; + this._w = x.w || 0; + } + else + { + this._x = x || 0; + this._y = y || 0; + this._z = z || 0; + this._w = w || 0; + } + + if (update) + { + this.onChangeCallback(this); + } + + return this; + }, + + /** + * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise. + * + * @method Phaser.Math.Quaternion#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + add: function (v) + { + this._x += v.x; + this._y += v.y; + this._z += v.z; + this._w += v.w; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise. + * + * @method Phaser.Math.Quaternion#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + subtract: function (v) + { + this._x -= v.x; + this._y -= v.y; + this._z -= v.z; + this._w -= v.w; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Scale this Quaternion by the given value. + * + * @method Phaser.Math.Quaternion#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Quaternion by. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + scale: function (scale) + { + this._x *= scale; + this._y *= scale; + this._z *= scale; + this._w *= scale; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Calculate the length of this Quaternion. + * + * @method Phaser.Math.Quaternion#length + * @since 3.0.0 + * + * @return {number} The length of this Quaternion. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return Math.sqrt(x * x + y * y + z * z + w * w); + }, + + /** + * Calculate the length of this Quaternion squared. + * + * @method Phaser.Math.Quaternion#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Quaternion, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return x * x + y * y + z * z + w * w; + }, + + /** + * Normalize this Quaternion. + * + * @method Phaser.Math.Quaternion#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + var len = x * x + y * y + z * z + w * w; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this._x = x * len; + this._y = y * len; + this._z = z * len; + this._w = w * len; + } + + this.onChangeCallback(this); + + return this; + }, + + /** + * Calculate the dot product of this Quaternion and the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#dot + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion. + * + * @return {number} The dot product of this Quaternion and the given Quaternion or Vector. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; + }, + + /** + * Linearly interpolate this Quaternion towards the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#lerp + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards. + * @param {number} [t=0] - The percentage of interpolation. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + return this.set( + ax + t * (v.x - ax), + ay + t * (v.y - ay), + az + t * (v.z - az), + aw + t * (v.w - aw) + ); + }, + + /** + * Rotates this Quaternion based on the two given vectors. + * + * @method Phaser.Math.Quaternion#rotationTo + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - The transform rotation vector. + * @param {Phaser.Math.Vector3} b - The target rotation vector. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotationTo: function (a, b) + { + var dot = a.x * b.x + a.y * b.y + a.z * b.z; + + if (dot < -0.999999) + { + if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON) + { + tmpvec.copy(yUnitVec3).cross(a); + } + + tmpvec.normalize(); + + return this.setAxisAngle(tmpvec, Math.PI); + + } + else if (dot > 0.999999) + { + return this.set(0, 0, 0, 1); + } + else + { + tmpvec.copy(a).cross(b); + + this._x = tmpvec.x; + this._y = tmpvec.y; + this._z = tmpvec.z; + this._w = 1 + dot; + + return this.normalize(); + } + }, + + /** + * Set the axes of this Quaternion. + * + * @method Phaser.Math.Quaternion#setAxes + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} view - The view axis. + * @param {Phaser.Math.Vector3} right - The right axis. + * @param {Phaser.Math.Vector3} up - The upwards axis. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setAxes: function (view, right, up) + { + var m = tmpMat3.val; + + m[0] = right.x; + m[3] = right.y; + m[6] = right.z; + + m[1] = up.x; + m[4] = up.y; + m[7] = up.z; + + m[2] = -view.x; + m[5] = -view.y; + m[8] = -view.z; + + return this.fromMat3(tmpMat3).normalize(); + }, + + /** + * Reset this Matrix to an identity (default) Quaternion. + * + * @method Phaser.Math.Quaternion#identity + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + identity: function () + { + return this.set(0, 0, 0, 1); + }, + + /** + * Set the axis angle of this Quaternion. + * + * @method Phaser.Math.Quaternion#setAxisAngle + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} axis - The axis. + * @param {number} rad - The angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setAxisAngle: function (axis, rad) + { + rad = rad * 0.5; + + var s = Math.sin(rad); + + return this.set( + s * axis.x, + s * axis.y, + s * axis.z, + Math.cos(rad) + ); + }, + + /** + * Multiply this Quaternion by the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + multiply: function (b) + { + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = b.x; + var by = b.y; + var bz = b.z; + var bw = b.w; + + return this.set( + ax * bw + aw * bx + ay * bz - az * by, + ay * bw + aw * by + az * bx - ax * bz, + az * bw + aw * bz + ax * by - ay * bx, + aw * bw - ax * bx - ay * by - az * bz + ); + }, + + /** + * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#slerp + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards. + * @param {number} t - The percentage of interpolation. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + slerp: function (b, t) + { + // benchmarks: http://jsperf.com/quaternion-slerp-implementations + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = b.x; + var by = b.y; + var bz = b.z; + var bw = b.w; + + // calc cosine + var cosom = ax * bx + ay * by + az * bz + aw * bw; + + // adjust signs (if necessary) + if (cosom < 0) + { + cosom = -cosom; + bx = - bx; + by = - by; + bz = - bz; + bw = - bw; + } + + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + var scale0 = 1 - t; + var scale1 = t; + + // calculate coefficients + if ((1 - cosom) > EPSILON) + { + // standard case (slerp) + var omega = Math.acos(cosom); + var sinom = Math.sin(omega); + + scale0 = Math.sin((1.0 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } + + // calculate final values + return this.set( + scale0 * ax + scale1 * bx, + scale0 * ay + scale1 * by, + scale0 * az + scale1 * bz, + scale0 * aw + scale1 * bw + ); + }, + + /** + * Invert this Quaternion. + * + * @method Phaser.Math.Quaternion#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + invert: function () + { + var a0 = this.x; + var a1 = this.y; + var a2 = this.z; + var a3 = this.w; + + var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + var invDot = (dot) ? 1 / dot : 0; + + return this.set( + -a0 * invDot, + -a1 * invDot, + -a2 * invDot, + a3 * invDot + ); + }, + + /** + * Convert this Quaternion into its conjugate. + * + * Sets the x, y and z components. + * + * @method Phaser.Math.Quaternion#conjugate + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + conjugate: function () + { + this._x = -this.x; + this._y = -this.y; + this._z = -this.z; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Rotate this Quaternion on the X axis. + * + * @method Phaser.Math.Quaternion#rotateX + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateX: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = Math.sin(rad); + var bw = Math.cos(rad); + + return this.set( + ax * bw + aw * bx, + ay * bw + az * bx, + az * bw - ay * bx, + aw * bw - ax * bx + ); + }, + + /** + * Rotate this Quaternion on the Y axis. + * + * @method Phaser.Math.Quaternion#rotateY + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateY: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var by = Math.sin(rad); + var bw = Math.cos(rad); + + return this.set( + ax * bw - az * by, + ay * bw + aw * by, + az * bw + ax * by, + aw * bw - ay * by + ); + }, + + /** + * Rotate this Quaternion on the Z axis. + * + * @method Phaser.Math.Quaternion#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateZ: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bz = Math.sin(rad); + var bw = Math.cos(rad); + + return this.set( + ax * bw + ay * bz, + ay * bw - ax * bz, + az * bw + aw * bz, + aw * bw - az * bz + ); + }, + + /** + * Create a unit (or rotation) Quaternion from its x, y, and z components. + * + * Sets the w component. + * + * @method Phaser.Math.Quaternion#calculateW + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + calculateW: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + this.w = -Math.sqrt(1.0 - x * x - y * y - z * z); + + return this; + }, + + /** + * Set this Quaternion from the given Euler, based on Euler order. + * + * @method Phaser.Math.Quaternion#setFromEuler + * @since 3.50.0 + * + * @param {Phaser.Math.Euler} euler - The Euler to convert from. + * @param {boolean} [update=true] - Run the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromEuler: function (euler, update) + { + var x = euler.x / 2; + var y = euler.y / 2; + var z = euler.z / 2; + + var c1 = Math.cos(x); + var c2 = Math.cos(y); + var c3 = Math.cos(z); + + var s1 = Math.sin(x); + var s2 = Math.sin(y); + var s3 = Math.sin(z); + + switch (euler.order) + { + case 'XYZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'YXZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'ZXY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'ZYX': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'YZX': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'XZY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + } + + return this; + }, + + /** + * Sets the rotation of this Quaternion from the given Matrix4. + * + * @method Phaser.Math.Quaternion#setFromRotationMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to set the rotation from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromRotationMatrix: function (mat4) + { + var m = mat4.val; + + var m11 = m[0]; + var m12 = m[4]; + var m13 = m[8]; + var m21 = m[1]; + var m22 = m[5]; + var m23 = m[9]; + var m31 = m[2]; + var m32 = m[6]; + var m33 = m[10]; + + var trace = m11 + m22 + m33; + var s; + + if (trace > 0) + { + s = 0.5 / Math.sqrt(trace + 1.0); + + this.set( + (m32 - m23) * s, + (m13 - m31) * s, + (m21 - m12) * s, + 0.25 / s + ); + } + else if (m11 > m22 && m11 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); + + this.set( + 0.25 * s, + (m12 + m21) / s, + (m13 + m31) / s, + (m32 - m23) / s + ); + } + else if (m22 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); + + this.set( + (m12 + m21) / s, + 0.25 * s, + (m23 + m32) / s, + (m13 - m31) / s + ); + } + else + { + s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); + + this.set( + (m13 + m31) / s, + (m23 + m32) / s, + 0.25 * s, + (m21 - m12) / s + ); + } + + return this; + }, + + /** + * Convert the given Matrix into this Quaternion. + * + * @method Phaser.Math.Quaternion#fromMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + fromMat3: function (mat) + { + // benchmarks: + // http://jsperf.com/typed-array-access-speed + // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion + + // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes + // article "Quaternion Calculus and Fast Animation". + var m = mat.val; + var fTrace = m[0] + m[4] + m[8]; + var fRoot; + + if (fTrace > 0) + { + // |w| > 1/2, may as well choose w > 1/2 + fRoot = Math.sqrt(fTrace + 1.0); // 2w + + this.w = 0.5 * fRoot; + + fRoot = 0.5 / fRoot; // 1/(4w) + + this._x = (m[7] - m[5]) * fRoot; + this._y = (m[2] - m[6]) * fRoot; + this._z = (m[3] - m[1]) * fRoot; + } + else + { + // |w| <= 1/2 + var i = 0; + + if (m[4] > m[0]) + { + i = 1; + } + + if (m[8] > m[i * 3 + i]) + { + i = 2; + } + + var j = siNext[i]; + var k = siNext[j]; + + // This isn't quite as clean without array access + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); + tmp[i] = 0.5 * fRoot; + + fRoot = 0.5 / fRoot; + + tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + + this._x = tmp[0]; + this._y = tmp[1]; + this._z = tmp[2]; + this._w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; + } + + this.onChangeCallback(this); + + return this; + } + +}); + +module.exports = Quaternion; + + +/***/ }), + +/***/ 4208: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(7425); + +/** + * Convert the given angle in radians, to the equivalent angle in degrees. + * + * @function Phaser.Math.RadToDeg + * @since 3.0.0 + * + * @param {number} radians - The angle in radians to convert ot degrees. + * + * @return {number} The given angle converted to degrees. + */ +var RadToDeg = function (radians) +{ + return radians * CONST.RAD_TO_DEG; +}; + +module.exports = RadToDeg; + + +/***/ }), + +/***/ 1705: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random unit vector. + * + * Computes random values for the given vector between -1 and 1 that can be used to represent a direction. + * + * Optionally accepts a scale value to scale the resulting vector by. + * + * @function Phaser.Math.RandomXY + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} vector - The Vector to compute random values for. + * @param {number} [scale=1] - The scale of the random values. + * + * @return {Phaser.Math.Vector2} The given Vector. + */ +var RandomXY = function (vector, scale) +{ + if (scale === undefined) { scale = 1; } + + var r = Math.random() * 2 * Math.PI; + + vector.x = Math.cos(r) * scale; + vector.y = Math.sin(r) * scale; + + return vector; +}; + +module.exports = RandomXY; + + +/***/ }), + +/***/ 6650: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random position vector in a spherical area, optionally defined by the given radius. + * + * @function Phaser.Math.RandomXYZ + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} vec3 - The Vector to compute random values for. + * @param {number} [radius=1] - The radius. + * + * @return {Phaser.Math.Vector3} The given Vector. + */ +var RandomXYZ = function (vec3, radius) +{ + if (radius === undefined) { radius = 1; } + + var r = Math.random() * 2 * Math.PI; + var z = (Math.random() * 2) - 1; + var zScale = Math.sqrt(1 - z * z) * radius; + + vec3.x = Math.cos(r) * zScale; + vec3.y = Math.sin(r) * zScale; + vec3.z = z * radius; + + return vec3; +}; + +module.exports = RandomXYZ; + + +/***/ }), + +/***/ 2037: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random four-dimensional vector. + * + * @function Phaser.Math.RandomXYZW + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} vec4 - The Vector to compute random values for. + * @param {number} [scale=1] - The scale of the random values. + * + * @return {Phaser.Math.Vector4} The given Vector. + */ +var RandomXYZW = function (vec4, scale) +{ + if (scale === undefined) { scale = 1; } + + vec4.x = (Math.random() * 2 - 1) * scale; + vec4.y = (Math.random() * 2 - 1) * scale; + vec4.z = (Math.random() * 2 - 1) * scale; + vec4.w = (Math.random() * 2 - 1) * scale; + + return vec4; +}; + +module.exports = RandomXYZW; + + +/***/ }), + +/***/ 6283: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a given point by a given angle around the origin (0, 0), in an anti-clockwise direction. + * + * @function Phaser.Math.Rotate + * @since 3.0.0 + * + * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. + * @param {number} angle - The angle to be rotated by in an anticlockwise direction. + * + * @return {Phaser.Geom.Point} The given point, rotated by the given angle in an anticlockwise direction. + */ +var Rotate = function (point, angle) +{ + var x = point.x; + var y = point.y; + + point.x = (x * Math.cos(angle)) - (y * Math.sin(angle)); + point.y = (x * Math.sin(angle)) + (y * Math.cos(angle)); + + return point; +}; + +module.exports = Rotate; + + +/***/ }), + +/***/ 9876: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` to the given `angle`, at the same distance. + * + * In polar notation, this maps a point from (r, t) to (r, angle), vs. the origin (x, y). + * + * @function Phaser.Math.RotateAround + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] + * + * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. + * @param {number} x - The horizontal coordinate to rotate around. + * @param {number} y - The vertical coordinate to rotate around. + * @param {number} angle - The angle of rotation in radians. + * + * @return {Phaser.Types.Math.Vector2Like} The given point. + */ +var RotateAround = function (point, x, y, angle) +{ + var c = Math.cos(angle); + var s = Math.sin(angle); + + var tx = point.x - x; + var ty = point.y - y; + + point.x = tx * c - ty * s + x; + point.y = tx * s + ty * c + y; + + return point; +}; + +module.exports = RotateAround; + + +/***/ }), + +/***/ 8348: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` by the given `angle` and `distance`. + * + * In polar notation, this maps a point from (r, t) to (distance, t + angle), vs. the origin (x, y). + * + * @function Phaser.Math.RotateAroundDistance + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] + * + * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. + * @param {number} x - The horizontal coordinate to rotate around. + * @param {number} y - The vertical coordinate to rotate around. + * @param {number} angle - The angle of rotation in radians. + * @param {number} distance - The distance from (x, y) to place the point at. + * + * @return {Phaser.Types.Math.Vector2Like} The given point. + */ +var RotateAroundDistance = function (point, x, y, angle, distance) +{ + var t = angle + Math.atan2(point.y - y, point.x - x); + + point.x = x + (distance * Math.cos(t)); + point.y = y + (distance * Math.sin(t)); + + return point; +}; + +module.exports = RotateAroundDistance; + + +/***/ }), + +/***/ 4497: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Position a `point` at the given `angle` and `distance` to (`x`, `y`). + * + * @function Phaser.Math.RotateTo + * @since 3.24.0 + * + * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] + * + * @param {Phaser.Types.Math.Vector2Like} point - The point to be positioned. + * @param {number} x - The horizontal coordinate to position from. + * @param {number} y - The vertical coordinate to position from. + * @param {number} angle - The angle of rotation in radians. + * @param {number} distance - The distance from (x, y) to place the point at. + * + * @return {Phaser.Types.Math.Vector2Like} The given point. + */ +var RotateTo = function (point, x, y, angle, distance) +{ + point.x = x + (distance * Math.cos(angle)); + point.y = y + (distance * Math.sin(angle)); + + return point; +}; + +module.exports = RotateTo; + + +/***/ }), + +/***/ 9640: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector3 = __webpack_require__(5689); +var Matrix4 = __webpack_require__(9652); +var Quaternion = __webpack_require__(372); + +var tmpMat4 = new Matrix4(); +var tmpQuat = new Quaternion(); +var tmpVec3 = new Vector3(); + +/** + * Rotates a vector in place by axis angle. + * + * This is the same as transforming a point by an + * axis-angle quaternion, but it has higher precision. + * + * @function Phaser.Math.RotateVec3 + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} vec - The vector to be rotated. + * @param {Phaser.Math.Vector3} axis - The axis to rotate around. + * @param {number} radians - The angle of rotation in radians. + * + * @return {Phaser.Math.Vector3} The given vector. + */ +var RotateVec3 = function (vec, axis, radians) +{ + // Set the quaternion to our axis angle + tmpQuat.setAxisAngle(axis, radians); + + // Create a rotation matrix from the axis angle + tmpMat4.fromRotationTranslation(tmpQuat, tmpVec3.set(0, 0, 0)); + + // Multiply our vector by the rotation matrix + return vec.transformMat4(tmpMat4); +}; + +module.exports = RotateVec3; + + +/***/ }), + +/***/ 4078: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down. + * + * @function Phaser.Math.RoundAwayFromZero + * @since 3.0.0 + * + * @param {number} value - The number to round. + * + * @return {number} The rounded number, rounded away from zero. + */ +var RoundAwayFromZero = function (value) +{ + // "Opposite" of truncate. + return (value > 0) ? Math.ceil(value) : Math.floor(value); +}; + +module.exports = RoundAwayFromZero; + + +/***/ }), + +/***/ 855: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Round a value to the given precision. + * + * For example: + * + * ```javascript + * RoundTo(123.456, 0) = 123 + * RoundTo(123.456, 1) = 120 + * RoundTo(123.456, 2) = 100 + * ``` + * + * To round the decimal, i.e. to round to precision, pass in a negative `place`: + * + * ```javascript + * RoundTo(123.456789, 0) = 123 + * RoundTo(123.456789, -1) = 123.5 + * RoundTo(123.456789, -2) = 123.46 + * RoundTo(123.456789, -3) = 123.457 + * ``` + * + * @function Phaser.Math.RoundTo + * @since 3.0.0 + * + * @param {number} value - The value to round. + * @param {number} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. + * + * @return {number} The rounded value. + */ +var RoundTo = function (value, place, base) +{ + if (place === undefined) { place = 0; } + if (base === undefined) { base = 10; } + + var p = Math.pow(base, -place); + + return Math.round(value * p) / p; +}; + +module.exports = RoundTo; + + +/***/ }), + +/***/ 4936: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Generate a series of sine and cosine values. + * + * @function Phaser.Math.SinCosTableGenerator + * @since 3.0.0 + * + * @param {number} length - The number of values to generate. + * @param {number} [sinAmp=1] - The sine value amplitude. + * @param {number} [cosAmp=1] - The cosine value amplitude. + * @param {number} [frequency=1] - The frequency of the values. + * + * @return {Phaser.Types.Math.SinCosTable} The generated values. + */ +var SinCosTableGenerator = function (length, sinAmp, cosAmp, frequency) +{ + if (sinAmp === undefined) { sinAmp = 1; } + if (cosAmp === undefined) { cosAmp = 1; } + if (frequency === undefined) { frequency = 1; } + + frequency *= Math.PI / length; + + var cos = []; + var sin = []; + + for (var c = 0; c < length; c++) + { + cosAmp -= sinAmp * frequency; + sinAmp += cosAmp * frequency; + + cos[c] = cosAmp; + sin[c] = sinAmp; + } + + return { + sin: sin, + cos: cos, + length: length + }; +}; + +module.exports = SinCosTableGenerator; + + +/***/ }), + +/***/ 2733: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate a smooth interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * + * @function Phaser.Math.SmoothStep + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep} + * + * @param {number} x - The input value. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The percentage of interpolation, between 0 and 1. + */ +var SmoothStep = function (x, min, max) +{ + if (x <= min) + { + return 0; + } + + if (x >= max) + { + return 1; + } + + x = (x - min) / (max - min); + + return x * x * (3 - 2 * x); +}; + +module.exports = SmoothStep; + + +/***/ }), + +/***/ 278: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate a smoother interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * + * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}. + * + * @function Phaser.Math.SmootherStep + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} + * + * @param {number} x - The input value. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The percentage of interpolation, between 0 and 1. + */ +var SmootherStep = function (x, min, max) +{ + x = Math.max(0, Math.min(1, (x - min) / (max - min))); + + return x * x * x * (x * (x * 6 - 15) + 10); +}; + +module.exports = SmootherStep; + + +/***/ }), + +/***/ 163: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(2529); + +/** + * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid. + * + * For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2. + * + * If the given index is out of range an empty Vector2 is returned. + * + * @function Phaser.Math.ToXY + * @since 3.19.0 + * + * @param {number} index - The position within the grid to get the x/y value for. + * @param {number} width - The width of the grid. + * @param {number} height - The height of the grid. + * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created. + * + * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index. + */ +var ToXY = function (index, width, height, out) +{ + if (out === undefined) { out = new Vector2(); } + + var x = 0; + var y = 0; + var total = width * height; + + if (index > 0 && index <= total) + { + if (index > width - 1) + { + y = Math.floor(index / width); + x = index - (y * width); + } + else + { + x = index; + } + } + + return out.set(x, y); +}; + +module.exports = ToXY; + + +/***/ }), + +/***/ 7556: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(2529); + +/** + * Takes the `x` and `y` coordinates and transforms them into the same space as + * defined by the position, rotation and scale values. + * + * @function Phaser.Math.TransformXY + * @since 3.0.0 + * + * @param {number} x - The x coordinate to be transformed. + * @param {number} y - The y coordinate to be transformed. + * @param {number} positionX - Horizontal position of the transform point. + * @param {number} positionY - Vertical position of the transform point. + * @param {number} rotation - Rotation of the transform point, in radians. + * @param {number} scaleX - Horizontal scale of the transform point. + * @param {number} scaleY - Vertical scale of the transform point. + * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates. + * + * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point. + */ +var TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output) +{ + if (output === undefined) { output = new Vector2(); } + + var radianSin = Math.sin(rotation); + var radianCos = Math.cos(rotation); + + // Rotate and Scale + var a = radianCos * scaleX; + var b = radianSin * scaleX; + var c = -radianSin * scaleY; + var d = radianCos * scaleY; + + // Invert + var id = 1 / ((a * d) + (c * -b)); + + output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id); + output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id); + + return output; +}; + +module.exports = TransformXY; + + +/***/ }), + +/***/ 2529: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(7473); +var FuzzyEqual = __webpack_require__(12); + +/** + * @classdesc + * A representation of a vector in 2D space. + * + * A two-component vector. + * + * @class Vector2 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number|Phaser.Types.Math.Vector2Like} [x=0] - The x component, or an object with `x` and `y` properties. + * @param {number} [y=x] - The y component. + */ +var Vector2 = new Class({ + + initialize: + + function Vector2 (x, y) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector2#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector2#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + } + else + { + if (y === undefined) { y = x; } + + this.x = x || 0; + this.y = y || 0; + } + }, + + /** + * Make a clone of this Vector2. + * + * @method Phaser.Math.Vector2#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} A clone of this Vector2. + */ + clone: function () + { + return new Vector2(this.x, this.y); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector2#copy + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + copy: function (src) + { + this.x = src.x || 0; + this.y = src.y || 0; + + return this; + }, + + /** + * Set the component values of this Vector from a given Vector2Like object. + * + * @method Phaser.Math.Vector2#setFromObject + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setFromObject: function (obj) + { + this.x = obj.x || 0; + this.y = obj.y || 0; + + return this; + }, + + /** + * Set the `x` and `y` components of the this Vector to the given `x` and `y` values. + * + * @method Phaser.Math.Vector2#set + * @since 3.0.0 + * + * @param {number} x - The x value to set for this Vector. + * @param {number} [y=x] - The y value to set for this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + set: function (x, y) + { + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + }, + + /** + * This method is an alias for `Vector2.set`. + * + * @method Phaser.Math.Vector2#setTo + * @since 3.4.0 + * + * @param {number} x - The x value to set for this Vector. + * @param {number} [y=x] - The y value to set for this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setTo: function (x, y) + { + return this.set(x, y); + }, + + /** + * Sets the `x` and `y` values of this object from a given polar coordinate. + * + * @method Phaser.Math.Vector2#setToPolar + * @since 3.0.0 + * + * @param {number} azimuth - The angular coordinate, in radians. + * @param {number} [radius=1] - The radial coordinate (length). + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setToPolar: function (azimuth, radius) + { + if (radius == null) { radius = 1; } + + this.x = Math.cos(azimuth) * radius; + this.y = Math.sin(azimuth) * radius; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @method Phaser.Math.Vector2#equals + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. + * + * @return {boolean} Whether the given Vector is equal to this Vector. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y)); + }, + + /** + * Check whether this Vector is approximately equal to a given Vector. + * + * @method Phaser.Math.Vector2#fuzzyEquals + * @since 3.23.0 + * + * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. + * @param {number} [epsilon=0.0001] - The tolerance value. + * + * @return {boolean} Whether both absolute differences of the x and y components are smaller than `epsilon`. + */ + fuzzyEquals: function (v, epsilon) + { + return (FuzzyEqual(this.x, v.x, epsilon) && FuzzyEqual(this.y, v.y, epsilon)); + }, + + /** + * Calculate the angle between this Vector and the positive x-axis, in radians. + * + * @method Phaser.Math.Vector2#angle + * @since 3.0.0 + * + * @return {number} The angle between this Vector, and the positive x-axis, given in radians. + */ + angle: function () + { + // computes the angle in radians with respect to the positive x-axis + + var angle = Math.atan2(this.y, this.x); + + if (angle < 0) + { + angle += 2 * Math.PI; + } + + return angle; + }, + + /** + * Set the angle of this Vector. + * + * @method Phaser.Math.Vector2#setAngle + * @since 3.23.0 + * + * @param {number} angle - The angle, in radians. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setAngle: function (angle) + { + return this.setToPolar(angle, this.length()); + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector2#add + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + add: function (src) + { + this.x += src.x; + this.y += src.y; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector2#subtract + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + subtract: function (src) + { + this.x -= src.x; + this.y -= src.y; + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector2#multiply + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + multiply: function (src) + { + this.x *= src.x; + this.y *= src.y; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector2#scale + * @since 3.0.0 + * + * @param {number} value - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + scale: function (value) + { + if (isFinite(value)) + { + this.x *= value; + this.y *= value; + } + else + { + this.x = 0; + this.y = 0; + } + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector2#divide + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + divide: function (src) + { + this.x /= src.x; + this.y /= src.y; + + return this; + }, + + /** + * Negate the `x` and `y` components of this Vector. + * + * @method Phaser.Math.Vector2#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#distance + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (src) + { + var dx = src.x - this.x; + var dy = src.y - this.y; + + return Math.sqrt(dx * dx + dy * dy); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector2#distanceSq + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (src) + { + var dx = src.x - this.x; + var dy = src.y - this.y; + + return dx * dx + dy * dy; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector2#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + + return Math.sqrt(x * x + y * y); + }, + + /** + * Set the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector2#setLength + * @since 3.23.0 + * + * @param {number} length + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setLength: function (length) + { + return this.normalize().scale(length); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector2#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + + return x * x + y * y; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector2#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var len = x * x + y * y; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + } + + return this; + }, + + /** + * Rotate this Vector to its perpendicular, in the positive direction. + * + * @method Phaser.Math.Vector2#normalizeRightHand + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + normalizeRightHand: function () + { + var x = this.x; + + this.x = this.y * -1; + this.y = x; + + return this; + }, + + /** + * Rotate this Vector to its perpendicular, in the negative direction. + * + * @method Phaser.Math.Vector2#normalizeLeftHand + * @since 3.23.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + normalizeLeftHand: function () + { + var x = this.x; + + this.x = this.y; + this.y = x * -1; + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#dot + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to dot product with this Vector2. + * + * @return {number} The dot product of this Vector and the given Vector. + */ + dot: function (src) + { + return this.x * src.x + this.y * src.y; + }, + + /** + * Calculate the cross product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#cross + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to cross with this Vector2. + * + * @return {number} The cross product of this Vector and the given Vector. + */ + cross: function (src) + { + return this.x * src.y - this.y * src.x; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector2#lerp + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + lerp: function (src, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + + this.x = ax + t * (src.x - ax); + this.y = ay + t * (src.y - ay); + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector2#transformMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + transformMat3: function (mat) + { + var x = this.x; + var y = this.y; + var m = mat.val; + + this.x = m[0] * x + m[3] * y + m[6]; + this.y = m[1] * x + m[4] * y + m[7]; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector2#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[12]; + this.y = m[1] * x + m[5] * y + m[13]; + + return this; + }, + + /** + * Make this Vector the zero vector (0, 0). + * + * @method Phaser.Math.Vector2#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + reset: function () + { + this.x = 0; + this.y = 0; + + return this; + }, + + /** + * Limit the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector2#limit + * @since 3.23.0 + * + * @param {number} max - The maximum length. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + limit: function (max) + { + var len = this.length(); + + if (len && len > max) + { + this.scale(max / len); + } + + return this; + }, + + /** + * Reflect this Vector off a line defined by a normal. + * + * @method Phaser.Math.Vector2#reflect + * @since 3.23.0 + * + * @param {Phaser.Math.Vector2} normal - A vector perpendicular to the line. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + reflect: function (normal) + { + normal = normal.clone().normalize(); + + return this.subtract(normal.scale(2 * this.dot(normal))); + }, + + /** + * Reflect this Vector across another. + * + * @method Phaser.Math.Vector2#mirror + * @since 3.23.0 + * + * @param {Phaser.Math.Vector2} axis - A vector to reflect across. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + mirror: function (axis) + { + return this.reflect(axis).negate(); + }, + + /** + * Rotate this Vector by an angle amount. + * + * @method Phaser.Math.Vector2#rotate + * @since 3.23.0 + * + * @param {number} delta - The angle to rotate by, in radians. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + rotate: function (delta) + { + var cos = Math.cos(delta); + var sin = Math.sin(delta); + + return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); + }, + + /** + * Project this Vector onto another. + * + * @method Phaser.Math.Vector2#project + * @since 3.60.0 + * + * @param {Phaser.Math.Vector2} src - The vector to project onto. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + project: function (src) + { + var scalar = this.dot(src) / src.dot(src); + + return this.copy(src).scale(scalar); + } + +}); + +/** + * A static zero Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.ZERO + * @type {Phaser.Math.Vector2} + * @since 3.1.0 + */ +Vector2.ZERO = new Vector2(); + +/** + * A static right Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.RIGHT + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.RIGHT = new Vector2(1, 0); + +/** + * A static left Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.LEFT + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.LEFT = new Vector2(-1, 0); + +/** + * A static up Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.UP + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.UP = new Vector2(0, -1); + +/** + * A static down Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.DOWN + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.DOWN = new Vector2(0, 1); + +/** + * A static one Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.ONE + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.ONE = new Vector2(1, 1); + +module.exports = Vector2; + + +/***/ }), + +/***/ 5689: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A representation of a vector in 3D space. + * + * A three-component vector. + * + * @class Vector3 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Vector3 = new Class({ + + initialize: + + function Vector3 (x, y, z) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector3#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector3#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The z component of this Vector. + * + * @name Phaser.Math.Vector3#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.z = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + }, + + /** + * Set this Vector to point up. + * + * Sets the y component of the vector to 1, and the others to 0. + * + * @method Phaser.Math.Vector3#up + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + up: function () + { + this.x = 0; + this.y = 1; + this.z = 0; + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.min` result from the given vector. + * + * @method Phaser.Math.Vector3#min + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the minimum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + min: function (v) + { + this.x = Math.min(this.x, v.x); + this.y = Math.min(this.y, v.y); + this.z = Math.min(this.z, v.z); + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.max` result from the given vector. + * + * @method Phaser.Math.Vector3#max + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the maximum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + max: function (v) + { + this.x = Math.max(this.x, v.x); + this.y = Math.max(this.y, v.y); + this.z = Math.max(this.z, v.z); + + return this; + }, + + /** + * Make a clone of this Vector3. + * + * @method Phaser.Math.Vector3#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. + */ + clone: function () + { + return new Vector3(this.x, this.y, this.z); + }, + + /** + * Adds the two given Vector3s and sets the results into this Vector3. + * + * @method Phaser.Math.Vector3#addVectors + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to add. + * @param {Phaser.Math.Vector3} b - The second Vector to add. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addVectors: function (a, b) + { + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + + return this; + }, + + /** + * Calculate the cross (vector) product of two given Vectors. + * + * @method Phaser.Math.Vector3#crossVectors + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to multiply. + * @param {Phaser.Math.Vector3} b - The second Vector to multiply. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + crossVectors: function (a, b) + { + var ax = a.x; + var ay = a.y; + var az = a.z; + var bx = b.x; + var by = b.y; + var bz = b.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @method Phaser.Math.Vector3#equals + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. + * + * @return {boolean} True if the two vectors strictly match, otherwise false. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector3#copy + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + copy: function (src) + { + this.x = src.x; + this.y = src.y; + this.z = src.z || 0; + + return this; + }, + + /** + * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. + * + * @method Phaser.Math.Vector3#set + * @since 3.0.0 + * + * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. + * @param {number} [y] - The y value to set for this Vector. + * @param {number} [z] - The z value to set for this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + set: function (x, y, z) + { + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + + return this; + }, + + /** + * Sets the components of this Vector3 from the position of the given Matrix4. + * + * @method Phaser.Math.Vector3#setFromMatrixPosition + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the position from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixPosition: function (m) + { + return this.fromArray(m.val, 12); + }, + + /** + * Sets the components of this Vector3 from the Matrix4 column specified. + * + * @method Phaser.Math.Vector3#setFromMatrixColumn + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the column from. + * @param {number} index - The column index. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixColumn: function (mat4, index) + { + return this.fromArray(mat4.val, index * 4); + }, + + /** + * Sets the components of this Vector3 from the given array, based on the offset. + * + * Vector3.x = array[offset] + * Vector3.y = array[offset + 1] + * Vector3.z = array[offset + 2] + * + * @method Phaser.Math.Vector3#fromArray + * @since 3.50.0 + * + * @param {number[]} array - The array of values to get this Vector from. + * @param {number} [offset=0] - The offset index into the array. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + fromArray: function (array, offset) + { + if (offset === undefined) { offset = 0; } + + this.x = array[offset]; + this.y = array[offset + 1]; + this.z = array[offset + 2]; + + return this; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + add: function (v) + { + this.x += v.x; + this.y += v.y; + this.z += v.z || 0; + + return this; + }, + + /** + * Add the given value to each component of this Vector. + * + * @method Phaser.Math.Vector3#addScalar + * @since 3.50.0 + * + * @param {number} s - The amount to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScalar: function (s) + { + this.x += s; + this.y += s; + this.z += s; + + return this; + }, + + /** + * Add and scale a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#addScale + * @since 3.50.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * @param {number} scale - The amount to scale `v` by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScale: function (v, scale) + { + this.x += v.x * scale; + this.y += v.y * scale; + this.z += v.z * scale || 0; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector3#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + subtract: function (v) + { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z || 0; + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + multiply: function (v) + { + this.x *= v.x; + this.y *= v.y; + this.z *= v.z || 1; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector3#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + scale: function (scale) + { + if (isFinite(scale)) + { + this.x *= scale; + this.y *= scale; + this.z *= scale; + } + else + { + this.x = 0; + this.y = 0; + this.z = 0; + } + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#divide + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + divide: function (v) + { + this.x /= v.x; + this.y /= v.y; + this.z /= v.z || 1; + + return this; + }, + + /** + * Negate the `x`, `y` and `z` components of this Vector. + * + * @method Phaser.Math.Vector3#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#distance + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return Math.sqrt(dx * dx + dy * dy + dz * dz); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector3#distanceSq + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return dx * dx + dy * dy + dz * dz; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector3#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return Math.sqrt(x * x + y * y + z * z); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector3#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return x * x + y * y + z * z; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector3#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var len = x * x + y * y + z * z; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + this.z = z * len; + } + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. + * + * @return {number} The dot product of this Vector and `v`. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z; + }, + + /** + * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. + * + * @method Phaser.Math.Vector3#cross + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector to cross product with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + cross: function (v) + { + var ax = this.x; + var ay = this.y; + var az = this.z; + var bx = v.x; + var by = v.y; + var bz = v.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector3#lerp + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + + this.x = ax + t * (v.x - ax); + this.y = ay + t * (v.y - ay); + this.z = az + t * (v.z - az); + + return this; + }, + + /** + * Takes a Matrix3 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix3 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix3} mat3 - The Matrix3 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix3: function (mat3) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat3.val; + + this.x = m[0] * x + m[3] * y + m[6] * z; + this.y = m[1] * x + m[4] * y + m[7] * z; + this.z = m[2] * x + m[5] * y + m[8] * z; + + return this; + }, + + /** + * Takes a Matrix4 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix4: function (mat4) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat4.val; + + var w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]); + + this.x = (m[0] * x + m[4] * y + m[8] * z + m[12]) * w; + this.y = (m[1] * x + m[5] * y + m[9] * z + m[13]) * w; + this.z = (m[2] * x + m[6] * y + m[10] * z + m[14]) * w; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector3#transformMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat3: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = x * m[0] + y * m[3] + z * m[6]; + this.y = x * m[1] + y * m[4] + z * m[7]; + this.z = x * m[2] + y * m[5] + z * m[8]; + + return this; + }, + + /** + * Transform this Vector with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; + this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; + this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; + + return this; + }, + + /** + * Transforms the coordinates of this Vector3 with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformCoordinates + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformCoordinates: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; + var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; + var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; + var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; + + this.x = tx / tw; + this.y = ty / tw; + this.z = tz / tw; + + return this; + }, + + /** + * Transform this Vector with the given Quaternion. + * + * @method Phaser.Math.Vector3#transformQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformQuat: function (q) + { + // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations + var x = this.x; + var y = this.y; + var z = this.z; + var qx = q.x; + var qy = q.y; + var qz = q.z; + var qw = q.w; + + // calculate quat * vec + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; + + return this; + }, + + /** + * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, + * e.g. unprojecting a 2D point into 3D space. + * + * @method Phaser.Math.Vector3#project + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + project: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var a00 = m[0]; + var a01 = m[1]; + var a02 = m[2]; + var a03 = m[3]; + var a10 = m[4]; + var a11 = m[5]; + var a12 = m[6]; + var a13 = m[7]; + var a20 = m[8]; + var a21 = m[9]; + var a22 = m[10]; + var a23 = m[11]; + var a30 = m[12]; + var a31 = m[13]; + var a32 = m[14]; + var a33 = m[15]; + + var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); + + this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; + this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; + this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; + + return this; + }, + + /** + * Multiplies this Vector3 by the given view and projection matrices. + * + * @method Phaser.Math.Vector3#projectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} viewMatrix - A View Matrix. + * @param {Phaser.Math.Matrix4} projectionMatrix - A Projection Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + projectViewMatrix: function (viewMatrix, projectionMatrix) + { + return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix); + }, + + /** + * Multiplies this Vector3 by the given inversed projection matrix and world matrix. + * + * @method Phaser.Math.Vector3#unprojectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} projectionMatrix - An inversed Projection Matrix. + * @param {Phaser.Math.Matrix4} worldMatrix - A World View Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unprojectViewMatrix: function (projectionMatrix, worldMatrix) + { + return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix); + }, + + /** + * Unproject this point from 2D space to 3D space. + * The point should have its x and y properties set to + * 2D screen space, and the z either at 0 (near plane) + * or 1 (far plane). The provided matrix is assumed to already + * be combined, i.e. projection * view * model. + * + * After this operation, this vector's (x, y, z) components will + * represent the unprojected 3D coordinate. + * + * @method Phaser.Math.Vector3#unproject + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. + * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unproject: function (viewport, invProjectionView) + { + var viewX = viewport.x; + var viewY = viewport.y; + var viewWidth = viewport.z; + var viewHeight = viewport.w; + + var x = this.x - viewX; + var y = (viewHeight - this.y - 1) - viewY; + var z = this.z; + + this.x = (2 * x) / viewWidth - 1; + this.y = (2 * y) / viewHeight - 1; + this.z = 2 * z - 1; + + return this.project(invProjectionView); + }, + + /** + * Make this Vector the zero vector (0, 0, 0). + * + * @method Phaser.Math.Vector3#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + reset: function () + { + this.x = 0; + this.y = 0; + this.z = 0; + + return this; + } + +}); + +/** + * A static zero Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ZERO + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ZERO = new Vector3(); + +/** + * A static right Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.RIGHT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.RIGHT = new Vector3(1, 0, 0); + +/** + * A static left Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.LEFT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.LEFT = new Vector3(-1, 0, 0); + +/** + * A static up Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.UP + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.UP = new Vector3(0, -1, 0); + +/** + * A static down Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.DOWN + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.DOWN = new Vector3(0, 1, 0); + +/** + * A static forward Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.FORWARD + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.FORWARD = new Vector3(0, 0, 1); + +/** + * A static back Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.BACK + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.BACK = new Vector3(0, 0, -1); + +/** + * A static one Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ONE + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ONE = new Vector3(1, 1, 1); + +module.exports = Vector3; + + +/***/ }), + +/***/ 9279: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A representation of a vector in 4D space. + * + * A four-component vector. + * + * @class Vector4 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + * @param {number} [w] - The w component. + */ +var Vector4 = new Class({ + + initialize: + + function Vector4 (x, y, z, w) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector4#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector4#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The z component of this Vector. + * + * @name Phaser.Math.Vector4#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.z = 0; + + /** + * The w component of this Vector. + * + * @name Phaser.Math.Vector4#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.w = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + this.w = x.w || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + this.w = w || 0; + } + }, + + /** + * Make a clone of this Vector4. + * + * @method Phaser.Math.Vector4#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} A clone of this Vector4. + */ + clone: function () + { + return new Vector4(this.x, this.y, this.z, this.w); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector4#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + copy: function (src) + { + this.x = src.x; + this.y = src.y; + this.z = src.z || 0; + this.w = src.w || 0; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict quality check against each Vector's components. + * + * @method Phaser.Math.Vector4#equals + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} v - The vector to check equality with. + * + * @return {boolean} A boolean indicating whether the two Vectors are equal or not. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z) && (this.w === v.w)); + }, + + /** + * Set the `x`, `y`, `z` and `w` components of the this Vector to the given `x`, `y`, `z` and `w` values. + * + * @method Phaser.Math.Vector4#set + * @since 3.0.0 + * + * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y, z and w components. + * @param {number} y - The y value to set for this Vector. + * @param {number} z - The z value to set for this Vector. + * @param {number} w - The z value to set for this Vector. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + set: function (x, y, z, w) + { + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + this.w = x.w || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + this.w = w || 0; + } + + return this; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector4#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + add: function (v) + { + this.x += v.x; + this.y += v.y; + this.z += v.z || 0; + this.w += v.w || 0; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector4#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + subtract: function (v) + { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z || 0; + this.w -= v.w || 0; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector4#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + scale: function (scale) + { + this.x *= scale; + this.y *= scale; + this.z *= scale; + this.w *= scale; + + return this; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector4#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return Math.sqrt(x * x + y * y + z * z + w * w); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector4#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return x * x + y * y + z * z + w * w; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector4#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + var len = x * x + y * y + z * z + w * w; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + this.z = z * len; + this.w = w * len; + } + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector4#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} v - The Vector4 to dot product with this Vector4. + * + * @return {number} The dot product of this Vector and the given Vector. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector4#lerp + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} v - The Vector4 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + this.x = ax + t * (v.x - ax); + this.y = ay + t * (v.y - ay); + this.z = az + t * (v.z - az); + this.w = aw + t * (v.w - aw); + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector4#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + multiply: function (v) + { + this.x *= v.x; + this.y *= v.y; + this.z *= v.z || 1; + this.w *= v.w || 1; + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector4#divide + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + divide: function (v) + { + this.x /= v.x; + this.y /= v.y; + this.z /= v.z || 1; + this.w /= v.w || 1; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector4#distance + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + var dw = v.w - this.w || 0; + + return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector4#distanceSq + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + var dw = v.w - this.w || 0; + + return dx * dx + dy * dy + dz * dz + dw * dw; + }, + + /** + * Negate the `x`, `y`, `z` and `w` components of this Vector. + * + * @method Phaser.Math.Vector4#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + this.w = -this.w; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector4#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector4 with. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + this.y = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + this.z = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + this.w = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + + return this; + }, + + /** + * Transform this Vector with the given Quaternion. + * + * @method Phaser.Math.Vector4#transformQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + transformQuat: function (q) + { + var x = this.x; + var y = this.y; + var z = this.z; + var qx = q.x; + var qy = q.y; + var qz = q.z; + var qw = q.w; + + // calculate quat * vec + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; + + return this; + }, + + /** + * Make this Vector the zero vector (0, 0, 0, 0). + * + * @method Phaser.Math.Vector4#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + reset: function () + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 0; + + return this; + } + +}); + +Vector4.prototype.sub = Vector4.prototype.subtract; +Vector4.prototype.mul = Vector4.prototype.multiply; +Vector4.prototype.div = Vector4.prototype.divide; +Vector4.prototype.dist = Vector4.prototype.distance; +Vector4.prototype.distSq = Vector4.prototype.distanceSq; +Vector4.prototype.len = Vector4.prototype.length; +Vector4.prototype.lenSq = Vector4.prototype.lengthSq; + +module.exports = Vector4; + + +/***/ }), + +/***/ 4119: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if the two values are within the given `tolerance` of each other. + * + * @function Phaser.Math.Within + * @since 3.0.0 + * + * @param {number} a - The first value to use in the calculation. + * @param {number} b - The second value to use in the calculation. + * @param {number} tolerance - The tolerance. Anything equal to or less than this value is considered as being within range. + * + * @return {boolean} Returns `true` if `a` is less than or equal to the tolerance of `b`. + */ +var Within = function (a, b, tolerance) +{ + return (Math.abs(a - b) <= tolerance); +}; + +module.exports = Within; + + +/***/ }), + +/***/ 8445: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Wrap the given `value` between `min` and `max`. + * + * @function Phaser.Math.Wrap + * @since 3.0.0 + * + * @param {number} value - The value to wrap. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. + * + * @return {number} The wrapped value. + */ +var Wrap = function (value, min, max) +{ + if (value >= min && value <= max) + { + // Skip modulo if already in range + return value; + } + + var range = max - min; + + return (min + ((((value - min) % range) + range) % range)); +}; + +module.exports = Wrap; + + +/***/ }), + +/***/ 6412: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * + * @function Phaser.Math.Angle.Between + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The angle in radians. + */ +var Between = function (x1, y1, x2, y2) +{ + return Math.atan2(y2 - y1, x2 - x1); +}; + +module.exports = Between; + + +/***/ }), + +/***/ 760: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * + * Calculates the angle of the vector from the first point to the second point. + * + * @function Phaser.Math.Angle.BetweenPoints + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} point1 - The first point. + * @param {Phaser.Types.Math.Vector2Like} point2 - The second point. + * + * @return {number} The angle in radians. + */ +var BetweenPoints = function (point1, point2) +{ + return Math.atan2(point2.y - point1.y, point2.x - point1.x); +}; + +module.exports = BetweenPoints; + + +/***/ }), + +/***/ 6909: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * + * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate + * travels down the screen. + * + * @function Phaser.Math.Angle.BetweenPointsY + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} point1 - The first point. + * @param {Phaser.Types.Math.Vector2Like} point2 - The second point. + * + * @return {number} The angle in radians. + */ +var BetweenPointsY = function (point1, point2) +{ + return Math.atan2(point2.x - point1.x, point2.y - point1.y); +}; + +module.exports = BetweenPointsY; + + +/***/ }), + +/***/ 6947: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * + * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate + * travels down the screen. + * + * @function Phaser.Math.Angle.BetweenY + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The angle in radians. + */ +var BetweenY = function (x1, y1, x2, y2) +{ + return Math.atan2(x2 - x1, y2 - y1); +}; + +module.exports = BetweenY; + + +/***/ }), + +/***/ 3426: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(7425); + +/** + * Takes an angle in Phasers default clockwise format and converts it so that + * 0 is North, 90 is West, 180 is South and 270 is East, + * therefore running counter-clockwise instead of clockwise. + * + * You can pass in the angle from a Game Object using: + * + * ```javascript + * var converted = CounterClockwise(gameobject.rotation); + * ``` + * + * All values for this function are in radians. + * + * @function Phaser.Math.Angle.CounterClockwise + * @since 3.16.0 + * + * @param {number} angle - The angle to convert, in radians. + * + * @return {number} The converted angle, in radians. + */ +var CounterClockwise = function (angle) +{ + if (angle > Math.PI) + { + angle -= CONST.PI2; + } + + return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); +}; + +module.exports = CounterClockwise; + + +/***/ }), + +/***/ 6906: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Normalize an angle to the [0, 2pi] range. + * + * @function Phaser.Math.Angle.Normalize + * @since 3.0.0 + * + * @param {number} angle - The angle to normalize, in radians. + * + * @return {number} The normalized angle, in radians. + */ +var Normalize = function (angle) +{ + angle = angle % (2 * Math.PI); + + if (angle >= 0) + { + return angle; + } + else + { + return angle + 2 * Math.PI; + } +}; + +module.exports = Normalize; + + +/***/ }), + +/***/ 3270: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @author @samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FloatBetween = __webpack_require__(104); + +/** + * Returns a random angle in the range [-pi, pi]. + * + * @function Phaser.Math.Angle.Random + * @since 3.23.0 + * + * @return {number} The angle, in radians. + */ +var Random = function () +{ + return FloatBetween(-Math.PI, Math.PI); +}; + +module.exports = Random; + + +/***/ }), + +/***/ 2748: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @author @samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FloatBetween = __webpack_require__(104); + +/** + * Returns a random angle in the range [-180, 180]. + * + * @function Phaser.Math.Angle.RandomDegrees + * @since 3.23.0 + * + * @return {number} The angle, in degrees. + */ +var RandomDegrees = function () +{ + return FloatBetween(-180, 180); +}; + +module.exports = RandomDegrees; + + +/***/ }), + +/***/ 936: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Normalize = __webpack_require__(6906); + +/** + * Reverse the given angle. + * + * @function Phaser.Math.Angle.Reverse + * @since 3.0.0 + * + * @param {number} angle - The angle to reverse, in radians. + * + * @return {number} The reversed angle, in radians. + */ +var Reverse = function (angle) +{ + return Normalize(angle + Math.PI); +}; + +module.exports = Reverse; + + +/***/ }), + +/***/ 1935: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(7425); + +/** + * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. + * + * @function Phaser.Math.Angle.RotateTo + * @since 3.0.0 + * + * @param {number} currentAngle - The current angle, in radians. + * @param {number} targetAngle - The target angle to rotate to, in radians. + * @param {number} [lerp=0.05] - The lerp value to add to the current angle. + * + * @return {number} The adjusted angle. + */ +var RotateTo = function (currentAngle, targetAngle, lerp) +{ + if (lerp === undefined) { lerp = 0.05; } + + if (currentAngle === targetAngle) + { + return currentAngle; + } + + if (Math.abs(targetAngle - currentAngle) <= lerp || Math.abs(targetAngle - currentAngle) >= (MATH_CONST.PI2 - lerp)) + { + currentAngle = targetAngle; + } + else + { + if (Math.abs(targetAngle - currentAngle) > Math.PI) + { + if (targetAngle < currentAngle) + { + targetAngle += MATH_CONST.PI2; + } + else + { + targetAngle -= MATH_CONST.PI2; + } + } + + if (targetAngle > currentAngle) + { + currentAngle += lerp; + } + else if (targetAngle < currentAngle) + { + currentAngle -= lerp; + } + } + + return currentAngle; +}; + +module.exports = RotateTo; + + +/***/ }), + +/***/ 5393: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Gets the shortest angle between `angle1` and `angle2`. + * + * Both angles must be in the range -180 to 180, which is the same clamped + * range that `sprite.angle` uses, so you can pass in two sprite angles to + * this method and get the shortest angle back between the two of them. + * + * The angle returned will be in the same range. If the returned angle is + * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's + * a clockwise rotation. + * + * @function Phaser.Math.Angle.ShortestBetween + * @since 3.0.0 + * + * @param {number} angle1 - The first angle in the range -180 to 180. + * @param {number} angle2 - The second angle in the range -180 to 180. + * + * @return {number} The shortest angle, in degrees. If greater than zero it's a counter-clockwise rotation. + */ +var ShortestBetween = function (angle1, angle2) +{ + var difference = angle2 - angle1; + + if (difference === 0) + { + return 0; + } + + var times = Math.floor((difference - (-180)) / 360); + + return difference - (times * 360); + +}; + +module.exports = ShortestBetween; + + +/***/ }), + +/***/ 3692: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MathWrap = __webpack_require__(8445); + +/** + * Wrap an angle. + * + * Wraps the angle to a value in the range of -PI to PI. + * + * @function Phaser.Math.Angle.Wrap + * @since 3.0.0 + * + * @param {number} angle - The angle to wrap, in radians. + * + * @return {number} The wrapped angle, in radians. + */ +var Wrap = function (angle) +{ + return MathWrap(angle, -Math.PI, Math.PI); +}; + +module.exports = Wrap; + + +/***/ }), + +/***/ 2820: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Wrap = __webpack_require__(8445); + +/** + * Wrap an angle in degrees. + * + * Wraps the angle to a value in the range of -180 to 180. + * + * @function Phaser.Math.Angle.WrapDegrees + * @since 3.0.0 + * + * @param {number} angle - The angle to wrap, in degrees. + * + * @return {number} The wrapped angle, in degrees. + */ +var WrapDegrees = function (angle) +{ + return Wrap(angle, -180, 180); +}; + +module.exports = WrapDegrees; + + +/***/ }), + +/***/ 1833: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Angle + */ + +module.exports = { + + Between: __webpack_require__(6412), + BetweenPoints: __webpack_require__(760), + BetweenPointsY: __webpack_require__(6909), + BetweenY: __webpack_require__(6947), + CounterClockwise: __webpack_require__(3426), + Normalize: __webpack_require__(6906), + Random: __webpack_require__(3270), + RandomDegrees: __webpack_require__(2748), + Reverse: __webpack_require__(936), + RotateTo: __webpack_require__(1935), + ShortestBetween: __webpack_require__(5393), + Wrap: __webpack_require__(3692), + WrapDegrees: __webpack_require__(2820) + +}; + + +/***/ }), + +/***/ 7425: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = { + + /** + * The value of PI * 2. + * + * @name Phaser.Math.PI2 + * @type {number} + * @since 3.0.0 + */ + PI2: Math.PI * 2, + + /** + * The value of PI * 0.5. + * + * Yes, we understand that this should actually be PI * 2, but + * it has been like this for so long we can't change it now. + * If you need PI * 2, use the PI2 constant instead. + * + * @name Phaser.Math.TAU + * @type {number} + * @since 3.0.0 + */ + TAU: Math.PI * 0.5, + + /** + * An epsilon value (1.0e-6) + * + * @name Phaser.Math.EPSILON + * @type {number} + * @since 3.0.0 + */ + EPSILON: 1.0e-6, + + /** + * For converting degrees to radians (PI / 180) + * + * @name Phaser.Math.DEG_TO_RAD + * @type {number} + * @since 3.0.0 + */ + DEG_TO_RAD: Math.PI / 180, + + /** + * For converting radians to degrees (180 / PI) + * + * @name Phaser.Math.RAD_TO_DEG + * @type {number} + * @since 3.0.0 + */ + RAD_TO_DEG: 180 / Math.PI, + + /** + * An instance of the Random Number Generator. + * This is not set until the Game boots. + * + * @name Phaser.Math.RND + * @type {Phaser.Math.RandomDataGenerator} + * @since 3.0.0 + */ + RND: null, + + /** + * The minimum safe integer this browser supports. + * We use a const for backward compatibility with Internet Explorer. + * + * @name Phaser.Math.MIN_SAFE_INTEGER + * @type {number} + * @since 3.21.0 + */ + MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER || -9007199254740991, + + /** + * The maximum safe integer this browser supports. + * We use a const for backward compatibility with Internet Explorer. + * + * @name Phaser.Math.MAX_SAFE_INTEGER + * @type {number} + * @since 3.21.0 + */ + MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER || 9007199254740991 + +}; + +module.exports = MATH_CONST; + + +/***/ }), + +/***/ 1518: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the distance between two sets of coordinates (points). + * + * @function Phaser.Math.Distance.Between + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point. + */ +var DistanceBetween = function (x1, y1, x2, y2) +{ + var dx = x1 - x2; + var dy = y1 - y2; + + return Math.sqrt(dx * dx + dy * dy); +}; + +module.exports = DistanceBetween; + + +/***/ }), + +/***/ 5372: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the distance between two points. + * + * @function Phaser.Math.Distance.BetweenPoints + * @since 3.22.0 + * + * @param {Phaser.Types.Math.Vector2Like} a - The first point. + * @param {Phaser.Types.Math.Vector2Like} b - The second point. + * + * @return {number} The distance between the points. + */ +var DistanceBetweenPoints = function (a, b) +{ + var dx = a.x - b.x; + var dy = a.y - b.y; + + return Math.sqrt(dx * dx + dy * dy); +}; + +module.exports = DistanceBetweenPoints; + + +/***/ }), + +/***/ 4430: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the squared distance between two points. + * + * @function Phaser.Math.Distance.BetweenPointsSquared + * @since 3.22.0 + * + * @param {Phaser.Types.Math.Vector2Like} a - The first point. + * @param {Phaser.Types.Math.Vector2Like} b - The second point. + * + * @return {number} The squared distance between the points. + */ +var DistanceBetweenPointsSquared = function (a, b) +{ + var dx = a.x - b.x; + var dy = a.y - b.y; + + return dx * dx + dy * dy; +}; + +module.exports = DistanceBetweenPointsSquared; + + +/***/ }), + +/***/ 4361: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the Chebyshev distance between two sets of coordinates (points). + * + * Chebyshev distance (or chessboard distance) is the maximum of the horizontal and vertical distances. + * It's the effective distance when movement can be horizontal, vertical, or diagonal. + * + * @function Phaser.Math.Distance.Chebyshev + * @since 3.22.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point. + */ +var ChebyshevDistance = function (x1, y1, x2, y2) +{ + return Math.max(Math.abs(x1 - x2), Math.abs(y1 - y2)); +}; + +module.exports = ChebyshevDistance; + + +/***/ }), + +/***/ 7798: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the distance between two sets of coordinates (points) to the power of `pow`. + * + * @function Phaser.Math.Distance.Power + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * @param {number} pow - The exponent. + * + * @return {number} The distance between each point. + */ +var DistancePower = function (x1, y1, x2, y2, pow) +{ + if (pow === undefined) { pow = 2; } + + return Math.sqrt(Math.pow(x2 - x1, pow) + Math.pow(y2 - y1, pow)); +}; + +module.exports = DistancePower; + + +/***/ }), + +/***/ 8290: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the snake distance between two sets of coordinates (points). + * + * Snake distance (rectilinear distance, Manhattan distance) is the sum of the horizontal and vertical distances. + * It's the effective distance when movement is allowed only horizontally or vertically (but not both). + * + * @function Phaser.Math.Distance.Snake + * @since 3.22.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point. + */ +var SnakeDistance = function (x1, y1, x2, y2) +{ + return Math.abs(x1 - x2) + Math.abs(y1 - y2); +}; + +module.exports = SnakeDistance; + + +/***/ }), + +/***/ 3788: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the distance between two sets of coordinates (points), squared. + * + * @function Phaser.Math.Distance.Squared + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point, squared. + */ +var DistanceSquared = function (x1, y1, x2, y2) +{ + var dx = x1 - x2; + var dy = y1 - y2; + + return dx * dx + dy * dy; +}; + +module.exports = DistanceSquared; + + +/***/ }), + +/***/ 6338: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Distance + */ + +module.exports = { + + Between: __webpack_require__(1518), + BetweenPoints: __webpack_require__(5372), + BetweenPointsSquared: __webpack_require__(4430), + Chebyshev: __webpack_require__(4361), + Power: __webpack_require__(7798), + Snake: __webpack_require__(8290), + Squared: __webpack_require__(3788) + +}; + + +/***/ }), + +/***/ 5751: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Back ease-in. + * + * @function Phaser.Math.Easing.Back.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [overshoot=1.70158] - The overshoot amount. + * + * @return {number} The tweened value. + */ +var In = function (v, overshoot) +{ + if (overshoot === undefined) { overshoot = 1.70158; } + + return v * v * ((overshoot + 1) * v - overshoot); +}; + +module.exports = In; + + +/***/ }), + +/***/ 6203: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Back ease-in/out. + * + * @function Phaser.Math.Easing.Back.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [overshoot=1.70158] - The overshoot amount. + * + * @return {number} The tweened value. + */ +var InOut = function (v, overshoot) +{ + if (overshoot === undefined) { overshoot = 1.70158; } + + var s = overshoot * 1.525; + + if ((v *= 2) < 1) + { + return 0.5 * (v * v * ((s + 1) * v - s)); + } + else + { + return 0.5 * ((v -= 2) * v * ((s + 1) * v + s) + 2); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 9103: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Back ease-out. + * + * @function Phaser.Math.Easing.Back.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [overshoot=1.70158] - The overshoot amount. + * + * @return {number} The tweened value. + */ +var Out = function (v, overshoot) +{ + if (overshoot === undefined) { overshoot = 1.70158; } + + return --v * v * ((overshoot + 1) * v + overshoot) + 1; +}; + +module.exports = Out; + + +/***/ }), + +/***/ 4938: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Back + */ + +module.exports = { + + In: __webpack_require__(5751), + Out: __webpack_require__(9103), + InOut: __webpack_require__(6203) + +}; + + +/***/ }), + +/***/ 8677: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Bounce ease-in. + * + * @function Phaser.Math.Easing.Bounce.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + v = 1 - v; + + if (v < 1 / 2.75) + { + return 1 - (7.5625 * v * v); + } + else if (v < 2 / 2.75) + { + return 1 - (7.5625 * (v -= 1.5 / 2.75) * v + 0.75); + } + else if (v < 2.5 / 2.75) + { + return 1 - (7.5625 * (v -= 2.25 / 2.75) * v + 0.9375); + } + else + { + return 1 - (7.5625 * (v -= 2.625 / 2.75) * v + 0.984375); + } +}; + +module.exports = In; + + +/***/ }), + +/***/ 4649: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Bounce ease-in/out. + * + * @function Phaser.Math.Easing.Bounce.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + var reverse = false; + + if (v < 0.5) + { + v = 1 - (v * 2); + reverse = true; + } + else + { + v = (v * 2) - 1; + } + + if (v < 1 / 2.75) + { + v = 7.5625 * v * v; + } + else if (v < 2 / 2.75) + { + v = 7.5625 * (v -= 1.5 / 2.75) * v + 0.75; + } + else if (v < 2.5 / 2.75) + { + v = 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375; + } + else + { + v = 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375; + } + + if (reverse) + { + return (1 - v) * 0.5; + } + else + { + return v * 0.5 + 0.5; + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 504: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Bounce ease-out. + * + * @function Phaser.Math.Easing.Bounce.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + if (v < 1 / 2.75) + { + return 7.5625 * v * v; + } + else if (v < 2 / 2.75) + { + return 7.5625 * (v -= 1.5 / 2.75) * v + 0.75; + } + else if (v < 2.5 / 2.75) + { + return 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375; + } + else + { + return 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375; + } +}; + +module.exports = Out; + + +/***/ }), + +/***/ 8872: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Bounce + */ + +module.exports = { + + In: __webpack_require__(8677), + Out: __webpack_require__(504), + InOut: __webpack_require__(4649) + +}; + + +/***/ }), + +/***/ 3170: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Circular ease-in. + * + * @function Phaser.Math.Easing.Circular.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return 1 - Math.sqrt(1 - v * v); +}; + +module.exports = In; + + +/***/ }), + +/***/ 2627: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Circular ease-in/out. + * + * @function Phaser.Math.Easing.Circular.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return -0.5 * (Math.sqrt(1 - v * v) - 1); + } + else + { + return 0.5 * (Math.sqrt(1 - (v -= 2) * v) + 1); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 1349: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Circular ease-out. + * + * @function Phaser.Math.Easing.Circular.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return Math.sqrt(1 - (--v * v)); +}; + +module.exports = Out; + + +/***/ }), + +/***/ 5006: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Circular + */ + +module.exports = { + + In: __webpack_require__(3170), + Out: __webpack_require__(1349), + InOut: __webpack_require__(2627) + +}; + + +/***/ }), + +/***/ 6046: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Cubic ease-in. + * + * @function Phaser.Math.Easing.Cubic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v * v; +}; + +module.exports = In; + + +/***/ }), + +/***/ 9531: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Cubic ease-in/out. + * + * @function Phaser.Math.Easing.Cubic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v * v; + } + else + { + return 0.5 * ((v -= 2) * v * v + 2); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 4836: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Cubic ease-out. + * + * @function Phaser.Math.Easing.Cubic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return --v * v * v + 1; +}; + +module.exports = Out; + + +/***/ }), + +/***/ 875: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Cubic + */ + +module.exports = { + + In: __webpack_require__(6046), + Out: __webpack_require__(4836), + InOut: __webpack_require__(9531) + +}; + + +/***/ }), + +/***/ 7619: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Elastic ease-in. + * + * @function Phaser.Math.Easing.Elastic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. + * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. + * + * @return {number} The tweened value. + */ +var In = function (v, amplitude, period) +{ + if (amplitude === undefined) { amplitude = 0.1; } + if (period === undefined) { period = 0.1; } + + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + var s = period / 4; + + if (amplitude < 1) + { + amplitude = 1; + } + else + { + s = period * Math.asin(1 / amplitude) / (2 * Math.PI); + } + + return -(amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period)); + } +}; + +module.exports = In; + + +/***/ }), + +/***/ 7437: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Elastic ease-in/out. + * + * @function Phaser.Math.Easing.Elastic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. + * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. + * + * @return {number} The tweened value. + */ +var InOut = function (v, amplitude, period) +{ + if (amplitude === undefined) { amplitude = 0.1; } + if (period === undefined) { period = 0.1; } + + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + var s = period / 4; + + if (amplitude < 1) + { + amplitude = 1; + } + else + { + s = period * Math.asin(1 / amplitude) / (2 * Math.PI); + } + + if ((v *= 2) < 1) + { + return -0.5 * (amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period)); + } + else + { + return amplitude * Math.pow(2, -10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period) * 0.5 + 1; + } + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 8119: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Elastic ease-out. + * + * @function Phaser.Math.Easing.Elastic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. + * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. + * + * @return {number} The tweened value. + */ +var Out = function (v, amplitude, period) +{ + if (amplitude === undefined) { amplitude = 0.1; } + if (period === undefined) { period = 0.1; } + + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + var s = period / 4; + + if (amplitude < 1) + { + amplitude = 1; + } + else + { + s = period * Math.asin(1 / amplitude) / (2 * Math.PI); + } + + return (amplitude * Math.pow(2, -10 * v) * Math.sin((v - s) * (2 * Math.PI) / period) + 1); + } +}; + +module.exports = Out; + + +/***/ }), + +/***/ 2884: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Elastic + */ + +module.exports = { + + In: __webpack_require__(7619), + Out: __webpack_require__(8119), + InOut: __webpack_require__(7437) + +}; + + +/***/ }), + +/***/ 5456: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Exponential ease-in. + * + * @function Phaser.Math.Easing.Expo.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return Math.pow(2, 10 * (v - 1)) - 0.001; +}; + +module.exports = In; + + +/***/ }), + +/***/ 3461: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Exponential ease-in/out. + * + * @function Phaser.Math.Easing.Expo.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * Math.pow(2, 10 * (v - 1)); + } + else + { + return 0.5 * (2 - Math.pow(2, -10 * (v - 1))); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 2711: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Exponential ease-out. + * + * @function Phaser.Math.Easing.Expo.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return 1 - Math.pow(2, -10 * v); +}; + +module.exports = Out; + + +/***/ }), + +/***/ 6287: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Expo + */ + +module.exports = { + + In: __webpack_require__(5456), + Out: __webpack_require__(2711), + InOut: __webpack_require__(3461) + +}; + + +/***/ }), + +/***/ 8613: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing + */ + +module.exports = { + + Back: __webpack_require__(4938), + Bounce: __webpack_require__(8872), + Circular: __webpack_require__(5006), + Cubic: __webpack_require__(875), + Elastic: __webpack_require__(2884), + Expo: __webpack_require__(6287), + Linear: __webpack_require__(4233), + Quadratic: __webpack_require__(6341), + Quartic: __webpack_require__(762), + Quintic: __webpack_require__(345), + Sine: __webpack_require__(8698), + Stepped: __webpack_require__(7051) + +}; + + +/***/ }), + +/***/ 744: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Linear easing (no variation). + * + * @function Phaser.Math.Easing.Linear + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Linear = function (v) +{ + return v; +}; + +module.exports = Linear; + + +/***/ }), + +/***/ 4233: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +module.exports = __webpack_require__(744); + + +/***/ }), + +/***/ 9810: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quadratic ease-in. + * + * @function Phaser.Math.Easing.Quadratic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v; +}; + +module.exports = In; + + +/***/ }), + +/***/ 8163: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quadratic ease-in/out. + * + * @function Phaser.Math.Easing.Quadratic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v; + } + else + { + return -0.5 * (--v * (v - 2) - 1); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 6123: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quadratic ease-out. + * + * @function Phaser.Math.Easing.Quadratic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return v * (2 - v); +}; + +module.exports = Out; + + +/***/ }), + +/***/ 6341: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quadratic + */ + +module.exports = { + + In: __webpack_require__(9810), + Out: __webpack_require__(6123), + InOut: __webpack_require__(8163) + +}; + + +/***/ }), + +/***/ 7337: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quartic ease-in. + * + * @function Phaser.Math.Easing.Quartic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v * v * v; +}; + +module.exports = In; + + +/***/ }), + +/***/ 4878: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quartic ease-in/out. + * + * @function Phaser.Math.Easing.Quartic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v * v * v; + } + else + { + return -0.5 * ((v -= 2) * v * v * v - 2); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 9012: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quartic ease-out. + * + * @function Phaser.Math.Easing.Quartic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return 1 - (--v * v * v * v); +}; + +module.exports = Out; + + +/***/ }), + +/***/ 762: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quartic + */ + +module.exports = { + + In: __webpack_require__(7337), + Out: __webpack_require__(9012), + InOut: __webpack_require__(4878) + +}; + + +/***/ }), + +/***/ 303: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quintic ease-in. + * + * @function Phaser.Math.Easing.Quintic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v * v * v * v; +}; + +module.exports = In; + + +/***/ }), + +/***/ 553: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quintic ease-in/out. + * + * @function Phaser.Math.Easing.Quintic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v * v * v * v; + } + else + { + return 0.5 * ((v -= 2) * v * v * v * v + 2); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 1632: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quintic ease-out. + * + * @function Phaser.Math.Easing.Quintic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return --v * v * v * v * v + 1; +}; + +module.exports = Out; + + +/***/ }), + +/***/ 345: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quintic + */ + +module.exports = { + + In: __webpack_require__(303), + Out: __webpack_require__(1632), + InOut: __webpack_require__(553) + +}; + + +/***/ }), + +/***/ 8455: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sinusoidal ease-in. + * + * @function Phaser.Math.Easing.Sine.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + return 1 - Math.cos(v * Math.PI / 2); + } +}; + +module.exports = In; + + +/***/ }), + +/***/ 1844: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sinusoidal ease-in/out. + * + * @function Phaser.Math.Easing.Sine.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + return 0.5 * (1 - Math.cos(Math.PI * v)); + } +}; + +module.exports = InOut; + + +/***/ }), + +/***/ 990: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sinusoidal ease-out. + * + * @function Phaser.Math.Easing.Sine.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + return Math.sin(v * Math.PI / 2); + } +}; + +module.exports = Out; + + +/***/ }), + +/***/ 8698: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Sine + */ + +module.exports = { + + In: __webpack_require__(8455), + Out: __webpack_require__(990), + InOut: __webpack_require__(1844) + +}; + + +/***/ }), + +/***/ 6745: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Stepped easing. + * + * @function Phaser.Math.Easing.Stepped + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [steps=1] - The number of steps in the ease. + * + * @return {number} The tweened value. + */ +var Stepped = function (v, steps) +{ + if (steps === undefined) { steps = 1; } + + if (v <= 0) + { + return 0; + } + else if (v >= 1) + { + return 1; + } + else + { + return (((steps * v) | 0) + 1) * (1 / steps); + } +}; + +module.exports = Stepped; + + +/***/ }), + +/***/ 7051: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Stepped + */ + +module.exports = __webpack_require__(6745); + + +/***/ }), + +/***/ 3158: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the fuzzy ceiling of the given value. + * + * @function Phaser.Math.Fuzzy.Ceil + * @since 3.0.0 + * + * @param {number} value - The value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {number} The fuzzy ceiling of the value. + */ +var Ceil = function (value, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return Math.ceil(value - epsilon); +}; + +module.exports = Ceil; + + +/***/ }), + +/***/ 12: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check whether the given values are fuzzily equal. + * + * Two numbers are fuzzily equal if their difference is less than `epsilon`. + * + * @function Phaser.Math.Fuzzy.Equal + * @since 3.0.0 + * + * @param {number} a - The first value. + * @param {number} b - The second value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`. + */ +var Equal = function (a, b, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return Math.abs(a - b) < epsilon; +}; + +module.exports = Equal; + + +/***/ }), + +/***/ 1326: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the fuzzy floor of the given value. + * + * @function Phaser.Math.Fuzzy.Floor + * @since 3.0.0 + * + * @param {number} value - The value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {number} The floor of the value. + */ +var Floor = function (value, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return Math.floor(value + epsilon); +}; + +module.exports = Floor; + + +/***/ }), + +/***/ 7373: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check whether `a` is fuzzily greater than `b`. + * + * `a` is fuzzily greater than `b` if it is more than `b - epsilon`. + * + * @function Phaser.Math.Fuzzy.GreaterThan + * @since 3.0.0 + * + * @param {number} a - The first value. + * @param {number} b - The second value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {boolean} `true` if `a` is fuzzily greater than than `b`, otherwise `false`. + */ +var GreaterThan = function (a, b, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return a > b - epsilon; +}; + +module.exports = GreaterThan; + + +/***/ }), + +/***/ 2622: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check whether `a` is fuzzily less than `b`. + * + * `a` is fuzzily less than `b` if it is less than `b + epsilon`. + * + * @function Phaser.Math.Fuzzy.LessThan + * @since 3.0.0 + * + * @param {number} a - The first value. + * @param {number} b - The second value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {boolean} `true` if `a` is fuzzily less than `b`, otherwise `false`. + */ +var LessThan = function (a, b, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return a < b + epsilon; +}; + +module.exports = LessThan; + + +/***/ }), + +/***/ 7927: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Fuzzy + */ + +module.exports = { + + Ceil: __webpack_require__(3158), + Equal: __webpack_require__(12), + Floor: __webpack_require__(1326), + GreaterThan: __webpack_require__(7373), + LessThan: __webpack_require__(2622) + +}; + + +/***/ }), + +/***/ 4675: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(7425); +var Extend = __webpack_require__(1030); + +/** + * @namespace Phaser.Math + */ + +var PhaserMath = { + + // Collections of functions + Angle: __webpack_require__(1833), + Distance: __webpack_require__(6338), + Easing: __webpack_require__(8613), + Fuzzy: __webpack_require__(7927), + Interpolation: __webpack_require__(2140), + Pow2: __webpack_require__(7897), + Snap: __webpack_require__(3943), + + // Expose the RNG Class + RandomDataGenerator: __webpack_require__(6957), + + // Single functions + Average: __webpack_require__(3136), + Bernstein: __webpack_require__(785), + Between: __webpack_require__(7025), + CatmullRom: __webpack_require__(48), + CeilTo: __webpack_require__(5035), + Clamp: __webpack_require__(2915), + DegToRad: __webpack_require__(7149), + Difference: __webpack_require__(2975), + Euler: __webpack_require__(2107), + Factorial: __webpack_require__(3916), + FloatBetween: __webpack_require__(104), + FloorTo: __webpack_require__(4941), + FromPercent: __webpack_require__(1555), + GetSpeed: __webpack_require__(5005), + IsEven: __webpack_require__(3702), + IsEvenStrict: __webpack_require__(8820), + Linear: __webpack_require__(1743), + LinearXY: __webpack_require__(3416), + MaxAdd: __webpack_require__(3733), + Median: __webpack_require__(44), + MinSub: __webpack_require__(5385), + Percent: __webpack_require__(8585), + RadToDeg: __webpack_require__(4208), + RandomXY: __webpack_require__(1705), + RandomXYZ: __webpack_require__(6650), + RandomXYZW: __webpack_require__(2037), + Rotate: __webpack_require__(6283), + RotateAround: __webpack_require__(9876), + RotateAroundDistance: __webpack_require__(8348), + RotateTo: __webpack_require__(4497), + RoundAwayFromZero: __webpack_require__(4078), + RoundTo: __webpack_require__(855), + SinCosTableGenerator: __webpack_require__(4936), + SmootherStep: __webpack_require__(278), + SmoothStep: __webpack_require__(2733), + ToXY: __webpack_require__(163), + TransformXY: __webpack_require__(7556), + Within: __webpack_require__(4119), + Wrap: __webpack_require__(8445), + + // Vector classes + Vector2: __webpack_require__(2529), + Vector3: __webpack_require__(5689), + Vector4: __webpack_require__(9279), + Matrix3: __webpack_require__(2149), + Matrix4: __webpack_require__(9652), + Quaternion: __webpack_require__(372), + RotateVec3: __webpack_require__(9640) + +}; + +// Merge in the consts + +PhaserMath = Extend(false, PhaserMath, CONST); + +// Export it + +module.exports = PhaserMath; + + +/***/ }), + +/***/ 1640: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bernstein = __webpack_require__(785); + +/** + * A bezier interpolation method. + * + * @function Phaser.Math.Interpolation.Bezier + * @since 3.0.0 + * + * @param {number[]} v - The input array of values to interpolate between. + * @param {number} k - The percentage of interpolation, between 0 and 1. + * + * @return {number} The interpolated value. + */ +var BezierInterpolation = function (v, k) +{ + var b = 0; + var n = v.length - 1; + + for (var i = 0; i <= n; i++) + { + b += Math.pow(1 - k, n - i) * Math.pow(k, i) * v[i] * Bernstein(n, i); + } + + return b; +}; + +module.exports = BezierInterpolation; + + +/***/ }), + +/***/ 6105: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CatmullRom = __webpack_require__(48); + +/** + * A Catmull-Rom interpolation method. + * + * @function Phaser.Math.Interpolation.CatmullRom + * @since 3.0.0 + * + * @param {number[]} v - The input array of values to interpolate between. + * @param {number} k - The percentage of interpolation, between 0 and 1. + * + * @return {number} The interpolated value. + */ +var CatmullRomInterpolation = function (v, k) +{ + var m = v.length - 1; + var f = m * k; + var i = Math.floor(f); + + if (v[0] === v[m]) + { + if (k < 0) + { + i = Math.floor(f = m * (1 + k)); + } + + return CatmullRom(f - i, v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m]); + } + else + { + if (k < 0) + { + return v[0] - (CatmullRom(-f, v[0], v[0], v[1], v[1]) - v[0]); + } + + if (k > 1) + { + return v[m] - (CatmullRom(f - m, v[m], v[m], v[m - 1], v[m - 1]) - v[m]); + } + + return CatmullRom(f - i, v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2]); + } +}; + +module.exports = CatmullRomInterpolation; + + +/***/ }), + +/***/ 4002: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @ignore + */ +function P0 (t, p) +{ + var k = 1 - t; + + return k * k * k * p; +} + +/** + * @ignore + */ +function P1 (t, p) +{ + var k = 1 - t; + + return 3 * k * k * t * p; +} + +/** + * @ignore + */ +function P2 (t, p) +{ + return 3 * (1 - t) * t * t * p; +} + +/** + * @ignore + */ +function P3 (t, p) +{ + return t * t * t * p; +} + +/** + * A cubic bezier interpolation method. + * + * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a + * + * @function Phaser.Math.Interpolation.CubicBezier + * @since 3.0.0 + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} p0 - The start point. + * @param {number} p1 - The first control point. + * @param {number} p2 - The second control point. + * @param {number} p3 - The end point. + * + * @return {number} The interpolated value. + */ +var CubicBezierInterpolation = function (t, p0, p1, p2, p3) +{ + return P0(t, p0) + P1(t, p1) + P2(t, p2) + P3(t, p3); +}; + +module.exports = CubicBezierInterpolation; + + +/***/ }), + +/***/ 6765: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Linear = __webpack_require__(1743); + +/** + * A linear interpolation method. + * + * @function Phaser.Math.Interpolation.Linear + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Linear_interpolation} + * + * @param {number[]} v - The input array of values to interpolate between. + * @param {!number} k - The percentage of interpolation, between 0 and 1. + * + * @return {!number} The interpolated value. + */ +var LinearInterpolation = function (v, k) +{ + var m = v.length - 1; + var f = m * k; + var i = Math.floor(f); + + if (k < 0) + { + return Linear(v[0], v[1], f); + } + else if (k > 1) + { + return Linear(v[m], v[m - 1], m - f); + } + else + { + return Linear(v[i], v[(i + 1 > m) ? m : i + 1], f - i); + } +}; + +module.exports = LinearInterpolation; + + +/***/ }), + +/***/ 6388: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @ignore + */ +function P0 (t, p) +{ + var k = 1 - t; + + return k * k * p; +} + +/** + * @ignore + */ +function P1 (t, p) +{ + return 2 * (1 - t) * t * p; +} + +/** + * @ignore + */ +function P2 (t, p) +{ + return t * t * p; +} + +// https://github.com/mrdoob/three.js/blob/master/src/extras/core/Interpolations.js + +/** + * A quadratic bezier interpolation method. + * + * @function Phaser.Math.Interpolation.QuadraticBezier + * @since 3.2.0 + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} p0 - The start point. + * @param {number} p1 - The control point. + * @param {number} p2 - The end point. + * + * @return {number} The interpolated value. + */ +var QuadraticBezierInterpolation = function (t, p0, p1, p2) +{ + return P0(t, p0) + P1(t, p1) + P2(t, p2); +}; + +module.exports = QuadraticBezierInterpolation; + + +/***/ }), + +/***/ 5735: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmoothStep = __webpack_require__(2733); + +/** + * A Smooth Step interpolation method. + * + * @function Phaser.Math.Interpolation.SmoothStep + * @since 3.9.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep} + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The interpolated value. + */ +var SmoothStepInterpolation = function (t, min, max) +{ + return min + (max - min) * SmoothStep(t, 0, 1); +}; + +module.exports = SmoothStepInterpolation; + + +/***/ }), + +/***/ 8705: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmootherStep = __webpack_require__(278); + +/** + * A Smoother Step interpolation method. + * + * @function Phaser.Math.Interpolation.SmootherStep + * @since 3.9.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The interpolated value. + */ +var SmootherStepInterpolation = function (t, min, max) +{ + return min + (max - min) * SmootherStep(t, 0, 1); +}; + +module.exports = SmootherStepInterpolation; + + +/***/ }), + +/***/ 2140: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Interpolation + */ + +module.exports = { + + Bezier: __webpack_require__(1640), + CatmullRom: __webpack_require__(6105), + CubicBezier: __webpack_require__(4002), + Linear: __webpack_require__(6765), + QuadraticBezier: __webpack_require__(6388), + SmoothStep: __webpack_require__(5735), + SmootherStep: __webpack_require__(8705) + +}; + + +/***/ }), + +/***/ 5443: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns the nearest power of 2 to the given `value`. + * + * @function Phaser.Math.Pow2.GetNext + * @since 3.0.0 + * + * @param {number} value - The value. + * + * @return {number} The nearest power of 2 to `value`. + */ +var GetPowerOfTwo = function (value) +{ + var index = Math.log(value) / 0.6931471805599453; + + return (1 << Math.ceil(index)); +}; + +module.exports = GetPowerOfTwo; + + +/***/ }), + +/***/ 725: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if the given `width` and `height` are a power of two. + * Useful for checking texture dimensions. + * + * @function Phaser.Math.Pow2.IsSize + * @since 3.0.0 + * + * @param {number} width - The width. + * @param {number} height - The height. + * + * @return {boolean} `true` if `width` and `height` are a power of two, otherwise `false`. + */ +var IsSizePowerOfTwo = function (width, height) +{ + return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0); +}; + +module.exports = IsSizePowerOfTwo; + + +/***/ }), + +/***/ 167: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Tests the value and returns `true` if it is a power of two. + * + * @function Phaser.Math.Pow2.IsValue + * @since 3.0.0 + * + * @param {number} value - The value to check if it's a power of two. + * + * @return {boolean} Returns `true` if `value` is a power of two, otherwise `false`. + */ +var IsValuePowerOfTwo = function (value) +{ + return (value > 0 && (value & (value - 1)) === 0); +}; + +module.exports = IsValuePowerOfTwo; + + +/***/ }), + +/***/ 7897: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Pow2 + */ + +module.exports = { + + GetNext: __webpack_require__(5443), + IsSize: __webpack_require__(725), + IsValue: __webpack_require__(167) + +}; + + +/***/ }), + +/***/ 6957: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A seeded Random Data Generator. + * + * Access via `Phaser.Math.RND` which is an instance of this class pre-defined + * by Phaser. Or, create your own instance to use as you require. + * + * The `Math.RND` generator is seeded by the Game Config property value `seed`. + * If no such config property exists, a random number is used. + * + * If you create your own instance of this class you should provide a seed for it. + * If no seed is given it will use a 'random' one based on Date.now. + * + * @class RandomDataGenerator + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {(string|string[])} [seeds] - The seeds to use for the random number generator. + */ +var RandomDataGenerator = new Class({ + + initialize: + + function RandomDataGenerator (seeds) + { + if (seeds === undefined) { seeds = [ (Date.now() * Math.random()).toString() ]; } + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#c + * @type {number} + * @default 1 + * @private + * @since 3.0.0 + */ + this.c = 1; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#s0 + * @type {number} + * @default 0 + * @private + * @since 3.0.0 + */ + this.s0 = 0; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#s1 + * @type {number} + * @default 0 + * @private + * @since 3.0.0 + */ + this.s1 = 0; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#s2 + * @type {number} + * @default 0 + * @private + * @since 3.0.0 + */ + this.s2 = 0; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#n + * @type {number} + * @default 0 + * @private + * @since 3.2.0 + */ + this.n = 0; + + /** + * Signs to choose from. + * + * @name Phaser.Math.RandomDataGenerator#signs + * @type {number[]} + * @since 3.0.0 + */ + this.signs = [ -1, 1 ]; + + if (seeds) + { + this.init(seeds); + } + }, + + /** + * Private random helper. + * + * @method Phaser.Math.RandomDataGenerator#rnd + * @since 3.0.0 + * @private + * + * @return {number} A random number. + */ + rnd: function () + { + var t = 2091639 * this.s0 + this.c * 2.3283064365386963e-10; // 2^-32 + + this.c = t | 0; + this.s0 = this.s1; + this.s1 = this.s2; + this.s2 = t - this.c; + + return this.s2; + }, + + /** + * Internal method that creates a seed hash. + * + * @method Phaser.Math.RandomDataGenerator#hash + * @since 3.0.0 + * @private + * + * @param {string} data - The value to hash. + * + * @return {number} The hashed value. + */ + hash: function (data) + { + var h; + var n = this.n; + + data = data.toString(); + + for (var i = 0; i < data.length; i++) + { + n += data.charCodeAt(i); + h = 0.02519603282416938 * n; + n = h >>> 0; + h -= n; + h *= n; + n = h >>> 0; + h -= n; + n += h * 0x100000000;// 2^32 + } + + this.n = n; + + return (n >>> 0) * 2.3283064365386963e-10;// 2^-32 + }, + + /** + * Initialize the state of the random data generator. + * + * @method Phaser.Math.RandomDataGenerator#init + * @since 3.0.0 + * + * @param {(string|string[])} seeds - The seeds to initialize the random data generator with. + */ + init: function (seeds) + { + if (typeof seeds === 'string') + { + this.state(seeds); + } + else + { + this.sow(seeds); + } + }, + + /** + * Reset the seed of the random data generator. + * + * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present. + * + * @method Phaser.Math.RandomDataGenerator#sow + * @since 3.0.0 + * + * @param {string[]} seeds - The array of seeds: the `toString()` of each value is used. + */ + sow: function (seeds) + { + // Always reset to default seed + this.n = 0xefc8249d; + this.s0 = this.hash(' '); + this.s1 = this.hash(' '); + this.s2 = this.hash(' '); + this.c = 1; + + if (!seeds) + { + return; + } + + // Apply any seeds + for (var i = 0; i < seeds.length && (seeds[i] != null); i++) + { + var seed = seeds[i]; + + this.s0 -= this.hash(seed); + this.s0 += ~~(this.s0 < 0); + this.s1 -= this.hash(seed); + this.s1 += ~~(this.s1 < 0); + this.s2 -= this.hash(seed); + this.s2 += ~~(this.s2 < 0); + } + }, + + /** + * Returns a random integer between 0 and 2^32. + * + * @method Phaser.Math.RandomDataGenerator#integer + * @since 3.0.0 + * + * @return {number} A random integer between 0 and 2^32. + */ + integer: function () + { + // 2^32 + return this.rnd() * 0x100000000; + }, + + /** + * Returns a random real number between 0 and 1. + * + * @method Phaser.Math.RandomDataGenerator#frac + * @since 3.0.0 + * + * @return {number} A random real number between 0 and 1. + */ + frac: function () + { + // 2^-53 + return this.rnd() + (this.rnd() * 0x200000 | 0) * 1.1102230246251565e-16; + }, + + /** + * Returns a random real number between 0 and 2^32. + * + * @method Phaser.Math.RandomDataGenerator#real + * @since 3.0.0 + * + * @return {number} A random real number between 0 and 2^32. + */ + real: function () + { + return this.integer() + this.frac(); + }, + + /** + * Returns a random integer between and including min and max. + * + * @method Phaser.Math.RandomDataGenerator#integerInRange + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random number between min and max. + */ + integerInRange: function (min, max) + { + return Math.floor(this.realInRange(0, max - min + 1) + min); + }, + + /** + * Returns a random integer between and including min and max. + * This method is an alias for RandomDataGenerator.integerInRange. + * + * @method Phaser.Math.RandomDataGenerator#between + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random number between min and max. + */ + between: function (min, max) + { + return Math.floor(this.realInRange(0, max - min + 1) + min); + }, + + /** + * Returns a random real number between min and max. + * + * @method Phaser.Math.RandomDataGenerator#realInRange + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random number between min and max. + */ + realInRange: function (min, max) + { + return this.frac() * (max - min) + min; + }, + + /** + * Returns a random real number between -1 and 1. + * + * @method Phaser.Math.RandomDataGenerator#normal + * @since 3.0.0 + * + * @return {number} A random real number between -1 and 1. + */ + normal: function () + { + return 1 - (2 * this.frac()); + }, + + /** + * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368 + * + * @method Phaser.Math.RandomDataGenerator#uuid + * @since 3.0.0 + * + * @return {string} A valid RFC4122 version4 ID hex string + */ + uuid: function () + { + var a = ''; + var b = ''; + + for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-') + { + // eslint-disable-next-line no-empty + } + + return b; + }, + + /** + * Returns a random element from within the given array. + * + * @method Phaser.Math.RandomDataGenerator#pick + * @since 3.0.0 + * + * @generic T + * @genericUse {T[]} - [array] + * @genericUse {T} - [$return] + * + * @param {T[]} array - The array to pick a random element from. + * + * @return {T} A random member of the array. + */ + pick: function (array) + { + return array[this.integerInRange(0, array.length - 1)]; + }, + + /** + * Returns a sign to be used with multiplication operator. + * + * @method Phaser.Math.RandomDataGenerator#sign + * @since 3.0.0 + * + * @return {number} -1 or +1. + */ + sign: function () + { + return this.pick(this.signs); + }, + + /** + * Returns a random element from within the given array, favoring the earlier entries. + * + * @method Phaser.Math.RandomDataGenerator#weightedPick + * @since 3.0.0 + * + * @generic T + * @genericUse {T[]} - [array] + * @genericUse {T} - [$return] + * + * @param {T[]} array - The array to pick a random element from. + * + * @return {T} A random member of the array. + */ + weightedPick: function (array) + { + return array[~~(Math.pow(this.frac(), 2) * (array.length - 1) + 0.5)]; + }, + + /** + * Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified. + * + * @method Phaser.Math.RandomDataGenerator#timestamp + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random timestamp between min and max. + */ + timestamp: function (min, max) + { + return this.realInRange(min || 946684800000, max || 1577862000000); + }, + + /** + * Returns a random angle between -180 and 180. + * + * @method Phaser.Math.RandomDataGenerator#angle + * @since 3.0.0 + * + * @return {number} A random number between -180 and 180. + */ + angle: function () + { + return this.integerInRange(-180, 180); + }, + + /** + * Returns a random rotation in radians, between -3.141 and 3.141 + * + * @method Phaser.Math.RandomDataGenerator#rotation + * @since 3.0.0 + * + * @return {number} A random number between -3.141 and 3.141 + */ + rotation: function () + { + return this.realInRange(-3.1415926, 3.1415926); + }, + + /** + * Gets or Sets the state of the generator. This allows you to retain the values + * that the generator is using between games, i.e. in a game save file. + * + * To seed this generator with a previously saved state you can pass it as the + * `seed` value in your game config, or call this method directly after Phaser has booted. + * + * Call this method with no parameters to return the current state. + * + * If providing a state it should match the same format that this method + * returns, which is a string with a header `!rnd` followed by the `c`, + * `s0`, `s1` and `s2` values respectively, each comma-delimited. + * + * @method Phaser.Math.RandomDataGenerator#state + * @since 3.0.0 + * + * @param {string} [state] - Generator state to be set. + * + * @return {string} The current state of the generator. + */ + state: function (state) + { + if (typeof state === 'string' && state.match(/^!rnd/)) + { + state = state.split(','); + + this.c = parseFloat(state[1]); + this.s0 = parseFloat(state[2]); + this.s1 = parseFloat(state[3]); + this.s2 = parseFloat(state[4]); + } + + return [ '!rnd', this.c, this.s0, this.s1, this.s2 ].join(','); + }, + + /** + * Shuffles the given array, using the current seed. + * + * @method Phaser.Math.RandomDataGenerator#shuffle + * @since 3.7.0 + * + * @generic T + * @genericUse {T[]} - [array,$return] + * + * @param {T[]} [array] - The array to be shuffled. + * + * @return {T[]} The shuffled array. + */ + shuffle: function (array) + { + var len = array.length - 1; + + for (var i = len; i > 0; i--) + { + var randomIndex = Math.floor(this.frac() * (i + 1)); + var itemAtIndex = array[randomIndex]; + + array[randomIndex] = array[i]; + array[i] = itemAtIndex; + } + + return array; + } + +}); + +module.exports = RandomDataGenerator; + + +/***/ }), + +/***/ 5659: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using ceil. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`. + * As will `14` snap to `15`... but `16` will snap to `20`. + * + * @function Phaser.Math.Snap.Ceil + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapCeil = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.ceil(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapCeil; + + +/***/ }), + +/***/ 5461: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using floor. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`. + * As will `14` snap to `10`... but `16` will snap to `15`. + * + * @function Phaser.Math.Snap.Floor + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapFloor = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.floor(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapFloor; + + +/***/ }), + +/***/ 5131: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using rounding. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10` whereas `14` will snap to `15`. + * + * @function Phaser.Math.Snap.To + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapTo = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.round(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapTo; + + +/***/ }), + +/***/ 3943: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Snap + */ + +module.exports = { + + Ceil: __webpack_require__(5659), + Floor: __webpack_require__(5461), + To: __webpack_require__(5131) + +}; + + +/***/ }), + +/***/ 8666: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** +* @author Richard Davey +* @copyright 2013-2023 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ + +var Class = __webpack_require__(7473); + +/** + * @classdesc + * A Global Plugin is installed just once into the Game owned Plugin Manager. + * It can listen for Game events and respond to them. + * + * @class BasePlugin + * @memberof Phaser.Plugins + * @constructor + * @since 3.8.0 + * + * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager. + */ +var BasePlugin = new Class({ + + initialize: + + function BasePlugin (pluginManager) + { + /** + * A handy reference to the Plugin Manager that is responsible for this plugin. + * Can be used as a route to gain access to game systems and events. + * + * @name Phaser.Plugins.BasePlugin#pluginManager + * @type {Phaser.Plugins.PluginManager} + * @protected + * @since 3.8.0 + */ + this.pluginManager = pluginManager; + + /** + * A reference to the Game instance this plugin is running under. + * + * @name Phaser.Plugins.BasePlugin#game + * @type {Phaser.Game} + * @protected + * @since 3.8.0 + */ + this.game = pluginManager.game; + }, + + /** + * The PluginManager calls this method on a Global Plugin when the plugin is first instantiated. + * It will never be called again on this instance. + * In here you can set-up whatever you need for this plugin to run. + * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this. + * On a Scene Plugin, this method is never called. Use {@link Phaser.Plugins.ScenePlugin#boot} instead. + * + * @method Phaser.Plugins.BasePlugin#init + * @since 3.8.0 + * + * @param {?any} [data] - A value specified by the user, if any, from the `data` property of the plugin's configuration object (if started at game boot) or passed in the PluginManager's `install` method (if started manually). + */ + init: function () + { + }, + + /** + * The PluginManager calls this method on a Global Plugin when the plugin is started. + * If a plugin is stopped, and then started again, this will get called again. + * Typically called immediately after `BasePlugin.init`. + * On a Scene Plugin, this method is never called. + * + * @method Phaser.Plugins.BasePlugin#start + * @since 3.8.0 + */ + start: function () + { + // Here are the game-level events you can listen to. + // At the very least you should offer a destroy handler for when the game closes down. + + // var eventEmitter = this.game.events; + + // eventEmitter.once('destroy', this.gameDestroy, this); + // eventEmitter.on('pause', this.gamePause, this); + // eventEmitter.on('resume', this.gameResume, this); + // eventEmitter.on('resize', this.gameResize, this); + // eventEmitter.on('prestep', this.gamePreStep, this); + // eventEmitter.on('step', this.gameStep, this); + // eventEmitter.on('poststep', this.gamePostStep, this); + // eventEmitter.on('prerender', this.gamePreRender, this); + // eventEmitter.on('postrender', this.gamePostRender, this); + }, + + /** + * The PluginManager calls this method on a Global Plugin when the plugin is stopped. + * The game code has requested that your plugin stop doing whatever it does. + * It is now considered as 'inactive' by the PluginManager. + * Handle that process here (i.e. stop listening for events, etc) + * If the plugin is started again then `BasePlugin.start` will be called again. + * On a Scene Plugin, this method is never called. + * + * @method Phaser.Plugins.BasePlugin#stop + * @since 3.8.0 + */ + stop: function () + { + }, + + /** + * Game instance has been destroyed. + * You must release everything in here, all references, all objects, free it all up. + * + * @method Phaser.Plugins.BasePlugin#destroy + * @since 3.8.0 + */ + destroy: function () + { + this.pluginManager = null; + this.game = null; + this.scene = null; + this.systems = null; + } + +}); + +module.exports = BasePlugin; + + +/***/ }), + +/***/ 8456: +/***/ ((module) => { /** * @author Richard Davey @@ -47448,328 +48092,152 @@ module.exports = PluginCache; /***/ }), -/* 330 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 5722: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ +* @author Richard Davey +* @copyright 2013-2023 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ -var Class = __webpack_require__(0); +var BasePlugin = __webpack_require__(8666); +var Class = __webpack_require__(7473); +var SceneEvents = __webpack_require__(204); /** * @classdesc - * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect - * a visible pixel from the geometry mask. The mask is essentially a clipping path which can only - * make a masked pixel fully visible or fully invisible without changing its alpha (opacity). + * A Scene Level Plugin is installed into every Scene and belongs to that Scene. + * It can listen for Scene events and respond to them. + * It can map itself to a Scene property, or into the Scene Systems, or both. * - * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) - * should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed - * if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and - * alpha of the pixel from the Geometry Mask do not matter. - * - * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. - * Moving or transforming the underlying Graphics object will change the mask (and affect the visibility - * of any masked objects), whereas moving or transforming a masked object will not affect the mask. - * You can think of the Geometry Mask (or rather, of its Graphics object) as an invisible curtain placed - * in front of all masked objects which has its own visual properties and, naturally, respects the camera's - * visual properties, but isn't affected by and doesn't follow the masked objects by itself. - * - * @class GeometryMask - * @memberof Phaser.Display.Masks + * @class ScenePlugin + * @memberof Phaser.Plugins + * @extends Phaser.Plugins.BasePlugin * @constructor - * @since 3.0.0 + * @since 3.8.0 * - * @param {Phaser.Scene} scene - This parameter is not used. - * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List. + * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin. + * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager. + * @param {string} pluginKey - The key under which this plugin has been installed into the Scene Systems. */ -var GeometryMask = new Class({ +var ScenePlugin = new Class({ + + Extends: BasePlugin, initialize: - function GeometryMask (scene, graphicsGeometry) + function ScenePlugin (scene, pluginManager, pluginKey) { - /** - * The Graphics object which describes the Geometry Mask. - * - * @name Phaser.Display.Masks.GeometryMask#geometryMask - * @type {Phaser.GameObjects.Graphics} - * @since 3.0.0 - */ - this.geometryMask = graphicsGeometry; + BasePlugin.call(this, pluginManager); /** - * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels - * drawn to the Geometry Mask. + * A reference to the Scene that has installed this plugin. + * Only set if it's a Scene Plugin, otherwise `null`. + * This property is only set when the plugin is instantiated and added to the Scene, not before. + * You can use it during the `boot` method. * - * This is a WebGL only feature. - * - * @name Phaser.Display.Masks.GeometryMask#invertAlpha - * @type {boolean} - * @since 3.16.0 + * @name Phaser.Plugins.ScenePlugin#scene + * @type {?Phaser.Scene} + * @protected + * @since 3.8.0 */ - this.invertAlpha = false; + this.scene = scene; /** - * Is this mask a stencil mask? + * A reference to the Scene Systems of the Scene that has installed this plugin. + * Only set if it's a Scene Plugin, otherwise `null`. + * This property is only set when the plugin is instantiated and added to the Scene, not before. + * You can use it during the `boot` method. * - * @name Phaser.Display.Masks.GeometryMask#isStencil - * @type {boolean} + * @name Phaser.Plugins.ScenePlugin#systems + * @type {?Phaser.Scenes.Systems} + * @protected + * @since 3.8.0 + */ + this.systems = scene.sys; + + /** + * The key under which this plugin was installed into the Scene Systems. + * + * This property is only set when the plugin is instantiated and added to the Scene, not before. + * You can use it during the `boot` method. + * + * @name Phaser.Plugins.ScenePlugin#pluginKey + * @type {string} * @readonly - * @since 3.17.0 + * @since 3.54.0 */ - this.isStencil = true; + this.pluginKey = pluginKey; - /** - * The current stencil level. - * - * @name Phaser.Display.Masks.GeometryMask#level - * @type {boolean} - * @private - * @since 3.17.0 - */ - this.level = 0; + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); }, /** - * Sets a new Graphics object for the Geometry Mask. + * This method is called when the Scene boots. It is only ever called once. * - * @method Phaser.Display.Masks.GeometryMask#setShape - * @since 3.0.0 + * By this point the plugin properties `scene` and `systems` will have already been set. * - * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. + * In here you can listen for {@link Phaser.Scenes.Events Scene events} and set-up whatever you need for this plugin to run. + * Here are the Scene events you can listen to: * - * @return {this} This Geometry Mask + * - start + * - ready + * - preupdate + * - update + * - postupdate + * - resize + * - pause + * - resume + * - sleep + * - wake + * - transitioninit + * - transitionstart + * - transitioncomplete + * - transitionout + * - shutdown + * - destroy + * + * At the very least you should offer a destroy handler for when the Scene closes down, i.e: + * + * ```javascript + * var eventEmitter = this.systems.events; + * eventEmitter.once('destroy', this.sceneDestroy, this); + * ``` + * + * @method Phaser.Plugins.ScenePlugin#boot + * @since 3.8.0 */ - setShape: function (graphicsGeometry) + boot: function () { - this.geometryMask = graphicsGeometry; - - return this; }, /** - * Sets the `invertAlpha` property of this Geometry Mask. + * Game instance has been destroyed. * - * Inverting the alpha essentially flips the way the mask works. + * You must release everything in here, all references, all objects, free it all up. * - * This is a WebGL only feature. - * - * @method Phaser.Display.Masks.GeometryMask#setInvertAlpha - * @since 3.17.0 - * - * @param {boolean} [value=true] - Invert the alpha of this mask? - * - * @return {this} This Geometry Mask - */ - setInvertAlpha: function (value) - { - if (value === undefined) { value = true; } - - this.invertAlpha = value; - - return this; - }, - - /** - * Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask. - * - * @method Phaser.Display.Masks.GeometryMask#preRenderWebGL - * @since 3.0.0 - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. - * @param {Phaser.GameObjects.GameObject} child - The Game Object being rendered. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. - */ - preRenderWebGL: function (renderer, child, camera) - { - var gl = renderer.gl; - - // Force flushing before drawing to stencil buffer - renderer.flush(); - - if (renderer.maskStack.length === 0) - { - gl.enable(gl.STENCIL_TEST); - gl.clear(gl.STENCIL_BUFFER_BIT); - - renderer.maskCount = 0; - } - - if (renderer.currentCameraMask.mask !== this) - { - renderer.currentMask.mask = this; - } - - renderer.maskStack.push({ mask: this, camera: camera }); - - this.applyStencil(renderer, camera, true); - - renderer.maskCount++; - }, - - /** - * Applies the current stencil mask to the renderer. - * - * @method Phaser.Display.Masks.GeometryMask#applyStencil - * @since 3.17.0 - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. - * @param {boolean} inc - Is this an INCR stencil or a DECR stencil? - */ - applyStencil: function (renderer, camera, inc) - { - var gl = renderer.gl; - var geometryMask = this.geometryMask; - var level = renderer.maskCount; - - gl.colorMask(false, false, false, false); - - if (inc) - { - gl.stencilFunc(gl.EQUAL, level, 0xFF); - gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL, level + 1, 0xFF); - gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR); - } - - // Write stencil buffer - geometryMask.renderWebGL(renderer, geometryMask, camera); - - renderer.flush(); - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); - - if (inc) - { - if (this.invertAlpha) - { - gl.stencilFunc(gl.NOTEQUAL, level + 1, 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL, level + 1, 0xFF); - } - } - else if (this.invertAlpha) - { - gl.stencilFunc(gl.NOTEQUAL, level, 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL, level, 0xFF); - } - }, - - /** - * Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it. - * - * @method Phaser.Display.Masks.GeometryMask#postRenderWebGL - * @since 3.0.0 - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw flush. - */ - postRenderWebGL: function (renderer) - { - var gl = renderer.gl; - - renderer.maskStack.pop(); - - renderer.maskCount--; - - // Force flush before disabling stencil test - renderer.flush(); - - var current = renderer.currentMask; - - if (renderer.maskStack.length === 0) - { - // If this is the only mask in the stack, flush and disable - current.mask = null; - - gl.disable(gl.STENCIL_TEST); - } - else - { - var prev = renderer.maskStack[renderer.maskStack.length - 1]; - - prev.mask.applyStencil(renderer, prev.camera, false); - - if (renderer.currentCameraMask.mask !== prev.mask) - { - current.mask = prev.mask; - current.camera = prev.camera; - } - else - { - current.mask = null; - } - } - }, - - /** - * Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object. - * - * @method Phaser.Display.Masks.GeometryMask#preRenderCanvas - * @since 3.0.0 - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance to set the clipping path on. - * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. - */ - preRenderCanvas: function (renderer, mask, camera) - { - var geometryMask = this.geometryMask; - - renderer.currentContext.save(); - - geometryMask.renderCanvas(renderer, geometryMask, camera, null, null, true); - - renderer.currentContext.clip(); - }, - - /** - * Restore the canvas context's previous clipping path, thus turning off the mask for it. - * - * @method Phaser.Display.Masks.GeometryMask#postRenderCanvas - * @since 3.0.0 - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance being restored. - */ - postRenderCanvas: function (renderer) - { - renderer.currentContext.restore(); - }, - - /** - * Destroys this GeometryMask and nulls any references it holds. - * - * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, - * so be sure to call `clearMask` on any Game Object using it, before destroying it. - * - * @method Phaser.Display.Masks.GeometryMask#destroy - * @since 3.7.0 + * @method Phaser.Plugins.ScenePlugin#destroy + * @since 3.8.0 */ destroy: function () { - this.geometryMask = null; + this.pluginManager = null; + this.game = null; + this.scene = null; + this.systems = null; } }); -module.exports = GeometryMask; +module.exports = ScenePlugin; /***/ }), -/* 331 */ -/***/ (function(module, exports) { + +/***/ 8351: +/***/ ((module) => { /** * @author Richard Davey @@ -47778,201 +48246,338 @@ module.exports = GeometryMask; */ /** - * Provides methods used for getting and setting the origin of a Game Object. - * Values are normalized, given in the range 0 to 1. - * Display values contain the calculated pixel values. - * Should be applied as a mixin and not used directly. + * Phaser Blend Modes. * - * @namespace Phaser.GameObjects.Components.Origin + * @namespace Phaser.BlendModes * @since 3.0.0 */ -var Origin = { +module.exports = { /** - * A property indicating that a Game Object has this component. + * Skips the Blend Mode check in the renderer. * - * @name Phaser.GameObjects.Components.Origin#_originComponent - * @type {boolean} - * @private - * @default true - * @since 3.2.0 - */ - _originComponent: true, - - /** - * The horizontal origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the left of the Game Object. - * - * @name Phaser.GameObjects.Components.Origin#originX + * @name Phaser.BlendModes.SKIP_CHECK * @type {number} - * @default 0.5 + * @const * @since 3.0.0 */ - originX: 0.5, + SKIP_CHECK: -1, /** - * The vertical origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the top of the Game Object. + * Normal blend mode. For Canvas and WebGL. + * This is the default setting and draws new shapes on top of the existing canvas content. * - * @name Phaser.GameObjects.Components.Origin#originY + * @name Phaser.BlendModes.NORMAL * @type {number} - * @default 0.5 + * @const * @since 3.0.0 */ - originY: 0.5, - - // private + read only - _displayOriginX: 0, - _displayOriginY: 0, + NORMAL: 0, /** - * The horizontal display origin of this Game Object. - * The origin is a normalized value between 0 and 1. - * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + * Add blend mode. For Canvas and WebGL. + * Where both shapes overlap the color is determined by adding color values. * - * @name Phaser.GameObjects.Components.Origin#displayOriginX + * @name Phaser.BlendModes.ADD * @type {number} + * @const * @since 3.0.0 */ - displayOriginX: { - - get: function () - { - return this._displayOriginX; - }, - - set: function (value) - { - this._displayOriginX = value; - this.originX = value / this.width; - } - - }, + ADD: 1, /** - * The vertical display origin of this Game Object. - * The origin is a normalized value between 0 and 1. - * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + * Multiply blend mode. For Canvas and WebGL. + * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. * - * @name Phaser.GameObjects.Components.Origin#displayOriginY + * @name Phaser.BlendModes.MULTIPLY * @type {number} + * @const * @since 3.0.0 */ - displayOriginY: { - - get: function () - { - return this._displayOriginY; - }, - - set: function (value) - { - this._displayOriginY = value; - this.originY = value / this.height; - } - - }, + MULTIPLY: 2, /** - * Sets the origin of this Game Object. + * Screen blend mode. For Canvas and WebGL. + * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) * - * The values are given in the range 0 to 1. - * - * @method Phaser.GameObjects.Components.Origin#setOrigin + * @name Phaser.BlendModes.SCREEN + * @type {number} + * @const * @since 3.0.0 - * - * @param {number} [x=0.5] - The horizontal origin value. - * @param {number} [y=x] - The vertical origin value. If not defined it will be set to the value of `x`. - * - * @return {this} This Game Object instance. */ - setOrigin: function (x, y) - { - if (x === undefined) { x = 0.5; } - if (y === undefined) { y = x; } - - this.originX = x; - this.originY = y; - - return this.updateDisplayOrigin(); - }, + SCREEN: 3, /** - * Sets the origin of this Game Object based on the Pivot values in its Frame. + * Overlay blend mode. For Canvas only. + * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. * - * @method Phaser.GameObjects.Components.Origin#setOriginFromFrame + * @name Phaser.BlendModes.OVERLAY + * @type {number} + * @const * @since 3.0.0 - * - * @return {this} This Game Object instance. */ - setOriginFromFrame: function () - { - if (!this.frame || !this.frame.customPivot) - { - return this.setOrigin(); - } - else - { - this.originX = this.frame.pivotX; - this.originY = this.frame.pivotY; - } - - return this.updateDisplayOrigin(); - }, + OVERLAY: 4, /** - * Sets the display origin of this Game Object. - * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * Darken blend mode. For Canvas only. + * Retains the darkest pixels of both layers. * - * @method Phaser.GameObjects.Components.Origin#setDisplayOrigin + * @name Phaser.BlendModes.DARKEN + * @type {number} + * @const * @since 3.0.0 - * - * @param {number} [x=0] - The horizontal display origin value. - * @param {number} [y=x] - The vertical display origin value. If not defined it will be set to the value of `x`. - * - * @return {this} This Game Object instance. */ - setDisplayOrigin: function (x, y) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = x; } - - this.displayOriginX = x; - this.displayOriginY = y; - - return this; - }, + DARKEN: 5, /** - * Updates the Display Origin cached values internally stored on this Game Object. - * You don't usually call this directly, but it is exposed for edge-cases where you may. + * Lighten blend mode. For Canvas only. + * Retains the lightest pixels of both layers. * - * @method Phaser.GameObjects.Components.Origin#updateDisplayOrigin + * @name Phaser.BlendModes.LIGHTEN + * @type {number} + * @const * @since 3.0.0 - * - * @return {this} This Game Object instance. */ - updateDisplayOrigin: function () - { - this._displayOriginX = this.originX * this.width; - this._displayOriginY = this.originY * this.height; + LIGHTEN: 6, - return this; - } + /** + * Color Dodge blend mode. For Canvas only. + * Divides the bottom layer by the inverted top layer. + * + * @name Phaser.BlendModes.COLOR_DODGE + * @type {number} + * @const + * @since 3.0.0 + */ + COLOR_DODGE: 7, + + /** + * Color Burn blend mode. For Canvas only. + * Divides the inverted bottom layer by the top layer, and then inverts the result. + * + * @name Phaser.BlendModes.COLOR_BURN + * @type {number} + * @const + * @since 3.0.0 + */ + COLOR_BURN: 8, + + /** + * Hard Light blend mode. For Canvas only. + * A combination of multiply and screen like overlay, but with top and bottom layer swapped. + * + * @name Phaser.BlendModes.HARD_LIGHT + * @type {number} + * @const + * @since 3.0.0 + */ + HARD_LIGHT: 9, + + /** + * Soft Light blend mode. For Canvas only. + * A softer version of hard-light. Pure black or white does not result in pure black or white. + * + * @name Phaser.BlendModes.SOFT_LIGHT + * @type {number} + * @const + * @since 3.0.0 + */ + SOFT_LIGHT: 10, + + /** + * Difference blend mode. For Canvas only. + * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. + * + * @name Phaser.BlendModes.DIFFERENCE + * @type {number} + * @const + * @since 3.0.0 + */ + DIFFERENCE: 11, + + /** + * Exclusion blend mode. For Canvas only. + * Like difference, but with lower contrast. + * + * @name Phaser.BlendModes.EXCLUSION + * @type {number} + * @const + * @since 3.0.0 + */ + EXCLUSION: 12, + + /** + * Hue blend mode. For Canvas only. + * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. + * + * @name Phaser.BlendModes.HUE + * @type {number} + * @const + * @since 3.0.0 + */ + HUE: 13, + + /** + * Saturation blend mode. For Canvas only. + * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. + * + * @name Phaser.BlendModes.SATURATION + * @type {number} + * @const + * @since 3.0.0 + */ + SATURATION: 14, + + /** + * Color blend mode. For Canvas only. + * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. + * + * @name Phaser.BlendModes.COLOR + * @type {number} + * @const + * @since 3.0.0 + */ + COLOR: 15, + + /** + * Luminosity blend mode. For Canvas only. + * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. + * + * @name Phaser.BlendModes.LUMINOSITY + * @type {number} + * @const + * @since 3.0.0 + */ + LUMINOSITY: 16, + + /** + * Alpha erase blend mode. For Canvas and WebGL. + * + * @name Phaser.BlendModes.ERASE + * @type {number} + * @const + * @since 3.0.0 + */ + ERASE: 17, + + /** + * Source-in blend mode. For Canvas only. + * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. + * + * @name Phaser.BlendModes.SOURCE_IN + * @type {number} + * @const + * @since 3.0.0 + */ + SOURCE_IN: 18, + + /** + * Source-out blend mode. For Canvas only. + * The new shape is drawn where it doesn't overlap the existing canvas content. + * + * @name Phaser.BlendModes.SOURCE_OUT + * @type {number} + * @const + * @since 3.0.0 + */ + SOURCE_OUT: 19, + + /** + * Source-out blend mode. For Canvas only. + * The new shape is only drawn where it overlaps the existing canvas content. + * + * @name Phaser.BlendModes.SOURCE_ATOP + * @type {number} + * @const + * @since 3.0.0 + */ + SOURCE_ATOP: 20, + + /** + * Destination-over blend mode. For Canvas only. + * New shapes are drawn behind the existing canvas content. + * + * @name Phaser.BlendModes.DESTINATION_OVER + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_OVER: 21, + + /** + * Destination-in blend mode. For Canvas only. + * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. + * + * @name Phaser.BlendModes.DESTINATION_IN + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_IN: 22, + + /** + * Destination-out blend mode. For Canvas only. + * The existing content is kept where it doesn't overlap the new shape. + * + * @name Phaser.BlendModes.DESTINATION_OUT + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_OUT: 23, + + /** + * Destination-out blend mode. For Canvas only. + * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. + * + * @name Phaser.BlendModes.DESTINATION_ATOP + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_ATOP: 24, + + /** + * Lighten blend mode. For Canvas only. + * Where both shapes overlap the color is determined by adding color values. + * + * @name Phaser.BlendModes.LIGHTER + * @type {number} + * @const + * @since 3.0.0 + */ + LIGHTER: 25, + + /** + * Copy blend mode. For Canvas only. + * Only the new shape is shown. + * + * @name Phaser.BlendModes.COPY + * @type {number} + * @const + * @since 3.0.0 + */ + COPY: 26, + + /** + * Xor blend mode. For Canvas only. + * Shapes are made transparent where both overlap and drawn normal everywhere else. + * + * @name Phaser.BlendModes.XOR + * @type {number} + * @const + * @since 3.0.0 + */ + XOR: 27 }; -module.exports = Origin; - /***/ }), -/* 332 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8196: +/***/ ((module) => { /** * @author Richard Davey @@ -47980,428 +48585,1727 @@ module.exports = Origin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DegToRad = __webpack_require__(21); -var GetBoolean = __webpack_require__(333); -var GetValue = __webpack_require__(8); -var TWEEN_CONST = __webpack_require__(334); -var Vector2 = __webpack_require__(3); - /** - * Provides methods used for managing a Game Object following a Path. - * Should be applied as a mixin and not used directly. + * Phaser Scale Modes. * - * @namespace Phaser.GameObjects.Components.PathFollower - * @since 3.17.0 + * @namespace Phaser.ScaleModes + * @since 3.0.0 */ -var PathFollower = { +var ScaleModes = { /** - * The Path this PathFollower is following. It can only follow one Path at a time. + * Default Scale Mode (Linear). * - * @name Phaser.GameObjects.Components.PathFollower#path - * @type {Phaser.Curves.Path} - * @since 3.0.0 - */ - path: null, - - /** - * Should the PathFollower automatically rotate to point in the direction of the Path? - * - * @name Phaser.GameObjects.Components.PathFollower#rotateToPath - * @type {boolean} - * @default false - * @since 3.0.0 - */ - rotateToPath: false, - - /** - * If the PathFollower is rotating to match the Path (@see Phaser.GameObjects.PathFollower#rotateToPath) - * this value is added to the rotation value. This allows you to rotate objects to a path but control - * the angle of the rotation as well. - * - * @name Phaser.GameObjects.PathFollower#pathRotationOffset + * @name Phaser.ScaleModes.DEFAULT * @type {number} - * @default 0 + * @readonly * @since 3.0.0 */ - pathRotationOffset: 0, + DEFAULT: 0, /** - * An additional vector to add to the PathFollowers position, allowing you to offset it from the - * Path coordinates. + * Linear Scale Mode. * - * @name Phaser.GameObjects.PathFollower#pathOffset - * @type {Phaser.Math.Vector2} - * @since 3.0.0 - */ - pathOffset: null, - - /** - * A Vector2 that stores the current point of the path the follower is on. - * - * @name Phaser.GameObjects.PathFollower#pathVector - * @type {Phaser.Math.Vector2} - * @since 3.0.0 - */ - pathVector: null, - - /** - * The distance the follower has traveled from the previous point to the current one, at the last update. - * - * @name Phaser.GameObjects.PathFollower#pathDelta - * @type {Phaser.Math.Vector2} - * @since 3.23.0 - */ - pathDelta: null, - - /** - * The Tween used for following the Path. - * - * @name Phaser.GameObjects.PathFollower#pathTween - * @type {Phaser.Tweens.Tween} - * @since 3.0.0 - */ - pathTween: null, - - /** - * Settings for the PathFollower. - * - * @name Phaser.GameObjects.PathFollower#pathConfig - * @type {?Phaser.Types.GameObjects.PathFollower.PathConfig} - * @default null - * @since 3.0.0 - */ - pathConfig: null, - - /** - * Records the direction of the follower so it can change direction. - * - * @name Phaser.GameObjects.PathFollower#_prevDirection + * @name Phaser.ScaleModes.LINEAR * @type {number} - * @private + * @readonly * @since 3.0.0 */ - _prevDirection: TWEEN_CONST.PLAYING_FORWARD, + LINEAR: 0, /** - * Set the Path that this PathFollower should follow. + * Nearest Scale Mode. * - * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings. - * - * @method Phaser.GameObjects.Components.PathFollower#setPath + * @name Phaser.ScaleModes.NEAREST + * @type {number} + * @readonly * @since 3.0.0 - * - * @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time. - * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config] - Settings for the PathFollower. - * - * @return {this} This Game Object. */ - setPath: function (path, config) - { - if (config === undefined) { config = this.pathConfig; } - - var tween = this.pathTween; - - if (tween && tween.isPlaying()) - { - tween.stop(); - } - - this.path = path; - - if (config) - { - this.startFollow(config); - } - - return this; - }, - - /** - * Set whether the PathFollower should automatically rotate to point in the direction of the Path. - * - * @method Phaser.GameObjects.Components.PathFollower#setRotateToPath - * @since 3.0.0 - * - * @param {boolean} value - Whether the PathFollower should automatically rotate to point in the direction of the Path. - * @param {number} [offset=0] - Rotation offset in degrees. - * - * @return {this} This Game Object. - */ - setRotateToPath: function (value, offset) - { - if (offset === undefined) { offset = 0; } - - this.rotateToPath = value; - - this.pathRotationOffset = offset; - - return this; - }, - - /** - * Is this PathFollower actively following a Path or not? - * - * To be considered as `isFollowing` it must be currently moving on a Path, and not paused. - * - * @method Phaser.GameObjects.Components.PathFollower#isFollowing - * @since 3.0.0 - * - * @return {boolean} `true` is this PathFollower is actively following a Path, otherwise `false`. - */ - isFollowing: function () - { - var tween = this.pathTween; - - return (tween && tween.isPlaying()); - }, - - /** - * Starts this PathFollower following its given Path. - * - * @method Phaser.GameObjects.Components.PathFollower#startFollow - * @since 3.3.0 - * - * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config={}] - The duration of the follow, or a PathFollower config object. - * @param {number} [startAt=0] - Optional start position of the follow, between 0 and 1. - * - * @return {this} This Game Object. - */ - startFollow: function (config, startAt) - { - if (config === undefined) { config = {}; } - if (startAt === undefined) { startAt = 0; } - - var tween = this.pathTween; - - if (tween && tween.isPlaying()) - { - tween.stop(); - } - - if (typeof config === 'number') - { - config = { duration: config }; - } - - // Override in case they've been specified in the config - config.from = GetValue(config, 'from', 0); - config.to = GetValue(config, 'to', 1); - - var positionOnPath = GetBoolean(config, 'positionOnPath', false); - - this.rotateToPath = GetBoolean(config, 'rotateToPath', false); - this.pathRotationOffset = GetValue(config, 'rotationOffset', 0); - - // This works, but it's not an ideal way of doing it as the follower jumps position - var seek = GetValue(config, 'startAt', startAt); - - if (seek) - { - config.onStart = function (tween) - { - var tweenData = tween.data[0]; - tweenData.progress = seek; - tweenData.elapsed = tweenData.duration * seek; - var v = tweenData.ease(tweenData.progress); - tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); - tweenData.setTargetValue(); - }; - } - - if (!this.pathOffset) - { - this.pathOffset = new Vector2(this.x, this.y); - } - - if (!this.pathVector) - { - this.pathVector = new Vector2(); - } - - if (!this.pathDelta) - { - this.pathDelta = new Vector2(); - } - - this.pathDelta.reset(); - - config.persist = true; - - this.pathTween = this.scene.sys.tweens.addCounter(config); - - // The starting point of the path, relative to this follower - this.path.getStartPoint(this.pathOffset); - - if (positionOnPath) - { - this.x = this.pathOffset.x; - this.y = this.pathOffset.y; - } - - this.pathOffset.x = this.x - this.pathOffset.x; - this.pathOffset.y = this.y - this.pathOffset.y; - - this._prevDirection = TWEEN_CONST.PLAYING_FORWARD; - - if (this.rotateToPath) - { - // Set the rotation now (in case the tween has a delay on it, etc) - var nextPoint = this.path.getPoint(0.1); - - this.rotation = Math.atan2(nextPoint.y - this.y, nextPoint.x - this.x) + DegToRad(this.pathRotationOffset); - } - - this.pathConfig = config; - - return this; - }, - - /** - * Pauses this PathFollower. It will still continue to render, but it will remain motionless at the - * point on the Path at which you paused it. - * - * @method Phaser.GameObjects.Components.PathFollower#pauseFollow - * @since 3.3.0 - * - * @return {this} This Game Object. - */ - pauseFollow: function () - { - var tween = this.pathTween; - - if (tween && tween.isPlaying()) - { - tween.pause(); - } - - return this; - }, - - /** - * Resumes a previously paused PathFollower. - * - * If the PathFollower was not paused this has no effect. - * - * @method Phaser.GameObjects.Components.PathFollower#resumeFollow - * @since 3.3.0 - * - * @return {this} This Game Object. - */ - resumeFollow: function () - { - var tween = this.pathTween; - - if (tween && tween.isPaused()) - { - tween.resume(); - } - - return this; - }, - - /** - * Stops this PathFollower from following the path any longer. - * - * This will invoke any 'stop' conditions that may exist on the Path, or for the follower. - * - * @method Phaser.GameObjects.Components.PathFollower#stopFollow - * @since 3.3.0 - * - * @return {this} This Game Object. - */ - stopFollow: function () - { - var tween = this.pathTween; - - if (tween && tween.isPlaying()) - { - tween.stop(); - } - - return this; - }, - - /** - * Internal update handler that advances this PathFollower along the path. - * - * Called automatically by the Scene step, should not typically be called directly. - * - * @method Phaser.GameObjects.Components.PathFollower#pathUpdate - * @since 3.17.0 - */ - pathUpdate: function () - { - var tween = this.pathTween; - - if (tween) - { - var tweenData = tween.data[0]; - var pathDelta = this.pathDelta; - var pathVector = this.pathVector; - - pathDelta.copy(pathVector).negate(); - - if (tweenData.state === TWEEN_CONST.COMPLETE) - { - this.path.getPoint(tweenData.end, pathVector); - - pathDelta.add(pathVector); - pathVector.add(this.pathOffset); - - this.setPosition(pathVector.x, pathVector.y); - - return; - } - else if (tweenData.state !== TWEEN_CONST.PLAYING_FORWARD && tweenData.state !== TWEEN_CONST.PLAYING_BACKWARD) - { - // If delayed, etc then bail out - return; - } - - this.path.getPoint(tween.getValue(), pathVector); - - pathDelta.add(pathVector); - pathVector.add(this.pathOffset); - - var oldX = this.x; - var oldY = this.y; - - this.setPosition(pathVector.x, pathVector.y); - - var speedX = this.x - oldX; - var speedY = this.y - oldY; - - if (speedX === 0 && speedY === 0) - { - // Bail out early - return; - } - - if (tweenData.state !== this._prevDirection) - { - // We've changed direction, so don't do a rotate this frame - this._prevDirection = tweenData.state; - - return; - } - - if (this.rotateToPath) - { - this.rotation = Math.atan2(speedY, speedX) + DegToRad(this.pathRotationOffset); - } - } - } + NEAREST: 1 }; -module.exports = PathFollower; +module.exports = ScaleModes; /***/ }), -/* 333 */ -/***/ (function(module, exports) { + +/***/ 3527: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scale Manager Resize Event. + * + * This event is dispatched whenever the Scale Manager detects a resize event from the browser. + * It sends three parameters to the callback, each of them being Size components. You can read + * the `width`, `height`, `aspectRatio` and other properties of these components to help with + * scaling your own game content. + * + * @event Phaser.Scale.Events#RESIZE + * @type {string} + * @since 3.16.1 + * + * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas. + * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size. + * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode. + * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width. + * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height. + */ +module.exports = 'resize'; + + +/***/ }), + +/***/ 8618: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Added to Scene Event. + * + * This event is dispatched when a Game Object is added to a Scene. + * + * Listen for it from a Scene using `this.events.on('addedtoscene', listener)`. + * + * @event Phaser.Scenes.Events#ADDED_TO_SCENE + * @type {string} + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene. + * @param {Phaser.Scene} scene - The Scene to which the Game Object was added. + */ +module.exports = 'addedtoscene'; + + +/***/ }), + +/***/ 4328: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Boot Event. + * + * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins. + * + * Listen to it from a Scene using `this.events.on('boot', listener)`. + * + * @event Phaser.Scenes.Events#BOOT + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + */ +module.exports = 'boot'; + + +/***/ }), + +/***/ 6099: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Create Event. + * + * This event is dispatched by a Scene after it has been created by the Scene Manager. + * + * If a Scene has a `create` method then this event is emitted _after_ that has run. + * + * If there is a transition, this event will be fired after the `TRANSITION_START` event. + * + * Listen to it from a Scene using `this.events.on('create', listener)`. + * + * @event Phaser.Scenes.Events#CREATE + * @type {string} + * @since 3.17.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event. + */ +module.exports = 'create'; + + +/***/ }), + +/***/ 7645: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Destroy Event. + * + * This event is dispatched by a Scene during the Scene Systems destroy process. + * + * Listen to it from a Scene using `this.events.on('destroy', listener)`. + * + * You should destroy any resources that may be in use by your Scene in this event handler. + * + * @event Phaser.Scenes.Events#DESTROY + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + */ +module.exports = 'destroy'; + + +/***/ }), + +/***/ 2710: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Pause Event. + * + * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an + * action from another Scene. + * + * Listen to it from a Scene using `this.events.on('pause', listener)`. + * + * @event Phaser.Scenes.Events#PAUSE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was paused. + */ +module.exports = 'pause'; + + +/***/ }), + +/***/ 2547: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Post Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('postupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#POST_UPDATE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'postupdate'; + + +/***/ }), + +/***/ 8577: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Pre-Render Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to this event from a Scene using `this.events.on('prerender', listener)`. + * + * A Scene will only render if it is visible. + * + * This event is dispatched after the Scene Display List is sorted and before the Scene is rendered. + * + * @event Phaser.Scenes.Events#PRE_RENDER + * @type {string} + * @since 3.53.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. + */ +module.exports = 'prerender'; + + +/***/ }), + +/***/ 8197: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Pre Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('preupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#PRE_UPDATE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'preupdate'; + + +/***/ }), + +/***/ 8997: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Ready Event. + * + * This event is dispatched by a Scene during the Scene Systems start process. + * By this point in the process the Scene is now fully active and rendering. + * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event. + * + * Listen to it from a Scene using `this.events.on('ready', listener)`. + * + * @event Phaser.Scenes.Events#READY + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was started. + */ +module.exports = 'ready'; + + +/***/ }), + +/***/ 7604: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Removed from Scene Event. + * + * This event is dispatched when a Game Object is removed from a Scene. + * + * Listen for it from a Scene using `this.events.on('removedfromscene', listener)`. + * + * @event Phaser.Scenes.Events#REMOVED_FROM_SCENE + * @type {string} + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene. + * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed. + */ +module.exports = 'removedfromscene'; + + +/***/ }), + +/***/ 8999: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Render Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('render', listener)`. + * + * A Scene will only render if it is visible. + * + * By the time this event is dispatched, the Scene will have already been rendered. + * + * @event Phaser.Scenes.Events#RENDER + * @type {string} + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. + */ +module.exports = 'render'; + + +/***/ }), + +/***/ 9742: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Resume Event. + * + * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.events.on('resume', listener)`. + * + * @event Phaser.Scenes.Events#RESUME + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was resumed. + */ +module.exports = 'resume'; + + +/***/ }), + +/***/ 3667: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Shutdown Event. + * + * This event is dispatched by a Scene during the Scene Systems shutdown process. + * + * Listen to it from a Scene using `this.events.on('shutdown', listener)`. + * + * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding + * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not + * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources. + * + * @event Phaser.Scenes.Events#SHUTDOWN + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was shutdown. + */ +module.exports = 'shutdown'; + + +/***/ }), + +/***/ 3468: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Sleep Event. + * + * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.events.on('sleep', listener)`. + * + * @event Phaser.Scenes.Events#SLEEP + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was sent to sleep. + */ +module.exports = 'sleep'; + + +/***/ }), + +/***/ 7840: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Start Event. + * + * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins. + * + * Listen to it from a Scene using `this.events.on('start', listener)`. + * + * @event Phaser.Scenes.Events#START + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + */ +module.exports = 'start'; + + +/***/ }), + +/***/ 9896: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Complete Event. + * + * This event is dispatched by the Target Scene of a transition. + * + * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration + * of the transition. + * + * Listen to it from a Scene using `this.events.on('transitioncomplete', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_COMPLETE + * @type {string} + * @since 3.5.0 + * + * @param {Phaser.Scene} scene -The Scene on which the transitioned completed. + */ +module.exports = 'transitioncomplete'; + + +/***/ }), + +/***/ 5103: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Init Event. + * + * This event is dispatched by the Target Scene of a transition. + * + * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method, + * this event is not dispatched. + * + * Listen to it from a Scene using `this.events.on('transitioninit', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_INIT + * @type {string} + * @since 3.5.0 + * + * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitioninit'; + + +/***/ }), + +/***/ 3162: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Out Event. + * + * This event is dispatched by a Scene when it initiates a transition to another Scene. + * + * Listen to it from a Scene using `this.events.on('transitionout', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_OUT + * @type {string} + * @since 3.5.0 + * + * @param {Phaser.Scene} target - A reference to the Scene that is being transitioned to. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitionout'; + + +/***/ }), + +/***/ 7841: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Start Event. + * + * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep. + * + * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method, + * this event is dispatched anyway. + * + * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is + * dispatched instead of this event. + * + * Listen to it from a Scene using `this.events.on('transitionstart', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_START + * @type {string} + * @since 3.5.0 + * + * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitionstart'; + + +/***/ }), + +/***/ 6454: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Wake Event. + * + * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before + * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead. + * + * Listen to it from a Scene using `this.events.on('transitionwake', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_WAKE + * @type {string} + * @since 3.5.0 + * + * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitionwake'; + + +/***/ }), + +/***/ 6536: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists and the Scene is in a Running state, otherwise this is skipped. + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('update', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#UPDATE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'update'; + + +/***/ }), + +/***/ 3875: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Wake Event. + * + * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.events.on('wake', listener)`. + * + * @event Phaser.Scenes.Events#WAKE + * @type {string} + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was woken up. + */ +module.exports = 'wake'; + + +/***/ }), + +/***/ 204: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Scenes.Events + */ + +module.exports = { + + ADDED_TO_SCENE: __webpack_require__(8618), + BOOT: __webpack_require__(4328), + CREATE: __webpack_require__(6099), + DESTROY: __webpack_require__(7645), + PAUSE: __webpack_require__(2710), + POST_UPDATE: __webpack_require__(2547), + PRE_RENDER: __webpack_require__(8577), + PRE_UPDATE: __webpack_require__(8197), + READY: __webpack_require__(8997), + REMOVED_FROM_SCENE: __webpack_require__(7604), + RENDER: __webpack_require__(8999), + RESUME: __webpack_require__(9742), + SHUTDOWN: __webpack_require__(3667), + SLEEP: __webpack_require__(3468), + START: __webpack_require__(7840), + TRANSITION_COMPLETE: __webpack_require__(9896), + TRANSITION_INIT: __webpack_require__(5103), + TRANSITION_OUT: __webpack_require__(3162), + TRANSITION_START: __webpack_require__(7841), + TRANSITION_WAKE: __webpack_require__(6454), + UPDATE: __webpack_require__(6536), + WAKE: __webpack_require__(3875) + +}; + + +/***/ }), + +/***/ 2362: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(7473); +var Clamp = __webpack_require__(2915); +var Extend = __webpack_require__(1030); + +/** + * @classdesc + * A Frame is a section of a Texture. + * + * @class Frame + * @memberof Phaser.Textures + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Textures.Texture} texture - The Texture this Frame is a part of. + * @param {(number|string)} name - The name of this Frame. The name is unique within the Texture. + * @param {number} sourceIndex - The index of the TextureSource that this Frame is a part of. + * @param {number} x - The x coordinate of the top-left of this Frame. + * @param {number} y - The y coordinate of the top-left of this Frame. + * @param {number} width - The width of this Frame. + * @param {number} height - The height of this Frame. + */ +var Frame = new Class({ + + initialize: + + function Frame (texture, name, sourceIndex, x, y, width, height) + { + /** + * The Texture this Frame is a part of. + * + * @name Phaser.Textures.Frame#texture + * @type {Phaser.Textures.Texture} + * @since 3.0.0 + */ + this.texture = texture; + + /** + * The name of this Frame. + * The name is unique within the Texture. + * + * @name Phaser.Textures.Frame#name + * @type {string} + * @since 3.0.0 + */ + this.name = name; + + /** + * The TextureSource this Frame is part of. + * + * @name Phaser.Textures.Frame#source + * @type {Phaser.Textures.TextureSource} + * @since 3.0.0 + */ + this.source = texture.source[sourceIndex]; + + /** + * The index of the TextureSource in the Texture sources array. + * + * @name Phaser.Textures.Frame#sourceIndex + * @type {number} + * @since 3.0.0 + */ + this.sourceIndex = sourceIndex; + + /** + * A reference to the Texture Source WebGL Texture that this Frame is using. + * + * @name Phaser.Textures.Frame#glTexture + * @type {?WebGLTexture} + * @default null + * @since 3.11.0 + */ + this.glTexture = this.source.glTexture; + + /** + * X position within the source image to cut from. + * + * @name Phaser.Textures.Frame#cutX + * @type {number} + * @since 3.0.0 + */ + this.cutX; + + /** + * Y position within the source image to cut from. + * + * @name Phaser.Textures.Frame#cutY + * @type {number} + * @since 3.0.0 + */ + this.cutY; + + /** + * The width of the area in the source image to cut. + * + * @name Phaser.Textures.Frame#cutWidth + * @type {number} + * @since 3.0.0 + */ + this.cutWidth; + + /** + * The height of the area in the source image to cut. + * + * @name Phaser.Textures.Frame#cutHeight + * @type {number} + * @since 3.0.0 + */ + this.cutHeight; + + /** + * The X rendering offset of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The Y rendering offset of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The rendering width of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#width + * @type {number} + * @since 3.0.0 + */ + this.width; + + /** + * The rendering height of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#height + * @type {number} + * @since 3.0.0 + */ + this.height; + + /** + * Half the width, floored. + * Precalculated for the renderer. + * + * @name Phaser.Textures.Frame#halfWidth + * @type {number} + * @since 3.0.0 + */ + this.halfWidth; + + /** + * Half the height, floored. + * Precalculated for the renderer. + * + * @name Phaser.Textures.Frame#halfHeight + * @type {number} + * @since 3.0.0 + */ + this.halfHeight; + + /** + * The x center of this frame, floored. + * + * @name Phaser.Textures.Frame#centerX + * @type {number} + * @since 3.0.0 + */ + this.centerX; + + /** + * The y center of this frame, floored. + * + * @name Phaser.Textures.Frame#centerY + * @type {number} + * @since 3.0.0 + */ + this.centerY; + + /** + * The horizontal pivot point of this Frame. + * + * @name Phaser.Textures.Frame#pivotX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.pivotX = 0; + + /** + * The vertical pivot point of this Frame. + * + * @name Phaser.Textures.Frame#pivotY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.pivotY = 0; + + /** + * Does this Frame have a custom pivot point? + * + * @name Phaser.Textures.Frame#customPivot + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.customPivot = false; + + /** + * **CURRENTLY UNSUPPORTED** + * + * Is this frame is rotated or not in the Texture? + * Rotation allows you to use rotated frames in texture atlas packing. + * It has nothing to do with Sprite rotation. + * + * @name Phaser.Textures.Frame#rotated + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.rotated = false; + + /** + * Over-rides the Renderer setting. + * -1 = use Renderer Setting + * 0 = No rounding + * 1 = Round + * + * @name Phaser.Textures.Frame#autoRound + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.autoRound = -1; + + /** + * Any Frame specific custom data can be stored here. + * + * @name Phaser.Textures.Frame#customData + * @type {object} + * @since 3.0.0 + */ + this.customData = {}; + + /** + * WebGL UV u0 value. + * + * @name Phaser.Textures.Frame#u0 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.u0 = 0; + + /** + * WebGL UV v0 value. + * + * @name Phaser.Textures.Frame#v0 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.v0 = 0; + + /** + * WebGL UV u1 value. + * + * @name Phaser.Textures.Frame#u1 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.u1 = 0; + + /** + * WebGL UV v1 value. + * + * @name Phaser.Textures.Frame#v1 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.v1 = 0; + + /** + * The un-modified source frame, trim and UV data. + * + * @name Phaser.Textures.Frame#data + * @type {object} + * @private + * @since 3.0.0 + */ + this.data = { + cut: { + x: 0, + y: 0, + w: 0, + h: 0, + r: 0, + b: 0 + }, + trim: false, + sourceSize: { + w: 0, + h: 0 + }, + spriteSourceSize: { + x: 0, + y: 0, + w: 0, + h: 0, + r: 0, + b: 0 + }, + radius: 0, + drawImage: { + x: 0, + y: 0, + width: 0, + height: 0 + } + }; + + this.setSize(width, height, x, y); + }, + + /** + * Sets the width, height, x and y of this Frame. + * + * This is called automatically by the constructor + * and should rarely be changed on-the-fly. + * + * @method Phaser.Textures.Frame#setSize + * @since 3.7.0 + * + * @param {number} width - The width of the frame before being trimmed. + * @param {number} height - The height of the frame before being trimmed. + * @param {number} [x=0] - The x coordinate of the top-left of this Frame. + * @param {number} [y=0] - The y coordinate of the top-left of this Frame. + * + * @return {this} This Frame object. + */ + setSize: function (width, height, x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + this.cutX = x; + this.cutY = y; + this.cutWidth = width; + this.cutHeight = height; + + this.width = width; + this.height = height; + + this.halfWidth = Math.floor(width * 0.5); + this.halfHeight = Math.floor(height * 0.5); + + this.centerX = Math.floor(width / 2); + this.centerY = Math.floor(height / 2); + + var data = this.data; + var cut = data.cut; + + cut.x = x; + cut.y = y; + cut.w = width; + cut.h = height; + cut.r = x + width; + cut.b = y + height; + + data.sourceSize.w = width; + data.sourceSize.h = height; + + data.spriteSourceSize.w = width; + data.spriteSourceSize.h = height; + + data.radius = 0.5 * Math.sqrt(width * width + height * height); + + var drawImage = data.drawImage; + + drawImage.x = x; + drawImage.y = y; + drawImage.width = width; + drawImage.height = height; + + return this.updateUVs(); + }, + + /** + * If the frame was trimmed when added to the Texture Atlas, this records the trim and source data. + * + * @method Phaser.Textures.Frame#setTrim + * @since 3.0.0 + * + * @param {number} actualWidth - The width of the frame before being trimmed. + * @param {number} actualHeight - The height of the frame before being trimmed. + * @param {number} destX - The destination X position of the trimmed frame for display. + * @param {number} destY - The destination Y position of the trimmed frame for display. + * @param {number} destWidth - The destination width of the trimmed frame for display. + * @param {number} destHeight - The destination height of the trimmed frame for display. + * + * @return {this} This Frame object. + */ + setTrim: function (actualWidth, actualHeight, destX, destY, destWidth, destHeight) + { + var data = this.data; + var ss = data.spriteSourceSize; + + // Store actual values + + data.trim = true; + + data.sourceSize.w = actualWidth; + data.sourceSize.h = actualHeight; + + ss.x = destX; + ss.y = destY; + ss.w = destWidth; + ss.h = destHeight; + ss.r = destX + destWidth; + ss.b = destY + destHeight; + + // Adjust properties + this.x = destX; + this.y = destY; + + this.width = destWidth; + this.height = destHeight; + + this.halfWidth = destWidth * 0.5; + this.halfHeight = destHeight * 0.5; + + this.centerX = Math.floor(destWidth / 2); + this.centerY = Math.floor(destHeight / 2); + + return this.updateUVs(); + }, + + /** + * Takes a crop data object and, based on the rectangular region given, calculates the + * required UV coordinates in order to crop this Frame for WebGL and Canvas rendering. + * + * This is called directly by the Game Object Texture Components `setCrop` method. + * Please use that method to crop a Game Object. + * + * @method Phaser.Textures.Frame#setCropUVs + * @since 3.11.0 + * + * @param {object} crop - The crop data object. This is the `GameObject._crop` property. + * @param {number} x - The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. + * @param {number} y - The y coordinate to start the crop from. Cannot be negative or exceed the Frame height. + * @param {number} width - The width of the crop rectangle. Cannot exceed the Frame width. + * @param {number} height - The height of the crop rectangle. Cannot exceed the Frame height. + * @param {boolean} flipX - Does the parent Game Object have flipX set? + * @param {boolean} flipY - Does the parent Game Object have flipY set? + * + * @return {object} The updated crop data object. + */ + setCropUVs: function (crop, x, y, width, height, flipX, flipY) + { + // Clamp the input values + + var cx = this.cutX; + var cy = this.cutY; + var cw = this.cutWidth; + var ch = this.cutHeight; + var rw = this.realWidth; + var rh = this.realHeight; + + x = Clamp(x, 0, rw); + y = Clamp(y, 0, rh); + + width = Clamp(width, 0, rw - x); + height = Clamp(height, 0, rh - y); + + var ox = cx + x; + var oy = cy + y; + var ow = width; + var oh = height; + + var data = this.data; + + if (data.trim) + { + var ss = data.spriteSourceSize; + + // Need to check for intersection between the cut area and the crop area + // If there is none, we set UV to be empty, otherwise set it to be the intersection area + + width = Clamp(width, 0, cw - x); + height = Clamp(height, 0, ch - y); + + var cropRight = x + width; + var cropBottom = y + height; + + var intersects = !(ss.r < x || ss.b < y || ss.x > cropRight || ss.y > cropBottom); + + if (intersects) + { + var ix = Math.max(ss.x, x); + var iy = Math.max(ss.y, y); + var iw = Math.min(ss.r, cropRight) - ix; + var ih = Math.min(ss.b, cropBottom) - iy; + + ow = iw; + oh = ih; + + if (flipX) + { + ox = cx + (cw - (ix - ss.x) - iw); + } + else + { + ox = cx + (ix - ss.x); + } + + if (flipY) + { + oy = cy + (ch - (iy - ss.y) - ih); + } + else + { + oy = cy + (iy - ss.y); + } + + x = ix; + y = iy; + + width = iw; + height = ih; + } + else + { + ox = 0; + oy = 0; + ow = 0; + oh = 0; + } + } + else + { + if (flipX) + { + ox = cx + (cw - x - width); + } + + if (flipY) + { + oy = cy + (ch - y - height); + } + } + + var tw = this.source.width; + var th = this.source.height; + + // Map the given coordinates into UV space, clamping to the 0-1 range. + + crop.u0 = Math.max(0, ox / tw); + crop.v0 = Math.max(0, oy / th); + crop.u1 = Math.min(1, (ox + ow) / tw); + crop.v1 = Math.min(1, (oy + oh) / th); + + crop.x = x; + crop.y = y; + + crop.cx = ox; + crop.cy = oy; + crop.cw = ow; + crop.ch = oh; + + crop.width = width; + crop.height = height; + + crop.flipX = flipX; + crop.flipY = flipY; + + return crop; + }, + + /** + * Takes a crop data object and recalculates the UVs based on the dimensions inside the crop object. + * Called automatically by `setFrame`. + * + * @method Phaser.Textures.Frame#updateCropUVs + * @since 3.11.0 + * + * @param {object} crop - The crop data object. This is the `GameObject._crop` property. + * @param {boolean} flipX - Does the parent Game Object have flipX set? + * @param {boolean} flipY - Does the parent Game Object have flipY set? + * + * @return {object} The updated crop data object. + */ + updateCropUVs: function (crop, flipX, flipY) + { + return this.setCropUVs(crop, crop.x, crop.y, crop.width, crop.height, flipX, flipY); + }, + + /** + * Directly sets the canvas and WebGL UV data for this frame. + * + * Use this if you need to override the values that are generated automatically + * when the Frame is created. + * + * @method Phaser.Textures.Frame#setUVs + * @since 3.50.0 + * + * @param {number} width - Width of this frame for the Canvas data. + * @param {number} height - Height of this frame for the Canvas data. + * @param {number} u0 - UV u0 value. + * @param {number} v0 - UV v0 value. + * @param {number} u1 - UV u1 value. + * @param {number} v1 - UV v1 value. + * + * @return {this} This Frame object. + */ + setUVs: function (width, height, u0, v0, u1, v1) + { + // Canvas data + + var cd = this.data.drawImage; + + cd.width = width; + cd.height = height; + + // WebGL data + + this.u0 = u0; + this.v0 = v0; + + this.u1 = u1; + this.v1 = v1; + + return this; + }, + + /** + * Updates the internal WebGL UV cache and the drawImage cache. + * + * @method Phaser.Textures.Frame#updateUVs + * @since 3.0.0 + * + * @return {this} This Frame object. + */ + updateUVs: function () + { + var cx = this.cutX; + var cy = this.cutY; + var cw = this.cutWidth; + var ch = this.cutHeight; + + // Canvas data + + var cd = this.data.drawImage; + + cd.width = cw; + cd.height = ch; + + // WebGL data + + var tw = this.source.width; + var th = this.source.height; + + this.u0 = cx / tw; + this.v0 = cy / th; + + this.u1 = (cx + cw) / tw; + this.v1 = (cy + ch) / th; + + return this; + }, + + /** + * Updates the internal WebGL UV cache. + * + * @method Phaser.Textures.Frame#updateUVsInverted + * @since 3.0.0 + * + * @return {this} This Frame object. + */ + updateUVsInverted: function () + { + var tw = this.source.width; + var th = this.source.height; + + this.u0 = (this.cutX + this.cutHeight) / tw; + this.v0 = this.cutY / th; + + this.u1 = this.cutX / tw; + this.v1 = (this.cutY + this.cutWidth) / th; + + return this; + }, + + /** + * Clones this Frame into a new Frame object. + * + * @method Phaser.Textures.Frame#clone + * @since 3.0.0 + * + * @return {Phaser.Textures.Frame} A clone of this Frame. + */ + clone: function () + { + var clone = new Frame(this.texture, this.name, this.sourceIndex); + + clone.cutX = this.cutX; + clone.cutY = this.cutY; + clone.cutWidth = this.cutWidth; + clone.cutHeight = this.cutHeight; + + clone.x = this.x; + clone.y = this.y; + + clone.width = this.width; + clone.height = this.height; + + clone.halfWidth = this.halfWidth; + clone.halfHeight = this.halfHeight; + + clone.centerX = this.centerX; + clone.centerY = this.centerY; + + clone.rotated = this.rotated; + + clone.data = Extend(true, clone.data, this.data); + + clone.updateUVs(); + + return clone; + }, + + /** + * Destroys this Frame by nulling its reference to the parent Texture and and data objects. + * + * @method Phaser.Textures.Frame#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.source = null; + this.texture = null; + this.glTexture = null; + this.customData = null; + this.data = null; + }, + + /** + * The width of the Frame in its un-trimmed, un-padded state, as prepared in the art package, + * before being packed. + * + * @name Phaser.Textures.Frame#realWidth + * @type {number} + * @readonly + * @since 3.0.0 + */ + realWidth: { + + get: function () + { + return this.data.sourceSize.w; + } + + }, + + /** + * The height of the Frame in its un-trimmed, un-padded state, as prepared in the art package, + * before being packed. + * + * @name Phaser.Textures.Frame#realHeight + * @type {number} + * @readonly + * @since 3.0.0 + */ + realHeight: { + + get: function () + { + return this.data.sourceSize.h; + } + + }, + + /** + * The radius of the Frame (derived from sqrt(w * w + h * h) / 2) + * + * @name Phaser.Textures.Frame#radius + * @type {number} + * @readonly + * @since 3.0.0 + */ + radius: { + + get: function () + { + return this.data.radius; + } + + }, + + /** + * Is the Frame trimmed or not? + * + * @name Phaser.Textures.Frame#trimmed + * @type {boolean} + * @readonly + * @since 3.0.0 + */ + trimmed: { + + get: function () + { + return this.data.trim; + } + + }, + + /** + * The Canvas drawImage data object. + * + * @name Phaser.Textures.Frame#canvasData + * @type {object} + * @readonly + * @since 3.0.0 + */ + canvasData: { + + get: function () + { + return this.data.drawImage; + } + + } + +}); + +module.exports = Frame; + + +/***/ }), + +/***/ 1864: +/***/ ((module) => { /** * @author Richard Davey @@ -48441,8 +50345,9 @@ module.exports = GetBoolean; /***/ }), -/* 334 */ -/***/ (function(module, exports) { + +/***/ 3747: +/***/ ((module) => { /** * @author Richard Davey @@ -48666,8 +50571,9 @@ module.exports = TWEEN_CONST; /***/ }), -/* 335 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 7473: +/***/ ((module) => { /** * @author Richard Davey @@ -48675,426 +50581,3319 @@ module.exports = TWEEN_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DeepCopy = __webpack_require__(336); -var SpliceOne = __webpack_require__(11); +// Taken from klasse by mattdesl https://github.com/mattdesl/klasse + +function hasGetterOrSetter (def) +{ + return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function'); +} + +function getProperty (definition, k, isClassDescriptor) +{ + // This may be a lightweight object, OR it might be a property that was defined previously. + + // For simple class descriptors we can just assume its NOT previously defined. + var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k); + + if (!isClassDescriptor && def.value && typeof def.value === 'object') + { + def = def.value; + } + + // This might be a regular property, or it may be a getter/setter the user defined in a class. + if (def && hasGetterOrSetter(def)) + { + if (typeof def.enumerable === 'undefined') + { + def.enumerable = true; + } + + if (typeof def.configurable === 'undefined') + { + def.configurable = true; + } + + return def; + } + else + { + return false; + } +} + +function hasNonConfigurable (obj, k) +{ + var prop = Object.getOwnPropertyDescriptor(obj, k); + + if (!prop) + { + return false; + } + + if (prop.value && typeof prop.value === 'object') + { + prop = prop.value; + } + + if (prop.configurable === false) + { + return true; + } + + return false; +} /** - * Provides methods used for setting the WebGL rendering pipeline of a Game Object. + * Extends the given `myClass` object's prototype with the properties of `definition`. * - * @namespace Phaser.GameObjects.Components.Pipeline - * @webglOnly - * @since 3.0.0 + * @function extend + * @ignore + * @param {Object} ctor The constructor object to mix into. + * @param {Object} definition A dictionary of functions for the class. + * @param {boolean} isClassDescriptor Is the definition a class descriptor? + * @param {Object} [extend] The parent constructor object. */ - -var Pipeline = { - - /** - * The initial WebGL pipeline of this Game Object. - * - * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. - * - * @name Phaser.GameObjects.Components.Pipeline#defaultPipeline - * @type {Phaser.Renderer.WebGL.WebGLPipeline} - * @default null - * @webglOnly - * @since 3.0.0 - */ - defaultPipeline: null, - - /** - * The current WebGL pipeline of this Game Object. - * - * @name Phaser.GameObjects.Components.Pipeline#pipeline - * @type {Phaser.Renderer.WebGL.WebGLPipeline} - * @default null - * @webglOnly - * @since 3.0.0 - */ - pipeline: null, - - /** - * Does this Game Object have any Post Pipelines set? - * - * @name Phaser.GameObjects.Components.Pipeline#hasPostPipeline - * @type {boolean} - * @webglOnly - * @since 3.50.0 - */ - hasPostPipeline: false, - - /** - * The WebGL Post FX Pipelines this Game Object uses for post-render effects. - * - * The pipelines are processed in the order in which they appear in this array. - * - * If you modify this array directly, be sure to set the - * `hasPostPipeline` property accordingly. - * - * @name Phaser.GameObjects.Components.Pipeline#postPipelines - * @type {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]} - * @webglOnly - * @since 3.50.0 - */ - postPipelines: null, - - /** - * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. - * - * @name Phaser.GameObjects.Components.Pipeline#pipelineData - * @type {object} - * @webglOnly - * @since 3.50.0 - */ - pipelineData: null, - - /** - * Sets the initial WebGL Pipeline of this Game Object. - * - * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. - * - * @method Phaser.GameObjects.Components.Pipeline#initPipeline - * @webglOnly - * @since 3.0.0 - * - * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - Either the string-based name of the pipeline, or a pipeline instance to set. - * - * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. - */ - initPipeline: function (pipeline) +function extend (ctor, definition, isClassDescriptor, extend) +{ + for (var k in definition) { - var renderer = this.scene.sys.renderer; - - if (!renderer) + if (!definition.hasOwnProperty(k)) { - return false; + continue; } - var pipelines = renderer.pipelines; + var def = getProperty(definition, k, isClassDescriptor); - this.postPipelines = []; - this.pipelineData = {}; - - if (pipelines) + if (def !== false) { - if (pipeline === undefined) + // If Extends is used, we will check its prototype to see if the final variable exists. + + var parent = extend || ctor; + + if (hasNonConfigurable(parent.prototype, k)) { - pipeline = pipelines.default; - } - - var instance = pipelines.get(pipeline); - - if (instance) - { - this.defaultPipeline = instance; - this.pipeline = instance; - - return true; - } - } - - return false; - }, - - /** - * Sets the main WebGL Pipeline of this Game Object. - * - * Also sets the `pipelineData` property, if the parameter is given. - * - * Both the pipeline and post pipelines share the same pipeline data object. - * - * @method Phaser.GameObjects.Components.Pipeline#setPipeline - * @webglOnly - * @since 3.0.0 - * - * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set. - * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. - * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. - * - * @return {this} This Game Object instance. - */ - setPipeline: function (pipeline, pipelineData, copyData) - { - var renderer = this.scene.sys.renderer; - - if (!renderer) - { - return this; - } - - var pipelines = renderer.pipelines; - - if (pipelines) - { - var instance = pipelines.get(pipeline); - - if (instance) - { - this.pipeline = instance; - } - - if (pipelineData) - { - this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; - } - } - - return this; - }, - - /** - * Sets one, or more, Post Pipelines on this Game Object. - * - * Post Pipelines are invoked after this Game Object has rendered to its target and - * are commonly used for post-fx. - * - * The post pipelines are appended to the `postPipelines` array belonging to this - * Game Object. When the renderer processes this Game Object, it iterates through the post - * pipelines in the order in which they appear in the array. If you are stacking together - * multiple effects, be aware that the order is important. - * - * If you call this method multiple times, the new pipelines will be appended to any existing - * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. - * - * You can optionally also set the `pipelineData` property, if the parameter is given. - * - * Both the pipeline and post pipelines share the pipeline data object together. - * - * @method Phaser.GameObjects.Components.Pipeline#setPostPipeline - * @webglOnly - * @since 3.50.0 - * - * @param {(string|string[]|function|function[]|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} pipelines - Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. - * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. - * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. - * - * @return {this} This Game Object instance. - */ - setPostPipeline: function (pipelines, pipelineData, copyData) - { - var renderer = this.scene.sys.renderer; - - if (!renderer) - { - return this; - } - - var pipelineManager = renderer.pipelines; - - if (pipelineManager) - { - if (!Array.isArray(pipelines)) - { - pipelines = [ pipelines ]; - } - - for (var i = 0; i < pipelines.length; i++) - { - var instance = pipelineManager.getPostPipeline(pipelines[i], this); - - if (instance) + // Just skip the final property + if (Class.ignoreFinals) { - this.postPipelines.push(instance); + continue; } + + // We cannot re-define a property that is configurable=false. + // So we will consider them final and throw an error. This is by + // default so it is clear to the developer what is happening. + // You can set ignoreFinals to true if you need to extend a class + // which has configurable=false; it will simply not re-define final properties. + throw new Error('cannot override final property \'' + k + '\', set Class.ignoreFinals = true to skip'); } - if (pipelineData) - { - this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; - } - } - - this.hasPostPipeline = (this.postPipelines.length > 0); - - return this; - }, - - /** - * Adds an entry to the `pipelineData` object belonging to this Game Object. - * - * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. - * - * If `value` is undefined, and `key` exists, `key` is removed from the data object. - * - * Both the pipeline and post pipelines share the pipeline data object together. - * - * @method Phaser.GameObjects.Components.Pipeline#setPipelineData - * @webglOnly - * @since 3.50.0 - * - * @param {string} key - The key of the pipeline data to set, update, or delete. - * @param {any} [value] - The value to be set with the key. If `undefined` then `key` will be deleted from the object. - * - * @return {this} This Game Object instance. - */ - setPipelineData: function (key, value) - { - var data = this.pipelineData; - - if (value === undefined) - { - delete data[key]; + Object.defineProperty(ctor.prototype, k, def); } else { - data[key] = value; + ctor.prototype[k] = definition[k]; } + } +} - return this; - }, - - /** - * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. - * - * @method Phaser.GameObjects.Components.Pipeline#getPostPipeline - * @webglOnly - * @since 3.50.0 - * - * @param {(string|function|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline)} pipeline - The string-based name of the pipeline, or a pipeline class. - * - * @return {(Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} The Post Pipeline/s matching the name, or undefined if no match. If more than one match they are returned in an array. - */ - getPostPipeline: function (pipeline) +/** + * Applies the given `mixins` to the prototype of `myClass`. + * + * @function mixin + * @ignore + * @param {Object} myClass The constructor object to mix into. + * @param {Object|Array} mixins The mixins to apply to the constructor. + */ +function mixin (myClass, mixins) +{ + if (!mixins) { - var isString = (typeof pipeline === 'string'); - - var pipelines = this.postPipelines; - - var results = []; - - for (var i = 0; i < pipelines.length; i++) - { - var instance = pipelines[i]; - - if ((isString && instance.name === pipeline) || (!isString && instance instanceof pipeline)) - { - results.push(instance); - } - } - - return (results.length === 1) ? results[0] : results; - }, - - /** - * Resets the WebGL Pipeline of this Game Object back to the default it was created with. - * - * @method Phaser.GameObjects.Components.Pipeline#resetPipeline - * @webglOnly - * @since 3.0.0 - * - * @param {boolean} [resetPostPipelines=false] - Reset all of the post pipelines? - * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? - * - * @return {boolean} `true` if the pipeline was reset successfully, otherwise `false`. - */ - resetPipeline: function (resetPostPipelines, resetData) - { - if (resetPostPipelines === undefined) { resetPostPipelines = false; } - if (resetData === undefined) { resetData = false; } - - this.pipeline = this.defaultPipeline; - - if (resetPostPipelines) - { - this.postPipelines = []; - this.hasPostPipeline = false; - } - - if (resetData) - { - this.pipelineData = {}; - } - - return (this.pipeline !== null); - }, - - /** - * Resets the WebGL Post Pipelines of this Game Object. It does this by calling - * the `destroy` method on each post pipeline and then clearing the local array. - * - * @method Phaser.GameObjects.Components.Pipeline#resetPostPipeline - * @webglOnly - * @since 3.50.0 - * - * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? - */ - resetPostPipeline: function (resetData) - { - if (resetData === undefined) { resetData = false; } - - var pipelines = this.postPipelines; - - for (var i = 0; i < pipelines.length; i++) - { - pipelines[i].destroy(); - } - - this.postPipelines = []; - this.hasPostPipeline = false; - - if (resetData) - { - this.pipelineData = {}; - } - }, - - /** - * Removes a type of Post Pipeline instances from this Game Object, based on the given name, and destroys them. - * - * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. - * - * @method Phaser.GameObjects.Components.Pipeline#removePostPipeline - * @webglOnly - * @since 3.50.0 - * - * @param {string|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} pipeline - The string-based name of the pipeline, or a pipeline class. - * - * @return {this} This Game Object. - */ - removePostPipeline: function (pipeline) - { - var pipelines = this.postPipelines; - - for (var i = pipelines.length - 1; i >= 0; i--) - { - var instance = pipelines[i]; - - if ( - (typeof pipeline === 'string' && instance.name === pipeline) || - (typeof pipeline !== 'string' && instance instanceof pipeline)) - { - instance.destroy(); - - SpliceOne(pipelines, i); - } - } - - this.hasPostPipeline = (this.postPipelines.length > 0); - - return this; - }, - - /** - * Gets the name of the WebGL Pipeline this Game Object is currently using. - * - * @method Phaser.GameObjects.Components.Pipeline#getPipelineName - * @webglOnly - * @since 3.0.0 - * - * @return {string} The string-based name of the pipeline being used by this Game Object. - */ - getPipelineName: function () - { - return this.pipeline.name; + return; } -}; + if (!Array.isArray(mixins)) + { + mixins = [ mixins ]; + } -module.exports = Pipeline; + for (var i = 0; i < mixins.length; i++) + { + extend(myClass, mixins[i].prototype || mixins[i]); + } +} + +/** + * Creates a new class with the given descriptor. + * The constructor, defined by the name `initialize`, + * is an optional function. If unspecified, an anonymous + * function will be used which calls the parent class (if + * one exists). + * + * You can also use `Extends` and `Mixins` to provide subclassing + * and inheritance. + * + * @class Phaser.Class + * @constructor + * @param {Object} definition a dictionary of functions for the class + * @example + * + * var MyClass = new Phaser.Class({ + * + * initialize: function() { + * this.foo = 2.0; + * }, + * + * bar: function() { + * return this.foo + 5; + * } + * }); + */ +function Class (definition) +{ + if (!definition) + { + definition = {}; + } + + // The variable name here dictates what we see in Chrome debugger + var initialize; + var Extends; + + if (definition.initialize) + { + if (typeof definition.initialize !== 'function') + { + throw new Error('initialize must be a function'); + } + + initialize = definition.initialize; + + // Usually we should avoid 'delete' in V8 at all costs. + // However, its unlikely to make any performance difference + // here since we only call this on class creation (i.e. not object creation). + delete definition.initialize; + } + else if (definition.Extends) + { + var base = definition.Extends; + + initialize = function () + { + base.apply(this, arguments); + }; + } + else + { + initialize = function () {}; + } + + if (definition.Extends) + { + initialize.prototype = Object.create(definition.Extends.prototype); + initialize.prototype.constructor = initialize; + + // For getOwnPropertyDescriptor to work, we need to act directly on the Extends (or Mixin) + + Extends = definition.Extends; + + delete definition.Extends; + } + else + { + initialize.prototype.constructor = initialize; + } + + // Grab the mixins, if they are specified... + var mixins = null; + + if (definition.Mixins) + { + mixins = definition.Mixins; + delete definition.Mixins; + } + + // First, mixin if we can. + mixin(initialize, mixins); + + // Now we grab the actual definition which defines the overrides. + extend(initialize, definition, true, Extends); + + return initialize; +} + +Class.extend = extend; +Class.mixin = mixin; +Class.ignoreFinals = false; + +module.exports = Class; /***/ }), -/* 336 */ -/***/ (function(module, exports) { + +/***/ 1984: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A NOOP (No Operation) callback function. + * + * Used internally by Phaser when it's more expensive to determine if a callback exists + * than it is to just invoke an empty function. + * + * @function Phaser.Utils.NOOP + * @since 3.0.0 + */ +var NOOP = function () +{ + // NOOP +}; + +module.exports = NOOP; + + +/***/ }), + +/***/ 1792: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Adds the given item, or array of items, to the array. + * + * Each item must be unique within the array. + * + * The array is modified in-place and returned. + * + * You can optionally specify a limit to the maximum size of the array. If the quantity of items being + * added will take the array length over this limit, it will stop adding once the limit is reached. + * + * You can optionally specify a callback to be invoked for each item successfully added to the array. + * + * @function Phaser.Utils.Array.Add + * @since 3.4.0 + * + * @param {array} array - The array to be added to. + * @param {any|any[]} item - The item, or array of items, to add to the array. Each item must be unique within the array. + * @param {number} [limit] - Optional limit which caps the size of the array. + * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {array} The input array. + */ +var Add = function (array, item, limit, callback, context) +{ + if (context === undefined) { context = array; } + + if (limit > 0) + { + var remaining = limit - array.length; + + // There's nothing more we can do here, the array is full + if (remaining <= 0) + { + return null; + } + } + + // Fast path to avoid array mutation and iteration + if (!Array.isArray(item)) + { + if (array.indexOf(item) === -1) + { + array.push(item); + + if (callback) + { + callback.call(context, item); + } + + return item; + } + else + { + return null; + } + } + + // If we got this far, we have an array of items to insert + + // Ensure all the items are unique + var itemLength = item.length - 1; + + while (itemLength >= 0) + { + if (array.indexOf(item[itemLength]) !== -1) + { + // Already exists in array, so remove it + item.splice(itemLength, 1); + } + + itemLength--; + } + + // Anything left? + itemLength = item.length; + + if (itemLength === 0) + { + return null; + } + + if (limit > 0 && itemLength > remaining) + { + item.splice(remaining); + + itemLength = remaining; + } + + for (var i = 0; i < itemLength; i++) + { + var entry = item[i]; + + array.push(entry); + + if (callback) + { + callback.call(context, entry); + } + } + + return item; +}; + +module.exports = Add; + + +/***/ }), + +/***/ 2280: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Adds the given item, or array of items, to the array starting at the index specified. + * + * Each item must be unique within the array. + * + * Existing elements in the array are shifted up. + * + * The array is modified in-place and returned. + * + * You can optionally specify a limit to the maximum size of the array. If the quantity of items being + * added will take the array length over this limit, it will stop adding once the limit is reached. + * + * You can optionally specify a callback to be invoked for each item successfully added to the array. + * + * @function Phaser.Utils.Array.AddAt + * @since 3.4.0 + * + * @param {array} array - The array to be added to. + * @param {any|any[]} item - The item, or array of items, to add to the array. + * @param {number} [index=0] - The index in the array where the item will be inserted. + * @param {number} [limit] - Optional limit which caps the size of the array. + * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {array} The input array. + */ +var AddAt = function (array, item, index, limit, callback, context) +{ + if (index === undefined) { index = 0; } + if (context === undefined) { context = array; } + + if (limit > 0) + { + var remaining = limit - array.length; + + // There's nothing more we can do here, the array is full + if (remaining <= 0) + { + return null; + } + } + + // Fast path to avoid array mutation and iteration + if (!Array.isArray(item)) + { + if (array.indexOf(item) === -1) + { + array.splice(index, 0, item); + + if (callback) + { + callback.call(context, item); + } + + return item; + } + else + { + return null; + } + } + + // If we got this far, we have an array of items to insert + + // Ensure all the items are unique + var itemLength = item.length - 1; + + while (itemLength >= 0) + { + if (array.indexOf(item[itemLength]) !== -1) + { + // Already exists in array, so remove it + item.pop(); + } + + itemLength--; + } + + // Anything left? + itemLength = item.length; + + if (itemLength === 0) + { + return null; + } + + // Truncate to the limit + if (limit > 0 && itemLength > remaining) + { + item.splice(remaining); + + itemLength = remaining; + } + + for (var i = itemLength - 1; i >= 0; i--) + { + var entry = item[i]; + + array.splice(index, 0, entry); + + if (callback) + { + callback.call(context, entry); + } + } + + return item; +}; + +module.exports = AddAt; + + +/***/ }), + +/***/ 2513: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given element to the top of the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.BringToTop + * @since 3.4.0 + * + * @param {array} array - The array. + * @param {*} item - The element to move. + * + * @return {*} The element that was moved. + */ +var BringToTop = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex !== -1 && currentIndex < array.length) + { + array.splice(currentIndex, 1); + array.push(item); + } + + return item; +}; + +module.exports = BringToTop; + + +/***/ }), + +/***/ 1771: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Returns the total number of elements in the array which have a property matching the given value. + * + * @function Phaser.Utils.Array.CountAllMatching + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} property - The property to test on each array element. + * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. + * + * @return {number} The total number of elements with properties matching the given value. + */ +var CountAllMatching = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + var total = 0; + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var child = array[i]; + + if (child[property] === value) + { + total++; + } + } + } + + return total; +}; + +module.exports = CountAllMatching; + + +/***/ }), + +/***/ 7883: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Passes each element in the array to the given callback. + * + * @function Phaser.Utils.Array.Each + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {function} callback - A callback to be invoked for each item in the array. + * @param {object} context - The context in which the callback is invoked. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the current array item. + * + * @return {array} The input array. + */ +var Each = function (array, callback, context) +{ + var i; + var args = [ null ]; + + for (i = 3; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (i = 0; i < array.length; i++) + { + args[0] = array[i]; + + callback.apply(context, args); + } + + return array; +}; + +module.exports = Each; + + +/***/ }), + +/***/ 5856: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Passes each element in the array, between the start and end indexes, to the given callback. + * + * @function Phaser.Utils.Array.EachInRange + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {function} callback - A callback to be invoked for each item in the array. + * @param {object} context - The context in which the callback is invoked. + * @param {number} startIndex - The start index to search from. + * @param {number} endIndex - The end index to search to. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + * + * @return {array} The input array. + */ +var EachInRange = function (array, callback, context, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + if (SafeRange(array, startIndex, endIndex)) + { + var i; + var args = [ null ]; + + for (i = 5; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (i = startIndex; i < endIndex; i++) + { + args[0] = array[i]; + + callback.apply(context, args); + } + } + + return array; +}; + +module.exports = EachInRange; + + +/***/ }), + +/***/ 3957: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Searches a pre-sorted array for the closet value to the given number. + * + * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, + * and will check for the closest value of those to the given number. + * + * @function Phaser.Utils.Array.FindClosestInSorted + * @since 3.0.0 + * + * @param {number} value - The value to search for in the array. + * @param {array} array - The array to search, which must be sorted. + * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. + * + * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. + */ +var FindClosestInSorted = function (value, array, key) +{ + if (!array.length) + { + return NaN; + } + else if (array.length === 1) + { + return array[0]; + } + + var i = 1; + var low; + var high; + + if (key) + { + if (value < array[0][key]) + { + return array[0]; + } + + while (array[i][key] < value) + { + i++; + } + } + else + { + while (array[i] < value) + { + i++; + } + } + + if (i > array.length) + { + i = array.length; + } + + if (key) + { + low = array[i - 1][key]; + high = array[i][key]; + + return ((high - value) <= (value - low)) ? array[i] : array[i - 1]; + } + else + { + low = array[i - 1]; + high = array[i]; + + return ((high - value) <= (value - low)) ? high : low; + } +}; + +module.exports = FindClosestInSorted; + + +/***/ }), + +/***/ 4493: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array and flattens it, returning a shallow-copy flattened array. + * + * @function Phaser.Utils.Array.Flatten + * @since 3.60.0 + * + * @param {array} array - The array to flatten. + * @param {array} [output] - An array to hold the results in. + * + * @return {array} The flattened output array. + */ +var Flatten = function (array, output) +{ + if (output === undefined) { output = []; } + + for (var i = 0; i < array.length; i++) + { + if (Array.isArray(array[i])) + { + Flatten(array[i], output); + } + else + { + output.push(array[i]); + } + } + + return output; +}; + +module.exports = Flatten; + + +/***/ }), + +/***/ 6245: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Returns all elements in the array. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('visible', true)` would return only elements that have their visible property set. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 elements. + * + * @function Phaser.Utils.Array.GetAll + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} [property] - The property to test on each array element. + * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. + * + * @return {array} All matching elements from the array. + */ +var GetAll = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + var output = []; + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var child = array[i]; + + if (!property || + (property && value === undefined && child.hasOwnProperty(property)) || + (property && value !== undefined && child[property] === value)) + { + output.push(child); + } + } + } + + return output; +}; + +module.exports = GetAll; + + +/***/ }), + +/***/ 1647: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Returns the first element in the array. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('visible', true)` would return the first element that had its `visible` property set. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would search only the first 50 elements. + * + * @function Phaser.Utils.Array.GetFirst + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} [property] - The property to test on each array element. + * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=array.length] - An optional end index to search up to (but not included) + * + * @return {object} The first matching element from the array, or `null` if no element could be found in the range given. + */ +var GetFirst = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var child = array[i]; + + if (!property || + (property && value === undefined && child.hasOwnProperty(property)) || + (property && value !== undefined && child[property] === value)) + { + return child; + } + } + } + + return null; +}; + +module.exports = GetFirst; + + +/***/ }), + +/***/ 5301: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns a Random element from the array. + * + * @function Phaser.Utils.Array.GetRandom + * @since 3.0.0 + * + * @param {array} array - The array to select the random entry from. + * @param {number} [startIndex=0] - An optional start index. + * @param {number} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from. + * + * @return {*} A random element from the array, or `null` if no element could be found in the range given. + */ +var GetRandom = function (array, startIndex, length) +{ + if (startIndex === undefined) { startIndex = 0; } + if (length === undefined) { length = array.length; } + + var randomIndex = startIndex + Math.floor(Math.random() * length); + + return (array[randomIndex] === undefined) ? null : array[randomIndex]; +}; + +module.exports = GetRandom; + + +/***/ }), + +/***/ 8683: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given array element above another one in the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveAbove + * @since 3.55.0 + * + * @param {array} array - The input array. + * @param {*} item1 - The element to move above base element. + * @param {*} item2 - The base element. + * + * + * @return {array} The input array. + */ +var MoveAbove = function (array, item1, item2) +{ + if (item1 === item2) + { + return array; + } + + var currentIndex = array.indexOf(item1); + var baseIndex = array.indexOf(item2); + + if (currentIndex < 0 || baseIndex < 0) + { + throw new Error('Supplied items must be elements of the same array'); + } + + if (currentIndex > baseIndex) + { + // item1 is already above item2 + return array; + } + + // Remove + array.splice(currentIndex, 1); + + // Add in new location + if (baseIndex === array.length - 1) + { + array.push(item1); + } + else + { + array.splice(baseIndex, 0, item1); + } + + return array; +}; + +module.exports = MoveAbove; + + +/***/ }), + +/***/ 546: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given array element below another one in the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveBelow + * @since 3.55.0 + * + * @param {array} array - The input array. + * @param {*} item1 - The element to move below base element. + * @param {*} item2 - The base element. + * + * + * @return {array} The input array. + */ +var MoveBelow = function (array, item1, item2) +{ + if (item1 === item2) + { + return array; + } + + var currentIndex = array.indexOf(item1); + var baseIndex = array.indexOf(item2); + + if (currentIndex < 0 || baseIndex < 0) + { + throw new Error('Supplied items must be elements of the same array'); + } + + if (currentIndex < baseIndex) + { + // item1 is already below item2 + return array; + } + + // Remove + array.splice(currentIndex, 1); + + // Add in new location + if (baseIndex === 0) + { + array.unshift(item1); + } + else + { + array.splice(baseIndex, 0, item1); + } + + return array; +}; + +module.exports = MoveBelow; + + +/***/ }), + +/***/ 1842: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given array element down one place in the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveDown + * @since 3.4.0 + * + * @param {array} array - The input array. + * @param {*} item - The element to move down the array. + * + * @return {array} The input array. + */ +var MoveDown = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex > 0) + { + var item2 = array[currentIndex - 1]; + + var index2 = array.indexOf(item2); + + array[currentIndex] = item2; + array[index2] = item; + } + + return array; +}; + +module.exports = MoveDown; + + +/***/ }), + +/***/ 1419: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves an element in an array to a new position within the same array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveTo + * @since 3.4.0 + * + * @param {array} array - The array. + * @param {*} item - The element to move. + * @param {number} index - The new index that the element will be moved to. + * + * @return {*} The element that was moved. + */ +var MoveTo = function (array, item, index) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex === -1 || index < 0 || index >= array.length) + { + throw new Error('Supplied index out of bounds'); + } + + if (currentIndex !== index) + { + // Remove + array.splice(currentIndex, 1); + + // Add in new location + array.splice(index, 0, item); + } + + return item; +}; + +module.exports = MoveTo; + + +/***/ }), + +/***/ 6512: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given array element up one place in the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveUp + * @since 3.4.0 + * + * @param {array} array - The input array. + * @param {*} item - The element to move up the array. + * + * @return {array} The input array. + */ +var MoveUp = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex !== -1 && currentIndex < array.length - 1) + { + // The element one above `item` in the array + var item2 = array[currentIndex + 1]; + var index2 = array.indexOf(item2); + + array[currentIndex] = item2; + array[index2] = item; + } + + return array; +}; + +module.exports = MoveUp; + + +/***/ }), + +/***/ 4130: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Create an array representing the range of numbers (usually integers), between, and inclusive of, + * the given `start` and `end` arguments. For example: + * + * `var array = Phaser.Utils.Array.NumberArray(2, 4); // array = [2, 3, 4]` + * `var array = Phaser.Utils.Array.NumberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` + * `var array = Phaser.Utils.Array.NumberArray(8, 2); // array = [8, 7, 6, 5, 4, 3, 2]` + * + * This is equivalent to `Phaser.Utils.Array.NumberArrayStep(start, end, 1)`. + * + * You can optionally provide a prefix and / or suffix string. If given the array will contain + * strings, not integers. For example: + * + * `var array = Phaser.Utils.Array.NumberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` + * `var array = Phaser.Utils.Array.NumberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` + * + * @function Phaser.Utils.Array.NumberArray + * @since 3.0.0 + * + * @param {number} start - The minimum value the array starts with. + * @param {number} end - The maximum value the array contains. + * @param {string} [prefix] - Optional prefix to place before the number. If provided the array will contain strings, not integers. + * @param {string} [suffix] - Optional suffix to place after the number. If provided the array will contain strings, not integers. + * + * @return {(number[]|string[])} The array of number values, or strings if a prefix or suffix was provided. + */ +var NumberArray = function (start, end, prefix, suffix) +{ + var result = []; + + var i; + var asString = false; + + if (prefix || suffix) + { + asString = true; + + if (!prefix) + { + prefix = ''; + } + + if (!suffix) + { + suffix = ''; + } + } + + if (end < start) + { + for (i = start; i >= end; i--) + { + if (asString) + { + result.push(prefix + i.toString() + suffix); + } + else + { + result.push(i); + } + } + } + else + { + for (i = start; i <= end; i++) + { + if (asString) + { + result.push(prefix + i.toString() + suffix); + } + else + { + result.push(i); + } + } + } + + return result; +}; + +module.exports = NumberArray; + + +/***/ }), + +/***/ 1316: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RoundAwayFromZero = __webpack_require__(4078); + +/** + * Create an array of numbers (positive and/or negative) progressing from `start` + * up to but not including `end` by advancing by `step`. + * + * If `start` is less than `end` a zero-length range is created unless a negative `step` is specified. + * + * Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0; + * for forward compatibility make sure to pass in actual numbers. + * + * @example + * NumberArrayStep(4); + * // => [0, 1, 2, 3] + * + * NumberArrayStep(1, 5); + * // => [1, 2, 3, 4] + * + * NumberArrayStep(0, 20, 5); + * // => [0, 5, 10, 15] + * + * NumberArrayStep(0, -4, -1); + * // => [0, -1, -2, -3] + * + * NumberArrayStep(1, 4, 0); + * // => [1, 1, 1] + * + * NumberArrayStep(0); + * // => [] + * + * @function Phaser.Utils.Array.NumberArrayStep + * @since 3.0.0 + * + * @param {number} [start=0] - The start of the range. + * @param {number} [end=null] - The end of the range. + * @param {number} [step=1] - The value to increment or decrement by. + * + * @return {number[]} The array of number values. + */ +var NumberArrayStep = function (start, end, step) +{ + if (start === undefined) { start = 0; } + if (end === undefined) { end = null; } + if (step === undefined) { step = 1; } + + if (end === null) + { + end = start; + start = 0; + } + + var result = []; + + var total = Math.max(RoundAwayFromZero((end - start) / (step || 1)), 0); + + for (var i = 0; i < total; i++) + { + result.push(start); + start += step; + } + + return result; +}; + +module.exports = NumberArrayStep; + + +/***/ }), + +/***/ 9465: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @ignore + */ +function swap (arr, i, j) +{ + var tmp = arr[i]; + arr[i] = arr[j]; + arr[j] = tmp; +} + +/** + * @ignore + */ +function defaultCompare (a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * A [Floyd-Rivest](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm) quick selection algorithm. + * + * Rearranges the array items so that all items in the [left, k] range are smaller than all items in [k, right]; + * The k-th element will have the (k - left + 1)th smallest value in [left, right]. + * + * The array is modified in-place. + * + * Based on code by [Vladimir Agafonkin](https://www.npmjs.com/~mourner) + * + * @function Phaser.Utils.Array.QuickSelect + * @since 3.0.0 + * + * @param {array} arr - The array to sort. + * @param {number} k - The k-th element index. + * @param {number} [left=0] - The index of the left part of the range. + * @param {number} [right] - The index of the right part of the range. + * @param {function} [compare] - An optional comparison function. Is passed two elements and should return 0, 1 or -1. + */ +var QuickSelect = function (arr, k, left, right, compare) +{ + if (left === undefined) { left = 0; } + if (right === undefined) { right = arr.length - 1; } + if (compare === undefined) { compare = defaultCompare; } + + while (right > left) + { + if (right - left > 600) + { + var n = right - left + 1; + var m = k - left + 1; + var z = Math.log(n); + var s = 0.5 * Math.exp(2 * z / 3); + var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1); + var newLeft = Math.max(left, Math.floor(k - m * s / n + sd)); + var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd)); + + QuickSelect(arr, k, newLeft, newRight, compare); + } + + var t = arr[k]; + var i = left; + var j = right; + + swap(arr, left, k); + + if (compare(arr[right], t) > 0) + { + swap(arr, left, right); + } + + while (i < j) + { + swap(arr, i, j); + + i++; + j--; + + while (compare(arr[i], t) < 0) + { + i++; + } + + while (compare(arr[j], t) > 0) + { + j--; + } + } + + if (compare(arr[left], t) === 0) + { + swap(arr, left, j); + } + else + { + j++; + swap(arr, j, right); + } + + if (j <= k) + { + left = j + 1; + } + + if (k <= j) + { + right = j - 1; + } + } +}; + +module.exports = QuickSelect; + + +/***/ }), + +/***/ 9703: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetValue = __webpack_require__(5851); +var Shuffle = __webpack_require__(4912); + +var BuildChunk = function (a, b, qty) +{ + var out = []; + + for (var aIndex = 0; aIndex < a.length; aIndex++) + { + for (var bIndex = 0; bIndex < b.length; bIndex++) + { + for (var i = 0; i < qty; i++) + { + out.push({ a: a[aIndex], b: b[bIndex] }); + } + } + } + + return out; +}; + +/** + * Creates an array populated with a range of values, based on the given arguments and configuration object. + * + * Range ([a,b,c], [1,2,3]) = + * a1, a2, a3, b1, b2, b3, c1, c2, c3 + * + * Range ([a,b], [1,2,3], qty = 3) = + * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3 + * + * Range ([a,b,c], [1,2,3], repeat x1) = + * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3 + * + * Range ([a,b], [1,2], repeat -1 = endless, max = 14) = + * Maybe if max is set then repeat goes to -1 automatically? + * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements) + * + * Range ([a], [1,2,3,4,5], random = true) = + * a4, a1, a5, a2, a3 + * + * Range ([a, b], [1,2,3], random = true) = + * b3, a2, a1, b1, a3, b2 + * + * Range ([a, b, c], [1,2,3], randomB = true) = + * a3, a1, a2, b2, b3, b1, c1, c3, c2 + * + * Range ([a], [1,2,3,4,5], yoyo = true) = + * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1 + * + * Range ([a, b], [1,2,3], yoyo = true) = + * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1 + * + * @function Phaser.Utils.Array.Range + * @since 3.0.0 + * + * @param {array} a - The first array of range elements. + * @param {array} b - The second array of range elements. + * @param {object} [options] - A range configuration object. Can contain: repeat, random, randomB, yoyo, max, qty. + * + * @return {array} An array of arranged elements. + */ +var Range = function (a, b, options) +{ + var max = GetValue(options, 'max', 0); + var qty = GetValue(options, 'qty', 1); + var random = GetValue(options, 'random', false); + var randomB = GetValue(options, 'randomB', false); + var repeat = GetValue(options, 'repeat', 0); + var yoyo = GetValue(options, 'yoyo', false); + + var out = []; + + if (randomB) + { + Shuffle(b); + } + + // Endless repeat, so limit by max + if (repeat === -1) + { + if (max === 0) + { + repeat = 0; + } + else + { + // Work out how many repeats we need + var total = (a.length * b.length) * qty; + + if (yoyo) + { + total *= 2; + } + + repeat = Math.ceil(max / total); + } + } + + for (var i = 0; i <= repeat; i++) + { + var chunk = BuildChunk(a, b, qty); + + if (random) + { + Shuffle(chunk); + } + + out = out.concat(chunk); + + if (yoyo) + { + chunk.reverse(); + + out = out.concat(chunk); + } + } + + if (max) + { + out.splice(max); + } + + return out; +}; + +module.exports = Range; + + +/***/ }), + +/***/ 7161: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SpliceOne = __webpack_require__(8935); + +/** + * Removes the given item, or array of items, from the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for each item successfully removed from the array. + * + * @function Phaser.Utils.Array.Remove + * @since 3.4.0 + * + * @param {array} array - The array to be modified. + * @param {*|Array.<*>} item - The item, or array of items, to be removed from the array. + * @param {function} [callback] - A callback to be invoked for each item successfully removed from the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {*|Array.<*>} The item, or array of items, that were successfully removed from the array. + */ +var Remove = function (array, item, callback, context) +{ + if (context === undefined) { context = array; } + + var index; + + // Fast path to avoid array mutation and iteration + if (!Array.isArray(item)) + { + index = array.indexOf(item); + + if (index !== -1) + { + SpliceOne(array, index); + + if (callback) + { + callback.call(context, item); + } + + return item; + } + else + { + return null; + } + } + + // If we got this far, we have an array of items to remove + + var itemLength = item.length - 1; + var removed = []; + + while (itemLength >= 0) + { + var entry = item[itemLength]; + + index = array.indexOf(entry); + + if (index !== -1) + { + SpliceOne(array, index); + + removed.push(entry); + + if (callback) + { + callback.call(context, entry); + } + } + + itemLength--; + } + + return removed; +}; + +module.exports = Remove; + + +/***/ }), + +/***/ 4725: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SpliceOne = __webpack_require__(8935); + +/** + * Removes the item from the given position in the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array. + * + * @function Phaser.Utils.Array.RemoveAt + * @since 3.4.0 + * + * @param {array} array - The array to be modified. + * @param {number} index - The array index to remove the item from. The index must be in bounds or it will throw an error. + * @param {function} [callback] - A callback to be invoked for the item removed from the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {*} The item that was removed. + */ +var RemoveAt = function (array, index, callback, context) +{ + if (context === undefined) { context = array; } + + if (index < 0 || index > array.length - 1) + { + throw new Error('Index out of bounds'); + } + + var item = SpliceOne(array, index); + + if (callback) + { + callback.call(context, item); + } + + return item; +}; + +module.exports = RemoveAt; + + +/***/ }), + +/***/ 8780: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Removes the item within the given range in the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for the item/s successfully removed from the array. + * + * @function Phaser.Utils.Array.RemoveBetween + * @since 3.4.0 + * + * @param {array} array - The array to be modified. + * @param {number} startIndex - The start index to remove from. + * @param {number} endIndex - The end index to remove to. + * @param {function} [callback] - A callback to be invoked for the item removed from the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {Array.<*>} An array of items that were removed. + */ +var RemoveBetween = function (array, startIndex, endIndex, callback, context) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + if (context === undefined) { context = array; } + + if (SafeRange(array, startIndex, endIndex)) + { + var size = endIndex - startIndex; + + var removed = array.splice(startIndex, size); + + if (callback) + { + for (var i = 0; i < removed.length; i++) + { + var entry = removed[i]; + + callback.call(context, entry); + } + } + + return removed; + } + else + { + return []; + } +}; + +module.exports = RemoveBetween; + + +/***/ }), + +/***/ 5744: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SpliceOne = __webpack_require__(8935); + +/** + * Removes a random object from the given array and returns it. + * Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index. + * + * @function Phaser.Utils.Array.RemoveRandomElement + * @since 3.0.0 + * + * @param {array} array - The array to removed a random element from. + * @param {number} [start=0] - The array index to start the search from. + * @param {number} [length=array.length] - Optional restriction on the number of elements to randomly select from. + * + * @return {object} The random element that was removed, or `null` if there were no array elements that fell within the given range. + */ +var RemoveRandomElement = function (array, start, length) +{ + if (start === undefined) { start = 0; } + if (length === undefined) { length = array.length; } + + var randomIndex = start + Math.floor(Math.random() * length); + + return SpliceOne(array, randomIndex); +}; + +module.exports = RemoveRandomElement; + + +/***/ }), + +/***/ 6960: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Replaces an element of the array with the new element. + * The new element cannot already be a member of the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.Replace + * @since 3.4.0 + * + * @param {array} array - The array to search within. + * @param {*} oldChild - The element in the array that will be replaced. + * @param {*} newChild - The element to be inserted into the array at the position of `oldChild`. + * + * @return {boolean} Returns true if the oldChild was successfully replaced, otherwise returns false. + */ +var Replace = function (array, oldChild, newChild) +{ + var index1 = array.indexOf(oldChild); + var index2 = array.indexOf(newChild); + + if (index1 !== -1 && index2 === -1) + { + array[index1] = newChild; + + return true; + } + else + { + return false; + } +}; + +module.exports = Replace; + + +/***/ }), + +/***/ 1021: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the element at the start of the array to the end, shifting all items in the process. + * The "rotation" happens to the left. + * + * @function Phaser.Utils.Array.RotateLeft + * @since 3.0.0 + * + * @param {array} array - The array to shift to the left. This array is modified in place. + * @param {number} [total=1] - The number of times to shift the array. + * + * @return {*} The most recently shifted element. + */ +var RotateLeft = function (array, total) +{ + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) + { + element = array.shift(); + array.push(element); + } + + return element; +}; + +module.exports = RotateLeft; + + +/***/ }), + +/***/ 4027: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the element at the end of the array to the start, shifting all items in the process. + * The "rotation" happens to the right. + * + * @function Phaser.Utils.Array.RotateRight + * @since 3.0.0 + * + * @param {array} array - The array to shift to the right. This array is modified in place. + * @param {number} [total=1] - The number of times to shift the array. + * + * @return {*} The most recently shifted element. + */ +var RotateRight = function (array, total) +{ + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) + { + element = array.pop(); + array.unshift(element); + } + + return element; +}; + +module.exports = RotateRight; + + +/***/ }), + +/***/ 2497: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Tests if the start and end indexes are a safe range for the given array. + * + * @function Phaser.Utils.Array.SafeRange + * @since 3.4.0 + * + * @param {array} array - The array to check. + * @param {number} startIndex - The start index. + * @param {number} endIndex - The end index. + * @param {boolean} [throwError=true] - Throw an error if the range is out of bounds. + * + * @return {boolean} True if the range is safe, otherwise false. + */ +var SafeRange = function (array, startIndex, endIndex, throwError) +{ + var len = array.length; + + if (startIndex < 0 || + startIndex > len || + startIndex >= endIndex || + endIndex > len) + { + if (throwError) + { + throw new Error('Range Error: Values outside acceptable range'); + } + + return false; + } + else + { + return true; + } +}; + +module.exports = SafeRange; + + +/***/ }), + +/***/ 5361: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given element to the bottom of the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.SendToBack + * @since 3.4.0 + * + * @param {array} array - The array. + * @param {*} item - The element to move. + * + * @return {*} The element that was moved. + */ +var SendToBack = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex !== -1 && currentIndex > 0) + { + array.splice(currentIndex, 1); + array.unshift(item); + } + + return item; +}; + +module.exports = SendToBack; + + +/***/ }), + +/***/ 3718: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(2497); + +/** + * Scans the array for elements with the given property. If found, the property is set to the `value`. + * + * For example: `SetAll('visible', true)` would set all elements that have a `visible` property to `false`. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would update only the first 50 elements. + * + * @function Phaser.Utils.Array.SetAll + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} property - The property to test for on each array element. + * @param {*} value - The value to set the property to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. + * + * @return {array} The input array. + */ +var SetAll = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var entry = array[i]; + + if (entry.hasOwnProperty(property)) + { + entry[property] = value; + } + } + } + + return array; +}; + +module.exports = SetAll; + + +/***/ }), + +/***/ 4912: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Shuffles the contents of the given array using the Fisher-Yates implementation. + * + * The original array is modified directly and returned. + * + * @function Phaser.Utils.Array.Shuffle + * @since 3.0.0 + * + * @generic T + * @genericUse {T[]} - [array,$return] + * + * @param {T[]} array - The array to shuffle. This array is modified in place. + * + * @return {T[]} The shuffled array. + */ +var Shuffle = function (array) +{ + for (var i = array.length - 1; i > 0; i--) + { + var j = Math.floor(Math.random() * (i + 1)); + var temp = array[i]; + array[i] = array[j]; + array[j] = temp; + } + + return array; +}; + +module.exports = Shuffle; + + +/***/ }), + +/***/ 2071: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes the given array and runs a numeric sort on it, ignoring any non-digits that + * may be in the entries. + * + * You should only run this on arrays containing strings. + * + * @function Phaser.Utils.Array.SortByDigits + * @since 3.50.0 + * + * @param {string[]} array - The input array of strings. + * + * @return {string[]} The sorted input array. + */ +var SortByDigits = function (array) +{ + var re = /\D/g; + + array.sort(function (a, b) + { + return (parseInt(a.replace(re, ''), 10) - parseInt(b.replace(re, ''), 10)); + }); + + return array; +}; + +module.exports = SortByDigits; + + +/***/ }), + +/***/ 8935: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Removes a single item from an array and returns it without creating gc, like the native splice does. + * Based on code by Mike Reinstein. + * + * @function Phaser.Utils.Array.SpliceOne + * @since 3.0.0 + * + * @param {array} array - The array to splice from. + * @param {number} index - The index of the item which should be spliced. + * + * @return {*} The item which was spliced (removed). + */ +var SpliceOne = function (array, index) +{ + if (index >= array.length) + { + return; + } + + var len = array.length - 1; + + var item = array[index]; + + for (var i = index; i < len; i++) + { + array[i] = array[i + 1]; + } + + array.length = len; + + return item; +}; + +module.exports = SpliceOne; + + +/***/ }), + +/***/ 9992: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @author Angry Bytes (and contributors) + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Device = __webpack_require__(9356); + +/** + * The comparator function. + * + * @ignore + * + * @param {*} a - The first item to test. + * @param {*} b - The second itemt to test. + * + * @return {boolean} True if they localCompare, otherwise false. + */ +function Compare (a, b) +{ + return String(a).localeCompare(b); +} + +/** + * Process the array contents. + * + * @ignore + * + * @param {array} array - The array to process. + * @param {function} compare - The comparison function. + * + * @return {array} - The processed array. + */ +function Process (array, compare) +{ + // Short-circuit when there's nothing to sort. + var len = array.length; + + if (len <= 1) + { + return array; + } + + // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. + // Chunks are the size of the left or right hand in merge sort. + // Stop when the left-hand covers all of the array. + var buffer = new Array(len); + + for (var chk = 1; chk < len; chk *= 2) + { + RunPass(array, compare, chk, buffer); + + var tmp = array; + + array = buffer; + + buffer = tmp; + } + + return array; +} + +/** + * Run a single pass with the given chunk size. + * + * @ignore + * + * @param {array} arr - The array to run the pass on. + * @param {function} comp - The comparison function. + * @param {number} chk - The number of iterations. + * @param {array} result - The array to store the result in. + */ +function RunPass (arr, comp, chk, result) +{ + var len = arr.length; + var i = 0; + + // Step size / double chunk size. + var dbl = chk * 2; + + // Bounds of the left and right chunks. + var l, r, e; + + // Iterators over the left and right chunk. + var li, ri; + + // Iterate over pairs of chunks. + for (l = 0; l < len; l += dbl) + { + r = l + chk; + e = r + chk; + + if (r > len) + { + r = len; + } + + if (e > len) + { + e = len; + } + + // Iterate both chunks in parallel. + li = l; + ri = r; + + while (true) + { + // Compare the chunks. + if (li < r && ri < e) + { + // This works for a regular `sort()` compatible comparator, + // but also for a simple comparator like: `a > b` + if (comp(arr[li], arr[ri]) <= 0) + { + result[i++] = arr[li++]; + } + else + { + result[i++] = arr[ri++]; + } + } + else if (li < r) + { + // Nothing to compare, just flush what's left. + result[i++] = arr[li++]; + } + else if (ri < e) + { + result[i++] = arr[ri++]; + } + else + { + // Both iterators are at the chunk ends. + break; + } + } + } +} + +/** + * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. + * + * This is an implementation of merge sort, without recursion. + * + * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable + * + * @function Phaser.Utils.Array.StableSort + * @since 3.0.0 + * + * @param {array} array - The input array to be sorted. + * @param {function} [compare] - The comparison function. + * + * @return {array} The sorted result. + */ +var StableSort = function (array, compare) +{ + if (compare === undefined) { compare = Compare; } + + // Short-circuit when there's nothing to sort. + if (!array || array.length < 2) + { + return array; + } + + if (Device.features.stableSort) + { + return array.sort(compare); + } + + var result = Process(array, compare); + + // This simply copies back if the result isn't in the original array, which happens on an odd number of passes. + if (result !== array) + { + RunPass(result, null, array.length, array); + } + + return array; +}; + +module.exports = StableSort; + + +/***/ }), + +/***/ 2372: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Swaps the position of two elements in the given array. + * The elements must exist in the same array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.Swap + * @since 3.4.0 + * + * @param {array} array - The input array. + * @param {*} item1 - The first element to swap. + * @param {*} item2 - The second element to swap. + * + * @return {array} The input array. + */ +var Swap = function (array, item1, item2) +{ + if (item1 === item2) + { + return array; + } + + var index1 = array.indexOf(item1); + var index2 = array.indexOf(item2); + + if (index1 < 0 || index2 < 0) + { + throw new Error('Supplied items must be elements of the same array'); + } + + array[index1] = item2; + array[index2] = item1; + + return array; +}; + +module.exports = Swap; + + +/***/ }), + +/***/ 1953: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Utils.Array + */ + +module.exports = { + + Matrix: __webpack_require__(1237), + + Add: __webpack_require__(1792), + AddAt: __webpack_require__(2280), + BringToTop: __webpack_require__(2513), + CountAllMatching: __webpack_require__(1771), + Each: __webpack_require__(7883), + EachInRange: __webpack_require__(5856), + FindClosestInSorted: __webpack_require__(3957), + Flatten: __webpack_require__(4493), + GetAll: __webpack_require__(6245), + GetFirst: __webpack_require__(1647), + GetRandom: __webpack_require__(5301), + MoveDown: __webpack_require__(1842), + MoveTo: __webpack_require__(1419), + MoveUp: __webpack_require__(6512), + MoveAbove: __webpack_require__(8683), + MoveBelow: __webpack_require__(546), + NumberArray: __webpack_require__(4130), + NumberArrayStep: __webpack_require__(1316), + QuickSelect: __webpack_require__(9465), + Range: __webpack_require__(9703), + Remove: __webpack_require__(7161), + RemoveAt: __webpack_require__(4725), + RemoveBetween: __webpack_require__(8780), + RemoveRandomElement: __webpack_require__(5744), + Replace: __webpack_require__(6960), + RotateLeft: __webpack_require__(1021), + RotateRight: __webpack_require__(4027), + SafeRange: __webpack_require__(2497), + SendToBack: __webpack_require__(5361), + SetAll: __webpack_require__(3718), + Shuffle: __webpack_require__(4912), + SortByDigits: __webpack_require__(2071), + SpliceOne: __webpack_require__(8935), + StableSort: __webpack_require__(9992), + Swap: __webpack_require__(2372) + +}; + + +/***/ }), + +/***/ 1816: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if an array can be used as a matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.CheckMatrix + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix] + * + * @param {T[][]} [matrix] - The array to check. + * + * @return {boolean} `true` if the given `matrix` array is a valid matrix. + */ +var CheckMatrix = function (matrix) +{ + if (!Array.isArray(matrix) || !Array.isArray(matrix[0])) + { + return false; + } + + // How long is the first row? + var size = matrix[0].length; + + // Validate the rest of the rows are the same length + for (var i = 1; i < matrix.length; i++) + { + if (matrix[i].length !== size) + { + return false; + } + } + + return true; +}; + +module.exports = CheckMatrix; + + +/***/ }), + +/***/ 6655: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Pad = __webpack_require__(7222); +var CheckMatrix = __webpack_require__(1816); + +/** + * Generates a string (which you can pass to console.log) from the given Array Matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.MatrixToString + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix] + * + * @param {T[][]} [matrix] - A 2-dimensional array. + * + * @return {string} A string representing the matrix. + */ +var MatrixToString = function (matrix) +{ + var str = ''; + + if (!CheckMatrix(matrix)) + { + return str; + } + + for (var r = 0; r < matrix.length; r++) + { + for (var c = 0; c < matrix[r].length; c++) + { + var cell = matrix[r][c].toString(); + + if (cell !== 'undefined') + { + str += Pad(cell, 2); + } + else + { + str += '?'; + } + + if (c < matrix[r].length - 1) + { + str += ' |'; + } + } + + if (r < matrix.length - 1) + { + str += '\n'; + + for (var i = 0; i < matrix[r].length; i++) + { + str += '---'; + + if (i < matrix[r].length - 1) + { + str += '+'; + } + } + + str += '\n'; + } + + } + + return str; +}; + +module.exports = MatrixToString; + + +/***/ }), + +/***/ 582: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Reverses the columns in the given Array Matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.ReverseColumns + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to reverse the columns for. + * + * @return {T[][]} The column reversed matrix. + */ +var ReverseColumns = function (matrix) +{ + return matrix.reverse(); +}; + +module.exports = ReverseColumns; + + +/***/ }), + +/***/ 6063: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Reverses the rows in the given Array Matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.ReverseRows + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to reverse the rows for. + * + * @return {T[][]} The column reversed matrix. + */ +var ReverseRows = function (matrix) +{ + for (var i = 0; i < matrix.length; i++) + { + matrix[i].reverse(); + } + + return matrix; +}; + +module.exports = ReverseRows; + + +/***/ }), + +/***/ 8321: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateMatrix = __webpack_require__(7116); + +/** + * Rotates the array matrix 180 degrees. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.Rotate180 + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var Rotate180 = function (matrix) +{ + return RotateMatrix(matrix, 180); +}; + +module.exports = Rotate180; + + +/***/ }), + +/***/ 2597: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateMatrix = __webpack_require__(7116); + +/** + * Rotates the array matrix to the left (or 90 degrees) + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.RotateLeft + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var RotateLeft = function (matrix) +{ + return RotateMatrix(matrix, 90); +}; + +module.exports = RotateLeft; + + +/***/ }), + +/***/ 7116: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CheckMatrix = __webpack_require__(1816); +var TransposeMatrix = __webpack_require__(4780); + +/** + * Rotates the array matrix based on the given rotation value. + * + * The value can be given in degrees: 90, -90, 270, -270 or 180, + * or a string command: `rotateLeft`, `rotateRight` or `rotate180`. + * + * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.RotateMatrix + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * @param {(number|string)} [direction=90] - The amount to rotate the matrix by. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var RotateMatrix = function (matrix, direction) +{ + if (direction === undefined) { direction = 90; } + + if (!CheckMatrix(matrix)) + { + return null; + } + + if (typeof direction !== 'string') + { + direction = ((direction % 360) + 360) % 360; + } + + if (direction === 90 || direction === -270 || direction === 'rotateLeft') + { + matrix = TransposeMatrix(matrix); + matrix.reverse(); + } + else if (direction === -90 || direction === 270 || direction === 'rotateRight') + { + matrix.reverse(); + matrix = TransposeMatrix(matrix); + } + else if (Math.abs(direction) === 180 || direction === 'rotate180') + { + for (var i = 0; i < matrix.length; i++) + { + matrix[i].reverse(); + } + + matrix.reverse(); + } + + return matrix; +}; + +module.exports = RotateMatrix; + + +/***/ }), + +/***/ 6285: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateMatrix = __webpack_require__(7116); + +/** + * Rotates the array matrix to the left (or -90 degrees) + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.RotateRight + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var RotateRight = function (matrix) +{ + return RotateMatrix(matrix, -90); +}; + +module.exports = RotateRight; + + +/***/ }), + +/***/ 7711: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateLeft = __webpack_require__(1021); +var RotateRight = __webpack_require__(4027); + +/** + * Translates the given Array Matrix by shifting each column and row the + * amount specified. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.Translate + * @since 3.50.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to translate. + * @param {number} [x=0] - The amount to horizontally translate the matrix by. + * @param {number} [y=0] - The amount to vertically translate the matrix by. + * + * @return {T[][]} The translated matrix. + */ +var TranslateMatrix = function (matrix, x, y) +{ + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + // Vertical translation + + if (y !== 0) + { + if (y < 0) + { + // Shift Up + RotateLeft(matrix, Math.abs(y)); + } + else + { + // Shift Down + RotateRight(matrix, y); + } + } + + // Horizontal translation + + if (x !== 0) + { + for (var i = 0; i < matrix.length; i++) + { + var row = matrix[i]; + + if (x < 0) + { + RotateLeft(row, Math.abs(x)); + } + else + { + RotateRight(row, x); + } + } + } + + return matrix; +}; + +module.exports = TranslateMatrix; + + +/***/ }), + +/***/ 4780: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Transposes the elements of the given matrix (array of arrays). + * + * The transpose of a matrix is a new matrix whose rows are the columns of the original. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.TransposeMatrix + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [array,$return] + * + * @param {T[][]} [array] - The array matrix to transpose. + * + * @return {T[][]} A new array matrix which is a transposed version of the given array. + */ +var TransposeMatrix = function (array) +{ + var sourceRowCount = array.length; + var sourceColCount = array[0].length; + + var result = new Array(sourceColCount); + + for (var i = 0; i < sourceColCount; i++) + { + result[i] = new Array(sourceRowCount); + + for (var j = sourceRowCount - 1; j > -1; j--) + { + result[i][j] = array[j][i]; + } + } + + return result; +}; + +module.exports = TransposeMatrix; + + +/***/ }), + +/***/ 1237: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Utils.Array.Matrix + */ + +module.exports = { + + CheckMatrix: __webpack_require__(1816), + MatrixToString: __webpack_require__(6655), + ReverseColumns: __webpack_require__(582), + ReverseRows: __webpack_require__(6063), + Rotate180: __webpack_require__(8321), + RotateLeft: __webpack_require__(2597), + RotateMatrix: __webpack_require__(7116), + RotateRight: __webpack_require__(6285), + Translate: __webpack_require__(7711), + TransposeMatrix: __webpack_require__(4780) + +}; + + +/***/ }), + +/***/ 3911: +/***/ ((module) => { /** * @author Richard Davey @@ -49142,8 +53941,9 @@ module.exports = DeepCopy; /***/ }), -/* 337 */ -/***/ (function(module, exports) { + +/***/ 1030: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey @@ -49151,978 +53951,233 @@ module.exports = DeepCopy; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var IsPlainObject = __webpack_require__(2482); + +// @param {boolean} deep - Perform a deep copy? +// @param {object} target - The target object to copy to. +// @return {object} The extended object. + /** - * Provides methods used for getting and setting the size of a Game Object. + * This is a slightly modified version of http://api.jquery.com/jQuery.extend/ * - * @namespace Phaser.GameObjects.Components.Size + * @function Phaser.Utils.Objects.Extend * @since 3.0.0 - */ - -var Size = { - - /** - * A property indicating that a Game Object has this component. - * - * @name Phaser.GameObjects.Components.Size#_sizeComponent - * @type {boolean} - * @private - * @default true - * @since 3.2.0 - */ - _sizeComponent: true, - - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - * - * @name Phaser.GameObjects.Components.Size#width - * @type {number} - * @since 3.0.0 - */ - width: 0, - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - * - * @name Phaser.GameObjects.Components.Size#height - * @type {number} - * @since 3.0.0 - */ - height: 0, - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.Size#displayWidth - * @type {number} - * @since 3.0.0 - */ - displayWidth: { - - get: function () - { - return Math.abs(this.scaleX * this.frame.realWidth); - }, - - set: function (value) - { - this.scaleX = value / this.frame.realWidth; - } - - }, - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.Size#displayHeight - * @type {number} - * @since 3.0.0 - */ - displayHeight: { - - get: function () - { - return Math.abs(this.scaleY * this.frame.realHeight); - }, - - set: function (value) - { - this.scaleY = value / this.frame.realHeight; - } - - }, - - /** - * Sets the size of this Game Object to be that of the given Frame. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * - * @method Phaser.GameObjects.Components.Size#setSizeToFrame - * @since 3.0.0 - * - * @param {Phaser.Textures.Frame} frame - The frame to base the size of this Game Object on. - * - * @return {this} This Game Object instance. - */ - setSizeToFrame: function (frame) - { - if (frame === undefined) { frame = this.frame; } - - this.width = frame.realWidth; - this.height = frame.realHeight; - - var input = this.input; - - if (input && !input.customHitArea) - { - input.hitArea.width = this.width; - input.hitArea.height = this.height; - } - - return this; - }, - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * - * @method Phaser.GameObjects.Components.Size#setSize - * @since 3.0.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setSize: function (width, height) - { - this.width = width; - this.height = height; - - return this; - }, - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * - * @method Phaser.GameObjects.Components.Size#setDisplaySize - * @since 3.0.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setDisplaySize: function (width, height) - { - this.displayWidth = width; - this.displayHeight = height; - - return this; - } - -}; - -module.exports = Size; - - -/***/ }), -/* 338 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Frame = __webpack_require__(69); - -// bitmask flag for GameObject.renderMask -var _FLAG = 8; // 1000 - -/** - * Provides methods used for getting and setting the texture of a Game Object. * - * @namespace Phaser.GameObjects.Components.Texture - * @since 3.0.0 - */ - -var Texture = { - - /** - * The Texture this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.Texture#texture - * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} - * @since 3.0.0 - */ - texture: null, - - /** - * The Texture Frame this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.Texture#frame - * @type {Phaser.Textures.Frame} - * @since 3.0.0 - */ - frame: null, - - /** - * Internal flag. Not to be set by this Game Object. - * - * @name Phaser.GameObjects.Components.Texture#isCropped - * @type {boolean} - * @private - * @since 3.11.0 - */ - isCropped: false, - - /** - * Sets the texture and frame this Game Object will use to render with. - * - * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * - * @method Phaser.GameObjects.Components.Texture#setTexture - * @since 3.0.0 - * - * @param {(string|Phaser.Textures.Texture)} key - The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. - * @param {(string|number)} [frame] - The name or index of the frame within the Texture. - * - * @return {this} This Game Object instance. - */ - setTexture: function (key, frame) - { - this.texture = this.scene.sys.textures.get(key); - - return this.setFrame(frame); - }, - - /** - * Sets the frame this Game Object will use to render with. - * - * If you pass a string or index then the Frame has to belong to the current Texture being used - * by this Game Object. - * - * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * - * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * - * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. - * - * @method Phaser.GameObjects.Components.Texture#setFrame - * @since 3.0.0 - * - * @param {(string|number|Phaser.Textures.Frame)} frame - The name or index of the frame within the Texture, or a Frame instance. - * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? - * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? - * - * @return {this} This Game Object instance. - */ - setFrame: function (frame, updateSize, updateOrigin) - { - if (updateSize === undefined) { updateSize = true; } - if (updateOrigin === undefined) { updateOrigin = true; } - - if (frame instanceof Frame) - { - this.texture = this.scene.sys.textures.get(frame.texture.key); - - this.frame = frame; - } - else - { - this.frame = this.texture.get(frame); - } - - if (!this.frame.cutWidth || !this.frame.cutHeight) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - - if (this._sizeComponent && updateSize) - { - this.setSizeToFrame(); - } - - if (this._originComponent && updateOrigin) - { - if (this.frame.customPivot) - { - this.setOrigin(this.frame.pivotX, this.frame.pivotY); - } - else - { - this.updateDisplayOrigin(); - } - } - - return this; - } - -}; - -module.exports = Texture; - - -/***/ }), -/* 339 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Frame = __webpack_require__(69); - -// bitmask flag for GameObject.renderMask -var _FLAG = 8; // 1000 - -/** - * Provides methods used for getting and setting the texture of a Game Object. + * @param {...*} [args] - The objects that will be mixed. * - * @namespace Phaser.GameObjects.Components.TextureCrop - * @since 3.0.0 + * @return {object} The extended object. */ - -var TextureCrop = { - - /** - * The Texture this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.TextureCrop#texture - * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} - * @since 3.0.0 - */ - texture: null, - - /** - * The Texture Frame this Game Object is using to render with. - * - * @name Phaser.GameObjects.Components.TextureCrop#frame - * @type {Phaser.Textures.Frame} - * @since 3.0.0 - */ - frame: null, - - /** - * A boolean flag indicating if this Game Object is being cropped or not. - * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. - * Equally, calling `setCrop` with no arguments will reset the crop and disable it. - * - * @name Phaser.GameObjects.Components.TextureCrop#isCropped - * @type {boolean} - * @since 3.11.0 - */ - isCropped: false, - - /** - * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * - * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * - * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just - * changes what is shown when rendered. - * - * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * - * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left - * half of it, you could call `setCrop(0, 0, 400, 600)`. - * - * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop - * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * - * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * - * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * - * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow - * the renderer to skip several internal calculations. - * - * @method Phaser.GameObjects.Components.TextureCrop#setCrop - * @since 3.11.0 - * - * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. - * @param {number} [y] - The y coordinate to start the crop from. - * @param {number} [width] - The width of the crop rectangle in pixels. - * @param {number} [height] - The height of the crop rectangle in pixels. - * - * @return {this} This Game Object instance. - */ - setCrop: function (x, y, width, height) - { - if (x === undefined) - { - this.isCropped = false; - } - else if (this.frame) - { - if (typeof x === 'number') - { - this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY); - } - else - { - var rect = x; - - this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY); - } - - this.isCropped = true; - } - - return this; - }, - - /** - * Sets the texture and frame this Game Object will use to render with. - * - * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * - * @method Phaser.GameObjects.Components.TextureCrop#setTexture - * @since 3.0.0 - * - * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|number)} [frame] - The name or index of the frame within the Texture. - * - * @return {this} This Game Object instance. - */ - setTexture: function (key, frame) - { - this.texture = this.scene.sys.textures.get(key); - - return this.setFrame(frame); - }, - - /** - * Sets the frame this Game Object will use to render with. - * - * If you pass a string or index then the Frame has to belong to the current Texture being used - * by this Game Object. - * - * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * - * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * - * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. - * - * @method Phaser.GameObjects.Components.TextureCrop#setFrame - * @since 3.0.0 - * - * @param {(string|number|Phaser.Textures.Frame)} frame - The name or index of the frame within the Texture, or a Frame instance. - * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? - * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? - * - * @return {this} This Game Object instance. - */ - setFrame: function (frame, updateSize, updateOrigin) - { - if (updateSize === undefined) { updateSize = true; } - if (updateOrigin === undefined) { updateOrigin = true; } - - if (frame instanceof Frame) - { - this.texture = this.scene.sys.textures.get(frame.texture.key); - - this.frame = frame; - } - else - { - this.frame = this.texture.get(frame); - } - - if (!this.frame.cutWidth || !this.frame.cutHeight) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - - if (this._sizeComponent && updateSize) - { - this.setSizeToFrame(); - } - - if (this._originComponent && updateOrigin) - { - if (this.frame.customPivot) - { - this.setOrigin(this.frame.pivotX, this.frame.pivotY); - } - else - { - this.updateDisplayOrigin(); - } - } - - if (this.isCropped) - { - this.frame.updateCropUVs(this._crop, this.flipX, this.flipY); - } - - return this; - }, - - /** - * Internal method that returns a blank, well-formed crop object for use by a Game Object. - * - * @method Phaser.GameObjects.Components.TextureCrop#resetCropObject - * @private - * @since 3.12.0 - * - * @return {object} The crop object. - */ - resetCropObject: function () - { - return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 }; - } - -}; - -module.exports = TextureCrop; - - -/***/ }), -/* 340 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for setting the tint of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Tint - * @webglOnly - * @since 3.0.0 - */ - -var Tint = { - - /** - * The tint value being applied to the top-left vertice of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. - * - * @name Phaser.GameObjects.Components.Tint#tintTopLeft - * @type {number} - * @default 0xffffff - * @since 3.0.0 - */ - tintTopLeft: 0xffffff, - - /** - * The tint value being applied to the top-right vertice of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. - * - * @name Phaser.GameObjects.Components.Tint#tintTopRight - * @type {number} - * @default 0xffffff - * @since 3.0.0 - */ - tintTopRight: 0xffffff, - - /** - * The tint value being applied to the bottom-left vertice of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomLeft - * @type {number} - * @default 0xffffff - * @since 3.0.0 - */ - tintBottomLeft: 0xffffff, - - /** - * The tint value being applied to the bottom-right vertice of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomRight - * @type {number} - * @default 0xffffff - * @since 3.0.0 - */ - tintBottomRight: 0xffffff, - - /** - * The tint fill mode. - * - * `false` = An additive tint (the default), where vertices colors are blended with the texture. - * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. - * - * @name Phaser.GameObjects.Components.Tint#tintFill - * @type {boolean} - * @default false - * @since 3.11.0 - */ - tintFill: false, - - /** - * Clears all tint values associated with this Game Object. - * - * Immediately sets the color values back to 0xffffff and the tint type to 'additive', - * which results in no visible change to the texture. - * - * @method Phaser.GameObjects.Components.Tint#clearTint - * @webglOnly - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - clearTint: function () - { - this.setTint(0xffffff); - - return this; - }, - - /** - * Sets an additive tint on this Game Object. - * - * The tint works by taking the pixel color values from the Game Objects texture, and then - * multiplying it by the color value of the tint. You can provide either one color value, - * in which case the whole Game Object will be tinted in that color. Or you can provide a color - * per corner. The colors are blended together across the extent of the Game Object. - * - * To modify the tint color once set, either call this method again with new values or use the - * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, - * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * - * To remove a tint call `clearTint`. - * - * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. - * - * @method Phaser.GameObjects.Components.Tint#setTint - * @webglOnly - * @since 3.0.0 - * - * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. - * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. - * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. - * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. - * - * @return {this} This Game Object instance. - */ - setTint: function (topLeft, topRight, bottomLeft, bottomRight) - { - if (topLeft === undefined) { topLeft = 0xffffff; } - - if (topRight === undefined) - { - topRight = topLeft; - bottomLeft = topLeft; - bottomRight = topLeft; - } - - this.tintTopLeft = topLeft; - this.tintTopRight = topRight; - this.tintBottomLeft = bottomLeft; - this.tintBottomRight = bottomRight; - - this.tintFill = false; - - return this; - }, - - /** - * Sets a fill-based tint on this Game Object. - * - * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture - * with those in the tint. You can use this for effects such as making a player flash 'white' - * if hit by something. You can provide either one color value, in which case the whole - * Game Object will be rendered in that color. Or you can provide a color per corner. The colors - * are blended together across the extent of the Game Object. - * - * To modify the tint color once set, either call this method again with new values or use the - * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, - * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * - * To remove a tint call `clearTint`. - * - * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. - * - * @method Phaser.GameObjects.Components.Tint#setTintFill - * @webglOnly - * @since 3.11.0 - * - * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. - * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. - * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. - * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. - * - * @return {this} This Game Object instance. - */ - setTintFill: function (topLeft, topRight, bottomLeft, bottomRight) - { - this.setTint(topLeft, topRight, bottomLeft, bottomRight); - - this.tintFill = true; - - return this; - }, - - /** - * The tint value being applied to the whole of the Game Object. - * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. - * - * @name Phaser.GameObjects.Components.Tint#tint - * @type {number} - * @webglOnly - * @since 3.0.0 - */ - tint: { - - set: function (value) - { - this.setTint(value, value, value, value); - } - }, - - /** - * Does this Game Object have a tint applied? - * - * It checks to see if the 4 tint properties are set to the value 0xffffff - * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. - * - * @name Phaser.GameObjects.Components.Tint#isTinted - * @type {boolean} - * @webglOnly - * @readonly - * @since 3.11.0 - */ - isTinted: { - - get: function () - { - var white = 0xffffff; - - return ( - this.tintFill || - this.tintTopLeft !== white || - this.tintTopRight !== white || - this.tintBottomLeft !== white || - this.tintBottomRight !== white - ); - } - - } - -}; - -module.exports = Tint; - - -/***/ }), -/* 341 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var NOOP = __webpack_require__(2); -var renderWebGL = NOOP; -var renderCanvas = NOOP; - -if (true) +var Extend = function () { - renderWebGL = __webpack_require__(342); -} + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; -if (false) -{} + // Handle a deep copy situation + if (typeof target === 'boolean') + { + deep = target; + target = arguments[1] || {}; -module.exports = { + // skip the boolean and the target + i = 2; + } - renderWebGL: renderWebGL, - renderCanvas: renderCanvas + // extend Phaser if only one argument is passed + if (length === i) + { + target = this; + --i; + } + for (; i < length; i++) + { + // Only deal with non-null/undefined values + if ((options = arguments[i]) != null) + { + // Extend the base object + for (name in options) + { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target === copy) + { + continue; + } + + // Recurse if we're merging plain objects or arrays + if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) + { + if (copyIsArray) + { + copyIsArray = false; + clone = src && Array.isArray(src) ? src : []; + } + else + { + clone = src && IsPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = Extend(deep, clone, copy); + + // Don't bring in undefined values + } + else if (copy !== undefined) + { + target[name] = copy; + } + } + } + } + + // Return the modified object + return target; }; +module.exports = Extend; + /***/ }), -/* 342 */ -/***/ (function(module, exports) { + +/***/ 8361: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH = __webpack_require__(4675); +var GetValue = __webpack_require__(5851); + +/** + * Retrieves a value from an object. Allows for more advanced selection options, including: + * + * Allowed types: + * + * Implicit + * { + * x: 4 + * } + * + * From function + * { + * x: function () + * } + * + * Randomly pick one element from the array + * { + * x: [a, b, c, d, e, f] + * } + * + * Random integer between min and max: + * { + * x: { randInt: [min, max] } + * } + * + * Random float between min and max: + * { + * x: { randFloat: [min, max] } + * } + * + * + * @function Phaser.Utils.Objects.GetAdvancedValue + * @since 3.0.0 + * + * @param {object} source - The object to retrieve the value from. + * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. + * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. + * + * @return {*} The value of the requested key. + */ +var GetAdvancedValue = function (source, key, defaultValue) +{ + var value = GetValue(source, key, null); + + if (value === null) + { + return defaultValue; + } + else if (Array.isArray(value)) + { + return MATH.RND.pick(value); + } + else if (typeof value === 'object') + { + if (value.hasOwnProperty('randInt')) + { + return MATH.RND.integerInRange(value.randInt[0], value.randInt[1]); + } + else if (value.hasOwnProperty('randFloat')) + { + return MATH.RND.realInRange(value.randFloat[0], value.randFloat[1]); + } + } + else if (typeof value === 'function') + { + return value(key); + } + + return value; +}; + +module.exports = GetAdvancedValue; + + +/***/ }), + +/***/ 4597: +/***/ ((module) => { /** * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> * @copyright 2013-2023 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * Renders this Game Object with the WebGL Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. + * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue} * - * @method Phaser.GameObjects.Container#renderWebGL - * @since 3.4.0 - * @private + * @function Phaser.Utils.Objects.GetFastValue + * @since 3.0.0 * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + * @param {object} source - The object to search + * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods) + * @param {*} [defaultValue] - The default value to use if the key does not exist. + * + * @return {*} The value if found; otherwise, defaultValue (null if none provided) */ -var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) +var GetFastValue = function (source, key, defaultValue) { - camera.addToRenderList(container); + var t = typeof(source); - var children = container.list; - var childCount = children.length; - - if (childCount === 0) + if (!source || t === 'number' || t === 'string') { - return; + return defaultValue; } - - var transformMatrix = container.localTransform; - - if (parentMatrix) + else if (source.hasOwnProperty(key) && source[key] !== undefined) { - transformMatrix.loadIdentity(); - transformMatrix.multiply(parentMatrix); - transformMatrix.translate(container.x, container.y); - transformMatrix.rotate(container.rotation); - transformMatrix.scale(container.scaleX, container.scaleY); + return source[key]; } else { - transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); + return defaultValue; } - - renderer.pipelines.preBatch(container); - - var containerHasBlendMode = (container.blendMode !== -1); - - if (!containerHasBlendMode) - { - // If Container is SKIP_TEST then set blend mode to be Normal - renderer.setBlendMode(0); - } - - var alpha = container.alpha; - - var scrollFactorX = container.scrollFactorX; - var scrollFactorY = container.scrollFactorY; - - for (var i = 0; i < childCount; i++) - { - var child = children[i]; - - if (!child.willRender(camera)) - { - continue; - } - - var childAlphaTopLeft; - var childAlphaTopRight; - var childAlphaBottomLeft; - var childAlphaBottomRight; - - if (child.alphaTopLeft !== undefined) - { - childAlphaTopLeft = child.alphaTopLeft; - childAlphaTopRight = child.alphaTopRight; - childAlphaBottomLeft = child.alphaBottomLeft; - childAlphaBottomRight = child.alphaBottomRight; - } - else - { - var childAlpha = child.alpha; - - childAlphaTopLeft = childAlpha; - childAlphaTopRight = childAlpha; - childAlphaBottomLeft = childAlpha; - childAlphaBottomRight = childAlpha; - } - - var childScrollFactorX = child.scrollFactorX; - var childScrollFactorY = child.scrollFactorY; - - if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode) - { - // If Container doesn't have its own blend mode, then a child can have one - renderer.setBlendMode(child.blendMode); - } - - var mask = child.mask; - - if (mask) - { - mask.preRenderWebGL(renderer, child, camera); - } - - var type = child.type; - - if (type !== renderer.currentType) - { - renderer.newType = true; - renderer.currentType = type; - } - - renderer.nextTypeMatch = (i < childCount - 1) ? (children[i + 1].type === renderer.currentType) : false; - - // Set parent values - child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); - - child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha); - - // Render - child.renderWebGL(renderer, child, camera, transformMatrix, container); - - // Restore original values - - child.setAlpha(childAlphaTopLeft, childAlphaTopRight, childAlphaBottomLeft, childAlphaBottomRight); - - child.setScrollFactor(childScrollFactorX, childScrollFactorY); - - if (mask) - { - mask.postRenderWebGL(renderer, camera); - } - - renderer.newType = false; - } - - renderer.pipelines.postBatch(container); }; -module.exports = ContainerWebGLRenderer; +module.exports = GetFastValue; /***/ }), -/* 343 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 5851: +/***/ ((module) => { /** * @author Richard Davey @@ -50130,192 +54185,283 @@ module.exports = ContainerWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(29); - /** - * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union. + * Retrieves a value from an object, or an alternative object, falling to a back-up default value if not found. * - * @function Phaser.Geom.Rectangle.Union + * The key is a string, which can be split based on the use of the period character. + * + * For example: + * + * ```javascript + * const source = { + * lives: 3, + * render: { + * screen: { + * width: 1024 + * } + * } + * } + * + * const lives = GetValue(source, 'lives', 1); + * const width = GetValue(source, 'render.screen.width', 800); + * const height = GetValue(source, 'render.screen.height', 600); + * ``` + * + * In the code above, `lives` will be 3 because it's defined at the top level of `source`. + * The `width` value will be 1024 because it can be found inside the `render.screen` object. + * The `height` value will be 600, the default value, because it is missing from the `render.screen` object. + * + * @function Phaser.Utils.Objects.GetValue * @since 3.0.0 * - * @generic {Phaser.Geom.Rectangle} O - [out,$return] + * @param {object} source - The primary object to try to retrieve the value from. If not found in here, `altSource` is checked. + * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. + * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. + * @param {object} [altSource] - An alternative object to retrieve the value from. If the property exists in `source` then `altSource` will not be used. * - * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to use. - * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to use. - * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the union in. - * - * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided. + * @return {*} The value of the requested key. */ -var Union = function (rectA, rectB, out) +var GetValue = function (source, key, defaultValue, altSource) { - if (out === undefined) { out = new Rectangle(); } - - // Cache vars so we can use one of the input rects as the output rect - var x = Math.min(rectA.x, rectB.x); - var y = Math.min(rectA.y, rectB.y); - var w = Math.max(rectA.right, rectB.right) - x; - var h = Math.max(rectA.bottom, rectB.bottom) - y; - - return out.setTo(x, y, w, h); -}; - -module.exports = Union; - - -/***/ }), -/* 344 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var renderWebGL = __webpack_require__(2); -var renderCanvas = __webpack_require__(2); - -if (true) -{ - renderWebGL = __webpack_require__(345); -} - -if (false) -{} - -module.exports = { - - renderWebGL: renderWebGL, - renderCanvas: renderCanvas - -}; - - -/***/ }), -/* 345 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Renders this Game Object with the WebGL Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * @method SpineContainerWebGLRenderer#renderWebGL - * @since 3.50.0 - * @private - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {SpineContainer} container - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - */ -var SpineContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) -{ - var plugin = container.plugin; - var sceneRenderer = plugin.sceneRenderer; - var children = container.list; - - if (children.length === 0) + if ((!source && !altSource) || typeof source === 'number') { - if (sceneRenderer.batcher.isDrawing && renderer.finalType) - { - sceneRenderer.end(); + return defaultValue; + } + else if (source && source.hasOwnProperty(key)) + { + return source[key]; + } + else if (altSource && altSource.hasOwnProperty(key)) + { + return altSource[key]; + } + else if (key.indexOf('.') !== -1) + { + var keys = key.split('.'); + var parentA = source; + var parentB = altSource; + var valueA = defaultValue; + var valueB = defaultValue; + var valueAFound = true; + var valueBFound = true; - renderer.pipelines.rebind(); + // Use for loop here so we can break early + for (var i = 0; i < keys.length; i++) + { + if (parentA && parentA.hasOwnProperty(keys[i])) + { + // Yes parentA has a key property, let's carry on down + valueA = parentA[keys[i]]; + parentA = parentA[keys[i]]; + } + else + { + valueAFound = false; + } + + if (parentB && parentB.hasOwnProperty(keys[i])) + { + // Yes parentB has a key property, let's carry on down + valueB = parentB[keys[i]]; + parentB = parentB[keys[i]]; + } + else + { + valueBFound = false; + } } - return; - } - - camera.addToRenderList(container); - - var transformMatrix = container.localTransform; - - if (parentMatrix) - { - transformMatrix.loadIdentity(); - transformMatrix.multiply(parentMatrix); - transformMatrix.translate(container.x, container.y); - transformMatrix.rotate(container.rotation); - transformMatrix.scale(container.scaleX, container.scaleY); + if (valueAFound) + { + return valueA; + } + else if (valueBFound) + { + return valueB; + } + else + { + return defaultValue; + } } else { - transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); - } - - if (renderer.newType) - { - // flush + clear if this is a new type - renderer.pipelines.clear(); - - sceneRenderer.begin(); - } - - var rendererNextType = renderer.nextTypeMatch; - - // Force these to avoid batch flushing during SpineGameObject.renderWebGL - renderer.nextTypeMatch = true; - renderer.newType = false; - - for (var i = 0; i < children.length; i++) - { - var child = children[i]; - - if (child.willRender(camera, container)) - { - var mask = child.mask; - - if (mask) - { - sceneRenderer.end(); - - renderer.pipelines.rebind(); - - mask.preRenderWebGL(renderer, child, camera); - - renderer.pipelines.clear(); - - sceneRenderer.begin(); - } - - child.renderWebGL(renderer, child, camera, transformMatrix, container); - - if (mask) - { - sceneRenderer.end(); - - renderer.pipelines.rebind(); - - mask.postRenderWebGL(renderer, camera); - - renderer.pipelines.clear(); - - sceneRenderer.begin(); - } - } - } - - renderer.nextTypeMatch = rendererNextType; - - if (!rendererNextType) - { - // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch - sceneRenderer.end(); - - // And rebind the previous pipeline - renderer.pipelines.rebind(); + return defaultValue; } }; -module.exports = SpineContainerWebGLRenderer; +module.exports = GetValue; + + +/***/ }), + +/***/ 2482: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * This is a slightly modified version of jQuery.isPlainObject. + * A plain object is an object whose internal class property is [object Object]. + * + * @function Phaser.Utils.Objects.IsPlainObject + * @since 3.0.0 + * + * @param {object} obj - The object to inspect. + * + * @return {boolean} `true` if the object is plain, otherwise `false`. + */ +var IsPlainObject = function (obj) +{ + // Not plain objects: + // - Any object or value whose internal [[Class]] property is not "[object Object]" + // - DOM nodes + // - window + if (!obj || typeof(obj) !== 'object' || obj.nodeType || obj === obj.window) + { + return false; + } + + // Support: Firefox <20 + // The try/catch suppresses exceptions thrown when attempting to access + // the "constructor" property of certain host objects, ie. |window.location| + // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 + try + { + if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf')) + { + return false; + } + } + catch (e) + { + return false; + } + + // If the function hasn't returned already, we're confident that + // |obj| is a plain object, created by {} or constructed with new Object + return true; +}; + +module.exports = IsPlainObject; + + +/***/ }), + +/***/ 7222: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2013-2023 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes the given string and pads it out, to the length required, using the character + * specified. For example if you need a string to be 6 characters long, you can call: + * + * `pad('bob', 6, '-', 2)` + * + * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right. + * + * You can also use it to pad numbers (they are always returned as strings): + * + * `pad(512, 6, '0', 1)` + * + * Would return: `000512` with the string padded to the left. + * + * If you don't specify a direction it'll pad to both sides: + * + * `pad('c64', 7, '*')` + * + * Would return: `**c64**` + * + * @function Phaser.Utils.String.Pad + * @since 3.0.0 + * + * @param {string|number|object} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. + * @param {number} [len=0] - The number of characters to be added. + * @param {string} [pad=" "] - The string to pad it out with (defaults to a space). + * @param {number} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). + * + * @return {string} The padded string. + */ +var Pad = function (str, len, pad, dir) +{ + if (len === undefined) { len = 0; } + if (pad === undefined) { pad = ' '; } + if (dir === undefined) { dir = 3; } + + str = str.toString(); + + var padlen = 0; + + if (len + 1 >= str.length) + { + switch (dir) + { + case 1: + str = new Array(len + 1 - str.length).join(pad) + str; + break; + + case 3: + var right = Math.ceil((padlen = len - str.length) / 2); + var left = padlen - right; + str = new Array(left + 1).join(pad) + str + new Array(right + 1).join(pad); + break; + + default: + str = str + new Array(len + 1 - str.length).join(pad); + break; + } + } + + return str; +}; + +module.exports = Pad; /***/ }) -/******/ ]); \ No newline at end of file + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module is referenced by other modules so it can't be inlined +/******/ var __webpack_exports__ = __webpack_require__(4513); +/******/ window.SpinePlugin = __webpack_exports__; +/******/ +/******/ })() +; \ No newline at end of file diff --git a/plugins/spine4.1/dist/SpineWebGLPlugin.min.js b/plugins/spine4.1/dist/SpineWebGLPlugin.min.js index 1dfcc3a0d..7595ba124 100644 --- a/plugins/spine4.1/dist/SpineWebGLPlugin.min.js +++ b/plugins/spine4.1/dist/SpineWebGLPlugin.min.js @@ -1,1266 +1 @@ -window.SpinePlugin=function(t){var e={};function i(s){if(e[s])return e[s].exports;var n=e[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(s,n,function(e){return t[e]}.bind(null,n));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=70)}([function(t,e){function i(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||! -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function s(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function n(t,e,n,r){for(var o in e)if(e.hasOwnProperty(o)){var h=i(e,o,n);if(!1!==h){if(s((r||t).prototype,o)){if(a.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=e[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(35),r=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new r(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return n(this.x,t.x,e)&&n(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});r.ZERO=new r,r.RIGHT=new r(1,0),r.LEFT=new r(-1,0),r.UP=new r(0,-1),r.DOWN=new r(0,1),r.ONE=new r(1,1),t.exports=r},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=i},function(t,e){t.exports=function(t,e,i,s){var n=t.length;if(e<0||e>n||e>=i||i>n){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e){t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},function(t,e){t.exports=function(t,e,i){var s=i-e;return e+((t-e)%s+s)%s}},function(t,e){t.exports=function(t,e,i,s){if(!t&&!s||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(s&&s.hasOwnProperty(e))return s[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),r=t,a=s,o=i,h=i,l=!0,c=!0,u=0;u=t.length)){for(var i=t.length-1,s=t[e],n=e;n - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(30),r=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=n.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=r},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(4);t.exports=function(t){return t>Math.PI&&(t-=s.PI2),Math.abs(((t+s.TAU)%s.PI2-s.PI2)%s.PI2)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=new(i(0))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,n=t.z,r=e.x,a=e.y,o=e.z;return this.x=s*o-n*a,this.y=n*r-i*o,this.z=i*a-s*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z;return this.x=i*a-s*r,this.y=s*n-e*a,this.z=e*r-i*n,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[3]*i+n[6]*s,this.y=n[1]*e+n[4]*i+n[7]*s,this.z=n[2]*e+n[5]*i+n[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=1/(n[3]*e+n[7]*i+n[11]*s+n[15]);return this.x=(n[0]*e+n[4]*i+n[8]*s+n[12])*r,this.y=(n[1]*e+n[5]*i+n[9]*s+n[13])*r,this.z=(n[2]*e+n[6]*i+n[10]*s+n[14])*r,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=e*n[0]+i*n[3]+s*n[6],this.y=e*n[1]+i*n[4]+s*n[7],this.z=e*n[2]+i*n[5]+s*n[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12],this.y=n[1]*e+n[5]*i+n[9]*s+n[13],this.z=n[2]*e+n[6]*i+n[10]*s+n[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=e*n[0]+i*n[4]+s*n[8]+n[12],a=e*n[1]+i*n[5]+s*n[9]+n[13],o=e*n[2]+i*n[6]+s*n[10]+n[14],h=e*n[3]+i*n[7]+s*n[11]+n[15];return this.x=r/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z,o=t.w,h=o*e+r*s-a*i,l=o*i+a*e-n*s,c=o*s+n*i-r*e,u=-n*e-r*i-a*s;return this.x=h*o+u*-n+l*-a-c*-r,this.y=l*o+u*-r+c*-n-h*-a,this.z=c*o+u*-a+h*-r-l*-n,this},project:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=n[0],a=n[1],o=n[2],h=n[3],l=n[4],c=n[5],u=n[6],d=n[7],f=n[8],p=n[9],m=n[10],g=n[11],x=n[12],v=n[13],y=n[14],w=1/(e*h+i*d+s*g+n[15]);return this.x=(e*r+i*l+s*f+x)*w,this.y=(e*a+i*c+s*p+v)*w,this.z=(e*o+i*u+s*m+y)*w,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,n=t.z,r=t.w,a=this.x-i,o=r-this.y-1-s,h=this.z;return this.x=2*a/n-1,this.y=2*o/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(4);t.exports=function(t){return t*s.RAD_TO_DEG}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(27),n=i(62);t.exports=function(t,e){if(void 0===e&&(e=90),!s(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=n(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=n(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s,n=i(28),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(s=navigator.userAgent,/Edg\/\d+/.test(s)?(r.edge=!0,r.es2019=!0):/OPR/.test(s)?(r.opera=!0,r.es2019=!0):/Chrome\/(\d+)/.test(s)&&!n.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10),r.es2019=r.chromeVersion>69):/Firefox\D+(\d+)/.test(s)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10),r.es2019=r.firefoxVersion>10):/AppleWebKit/.test(s)&&n.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(s)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+) Safari/.test(s)&&!n.windowsPhone?(r.safari=!0,r.safariVersion=parseInt(RegExp.$1,10),r.es2019=r.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(r.silk=!0),r)},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(6),n=function(){var t,e,i,r,a,o,h=arguments[0]||{},l=1,c=arguments.length,u=!1;for("boolean"==typeof h&&(u=h,h=arguments[1]||{},l=2),c===l&&(h=this,--l);l - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(4);t.exports=function(t){return t*s.DEG_TO_RAD}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(15),r=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new r(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,n,r,a,o,h,l,c,u,d,f,p,m){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=s,g[4]=n,g[5]=r,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=c,g[11]=u,g[12]=d,g[13]=f,g[14]=p,g[15]=m,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=a.fromQuat(i).val,n=e.x,r=e.y,o=e.z;return this.setValues(s[0]*n,s[1]*n,s[2]*n,0,s[4]*r,s[5]*r,s[6]*r,0,s[8]*o,s[9]*o,s[10]*o,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],n=t[6],r=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=n,t[11]=t[14],t[12]=s,t[13]=r,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15],x=e*a-i*r,v=e*o-s*r,y=e*h-n*r,w=i*o-s*a,b=i*h-n*a,M=s*h-n*o,A=l*p-c*f,E=l*m-u*f,S=l*g-d*f,T=c*m-u*p,I=c*g-d*p,C=u*g-d*m,R=x*C-v*I+y*T+w*S-b*E+M*A;return R?(R=1/R,this.setValues((a*C-o*I+h*T)*R,(s*I-i*C-n*T)*R,(p*M-m*b+g*w)*R,(u*b-c*M-d*w)*R,(o*S-r*C-h*E)*R,(e*C-s*S+n*E)*R,(m*y-f*M-g*v)*R,(l*M-u*y+d*v)*R,(r*I-a*S+h*A)*R,(i*S-e*I-n*A)*R,(f*b-p*y+g*x)*R,(c*y-l*b-d*x)*R,(a*E-r*T-o*A)*R,(e*T-i*E+s*A)*R,(p*v-f*w-m*x)*R,(l*w-c*v+u*x)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return this.setValues(a*(u*g-d*m)-c*(o*g-h*m)+p*(o*d-h*u),-(i*(u*g-d*m)-c*(s*g-n*m)+p*(s*d-n*u)),i*(o*g-h*m)-a*(s*g-n*m)+p*(s*h-n*o),-(i*(o*d-h*u)-a*(s*d-n*u)+c*(s*h-n*o)),-(r*(u*g-d*m)-l*(o*g-h*m)+f*(o*d-h*u)),e*(u*g-d*m)-l*(s*g-n*m)+f*(s*d-n*u),-(e*(o*g-h*m)-r*(s*g-n*m)+f*(s*h-n*o)),e*(o*d-h*u)-r*(s*d-n*u)+l*(s*h-n*o),r*(c*g-d*p)-l*(a*g-h*p)+f*(a*d-h*c),-(e*(c*g-d*p)-l*(i*g-n*p)+f*(i*d-n*c)),e*(a*g-h*p)-r*(i*g-n*p)+f*(i*h-n*a),-(e*(a*d-h*c)-r*(i*d-n*c)+l*(i*h-n*a)),-(r*(c*m-u*p)-l*(a*m-o*p)+f*(a*u-o*c)),e*(c*m-u*p)-l*(i*m-s*p)+f*(i*u-s*c),-(e*(a*m-o*p)-r*(i*m-s*p)+f*(i*o-s*a)),e*(a*u-o*c)-r*(i*u-s*c)+l*(i*o-s*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return(e*a-i*r)*(u*g-d*m)-(e*o-s*r)*(c*g-d*p)+(e*h-n*r)*(c*m-u*p)+(i*o-s*a)*(l*g-d*f)-(i*h-n*a)*(l*m-u*f)+(s*h-n*o)*(l*p-c*f)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],g=e[14],x=e[15],v=t.val,y=v[0],w=v[1],b=v[2],M=v[3];return e[0]=y*i+w*a+b*c+M*p,e[1]=y*s+w*o+b*u+M*m,e[2]=y*n+w*h+b*d+M*g,e[3]=y*r+w*l+b*f+M*x,y=v[4],w=v[5],b=v[6],M=v[7],e[4]=y*i+w*a+b*c+M*p,e[5]=y*s+w*o+b*u+M*m,e[6]=y*n+w*h+b*d+M*g,e[7]=y*r+w*l+b*f+M*x,y=v[8],w=v[9],b=v[10],M=v[11],e[8]=y*i+w*a+b*c+M*p,e[9]=y*s+w*o+b*u+M*m,e[10]=y*n+w*h+b*d+M*g,e[11]=y*r+w*l+b*f+M*x,y=v[12],w=v[13],b=v[14],M=v[15],e[12]=y*i+w*a+b*c+M*p,e[13]=y*s+w*o+b*u+M*m,e[14]=y*n+w*h+b*d+M*g,e[15]=y*r+w*l+b*f+M*x,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,n=i[0],r=i[4],a=i[8],o=i[12],h=i[1],l=i[5],c=i[9],u=i[13],d=i[2],f=i[6],p=i[10],m=i[14],g=i[3],x=i[7],v=i[11],y=i[15],w=s[0],b=s[4],M=s[8],A=s[12],E=s[1],S=s[5],T=s[9],I=s[13],C=s[2],R=s[6],k=s[10],F=s[14],L=s[3],P=s[7],Y=s[11],O=s[15];return this.setValues(n*w+r*E+a*C+o*L,h*w+l*E+c*C+u*L,d*w+f*E+p*C+m*L,g*w+x*E+v*C+y*L,n*b+r*S+a*R+o*P,h*b+l*S+c*R+u*P,d*b+f*S+p*R+m*P,g*b+x*S+v*R+y*P,n*M+r*T+a*k+o*Y,h*M+l*T+c*k+u*Y,d*M+f*T+p*k+m*Y,g*M+x*T+v*k+y*Y,n*A+r*I+a*F+o*O,h*A+l*I+c*F+u*O,d*A+f*I+p*F+m*O,g*A+x*I+v*F+y*O)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),n=1-i,r=t.x,a=t.y,o=t.z,h=n*r,l=n*a;return this.setValues(h*r+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*r,0,h*o-s*a,l*o+s*r,n*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,n=e.y,r=e.z,a=Math.sqrt(s*s+n*n+r*r);if(Math.abs(a)<1e-6)return this;s*=a=1/a,n*=a,r*=a;var o=Math.sin(t),h=Math.cos(t),l=1-h,c=i[0],u=i[1],d=i[2],f=i[3],p=i[4],m=i[5],g=i[6],x=i[7],v=i[8],y=i[9],w=i[10],b=i[11],M=i[12],A=i[13],E=i[14],S=i[15],T=s*s*l+h,I=n*s*l+r*o,C=r*s*l-n*o,R=s*n*l-r*o,k=n*n*l+h,F=r*n*l+s*o,L=s*r*l+n*o,P=n*r*l-s*o,Y=r*r*l+h;return this.setValues(c*T+p*I+v*C,u*T+m*I+y*C,d*T+g*I+w*C,f*T+x*I+b*C,c*R+p*k+v*F,u*R+m*k+y*F,d*R+g*k+w*F,f*R+x*k+b*F,c*L+p*P+v*Y,u*L+m*P+y*Y,d*L+g*P+w*Y,f*L+x*P+b*Y,M,A,E,S)},rotateX:function(t){var e=this.val,i=Math.sin(t),s=Math.cos(t),n=e[4],r=e[5],a=e[6],o=e[7],h=e[8],l=e[9],c=e[10],u=e[11];return e[4]=n*s+h*i,e[5]=r*s+l*i,e[6]=a*s+c*i,e[7]=o*s+u*i,e[8]=h*s-n*i,e[9]=l*s-r*i,e[10]=c*s-a*i,e[11]=u*s-o*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),s=Math.cos(t),n=e[0],r=e[1],a=e[2],o=e[3],h=e[8],l=e[9],c=e[10],u=e[11];return e[0]=n*s-h*i,e[1]=r*s-l*i,e[2]=a*s-c*i,e[3]=o*s-u*i,e[8]=n*i+h*s,e[9]=r*i+l*s,e[10]=a*i+c*s,e[11]=o*i+u*s,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),s=Math.cos(t),n=e[0],r=e[1],a=e[2],o=e[3],h=e[4],l=e[5],c=e[6],u=e[7];return e[0]=n*s+h*i,e[1]=r*s+l*i,e[2]=a*s+c*i,e[3]=o*s+u*i,e[4]=h*s-n*i,e[5]=l*s-r*i,e[6]=c*s-a*i,e[7]=u*s-o*i,this},fromRotationTranslation:function(t,e){var i=t.x,s=t.y,n=t.z,r=t.w,a=i+i,o=s+s,h=n+n,l=i*a,c=i*o,u=i*h,d=s*o,f=s*h,p=n*h,m=r*a,g=r*o,x=r*h;return this.setValues(1-(d+p),c+x,u-g,0,c-x,1-(l+p),f+m,0,u+g,f-m,1-(l+d),0,e.x,e.y,e.z,1)},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,n=t.w,r=e+e,a=i+i,o=s+s,h=e*r,l=e*a,c=e*o,u=i*a,d=i*o,f=s*o,p=n*r,m=n*a,g=n*o;return this.setValues(1-(u+f),l+g,c-m,0,l-g,1-(h+f),d+p,0,c+m,d-p,1-(h+u),0,0,0,0,1)},frustum:function(t,e,i,s,n,r){var a=1/(e-t),o=1/(s-i),h=1/(n-r);return this.setValues(2*n*a,0,0,0,0,2*n*o,0,0,(e+t)*a,(s+i)*o,(r+n)*h,-1,0,0,r*n*2*h,0)},perspective:function(t,e,i,s){var n=1/Math.tan(t/2),r=1/(i-s);return this.setValues(n/e,0,0,0,0,n,0,0,0,0,(s+i)*r,-1,0,0,2*s*i*r,0)},perspectiveLH:function(t,e,i,s){return this.setValues(2*i/t,0,0,0,0,2*i/e,0,0,0,0,-s/(i-s),1,0,0,i*s/(i-s),0)},ortho:function(t,e,i,s,n,r){var a=t-e,o=i-s,h=n-r;return a=0===a?a:1/a,o=0===o?o:1/o,h=0===h?h:1/h,this.setValues(-2*a,0,0,0,0,-2*o,0,0,0,0,2*h,0,(t+e)*a,(s+i)*o,(r+n)*h,1)},lookAtRH:function(t,e,i){var s=this.val;return c.subVectors(t,e),0===c.getLengthSquared()&&(c.z=1),c.normalize(),h.crossVectors(i,c),0===h.getLengthSquared()&&(1===Math.abs(i.z)?c.x+=1e-4:c.z+=1e-4,c.normalize(),h.crossVectors(i,c)),h.normalize(),l.crossVectors(c,h),s[0]=h.x,s[1]=h.y,s[2]=h.z,s[4]=l.x,s[5]=l.y,s[6]=l.z,s[8]=c.x,s[9]=c.y,s[10]=c.z,this},lookAt:function(t,e,i){var s=t.x,n=t.y,r=t.z,a=i.x,o=i.y,h=i.z,l=e.x,c=e.y,u=e.z;if(Math.abs(s-l)<1e-6&&Math.abs(n-c)<1e-6&&Math.abs(r-u)<1e-6)return this.identity();var d=s-l,f=n-c,p=r-u,m=1/Math.sqrt(d*d+f*f+p*p),g=o*(p*=m)-h*(f*=m),x=h*(d*=m)-a*p,v=a*f-o*d;(m=Math.sqrt(g*g+x*x+v*v))?(g*=m=1/m,x*=m,v*=m):(g=0,x=0,v=0);var y=f*v-p*x,w=p*g-d*v,b=d*x-f*g;return(m=Math.sqrt(y*y+w*w+b*b))?(y*=m=1/m,w*=m,b*=m):(y=0,w=0,b=0),this.setValues(g,y,d,0,x,w,f,0,v,b,p,0,-(g*s+x*n+v*r),-(y*s+w*n+b*r),-(d*s+f*n+p*r),1)},yawPitchRoll:function(t,e,i){this.zero(),a.zero(),o.zero();var s=this.val,n=a.val,r=o.val,h=Math.sin(i),l=Math.cos(i);return s[10]=1,s[15]=1,s[0]=l,s[1]=h,s[4]=-h,s[5]=l,h=Math.sin(e),l=Math.cos(e),n[0]=1,n[15]=1,n[5]=l,n[10]=l,n[9]=-h,n[6]=h,h=Math.sin(t),l=Math.cos(t),r[5]=1,r[15]=1,r[0]=l,r[2]=-h,r[8]=h,r[10]=l,this.multiplyLocal(a),this.multiplyLocal(o),this},setWorldMatrix:function(t,e,i,s,n){return this.yawPitchRoll(t.y,t.x,t.z),a.scaling(i.x,i.y,i.z),o.xyz(e.x,e.y,e.z),this.multiplyLocal(a),this.multiplyLocal(o),s&&this.multiplyLocal(s),n&&this.multiplyLocal(n),this},multiplyToMat4:function(t,e){var i=this.val,s=t.val,n=i[0],r=i[1],a=i[2],o=i[3],h=i[4],l=i[5],c=i[6],u=i[7],d=i[8],f=i[9],p=i[10],m=i[11],g=i[12],x=i[13],v=i[14],y=i[15],w=s[0],b=s[1],M=s[2],A=s[3],E=s[4],S=s[5],T=s[6],I=s[7],C=s[8],R=s[9],k=s[10],F=s[11],L=s[12],P=s[13],Y=s[14],O=s[15];return e.setValues(w*n+b*h+M*d+A*g,b*r+b*l+M*f+A*x,M*a+b*c+M*p+A*v,A*o+b*u+M*m+A*y,E*n+S*h+T*d+I*g,E*r+S*l+T*f+I*x,E*a+S*c+T*p+I*v,E*o+S*u+T*m+I*y,C*n+R*h+k*d+F*g,C*r+R*l+k*f+F*x,C*a+R*c+k*p+F*v,C*o+R*u+k*m+F*y,L*n+P*h+Y*d+O*g,L*r+P*l+Y*f+O*x,L*a+P*c+Y*p+O*v,L*o+P*u+Y*m+O*y)},fromRotationXYTranslation:function(t,e,i){var s=e.x,n=e.y,r=e.z,a=Math.sin(t.x),o=Math.cos(t.x),h=Math.sin(t.y),l=Math.cos(t.y),c=s,u=n,d=r,f=-a,p=0-f*h,m=0-o*h,g=f*l,x=o*l;return i||(c=l*s+h*r,u=p*s+o*n+g*r,d=m*s+a*n+x*r),this.setValues(l,p,m,0,0,o,a,0,h,g,x,0,c,u,d,1)},getMaxScaleOnAxis:function(){var t=this.val,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,s))}}),a=new r,o=new r,h=new n,l=new n,c=new n;t.exports=r},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={ADDED_TO_SCENE:i(188),BOOT:i(189),CREATE:i(190),DESTROY:i(191),PAUSE:i(192),POST_UPDATE:i(193),PRE_RENDER:i(194),PRE_UPDATE:i(195),READY:i(196),REMOVED_FROM_SCENE:i(197),RENDER:i(198),RESUME:i(199),SHUTDOWN:i(200),SLEEP:i(201),START:i(202),TRANSITION_COMPLETE:i(203),TRANSITION_INIT:i(204),TRANSITION_OUT:i(205),TRANSITION_START:i(206),TRANSITION_WAKE:i(207),UPDATE:i(208),WAKE:i(209)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(10),r=i(48),a=i(9),o=i(49),h=i(50),l=i(222),c=i(51),u=new s({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var s=a(e,"url");void 0===s?s=t.path+i+"."+a(e,"extension",""):"string"!=typeof s||s.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(s=t.path+s),this.url=s,this.src="",this.xhrSettings=c(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?n.FILE_POPULATED:n.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===n.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=n.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,s=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(s=!1),this.state=n.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=n.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=n.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=n.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==n.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(r.FILE_COMPLETE,e,i,t),this.loader.emit(r.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=n.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={},s={install:function(t){for(var e in i)t[e]=i[e]},register:function(t,e){i[t]=e},destroy:function(){i={}}};t.exports=s},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(4),r=i(3),a=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,s,n,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||r?n.TAU-(r>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,n=s[0],r=s[1],a=s[2],o=s[3];return s[0]=n*i+a*e,s[1]=r*i+o*e,s[2]=n*-e+a*i,s[3]=r*-e+o*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,n=i[0],r=i[1],a=i[2],o=i[3],h=i[4],l=i[5],c=s[0],u=s[1],d=s[2],f=s[3],p=s[4],m=s[5],g=void 0===e?i:e.matrix;return g[0]=c*n+u*a,g[1]=c*r+u*o,g[2]=d*n+f*a,g[3]=d*r+f*o,g[4]=p*n+m*a+h,g[5]=p*r+m*o+l,g},multiplyWithOffset:function(t,e,i){var s=this.matrix,n=t.matrix,r=s[0],a=s[1],o=s[2],h=s[3],l=e*r+i*o+s[4],c=e*a+i*h+s[5],u=n[0],d=n[1],f=n[2],p=n[3],m=n[4],g=n[5];return s[0]=u*r+d*o,s[1]=u*a+d*h,s[2]=f*r+p*o,s[3]=f*a+p*h,s[4]=m*r+g*o+l,s[5]=m*a+g*h+c,this},transform:function(t,e,i,s,n,r){var a=this.matrix,o=a[0],h=a[1],l=a[2],c=a[3],u=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*c,a[2]=i*o+s*l,a[3]=i*h+s*c,a[4]=n*o+r*l+u,a[5]=n*h+r*c+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,n=s[0],r=s[1],a=s[2],o=s[3],h=s[4],l=s[5];return i.x=t*n+e*a+h,i.y=t*r+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=e*n-i*s;return t[0]=n/o,t[1]=-i/o,t[2]=-s/o,t[3]=e/o,t[4]=(s*a-n*r)/o,t[5]=-(e*a-i*r)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,n,r){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=s,a[4]=n,a[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],n=e[2],r=e[3],a=i*r-s*n;if(t.translateX=e[4],t.translateY=e[5],i||s){var o=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(n||r){var h=Math.sqrt(n*n+r*r);t.rotation=.5*Math.PI-(r>0?Math.acos(-n/h):-Math.acos(n/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,n){var r=this.matrix,a=Math.sin(i),o=Math.cos(i);return r[4]=t,r[5]=e,r[0]=o*s,r[1]=a*s,r[2]=-a*n,r[3]=o*n,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var s=this.matrix,n=s[0],a=s[1],o=s[2],h=s[3],l=s[4],c=s[5],u=1/(n*h+o*-a);return i.x=h*u*t+-o*u*e+(c*o-l*h)*u,i.y=n*u*e+-a*u*t+(-c*n+l*a)*u,i},setQuad:function(t,e,i,s,n,r){void 0===r&&(r=this.quad);var a=this.matrix,o=a[0],h=a[1],l=a[2],c=a[3],u=a[4],d=a[5];return r[0]=t*o+e*l+u,r[1]=t*h+e*c+d,r[2]=t*o+s*l+u,r[3]=t*h+s*c+d,r[4]=i*o+s*l+u,r[5]=i*h+s*c+d,r[6]=i*o+e*l+u,r[7]=i*h+e*c+d,n&&r.forEach((function(t,e){r[e]=Math.round(t)})),r},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.round(s)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.round(s)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},function(t,e){t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return i;var t=navigator.userAgent;/Windows/.test(t)?i.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(i.iOS=!0,i.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),i.iOSVersion=parseInt(RegExp.$1,10)):i.macOS=!0:/Android/.test(t)?i.android=!0:/Linux/.test(t)?i.linux=!0:/iP[ao]d|iPhone/i.test(t)?(i.iOS=!0,navigator.appVersion.match(/OS (\d+)/),i.iOSVersion=parseInt(RegExp.$1,10),i.iPhone=-1!==t.toLowerCase().indexOf("iphone"),i.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?i.kindle=!0:/CrOS/.test(t)&&(i.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(i.android=!1,i.iOS=!1,i.macOS=!1,i.windows=!0,i.windowsPhone=!0);var s=/Silk/.test(t);return(i.windows||i.macOS||i.linux&&!s||i.chromeOS)&&(i.desktop=!0),(i.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(i.desktop=!1),navigator.standalone&&(i.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(i.cordova=!0),void 0!==window.ejecta&&(i.ejecta=!0)),void 0!==e&&e.versions&&e.versions.node&&(i.node=!0),i.node&&"object"==typeof e.versions&&(i.nodeWebkit=!!e.versions["node-webkit"],i.electron=!!e.versions.electron),/Crosswalk/.test(t)&&(i.crosswalk=!0),i.pixelRatio=window.devicePixelRatio||1,i}()}).call(this,i(300))},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(318),r=i(67),a=i(319),o=i(30),h=i(320),l=i(325),c=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=c},function(t,e){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},function(t,e){t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},function(t,e){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(7);t.exports=function(t){return s(t,-Math.PI,Math.PI)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(7);t.exports=function(t){return s(t,-180,180)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e) - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(37);t.exports=function(t,e){return s(t)/s(e)/s(t-e)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e){t.exports=function(t,e,i,s,n){var r=.5*(s-e),a=.5*(n-i),o=t*t;return(2*i-2*s+r+a)*(t*o)+(-3*i+3*s-2*r-a)*o+r*t+i}},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),a=t.x-e,o=t.y-i;return t.x=a*n-o*r+e,t.y=a*r+o*n+i,t}},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(3);t.exports=function(t,e,i,n,r,a,o,h){void 0===h&&(h=new s);var l=Math.sin(r),c=Math.cos(r),u=c*a,d=l*a,f=-l*o,p=c*o,m=1/(u*p+f*-d);return h.x=p*m*t+-f*m*e+(n*f-i*p)*m,h.y=u*m*e+-d*m*t+(-n*u+i*d)*m,h}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=l*r-a*h,u=-l*n+a*o,d=h*n-r*o,f=e*c+i*u+s*d;return f?(f=1/f,t[0]=c*f,t[1]=(-l*i+s*h)*f,t[2]=(a*i-s*r)*f,t[3]=u*f,t[4]=(l*e-s*o)*f,t[5]=(-a*e+s*n)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(r*e-i*n)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=r*l-a*h,t[1]=s*h-i*l,t[2]=i*a-s*r,t[3]=a*o-n*l,t[4]=e*l-s*o,t[5]=s*n-e*a,t[6]=n*h-r*o,t[7]=i*o-e*h,t[8]=e*r-i*n,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*r-a*h)+i*(-l*n+a*o)+s*(h*n-r*o)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=t.val,d=u[0],f=u[1],p=u[2],m=u[3],g=u[4],x=u[5],v=u[6],y=u[7],w=u[8];return e[0]=d*i+f*r+p*h,e[1]=d*s+f*a+p*l,e[2]=d*n+f*o+p*c,e[3]=m*i+g*r+x*h,e[4]=m*s+g*a+x*l,e[5]=m*n+g*o+x*c,e[6]=v*i+y*r+w*h,e[7]=v*s+y*a+w*l,e[8]=v*n+y*o+w*c,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*s+h*a,e[2]=l*n+h*o,e[3]=l*r-h*i,e[4]=l*a-h*s,e[5]=l*o-h*n,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,n=t.w,r=e+e,a=i+i,o=s+s,h=e*r,l=e*a,c=e*o,u=i*a,d=i*o,f=s*o,p=n*r,m=n*a,g=n*o,x=this.val;return x[0]=1-(u+f),x[3]=l+g,x[6]=c-m,x[1]=l-g,x[4]=1-(h+f),x[7]=d+p,x[2]=c+m,x[5]=d-p,x[8]=1-(h+u),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],m=e[12],g=e[13],x=e[14],v=e[15],y=s*h-n*o,w=s*l-r*o,b=s*c-a*o,M=n*l-r*h,A=n*c-a*h,E=r*c-a*l,S=u*g-d*m,T=u*x-f*m,I=u*v-p*m,C=d*x-f*g,R=d*v-p*g,k=f*v-p*x,F=y*k-w*R+b*C+M*I-A*T+E*S;return F?(F=1/F,i[0]=(h*k-l*R+c*C)*F,i[1]=(l*I-o*k-c*T)*F,i[2]=(o*R-h*I+c*S)*F,i[3]=(r*R-n*k-a*C)*F,i[4]=(s*k-r*I+a*T)*F,i[5]=(n*I-s*R-a*S)*F,i[6]=(g*E-x*A+v*M)*F,i[7]=(x*b-m*E-v*w)*F,i[8]=(m*A-g*b+v*y)*F,this):null}});t.exports=s},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(45),r=i(2),a=i(15),o=new Int8Array([1,2,0]),h=new Float32Array([0,0,0]),l=new a(1,0,0),c=new a(0,1,0),u=new a,d=new n,f=new s({initialize:function(t,e,i,s){this.onChangeCallback=r,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,n){return void 0===n&&(n=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),n&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this._x=t*n,this._y=e*n,this._z=i*n,this._w=s*n),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),n+e*(t.z-n),r+e*(t.w-r))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(l).cross(t).length()<1e-6&&u.copy(c).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?this.set(0,0,0,1):(u.copy(t).cross(e),this._x=u.x,this._y=u.y,this._z=u.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=d.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(d).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+n*r+i*o-s*a,i*h+n*a+s*r-e*o,s*h+n*o+e*a-i*r,n*h-e*r-i*a-s*o)},slerp:function(t,e){var i=this.x,s=this.y,n=this.z,r=this.w,a=t.x,o=t.y,h=t.z,l=t.w,c=i*a+s*o+n*h+r*l;c<0&&(c=-c,a=-a,o=-o,h=-h,l=-l);var u=1-e,d=e;if(1-c>1e-6){var f=Math.acos(c),p=Math.sin(f);u=Math.sin((1-e)*f)/p,d=Math.sin(e*f)/p}return this.set(u*i+d*a,u*s+d*o,u*n+d*h,u*r+d*l)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s,r=n?1/n:0;return this.set(-t*r,-e*r,-i*r,s*r)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a+n*r,i*a+s*r,s*a-i*r,n*a-e*r)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a-s*r,i*a+n*r,s*a+e*r,n*a-i*r)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*r,i*a-e*r,s*a+n*r,n*a-s*r)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,n=t.z/2,r=Math.cos(i),a=Math.cos(s),o=Math.cos(n),h=Math.sin(i),l=Math.sin(s),c=Math.sin(n);switch(t.order){case"XYZ":this.set(h*a*o+r*l*c,r*l*o-h*a*c,r*a*c+h*l*o,r*a*o-h*l*c,e);break;case"YXZ":this.set(h*a*o+r*l*c,r*l*o-h*a*c,r*a*c-h*l*o,r*a*o+h*l*c,e);break;case"ZXY":this.set(h*a*o-r*l*c,r*l*o+h*a*c,r*a*c+h*l*o,r*a*o-h*l*c,e);break;case"ZYX":this.set(h*a*o-r*l*c,r*l*o+h*a*c,r*a*c-h*l*o,r*a*o+h*l*c,e);break;case"YZX":this.set(h*a*o+r*l*c,r*l*o+h*a*c,r*a*c-h*l*o,r*a*o-h*l*c,e);break;case"XZY":this.set(h*a*o-r*l*c,r*l*o-h*a*c,r*a*c+h*l*o,r*a*o+h*l*c,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],n=i[4],r=i[8],a=i[1],o=i[5],h=i[9],l=i[2],c=i[6],u=i[10],d=s+o+u;return d>0?(e=.5/Math.sqrt(d+1),this.set((c-h)*e,(r-l)*e,(a-n)*e,.25/e)):s>o&&s>u?(e=2*Math.sqrt(1+s-o-u),this.set(.25*e,(n+a)/e,(r+l)/e,(c-h)/e)):o>u?(e=2*Math.sqrt(1+o-s-u),this.set((n+a)/e,.25*e,(h+c)/e,(r-l)/e)):(e=2*Math.sqrt(1+u-s-o),this.set((r+l)/e,(h+c)/e,.25*e,(a-n)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var n=0;i[4]>i[0]&&(n=1),i[8]>i[3*n+n]&&(n=2);var r=o[n],a=o[r];e=Math.sqrt(i[3*n+n]-i[3*r+r]-i[3*a+a]+1),h[n]=.5*e,e=.5/e,h[r]=(i[3*r+n]+i[3*n+r])*e,h[a]=(i[3*a+n]+i[3*n+a])*e,this._x=h[0],this._y=h[1],this._z=h[2],this._w=(i[3*a+r]-i[3*r+a])*e}return this.onChangeCallback(this),this}});t.exports=f},function(t,e){(function(){"use strict";var e=(()=>{var t=Object.defineProperty,e=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,n={};((e,i)=>{for(var s in i)t(e,s,{get:i[s],enumerable:!0})})(n,{AlphaTimeline:()=>ft,Animation:()=>C,AnimationState:()=>kt,AnimationStateAdapter:()=>Yt,AnimationStateData:()=>Nt,AssetManager:()=>Ai,AssetManagerBase:()=>ce,AtlasAttachmentLoader:()=>re,Attachment:()=>b,AttachmentTimeline:()=>gt,BinaryInput:()=>Pe,BlendMode:()=>ke,Bone:()=>he,BoneData:()=>ae,BoundingBoxAttachment:()=>Ut,CURRENT:()=>Vt,CameraController:()=>Gi,ClippingAttachment:()=>Wt,Color:()=>h,Color2Attribute:()=>es,ColorAttribute:()=>ts,ConstraintData:()=>le,CurveTimeline:()=>Q,CurveTimeline1:()=>$,CurveTimeline2:()=>tt,DebugUtils:()=>g,DeformTimeline:()=>xt,Downloader:()=>ue,DrawOrderTimeline:()=>bt,Event:()=>de,EventData:()=>fe,EventQueue:()=>Lt,EventTimeline:()=>yt,EventType:()=>Pt,FIRST:()=>Dt,FakeTexture:()=>Zt,GLTexture:()=>Mi,HOLD_FIRST:()=>Bt,HOLD_MIX:()=>zt,HOLD_SUBSEQUENT:()=>Xt,IkConstraint:()=>pe,IkConstraintData:()=>me,IkConstraintTimeline:()=>Mt,Input:()=>Wi,IntSet:()=>r,Interpolation:()=>u,LoadingScreen:()=>ws,M00:()=>Si,M01:()=>Ti,M02:()=>Ii,M03:()=>Ci,M10:()=>Ri,M11:()=>ki,M12:()=>Fi,M13:()=>Li,M20:()=>Pi,M21:()=>Yi,M22:()=>Oi,M23:()=>Di,M30:()=>Xi,M31:()=>Bi,M32:()=>zi,M33:()=>_i,ManagedWebGLRenderingContext:()=>yi,MathUtils:()=>c,Matrix4:()=>Ni,Mesh:()=>Zi,MeshAttachment:()=>te,MixBlend:()=>R,MixDirection:()=>k,OrthoCamera:()=>Ui,PathAttachment:()=>ee,PathConstraint:()=>be,PathConstraintData:()=>ge,PathConstraintMixTimeline:()=>Tt,PathConstraintPositionTimeline:()=>Et,PathConstraintSpacingTimeline:()=>St,PointAttachment:()=>ie,PolygonBatcher:()=>ns,Pool:()=>x,Position2Attribute:()=>Ji,Position3Attribute:()=>Qi,PositionMode:()=>xe,Pow:()=>d,PowOut:()=>f,RGB2Timeline:()=>mt,RGBA2Timeline:()=>pt,RGBATimeline:()=>ut,RGBTimeline:()=>dt,RegionAttachment:()=>ne,ResizeMode:()=>vs,RotateMode:()=>ye,RotateTimeline:()=>et,SETUP:()=>_t,SUBSEQUENT:()=>Ot,ScaleTimeline:()=>rt,ScaleXTimeline:()=>at,ScaleYTimeline:()=>ot,SceneRenderer:()=>xs,SequenceTimeline:()=>Ct,Shader:()=>Hi,ShapeRenderer:()=>rs,ShapeType:()=>as,ShearTimeline:()=>ht,ShearXTimeline:()=>lt,ShearYTimeline:()=>ct,Skeleton:()=>Se,SkeletonBinary:()=>Le,SkeletonBounds:()=>ci,SkeletonClipping:()=>di,SkeletonData:()=>Te,SkeletonDebugRenderer:()=>hs,SkeletonJson:()=>fi,SkeletonRenderer:()=>cs,Skin:()=>Ce,SkinEntry:()=>Ie,Slot:()=>Me,SlotData:()=>Re,SpacingMode:()=>ve,SpineCanvas:()=>As,StringSet:()=>a,TexCoordAttribute:()=>$i,Texture:()=>qt,TextureAtlas:()=>Kt,TextureAtlasPage:()=>Qt,TextureAtlasRegion:()=>$t,TextureFilter:()=>Gt,TextureRegion:()=>Ht,TextureWrap:()=>jt,TimeKeeper:()=>y,Timeline:()=>J,Touch:()=>qi,TrackEntry:()=>Ft,TransformConstraint:()=>Ae,TransformConstraintData:()=>Fe,TransformConstraintTimeline:()=>At,TransformMode:()=>oe,TranslateTimeline:()=>it,TranslateXTimeline:()=>st,TranslateYTimeline:()=>nt,Triangulator:()=>ui,Utils:()=>m,Vector2:()=>v,Vector3:()=>Ei,VertexAttachment:()=>A,VertexAttribute:()=>Ki,VertexAttributeType:()=>is,WebGLBlendModeConverter:()=>wi,WindowedMean:()=>w});var r=class{constructor(){this.array=new Array}add(t){let e=this.contains(t);return this.array[0|t]=0|t,!e}contains(t){return null!=this.array[0|t]}remove(t){this.array[0|t]=void 0}clear(){this.array.length=0}},a=class{constructor(){this.entries={},this.size=0}add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var i=0,s=t.length;i1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}static fromString(t){return(new o).setFromString(t)}},h=o;h.WHITE=new o(1,1,1,1),h.RED=new o(1,0,0,1),h.GREEN=new o(0,1,0,1),h.BLUE=new o(0,0,1,1),h.MAGENTA=new o(1,0,1,1);var l=class{static clamp(t,e,i){return ti?i:t}static cosDeg(t){return Math.cos(t*l.degRad)}static sinDeg(t){return Math.sin(t*l.degRad)}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return l.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,i){let s=Math.random(),n=e-t;return s<=(i-t)/n?t+Math.sqrt(s*n*(i-t)):e-Math.sqrt((1-s)*n*(e-i))}static isPowerOfTwo(t){return t&&0==(t&t-1)}},c=l;c.PI=3.1415927,c.PI2=2*l.PI,c.radiansToDegrees=180/l.PI,c.radDeg=l.radiansToDegrees,c.degreesToRadians=l.PI/180,c.degRad=l.degreesToRadians;var u=class{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}},d=class extends u{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}},f=class extends d{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}},p=class{static arrayCopy(t,e,i,s,n){for(let r=e,a=s;r=e?t:p.setArraySize(t,e,i)}static newArray(t,e){let i=new Array(t);for(let s=0;s0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},w=class{constructor(t=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let e=0;e>1)*r;let a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(!l){o.length>0&&(h=o);let a=t.bone,l=a.worldX,c=a.worldY,u=a.a,d=a.b,f=a.c,p=a.d;for(let t=e,a=n;a=this.regions.length&&(i=this.regions.length-1);let s=this.regions[i];e.region!=s&&(e.region=s,e.updateRegion())}getPath(t,e){let i=t,s=(this.start+e).toString();for(let t=this.digits-s.length;t>0;t--)i+="0";return i+=s,i}static nextID(){return E._nextID++}},S=E;S._nextID=0;var T=(t=>(t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse",t))(T||{}),I=[0,1,2,3,4,5,6],C=class{constructor(t,e,i){if(this.timelines=[],this.timelineIds=new a,!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=i}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e0&&(e%=this.duration));let h=this.timelines;for(let s=0,l=h.length;s(t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add",t))(R||{}),k=(t=>(t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut",t))(k||{}),F=0,L=1,P=2,Y=3,O=4,D=5,X=6,B=7,z=8,_=9,V=10,N=11,U=12,W=13,q=14,G=15,j=16,H=17,Z=18,K=19,J=class{constructor(t,e){this.propertyIds=e,this.frames=m.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let i=t.length;for(let s=1;se)return s-1;return i-1}static search(t,e,i){let s=t.length;for(let n=i;ne)return n-i;return s-i}},Q=class extends J{constructor(t,e,i){super(t,i),this.curves=m.newFloatArray(t+18*e),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+18*t;if(this.curves.length>e){let t=m.newFloatArray(e);m.arrayCopy(this.curves,0,t,0,e),this.curves=t}}setBezier(t,e,i,s,n,r,a,o,h,l,c){let u=this.curves,d=this.getFrameCount()+18*t;0==i&&(u[e]=2+d);let f=.03*(s-2*r+o),p=.03*(n-2*a+h),m=.006*(3*(r-o)-s+l),g=.006*(3*(a-h)-n+c),x=2*f+m,v=2*p+g,y=.3*(r-s)+f+.16666667*m,w=.3*(a-n)+p+.16666667*g,b=s+y,M=n+w;for(let t=d+18;dt){let r=this.frames[e],a=this.frames[e+i];return a+(t-r)/(n[s]-r)*(n[s+1]-a)}let r=s+18;for(s+=2;s=t){let e=n[s-2],i=n[s-1];return i+(t-e)/(n[s]-e)*(n[s+1]-i)}e+=this.getFrameEntries();let a=n[r-2],o=n[r-1];return o+(t-a)/(this.frames[e]-a)*(this.frames[e+i]-o)}},$=class extends Q{constructor(t,e,i){super(t,e,[i])}getFrameEntries(){return 2}setFrame(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+1]=i}getCurveValue(t){let e=this.frames,i=e.length-2;for(let s=2;s<=i;s+=2)if(e[s]>t){i=s-2;break}let s=this.curves[i>>1];switch(s){case 0:let s=e[i],n=e[i+1];return n+(t-s)/(e[i+2]-s)*(e[i+2+1]-n);case 1:return e[i+1]}return this.getBezierValue(t,i,1,s-2)}},tt=class extends Q{constructor(t,e,i,s){super(t,e,[i,s])}getFrameEntries(){return 3}setFrame(t,e,i,s){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s}},et=class extends ${constructor(t,e,i){super(t,e,F+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i>2];switch(p){case 0:let t=h[f];c=h[f+1],u=h[f+2],d=h[f+3];let e=(i-t)/(h[f+4]-t);c+=(h[f+4+1]-c)*e,u+=(h[f+4+2]-u)*e,d+=(h[f+4+3]-d)*e;break;case 1:c=h[f+1],u=h[f+2],d=h[f+3];break;default:c=this.getBezierValue(i,f,1,p-2),u=this.getBezierValue(i,f,2,p+18-2),d=this.getBezierValue(i,f,3,p+36-2)}if(1==n)l.r=c,l.g=u,l.b=d;else{if(0==r){let t=o.data.color;l.r=t.r,l.g=t.g,l.b=t.b}l.r+=(c-l.r)*n,l.g+=(u-l.g)*n,l.b+=(d-l.b)*n}}},ft=class extends ${constructor(t,e,i){super(t,e,z+"|"+i),this.slotIndex=0,this.slotIndex=i}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.color;if(i>3];switch(y){case 0:let t=h[v];u=h[v+1],d=h[v+2],f=h[v+3],p=h[v+4],m=h[v+5],g=h[v+6],x=h[v+7];let e=(i-t)/(h[v+8]-t);u+=(h[v+8+1]-u)*e,d+=(h[v+8+2]-d)*e,f+=(h[v+8+3]-f)*e,p+=(h[v+8+4]-p)*e,m+=(h[v+8+5]-m)*e,g+=(h[v+8+6]-g)*e,x+=(h[v+8+7]-x)*e;break;case 1:u=h[v+1],d=h[v+2],f=h[v+3],p=h[v+4],m=h[v+5],g=h[v+6],x=h[v+7];break;default:u=this.getBezierValue(i,v,1,y-2),d=this.getBezierValue(i,v,2,y+18-2),f=this.getBezierValue(i,v,3,y+36-2),p=this.getBezierValue(i,v,4,y+54-2),m=this.getBezierValue(i,v,5,y+72-2),g=this.getBezierValue(i,v,6,y+90-2),x=this.getBezierValue(i,v,7,y+108-2)}if(1==n)l.set(u,d,f,p),c.r=m,c.g=g,c.b=x;else{if(0==r){l.setFromColor(o.data.color);let t=o.data.darkColor;c.r=t.r,c.g=t.g,c.b=t.b}l.add((u-l.r)*n,(d-l.g)*n,(f-l.b)*n,(p-l.a)*n),c.r+=(m-c.r)*n,c.g+=(g-c.g)*n,c.b+=(x-c.b)*n}}},mt=class extends Q{constructor(t,e,i){super(t,e,[B+"|"+i,_+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,s,n,r,a,o){t*=7,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n,this.frames[t+4]=r,this.frames[t+5]=a,this.frames[t+6]=o}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,c=o.darkColor;if(it){let n=this.frames[e];return i[s+1]*(t-n)/(i[s]-n)}let n=s+18;for(s+=2;s=t){let e=i[s-2],n=i[s-1];return n+(t-e)/(i[s]-e)*(i[s+1]-n)}let r=i[n-2],a=i[n-1];return a+(1-a)*(t-r)/(this.frames[e+this.getFrameEntries()]-r)}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.getAttachment();if(!h)return;if(!(h instanceof A)||h.timelineAttachment!=this.attachment)return;let l=o.deform;0==l.length&&(r=0);let c=this.vertices,u=c[0].length,d=this.frames;if(i=d[d.length-1]){let t=c[d.length-1];if(1==n)if(3==r){let e=h;if(e.bones)for(let e=0;ei)this.apply(t,e,Number.MAX_VALUE,s,n,r,a),e=-1;else if(e>=o[h-1])return;if(i0&&o[l-1]==t;)l--}for(;l=o[l];l++)s.push(this.events[l])}},yt=vt;yt.propertyIds=[""+U];var wt=class extends J{constructor(t){super(t,wt.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,s,n,r,a){if(1==a)return void(0==r&&m.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));if(i>2];switch(f){case 0:let t=u[d];h=u[d+1],l=u[d+2],c=u[d+3];let e=(i-t)/(u[d+4]-t);h+=(u[d+4+1]-h)*e,l+=(u[d+4+2]-l)*e,c+=(u[d+4+3]-c)*e;break;case 1:h=u[d+1],l=u[d+2],c=u[d+3];break;default:h=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),c=this.getBezierValue(i,d,3,f+36-2)}if(0==r){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*n,o.mixX=t.mixX+(l-t.mixX)*n,o.mixY=t.mixY+(c-t.mixY)*n}else o.mixRotate+=(h-o.mixRotate)*n,o.mixX+=(l-o.mixX)*n,o.mixY+=(c-o.mixY)*n}},It=class extends J{constructor(t,e,i){super(t,[K+"|"+e+"|"+i.sequence.id]),this.slotIndex=e,this.attachment=i}getFrameEntries(){return It.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,i,s,n){let r=this.frames;r[t*=It.ENTRIES]=e,r[t+It.MODE]=i|s<<4,r[t+It.DELAY]=n}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.attachment,l=this.attachment;if(!(h==l||h instanceof A&&h.timelineAttachment==l))return;let c=this.frames;if(i>4,g=this.attachment.sequence.regions.length,x=I[15&f];if(0!=x)switch(m+=(i-d)/p+1e-5|0,x){case 1:m=Math.min(g-1,m);break;case 2:m%=g;break;case 3:{let t=(g<<1)-2;m=0==t?0:m%t,m>=g&&(m=t-m);break}case 4:m=Math.max(g-1-m,0);break;case 5:m=g-1-m%g;break;case 6:{let t=(g<<1)-2;m=0==t?0:(m+g-1)%t,m>=g&&(m=t-m)}}o.sequenceIndex=m}},Ct=It;Ct.ENTRIES=3,Ct.MODE=1,Ct.DELAY=2;var Rt=class{constructor(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Lt(this),this.propertyIDs=new a,this.animationsChanged=!1,this.trackEntryPool=new x(()=>new Ft),this.data=t}static emptyAnimation(){return Rt._emptyAnimation}update(t){t*=this.timeScale;let e=this.tracks;for(let i=0,s=e.length;i0){if(s.delay-=n,s.delay>0)continue;n=-s.delay,s.delay=0}let r=s.next;if(r){let e=s.trackLast-r.delay;if(e>=0){for(r.delay=0,r.trackTime+=0==s.timeScale?0:(e/s.timeScale+t)*r.timeScale,s.trackTime+=n,this.setCurrent(i,r,!0);r.mixingFrom;)r.mixTime+=t,r=r.mixingFrom;continue}}else if(s.trackLast>=s.trackEnd&&!s.mixingFrom){e[i]=null,this.queue.end(s),this.clearNext(s);continue}if(s.mixingFrom&&this.updateMixingFrom(s,t)){let t=s.mixingFrom;for(s.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}s.trackTime+=n}this.queue.drain()}updateMixingFrom(t,e){let i=t.mixingFrom;if(!i)return!0;let s=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),s):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,i=this.tracks,s=!1;for(let r=0,a=i.length;r0)continue;s=!0;let o=0==r?1:a.mixBlend,h=a.alpha;a.mixingFrom?h*=this.applyMixingFrom(a,t,o):a.trackTime>=a.trackEnd&&!a.next&&(h=0);let l=a.animationLast,c=a.getAnimationTime(),u=c,d=e;a.reverse&&(u=a.animation.duration-u,d=null);let f=a.animation.timelines,p=f.length;if(0==r&&1==h||3==o)for(let e=0;e1&&(n=1),1!=i&&(i=s.mixBlend));let r=n0&&this.queueEvents(s,d),this.events.length=0,s.nextAnimationLast=d,s.nextTrackLast=s.trackTime,n}applyAttachmentTimeline(t,e,i,s,n){var r=e.slots[t.slotIndex];r.bone.active&&(i0,s=t>=0;c.signum(e)!=c.signum(f)&&Math.abs(e)<=90&&(Math.abs(t)>180&&(t+=360*c.signum(t)),s=i),d=f+t-t%360,s!=i&&(d+=360*c.signum(t)),r[a]=d}r[a+1]=f,h.rotation=l+d*s}queueEvents(t,e){let i=t.animationStart,s=t.animationEnd,n=s-i,r=t.trackLast%n,a=this.events,o=0,h=a.length;for(;os||this.queue.event(t,e)}let l=!1;for(l=t.loop?0==n||r>t.trackTime%n:e>=s&&t.animationLast=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let i=e;for(;;){let t=i.mixingFrom;if(!t)break;this.queue.end(t),i.mixingFrom=null,i.mixingTo=null,i=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,i){let s=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,s&&(i&&this.queue.interrupt(s),e.mixingFrom=s,s.mixingTo=e,e.mixTime=0,s.mixingFrom&&s.mixDuration>0&&(e.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,i=!1){let s=this.data.skeletonData.findAnimation(e);if(!s)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,s,i)}setAnimationWith(t,e,i=!1){if(!e)throw new Error("animation cannot be null.");let s=!0,n=this.expandToIndex(t);n&&(-1==n.nextTrackLast?(this.tracks[t]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.clearNext(n),n=n.mixingFrom,s=!1):this.clearNext(n));let r=this.trackEntry(t,e,i,n);return this.setCurrent(t,r,s),this.queue.drain(),r}addAnimation(t,e,i=!1,s=0){let n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,n,i,s)}addAnimationWith(t,e,i=!1,s=0){if(!e)throw new Error("animation cannot be null.");let n=this.expandToIndex(t);if(n)for(;n.next;)n=n.next;let r=this.trackEntry(t,e,i,n);return n?(n.next=r,r.previous=n,s<=0&&(s+=n.getTrackComplete()-r.mixDuration)):(this.setCurrent(t,r,!0),this.queue.drain()),r.delay=s,r}setEmptyAnimation(t,e=0){let i=this.setAnimationWith(t,Rt.emptyAnimation(),!1);return i.mixDuration=e,i.trackEnd=e,i}addEmptyAnimation(t,e=0,i=0){let s=this.addAnimationWith(t,Rt.emptyAnimation(),!1,i);return i<=0&&(s.delay+=s.mixDuration-e),s.mixDuration=e,s.trackEnd=e,s}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e0){n[o]=zt,r[o]=i;continue t}break}n[o]=Bt}else n[o]=Ot}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},kt=Rt;kt._emptyAnimation=new C("",[],0);var Ft=class{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=2,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime(t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event",t))(Pt||{}),Yt=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}},Ot=0,Dt=1,Xt=2,Bt=3,zt=4,_t=1,Vt=2,Nt=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,i){let s=this.skeletonData.findAnimation(t);if(!s)throw new Error("Animation not found: "+t);let n=this.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);this.setMixWith(s,n,i)}setMixWith(t,e,i){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let s=t.name+"."+e.name;this.animationToMixTime[s]=i}getMix(t,e){let i=t.name+"."+e.name,s=this.animationToMixTime[i];return void 0===s?this.defaultMix:s}},Ut=class extends A{constructor(t){super(t),this.color=new h(1,1,1,1)}copy(){let t=new Ut(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},Wt=class extends A{constructor(t){super(t),this.endSlot=null,this.color=new h(.2275,.2275,.8078,1)}copy(){let t=new Wt(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},qt=class{constructor(t){this._image=t}getImage(){return this._image}},Gt=(t=>(t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear",t))(Gt||{}),jt=(t=>(t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat",t))(jt||{}),Ht=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},Zt=class extends qt{setFilters(t,e){}setWraps(t,e){}dispose(){}},Kt=class{constructor(t){this.pages=new Array,this.regions=new Array;let e=new Jt(t),i=new Array(4),s={size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},format:()=>{},filter:t=>{t.minFilter=m.enumValue(Gt,i[1]),t.magFilter=m.enumValue(Gt,i[2])},repeat:t=>{-1!=i[1].indexOf("x")&&(t.uWrap=10497),-1!=i[1].indexOf("y")&&(t.vWrap=10497)},pma:t=>{t.pma="true"==i[1]}};var n={xy:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2])},size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},bounds:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2]),t.width=parseInt(i[3]),t.height=parseInt(i[4])},offset:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2])},orig:t=>{t.originalWidth=parseInt(i[1]),t.originalHeight=parseInt(i[2])},offsets:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2]),t.originalWidth=parseInt(i[3]),t.originalHeight=parseInt(i[4])},rotate:t=>{let e=i[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:t=>{t.index=parseInt(i[1])}};let r=e.readLine();for(;r&&0==r.trim().length;)r=e.readLine();for(;r&&0!=r.trim().length&&0!=e.readEntry(i,r);)r=e.readLine();let a=null,o=null,h=null;for(;null!==r;)if(0==r.trim().length)a=null,r=e.readLine();else if(a){let t=new $t(a,r);for(;;){let s=e.readEntry(i,r=e.readLine());if(0==s)break;let a=n[i[0]];if(a)a(t);else{o||(o=[]),h||(h=[]),o.push(i[0]);let t=[];for(let e=0;e0&&h&&h.length>0&&(t.names=o,t.values=h,o=null,h=null),t.u=t.x/a.width,t.v=t.y/a.height,90==t.degrees?(t.u2=(t.x+t.height)/a.width,t.v2=(t.y+t.width)/a.height):(t.u2=(t.x+t.width)/a.width,t.v2=(t.y+t.height)/a.height),this.regions.push(t)}else{for(a=new Qt(r.trim());0!=e.readEntry(i,r=e.readLine());){let t=s[i[0]];t&&t(a)}this.pages.push(a)}}findRegion(t){for(let e=0;e=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;let i=e.indexOf(":");if(-1==i)return 0;t[0]=e.substr(0,i).trim();for(let s=1,n=i+1;;s++){let i=e.indexOf(",",n);if(-1==i)return t[s]=e.substr(n).trim(),s;if(t[s]=e.substr(n,i-n).trim(),n=i+1,4==s)return 4}}},Qt=class{constructor(t){this.minFilter=9728,this.magFilter=9728,this.uWrap=33071,this.vWrap=33071,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}},$t=class extends Ht{constructor(t,e){super(),this.x=0,this.y=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.index=0,this.degrees=0,this.names=null,this.values=null,this.page=t,this.name=e}},te=class extends A{constructor(t,e){super(t),this.region=null,this.regionUVs=[],this.uvs=[],this.triangles=[],this.color=new h(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=[],this.parentMesh=null,this.sequence=null,this.tempColor=new h(0,0,0,0),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=m.newFloatArray(t.length));let e=this.uvs,i=this.uvs.length,s=this.region.u,n=this.region.v,r=0,a=0;if(this.region instanceof $t){let o=this.region,h=o.page.texture.getImage(),l=h.width,c=h.height;switch(o.degrees){case 90:s-=(o.originalHeight-o.offsetY-o.height)/l,n-=(o.originalWidth-o.offsetX-o.width)/c,r=o.originalHeight/l,a=o.originalWidth/c;for(let o=0;o= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}},oe=(t=>(t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection",t))(oe||{}),he=class{constructor(t,e,i){if(this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,s,n,r,a){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=s,this.ascaleY=n,this.ashearX=r,this.ashearY=a;let o=this.parent;if(!o){let o=this.skeleton,h=i+90+a,l=o.scaleX,u=o.scaleY;return this.a=c.cosDeg(i+r)*s*l,this.b=c.cosDeg(h)*n*l,this.c=c.sinDeg(i+r)*s*u,this.d=c.sinDeg(h)*n*u,this.worldX=t*l+o.x,void(this.worldY=e*u+o.y)}let h=o.a,l=o.b,u=o.c,d=o.d;switch(this.worldX=h*t+l*e+o.worldX,this.worldY=u*t+d*e+o.worldY,this.data.transformMode){case 0:{let t=i+90+a,e=c.cosDeg(i+r)*s,o=c.cosDeg(t)*n,f=c.sinDeg(i+r)*s,p=c.sinDeg(t)*n;return this.a=h*e+l*f,this.b=h*o+l*p,this.c=u*e+d*f,void(this.d=u*o+d*p)}case 1:{let t=i+90+a;this.a=c.cosDeg(i+r)*s,this.b=c.cosDeg(t)*n,this.c=c.sinDeg(i+r)*s,this.d=c.sinDeg(t)*n;break}case 2:{let t=h*h+u*u,e=0;t>1e-4?(t=Math.abs(h*d-l*u)/t,h/=this.skeleton.scaleX,u/=this.skeleton.scaleY,l=u*t,d=h*t,e=Math.atan2(u,h)*c.radDeg):(h=0,u=0,e=90-Math.atan2(d,l)*c.radDeg);let o=i+r-e,f=i+a-e+90,p=c.cosDeg(o)*s,m=c.cosDeg(f)*n,g=c.sinDeg(o)*s,x=c.sinDeg(f)*n;this.a=h*p-l*g,this.b=h*m-l*x,this.c=u*p+d*g,this.d=u*m+d*x;break}case 3:case 4:{let t=c.cosDeg(i),e=c.sinDeg(i),o=(h*t+l*e)/this.skeleton.scaleX,f=(u*t+d*e)/this.skeleton.scaleY,p=Math.sqrt(o*o+f*f);p>1e-5&&(p=1/p),o*=p,f*=p,p=Math.sqrt(o*o+f*f),3==this.data.transformMode&&h*d-l*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let m=Math.PI/2+Math.atan2(f,o),g=Math.cos(m)*p,x=Math.sin(m)*p,v=c.cosDeg(r)*s,y=c.cosDeg(90+a)*n,w=c.sinDeg(r)*s,b=c.sinDeg(90+a)*n;this.a=o*v+g*w,this.b=o*y+g*b,this.c=f*v+x*w,this.d=f*y+x*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.c,this.a)*c.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*c.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){let t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*c.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*c.radDeg);let e=t.a,i=t.b,s=t.c,n=t.d,r=1/(e*n-i*s),a=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=a*n*r-o*i*r,this.ay=o*e*r-a*s*r;let h=r*n,l=r*e,u=r*i,d=r*s,f=h*this.a-u*this.c,p=h*this.b-u*this.d,m=l*this.c-d*this.a,g=l*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let t=f*g-p*m;this.ascaleY=t/this.ascaleX,this.ashearY=Math.atan2(f*p+m*g,t)*c.radDeg,this.arotation=Math.atan2(m,f)*c.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*c.radDeg}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),i=t.x-this.worldX,s=t.y-this.worldY;return t.x=i*this.d*e-s*this.b*e,t.y=s*this.a*e-i*this.c*e,t}localToWorld(t){let e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t}worldToLocalRotation(t){let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(this.a*e-this.c*i,this.d*i-this.b*e)*c.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(i*this.c+e*this.d,i*this.a+e*this.b)*c.radDeg}rotateWorld(t){let e=this.a,i=this.b,s=this.c,n=this.d,r=c.cosDeg(t),a=c.sinDeg(t);this.a=r*e-a*s,this.b=r*i-a*n,this.c=a*e+r*s,this.d=a*i+r*n}},le=class{constructor(t,e,i){this.name=t,this.order=e,this.skinRequired=i}},ce=class{constructor(t,e="",i=new ue){this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e,this.downloader=i}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,i){this.toLoad--,this.loaded++,this.assets[e]=i,t&&t(e,i)}error(t,e,i){this.toLoad--,this.loaded++,this.errors[e]=i,t&&t(e,i)}loadAll(){return new Promise((t,e)=>{let i=()=>{this.isLoadingComplete()?this.hasErrors()?e(this.errors):t(this):requestAnimationFrame(i)};requestAnimationFrame(i)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadBinary(t,i=>{this.success(e,t,i)},(e,s)=>{this.error(i,t,`Couldn't load binary ${t}: status ${e}, ${s}`)})}loadText(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadText(t,i=>{this.success(e,t,i)},(e,s)=>{this.error(i,t,`Couldn't load text ${t}: status ${e}, ${s}`)})}loadJson(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadJson(t,i=>{this.success(e,t,i)},(e,s)=>{this.error(i,t,`Couldn't load JSON ${t}: status ${e}, ${s}`)})}loadTexture(t,e=(()=>{}),i=(()=>{})){if(t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then(e=>e.ok?e.blob():(this.error(i,t,"Couldn't load image: "+t),null)).then(t=>t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(i=>{i&&this.success(e,t,this.textureLoader(i))});else{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>{this.success(e,t,this.textureLoader(s))},s.onerror=()=>{this.error(i,t,"Couldn't load image: "+t)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),s.src=t}}loadTextureAtlas(t,e=(()=>{}),i=(()=>{}),s){let n=t.lastIndexOf("/"),r=n>=0?t.substring(0,n+1):"";t=this.start(t),this.downloader.downloadText(t,n=>{try{let a=new Kt(n),o=a.pages.length,h=!1;for(let n of a.pages)this.loadTexture(s?s[n.name]:r+n.name,(i,s)=>{h||(n.setTexture(s),0==--o&&this.success(e,t,a))},(e,s)=>{h||this.error(i,t,`Couldn't load texture atlas ${t} page image: ${e}`),h=!0})}catch(e){this.error(i,t,`Couldn't parse texture atlas ${t}: ${e.message}`)}},(e,s)=>{this.error(i,t,`Couldn't load texture atlas ${t}: status ${e}, ${s}`)})}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let e=this.assets[t];if(e)return e;let i=this.errors[t];throw Error("Asset not found: "+t+(i?"\n"+i:""))}remove(t){t=this.pathPrefix+t;let e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}removeAll(){for(let t in this.assets){let e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}isLoadingComplete(){return 0==this.toLoad}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},ue=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return-1!=e?(e+="base64,".length,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var e=window.atob(t),i=e.length,s=new Uint8Array(i),n=0;n{this.finish(t,s.status,s.responseText)};s.onload=n,s.onerror=n,s.send()}downloadJson(t,e,i){this.downloadText(t,t=>{e(JSON.parse(t))},i)}downloadBinary(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType="arraybuffer";let n=()=>{this.finish(t,s.status,s.response)};s.onload=()=>{200==s.status||0==s.status?this.finish(t,200,new Uint8Array(s.response)):n()},s.onerror=n,s.send()}start(t,e,i){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,i)}}finish(t,e,i){let s=this.callbacks[t];delete this.callbacks[t];let n=200==e||0==e?[i]:[e,i];for(let t=n.length-1,e=s.length;t180?f-=360:f<-180&&(f+=360);let g=t.ascaleX,x=t.ascaleY;if(s||n){switch(t.data.transformMode){case 3:case 4:p=e-t.worldX,m=i-t.worldY}let o=t.data.length*g,h=Math.sqrt(p*p+m*m);if(s&&ho&&o>1e-4){let t=(h/o-1)*a+1;g*=t,r&&(x*=t)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*a,g,x,t.ashearX,t.ashearY)}apply2(t,e,i,s,n,r,a,o,h){let l=t.ax,u=t.ay,d=t.ascaleX,f=t.ascaleY,p=d,m=f,g=e.ascaleX,x=0,v=0,y=0;d<0?(d=-d,x=180,y=-1):(x=0,y=1),f<0&&(f=-f,y=-y),g<0?(g=-g,v=180):v=0;let w=e.ax,b=0,M=0,A=0,E=t.a,S=t.b,T=t.c,I=t.d,C=Math.abs(d-f)<=1e-4;!C||r?(b=0,M=E*w+t.worldX,A=T*w+t.worldY):(b=e.ay,M=E*w+S*b+t.worldX,A=T*w+I*b+t.worldY);let R=t.parent;if(!R)throw new Error("IK parent must itself have a parent.");E=R.a,S=R.b,T=R.c,I=R.d;let k,F,L=1/(E*I-S*T),P=M-R.worldX,Y=A-R.worldY,O=(P*I-Y*S)*L-l,D=(Y*E-P*T)*L-u,X=Math.sqrt(O*O+D*D),B=e.data.length*g;if(X<1e-4)return this.apply1(t,i,s,!1,r,!1,h),void e.updateWorldTransformWith(w,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);P=i-R.worldX,Y=s-R.worldY;let z=(P*I-Y*S)*L-l,_=(Y*E-P*T)*L-u,V=z*z+_*_;if(0!=o){o*=d*(g+1)*.5;let t=Math.sqrt(V),e=t-X-B*d+o;if(e>0){let i=Math.min(1,e/(2*o))-1;i=(e-o*(1-i*i))/t,z-=i*z,_-=i*_,V=z*z+_*_}}t:if(C){B*=d;let t=(V-X*X-B*B)/(2*X*B);t<-1?(t=-1,F=Math.PI*n):t>1?(t=1,F=0,r&&(E=(Math.sqrt(V)/(X+B)-1)*h+1,p*=E,a&&(m*=E))):F=Math.acos(t)*n,E=X+B*t,S=B*Math.sin(F),k=Math.atan2(_*E-z*S,z*E+_*S)}else{E=d*B,S=f*B;let t=E*E,e=S*S,i=Math.atan2(_,z);T=e*X*X+t*V-t*e;let s=-2*e*X,r=e-t;if(I=s*s-4*r*T,I>=0){let t=Math.sqrt(I);s<0&&(t=-t),t=.5*-(s+t);let e=t/r,a=T/t,o=Math.abs(e)=-1&&T<=1&&(T=Math.acos(T),P=E*Math.cos(T)+X,Y=S*Math.sin(T),I=P*P+Y*Y,Im&&(u=T,m=I,p=P,g=Y)),V<=.5*(h+m)?(k=i-Math.atan2(l*n,o),F=a*n):(k=i-Math.atan2(g*n,p),F=u*n)}let N=Math.atan2(b,w)*y,U=t.arotation;k=(k-N)*c.radDeg+x-U,k>180?k-=360:k<-180&&(k+=360),t.updateWorldTransformWith(l,u,U+k*h,p,m,0,0),U=e.arotation,F=((F+N)*c.radDeg-e.ashearX)*y+v-U,F>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(w,b,U+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}},me=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},ge=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.positionMode=xe.Fixed,this.spacingMode=ve.Fixed,this.rotateMode=ye.Chain,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}},xe=(t=>(t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent",t))(xe||{}),ve=(t=>(t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional",t))(ve||{}),ye=(t=>(t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale",t))(ye||{}),we=class{constructor(t,e){if(this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0,s=t.bones.length;i0){t=l/t*f;for(let e=1;e0?c.degRad:-c.degRad}for(let t=0,n=3;t0){let i=h.a,s=h.b,a=h.c,o=h.d,l=0,d=0,f=0;if(l=r?p[n-1]:0==u[t+1]?p[n+2]:Math.atan2(w,m),l-=Math.atan2(a,i),y){d=Math.cos(l),f=Math.sin(l);let t=h.data.length;g+=(t*(d*i-f*a)-m)*e,x+=(t*(f*i+d*a)-w)*e}else l+=v;l>c.PI?l-=c.PI2:l<-c.PI&&(l+=c.PI2),l*=e,d=Math.cos(l),f=Math.sin(l),h.a=d*i-f*a,h.b=d*s-f*o,h.c=f*i+d*a,h.d=f*s+d*o}h.updateAppliedTransform()}}computeWorldPositions(t,e,i){let s=this.target,n=this.position,r=this.spaces,a=m.setArraySize(this.positions,3*e+2),o=this.world,h=t.closed,l=t.worldVerticesLength,c=l/6,u=we.NONE;if(!t.constantSpeed){let d=t.lengths;c-=h?1:2;let f,p=d[c];switch(1==this.data.positionMode&&(n*=p),this.data.spacingMode){case 2:f=p;break;case 3:f=p/e;break;default:f=1}o=m.setArraySize(this.world,8);for(let m=0,g=0,x=0;mp){u!=we.AFTER&&(u=we.AFTER,t.computeWorldVertices(s,l-6,4,o,0,2)),this.addAfterPosition(v-p,o,0,a,g);continue}}for(;;x++){let t=d[x];if(!(v>t)){if(0==x)v/=t;else{let e=d[x-1];v=(v-e)/(t-e)}break}}x!=u&&(u=x,h&&x==c?(t.computeWorldVertices(s,l-4,4,o,0,2),t.computeWorldVertices(s,0,4,o,4,2)):t.computeWorldVertices(s,6*x+2,8,o,0,2)),this.addCurvePosition(v,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],a,g,i||m>0&&0==e)}return a}h?(l+=2,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l-4,o,0,2),t.computeWorldVertices(s,0,2,o,l-4,2),o[l-2]=o[0],o[l-1]=o[1]):(c--,l-=4,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l,o,0,2));let d,f=m.setArraySize(this.curves,c),p=0,g=o[0],x=o[1],v=0,y=0,w=0,b=0,M=0,A=0,E=0,S=0,T=0,I=0,C=0,R=0,k=0,F=0;for(let t=0,e=2;tp){this.addAfterPosition(Y-p,o,l-4,a,s);continue}}for(;;c++){let t=f[c];if(!(Y>t)){if(0==c)Y/=t;else{let e=f[c-1];Y=(Y-e)/(t-e)}break}}if(c!=u){u=c;let t=6*c;for(g=o[t],x=o[t+1],v=o[t+2],y=o[t+3],w=o[t+4],b=o[t+5],M=o[t+6],A=o[t+7],E=.03*(g-2*v+w),S=.03*(x-2*y+b),T=.006*(3*(v-w)-g+M),I=.006*(3*(y-b)-x+A),C=2*E+T,R=2*S+I,k=.3*(v-g)+E+.16666667*T,F=.3*(y-x)+S+.16666667*I,P=Math.sqrt(k*k+F*F),L[0]=P,t=1;t<8;t++)k+=C,F+=R,C+=T,R+=I,P+=Math.sqrt(k*k+F*F),L[t]=P;k+=C,F+=R,P+=Math.sqrt(k*k+F*F),L[8]=P,k+=C+T,F+=R+I,P+=Math.sqrt(k*k+F*F),L[9]=P,m=0}for(Y*=P;;m++){let t=L[m];if(!(Y>t)){if(0==m)Y/=t;else{let e=L[m-1];Y=m+(Y-e)/(t-e)}break}}this.addCurvePosition(.1*Y,g,x,v,y,w,b,M,A,a,s,i||t>0&&0==e)}return a}addBeforePosition(t,e,i,s,n){let r=e[i],a=e[i+1],o=e[i+2]-r,h=e[i+3]-a,l=Math.atan2(h,o);s[n]=r+t*Math.cos(l),s[n+1]=a+t*Math.sin(l),s[n+2]=l}addAfterPosition(t,e,i,s,n){let r=e[i+2],a=e[i+3],o=r-e[i],h=a-e[i+1],l=Math.atan2(h,o);s[n]=r+t*Math.cos(l),s[n+1]=a+t*Math.sin(l),s[n+2]=l}addCurvePosition(t,e,i,s,n,r,a,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=i,void(l[c+2]=Math.atan2(n-i,s-e));let d=t*t,f=d*t,p=1-t,m=p*p,g=m*p,x=p*t,v=3*x,y=p*v,w=v*t,b=e*g+s*y+r*w+o*f,M=i*g+n*y+a*w+h*f;l[c]=b,l[c+1]=M,u&&(l[c+2]=t<.001?Math.atan2(n-i,s-e):Math.atan2(M-(i*m+n*x*2+a*d),b-(e*m+s*x*2+r*d)))}},be=we;be.NONE=-1,be.BEFORE=-2,be.AFTER=-3,be.epsilon=1e-5;var Me=class{constructor(t,e){if(this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new h,this.darkColor=t.darkColor?new h:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(t instanceof A&&this.attachment instanceof A&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},Ae=class{constructor(t,e){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new v,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(let i=0;i0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;fc.PI?r-=c.PI2:r<-c.PI&&(r+=c.PI2),r*=t;let a=Math.cos(r),o=Math.sin(r);x.a=a*e-o*s,x.b=a*i-o*n,x.c=o*e+a*s,x.d=o*i+a*n}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(t.x-x.worldX)*e,x.worldY+=(t.y-x.worldY)*i}if(0!=s){let t=Math.sqrt(x.a*x.a+x.c*x.c);0!=t&&(t=(t+(Math.sqrt(h*h+u*u)-t+this.data.offsetScaleX)*s)/t),x.a*=t,x.c*=t}if(0!=n){let t=Math.sqrt(x.b*x.b+x.d*x.d);0!=t&&(t=(t+(Math.sqrt(l*l+d*d)-t+this.data.offsetScaleY)*n)/t),x.b*=t,x.d*=t}if(r>0){let t=x.b,e=x.d,i=Math.atan2(e,t),s=Math.atan2(d,l)-Math.atan2(u,h)-(i-Math.atan2(x.c,x.a));s>c.PI?s-=c.PI2:s<-c.PI&&(s+=c.PI2),s=i+(s+m)*r;let n=Math.sqrt(t*t+e*e);x.b=Math.cos(s)*n,x.d=Math.sin(s)*n}x.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=0!=e||0!=i,o=this.target,h=o.a,l=o.b,u=o.c,d=o.d,f=h*d-l*u>0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;fc.PI?r-=c.PI2:r<-c.PI&&(r+=c.PI2),r*=t;let a=Math.cos(r),o=Math.sin(r);x.a=a*e-o*s,x.b=a*i-o*n,x.c=o*e+a*s,x.d=o*i+a*n}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=t.x*e,x.worldY+=t.y*i}if(0!=s){let t=(Math.sqrt(h*h+u*u)-1+this.data.offsetScaleX)*s+1;x.a*=t,x.c*=t}if(0!=n){let t=(Math.sqrt(l*l+d*d)-1+this.data.offsetScaleY)*n+1;x.b*=t,x.d*=t}if(r>0){let t=Math.atan2(d,l)-Math.atan2(u,h);t>c.PI?t-=c.PI2:t<-c.PI&&(t+=c.PI2);let e=x.b,i=x.d;t=Math.atan2(i,e)+(t-c.PI/2+m)*r;let s=Math.sqrt(e*e+i*i);x.b=Math.cos(t)*s,x.d=Math.sin(t)*s}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=this.target,o=this.bones;for(let h=0,l=o.length;h=s.length&&(s.length=t+1),s[t]||(s[t]={}),s[t][e]=i}addSkin(t){for(let e=0;e= 0.");if(!e)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}},ke=(t=>(t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen",t))(ke||{}),Fe=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Le=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new Te;i.name="";let s=new Pe(t),n=s.readInt32(),r=s.readInt32();i.hash=0==r&&0==n?null:r.toString(16)+n.toString(16),i.version=s.readString(),i.x=s.readFloat(),i.y=s.readFloat(),i.width=s.readFloat(),i.height=s.readFloat();let a=s.readBoolean();a&&(i.fps=s.readFloat(),i.imagesPath=s.readString(),i.audioPath=s.readString());let o=0;o=s.readInt(!0);for(let t=0;t>4,t.readFloat())}s.push(e);break}}}}}let r=t.readInt(!0);if(r>0){let e=new bt(r),n=i.slots.length;for(let i=0;i=0;t--)a[t]=-1;let o=m.newArray(n-r,0),h=0,l=0;for(let e=0;e=0;t--)-1==a[t]&&(a[t]=o[--l]);e.setFrame(i,s,a)}s.push(e)}let a=t.readInt(!0);if(a>0){let e=new yt(a);for(let s=0;s>>1^-(1&i)}readStringRef(){let t=this.readInt(!0);return 0==t?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&t)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(t),i++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return 0!=this.readByte()}},Ye=class{constructor(t,e,i,s,n){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=s,this.inheritTimeline=n}},Oe=class{constructor(t=null,e=null){this.bones=t,this.vertices=e}},De=(t=>(t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping",t))(De||{});function Xe(t,e,i){let s=t.readFloat(),n=t.readFloat()*i;for(let r=0,a=0,o=e.getFrameCount()-1;e.setFrame(r,s,n),r!=o;r++){let o=t.readFloat(),h=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(r);break;case li:ze(t,e,a++,r,0,s,o,n,h,i)}s=o,n=h}return e}function Be(t,e,i){let s=t.readFloat(),n=t.readFloat()*i,r=t.readFloat()*i;for(let a=0,o=0,h=e.getFrameCount()-1;e.setFrame(a,s,n,r),a!=h;a++){let h=t.readFloat(),l=t.readFloat()*i,c=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(a);break;case li:ze(t,e,o++,a,0,s,h,n,l,i),ze(t,e,o++,a,1,s,h,r,c,i)}s=h,n=l,r=c}return e}function ze(t,e,i,s,n,r,a,o,h,l){e.setBezier(i,s,n,r,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,a,h)}var _e,Ve=0,Ne=1,Ue=2,We=3,qe=4,Ge=5,je=6,He=7,Ze=8,Ke=9,Je=0,Qe=1,$e=2,ti=3,ei=4,ii=5,si=0,ni=1,ri=0,ai=1,oi=2,hi=1,li=2,ci=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new x(()=>m.newFloatArray(16))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");let i=this.boundingBoxes,s=this.polygons,n=this.polygonPool,r=t.slots,a=r.length;i.length=0,n.freeAll(s),s.length=0;for(let t=0;t=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,i,s){let n=this.minX,r=this.minY,a=this.maxX,o=this.maxY;if(t<=n&&i<=n||e<=r&&s<=r||t>=a&&i>=a||e>=o&&s>=o)return!1;let h=(s-e)/(i-t),l=h*(n-t)+e;if(l>r&&lr&&ln&&cn&&ct.minX&&this.minYt.minY}containsPoint(t,e){let i=this.polygons;for(let s=0,n=i.length;s=i||o=i){let h=s[t];h+(i-n)/(o-n)*(s[r]-h)=c&&x<=a||x>=a&&x<=c)&&(x>=e&&x<=s||x>=s&&x<=e)){let t=(l*m-h*f)/g;if((t>=u&&t<=d||t>=d&&t<=u)&&(t>=i&&t<=n||t>=n&&t<=i))return!0}c=a,u=d}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},ui=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new x(()=>new Array),this.polygonIndicesPool=new x(()=>new Array)}triangulate(t){let e=t,i=t.length>>1,s=this.indicesArray;s.length=0;for(let t=0;t3;){let t=i-1,a=0,o=1;for(;;){t:if(!n[a]){let r=s[t]<<1,h=s[a]<<1,l=s[o]<<1,c=e[r],u=e[r+1],d=e[h],f=e[h+1],p=e[l],m=e[l+1];for(let r=(o+1)%i;r!=t;r=(r+1)%i){if(!n[r])continue;let t=s[r]<<1,i=e[t],a=e[t+1];if(ui.positiveArea(p,m,c,u,i,a)&&ui.positiveArea(c,u,d,f,i,a)&&ui.positiveArea(d,f,p,m,i,a))break t}break}if(0==o){do{if(!n[a])break;a--}while(a>0);break}t=a,a=o,o=(o+1)%i}r.push(s[(i+a-1)%i]),r.push(s[a]),r.push(s[(a+1)%i]),s.splice(a,1),n.splice(a,1),i--;let h=(i+a-1)%i,l=a==i?0:a;n[h]=ui.isConcave(h,i,e,s),n[l]=ui.isConcave(l,i,e,s)}return 3==i&&(r.push(s[2]),r.push(s[0]),r.push(s[1])),r}decompose(t,e){let i=t,s=this.convexPolygons;this.polygonPool.freeAll(s),s.length=0;let n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;let r=this.polygonIndicesPool.obtain();r.length=0;let a=this.polygonPool.obtain();a.length=0;let o=-1,h=0;for(let t=0,l=e.length;t0?(s.push(a),n.push(r)):(this.polygonPool.free(a),this.polygonIndicesPool.free(r)),a=this.polygonPool.obtain(),a.length=0,a.push(d),a.push(f),a.push(p),a.push(m),a.push(g),a.push(x),r=this.polygonIndicesPool.obtain(),r.length=0,r.push(l),r.push(c),r.push(u),h=ui.winding(d,f,p,m,g,x),o=l)}a.length>0&&(s.push(a),n.push(r));for(let t=0,e=s.length;t=0;t--)a=s[t],0==a.length&&(s.splice(t,1),this.polygonPool.free(a),r=n[t],n.splice(t,1),this.polygonIndicesPool.free(r));return s}static isConcave(t,e,i,s){let n=s[(e+t-1)%e]<<1,r=s[t]<<1,a=s[(t+1)%e]<<1;return!this.positiveArea(i[n],i[n+1],i[r],i[r+1],i[a],i[a+1])}static positiveArea(t,e,i,s,n,r){return t*(r-s)+i*(e-r)+n*(s-e)>=0}static winding(t,e,i,s,n,r){let a=i-t,o=s-e;return n*o-r*a+a*e-t*o>=0?1:-1}},di=class{constructor(){this.triangulator=new ui,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let i=e.worldVerticesLength,s=m.setArraySize(this.clippingPolygon,i);e.computeWorldVertices(t,0,i,s,0,2);let n=this.clippingPolygon;di.makeClockwise(n);let r=this.clippingPolygons=this.triangulator.decompose(n,this.triangulator.triangulate(n));for(let t=0,e=r.length;t>1,R=this.clipOutput,k=m.setArraySize(l,e+C*f);for(let h=0;h=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(i),h.push(s),h.push(n),h.push(r),h.push(t),h.push(e),o.length=0;let u=a,d=a.length-4;for(let t=0;;t+=2){let e=u[t],i=u[t+1],s=u[t+2],n=u[t+3],r=e-s,a=i-n,f=h,p=h.length-2,m=o.length;for(let t=0;t0;if(r*(l-n)-a*(h-s)>0){if(p){o.push(u),o.push(d);continue}let t=d-l,r=u-h,a=t*(s-e)-r*(n-i);if(Math.abs(a)>1e-6){let c=(r*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(n-i)*c)}else o.push(e),o.push(i)}else if(p){let t=d-l,r=u-h,a=t*(s-e)-r*(n-i);if(Math.abs(a)>1e-6){let c=(r*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(n-i)*c)}else o.push(e),o.push(i);o.push(u),o.push(d)}c=!0}if(m==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),t==d)break;let g=o;(o=h).length=0,h=g}if(l!=o){l.length=0;for(let t=0,e=o.length-2;t>1;t=0;e--)-1==o[e]&&(o[e]=t[--n])}e.setFrame(r,vi(a,"time",0),o)}n.push(e)}if(t.events){let e=new yt(t.events.length),s=0;for(let n=0;n{t&&t.preventDefault()}),i.addEventListener("webglcontextrestored",t=>{for(let t=0,e=this.restorables.length;t-1&&this.restorables.splice(e,1)}},wi=class{static getDestGLBlendMode(t){switch(t){case 0:return 771;case 1:return 1;case 2:case 3:return 771;default:throw new Error("Unknown blend mode: "+t)}}static getSourceColorGLBlendMode(t,e=!1){switch(t){case 0:case 1:return e?1:770;case 2:return 774;case 3:return 1;default:throw new Error("Unknown blend mode: "+t)}}static getSourceAlphaGLBlendMode(t){switch(t){case 0:case 1:return 1;case 2:return 771;case 3:return 769;default:throw new Error("Unknown blend mode: "+t)}}},bi=class extends qt{constructor(t,e,i=!1){super(e),this.texture=null,this.boundUnit=0,this.useMipMaps=!1,this.context=t instanceof yi?t:new yi(t),this.useMipMaps=i,this.restore(),this.context.addRestorable(this)}setFilters(t,e){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,bi.validateMagFilter(e)),this.useMipMaps=bi.usesMipMaps(t),this.useMipMaps&&i.generateMipmap(i.TEXTURE_2D)}static validateMagFilter(t){switch(t){case 9987:case 9987:case 9985:case 9986:case 9984:return 9729;default:return t}}static usesMipMaps(t){switch(t){case 9987:case 9987:case 9985:case 9986:case 9984:return!0;default:return!1}}setWraps(t,e){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e)}update(t){let e=this.context.gl;this.texture||(this.texture=this.context.gl.createTexture()),this.bind(),bi.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL&&e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this._image),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t&&e.generateMipmap(e.TEXTURE_2D)}restore(){this.texture=null,this.update(this.useMipMaps)}bind(t=0){let e=this.context.gl;this.boundUnit=t,e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.texture)}unbind(){let t=this.context.gl;t.activeTexture(t.TEXTURE0+this.boundUnit),t.bindTexture(t.TEXTURE_2D,null)}dispose(){this.context.removeRestorable(this),this.context.gl.deleteTexture(this.texture)}},Mi=bi;Mi.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL=!1;var Ai=class extends ce{constructor(t,e="",i=new ue){super(e=>new Mi(t,e),e,i)}},Ei=class{constructor(t=0,e=0,i=0){this.x=0,this.y=0,this.z=0,this.x=t,this.y=e,this.z=i}setFrom(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}set(t,e,i){return this.x=t,this.y=e,this.z=i,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}scale(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(){let t=this.length();return 0==t||(t=1/t,this.x*=t,this.y*=t,this.z*=t),this}cross(t){return this.set(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)}multiply(t){let e=t.values;return this.set(this.x*e[Si]+this.y*e[Ti]+this.z*e[Ii]+e[Ci],this.x*e[Ri]+this.y*e[ki]+this.z*e[Fi]+e[Li],this.x*e[Pi]+this.y*e[Yi]+this.z*e[Oi]+e[Di])}project(t){let e=t.values,i=1/(this.x*e[Xi]+this.y*e[Bi]+this.z*e[zi]+e[_i]);return this.set((this.x*e[Si]+this.y*e[Ti]+this.z*e[Ii]+e[Ci])*i,(this.x*e[Ri]+this.y*e[ki]+this.z*e[Fi]+e[Li])*i,(this.x*e[Pi]+this.y*e[Yi]+this.z*e[Oi]+e[Di])*i)}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}distance(t){let e=t.x-this.x,i=t.y-this.y,s=t.z-this.z;return Math.sqrt(e*e+i*i+s*s)}},Si=0,Ti=4,Ii=8,Ci=12,Ri=1,ki=5,Fi=9,Li=13,Pi=2,Yi=6,Oi=10,Di=14,Xi=3,Bi=7,zi=11,_i=15,Vi=class{constructor(){this.temp=new Float32Array(16),this.values=new Float32Array(16);let t=this.values;t[Si]=1,t[ki]=1,t[Oi]=1,t[_i]=1}set(t){return this.values.set(t),this}transpose(){let t=this.temp,e=this.values;return t[Si]=e[Si],t[Ti]=e[Ri],t[Ii]=e[Pi],t[Ci]=e[Xi],t[Ri]=e[Ti],t[ki]=e[ki],t[Fi]=e[Yi],t[Li]=e[Bi],t[Pi]=e[Ii],t[Yi]=e[Fi],t[Oi]=e[Oi],t[Di]=e[zi],t[Xi]=e[Ci],t[Bi]=e[Li],t[zi]=e[Di],t[_i]=e[_i],this.set(t)}identity(){let t=this.values;return t[Si]=1,t[Ti]=0,t[Ii]=0,t[Ci]=0,t[Ri]=0,t[ki]=1,t[Fi]=0,t[Li]=0,t[Pi]=0,t[Yi]=0,t[Oi]=1,t[Di]=0,t[Xi]=0,t[Bi]=0,t[zi]=0,t[_i]=1,this}invert(){let t=this.values,e=this.temp,i=t[Xi]*t[Yi]*t[Fi]*t[Ci]-t[Pi]*t[Bi]*t[Fi]*t[Ci]-t[Xi]*t[ki]*t[Oi]*t[Ci]+t[Ri]*t[Bi]*t[Oi]*t[Ci]+t[Pi]*t[ki]*t[zi]*t[Ci]-t[Ri]*t[Yi]*t[zi]*t[Ci]-t[Xi]*t[Yi]*t[Ii]*t[Li]+t[Pi]*t[Bi]*t[Ii]*t[Li]+t[Xi]*t[Ti]*t[Oi]*t[Li]-t[Si]*t[Bi]*t[Oi]*t[Li]-t[Pi]*t[Ti]*t[zi]*t[Li]+t[Si]*t[Yi]*t[zi]*t[Li]+t[Xi]*t[ki]*t[Ii]*t[Di]-t[Ri]*t[Bi]*t[Ii]*t[Di]-t[Xi]*t[Ti]*t[Fi]*t[Di]+t[Si]*t[Bi]*t[Fi]*t[Di]+t[Ri]*t[Ti]*t[zi]*t[Di]-t[Si]*t[ki]*t[zi]*t[Di]-t[Pi]*t[ki]*t[Ii]*t[_i]+t[Ri]*t[Yi]*t[Ii]*t[_i]+t[Pi]*t[Ti]*t[Fi]*t[_i]-t[Si]*t[Yi]*t[Fi]*t[_i]-t[Ri]*t[Ti]*t[Oi]*t[_i]+t[Si]*t[ki]*t[Oi]*t[_i];if(0==i)throw new Error("non-invertible matrix");let s=1/i;return e[Si]=t[Fi]*t[Di]*t[Bi]-t[Li]*t[Oi]*t[Bi]+t[Li]*t[Yi]*t[zi]-t[ki]*t[Di]*t[zi]-t[Fi]*t[Yi]*t[_i]+t[ki]*t[Oi]*t[_i],e[Ti]=t[Ci]*t[Oi]*t[Bi]-t[Ii]*t[Di]*t[Bi]-t[Ci]*t[Yi]*t[zi]+t[Ti]*t[Di]*t[zi]+t[Ii]*t[Yi]*t[_i]-t[Ti]*t[Oi]*t[_i],e[Ii]=t[Ii]*t[Li]*t[Bi]-t[Ci]*t[Fi]*t[Bi]+t[Ci]*t[ki]*t[zi]-t[Ti]*t[Li]*t[zi]-t[Ii]*t[ki]*t[_i]+t[Ti]*t[Fi]*t[_i],e[Ci]=t[Ci]*t[Fi]*t[Yi]-t[Ii]*t[Li]*t[Yi]-t[Ci]*t[ki]*t[Oi]+t[Ti]*t[Li]*t[Oi]+t[Ii]*t[ki]*t[Di]-t[Ti]*t[Fi]*t[Di],e[Ri]=t[Li]*t[Oi]*t[Xi]-t[Fi]*t[Di]*t[Xi]-t[Li]*t[Pi]*t[zi]+t[Ri]*t[Di]*t[zi]+t[Fi]*t[Pi]*t[_i]-t[Ri]*t[Oi]*t[_i],e[ki]=t[Ii]*t[Di]*t[Xi]-t[Ci]*t[Oi]*t[Xi]+t[Ci]*t[Pi]*t[zi]-t[Si]*t[Di]*t[zi]-t[Ii]*t[Pi]*t[_i]+t[Si]*t[Oi]*t[_i],e[Fi]=t[Ci]*t[Fi]*t[Xi]-t[Ii]*t[Li]*t[Xi]-t[Ci]*t[Ri]*t[zi]+t[Si]*t[Li]*t[zi]+t[Ii]*t[Ri]*t[_i]-t[Si]*t[Fi]*t[_i],e[Li]=t[Ii]*t[Li]*t[Pi]-t[Ci]*t[Fi]*t[Pi]+t[Ci]*t[Ri]*t[Oi]-t[Si]*t[Li]*t[Oi]-t[Ii]*t[Ri]*t[Di]+t[Si]*t[Fi]*t[Di],e[Pi]=t[ki]*t[Di]*t[Xi]-t[Li]*t[Yi]*t[Xi]+t[Li]*t[Pi]*t[Bi]-t[Ri]*t[Di]*t[Bi]-t[ki]*t[Pi]*t[_i]+t[Ri]*t[Yi]*t[_i],e[Yi]=t[Ci]*t[Yi]*t[Xi]-t[Ti]*t[Di]*t[Xi]-t[Ci]*t[Pi]*t[Bi]+t[Si]*t[Di]*t[Bi]+t[Ti]*t[Pi]*t[_i]-t[Si]*t[Yi]*t[_i],e[Oi]=t[Ti]*t[Li]*t[Xi]-t[Ci]*t[ki]*t[Xi]+t[Ci]*t[Ri]*t[Bi]-t[Si]*t[Li]*t[Bi]-t[Ti]*t[Ri]*t[_i]+t[Si]*t[ki]*t[_i],e[Di]=t[Ci]*t[ki]*t[Pi]-t[Ti]*t[Li]*t[Pi]-t[Ci]*t[Ri]*t[Yi]+t[Si]*t[Li]*t[Yi]+t[Ti]*t[Ri]*t[Di]-t[Si]*t[ki]*t[Di],e[Xi]=t[Fi]*t[Yi]*t[Xi]-t[ki]*t[Oi]*t[Xi]-t[Fi]*t[Pi]*t[Bi]+t[Ri]*t[Oi]*t[Bi]+t[ki]*t[Pi]*t[zi]-t[Ri]*t[Yi]*t[zi],e[Bi]=t[Ti]*t[Oi]*t[Xi]-t[Ii]*t[Yi]*t[Xi]+t[Ii]*t[Pi]*t[Bi]-t[Si]*t[Oi]*t[Bi]-t[Ti]*t[Pi]*t[zi]+t[Si]*t[Yi]*t[zi],e[zi]=t[Ii]*t[ki]*t[Xi]-t[Ti]*t[Fi]*t[Xi]-t[Ii]*t[Ri]*t[Bi]+t[Si]*t[Fi]*t[Bi]+t[Ti]*t[Ri]*t[zi]-t[Si]*t[ki]*t[zi],e[_i]=t[Ti]*t[Fi]*t[Pi]-t[Ii]*t[ki]*t[Pi]+t[Ii]*t[Ri]*t[Yi]-t[Si]*t[Fi]*t[Yi]-t[Ti]*t[Ri]*t[Oi]+t[Si]*t[ki]*t[Oi],t[Si]=e[Si]*s,t[Ti]=e[Ti]*s,t[Ii]=e[Ii]*s,t[Ci]=e[Ci]*s,t[Ri]=e[Ri]*s,t[ki]=e[ki]*s,t[Fi]=e[Fi]*s,t[Li]=e[Li]*s,t[Pi]=e[Pi]*s,t[Yi]=e[Yi]*s,t[Oi]=e[Oi]*s,t[Di]=e[Di]*s,t[Xi]=e[Xi]*s,t[Bi]=e[Bi]*s,t[zi]=e[zi]*s,t[_i]=e[_i]*s,this}determinant(){let t=this.values;return t[Xi]*t[Yi]*t[Fi]*t[Ci]-t[Pi]*t[Bi]*t[Fi]*t[Ci]-t[Xi]*t[ki]*t[Oi]*t[Ci]+t[Ri]*t[Bi]*t[Oi]*t[Ci]+t[Pi]*t[ki]*t[zi]*t[Ci]-t[Ri]*t[Yi]*t[zi]*t[Ci]-t[Xi]*t[Yi]*t[Ii]*t[Li]+t[Pi]*t[Bi]*t[Ii]*t[Li]+t[Xi]*t[Ti]*t[Oi]*t[Li]-t[Si]*t[Bi]*t[Oi]*t[Li]-t[Pi]*t[Ti]*t[zi]*t[Li]+t[Si]*t[Yi]*t[zi]*t[Li]+t[Xi]*t[ki]*t[Ii]*t[Di]-t[Ri]*t[Bi]*t[Ii]*t[Di]-t[Xi]*t[Ti]*t[Fi]*t[Di]+t[Si]*t[Bi]*t[Fi]*t[Di]+t[Ri]*t[Ti]*t[zi]*t[Di]-t[Si]*t[ki]*t[zi]*t[Di]-t[Pi]*t[ki]*t[Ii]*t[_i]+t[Ri]*t[Yi]*t[Ii]*t[_i]+t[Pi]*t[Ti]*t[Fi]*t[_i]-t[Si]*t[Yi]*t[Fi]*t[_i]-t[Ri]*t[Ti]*t[Oi]*t[_i]+t[Si]*t[ki]*t[Oi]*t[_i]}translate(t,e,i){let s=this.values;return s[Ci]+=t,s[Li]+=e,s[Di]+=i,this}copy(){return(new Vi).set(this.values)}projection(t,e,i,s){this.identity();let n=1/Math.tan(i*(Math.PI/180)/2),r=(e+t)/(t-e),a=2*e*t/(t-e),o=this.values;return o[Si]=n/s,o[Ri]=0,o[Pi]=0,o[Xi]=0,o[Ti]=0,o[ki]=n,o[Yi]=0,o[Bi]=0,o[Ii]=0,o[Fi]=0,o[Oi]=r,o[zi]=-1,o[Ci]=0,o[Li]=0,o[Di]=a,o[_i]=0,this}ortho2d(t,e,i,s){return this.ortho(t,t+i,e,e+s,0,1)}ortho(t,e,i,s,n,r){this.identity();let a=2/(e-t),o=2/(s-i),h=-2/(r-n),l=-(e+t)/(e-t),c=-(s+i)/(s-i),u=-(r+n)/(r-n),d=this.values;return d[Si]=a,d[Ri]=0,d[Pi]=0,d[Xi]=0,d[Ti]=0,d[ki]=o,d[Yi]=0,d[Bi]=0,d[Ii]=0,d[Fi]=0,d[Oi]=h,d[zi]=0,d[Ci]=l,d[Li]=c,d[Di]=u,d[_i]=1,this}multiply(t){let e=this.temp,i=this.values,s=t.values;return e[Si]=i[Si]*s[Si]+i[Ti]*s[Ri]+i[Ii]*s[Pi]+i[Ci]*s[Xi],e[Ti]=i[Si]*s[Ti]+i[Ti]*s[ki]+i[Ii]*s[Yi]+i[Ci]*s[Bi],e[Ii]=i[Si]*s[Ii]+i[Ti]*s[Fi]+i[Ii]*s[Oi]+i[Ci]*s[zi],e[Ci]=i[Si]*s[Ci]+i[Ti]*s[Li]+i[Ii]*s[Di]+i[Ci]*s[_i],e[Ri]=i[Ri]*s[Si]+i[ki]*s[Ri]+i[Fi]*s[Pi]+i[Li]*s[Xi],e[ki]=i[Ri]*s[Ti]+i[ki]*s[ki]+i[Fi]*s[Yi]+i[Li]*s[Bi],e[Fi]=i[Ri]*s[Ii]+i[ki]*s[Fi]+i[Fi]*s[Oi]+i[Li]*s[zi],e[Li]=i[Ri]*s[Ci]+i[ki]*s[Li]+i[Fi]*s[Di]+i[Li]*s[_i],e[Pi]=i[Pi]*s[Si]+i[Yi]*s[Ri]+i[Oi]*s[Pi]+i[Di]*s[Xi],e[Yi]=i[Pi]*s[Ti]+i[Yi]*s[ki]+i[Oi]*s[Yi]+i[Di]*s[Bi],e[Oi]=i[Pi]*s[Ii]+i[Yi]*s[Fi]+i[Oi]*s[Oi]+i[Di]*s[zi],e[Di]=i[Pi]*s[Ci]+i[Yi]*s[Li]+i[Oi]*s[Di]+i[Di]*s[_i],e[Xi]=i[Xi]*s[Si]+i[Bi]*s[Ri]+i[zi]*s[Pi]+i[_i]*s[Xi],e[Bi]=i[Xi]*s[Ti]+i[Bi]*s[ki]+i[zi]*s[Yi]+i[_i]*s[Bi],e[zi]=i[Xi]*s[Ii]+i[Bi]*s[Fi]+i[zi]*s[Oi]+i[_i]*s[zi],e[_i]=i[Xi]*s[Ci]+i[Bi]*s[Li]+i[zi]*s[Di]+i[_i]*s[_i],this.set(this.temp)}multiplyLeft(t){let e=this.temp,i=this.values,s=t.values;return e[Si]=s[Si]*i[Si]+s[Ti]*i[Ri]+s[Ii]*i[Pi]+s[Ci]*i[Xi],e[Ti]=s[Si]*i[Ti]+s[Ti]*i[ki]+s[Ii]*i[Yi]+s[Ci]*i[Bi],e[Ii]=s[Si]*i[Ii]+s[Ti]*i[Fi]+s[Ii]*i[Oi]+s[Ci]*i[zi],e[Ci]=s[Si]*i[Ci]+s[Ti]*i[Li]+s[Ii]*i[Di]+s[Ci]*i[_i],e[Ri]=s[Ri]*i[Si]+s[ki]*i[Ri]+s[Fi]*i[Pi]+s[Li]*i[Xi],e[ki]=s[Ri]*i[Ti]+s[ki]*i[ki]+s[Fi]*i[Yi]+s[Li]*i[Bi],e[Fi]=s[Ri]*i[Ii]+s[ki]*i[Fi]+s[Fi]*i[Oi]+s[Li]*i[zi],e[Li]=s[Ri]*i[Ci]+s[ki]*i[Li]+s[Fi]*i[Di]+s[Li]*i[_i],e[Pi]=s[Pi]*i[Si]+s[Yi]*i[Ri]+s[Oi]*i[Pi]+s[Di]*i[Xi],e[Yi]=s[Pi]*i[Ti]+s[Yi]*i[ki]+s[Oi]*i[Yi]+s[Di]*i[Bi],e[Oi]=s[Pi]*i[Ii]+s[Yi]*i[Fi]+s[Oi]*i[Oi]+s[Di]*i[zi],e[Di]=s[Pi]*i[Ci]+s[Yi]*i[Li]+s[Oi]*i[Di]+s[Di]*i[_i],e[Xi]=s[Xi]*i[Si]+s[Bi]*i[Ri]+s[zi]*i[Pi]+s[_i]*i[Xi],e[Bi]=s[Xi]*i[Ti]+s[Bi]*i[ki]+s[zi]*i[Yi]+s[_i]*i[Bi],e[zi]=s[Xi]*i[Ii]+s[Bi]*i[Fi]+s[zi]*i[Oi]+s[_i]*i[zi],e[_i]=s[Xi]*i[Ci]+s[Bi]*i[Li]+s[zi]*i[Di]+s[_i]*i[_i],this.set(this.temp)}lookAt(t,e,i){let s=Vi.xAxis,n=Vi.yAxis,r=Vi.zAxis;r.setFrom(e).normalize(),s.setFrom(e).normalize(),s.cross(i).normalize(),n.setFrom(s).cross(r).normalize(),this.identity();let a=this.values;return a[Si]=s.x,a[Ti]=s.y,a[Ii]=s.z,a[Ri]=n.x,a[ki]=n.y,a[Fi]=n.z,a[Pi]=-r.x,a[Yi]=-r.y,a[Oi]=-r.z,Vi.tmpMatrix.identity(),Vi.tmpMatrix.values[Ci]=-t.x,Vi.tmpMatrix.values[Li]=-t.y,Vi.tmpMatrix.values[Di]=-t.z,this.multiply(Vi.tmpMatrix),this}},Ni=Vi;Ni.xAxis=new Ei,Ni.yAxis=new Ei,Ni.zAxis=new Ei,Ni.tmpMatrix=new Vi;var Ui=class{constructor(t,e){this.position=new Ei(0,0,0),this.direction=new Ei(0,0,-1),this.up=new Ei(0,1,0),this.near=0,this.far=100,this.zoom=1,this.viewportWidth=0,this.viewportHeight=0,this.projectionView=new Ni,this.inverseProjectionView=new Ni,this.projection=new Ni,this.view=new Ni,this.viewportWidth=t,this.viewportHeight=e,this.update()}update(){let t=this.projection,e=this.view,i=this.projectionView,s=this.inverseProjectionView,n=this.zoom,r=this.viewportWidth,a=this.viewportHeight;t.ortho(n*(-r/2),n*(r/2),n*(-a/2),n*(a/2),this.near,this.far),e.lookAt(this.position,this.direction,this.up),i.set(t.values),i.multiply(e),s.set(i.values).invert()}screenToWorld(t,e,i){let s=t.x,n=i-t.y-1;return t.x=2*s/e-1,t.y=2*n/i-1,t.z=2*t.z-1,t.project(this.inverseProjectionView),t}worldToScreen(t,e,i){return t.project(this.projectionView),t.x=e*(t.x+1)/2,t.y=i*(t.y+1)/2,t.z=(t.z+1)/2,t}setViewport(t,e){this.viewportWidth=t,this.viewportHeight=e}},Wi=class{constructor(t){this.mouseX=0,this.mouseY=0,this.buttonDown=!1,this.touch0=null,this.touch1=null,this.initialPinchDistance=0,this.listeners=new Array,this.eventListeners=[],this.element=t,this.setupCallbacks(t)}setupCallbacks(t){let e=e=>{if(e instanceof MouseEvent){let i=t.getBoundingClientRect();this.mouseX=e.clientX-i.left,this.mouseY=e.clientY-i.top,this.listeners.map(t=>{this.buttonDown?t.dragged&&t.dragged(this.mouseX,this.mouseY):t.moved&&t.moved(this.mouseX,this.mouseY)})}},i=s=>{if(s instanceof MouseEvent){let n=t.getBoundingClientRect();this.mouseX=s.clientX-n.left,this.mouseY=s.clientY-n.top,this.buttonDown=!1,this.listeners.map(t=>{t.up&&t.up(this.mouseX,this.mouseY)}),document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",i)}};t.addEventListener("mousedown",s=>{if(s instanceof MouseEvent){let n=t.getBoundingClientRect();this.mouseX=s.clientX-n.left,this.mouseY=s.clientY-n.top,this.buttonDown=!0,this.listeners.map(t=>{t.down&&t.down(this.mouseX,this.mouseY)}),document.addEventListener("mousemove",e),document.addEventListener("mouseup",i)}},!0),t.addEventListener("mousemove",e,!0),t.addEventListener("mouseup",i,!0),t.addEventListener("wheel",t=>{t.preventDefault();let e=t.deltaY;t.deltaMode==WheelEvent.DOM_DELTA_LINE&&(e*=8),t.deltaMode==WheelEvent.DOM_DELTA_PAGE&&(e*=24),this.listeners.map(e=>{e.wheel&&e.wheel(t.deltaY)})},!0),t.addEventListener("touchstart",e=>{if(!this.touch0||!this.touch1){let i=e.changedTouches.item(0);if(!i)return;let s=t.getBoundingClientRect(),n=i.clientX-s.left,r=i.clientY-s.top,a=new qi(i.identifier,n,r);if(this.mouseX=n,this.mouseY=r,this.buttonDown=!0,this.touch0){if(!this.touch1){this.touch1=a;let t=this.touch1.x-this.touch0.x,e=this.touch1.x-this.touch0.x;this.initialPinchDistance=Math.sqrt(t*t+e*e),this.listeners.map(t=>{t.zoom&&t.zoom(this.initialPinchDistance,this.initialPinchDistance)})}}else this.touch0=a,this.listeners.map(t=>{t.down&&t.down(a.x,a.y)})}e.preventDefault()},!1),t.addEventListener("touchmove",e=>{if(this.touch0){var i=e.changedTouches;let r=t.getBoundingClientRect();for(var s=0;s{i.dragged&&i.dragged(t,e)})),this.touch1&&this.touch1.identifier===n.identifier&&(this.touch1.x=this.mouseX=t,this.touch1.y=this.mouseY=e)}if(this.touch0&&this.touch1){let t=this.touch1.x-this.touch0.x,e=this.touch1.x-this.touch0.x,i=Math.sqrt(t*t+e*e);this.listeners.map(t=>{t.zoom&&t.zoom(this.initialPinchDistance,i)})}}e.preventDefault()},!1);let s=e=>{if(this.touch0){var i=e.changedTouches;let r=t.getBoundingClientRect();for(var s=0;s{i.up&&i.up(t,e)}),!this.touch1){this.buttonDown=!1;break}this.touch0=this.touch1,this.touch1=null,this.mouseX=this.touch0.x,this.mouseX=this.touch0.x,this.buttonDown=!0,this.listeners.map(t=>{t.down&&t.down(this.touch0.x,this.touch0.y)})}this.touch1&&this.touch1.identifier&&(this.touch1=null)}}e.preventDefault()};t.addEventListener("touchend",s,!1),t.addEventListener("touchcancel",s)}addListener(t){this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>-1&&this.listeners.splice(e,1)}},qi=class{constructor(t,e,i){this.identifier=t,this.x=e,this.y=i}},Gi=class{constructor(t,e){this.canvas=t,this.camera=e;let i=0,s=0,n=0,r=0,a=0,o=0,h=0;new Wi(t).addListener({down:(t,l)=>{i=e.position.x,s=e.position.y,n=a=t,r=o=l,h=e.zoom},dragged:(h,l)=>{let c=h-n,u=l-r,d=e.screenToWorld(new Ei(0,0),t.clientWidth,t.clientHeight),f=e.screenToWorld(new Ei(c,u),t.clientWidth,t.clientHeight).sub(d);e.position.set(i-f.x,s-f.y,0),e.update(),a=h,o=l},wheel:i=>{let s=i/200*e.zoom,n=e.zoom+s;if(n>0){let s=0,r=0;if(i<0)s=a,r=o;else{let e=new Ei(t.clientWidth/2+15,t.clientHeight/2),i=a-e.x,n=t.clientHeight-1-o-e.y;s=e.x-i,r=t.clientHeight-1-e.y+n}let h=e.screenToWorld(new Ei(s,r),t.clientWidth,t.clientHeight);e.zoom=n,e.update();let l=e.screenToWorld(new Ei(s,r),t.clientWidth,t.clientHeight);e.position.add(h.sub(l)),e.update()}},zoom:(t,i)=>{let s=t/i;e.zoom=h*s},up:(t,e)=>{a=t,o=e},moved:(t,e)=>{a=t,o=e}})}},ji=class{constructor(t,e,i){this.vertexShader=e,this.fragmentShader=i,this.vs=null,this.fs=null,this.program=null,this.tmp2x2=new Float32Array(4),this.tmp3x3=new Float32Array(9),this.tmp4x4=new Float32Array(16),this.vsSource=e,this.fsSource=i,this.context=t instanceof yi?t:new yi(t),this.context.addRestorable(this),this.compile()}getProgram(){return this.program}getVertexShader(){return this.vertexShader}getFragmentShader(){return this.fragmentShader}getVertexShaderSource(){return this.vsSource}getFragmentSource(){return this.fsSource}compile(){let t=this.context.gl;try{if(this.vs=this.compileShader(t.VERTEX_SHADER,this.vertexShader),!this.vs)throw new Error("Couldn't compile vertex shader.");if(this.fs=this.compileShader(t.FRAGMENT_SHADER,this.fragmentShader),!this.fs)throw new Error("Couldn#t compile fragment shader.");this.program=this.compileProgram(this.vs,this.fs)}catch(t){throw this.dispose(),t}}compileShader(t,e){let i=this.context.gl,s=i.createShader(t);if(!s)throw new Error("Couldn't create shader.");if(i.shaderSource(s,e),i.compileShader(s),!i.getShaderParameter(s,i.COMPILE_STATUS)){let t="Couldn't compile shader: "+i.getShaderInfoLog(s);if(i.deleteShader(s),!i.isContextLost())throw new Error(t)}return s}compileProgram(t,e){let i=this.context.gl,s=i.createProgram();if(!s)throw new Error("Couldn't compile program.");if(i.attachShader(s,t),i.attachShader(s,e),i.linkProgram(s),!i.getProgramParameter(s,i.LINK_STATUS)){let t="Couldn't compile shader program: "+i.getProgramInfoLog(s);if(i.deleteProgram(s),!i.isContextLost())throw new Error(t)}return s}restore(){this.compile()}bind(){this.context.gl.useProgram(this.program)}unbind(){this.context.gl.useProgram(null)}setUniformi(t,e){this.context.gl.uniform1i(this.getUniformLocation(t),e)}setUniformf(t,e){this.context.gl.uniform1f(this.getUniformLocation(t),e)}setUniform2f(t,e,i){this.context.gl.uniform2f(this.getUniformLocation(t),e,i)}setUniform3f(t,e,i,s){this.context.gl.uniform3f(this.getUniformLocation(t),e,i,s)}setUniform4f(t,e,i,s,n){this.context.gl.uniform4f(this.getUniformLocation(t),e,i,s,n)}setUniform2x2f(t,e){let i=this.context.gl;this.tmp2x2.set(e),i.uniformMatrix2fv(this.getUniformLocation(t),!1,this.tmp2x2)}setUniform3x3f(t,e){let i=this.context.gl;this.tmp3x3.set(e),i.uniformMatrix3fv(this.getUniformLocation(t),!1,this.tmp3x3)}setUniform4x4f(t,e){let i=this.context.gl;this.tmp4x4.set(e),i.uniformMatrix4fv(this.getUniformLocation(t),!1,this.tmp4x4)}getUniformLocation(t){let e=this.context.gl;if(!this.program)throw new Error("Shader not compiled.");let i=e.getUniformLocation(this.program,t);if(!i&&!e.isContextLost())throw new Error("Couldn't find location for uniform "+t);return i}getAttributeLocation(t){let e=this.context.gl;if(!this.program)throw new Error("Shader not compiled.");let i=e.getAttribLocation(this.program,t);if(-1==i&&!e.isContextLost())throw new Error("Couldn't find location for attribute "+t);return i}dispose(){this.context.removeRestorable(this);let t=this.context.gl;this.vs&&(t.deleteShader(this.vs),this.vs=null),this.fs&&(t.deleteShader(this.fs),this.fs=null),this.program&&(t.deleteProgram(this.program),this.program=null)}static newColoredTextured(t){let e=`\n\t\t\t\tattribute vec4 ${ji.POSITION};\n\t\t\t\tattribute vec4 ${ji.COLOR};\n\t\t\t\tattribute vec2 ${ji.TEXCOORDS};\n\t\t\t\tuniform mat4 ${ji.MVP_MATRIX};\n\t\t\t\tvarying vec4 v_color;\n\t\t\t\tvarying vec2 v_texCoords;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = ${ji.COLOR};\n\t\t\t\t\tv_texCoords = ${ji.TEXCOORDS};\n\t\t\t\t\tgl_Position = ${ji.MVP_MATRIX} * ${ji.POSITION};\n\t\t\t\t}\n\t\t\t`;return new ji(t,e,"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_color;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tgl_FragColor = v_color * texture2D(u_texture, v_texCoords);\n\t\t\t\t}\n\t\t\t")}static newTwoColoredTextured(t){let e=`\n\t\t\t\tattribute vec4 ${ji.POSITION};\n\t\t\t\tattribute vec4 ${ji.COLOR};\n\t\t\t\tattribute vec4 ${ji.COLOR2};\n\t\t\t\tattribute vec2 ${ji.TEXCOORDS};\n\t\t\t\tuniform mat4 ${ji.MVP_MATRIX};\n\t\t\t\tvarying vec4 v_light;\n\t\t\t\tvarying vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_light = ${ji.COLOR};\n\t\t\t\t\tv_dark = ${ji.COLOR2};\n\t\t\t\t\tv_texCoords = ${ji.TEXCOORDS};\n\t\t\t\t\tgl_Position = ${ji.MVP_MATRIX} * ${ji.POSITION};\n\t\t\t\t}\n\t\t\t`;return new ji(t,e,"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_light;\n\t\t\t\tvarying LOWP vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tvec4 texColor = texture2D(u_texture, v_texCoords);\n\t\t\t\t\tgl_FragColor.a = texColor.a * v_light.a;\n\t\t\t\t\tgl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;\n\t\t\t\t}\n\t\t\t")}static newColored(t){let e=`\n\t\t\t\tattribute vec4 ${ji.POSITION};\n\t\t\t\tattribute vec4 ${ji.COLOR};\n\t\t\t\tuniform mat4 ${ji.MVP_MATRIX};\n\t\t\t\tvarying vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = ${ji.COLOR};\n\t\t\t\t\tgl_Position = ${ji.MVP_MATRIX} * ${ji.POSITION};\n\t\t\t\t}\n\t\t\t`;return new ji(t,e,"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tgl_FragColor = v_color;\n\t\t\t\t}\n\t\t\t")}},Hi=ji;Hi.MVP_MATRIX="u_projTrans",Hi.POSITION="a_position",Hi.COLOR="a_color",Hi.COLOR2="a_color2",Hi.TEXCOORDS="a_texCoords",Hi.SAMPLER="u_texture";var Zi=class{constructor(t,e,i,s){this.attributes=e,this.verticesBuffer=null,this.verticesLength=0,this.dirtyVertices=!1,this.indicesBuffer=null,this.indicesLength=0,this.dirtyIndices=!1,this.elementsPerVertex=0,this.context=t instanceof yi?t:new yi(t),this.elementsPerVertex=0;for(let t=0;tthis.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length}setIndices(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length}draw(t,e){this.drawWithOffset(t,e,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)}drawWithOffset(t,e,i,s){let n=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?n.drawElements(e,s,n.UNSIGNED_SHORT,2*i):n.drawArrays(e,i,s),this.unbind(t)}bind(t){let e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);let i=0;for(let s=0;s0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)}unbind(t){let e=this.context.gl;for(let i=0;i0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)}update(){let t=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=t.createBuffer()),t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),t.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),t.DYNAMIC_DRAW),this.dirtyIndices=!1)}restore(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()}dispose(){this.context.removeRestorable(this);let t=this.context.gl;t.deleteBuffer(this.verticesBuffer),t.deleteBuffer(this.indicesBuffer)}},Ki=class{constructor(t,e,i){this.name=t,this.type=e,this.numElements=i}},Ji=class extends Ki{constructor(){super(Hi.POSITION,is.Float,2)}},Qi=class extends Ki{constructor(){super(Hi.POSITION,is.Float,3)}},$i=class extends Ki{constructor(t=0){super(Hi.TEXCOORDS+(0==t?"":t),is.Float,2)}},ts=class extends Ki{constructor(){super(Hi.COLOR,is.Float,4)}},es=class extends Ki{constructor(){super(Hi.COLOR2,is.Float,4)}},is=(t=>(t[t.Float=0]="Float",t))(is||{}),ss=class{constructor(t,e=!0,i=10920){if(this.drawCalls=0,this.isDrawing=!1,this.shader=null,this.lastTexture=null,this.verticesLength=0,this.indicesLength=0,this.cullWasEnabled=!1,i>10920)throw new Error("Can't have more than 10920 triangles per batch: "+i);this.context=t instanceof yi?t:new yi(t);let s=e?[new Ji,new ts,new $i,new es]:[new Ji,new ts,new $i];this.mesh=new Zi(t,s,i,3*i);let n=this.context.gl;this.srcColorBlend=n.SRC_ALPHA,this.srcAlphaBlend=n.ONE,this.dstBlend=n.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=t,this.lastTexture=null,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend),this.cullWasEnabled=e.isEnabled(e.CULL_FACE),this.cullWasEnabled&&e.disable(e.CULL_FACE)}setBlendMode(t,e,i){if((this.srcColorBlend!=t||this.srcAlphaBlend!=e||this.dstBlend!=i)&&(this.srcColorBlend=t,this.srcAlphaBlend=e,this.dstBlend=i,this.isDrawing)){this.flush(),this.context.gl.blendFuncSeparate(t,i,e,i)}}draw(t,e,i){t!=this.lastTexture?(this.flush(),this.lastTexture=t):(this.verticesLength+e.length>this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();let s=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);let n=this.mesh.getIndices();for(let t=this.indicesLength,e=0;e0||this.indicesLength>0)&&this.flush(),this.shader=null,this.lastTexture=null,this.isDrawing=!1;let t=this.context.gl;t.disable(t.BLEND),this.cullWasEnabled&&t.enable(t.CULL_FACE)}getDrawCalls(){return this.drawCalls}static getAndResetGlobalDrawCalls(){let t=ss.globalDrawCalls;return ss.globalDrawCalls=0,t}dispose(){this.mesh.dispose()}},ns=ss;ns.globalDrawCalls=0;var rs=class{constructor(t,e=10920){if(this.isDrawing=!1,this.shapeType=as.Filled,this.color=new h(1,1,1,1),this.shader=null,this.vertexIndex=0,this.tmp=new v,e>10920)throw new Error("Can't have more than 10920 triangles per batch: "+e);this.context=t instanceof yi?t:new yi(t),this.mesh=new Zi(t,[new Ji,new ts],e,0);let i=this.context.gl;this.srcColorBlend=i.SRC_ALPHA,this.srcAlphaBlend=i.ONE,this.dstBlend=i.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("ShapeRenderer.begin() has already been called");this.shader=t,this.vertexIndex=0,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend)}setBlendMode(t,e,i){if(this.srcColorBlend=t,this.srcAlphaBlend=e,this.dstBlend=i,this.isDrawing){this.flush(),this.context.gl.blendFuncSeparate(t,i,e,i)}}setColor(t){this.color.setFromColor(t)}setColorWith(t,e,i,s){this.color.set(t,e,i,s)}point(t,e,i){this.check(as.Point,1),i||(i=this.color),this.vertex(t,e,i)}line(t,e,i,s,n){this.check(as.Line,2);this.mesh.getVertices(),this.vertexIndex;n||(n=this.color),this.vertex(t,e,n),this.vertex(i,s,n)}triangle(t,e,i,s,n,r,a,o,h,l){this.check(t?as.Filled:as.Line,3);this.mesh.getVertices(),this.vertexIndex;o||(o=this.color),h||(h=this.color),l||(l=this.color),t?(this.vertex(e,i,o),this.vertex(s,n,h),this.vertex(r,a,l)):(this.vertex(e,i,o),this.vertex(s,n,h),this.vertex(s,n,o),this.vertex(r,a,h),this.vertex(r,a,o),this.vertex(e,i,h))}quad(t,e,i,s,n,r,a,o,h,l,c,u,d){this.check(t?as.Filled:as.Line,3);this.mesh.getVertices(),this.vertexIndex;l||(l=this.color),c||(c=this.color),u||(u=this.color),d||(d=this.color),t?(this.vertex(e,i,l),this.vertex(s,n,c),this.vertex(r,a,u),this.vertex(r,a,u),this.vertex(o,h,d),this.vertex(e,i,l)):(this.vertex(e,i,l),this.vertex(s,n,c),this.vertex(s,n,c),this.vertex(r,a,u),this.vertex(r,a,u),this.vertex(o,h,d),this.vertex(o,h,d),this.vertex(e,i,l))}rect(t,e,i,s,n,r){this.quad(t,e,i,e+s,i,e+s,i+n,e,i+n,r,r,r,r)}rectLine(t,e,i,s,n,r,a){this.check(t?as.Filled:as.Line,8),a||(a=this.color);let o=this.tmp.set(n-i,e-s);o.normalize(),r*=.5;let h=o.x*r,l=o.y*r;t?(this.vertex(e+h,i+l,a),this.vertex(e-h,i-l,a),this.vertex(s+h,n+l,a),this.vertex(s-h,n-l,a),this.vertex(s+h,n+l,a),this.vertex(e-h,i-l,a)):(this.vertex(e+h,i+l,a),this.vertex(e-h,i-l,a),this.vertex(s+h,n+l,a),this.vertex(s-h,n-l,a),this.vertex(s+h,n+l,a),this.vertex(e+h,i+l,a),this.vertex(s-h,n-l,a),this.vertex(e-h,i-l,a))}x(t,e,i){this.line(t-i,e-i,t+i,e+i),this.line(t-i,e+i,t+i,e-i)}polygon(t,e,i,s){if(i<3)throw new Error("Polygon must contain at least 3 vertices");this.check(as.Line,2*i),s||(s=this.color);this.mesh.getVertices(),this.vertexIndex;i<<=1;let n=t[e<<=1],r=t[e+1],a=e+i;for(let o=e,h=e+i-2;o=a?(h=n,l=r):(h=t[o+2],l=t[o+3]),this.vertex(e,i,s),this.vertex(h,l,s)}}circle(t,e,i,s,n,r=0){if(0==r&&(r=Math.max(1,6*c.cbrt(s)|0)),r<=0)throw new Error("segments must be > 0.");n||(n=this.color);let a=2*c.PI/r,o=Math.cos(a),h=Math.sin(a),l=s,u=0;if(t){this.check(as.Filled,3*r+3),r--;for(let t=0;t0;)this.vertex(b,M,l),b+=A,M+=E,A+=S,E+=T,S+=I,T+=C,this.vertex(b,M,l);this.vertex(b,M,l),this.vertex(a,o,l)}vertex(t,e,i){let s=this.vertexIndex,n=this.mesh.getVertices();n[s++]=t,n[s++]=e,n[s++]=i.r,n[s++]=i.g,n[s++]=i.b,n[s++]=i.a,this.vertexIndex=s}end(){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");this.flush();let t=this.context.gl;t.disable(t.BLEND),this.isDrawing=!1}flush(){if(0!=this.vertexIndex){if(!this.shader)throw new Error("No shader set.");this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0}}check(t,e){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");if(this.shapeType==t){if(!(this.mesh.maxVertices()-this.mesh.numVertices()(t[t.Point=0]="Point",t[t.Line=1]="Line",t[t.Filled=4]="Filled",t))(as||{}),os=class{constructor(t){this.boneLineColor=new h(1,0,0,1),this.boneOriginColor=new h(0,1,0,1),this.attachmentLineColor=new h(0,0,1,.5),this.triangleLineColor=new h(1,.64,0,.5),this.pathColor=(new h).setFromString("FF7F00"),this.clipColor=new h(.8,0,0,2),this.aabbColor=new h(0,1,0,.5),this.drawBones=!0,this.drawRegionAttachments=!0,this.drawBoundingBoxes=!0,this.drawMeshHull=!0,this.drawMeshTriangles=!0,this.drawPaths=!0,this.drawSkeletonXY=!1,this.drawClipping=!0,this.premultipliedAlpha=!1,this.scale=1,this.boneWidth=2,this.bounds=new ci,this.temp=new Array,this.vertices=m.newFloatArray(2048),this.context=t instanceof yi?t:new yi(t)}draw(t,e,i){let s=e.x,n=e.y,r=this.context.gl,a=this.premultipliedAlpha?r.ONE:r.SRC_ALPHA;t.setBlendMode(a,r.ONE,r.ONE_MINUS_SRC_ALPHA);let o=e.bones;if(this.drawBones){t.setColor(this.boneLineColor);for(let e=0,s=o.length;e-1)continue;if(!s.parent)continue;let n=s.data.length*s.a+s.worldX,r=s.data.length*s.c+s.worldY;t.rectLine(!0,s.worldX,s.worldY,n,r,this.boneWidth*this.scale)}this.drawSkeletonXY&&t.x(s,n,4*this.scale)}if(this.drawRegionAttachments){t.setColor(this.attachmentLineColor);let i=e.slots;for(let e=0,s=i.length;e0){t.setColor(this.attachmentLineColor),h=2*(h>>1);let e=a[h-2],i=a[h-1];for(let s=0,n=h;s-1||t.circle(!0,s.worldX,s.worldY,3*this.scale,this.boneOriginColor,8)}}if(this.drawClipping){let i=e.slots;t.setColor(this.clipColor);for(let e=0,s=i.length;e=0&&i==y.data.index&&(x=!0),!x){h.clipEndWithSlot(y);continue}s>=0&&s==y.data.index&&(x=!1);let w,b=y.getAttachment();if(b instanceof ne){let t=b;d.vertices=this.vertices,d.numVertices=4,d.numFloats=v<<2,t.computeWorldVertices(y,d.vertices,0,v),a=ls.QUAD_TRIANGLES,r=t.uvs,w=t.region.renderObject.page.texture,o=t.color}else{if(!(b instanceof te)){if(b instanceof Wt){let t=b;h.clipStart(y,t);continue}h.clipEndWithSlot(y);continue}{let t=b;d.vertices=this.vertices,d.numVertices=t.worldVerticesLength>>1,d.numFloats=d.numVertices*v,d.numFloats>d.vertices.length&&(d.vertices=this.vertices=m.newFloatArray(d.numFloats)),t.computeWorldVertices(y,0,t.worldVerticesLength,d.vertices,0,v),a=t.triangles,w=t.region.renderObject.page.texture,r=t.uvs,o=t.color}}if(w){let e=y.color,i=this.tempColor;i.r=p.r*e.r*o.r,i.g=p.g*e.g*o.g,i.b=p.b*e.b*o.b,i.a=p.a*e.a*o.a,l&&(i.r*=i.a,i.g*=i.a,i.b*=i.a);let s=this.tempColor2;y.darkColor?(l?(s.r=y.darkColor.r*i.a,s.g=y.darkColor.g*i.a,s.b=y.darkColor.b*i.a):s.setFromColor(y.darkColor),s.a=l?1:0):s.set(0,0,0,1);let f=y.data.blendMode;if(f!=u&&(u=f,t.setBlendMode(wi.getSourceColorGLBlendMode(u,l),wi.getSourceAlphaGLBlendMode(u),wi.getDestGLBlendMode(u))),h.isClipping()){h.clipTriangles(d.vertices,d.numFloats,a,a.length,r,i,s,c);let e=new Float32Array(h.clippedVertices),o=h.clippedTriangles;n&&n(d.vertices,d.numFloats,g),t.draw(w,e,o)}else{let e=d.vertices;if(c)for(let t=2,n=0,a=d.numFloats;t(t[t.Stretch=0]="Stretch",t[t.Expand=1]="Expand",t[t.Fit=2]="Fit",t))(vs||{}),ys=0,ws=class{constructor(t){if(this.logo=null,this.spinner=null,this.angle=0,this.fadeOut=0,this.fadeIn=0,this.timeKeeper=new y,this.backgroundColor=new h(.135,.135,.135,1),this.tempColor=new h,this.renderer=t,this.timeKeeper.maxDelta=9,!ds){let t=navigator.userAgent.indexOf("Safari")>-1,e=()=>ys++;(ds=new Image).src=Ms,t||(ds.crossOrigin="anonymous"),ds.onload=e,(us=new Image).src=bs,t||(us.crossOrigin="anonymous"),us.onload=e}}dispose(){var t,e;null==(t=this.logo)||t.dispose(),null==(e=this.spinner)||e.dispose()}draw(t=!1){if(ys<2||t&&this.fadeOut>1)return;this.timeKeeper.update();let e=Math.abs(Math.sin(this.timeKeeper.totalTime+.25));this.angle-=200*this.timeKeeper.delta*(1+1.5*Math.pow(e,5));let i=this.tempColor,s=this.renderer,n=s.canvas,r=s.context.gl;if(s.resize(1),s.camera.position.set(n.width/2,n.height/2,0),s.batcher.setBlendMode(r.ONE,r.ONE,r.ONE_MINUS_SRC_ALPHA),t){if(this.fadeOut+=this.timeKeeper.delta*(this.timeKeeper.totalTime<1?2:1),this.fadeOut>1)return;i.setFromColor(this.backgroundColor),e=1-this.fadeOut/1,e=1-(e-1)*(e-1),i.a*=e,i.a>0&&(s.camera.zoom=1,s.begin(),s.quad(!0,0,0,n.width,0,n.width,n.height,0,n.height,i,i,i,i),s.end())}else this.fadeIn+=this.timeKeeper.delta,this.backgroundColor.a>0&&(r.clearColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),r.clear(r.COLOR_BUFFER_BIT)),e=1;e*=Math.min(this.fadeIn/1,1),i.set(e,e,e,e),this.logo||(this.logo=new Mi(s.context,ds),this.spinner=new Mi(s.context,us)),s.camera.zoom=Math.max(1,163/n.height),s.begin(),s.drawTexture(this.logo,(n.width-165)/2,(n.height-108)/2,165,108,i),this.spinner&&s.drawTextureRotated(this.spinner,(n.width-163)/2,(n.height-163)/2,163,163,81.5,81.5,this.angle,i),s.end()}},bs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAALKElEQVR42u2de2iW5R/GPzuqcwfnnKfNmafl5tTNHWzqNi3DEMQykcAoJSsySkspjSIk0iD/07Kf4R+FnVBDUTshZGpWUEJaaiWFgZlUFmXmIe3HNXthyebeZ77P9H13ffBG8Y8H7ut7vff93N/7fu4vGGPiFZiez/Qtw9lytJajfzfw9z/j+efPOv7cV8W+lUNY2a8T/ayTCRsWFLJA5rtUO1LLkV5p9LJeJizQiHeqnlOtmVFtdTGrrZkJCxYXsTgaI6r9MY4/UpNItW4mFDaXsTlaM6qVZlBq3UwofFrJp0HMWJ9DvXUzobCznJ1BzFjWlTLrZkJh/TDWBzFjTgo51s2EgnKI0Rrx+FiOWzNzVaym91Syx5qZsGBWb2ZFa0ZN6dbMhAWTcpkUrRmXD2K5NTNhgVbH0Zpxbl/mWjMTFvRIo0e0ZpzcncnWzISKtvmiMWNRJ4qslwmVXRXsas2Ix8ZwzFqZsGFREYtaM+Oaa1ljrUzYkJ9G/ok6TlzKjJWZVFor0y7c1Zu7WjLiqiGsskamXdHopyT4vALmzS9k/t19uHtKHlOSIMn6xAtARjIZ1sFcUSZ0Y4La+G6M18hS2IlCn4a+WoC0JNL0d/dUupdnUj40g6EJ2VEdMnhrOG/p5f/jUXz8SgmvaGU6KpNRNsLVQV0OdXf24s63h/P2gWoOrBjMCr2GJFQnnxnIM3q5P1PPmaYv+4ev4/C6UtbpV2gzXCkgL5W8Bwt48OIc6ul6Tp+s4+SyASxLiI4+PYCn1bHzDZxvaQW6vZzto7MYnQIpNkf7kp5EuozYUroqEjcNKHHd0Tl9mBPN1pk+hFeieGBnBtog7UXjsj9pWg+m6duecw2cay1OC/uxMC47KmP9OIYfoz1YoC20J/rzRG4quTZK2EAyJGs20qwUbYw0aNRmUxtvfUW/uEtNzc1NB1/X8LVyd15hh82F43AvD+VlXcsSJEZa1CQ3ejleAO7oxR3RDP0XN91X4+NXYb8nkv7UNTwV7e0YTdu7I3g33t7tuaEbNwSZpps2fSyvs4M2Tjhot+jb0Xzbltj8r5j/xVt/6Z1Ob93U1ZYO691EhhzchcHeXosVjcNZysyezLw4xRZt05R+fTeuj8vOj+zKyG0j2aZcVVs6v+QalnjrMFZASQYl2nBoSyz06e3j/Xk8rgWYmMvEICu2pm1HOTuc7okV8FgRj0XukwzanhvCc/F+72TjoQjdObN1OFuDLmh0xP+WHtxiI10ukJlCprb4guiv1fP+avZrS1C7NAkliHZjDtZwMMgqbukAltpMlwuMy2FcEBPqvfLLar5Uqi0hBdEwryy+Mv5n6zkbjTBa+dlMlwvUZFETZKGiFM7tvbhdJ3gSVRO0wzIjnxmvl/J6a6JsGMYGrahtpssFeqbR841S3mhN80OjOaSDEdqd6SjaMKgzgzRK7q1ib3PT9sYyNo7JZoyNFNvRcVMZmy7WOvIuryv/Zvdmdt90+nY0bRp3AvROohFwdwW7dTG7RFlbwlqdrbOBYg005NAQmZU0HWt1rXMBH1Xw0dQ8pmqzoaPmdhun7bHZjNVe9qP9eFQfO1VkUmHjhAVUZ1GtnKFSbjrkrPfy4i4UW5t/6ZxM54J0CqxFe81KpGsQyE4h23oYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjLna+bdOy+IiFquIpGq16Pb79cNYv3IIK/X/ugx+Ui6TVKvYVU9Nc8gX8od8Ir/IN/KPfCQ/yVfyl/6/pfJvLChkQdD6wyqntquCXYuKWJSfRr6D0dEAxV3xlw/khyD+kd/ku/88cHo+09tS3LBpO1HHCVUqcIA6CqB4K+6X6x35L/JM2loXurlWmUmlA5XogOIcK8/If5HncrSWo7F6cKIWPjT/RXGOlWfkv8hzaWsN4uaaysE6WIkOKM6x8oz8F3kusXqo2vxC5jtYiQ4ozrH0TeS5qIZcrB7qkrwdA8U5Vp6R/yLPZV8V+2L14Cl5THGwEh1QnGPlGfkv8lyUlIzFQ1cNYVVHrcjZ0VCcFe9Y+Eb+izy3ceclUl43aFN52DXXssYpnY6a4qFS8ZcP2uIf+e7inRh6pdFrdTGrm8uiHx/L8T2V7NGWzvJBLJ/bl7mTuzO5qBNFDoiJID/IF/KHfCK/yDfyT3O7d/KbfNfS80hNIrU0g9L6HOq1x5iTQo6FNpeLfCQ/yVfyl3xmXYwxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHNk9z4JwJ0SqKTdQkbyEwhU393T6V7zzR6pieR3tE1ITeVXImhe6BXDGZFdRbVeank2TBhcaEMr0rwbixj49IBLL2/L/ffmMuNHfqO9tFZjJYBd1ewO3Lx+IcVfKhqna5nHZYR6XFPH+5R3eeI5t9fx/fvjeC9Jdew5OKZKqFR/RDVKL6vL/f9PJafmyvHsL+a/ff24V6NmjZQbGchVbY6UM2BluqHv1rCqzVZ1KQlkZboepCdQvacPsz5bjTfXao+yMEaDt7Wk9tSIMVGig3TejCtJSM2bSpkPjWPqd1S6Zao+lORSYWmgkOjORRNwZqd5ezMSiHLRooNr5XwWjS6/1XHX9vL2T67N7M1iyXa9JCrYjVrS1gbpJyw6hBfsmiNCYT0P9/A+Wj1/6qGr5YNYFlJBiWJogEzezLz/ZG8/9s4fgtSyuvNYbyp1IONFBtu7sHNv4/j9yAxUHWrdaWsG9+N8XHd+YxkMpSy+aySz841cC5oXbmHCnnI74yxAgZ3YbDeB4PEQCOpBpFNZWwa2ZWRcdnxLsl00crtRB0n2lLg8JNRfDKoM4NsolgBSmw/UMADba1+qpmqfyf6x1u/0a/og3I+aEunP6/i86osqmygcGarF4p54dex/Bo0LqfqOfVwIQ/HW5/RSkwV1oN2WLlHTc82TljAwM4M1O5LWwYKZTjibYXNS0N5KcjKTe10PadfLObFuJwK4ozp+UzXDBTUjL+M5ZcBnRkQV53dMIwNQTu6bSTbVEzbi5awuVByd2E/FgaN0Tc1fKOzBHHV2aAdVSdv6s5NNkp7cSH/++xAng2yyHx+CM/H21YhfdPp+0U1X0TbSZnXx8faG9Aop0MS0cToh1p+iLcpOkLj9t/JOk5eqoPHxnDsyf486an5yqCDK7XZ1O4oZ4dWyy3FSXHUAYq47uyYbMZoGmhpG3DlEFb6uNiVBhpyaHhnBO8oJmfqOROJjzIiP43hJ8UxITqqX56S2Hur2KsOnq3nrE6PPNKPRwrSKbAZrjTQNZmuE7oxYXMZmxWbw9dxWFu4W4ezVedOE6qzI7oyYkY+M7TPeWsPbk2UX1qioSN+E3OZqOR2cReKE+qQRFN0Pi7y73g/UawU1KzezJpXwLz5hczX1ueUPKYkNb6GJQZ+j7/aAfRZREsv+quGsMoamXZBW2Gt5eU0alorEzYsKmJRa/m4NdeyxlqZsCGa84DKnVorEzboC7podis69DfIJmwufHMc7famvvmxZiYsKOtKWbRm1OcW1syEBboSJFozLh/EcmtmwgIluaM14/phrLdmJixYXMTiaM24p5I91syEBTphFOR7Y2tmwgJNvUFOr+tov3UzoaAv44KYUatv62ZCoemdhtG0+hzqrZsJBR08DWLG0gxKrZu50qvpxos3U5NItW4mFPp1ot+lPlpq2lYXs9qamVBZUMiC1ox4pJYjvlfStAu6GmTLcLboMtPIV4/6im5fFfuUi9QIap2MiWP+D96R1vPmsD/fAAAAAElFTkSuQmCC",Ms="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKUAAABsCAYAAAALzHKmAAAQ7klEQVR42u3da4xdVRUA4D0zd2Y6nZY59DVtZ1puS9+lzC0YAi2UQ8AAQczFpPgA9VIeIQbirRqJ0cBUBVGjDr/QCKSNRSMmpuODxAdxqhgwxkhFjf6Sxh/+UUNVNGJCzR7uTvas7LXX2q9zzp3em6y0gTN3Zu75utZe5+yztxC9V+/Ve5X9En1Vjd7J6SFbLNF7naPw+l2jh7YHMBWssqMHtlsRdim4qsLtIawaPiHEQOLoNrA9iIkQDnRrVA1qD2LZ8ISoxYqKo13sQAtBWBayQWZUAXGRQM9JjCngDVY0UqJNDbQrMcaGmArdUKpIjbYiQLsCZCyIMQBy8QwnilR4Q5AuCpxFYvRFmBLbEiwKwpsSaWycVQGZBKMrwBjA9BhxDe57u2L2hOoKNCbOrgAZitEVYUxoKSMErQvSxYIzCkguRg5EF4AUhqUlhy/YUKSxcRaKsioYOQhD4I0yYxkR3PcJBcuFysmgsXAWBTMJyBCMIQh9kGGxXIXvexCQXbHGAMrBWTbM2CCpMSMLIxehC77lSJwXGth7M0FzoVJIXXDWQnGmhOkL0ic7YhhtWdGGkAuPAjUWGoF4faCmwBkbZmyUqUCyMqMLRA4+E6IsdTjidUHKBYrh9CnpRcH0ypKxsyOGEYNIIeTCOz91OIJ1QYoB5eAMyZo+MFNnyVTZ0YiRC9EGEMOyAgshxErHsL2XK1gOUgwohtM1a5YNM7Rsu4K0ZkcbRm4mpPBRwFZ5hg9eCqkrUB+csWGGogzNkqEgrdnRhpGLkINudaLgwvVB6oqzCjCTZElb2Y4B0gUjBtEG0ARnDRLjjoG9DwcshtQGlIPTljVjwUySLWNkyRCQVHa0ZUUTRAwgF91a33BEy0VKAcVwwqwZC2bqbOlUurllOxQkJzNyINoAYqjWhYYjWg5SCiiG05Q1U8FMjTIoS8YE6YORi1BHtJ4KIcQEEtTXUWAxpK44YVlPBdO1jCdFWTZIE8bVGEYMIRPcZGBw4HKQcoBiOE1ZMzbMgVQwU6JMAdKEEcuIJogUvg1YCCE2gsCO42DlIIVAKZwpYJaSLVNnSU6XjYHUmxhTmXaFaMO3EYkLqMC+FsLlIoVAKZzMrEnBhJeLfLNlKMrYWRIDCbOkFSSVHbHM6AKRC6/ODUewNqQ+OLlZkxpjUmV8MBbMUJSxyzY3Q1IgTRgxiBRCHdem0KDAUkBh9sRwwjEnAXMMgTnKhFlUtiwkS5rGka4g9SaGgxFmRC7AzTCEEBcyA36dDSsXqAtOLkysjGMwY5XxVChjZ0kuSCo7YlkRQsQQYtDEFsegsLoCxUp7Kpgps2UslFGzJGccSYHUmxhOZqwzEZqAbfUMCisHKIZzgsCpl3MTzMwTpi1bYp2477gyFKUxS7qWbdjY2EBS2dGE0QQRA7gNCyHEdhjE8RhUDlBT9tzgmjWZMFNlSy+Urk1OzCyJlW0XkK4YOQh1cDtcgwBrQmoDWkdgboBZE8mYsJSHlnFbJ+5bwmOPJ7lZkirbC8aRsMvmgtTHjBhGE0QbwJ2egUE1ITVlUC5OmDVdYNrKuN70xM6WoShjlW4464dbtiFIWK6x7GjESEHUUe0iYncnbMdQSE0Z1ITTNOb0hRmjjLtmS9dmJ2rp1jtuKktyyrb6YLEMCUHq2dGG0QQRQ7f72kzc+cJecerne8Wvv7JNPHPvenEkz8Sh3UtFc92QyGt9Yko/HgOLAIUZlItTz5ouMF3KuE+2jFLCQ1D6lm6fLMkBacuOJowYRBUXyfjuHjF3NhdnsfjvAfH6E9vFt9XxKgikEKgJZyyYalzOLeMu2bLbULI6bh+QGwmQ+rgRlumdGEQAao+K56bEL2woVUwOiev0r8OAUjiJrMmFCbvykGxZRAmPitK1dHM7bohyMsuyi/I8f0+e57fJYIKEZXpXo9E4mOf5XTKyLLvCBLETF8uY2SKepkC+dpX4T02Ivepr4HvZcOZ5fmee54fyPL+DmTUhzAs6n4n8bN5dr9f3YdkSg8nsxG0lPBVKVpNjG0/aGhzfLDmRZdnumZmZp8+c+cdZPV555fSr7Xb7s0jJ3i5Pcue4MxKkPPkvvXTqz/B92u32l0wYOzG1fkhcd/py8Rcbyq/vFM/KY1WA95h/3zzP71bfU6JsNpsfgj+P/FlbrdaDGExYyuXvLz8H+DudODH700ajcSM3W6Yu4alQ1spCOTd38jcKocTZbh9+9NixY99XJ8AEUkcpo9W64yH197m5k7+bnZ19QT+J09NHntQhwji/Jg58qi6++ofLxJ8gSFneVw2Ka4QQDfh1Ok4dZavVmtZ/nrm5k7/Vf55O1tRhboUw5+ZOvqyOl5+R/FyOHj32PYVU/tloNG5IXcKrhJIzngwp3fNjomazea/64BuNxts646f50lWv169utw9/DmtqdJQyZFaSJVuV6nq9fqMEof5/vV6/CYBqgJDlee+yAbF/+4i4ZWqZeNfaIfHWzn+Hx0KcEuU9+s8jv3ej0bhVlXOZydX/k0iRMeb8P0D5e6tj8zy/Xb9UJIc56h/yqVOnXul8lmuZ2bJslKmbHG7XrbpCmCXFRLvdfqQD6jTS3Jiy5I4OykM6ADV+1Eu1DmV6evopBORexzDi1L+X/HnGxsb2w3Hm9PSRJ9QxWPOTZdmlKht2hi+w6dkox5bqffI8fye3hDteGqKaHVsHXihKl0tB+h0cY+lute54AGRKDCW89LNTRynHb7ChUWVVjetOnJh9EYBUyPZeNCoOtsbFQwdXi4/esELcd+tq8cCHJ8UXp+viy9efLz7AgamjlKXc1AA1m83DoIRDlFubzeb96hhZLVTlgJ24gttutx+ONa50bHZKRenaeTs1OfpAfnr6yOOdE7EZdNwmlKocntXLNkA5JTGq47Ds+Lf94lWsyfnXleLfnIwJUN4DOnNYwuUxh2A3Ln9XULrfK8t3J27Tu3BVwiOjXJqoAy8UZej1yclGo3GTLN+gu3w+z/P3YaWbQqk3Ne12e4ZC+c8rxWsYytcPiP9RpZxCqWDKnxOiBNlyAUpOnGsoh4tA2Rm8X9xqtT6md5wyZmYe+0YRKL+1S/wYQ3n8zctBl5SBUv5djivfjMOPduIzcizeiYfr9foVvUwZG+XCuzibZKnSceZ5/v4QlKp8y7ElhnJlTeTP7BI/kllRYfzrfvHqFy4UX1vaL/aVlSmROzwbwdS29T2UcEwZF+V8ozM2lu1VY812u/15akypGh3TmFJesJbHHD167IdUxz3YJy5bNySuX1mbvy55CbMLtzU6tjGlsdFptVqfUMc0Go23F4wy1l2dSnbfvpMwVPe9WWVLDsrOJaF9MFu2Wq1PqmNkGce67xiXhTjdNwdlvV6/BgxfbPfBfVCetxi6b9/rlCup65QzM48dl2OjLMv26CibzeZ96sTIzEFdpwQXz9U1yrtVlpR/Zll2Fec65Y6l4pbbx8XHH9kknvzJlPjlHy8Tp29eKT5ou0aJoIT3w3dBlLDzVpfAJEZ1XOdaJZxnOSlvPMjPzxFljIvng914RwebsjYO7uhMyHu46sOfnf3Oz2TXDW6vvYxdFoIXz3Wc8J5zs9n8iOn2IrxTc2BM3Glqdp7dI553uaOjxrhwcob+MyuUpjs6WZZdon8OcigjPx8V+u+GTWFTSWEx3WYcdJ225jNDSE4q0GHCzlueHOyujn6bUWYgeb9ZZUaQPe+GzQ+Gc8+oOGhC+c1d4gfI16n3XDAhQ7+9qE9l01E2Go132GYKyXE1NiFDTcpoNpv3LOYJGWXNErJNW9sEp63p2RKiVPMn1bS1DgxsyhoGdGpmizj+xtXiDYnx7/vFmce3iWdW1cTVGEY4hQ2ZW0nNq8Qm/M6XbXm3S100lwGedFybuvNOibLI+ZS2ceU4eAxiEuvCkfmU8ycToDxETe6FgCBQHeqyAbFvfEhcO7BwDuXFCEbTZF840XeHK0jYcbs2OIGle0mVJ/mmnClEPQqxyTY5I8/zFhif7fSZee4bnrPOU4AssnRXHaVTCTd14dRDY3UbTIiSeFhsN/aMjgnqthFx880rxX3yATL5p3y4LPXzOaBkUyBjZMlYpbtQlIOBD475ZEusjMNSvkXe6VEoJVDkeZ2dzIfIFsRzU+JF2OyM9M9fTC/6SUYOyFQPjQ2nWiUjxnPfw5EeHqMWIqAeIFsAU847lJM2JM6xsewt1OIDLs99P7ZFHNdB/upS8XtPiD7PfLuCXJNolYyyFiNI/Zit65ItrOVafFbHcFohY7hPTN21Tjz4uc3iqfsnxKdX1MTl1OoYRFaMsToGB6Trw2JFP/OdZC2hJZ7ZkrMoAbbSGmelDJ91hFKuJeS7jlBMkJnrAqqJlgMUZS/dArPlGHNdSg5M3xXXtvquuEatvIYtDRhpxbUJuIgqsU5lGWtUploK0KuEU9mSW8YpmFQ556xNuYW7NiW13B+FkMiKHIy+C6eGgBxJvMR0oSv5hi6+z4HJyZoU0M2RVvDlrOQbcxVfX5AhZbuqy0v7ZstYMLHlAVlLTF9ALLbvu9Y5Zylpn/XOsd0ibIvxr2KCLHpp6SCUIdnSZSF+WzfOhem6GD+1KwR3Z4jNjrtDpNoZwmWd8yrupZN6Hx3fbMmFSe0Swdq2ZIPjxk1112Duo8OBGLrBkw/IoncdK2XHsdC9dHz204m50xh3tzFq1zFqtzHXrfCw7OgDsqyNnZLszVijsmXgrmNcmGtS78lIoMX2aJz03fKO2sDJddPQSCDPiQ1DfWBycY6XtXstc2PQKuxgG2McmXTPb9/9vmuJYXKyJrWjbeg+3xPM4O73nWqvbyw7xgZZSJbEUBa157cNJjdr2vb+5iA1YV3HxYscj30PDCEHIgcjtfm8K8hSsmRotkwFk5s1TTghUAopB6xrjHMBBkI0YYTZ0dZlxwLpkiWDULpmy5gwqayZgZNkA7oKQQCxctByYg0XIIEQQuRitGVHblMTA2ShKGPDpC6wu+DEgJqg2rDGDBtAF4Q6RAojp1xXGmSMbImVcR+YWNY04eQCtUG1ofUJ2/uvcETIgUhhdAE5GAlkKShjwHTNmhhODKgJqQ2sC14uOgyfD0IbRF+MlQaZAiZWyn2yJsTJATqGnHQO2Jhh+xlsACFCG0QbRtdyzQFZCZSxYPpmTS7Q5cjJHYNBYIkZpu99HoUQ/o4QIYSIZUZfjJ4ZMjZI32wZBDMU5yhy8pZTULl4XYP5fagMyEVoy4oupTpGduwnkloSlKEwY+AcQU4MhRTD6ovXBRwFzwWgCSEF0QVjJUGmgEllTS5OLlCIlIN1mS9mx/cZ5eLDALpCTI2RAhkTZQqYoTgpoCPECbaBHQ2ETL3PUl98ECAXYijG0OyYAmQoTG7W5ODkAF1CnVgm2JQx4okPA+gCMTbGskBGgRmaOblAh5GTORIrfKFx4VH4EIAxIXIxlg2SBbMvECY3e7oApbDaIgQu5/2HmeEKEINYiwSRi7EQkLFgumZOCuggctKGI4ULZN/vMeSLj0AYMytWEqMLzFg4fYDaoKaC6wvOFR4FkIPQFaILxrJAOsHsc/zlfYDWXE8qF22s8Pz5KHxcgEVALBtjJXBSSEOwFhk1Zgy4hitCT4hVw+gFs8/zwxqIBbUgyK7fcyA0PD9XX4iVxhiC0xdof6STWCsoBmKF7+cVCWFXQYyBMxRpf+STX1b0x45AhN0OMSrOGEirhrY/dfQAdjvS7oy+WCF6r1RIFxXWvlTRg1YVqFWBmxZbD99ig9pt0YPQw9rD1nstVri9V+/Ve3XrS/wfim4P5fIFxLoAAAAASUVORK5CYII=",As=class{constructor(t,e){this.time=new y,e.pathPrefix||(e.pathPrefix=""),e.app||(e.app={loadAssets:()=>{},initialize:()=>{},update:()=>{},render:()=>{},error:()=>{}}),e.webglConfig&&(e.webglConfig={alpha:!0}),this.htmlCanvas=t,this.context=new yi(t,e.webglConfig),this.renderer=new xs(t,this.context),this.gl=this.context.gl,this.assetManager=new Ai(this.context,e.pathPrefix),this.input=new Wi(t),e.app.loadAssets&&e.app.loadAssets(this);let i=()=>{requestAnimationFrame(i),this.time.update(),e.app.update&&e.app.update(this,this.time.delta),e.app.render&&e.app.render(this)},s=()=>{this.assetManager.isLoadingComplete()?this.assetManager.hasErrors()?e.app.error&&e.app.error(this,this.assetManager.getErrors()):(e.app.initialize&&e.app.initialize(this),i()):requestAnimationFrame(s)};requestAnimationFrame(s)}clear(t,e,i,s){this.gl.clearColor(t,e,i,s),this.gl.clear(this.gl.COLOR_BUFFER_BIT)}};return fs=n,((n,r,a,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let h of i(r))s.call(n,h)||h===a||t(n,h,{get:()=>r[h],enumerable:!(o=e(r,h))||o.enumerable});return n})(t({},"__esModule",{value:!0}),fs)})();t.exports=e}).call(window)},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={ADD:i(212),COMPLETE:i(213),FILE_COMPLETE:i(214),FILE_KEY_COMPLETE:i(215),FILE_LOAD_ERROR:i(216),FILE_LOAD:i(217),FILE_PROGRESS:i(218),POST_PROCESS:i(219),PROGRESS:i(220),START:i(221)}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(19),n=i(51);t.exports=function(t,e){var i=void 0===t?n():s({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},function(t,e){t.exports=function(t,e,i,s,n,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===s&&(s=""),void 0===n&&(n=0),void 0===r&&(r=!1),{responseType:t,async:e,user:i,password:s,timeout:n,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:r}}},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(4),n=i(26),r=i(44),a=i(33),o=i(34),h=i(3),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*s.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.z=i,this.w=s,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*s,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new n),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new n),void 0===e&&(e=new n);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,s){i||(i=new h),s||(s=this.scene.sys.cameras.main);var n=s.scrollX,a=s.scrollY,o=t+n*this.scrollFactorX-n,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):r(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(59),r=i(227),a=i(234),o=i(60),h=i(23),l=new s({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new r(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new r(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={ADDED_TO_SCENE:i(235),DESTROY:i(236),REMOVED_FROM_SCENE:i(237),VIDEO_COMPLETE:i(238),VIDEO_CREATED:i(239),VIDEO_ERROR:i(240),VIDEO_LOOP:i(241),VIDEO_PLAY:i(242),VIDEO_SEEKED:i(243),VIDEO_SEEKING:i(244),VIDEO_STOP:i(245),VIDEO_TIMEOUT:i(246),VIDEO_UNLOCKED:i(247)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(26),n=new s,r=new s,a=new s,o={camera:n,sprite:r,calc:a};t.exports=function(t,e,i){var s=n,h=r,l=a;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),s.multiply(h,l),o}},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),n=0;n-1;r--)s[n][r]=t[r][n]}return s}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s,n,r,a=i(302),o=i(304),h=[],l=!1;t.exports=(r=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return s(t,e,i,a.CANVAS)},create:s=function(t,e,i,s,r){var c;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=a.CANVAS),void 0===r&&(r=!1);var u=n(s);return null===u?(u={parent:t,canvas:document.createElement("canvas"),type:s},s===a.CANVAS&&h.push(u),c=u.canvas):(u.parent=t,c=u.canvas),r&&(u.parent=c),c.width=e,c.height=i,l&&s===a.CANVAS&&o.disable(c.getContext("2d")),c},createWebGL:function(t,e,i){return s(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:n=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(68),n=i(12);t.exports=function(t,e,i){if(void 0===i&&(i=new n),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var r=s(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},function(t,e){t.exports=function(t){return 2*(t.width+t.height)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(1),r=i(19),a=new s({initialize:function(t,e,i,s,n,r,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,a,s,n)},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.cutX=i,this.cutY=s,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var n=this.data,r=n.cut;r.x=i,r.y=s,r.w=t,r.h=e,r.r=i+t,r.b=s+e,n.sourceSize.w=t,n.sourceSize.h=e,n.spriteSourceSize.w=t,n.spriteSourceSize.h=e,n.radius=.5*Math.sqrt(t*t+e*e);var a=n.drawImage;return a.x=i,a.y=s,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,s,n,r){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=s,o.w=n,o.h=r,o.r=i+n,o.b=s+r,this.x=i,this.y=s,this.width=n,this.height=r,this.halfWidth=.5*n,this.halfHeight=.5*r,this.centerX=Math.floor(n/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,s,r,a,o){var h=this.cutX,l=this.cutY,c=this.cutWidth,u=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=n(e,0,d)),m=l+(i=n(i,0,f)),g=s=n(s,0,d-e),x=r=n(r,0,f-i),v=this.data;if(v.trim){var y=v.spriteSourceSize,w=e+(s=n(s,0,c-e)),b=i+(r=n(r,0,u-i));if(!(y.rw||y.y>b)){var M=Math.max(y.x,e),A=Math.max(y.y,i),E=Math.min(y.r,w)-M,S=Math.min(y.b,b)-A;g=E,x=S,p=a?h+(c-(M-y.x)-E):h+(M-y.x),m=o?l+(u-(A-y.y)-S):l+(A-y.y),e=M,i=A,s=E,r=S}else p=0,m=0,g=0,x=0}else a&&(p=h+(c-e-s)),o&&(m=l+(u-i-r));var T=this.source.width,I=this.source.height;return t.u0=Math.max(0,p/T),t.v0=Math.max(0,m/I),t.u1=Math.min(1,(p+g)/T),t.v1=Math.min(1,(m+x)/I),t.x=e,t.y=i,t.cx=p,t.cy=m,t.cw=g,t.ch=x,t.width=s,t.height=r,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,n,r){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=s,this.u1=n,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,n=this.data.drawImage;n.width=i,n.height=s;var r=this.source.width,a=this.source.height;return this.u0=t/r,this.v0=e/a,this.u1=(t+i)/r,this.v1=(e+s)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var s=i(71),n=i(0),r=i(8),a=i(185),o=i(186),h={canvas:i(47),webgl:i(47)},l=i(210),c=i(226),u=i(258),d=i(2),f=new n({Extends:o,initialize:function(t,e,i){o.call(this,t,e,i);var n=e.game;this.isWebGL=2===n.config.renderType,this.cache=n.cache.addCustom("spine"),this.spineTextures=n.cache.addCustom("spineTextures"),this.json=n.cache.json,this.textures=n.textures,this.drawDebug=!1,this.gl,this.renderer,this.sceneRenderer,this.skeletonRenderer,this.skeletonDebugRenderer,this.plugin=h,this.temp1,this.temp2,this.isWebGL?(this.runtime=h.webgl,this.renderer=n.renderer,this.gl=n.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=n.renderer,this.getAtlas=this.getAtlasCanvas),this.renderer||(this.renderer={width:n.scale.width,height:n.scale.height,preRender:d,postRender:d,render:d,destroy:d});e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",(function(t,e,s,n,r){var a=this.scene.sys[i],o=new c(this.scene,a,t,e,s,n,r);return this.displayList.add(o),this.updateList.add(o),o}),(function(t,e){void 0===t&&(t={});var n=r(t,"key",null),a=r(t,"animationName",null),o=r(t,"loop",!1),h=this.scene.sys[i],l=new c(this.scene,h,0,0,n,a,o);void 0!==e&&(t.add=e),s(this.scene,l,t);var u=r(t,"skinName",!1);u&&l.setSkinByName(u);var d=r(t,"slotName",!1),f=r(t,"attachmentName",null);return d&&l.setAttachment(d,f),l.refresh()})),e.registerGameObject("spineContainer",(function(t,e,s){var n=this.scene.sys[i],r=new u(this.scene,n,t,e,s);return this.displayList.add(r),r}),(function(t,e){void 0===t&&(t={});var n=r(t,"x",0),a=r(t,"y",0),o=r(t,"children",null),h=this.scene.sys[i],l=new u(this.scene,h,n,a,o);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(a,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this),this.game.events.once("destroy",this.gameDestroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){var t=this.renderer.spineSceneRenderer;t||(t=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0),this.renderer.spineSceneRenderer=t),this.sceneRenderer=t,this.skeletonRenderer=t.skeletonRenderer,this.skeletonDebugRenderer=t.skeletonDebugRenderer,this.temp1=new h.webgl.Vector3(0,0,0),this.temp2=new h.webgl.Vector3(0,0,0)},getAtlasCanvas:function(t){var e=this.cache.get(t);if(e){var i,s=this.spineTextures;if(s.has(t))i=s.get(t);else{var n=this.textures;i=new this.runtime.TextureAtlas(e.data,(function(t){return new h.canvas.CanvasTexture(n.get(e.prefix+t).getSourceImage())}))}return i}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var i,s=this.spineTextures;if(s.has(t))i=s.get(t);else{var n=this.textures,r=this.sceneRenderer.context.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i=new this.runtime.TextureAtlas(e.data,(function(t){return new h.webgl.GLTexture(r,n.get(e.prefix+t).getSourceImage(),!1)}))}return i}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,i,s,n,r,a){var o;if(a=a||{},Array.isArray(t))for(var h=0;h - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(13),n=i(72);t.exports=function(t,e,i){e.x=n(i,"x",0),e.y=n(i,"y",0),e.depth=n(i,"depth",0),e.flipX=n(i,"flipX",!1),e.flipY=n(i,"flipY",!1);var r=n(i,"scale",null);"number"==typeof r?e.setScale(r):null!==r&&(e.scaleX=n(r,"x",1),e.scaleY=n(r,"y",1));var a=n(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=n(a,"x",1),e.scrollFactorY=n(a,"y",1)),e.rotation=n(i,"rotation",0);var o=n(i,"angle",null);null!==o&&(e.angle=o),e.alpha=n(i,"alpha",1);var h=n(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=n(h,"x",.5),c=n(h,"y",.5);e.setOrigin(l,c)}return e.blendMode=n(i,"blendMode",s.NORMAL),e.visible=n(i,"visible",!0),n(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(73),n=i(8);t.exports=function(t,e,i){var r=n(t,e,null);if(null===r)return i;if(Array.isArray(r))return s.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return s.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return s.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(4),n=i(19),r={Angle:i(74),Distance:i(83),Easing:i(91),Fuzzy:i(136),Interpolation:i(141),Pow2:i(149),Snap:i(153),RandomDataGenerator:i(157),Average:i(158),Bernstein:i(36),Between:i(159),CatmullRom:i(38),CeilTo:i(160),Clamp:i(1),DegToRad:i(21),Difference:i(161),Euler:i(162),Factorial:i(37),FloatBetween:i(20),FloorTo:i(163),FromPercent:i(164),GetSpeed:i(165),IsEven:i(166),IsEvenStrict:i(167),Linear:i(39),LinearXY:i(168),MaxAdd:i(169),Median:i(170),MinSub:i(171),Percent:i(172),RadToDeg:i(16),RandomXY:i(173),RandomXYZ:i(174),RandomXYZW:i(175),Rotate:i(176),RotateAround:i(42),RotateAroundDistance:i(177),RotateTo:i(178),RoundAwayFromZero:i(43),RoundTo:i(179),SinCosTableGenerator:i(180),SmootherStep:i(41),SmoothStep:i(40),ToXY:i(181),TransformXY:i(44),Within:i(182),Wrap:i(7),Vector2:i(3),Vector3:i(15),Vector4:i(183),Matrix3:i(45),Matrix4:i(22),Quaternion:i(46),RotateVec3:i(184)};r=n(!1,r,s),t.exports=r},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Between:i(31),BetweenPoints:i(75),BetweenPointsY:i(76),BetweenY:i(77),CounterClockwise:i(14),Normalize:i(32),Random:i(78),RandomDegrees:i(79),Reverse:i(80),RotateTo:i(81),ShortestBetween:i(82),Wrap:i(33),WrapDegrees:i(34)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},function(t,e){t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},function(t,e,i){ -/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(20);t.exports=function(){return s(-Math.PI,Math.PI)}},function(t,e,i){ -/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(20);t.exports=function(){return s(-180,180)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(32);t.exports=function(t){return s(t+Math.PI)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(4);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Between:i(84),BetweenPoints:i(85),BetweenPointsSquared:i(86),Chebyshev:i(87),Power:i(88),Snake:i(89),Squared:i(90)}},function(t,e){t.exports=function(t,e,i,s){var n=t-i,r=e-s;return Math.sqrt(n*n+r*r)}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}},function(t,e){t.exports=function(t,e,i,s){return Math.max(Math.abs(t-i),Math.abs(e-s))}},function(t,e){t.exports=function(t,e,i,s,n){return void 0===n&&(n=2),Math.sqrt(Math.pow(i-t,n)+Math.pow(s-e,n))}},function(t,e){t.exports=function(t,e,i,s){return Math.abs(t-i)+Math.abs(e-s)}},function(t,e){t.exports=function(t,e,i,s){var n=t-i,r=e-s;return n*n+r*r}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Back:i(92),Bounce:i(96),Circular:i(100),Cubic:i(104),Elastic:i(108),Expo:i(112),Linear:i(116),Quadratic:i(118),Quartic:i(122),Quintic:i(126),Sine:i(130),Stepped:i(134)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(93),Out:i(94),InOut:i(95)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(97),Out:i(98),InOut:i(99)}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(101),Out:i(102),InOut:i(103)}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(105),Out:i(106),InOut:i(107)}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(109),Out:i(110),InOut:i(111)}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+1}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(113),Out:i(114),InOut:i(115)}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports=i(117)},function(t,e){t.exports=function(t){return t}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(119),Out:i(120),InOut:i(121)}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(123),Out:i(124),InOut:i(125)}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(127),Out:i(128),InOut:i(129)}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={In:i(131),Out:i(132),InOut:i(133)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports=i(135)},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Ceil:i(137),Equal:i(35),Floor:i(138),GreaterThan:i(139),LessThan:i(140)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Bezier:i(142),CatmullRom:i(143),CubicBezier:i(144),Linear:i(145),QuadraticBezier:i(146),SmoothStep:i(147),SmootherStep:i(148)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(36);t.exports=function(t,e){for(var i=0,n=t.length-1,r=0;r<=n;r++)i+=Math.pow(1-e,n-r)*Math.pow(e,r)*t[r]*s(n,r);return i}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(38);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),s(n-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(s(-n,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(s(n-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(n-r,t[r?r-1:0],t[r],t[i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,n)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(39);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return e<0?s(t[0],t[1],n):e>1?s(t[i],t[i-1],i-n):s(t[r],t[r+1>i?i:r+1],n-r)}},function(t,e){t.exports=function(t,e,i,s){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(40);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(41);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={GetNext:i(150),IsSize:i(151),IsValue:i(152)}},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Ceil:i(154),Floor:i(155),To:i(156)}},function(t,e){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},function(t,e){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},function(t,e){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=new(i(0))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},function(t,e){t.exports=function(t){for(var e=0,i=0;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(1),n=i(0),r=i(22),a=i(2),o=new r,h=new n({initialize:function t(e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=t.DefaultOrder),this._x=e,this._y=i,this._z=s,this._order=n,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,s){return void 0===s&&(s=this._order),this._x=t,this._y=e,this._z=i,this._order=s,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var n=t.val,r=n[0],a=n[4],o=n[8],h=n[1],l=n[5],c=n[9],u=n[2],d=n[6],f=n[10],p=0,m=0,g=0;switch(e){case"XYZ":m=Math.asin(s(o,-1,1)),Math.abs(o)<.99999?(p=Math.atan2(-c,f),g=Math.atan2(-a,r)):p=Math.atan2(d,l);break;case"YXZ":p=Math.asin(-s(c,-1,1)),Math.abs(c)<.99999?(m=Math.atan2(o,f),g=Math.atan2(h,l)):m=Math.atan2(-u,r);break;case"ZXY":p=Math.asin(s(d,-1,1)),Math.abs(d)<.99999?(m=Math.atan2(-u,f),g=Math.atan2(-a,l)):g=Math.atan2(h,r);break;case"ZYX":m=Math.asin(-s(u,-1,1)),Math.abs(u)<.99999?(p=Math.atan2(d,f),g=Math.atan2(h,r)):g=Math.atan2(-a,l);break;case"YZX":g=Math.asin(s(h,-1,1)),Math.abs(h)<.99999?(p=Math.atan2(-c,l),m=Math.atan2(-u,r)):m=Math.atan2(o,f);break;case"XZY":g=Math.asin(-s(a,-1,1)),Math.abs(a)<.99999?(p=Math.atan2(d,l),m=Math.atan2(o,r)):p=Math.atan2(-c,f)}return this._x=p,this._y=m,this._z=g,this._order=e,i&&this.onChangeCallback(this),this}});h.RotationOrders=["XYZ","YXZ","ZXY","ZYX","YZX","XZY"],h.DefaultOrder="XYZ",t.exports=h},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(1);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))+e}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i,s){void 0===i&&(i=e+1);var n=(t-e)/(i-e);return n>1?void 0!==s?(n=(s-t)/(s-i))<0&&(n=0):n=1:n<0&&(n=0),n}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,n=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*n,t.y=Math.sin(i)*n,t.z=s*e,t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},function(t,e){t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},function(t,e){t.exports=function(t,e,i,s,n){var r=s+Math.atan2(t.y-i,t.x-e);return t.x=e+n*Math.cos(r),t.y=i+n*Math.sin(r),t}},function(t,e){t.exports=function(t,e,i,s,n){return t.x=e+n*Math.cos(s),t.y=i+n*Math.sin(s),t}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},function(t,e){t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1),s*=Math.PI/t;for(var n=[],r=[],a=0;a - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(3);t.exports=function(t,e,i,n){void 0===n&&(n=new s);var r=0,a=0;return t>0&&t<=e*i&&(r=t>e-1?t-(a=Math.floor(t/e))*e:t),n.set(r,a)}},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=new(i(0))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n,this.w=s*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return e*e+i*i+s*s+n*n},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12]*n,this.y=r[1]*e+r[5]*i+r[9]*s+r[13]*n,this.z=r[2]*e+r[6]*i+r[10]*s+r[14]*n,this.w=r[3]*e+r[7]*i+r[11]*s+r[15]*n,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z,o=t.w,h=o*e+r*s-a*i,l=o*i+a*e-n*s,c=o*s+n*i-r*e,u=-n*e-r*i-a*s;return this.x=h*o+u*-n+l*-a-c*-r,this.y=l*o+u*-r+c*-n-h*-a,this.z=c*o+u*-a+h*-r-l*-n,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(15),n=i(22),r=i(46),a=new n,o=new r,h=new s;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="resize"},function(t,e,i){ -/** -* @author Richard Davey -* @copyright 2013-2023 Photon Storm Ltd. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/ -var s=i(187),n=i(0),r=i(23),a=new n({Extends:s,initialize:function(t,e,i){s.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},function(t,e,i){ -/** -* @author Richard Davey -* @copyright 2013-2023 Photon Storm Ltd. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/ -var s=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="addedtoscene"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="boot"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="create"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="destroy"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="pause"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="postupdate"},function(t,e){ -/** - * @author samme - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="prerender"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="preupdate"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="ready"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="removedfromscene"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="render"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="resume"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="shutdown"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="sleep"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="start"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="transitioncomplete"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="transitioninit"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="transitionout"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="transitionstart"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="transitionwake"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="update"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="wake"},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var s=i(0),n=i(9),r=i(211),a=i(6),o=i(223),h=i(224),l=i(225),c=new s({Extends:h,initialize:function(t,e,i,s,r,c,u){var d,f,p,m=[],g=t.cacheManager.custom.spine;if(a(e)){var x=e;for(e=n(x,"key"),f=new o(t,{key:e,url:n(x,"jsonURL"),extension:n(x,"jsonExtension","json"),xhrSettings:n(x,"jsonXhrSettings")}),s=n(x,"atlasURL"),r=n(x,"preMultipliedAlpha"),Array.isArray(s)||(s=[s]),d=0;d - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(10),r=i(24),a=i(25),o=i(9),h=i(6),l=i(49),c=new s({Extends:r,initialize:function t(e,i,s,n,a){var l,c="png";if(h(i)){var u=i;i=o(u,"key"),s=o(u,"url"),l=o(u,"normalMap"),n=o(u,"xhrSettings"),c=o(u,"extension",c),a=o(u,"frameConfig")}Array.isArray(s)&&(l=s[1],s=s[0]);var d={type:"image",cache:e.textureManager,extension:c,responseType:"blob",key:i,url:s,xhrSettings:n,config:a};if(r.call(this,e,d),l){var f=new t(e,this.key,l,n,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=n.FILE_PROCESSING,t===n.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=n.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=n.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t?t.state>=n.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var s=0;s - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="addfile"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="complete"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="filecomplete"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="filecomplete-"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="loaderror"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="load"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="fileprogress"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="postprocess"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="progress"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="start"},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(50);t.exports=function(t,e){var i=s(e,t.xhrSettings),n=new XMLHttpRequest;if(n.open("GET",t.src,i.async,i.user,i.password),n.responseType=t.xhrSettings.responseType,n.timeout=i.timeout,i.headers)for(var r in i.headers)n.setRequestHeader(r,i.headers[r]);return i.header&&i.headerValue&&n.setRequestHeader(i.header,i.headerValue),i.requestedWith&&n.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&n.overrideMimeType(i.overrideMimeType),i.withCredentials&&(n.withCredentials=!0),n.onload=t.onLoad.bind(t,n),n.onerror=t.onError.bind(t,n),n.onprogress=t.onProgress.bind(t),n.send(),n}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(10),r=i(24),a=i(25),o=i(9),h=i(8),l=i(6),c=new s({Extends:r,initialize:function(t,e,i,s,a){var c="json";if(l(e)){var u=e;e=o(u,"key"),i=o(u,"url"),s=o(u,"xhrSettings"),c=o(u,"extension",c),a=o(u,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:c,responseType:"text",key:e,url:i,xhrSettings:s,config:a};r.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=n.FILE_POPULATED)},onProcess:function(){if(this.state!==n.FILE_POPULATED){this.state=n.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(10),r=i(48),a=new s({initialize:function(t,e,i,s){var r=[];s.forEach((function(t){t&&r.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=r,this.state=n.FILE_PENDING,this.complete=!1,this.pending=r.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(10),r=i(24),a=i(25),o=i(9),h=i(6),l=new s({Extends:r,initialize:function(t,e,i,s){var n="text",a="txt",l=t.cacheManager.text;if(h(e)){var c=e;e=o(c,"key"),i=o(c,"url"),s=o(c,"xhrSettings"),a=o(c,"extension",a),n=o(c,"type",n),l=o(c,"cache",l)}var u={type:n,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var s=0;s - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var s=i(31),n=i(1),r=i(0),a=i(52),o=i(53),h=i(54),l=i(55),c=i(56),u=i(57),d=i(14),f=i(21),p=i(58),m=i(16),g=i(248),x=i(255),v=new r({Extends:p,Mixins:[a,o,h,l,c,u,x],initialize:function(t,e,i,s,n,r,a){p.call(this,t,"Spine"),this.plugin=e,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null,this.root=null,this.bounds=null,this.drawDebug=!1,this.timeScale=1,this.displayOriginX=0,this.displayOriginY=0,this.preMultipliedAlpha=!1,this.blendMode=-1,this.setPosition(i,s),n&&this.setSkeleton(n,r,a)},willRender:function(t,e){var i=!this.skeleton||!(15!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id);if(!e&&!i&&this.parentContainer){var s=this.plugin,n=s.sceneRenderer;s.gl&&n.batcher.isDrawing&&(n.end(),s.renderer.pipelines.rebind())}return i},setAlpha:function(t,e){if(void 0===t&&(t=1),e){var i=this.findSlot(e);i&&(i.color.a=n(t,0,1))}else this.alpha=t;return this},alpha:{get:function(){return this.skeleton.color.a},set:function(t){var e=n(t,0,1);this.skeleton&&(this.skeleton.color.a=e),0===e?this.renderFlags&=-3:this.renderFlags|=2}},red:{get:function(){return this.skeleton.color.r},set:function(t){var e=n(t,0,1);this.skeleton&&(this.skeleton.color.r=e)}},green:{get:function(){return this.skeleton.color.g},set:function(t){var e=n(t,0,1);this.skeleton&&(this.skeleton.color.g=e)}},blue:{get:function(){return this.skeleton.color.b},set:function(t){var e=n(t,0,1);this.skeleton&&(this.skeleton.color.b=e)}},setColor:function(t,e){void 0===t&&(t=16777215);var i=(t>>16&255)/255,s=(t>>8&255)/255,n=(255&t)/255,r=t>16777215?(t>>>24)/255:null,a=this.skeleton;if(e){var o=this.findSlot(e);o&&(a=o)}return a.color.r=i,a.color.g=s,a.color.b=n,null!==r&&(a.color.a=r),this},setSkeletonFromJSON:function(t,e,i,s){return this.setSkeleton(t,e,i,s)},setSkeleton:function(t,e,i,s){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var n=this.plugin.createSkeleton(t,s);this.skeletonData=n.skeletonData,this.preMultipliedAlpha=n.preMultipliedAlpha;var r=n.skeleton;return r.setSkin(),r.setToSetupPose(),this.skeleton=r,n=this.plugin.createAnimationState(r),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=n.state,this.stateData=n.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=m(d(this.rotation))+90),this.state.apply(r),r.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=m(d(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,s){var n=this.skeleton;return void 0===t&&(t=n.data.width),void 0===e&&(e=n.data.height),void 0===i&&(i=0),void 0===s&&(s=0),this.width=t,this.height=e,this.displayOriginX=n.x-i,this.displayOriginY=n.y-s,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,s=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var n=this.getBounds();return this.width=n.size.x,this.height=n.size.y,this.displayOriginX=this.x-n.offset.x,this.displayOriginY=this.y-(e-(this.height+n.offset.y)),t.scaleX=i,t.scaleY=s,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(228),r=new s({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(n.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],s=0;s - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={CHANGE_DATA:i(229),CHANGE_DATA_KEY:i(230),DESTROY:i(231),REMOVE_DATA:i(232),SET_DATA:i(233)}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="changedata"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="changedata-"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="destroy"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="removedata"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="setdata"},function(t,e,i){"use strict";var s=Object.prototype.hasOwnProperty,n="~";function r(){}function a(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,i,s,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new a(i,s||t,r),h=n?n+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function l(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),l.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)s.call(t,e)&&i.push(n?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},l.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var s=0,r=i.length,a=new Array(r);s - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="addedtoscene"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="destroy"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="removedfromscene"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="complete"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="created"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="error"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="loop"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="play"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="seeked"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="seeking"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="stop"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="timeout"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="unlocked"},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={COMPLETE:i(249),DISPOSE:i(250),END:i(251),EVENT:i(252),INTERRUPTED:i(253),START:i(254)}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="complete"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="dispose"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="end"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="event"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="interrupted"},function(t,e){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports="start"},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var s=i(2),n=i(2),r=i(2);s=i(256),r=i(257),t.exports={renderWebGL:s,renderCanvas:n,renderDirect:r}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var s=i(1),n=i(14),r=i(61),a=i(16),o=i(7);t.exports=function(t,e,i,h,l){var c=e.plugin,u=e.skeleton,d=c.sceneRenderer;t.newType&&(t.pipelines.clear(),d.begin());var f=e.scrollFactorX,p=e.scrollFactorY,m=u.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,u.color.a=s(m*l.alpha,0,1)),i.addToRenderList(e);var g=r(e,i,h).calc,x=t.height;if(u.x=g.tx,u.y=x-g.ty,u.scaleX=g.scaleX,u.scaleY=g.scaleY,e.scaleX<0?(u.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(n(g.rotationNormalized))+90,0,360),e.scaleY<0&&(u.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),u.updateWorldTransform(),d.drawSkeleton(u,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,u.color.a=m),c.drawDebug||e.drawDebug){var v=u.x,y=u.y;u.x=0,u.y=0,d.drawSkeletonDebug(u,e.preMultipliedAlpha),u.x=v,u.y=y}t.nextTypeMatch||(d.end(),t.pipelines.rebind())}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var s=i(1),n=i(14),r=i(61),a=i(16),o=i(7);t.exports=function(t,e,i,h,l){var c=e.plugin,u=e.skeleton,d=c.sceneRenderer;t.pipelines.clear(),d.begin();var f=e.scrollFactorX,p=e.scrollFactorY,m=u.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,u.color.a=s(m*l.alpha,0,1)),i.addToRenderList(e);var g=r(e,i,h).calc,x=t.height;if(u.x=g.tx,u.y=x-g.ty,u.scaleX=g.scaleX,u.scaleY=g.scaleY,e.scaleX<0?(u.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(n(g.rotationNormalized))+90,0,360),e.scaleY<0&&(u.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),u.updateWorldTransform(),d.drawSkeleton(u,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,u.color.a=m),c.drawDebug||e.drawDebug){var v=u.x,y=u.y;u.x=0,u.y=0,d.drawSkeletonDebug(u,e.preMultipliedAlpha),u.x=v,u.y=y}d.end(),t.pipelines.rebind()}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ -var s=i(0),n=i(259),r=i(344),a=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r){n.call(this,t,i,s,r),this.type="Spine",this.plugin=e},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null,this.plugin=null}});t.exports=a},function(t,e,i){ -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(260),n=i(13),r=i(0),a=i(311),o=i(60),h=i(58),l=i(29),c=i(341),u=i(343),d=i(3),f=new r({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.Pipeline,a.Transform,a.Visible,c],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPipeline(),this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(n.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,n=!1;t.setEmpty();for(var r=0;r-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){var i,s=[null],n=this.list.slice(),r=n.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Matrix:i(261),Add:i(270),AddAt:i(271),BringToTop:i(272),CountAllMatching:i(273),Each:i(274),EachInRange:i(275),FindClosestInSorted:i(276),Flatten:i(277),GetAll:i(278),GetFirst:i(279),GetRandom:i(280),MoveDown:i(281),MoveTo:i(282),MoveUp:i(283),MoveAbove:i(284),MoveBelow:i(285),NumberArray:i(286),NumberArrayStep:i(287),QuickSelect:i(288),Range:i(289),Remove:i(290),RemoveAt:i(291),RemoveBetween:i(292),RemoveRandomElement:i(293),Replace:i(294),RotateLeft:i(63),RotateRight:i(64),SafeRange:i(5),SendToBack:i(295),SetAll:i(296),Shuffle:i(65),SortByDigits:i(297),SpliceOne:i(11),StableSort:i(298),Swap:i(310)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={CheckMatrix:i(27),MatrixToString:i(262),ReverseColumns:i(264),ReverseRows:i(265),Rotate180:i(266),RotateLeft:i(267),RotateMatrix:i(17),RotateRight:i(268),Translate:i(269),TransposeMatrix:i(62)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(263),n=i(27);t.exports=function(t){var e="";if(!n(t))return e;for(var i=0;i=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((n=e-t.length)/2);t=new Array(n-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;e - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(17);t.exports=function(t){return s(t,180)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(17);t.exports=function(t){return s(t,90)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(17);t.exports=function(t){return s(t,-90)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(63),n=i(64);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?s(t,Math.abs(i)):n(t,i)),0!==e)for(var r=0;r0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(n,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>r&&(e.splice(r),a=r);for(var o=0;o0){var a=s-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),n&&n.call(r,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;s>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),n&&n.call(r,l)}return e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(5);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var a=0;if(s(t,n,r))for(var o=n;o - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(5);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r)){var a,o=[null];for(a=5;ae.length&&(r=e.length),i?(s=e[r-1][i],(n=e[r][i])-t<=t-s?e[r]:e[r-1]):(s=e[r-1],(n=e[r])-t<=t-s?n:s)}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i=function(t,e){void 0===e&&(e=[]);for(var s=0;s - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(5);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var a=[];if(s(t,n,r))for(var o=n;o - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(5);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var a=n;a0){var s=t[i-1],n=t.indexOf(s);t[i]=s,t[n]=e}return t}},function(t,e){t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&in||(t.splice(s,1),n===t.length-1?t.push(e):t.splice(n,0,e)),t}},function(t,e){t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s=e;n--)a?r.push(i+n.toString()+s):r.push(n);else for(n=t;n<=e;n++)a?r.push(i+n.toString()+s):r.push(n);return r}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(43);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var n=[],r=Math.max(s((e-t)/(i||1)),0),a=0;a - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -function i(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function s(t,e){return te?1:0}var n=function(t,e,r,a,o){for(void 0===r&&(r=0),void 0===a&&(a=t.length-1),void 0===o&&(o=s);a>r;){if(a-r>600){var h=a-r+1,l=e-r+1,c=Math.log(h),u=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*u*(h-u)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(e-l*u/h+d)),p=Math.min(a,Math.floor(e+(h-l)*u/h+d));n(t,e,f,p,o)}var m=t[e],g=r,x=a;for(i(t,r,e),o(t[a],m)>0&&i(t,r,a);g0;)x--}0===o(t[r],m)?i(t,r,x):i(t,++x,a),x<=e&&(r=x+1),e<=x&&(a=x-1)}};t.exports=n},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(8),n=i(65),r=function(t,e,i){for(var s=[],n=0;n - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(11);t.exports=function(t,e,i,n){var r;if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(s(t,r),i&&i.call(n,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(r=t.indexOf(h))&&(s(t,r),o.push(h),i&&i.call(n,h)),a--}return o}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(11);t.exports=function(t,e,i,n){if(void 0===n&&(n=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(5);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),s(t,e,i)){var a=i-e,o=t.splice(e,a);if(n)for(var h=0;h - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(11);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return s(t,n)}},function(t,e){t.exports=function(t,e,i){var s=t.indexOf(e),n=t.indexOf(i);return-1!==s&&-1===n&&(t[s]=i,!0)}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(5);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var a=n;a - * @author Angry Bytes (and contributors) - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(299);function n(t,e){return String(t).localeCompare(e)}function r(t,e,i,s){var n,r,a,o,h,l=t.length,c=0,u=2*i;for(n=0;nl&&(r=l),a>l&&(a=l),o=n,h=r;;)if(o - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={os:i(28),browser:i(18),features:i(301),input:i(305),audio:i(306),video:i(307),fullscreen:i(308),canvasFeatures:i(309)}},function(t,e){var i,s,n=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{s="function"==typeof clearTimeout?clearTimeout:a}catch(t){s=a}}();var h,l=[],c=!1,u=-1;function d(){c&&h&&(c=!1,h.length?l=h.concat(l):u=-1,l.length&&f())}function f(){if(!c){var t=o(d);c=!0;for(var e=l.length;e;){for(h=l,l=[];++u1)for(var i=1;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(28),n=i(18),r=i(66),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=r.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=r.create2D(this),s=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=s.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,n.firefox&&n.firefoxVersion<21&&(a.getUserMedia=!1),!s.iOS&&(n.ie||n.firefox||n.chrome)&&(a.canvasBitBltShift=!0),(n.safari||n.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s={VERSION:"3.60.0-beta.18",BlendModes:i(13),ScaleModes:i(303),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i,s="";t.exports={disable:function(t){return""===s&&(s=i(t)),s&&(t[s]=!1),t},enable:function(t){return""===s&&(s=i(t)),s&&(t[s]=!0),t},getPrefix:i=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(18),n={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(n.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(n.mspointer=!0),navigator.getGamepads&&(n.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?n.wheelEvent="wheel":"onmousewheel"in window?n.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(n.wheelEvent="DOMMouseScroll")),n)},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(18),n={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return n;n.audioData=!!window.Audio,n.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var s=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(s||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(s)};if(n.ogg=i('ogg; codecs="vorbis"'),n.opus=i('ogg; codecs="opus"',"opus"),n.mp3=i("mpeg"),n.wav=i("wav"),n.m4a=i("x-m4a"),n.aac=i("aac"),n.flac=i("flac","x-flac"),n.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(s.edge)n.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var r=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===r&&a>=11||r>10)&&(n.dolby=!0)}}}catch(t){}return n}()},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return i;var t=document.createElement("video"),e=!!t.canPlayType,s=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(s,"")&&(i.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(s,"")&&(i.h264=!0,i.mp4=!0),t.canPlayType("video/x-m4v").replace(s,"")&&(i.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(s,"")&&(i.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(s,"")&&(i.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(s,"")&&(i.hls=!0))}catch(t){}return i}()},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return i;var t,e="Fullscreen",s="FullScreen",n=["request"+e,"request"+s,"webkitRequest"+e,"webkitRequest"+s,"msRequest"+e,"msRequest"+s,"mozRequest"+s,"mozRequest"+e];for(t=0;t - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s,n,r,a=i(66),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",n="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+n},r.src=s+"AP804Oa6"+n,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),s=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),s}()),o)},function(t,e){t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return t[s]=i,t[n]=e,t}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -t.exports={Alpha:i(312),AlphaSingle:i(313),BlendMode:i(314),ComputedSize:i(52),Crop:i(315),Depth:i(53),Flip:i(54),FX:i(316),GetBounds:i(317),Mask:i(326),Origin:i(331),PathFollower:i(332),Pipeline:i(335),ScrollFactor:i(55),Size:i(337),Texture:i(338),TextureCrop:i(339),Tint:i(340),ToJSON:i(59),Transform:i(56),TransformMatrix:i(26),Visible:i(57)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(1),n={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,n){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(n,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=n},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(1),n={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=n},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(13),n={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=n},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={fxPadding:0,setFXPadding:function(t){return void 0===t&&(t=0),this.fxPadding=t,this},onFXCopy:function(){},onFX:function(){}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(29),n=i(42),r=i(3),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,n,r,a,o,h,l;if(void 0===t&&(t=new s),this.parentContainer){var c=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),c.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),c.transformPoint(t.x,t.y,t),n=t.x,r=t.y,this.getBottomLeft(t),c.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),c.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),n=t.x,r=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,n,a,h),t.y=Math.min(i,r,o,l),t.width=Math.max(e,n,a,h)-t.x,t.height=Math.max(i,r,o,l)-t.y,t}};t.exports=a},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(67),n=i(68);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=n(t)/i);for(var a=0;a - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(321),r=i(322),a=i(30),o=i(324),h=i(3),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(12);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(323),n=i(12);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=s(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,c=0;c - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(12);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(12);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(327),n=i(330),r={mask:null,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},createBitmapMask:function(t,e,i,n,r){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new s(this.scene,t,e,i,n,r)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new n(this.scene,t)}};t.exports=r},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(328),r=new s({initialize:function(t,e,i,s,n,r){e||(e=t.sys.make.image({x:i,y:s,key:n,frame:r,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});n.register("bitmapMask",(function(t,e,i,s,n){return new r(this.scene,t,e,i,s,n)})),t.exports=r},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(0),n=i(329),r=i(23),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},n.register("GameObjectFactory",a,"add"),t.exports=a},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={},s={},n={register:function(t,e,s,n){void 0===n&&(n=!1),i[t]={plugin:e,mapping:s,custom:n}},registerCustom:function(t,e,i,n){s[t]={plugin:e,mapping:i,data:n}},hasCore:function(t){return i.hasOwnProperty(t)},hasCustom:function(t){return s.hasOwnProperty(t)},getCore:function(t){return i[t]},getCustom:function(t){return s[t]},getCustomClass:function(t){return s.hasOwnProperty(t)?s[t].plugin:null},remove:function(t){i.hasOwnProperty(t)&&delete i[t]},removeCustom:function(t){s.hasOwnProperty(t)&&delete s[t]},destroyCorePlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]},destroyCustomPlugins:function(){for(var t in s)s.hasOwnProperty(t)&&delete s[t]}};t.exports=n},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=new(i(0))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,n=this.geometryMask,r=t.maskCount;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,r,255),s.stencilOp(s.KEEP,s.KEEP,s.INCR)):(s.stencilFunc(s.EQUAL,r+1,255),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),n.renderWebGL(t,n,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),i?this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r+1,255):s.stencilFunc(s.EQUAL,r+1,255):this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r,255):s.stencilFunc(s.EQUAL,r,255)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(21),n=i(333),r=i(8),a=i(334),o=i(3),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=r(t,"from",0),t.to=r(t,"to",1);var h=n(t,"positionOnPath",!1);this.rotateToPath=n(t,"rotateToPath",!1),this.pathRotationOffset=r(t,"rotationOffset",0);var l=r(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var c=this.path.getPoint(.1);this.rotation=Math.atan2(c.y-this.y,c.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,n=this.pathVector;if(i.copy(n).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,n),i.add(n),n.add(this.pathOffset),void this.setPosition(n.x,n.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),n),i.add(n),n.add(this.pathOffset);var r=this.x,o=this.y;this.setPosition(n.x,n.y);var h=this.x-r,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+s(this.pathRotationOffset))}}};t.exports=h},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(336),n=i(11),r={defaultPipeline:null,pipeline:null,hasPostPipeline:!1,postPipelines:null,pipelineData:null,initPipeline:function(t){var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(this.postPipelines=[],this.pipelineData={},i){void 0===t&&(t=i.default);var s=i.get(t);if(s)return this.defaultPipeline=s,this.pipeline=s,!0}return!1},setPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){var a=r.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?s(e):e)}return this},setPostPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){Array.isArray(t)||(t=[t]);for(var a=0;a0,this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,s=[],n=0;n=0;i--){var s=e[i];("string"==typeof t&&s.name===t||"string"!=typeof t&&s instanceof t)&&(s.destroy(),n(e,i))}return this.hasPostPipeline=this.postPipelines.length>0,this},getPipelineName:function(){return this.pipeline.name}};t.exports=r},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i=function(t){var e,s,n;if("object"!=typeof t||null===t)return t;for(n in e=Array.isArray(t)?[]:{},t)s=t[n],e[n]=i(s);return e};t.exports=i},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(69),n={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=n},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(69),n={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=n},function(t,e){ -/** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var i={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,s=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=s,this.tintFill=!1,this},setTintFill:function(t,e,i,s){return this.setTint(t,e,i,s),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this.tintFill||16777215!==this.tintTopLeft||16777215!==this.tintTopRight||16777215!==this.tintBottomLeft||16777215!==this.tintBottomRight}}};t.exports=i},function(t,e,i){ -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(2),n=s,r=s;n=i(342),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list,r=n.length;if(0!==r){var a=e.localTransform;s?(a.loadIdentity(),a.multiply(s),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var o=-1!==e.blendMode;o||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,c=e.scrollFactorY,u=0;u - * @copyright 2013-2023 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(29);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-n,o=Math.max(t.bottom,e.bottom)-r;return i.setTo(n,r,a,o)}},function(t,e,i){ -/** - * @author Richard Davey - * @copyright 2022 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ -var s=i(2),n=i(2);s=i(345),t.exports={renderWebGL:s,renderCanvas:n}},function(t,e){t.exports=function(t,e,i,s){var n=e.plugin.sceneRenderer,r=e.list;if(0!==r.length){i.addToRenderList(e);var a=e.localTransform;s?(a.loadIdentity(),a.multiply(s),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.newType&&(t.pipelines.clear(),n.begin());var o=t.nextTypeMatch;t.nextTypeMatch=!0,t.newType=!1;for(var h=0;h{var t={4399:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function n(t,e,s,n,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new r(s,n||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,s,r=[];if(0===this._eventsCount)return r;for(s in t=this._events)e.call(t,s)&&r.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var r=0,n=s.length,a=new Array(n);r{(function(){"use strict";var e=(()=>{var t=Object.defineProperty,e=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,r={};((e,i)=>{for(var s in i)t(e,s,{get:i[s],enumerable:!0})})(r,{AlphaTimeline:()=>ft,Animation:()=>C,AnimationState:()=>kt,AnimationStateAdapter:()=>Ot,AnimationStateData:()=>Vt,AssetManager:()=>Ei,AssetManagerBase:()=>ce,AtlasAttachmentLoader:()=>ne,Attachment:()=>b,AttachmentTimeline:()=>mt,BinaryInput:()=>Pe,BlendMode:()=>ke,Bone:()=>he,BoneData:()=>ae,BoundingBoxAttachment:()=>Ut,CURRENT:()=>Nt,CameraController:()=>ji,ClippingAttachment:()=>Wt,Color:()=>h,Color2Attribute:()=>is,ColorAttribute:()=>es,ConstraintData:()=>le,CurveTimeline:()=>Q,CurveTimeline1:()=>$,CurveTimeline2:()=>tt,DebugUtils:()=>m,DeformTimeline:()=>xt,Downloader:()=>ue,DrawOrderTimeline:()=>bt,Event:()=>de,EventData:()=>fe,EventQueue:()=>Lt,EventTimeline:()=>yt,EventType:()=>Pt,FIRST:()=>Dt,FakeTexture:()=>Zt,GLTexture:()=>Mi,HOLD_FIRST:()=>Bt,HOLD_MIX:()=>zt,HOLD_SUBSEQUENT:()=>Xt,IkConstraint:()=>pe,IkConstraintData:()=>ge,IkConstraintTimeline:()=>At,Input:()=>qi,IntSet:()=>n,Interpolation:()=>u,LoadingScreen:()=>As,M00:()=>Ti,M01:()=>Ii,M02:()=>Ci,M03:()=>Ri,M10:()=>ki,M11:()=>Fi,M12:()=>Li,M13:()=>Pi,M20:()=>Oi,M21:()=>Yi,M22:()=>Di,M23:()=>Xi,M30:()=>Bi,M31:()=>zi,M32:()=>_i,M33:()=>Ni,ManagedWebGLRenderingContext:()=>yi,MathUtils:()=>c,Matrix4:()=>Ui,Mesh:()=>Ki,MeshAttachment:()=>te,MixBlend:()=>R,MixDirection:()=>k,OrthoCamera:()=>Wi,PathAttachment:()=>ee,PathConstraint:()=>be,PathConstraintData:()=>me,PathConstraintMixTimeline:()=>Tt,PathConstraintPositionTimeline:()=>Et,PathConstraintSpacingTimeline:()=>St,PointAttachment:()=>ie,PolygonBatcher:()=>ns,Pool:()=>x,Position2Attribute:()=>Qi,Position3Attribute:()=>$i,PositionMode:()=>xe,Pow:()=>d,PowOut:()=>f,RGB2Timeline:()=>gt,RGBA2Timeline:()=>pt,RGBATimeline:()=>ut,RGBTimeline:()=>dt,RegionAttachment:()=>re,ResizeMode:()=>ys,RotateMode:()=>ye,RotateTimeline:()=>et,SETUP:()=>_t,SUBSEQUENT:()=>Yt,ScaleTimeline:()=>nt,ScaleXTimeline:()=>at,ScaleYTimeline:()=>ot,SceneRenderer:()=>vs,SequenceTimeline:()=>Ct,Shader:()=>Zi,ShapeRenderer:()=>as,ShapeType:()=>os,ShearTimeline:()=>ht,ShearXTimeline:()=>lt,ShearYTimeline:()=>ct,Skeleton:()=>Se,SkeletonBinary:()=>Le,SkeletonBounds:()=>ci,SkeletonClipping:()=>di,SkeletonData:()=>Te,SkeletonDebugRenderer:()=>ls,SkeletonJson:()=>fi,SkeletonRenderer:()=>us,Skin:()=>Ce,SkinEntry:()=>Ie,Slot:()=>Ae,SlotData:()=>Re,SpacingMode:()=>ve,SpineCanvas:()=>Ss,StringSet:()=>a,TexCoordAttribute:()=>ts,Texture:()=>qt,TextureAtlas:()=>Kt,TextureAtlasPage:()=>Qt,TextureAtlasRegion:()=>$t,TextureFilter:()=>Gt,TextureRegion:()=>Ht,TextureWrap:()=>jt,TimeKeeper:()=>y,Timeline:()=>J,Touch:()=>Gi,TrackEntry:()=>Ft,TransformConstraint:()=>Me,TransformConstraintData:()=>Fe,TransformConstraintTimeline:()=>Mt,TransformMode:()=>oe,TranslateTimeline:()=>it,TranslateXTimeline:()=>st,TranslateYTimeline:()=>rt,Triangulator:()=>ui,Utils:()=>g,Vector2:()=>v,Vector3:()=>Si,VertexAttachment:()=>M,VertexAttribute:()=>Ji,VertexAttributeType:()=>ss,WebGLBlendModeConverter:()=>bi,WindowedMean:()=>w});var n=class{constructor(){this.array=new Array}add(t){let e=this.contains(t);return this.array[0|t]=0|t,!e}contains(t){return null!=this.array[0|t]}remove(t){this.array[0|t]=void 0}clear(){this.array.length=0}},a=class{constructor(){this.entries={},this.size=0}add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var i=0,s=t.length;i1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}static fromString(t){return(new o).setFromString(t)}},h=o;h.WHITE=new o(1,1,1,1),h.RED=new o(1,0,0,1),h.GREEN=new o(0,1,0,1),h.BLUE=new o(0,0,1,1),h.MAGENTA=new o(1,0,1,1);var l=class{static clamp(t,e,i){return ti?i:t}static cosDeg(t){return Math.cos(t*l.degRad)}static sinDeg(t){return Math.sin(t*l.degRad)}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return l.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,i){let s=Math.random(),r=e-t;return s<=(i-t)/r?t+Math.sqrt(s*r*(i-t)):e-Math.sqrt((1-s)*r*(e-i))}static isPowerOfTwo(t){return t&&0==(t&t-1)}},c=l;c.PI=3.1415927,c.PI2=2*l.PI,c.radiansToDegrees=180/l.PI,c.radDeg=l.radiansToDegrees,c.degreesToRadians=l.PI/180,c.degRad=l.degreesToRadians;var u=class{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}},d=class extends u{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}},f=class extends d{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}},p=class{static arrayCopy(t,e,i,s,r){for(let n=e,a=s;n=e?t:p.setArraySize(t,e,i)}static newArray(t,e){let i=new Array(t);for(let s=0;s0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},w=class{constructor(t=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let e=0;e>1)*n;let a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(!l){o.length>0&&(h=o);let a=t.bone,l=a.worldX,c=a.worldY,u=a.a,d=a.b,f=a.c,p=a.d;for(let t=e,a=r;a=this.regions.length&&(i=this.regions.length-1);let s=this.regions[i];e.region!=s&&(e.region=s,e.updateRegion())}getPath(t,e){let i=t,s=(this.start+e).toString();for(let t=this.digits-s.length;t>0;t--)i+="0";return i+=s,i}static nextID(){return E._nextID++}},S=E;S._nextID=0;var T=(t=>(t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse",t))(T||{}),I=[0,1,2,3,4,5,6],C=class{constructor(t,e,i){if(this.timelines=[],this.timelineIds=new a,!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=i}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e0&&(e%=this.duration));let h=this.timelines;for(let s=0,l=h.length;s(t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add",t))(R||{}),k=(t=>(t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut",t))(k||{}),F=0,L=1,P=2,O=3,Y=4,D=5,X=6,B=7,z=8,_=9,N=10,V=11,U=12,W=13,q=14,G=15,j=16,H=17,Z=18,K=19,J=class{constructor(t,e){this.propertyIds=e,this.frames=g.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let i=t.length;for(let s=1;se)return s-1;return i-1}static search(t,e,i){let s=t.length;for(let r=i;re)return r-i;return s-i}},Q=class extends J{constructor(t,e,i){super(t,i),this.curves=g.newFloatArray(t+18*e),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+18*t;if(this.curves.length>e){let t=g.newFloatArray(e);g.arrayCopy(this.curves,0,t,0,e),this.curves=t}}setBezier(t,e,i,s,r,n,a,o,h,l,c){let u=this.curves,d=this.getFrameCount()+18*t;0==i&&(u[e]=2+d);let f=.03*(s-2*n+o),p=.03*(r-2*a+h),g=.006*(3*(n-o)-s+l),m=.006*(3*(a-h)-r+c),x=2*f+g,v=2*p+m,y=.3*(n-s)+f+.16666667*g,w=.3*(a-r)+p+.16666667*m,b=s+y,A=r+w;for(let t=d+18;dt){let n=this.frames[e],a=this.frames[e+i];return a+(t-n)/(r[s]-n)*(r[s+1]-a)}let n=s+18;for(s+=2;s=t){let e=r[s-2],i=r[s-1];return i+(t-e)/(r[s]-e)*(r[s+1]-i)}e+=this.getFrameEntries();let a=r[n-2],o=r[n-1];return o+(t-a)/(this.frames[e]-a)*(this.frames[e+i]-o)}},$=class extends Q{constructor(t,e,i){super(t,e,[i])}getFrameEntries(){return 2}setFrame(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+1]=i}getCurveValue(t){let e=this.frames,i=e.length-2;for(let s=2;s<=i;s+=2)if(e[s]>t){i=s-2;break}let s=this.curves[i>>1];switch(s){case 0:let s=e[i],r=e[i+1];return r+(t-s)/(e[i+2]-s)*(e[i+2+1]-r);case 1:return e[i+1]}return this.getBezierValue(t,i,1,s-2)}},tt=class extends Q{constructor(t,e,i,s){super(t,e,[i,s])}getFrameEntries(){return 3}setFrame(t,e,i,s){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s}},et=class extends ${constructor(t,e,i){super(t,e,F+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,r,n,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i>2];switch(p){case 0:let t=h[f];c=h[f+1],u=h[f+2],d=h[f+3];let e=(i-t)/(h[f+4]-t);c+=(h[f+4+1]-c)*e,u+=(h[f+4+2]-u)*e,d+=(h[f+4+3]-d)*e;break;case 1:c=h[f+1],u=h[f+2],d=h[f+3];break;default:c=this.getBezierValue(i,f,1,p-2),u=this.getBezierValue(i,f,2,p+18-2),d=this.getBezierValue(i,f,3,p+36-2)}if(1==r)l.r=c,l.g=u,l.b=d;else{if(0==n){let t=o.data.color;l.r=t.r,l.g=t.g,l.b=t.b}l.r+=(c-l.r)*r,l.g+=(u-l.g)*r,l.b+=(d-l.b)*r}}},ft=class extends ${constructor(t,e,i){super(t,e,z+"|"+i),this.slotIndex=0,this.slotIndex=i}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.color;if(i>3];switch(y){case 0:let t=h[v];u=h[v+1],d=h[v+2],f=h[v+3],p=h[v+4],g=h[v+5],m=h[v+6],x=h[v+7];let e=(i-t)/(h[v+8]-t);u+=(h[v+8+1]-u)*e,d+=(h[v+8+2]-d)*e,f+=(h[v+8+3]-f)*e,p+=(h[v+8+4]-p)*e,g+=(h[v+8+5]-g)*e,m+=(h[v+8+6]-m)*e,x+=(h[v+8+7]-x)*e;break;case 1:u=h[v+1],d=h[v+2],f=h[v+3],p=h[v+4],g=h[v+5],m=h[v+6],x=h[v+7];break;default:u=this.getBezierValue(i,v,1,y-2),d=this.getBezierValue(i,v,2,y+18-2),f=this.getBezierValue(i,v,3,y+36-2),p=this.getBezierValue(i,v,4,y+54-2),g=this.getBezierValue(i,v,5,y+72-2),m=this.getBezierValue(i,v,6,y+90-2),x=this.getBezierValue(i,v,7,y+108-2)}if(1==r)l.set(u,d,f,p),c.r=g,c.g=m,c.b=x;else{if(0==n){l.setFromColor(o.data.color);let t=o.data.darkColor;c.r=t.r,c.g=t.g,c.b=t.b}l.add((u-l.r)*r,(d-l.g)*r,(f-l.b)*r,(p-l.a)*r),c.r+=(g-c.r)*r,c.g+=(m-c.g)*r,c.b+=(x-c.b)*r}}},gt=class extends Q{constructor(t,e,i){super(t,e,[B+"|"+i,_+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,s,r,n,a,o){t*=7,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=r,this.frames[t+4]=n,this.frames[t+5]=a,this.frames[t+6]=o}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,c=o.darkColor;if(it){let r=this.frames[e];return i[s+1]*(t-r)/(i[s]-r)}let r=s+18;for(s+=2;s=t){let e=i[s-2],r=i[s-1];return r+(t-e)/(i[s]-e)*(i[s+1]-r)}let n=i[r-2],a=i[r-1];return a+(1-a)*(t-n)/(this.frames[e+this.getFrameEntries()]-n)}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.getAttachment();if(!h)return;if(!(h instanceof M)||h.timelineAttachment!=this.attachment)return;let l=o.deform;0==l.length&&(n=0);let c=this.vertices,u=c[0].length,d=this.frames;if(i=d[d.length-1]){let t=c[d.length-1];if(1==r)if(3==n){let e=h;if(e.bones)for(let e=0;ei)this.apply(t,e,Number.MAX_VALUE,s,r,n,a),e=-1;else if(e>=o[h-1])return;if(i0&&o[l-1]==t;)l--}for(;l=o[l];l++)s.push(this.events[l])}},yt=vt;yt.propertyIds=[""+U];var wt=class extends J{constructor(t){super(t,wt.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,s,r,n,a){if(1==a)return void(0==n&&g.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));if(i>2];switch(f){case 0:let t=u[d];h=u[d+1],l=u[d+2],c=u[d+3];let e=(i-t)/(u[d+4]-t);h+=(u[d+4+1]-h)*e,l+=(u[d+4+2]-l)*e,c+=(u[d+4+3]-c)*e;break;case 1:h=u[d+1],l=u[d+2],c=u[d+3];break;default:h=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),c=this.getBezierValue(i,d,3,f+36-2)}if(0==n){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*r,o.mixX=t.mixX+(l-t.mixX)*r,o.mixY=t.mixY+(c-t.mixY)*r}else o.mixRotate+=(h-o.mixRotate)*r,o.mixX+=(l-o.mixX)*r,o.mixY+=(c-o.mixY)*r}},It=class extends J{constructor(t,e,i){super(t,[K+"|"+e+"|"+i.sequence.id]),this.slotIndex=e,this.attachment=i}getFrameEntries(){return It.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,i,s,r){let n=this.frames;n[t*=It.ENTRIES]=e,n[t+It.MODE]=i|s<<4,n[t+It.DELAY]=r}apply(t,e,i,s,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.attachment,l=this.attachment;if(!(h==l||h instanceof M&&h.timelineAttachment==l))return;let c=this.frames;if(i>4,m=this.attachment.sequence.regions.length,x=I[15&f];if(0!=x)switch(g+=(i-d)/p+1e-5|0,x){case 1:g=Math.min(m-1,g);break;case 2:g%=m;break;case 3:{let t=(m<<1)-2;g=0==t?0:g%t,g>=m&&(g=t-g);break}case 4:g=Math.max(m-1-g,0);break;case 5:g=m-1-g%m;break;case 6:{let t=(m<<1)-2;g=0==t?0:(g+m-1)%t,g>=m&&(g=t-g)}}o.sequenceIndex=g}},Ct=It;Ct.ENTRIES=3,Ct.MODE=1,Ct.DELAY=2;var Rt=class{constructor(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Lt(this),this.propertyIDs=new a,this.animationsChanged=!1,this.trackEntryPool=new x((()=>new Ft)),this.data=t}static emptyAnimation(){return Rt._emptyAnimation}update(t){t*=this.timeScale;let e=this.tracks;for(let i=0,s=e.length;i0){if(s.delay-=r,s.delay>0)continue;r=-s.delay,s.delay=0}let n=s.next;if(n){let e=s.trackLast-n.delay;if(e>=0){for(n.delay=0,n.trackTime+=0==s.timeScale?0:(e/s.timeScale+t)*n.timeScale,s.trackTime+=r,this.setCurrent(i,n,!0);n.mixingFrom;)n.mixTime+=t,n=n.mixingFrom;continue}}else if(s.trackLast>=s.trackEnd&&!s.mixingFrom){e[i]=null,this.queue.end(s),this.clearNext(s);continue}if(s.mixingFrom&&this.updateMixingFrom(s,t)){let t=s.mixingFrom;for(s.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}s.trackTime+=r}this.queue.drain()}updateMixingFrom(t,e){let i=t.mixingFrom;if(!i)return!0;let s=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),s):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,i=this.tracks,s=!1;for(let n=0,a=i.length;n0)continue;s=!0;let o=0==n?1:a.mixBlend,h=a.alpha;a.mixingFrom?h*=this.applyMixingFrom(a,t,o):a.trackTime>=a.trackEnd&&!a.next&&(h=0);let l=a.animationLast,c=a.getAnimationTime(),u=c,d=e;a.reverse&&(u=a.animation.duration-u,d=null);let f=a.animation.timelines,p=f.length;if(0==n&&1==h||3==o)for(let e=0;e1&&(r=1),1!=i&&(i=s.mixBlend));let n=r0&&this.queueEvents(s,d),this.events.length=0,s.nextAnimationLast=d,s.nextTrackLast=s.trackTime,r}applyAttachmentTimeline(t,e,i,s,r){var n=e.slots[t.slotIndex];n.bone.active&&(i0,s=t>=0;c.signum(e)!=c.signum(f)&&Math.abs(e)<=90&&(Math.abs(t)>180&&(t+=360*c.signum(t)),s=i),d=f+t-t%360,s!=i&&(d+=360*c.signum(t)),n[a]=d}n[a+1]=f,h.rotation=l+d*s}queueEvents(t,e){let i=t.animationStart,s=t.animationEnd,r=s-i,n=t.trackLast%r,a=this.events,o=0,h=a.length;for(;os||this.queue.event(t,e)}let l=!1;for(l=t.loop?0==r||n>t.trackTime%r:e>=s&&t.animationLast=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let i=e;for(;;){let t=i.mixingFrom;if(!t)break;this.queue.end(t),i.mixingFrom=null,i.mixingTo=null,i=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,i){let s=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,s&&(i&&this.queue.interrupt(s),e.mixingFrom=s,s.mixingTo=e,e.mixTime=0,s.mixingFrom&&s.mixDuration>0&&(e.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,i=!1){let s=this.data.skeletonData.findAnimation(e);if(!s)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,s,i)}setAnimationWith(t,e,i=!1){if(!e)throw new Error("animation cannot be null.");let s=!0,r=this.expandToIndex(t);r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,s=!1):this.clearNext(r));let n=this.trackEntry(t,e,i,r);return this.setCurrent(t,n,s),this.queue.drain(),n}addAnimation(t,e,i=!1,s=0){let r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,i,s)}addAnimationWith(t,e,i=!1,s=0){if(!e)throw new Error("animation cannot be null.");let r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;let n=this.trackEntry(t,e,i,r);return r?(r.next=n,n.previous=r,s<=0&&(s+=r.getTrackComplete()-n.mixDuration)):(this.setCurrent(t,n,!0),this.queue.drain()),n.delay=s,n}setEmptyAnimation(t,e=0){let i=this.setAnimationWith(t,Rt.emptyAnimation(),!1);return i.mixDuration=e,i.trackEnd=e,i}addEmptyAnimation(t,e=0,i=0){let s=this.addAnimationWith(t,Rt.emptyAnimation(),!1,i);return i<=0&&(s.delay+=s.mixDuration-e),s.mixDuration=e,s.trackEnd=e,s}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e0){r[o]=zt,n[o]=i;continue t}break}r[o]=Bt}else r[o]=Yt}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},kt=Rt;kt._emptyAnimation=new C("",[],0);var Ft=class{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=2,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime(t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event",t))(Pt||{}),Ot=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}},Yt=0,Dt=1,Xt=2,Bt=3,zt=4,_t=1,Nt=2,Vt=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,i){let s=this.skeletonData.findAnimation(t);if(!s)throw new Error("Animation not found: "+t);let r=this.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);this.setMixWith(s,r,i)}setMixWith(t,e,i){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let s=t.name+"."+e.name;this.animationToMixTime[s]=i}getMix(t,e){let i=t.name+"."+e.name,s=this.animationToMixTime[i];return void 0===s?this.defaultMix:s}},Ut=class extends M{constructor(t){super(t),this.color=new h(1,1,1,1)}copy(){let t=new Ut(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},Wt=class extends M{constructor(t){super(t),this.endSlot=null,this.color=new h(.2275,.2275,.8078,1)}copy(){let t=new Wt(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},qt=class{constructor(t){this._image=t}getImage(){return this._image}},Gt=(t=>(t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear",t))(Gt||{}),jt=(t=>(t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat",t))(jt||{}),Ht=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},Zt=class extends qt{setFilters(t,e){}setWraps(t,e){}dispose(){}},Kt=class{constructor(t){this.pages=new Array,this.regions=new Array;let e=new Jt(t),i=new Array(4),s={size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},format:()=>{},filter:t=>{t.minFilter=g.enumValue(Gt,i[1]),t.magFilter=g.enumValue(Gt,i[2])},repeat:t=>{-1!=i[1].indexOf("x")&&(t.uWrap=10497),-1!=i[1].indexOf("y")&&(t.vWrap=10497)},pma:t=>{t.pma="true"==i[1]}};var r={xy:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2])},size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},bounds:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2]),t.width=parseInt(i[3]),t.height=parseInt(i[4])},offset:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2])},orig:t=>{t.originalWidth=parseInt(i[1]),t.originalHeight=parseInt(i[2])},offsets:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2]),t.originalWidth=parseInt(i[3]),t.originalHeight=parseInt(i[4])},rotate:t=>{let e=i[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:t=>{t.index=parseInt(i[1])}};let n=e.readLine();for(;n&&0==n.trim().length;)n=e.readLine();for(;n&&0!=n.trim().length&&0!=e.readEntry(i,n);)n=e.readLine();let a=null,o=null,h=null;for(;null!==n;)if(0==n.trim().length)a=null,n=e.readLine();else if(a){let t=new $t(a,n);for(;;){let s=e.readEntry(i,n=e.readLine());if(0==s)break;let a=r[i[0]];if(a)a(t);else{o||(o=[]),h||(h=[]),o.push(i[0]);let t=[];for(let e=0;e0&&h&&h.length>0&&(t.names=o,t.values=h,o=null,h=null),t.u=t.x/a.width,t.v=t.y/a.height,90==t.degrees?(t.u2=(t.x+t.height)/a.width,t.v2=(t.y+t.width)/a.height):(t.u2=(t.x+t.width)/a.width,t.v2=(t.y+t.height)/a.height),this.regions.push(t)}else{for(a=new Qt(n.trim());0!=e.readEntry(i,n=e.readLine());){let t=s[i[0]];t&&t(a)}this.pages.push(a)}}findRegion(t){for(let e=0;e=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;let i=e.indexOf(":");if(-1==i)return 0;t[0]=e.substr(0,i).trim();for(let s=1,r=i+1;;s++){let i=e.indexOf(",",r);if(-1==i)return t[s]=e.substr(r).trim(),s;if(t[s]=e.substr(r,i-r).trim(),r=i+1,4==s)return 4}}},Qt=class{constructor(t){this.minFilter=9728,this.magFilter=9728,this.uWrap=33071,this.vWrap=33071,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}},$t=class extends Ht{constructor(t,e){super(),this.x=0,this.y=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.index=0,this.degrees=0,this.names=null,this.values=null,this.page=t,this.name=e}},te=class extends M{constructor(t,e){super(t),this.region=null,this.regionUVs=[],this.uvs=[],this.triangles=[],this.color=new h(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=[],this.parentMesh=null,this.sequence=null,this.tempColor=new h(0,0,0,0),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=g.newFloatArray(t.length));let e=this.uvs,i=this.uvs.length,s=this.region.u,r=this.region.v,n=0,a=0;if(this.region instanceof $t){let o=this.region,h=o.page.texture.getImage(),l=h.width,c=h.height;switch(o.degrees){case 90:s-=(o.originalHeight-o.offsetY-o.height)/l,r-=(o.originalWidth-o.offsetX-o.width)/c,n=o.originalHeight/l,a=o.originalWidth/c;for(let o=0;o= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}},oe=(t=>(t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection",t))(oe||{}),he=class{constructor(t,e,i){if(this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,s,r,n,a){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=s,this.ascaleY=r,this.ashearX=n,this.ashearY=a;let o=this.parent;if(!o){let o=this.skeleton,h=i+90+a,l=o.scaleX,u=o.scaleY;return this.a=c.cosDeg(i+n)*s*l,this.b=c.cosDeg(h)*r*l,this.c=c.sinDeg(i+n)*s*u,this.d=c.sinDeg(h)*r*u,this.worldX=t*l+o.x,void(this.worldY=e*u+o.y)}let h=o.a,l=o.b,u=o.c,d=o.d;switch(this.worldX=h*t+l*e+o.worldX,this.worldY=u*t+d*e+o.worldY,this.data.transformMode){case 0:{let t=i+90+a,e=c.cosDeg(i+n)*s,o=c.cosDeg(t)*r,f=c.sinDeg(i+n)*s,p=c.sinDeg(t)*r;return this.a=h*e+l*f,this.b=h*o+l*p,this.c=u*e+d*f,void(this.d=u*o+d*p)}case 1:{let t=i+90+a;this.a=c.cosDeg(i+n)*s,this.b=c.cosDeg(t)*r,this.c=c.sinDeg(i+n)*s,this.d=c.sinDeg(t)*r;break}case 2:{let t=h*h+u*u,e=0;t>1e-4?(t=Math.abs(h*d-l*u)/t,h/=this.skeleton.scaleX,u/=this.skeleton.scaleY,l=u*t,d=h*t,e=Math.atan2(u,h)*c.radDeg):(h=0,u=0,e=90-Math.atan2(d,l)*c.radDeg);let o=i+n-e,f=i+a-e+90,p=c.cosDeg(o)*s,g=c.cosDeg(f)*r,m=c.sinDeg(o)*s,x=c.sinDeg(f)*r;this.a=h*p-l*m,this.b=h*g-l*x,this.c=u*p+d*m,this.d=u*g+d*x;break}case 3:case 4:{let t=c.cosDeg(i),e=c.sinDeg(i),o=(h*t+l*e)/this.skeleton.scaleX,f=(u*t+d*e)/this.skeleton.scaleY,p=Math.sqrt(o*o+f*f);p>1e-5&&(p=1/p),o*=p,f*=p,p=Math.sqrt(o*o+f*f),3==this.data.transformMode&&h*d-l*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let g=Math.PI/2+Math.atan2(f,o),m=Math.cos(g)*p,x=Math.sin(g)*p,v=c.cosDeg(n)*s,y=c.cosDeg(90+a)*r,w=c.sinDeg(n)*s,b=c.sinDeg(90+a)*r;this.a=o*v+m*w,this.b=o*y+m*b,this.c=f*v+x*w,this.d=f*y+x*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.c,this.a)*c.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*c.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){let t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*c.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*c.radDeg);let e=t.a,i=t.b,s=t.c,r=t.d,n=1/(e*r-i*s),a=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=a*r*n-o*i*n,this.ay=o*e*n-a*s*n;let h=n*r,l=n*e,u=n*i,d=n*s,f=h*this.a-u*this.c,p=h*this.b-u*this.d,g=l*this.c-d*this.a,m=l*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+g*g),this.ascaleX>1e-4){let t=f*m-p*g;this.ascaleY=t/this.ascaleX,this.ashearY=Math.atan2(f*p+g*m,t)*c.radDeg,this.arotation=Math.atan2(g,f)*c.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,p)*c.radDeg}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),i=t.x-this.worldX,s=t.y-this.worldY;return t.x=i*this.d*e-s*this.b*e,t.y=s*this.a*e-i*this.c*e,t}localToWorld(t){let e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t}worldToLocalRotation(t){let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(this.a*e-this.c*i,this.d*i-this.b*e)*c.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(i*this.c+e*this.d,i*this.a+e*this.b)*c.radDeg}rotateWorld(t){let e=this.a,i=this.b,s=this.c,r=this.d,n=c.cosDeg(t),a=c.sinDeg(t);this.a=n*e-a*s,this.b=n*i-a*r,this.c=a*e+n*s,this.d=a*i+n*r}},le=class{constructor(t,e,i){this.name=t,this.order=e,this.skinRequired=i}},ce=class{constructor(t,e="",i=new ue){this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e,this.downloader=i}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,i){this.toLoad--,this.loaded++,this.assets[e]=i,t&&t(e,i)}error(t,e,i){this.toLoad--,this.loaded++,this.errors[e]=i,t&&t(e,i)}loadAll(){return new Promise(((t,e)=>{let i=()=>{this.isLoadingComplete()?this.hasErrors()?e(this.errors):t(this):requestAnimationFrame(i)};requestAnimationFrame(i)}))}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadBinary(t,(i=>{this.success(e,t,i)}),((e,s)=>{this.error(i,t,`Couldn't load binary ${t}: status ${e}, ${s}`)}))}loadText(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadText(t,(i=>{this.success(e,t,i)}),((e,s)=>{this.error(i,t,`Couldn't load text ${t}: status ${e}, ${s}`)}))}loadJson(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadJson(t,(i=>{this.success(e,t,i)}),((e,s)=>{this.error(i,t,`Couldn't load JSON ${t}: status ${e}, ${s}`)}))}loadTexture(t,e=(()=>{}),i=(()=>{})){if(t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then((e=>e.ok?e.blob():(this.error(i,t,`Couldn't load image: ${t}`),null))).then((t=>t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null)).then((i=>{i&&this.success(e,t,this.textureLoader(i))}));else{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>{this.success(e,t,this.textureLoader(s))},s.onerror=()=>{this.error(i,t,`Couldn't load image: ${t}`)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),s.src=t}}loadTextureAtlas(t,e=(()=>{}),i=(()=>{}),s){let r=t.lastIndexOf("/"),n=r>=0?t.substring(0,r+1):"";t=this.start(t),this.downloader.downloadText(t,(r=>{try{let a=new Kt(r),o=a.pages.length,h=!1;for(let r of a.pages)this.loadTexture(s?s[r.name]:n+r.name,((i,s)=>{h||(r.setTexture(s),0==--o&&this.success(e,t,a))}),((e,s)=>{h||this.error(i,t,`Couldn't load texture atlas ${t} page image: ${e}`),h=!0}))}catch(e){this.error(i,t,`Couldn't parse texture atlas ${t}: ${e.message}`)}}),((e,s)=>{this.error(i,t,`Couldn't load texture atlas ${t}: status ${e}, ${s}`)}))}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let e=this.assets[t];if(e)return e;let i=this.errors[t];throw Error("Asset not found: "+t+(i?"\n"+i:""))}remove(t){t=this.pathPrefix+t;let e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}removeAll(){for(let t in this.assets){let e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}isLoadingComplete(){return 0==this.toLoad}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},ue=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return-1!=e?(e+="base64,".length,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var e=window.atob(t),i=e.length,s=new Uint8Array(i),r=0;r{this.finish(t,s.status,s.responseText)};s.onload=r,s.onerror=r,s.send()}downloadJson(t,e,i){this.downloadText(t,(t=>{e(JSON.parse(t))}),i)}downloadBinary(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType="arraybuffer";let r=()=>{this.finish(t,s.status,s.response)};s.onload=()=>{200==s.status||0==s.status?this.finish(t,200,new Uint8Array(s.response)):r()},s.onerror=r,s.send()}start(t,e,i){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,i)}}finish(t,e,i){let s=this.callbacks[t];delete this.callbacks[t];let r=200==e||0==e?[i]:[e,i];for(let t=r.length-1,e=s.length;t180?f-=360:f<-180&&(f+=360);let m=t.ascaleX,x=t.ascaleY;if(s||r){switch(t.data.transformMode){case 3:case 4:p=e-t.worldX,g=i-t.worldY}let o=t.data.length*m,h=Math.sqrt(p*p+g*g);if(s&&ho&&o>1e-4){let t=(h/o-1)*a+1;m*=t,n&&(x*=t)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*a,m,x,t.ashearX,t.ashearY)}apply2(t,e,i,s,r,n,a,o,h){let l=t.ax,u=t.ay,d=t.ascaleX,f=t.ascaleY,p=d,g=f,m=e.ascaleX,x=0,v=0,y=0;d<0?(d=-d,x=180,y=-1):(x=0,y=1),f<0&&(f=-f,y=-y),m<0?(m=-m,v=180):v=0;let w=e.ax,b=0,A=0,M=0,E=t.a,S=t.b,T=t.c,I=t.d,C=Math.abs(d-f)<=1e-4;!C||n?(b=0,A=E*w+t.worldX,M=T*w+t.worldY):(b=e.ay,A=E*w+S*b+t.worldX,M=T*w+I*b+t.worldY);let R=t.parent;if(!R)throw new Error("IK parent must itself have a parent.");E=R.a,S=R.b,T=R.c,I=R.d;let k,F,L=1/(E*I-S*T),P=A-R.worldX,O=M-R.worldY,Y=(P*I-O*S)*L-l,D=(O*E-P*T)*L-u,X=Math.sqrt(Y*Y+D*D),B=e.data.length*m;if(X<1e-4)return this.apply1(t,i,s,!1,n,!1,h),void e.updateWorldTransformWith(w,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);P=i-R.worldX,O=s-R.worldY;let z=(P*I-O*S)*L-l,_=(O*E-P*T)*L-u,N=z*z+_*_;if(0!=o){o*=d*(m+1)*.5;let t=Math.sqrt(N),e=t-X-B*d+o;if(e>0){let i=Math.min(1,e/(2*o))-1;i=(e-o*(1-i*i))/t,z-=i*z,_-=i*_,N=z*z+_*_}}t:if(C){B*=d;let t=(N-X*X-B*B)/(2*X*B);t<-1?(t=-1,F=Math.PI*r):t>1?(t=1,F=0,n&&(E=(Math.sqrt(N)/(X+B)-1)*h+1,p*=E,a&&(g*=E))):F=Math.acos(t)*r,E=X+B*t,S=B*Math.sin(F),k=Math.atan2(_*E-z*S,z*E+_*S)}else{E=d*B,S=f*B;let t=E*E,e=S*S,i=Math.atan2(_,z);T=e*X*X+t*N-t*e;let s=-2*e*X,n=e-t;if(I=s*s-4*n*T,I>=0){let t=Math.sqrt(I);s<0&&(t=-t),t=.5*-(s+t);let e=t/n,a=T/t,o=Math.abs(e)=-1&&T<=1&&(T=Math.acos(T),P=E*Math.cos(T)+X,O=S*Math.sin(T),I=P*P+O*O,Ig&&(u=T,g=I,p=P,m=O)),N<=.5*(h+g)?(k=i-Math.atan2(l*r,o),F=a*r):(k=i-Math.atan2(m*r,p),F=u*r)}let V=Math.atan2(b,w)*y,U=t.arotation;k=(k-V)*c.radDeg+x-U,k>180?k-=360:k<-180&&(k+=360),t.updateWorldTransformWith(l,u,U+k*h,p,g,0,0),U=e.arotation,F=((F+V)*c.radDeg-e.ashearX)*y+v-U,F>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(w,b,U+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}},ge=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},me=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.positionMode=xe.Fixed,this.spacingMode=ve.Fixed,this.rotateMode=ye.Chain,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}},xe=(t=>(t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent",t))(xe||{}),ve=(t=>(t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional",t))(ve||{}),ye=(t=>(t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale",t))(ye||{}),we=class{constructor(t,e){if(this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0,s=t.bones.length;i0){t=l/t*f;for(let e=1;e0?c.degRad:-c.degRad}for(let t=0,r=3;t0){let i=h.a,s=h.b,a=h.c,o=h.d,l=0,d=0,f=0;if(l=n?p[r-1]:0==u[t+1]?p[r+2]:Math.atan2(w,g),l-=Math.atan2(a,i),y){d=Math.cos(l),f=Math.sin(l);let t=h.data.length;m+=(t*(d*i-f*a)-g)*e,x+=(t*(f*i+d*a)-w)*e}else l+=v;l>c.PI?l-=c.PI2:l<-c.PI&&(l+=c.PI2),l*=e,d=Math.cos(l),f=Math.sin(l),h.a=d*i-f*a,h.b=d*s-f*o,h.c=f*i+d*a,h.d=f*s+d*o}h.updateAppliedTransform()}}computeWorldPositions(t,e,i){let s=this.target,r=this.position,n=this.spaces,a=g.setArraySize(this.positions,3*e+2),o=this.world,h=t.closed,l=t.worldVerticesLength,c=l/6,u=we.NONE;if(!t.constantSpeed){let d=t.lengths;c-=h?1:2;let f,p=d[c];switch(1==this.data.positionMode&&(r*=p),this.data.spacingMode){case 2:f=p;break;case 3:f=p/e;break;default:f=1}o=g.setArraySize(this.world,8);for(let g=0,m=0,x=0;gp){u!=we.AFTER&&(u=we.AFTER,t.computeWorldVertices(s,l-6,4,o,0,2)),this.addAfterPosition(v-p,o,0,a,m);continue}}for(;;x++){let t=d[x];if(!(v>t)){if(0==x)v/=t;else{let e=d[x-1];v=(v-e)/(t-e)}break}}x!=u&&(u=x,h&&x==c?(t.computeWorldVertices(s,l-4,4,o,0,2),t.computeWorldVertices(s,0,4,o,4,2)):t.computeWorldVertices(s,6*x+2,8,o,0,2)),this.addCurvePosition(v,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],a,m,i||g>0&&0==e)}return a}h?(l+=2,o=g.setArraySize(this.world,l),t.computeWorldVertices(s,2,l-4,o,0,2),t.computeWorldVertices(s,0,2,o,l-4,2),o[l-2]=o[0],o[l-1]=o[1]):(c--,l-=4,o=g.setArraySize(this.world,l),t.computeWorldVertices(s,2,l,o,0,2));let d,f=g.setArraySize(this.curves,c),p=0,m=o[0],x=o[1],v=0,y=0,w=0,b=0,A=0,M=0,E=0,S=0,T=0,I=0,C=0,R=0,k=0,F=0;for(let t=0,e=2;tp){this.addAfterPosition(O-p,o,l-4,a,s);continue}}for(;;c++){let t=f[c];if(!(O>t)){if(0==c)O/=t;else{let e=f[c-1];O=(O-e)/(t-e)}break}}if(c!=u){u=c;let t=6*c;for(m=o[t],x=o[t+1],v=o[t+2],y=o[t+3],w=o[t+4],b=o[t+5],A=o[t+6],M=o[t+7],E=.03*(m-2*v+w),S=.03*(x-2*y+b),T=.006*(3*(v-w)-m+A),I=.006*(3*(y-b)-x+M),C=2*E+T,R=2*S+I,k=.3*(v-m)+E+.16666667*T,F=.3*(y-x)+S+.16666667*I,P=Math.sqrt(k*k+F*F),L[0]=P,t=1;t<8;t++)k+=C,F+=R,C+=T,R+=I,P+=Math.sqrt(k*k+F*F),L[t]=P;k+=C,F+=R,P+=Math.sqrt(k*k+F*F),L[8]=P,k+=C+T,F+=R+I,P+=Math.sqrt(k*k+F*F),L[9]=P,g=0}for(O*=P;;g++){let t=L[g];if(!(O>t)){if(0==g)O/=t;else{let e=L[g-1];O=g+(O-e)/(t-e)}break}}this.addCurvePosition(.1*O,m,x,v,y,w,b,A,M,a,s,i||t>0&&0==e)}return a}addBeforePosition(t,e,i,s,r){let n=e[i],a=e[i+1],o=e[i+2]-n,h=e[i+3]-a,l=Math.atan2(h,o);s[r]=n+t*Math.cos(l),s[r+1]=a+t*Math.sin(l),s[r+2]=l}addAfterPosition(t,e,i,s,r){let n=e[i+2],a=e[i+3],o=n-e[i],h=a-e[i+1],l=Math.atan2(h,o);s[r]=n+t*Math.cos(l),s[r+1]=a+t*Math.sin(l),s[r+2]=l}addCurvePosition(t,e,i,s,r,n,a,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=i,void(l[c+2]=Math.atan2(r-i,s-e));let d=t*t,f=d*t,p=1-t,g=p*p,m=g*p,x=p*t,v=3*x,y=p*v,w=v*t,b=e*m+s*y+n*w+o*f,A=i*m+r*y+a*w+h*f;l[c]=b,l[c+1]=A,u&&(l[c+2]=t<.001?Math.atan2(r-i,s-e):Math.atan2(A-(i*g+r*x*2+a*d),b-(e*g+s*x*2+n*d)))}},be=we;be.NONE=-1,be.BEFORE=-2,be.AFTER=-3,be.epsilon=1e-5;var Ae=class{constructor(t,e){if(this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new h,this.darkColor=t.darkColor?new h:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(t instanceof M&&this.attachment instanceof M&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},Me=class{constructor(t,e){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new v,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(let i=0;i0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,g=this.data.offsetShearY*f,m=this.bones;for(let f=0,x=m.length;fc.PI?n-=c.PI2:n<-c.PI&&(n+=c.PI2),n*=t;let a=Math.cos(n),o=Math.sin(n);x.a=a*e-o*s,x.b=a*i-o*r,x.c=o*e+a*s,x.d=o*i+a*r}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(t.x-x.worldX)*e,x.worldY+=(t.y-x.worldY)*i}if(0!=s){let t=Math.sqrt(x.a*x.a+x.c*x.c);0!=t&&(t=(t+(Math.sqrt(h*h+u*u)-t+this.data.offsetScaleX)*s)/t),x.a*=t,x.c*=t}if(0!=r){let t=Math.sqrt(x.b*x.b+x.d*x.d);0!=t&&(t=(t+(Math.sqrt(l*l+d*d)-t+this.data.offsetScaleY)*r)/t),x.b*=t,x.d*=t}if(n>0){let t=x.b,e=x.d,i=Math.atan2(e,t),s=Math.atan2(d,l)-Math.atan2(u,h)-(i-Math.atan2(x.c,x.a));s>c.PI?s-=c.PI2:s<-c.PI&&(s+=c.PI2),s=i+(s+g)*n;let r=Math.sqrt(t*t+e*e);x.b=Math.cos(s)*r,x.d=Math.sin(s)*r}x.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,r=this.mixScaleY,n=this.mixShearY,a=0!=e||0!=i,o=this.target,h=o.a,l=o.b,u=o.c,d=o.d,f=h*d-l*u>0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,g=this.data.offsetShearY*f,m=this.bones;for(let f=0,x=m.length;fc.PI?n-=c.PI2:n<-c.PI&&(n+=c.PI2),n*=t;let a=Math.cos(n),o=Math.sin(n);x.a=a*e-o*s,x.b=a*i-o*r,x.c=o*e+a*s,x.d=o*i+a*r}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=t.x*e,x.worldY+=t.y*i}if(0!=s){let t=(Math.sqrt(h*h+u*u)-1+this.data.offsetScaleX)*s+1;x.a*=t,x.c*=t}if(0!=r){let t=(Math.sqrt(l*l+d*d)-1+this.data.offsetScaleY)*r+1;x.b*=t,x.d*=t}if(n>0){let t=Math.atan2(d,l)-Math.atan2(u,h);t>c.PI?t-=c.PI2:t<-c.PI&&(t+=c.PI2);let e=x.b,i=x.d;t=Math.atan2(i,e)+(t-c.PI/2+g)*n;let s=Math.sqrt(e*e+i*i);x.b=Math.cos(t)*s,x.d=Math.sin(t)*s}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,r=this.mixScaleY,n=this.mixShearY,a=this.target,o=this.bones;for(let h=0,l=o.length;h=s.length&&(s.length=t+1),s[t]||(s[t]={}),s[t][e]=i}addSkin(t){for(let e=0;e= 0.");if(!e)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}},ke=(t=>(t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen",t))(ke||{}),Fe=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Le=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new Te;i.name="";let s=new Pe(t),r=s.readInt32(),n=s.readInt32();i.hash=0==n&&0==r?null:n.toString(16)+r.toString(16),i.version=s.readString(),i.x=s.readFloat(),i.y=s.readFloat(),i.width=s.readFloat(),i.height=s.readFloat();let a=s.readBoolean();a&&(i.fps=s.readFloat(),i.imagesPath=s.readString(),i.audioPath=s.readString());let o=0;o=s.readInt(!0);for(let t=0;t>4,t.readFloat())}s.push(e);break}}}}}let n=t.readInt(!0);if(n>0){let e=new bt(n),r=i.slots.length;for(let i=0;i=0;t--)a[t]=-1;let o=g.newArray(r-n,0),h=0,l=0;for(let e=0;e=0;t--)-1==a[t]&&(a[t]=o[--l]);e.setFrame(i,s,a)}s.push(e)}let a=t.readInt(!0);if(a>0){let e=new yt(a);for(let s=0;s>>1^-(1&i)}readStringRef(){let t=this.readInt(!0);return 0==t?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&t)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(t),i++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return 0!=this.readByte()}},Oe=class{constructor(t,e,i,s,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=s,this.inheritTimeline=r}},Ye=class{constructor(t=null,e=null){this.bones=t,this.vertices=e}},De=(t=>(t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping",t))(De||{});function Xe(t,e,i){let s=t.readFloat(),r=t.readFloat()*i;for(let n=0,a=0,o=e.getFrameCount()-1;e.setFrame(n,s,r),n!=o;n++){let o=t.readFloat(),h=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(n);break;case li:ze(t,e,a++,n,0,s,o,r,h,i)}s=o,r=h}return e}function Be(t,e,i){let s=t.readFloat(),r=t.readFloat()*i,n=t.readFloat()*i;for(let a=0,o=0,h=e.getFrameCount()-1;e.setFrame(a,s,r,n),a!=h;a++){let h=t.readFloat(),l=t.readFloat()*i,c=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(a);break;case li:ze(t,e,o++,a,0,s,h,r,l,i),ze(t,e,o++,a,1,s,h,n,c,i)}s=h,r=l,n=c}return e}function ze(t,e,i,s,r,n,a,o,h,l){e.setBezier(i,s,r,n,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,a,h)}var _e,Ne=0,Ve=1,Ue=2,We=3,qe=4,Ge=5,je=6,He=7,Ze=8,Ke=9,Je=0,Qe=1,$e=2,ti=3,ei=4,ii=5,si=0,ri=1,ni=0,ai=1,oi=2,hi=1,li=2,ci=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new x((()=>g.newFloatArray(16)))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");let i=this.boundingBoxes,s=this.polygons,r=this.polygonPool,n=t.slots,a=n.length;i.length=0,r.freeAll(s),s.length=0;for(let t=0;t=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,i,s){let r=this.minX,n=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&i<=r||e<=n&&s<=n||t>=a&&i>=a||e>=o&&s>=o)return!1;let h=(s-e)/(i-t),l=h*(r-t)+e;if(l>n&&ln&&lr&&cr&&ct.minX&&this.minYt.minY}containsPoint(t,e){let i=this.polygons;for(let s=0,r=i.length;s=i||o=i){let h=s[t];h+(i-r)/(o-r)*(s[n]-h)=c&&x<=a||x>=a&&x<=c)&&(x>=e&&x<=s||x>=s&&x<=e)){let t=(l*g-h*f)/m;if((t>=u&&t<=d||t>=d&&t<=u)&&(t>=i&&t<=r||t>=r&&t<=i))return!0}c=a,u=d}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},ui=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new x((()=>new Array)),this.polygonIndicesPool=new x((()=>new Array))}triangulate(t){let e=t,i=t.length>>1,s=this.indicesArray;s.length=0;for(let t=0;t3;){let t=i-1,a=0,o=1;for(;;){t:if(!r[a]){let n=s[t]<<1,h=s[a]<<1,l=s[o]<<1,c=e[n],u=e[n+1],d=e[h],f=e[h+1],p=e[l],g=e[l+1];for(let n=(o+1)%i;n!=t;n=(n+1)%i){if(!r[n])continue;let t=s[n]<<1,i=e[t],a=e[t+1];if(ui.positiveArea(p,g,c,u,i,a)&&ui.positiveArea(c,u,d,f,i,a)&&ui.positiveArea(d,f,p,g,i,a))break t}break}if(0==o){do{if(!r[a])break;a--}while(a>0);break}t=a,a=o,o=(o+1)%i}n.push(s[(i+a-1)%i]),n.push(s[a]),n.push(s[(a+1)%i]),s.splice(a,1),r.splice(a,1),i--;let h=(i+a-1)%i,l=a==i?0:a;r[h]=ui.isConcave(h,i,e,s),r[l]=ui.isConcave(l,i,e,s)}return 3==i&&(n.push(s[2]),n.push(s[0]),n.push(s[1])),n}decompose(t,e){let i=t,s=this.convexPolygons;this.polygonPool.freeAll(s),s.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let n=this.polygonIndicesPool.obtain();n.length=0;let a=this.polygonPool.obtain();a.length=0;let o=-1,h=0;for(let t=0,l=e.length;t0?(s.push(a),r.push(n)):(this.polygonPool.free(a),this.polygonIndicesPool.free(n)),a=this.polygonPool.obtain(),a.length=0,a.push(d),a.push(f),a.push(p),a.push(g),a.push(m),a.push(x),n=this.polygonIndicesPool.obtain(),n.length=0,n.push(l),n.push(c),n.push(u),h=ui.winding(d,f,p,g,m,x),o=l)}a.length>0&&(s.push(a),r.push(n));for(let t=0,e=s.length;t=0;t--)a=s[t],0==a.length&&(s.splice(t,1),this.polygonPool.free(a),n=r[t],r.splice(t,1),this.polygonIndicesPool.free(n));return s}static isConcave(t,e,i,s){let r=s[(e+t-1)%e]<<1,n=s[t]<<1,a=s[(t+1)%e]<<1;return!this.positiveArea(i[r],i[r+1],i[n],i[n+1],i[a],i[a+1])}static positiveArea(t,e,i,s,r,n){return t*(n-s)+i*(e-n)+r*(s-e)>=0}static winding(t,e,i,s,r,n){let a=i-t,o=s-e;return r*o-n*a+a*e-t*o>=0?1:-1}},di=class{constructor(){this.triangulator=new ui,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let i=e.worldVerticesLength,s=g.setArraySize(this.clippingPolygon,i);e.computeWorldVertices(t,0,i,s,0,2);let r=this.clippingPolygon;di.makeClockwise(r);let n=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let t=0,e=n.length;t>1,R=this.clipOutput,k=g.setArraySize(l,e+C*f);for(let h=0;h=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(i),h.push(s),h.push(r),h.push(n),h.push(t),h.push(e),o.length=0;let u=a,d=a.length-4;for(let t=0;;t+=2){let e=u[t],i=u[t+1],s=u[t+2],r=u[t+3],n=e-s,a=i-r,f=h,p=h.length-2,g=o.length;for(let t=0;t0;if(n*(l-r)-a*(h-s)>0){if(p){o.push(u),o.push(d);continue}let t=d-l,n=u-h,a=t*(s-e)-n*(r-i);if(Math.abs(a)>1e-6){let c=(n*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(r-i)*c)}else o.push(e),o.push(i)}else if(p){let t=d-l,n=u-h,a=t*(s-e)-n*(r-i);if(Math.abs(a)>1e-6){let c=(n*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(r-i)*c)}else o.push(e),o.push(i);o.push(u),o.push(d)}c=!0}if(g==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),t==d)break;let m=o;(o=h).length=0,h=m}if(l!=o){l.length=0;for(let t=0,e=o.length-2;t>1;t=0;e--)-1==o[e]&&(o[e]=t[--r])}e.setFrame(n,vi(a,"time",0),o)}r.push(e)}if(t.events){let e=new yt(t.events.length),s=0;for(let r=0;r{t&&t.preventDefault()})),i.addEventListener("webglcontextrestored",(t=>{for(let t=0,e=this.restorables.length;t-1&&this.restorables.splice(e,1)}},wi=771,bi=class{static getDestGLBlendMode(t){switch(t){case 0:case 2:case 3:return wi;case 1:return 1;default:throw new Error("Unknown blend mode: "+t)}}static getSourceColorGLBlendMode(t,e=!1){switch(t){case 0:case 1:return e?1:770;case 2:return 774;case 3:return 1;default:throw new Error("Unknown blend mode: "+t)}}static getSourceAlphaGLBlendMode(t){switch(t){case 0:case 1:return 1;case 2:return wi;case 3:return 769;default:throw new Error("Unknown blend mode: "+t)}}},Ai=class extends qt{constructor(t,e,i=!1){super(e),this.texture=null,this.boundUnit=0,this.useMipMaps=!1,this.context=t instanceof yi?t:new yi(t),this.useMipMaps=i,this.restore(),this.context.addRestorable(this)}setFilters(t,e){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,Ai.validateMagFilter(e)),this.useMipMaps=Ai.usesMipMaps(t),this.useMipMaps&&i.generateMipmap(i.TEXTURE_2D)}static validateMagFilter(t){switch(t){case 9987:case 9987:case 9985:case 9986:case 9984:return 9729;default:return t}}static usesMipMaps(t){switch(t){case 9987:case 9987:case 9985:case 9986:case 9984:return!0;default:return!1}}setWraps(t,e){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e)}update(t){let e=this.context.gl;this.texture||(this.texture=this.context.gl.createTexture()),this.bind(),Ai.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL&&e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this._image),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t&&e.generateMipmap(e.TEXTURE_2D)}restore(){this.texture=null,this.update(this.useMipMaps)}bind(t=0){let e=this.context.gl;this.boundUnit=t,e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.texture)}unbind(){let t=this.context.gl;t.activeTexture(t.TEXTURE0+this.boundUnit),t.bindTexture(t.TEXTURE_2D,null)}dispose(){this.context.removeRestorable(this),this.context.gl.deleteTexture(this.texture)}},Mi=Ai;Mi.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL=!1;var Ei=class extends ce{constructor(t,e="",i=new ue){super((e=>new Mi(t,e)),e,i)}},Si=class{constructor(t=0,e=0,i=0){this.x=0,this.y=0,this.z=0,this.x=t,this.y=e,this.z=i}setFrom(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}set(t,e,i){return this.x=t,this.y=e,this.z=i,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}scale(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(){let t=this.length();return 0==t||(t=1/t,this.x*=t,this.y*=t,this.z*=t),this}cross(t){return this.set(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)}multiply(t){let e=t.values;return this.set(this.x*e[Ti]+this.y*e[Ii]+this.z*e[Ci]+e[Ri],this.x*e[ki]+this.y*e[Fi]+this.z*e[Li]+e[Pi],this.x*e[Oi]+this.y*e[Yi]+this.z*e[Di]+e[Xi])}project(t){let e=t.values,i=1/(this.x*e[Bi]+this.y*e[zi]+this.z*e[_i]+e[Ni]);return this.set((this.x*e[Ti]+this.y*e[Ii]+this.z*e[Ci]+e[Ri])*i,(this.x*e[ki]+this.y*e[Fi]+this.z*e[Li]+e[Pi])*i,(this.x*e[Oi]+this.y*e[Yi]+this.z*e[Di]+e[Xi])*i)}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}distance(t){let e=t.x-this.x,i=t.y-this.y,s=t.z-this.z;return Math.sqrt(e*e+i*i+s*s)}},Ti=0,Ii=4,Ci=8,Ri=12,ki=1,Fi=5,Li=9,Pi=13,Oi=2,Yi=6,Di=10,Xi=14,Bi=3,zi=7,_i=11,Ni=15,Vi=class{constructor(){this.temp=new Float32Array(16),this.values=new Float32Array(16);let t=this.values;t[Ti]=1,t[Fi]=1,t[Di]=1,t[Ni]=1}set(t){return this.values.set(t),this}transpose(){let t=this.temp,e=this.values;return t[Ti]=e[Ti],t[Ii]=e[ki],t[Ci]=e[Oi],t[Ri]=e[Bi],t[ki]=e[Ii],t[Fi]=e[Fi],t[Li]=e[Yi],t[Pi]=e[zi],t[Oi]=e[Ci],t[Yi]=e[Li],t[Di]=e[Di],t[Xi]=e[_i],t[Bi]=e[Ri],t[zi]=e[Pi],t[_i]=e[Xi],t[Ni]=e[Ni],this.set(t)}identity(){let t=this.values;return t[Ti]=1,t[Ii]=0,t[Ci]=0,t[Ri]=0,t[ki]=0,t[Fi]=1,t[Li]=0,t[Pi]=0,t[Oi]=0,t[Yi]=0,t[Di]=1,t[Xi]=0,t[Bi]=0,t[zi]=0,t[_i]=0,t[Ni]=1,this}invert(){let t=this.values,e=this.temp,i=t[Bi]*t[Yi]*t[Li]*t[Ri]-t[Oi]*t[zi]*t[Li]*t[Ri]-t[Bi]*t[Fi]*t[Di]*t[Ri]+t[ki]*t[zi]*t[Di]*t[Ri]+t[Oi]*t[Fi]*t[_i]*t[Ri]-t[ki]*t[Yi]*t[_i]*t[Ri]-t[Bi]*t[Yi]*t[Ci]*t[Pi]+t[Oi]*t[zi]*t[Ci]*t[Pi]+t[Bi]*t[Ii]*t[Di]*t[Pi]-t[Ti]*t[zi]*t[Di]*t[Pi]-t[Oi]*t[Ii]*t[_i]*t[Pi]+t[Ti]*t[Yi]*t[_i]*t[Pi]+t[Bi]*t[Fi]*t[Ci]*t[Xi]-t[ki]*t[zi]*t[Ci]*t[Xi]-t[Bi]*t[Ii]*t[Li]*t[Xi]+t[Ti]*t[zi]*t[Li]*t[Xi]+t[ki]*t[Ii]*t[_i]*t[Xi]-t[Ti]*t[Fi]*t[_i]*t[Xi]-t[Oi]*t[Fi]*t[Ci]*t[Ni]+t[ki]*t[Yi]*t[Ci]*t[Ni]+t[Oi]*t[Ii]*t[Li]*t[Ni]-t[Ti]*t[Yi]*t[Li]*t[Ni]-t[ki]*t[Ii]*t[Di]*t[Ni]+t[Ti]*t[Fi]*t[Di]*t[Ni];if(0==i)throw new Error("non-invertible matrix");let s=1/i;return e[Ti]=t[Li]*t[Xi]*t[zi]-t[Pi]*t[Di]*t[zi]+t[Pi]*t[Yi]*t[_i]-t[Fi]*t[Xi]*t[_i]-t[Li]*t[Yi]*t[Ni]+t[Fi]*t[Di]*t[Ni],e[Ii]=t[Ri]*t[Di]*t[zi]-t[Ci]*t[Xi]*t[zi]-t[Ri]*t[Yi]*t[_i]+t[Ii]*t[Xi]*t[_i]+t[Ci]*t[Yi]*t[Ni]-t[Ii]*t[Di]*t[Ni],e[Ci]=t[Ci]*t[Pi]*t[zi]-t[Ri]*t[Li]*t[zi]+t[Ri]*t[Fi]*t[_i]-t[Ii]*t[Pi]*t[_i]-t[Ci]*t[Fi]*t[Ni]+t[Ii]*t[Li]*t[Ni],e[Ri]=t[Ri]*t[Li]*t[Yi]-t[Ci]*t[Pi]*t[Yi]-t[Ri]*t[Fi]*t[Di]+t[Ii]*t[Pi]*t[Di]+t[Ci]*t[Fi]*t[Xi]-t[Ii]*t[Li]*t[Xi],e[ki]=t[Pi]*t[Di]*t[Bi]-t[Li]*t[Xi]*t[Bi]-t[Pi]*t[Oi]*t[_i]+t[ki]*t[Xi]*t[_i]+t[Li]*t[Oi]*t[Ni]-t[ki]*t[Di]*t[Ni],e[Fi]=t[Ci]*t[Xi]*t[Bi]-t[Ri]*t[Di]*t[Bi]+t[Ri]*t[Oi]*t[_i]-t[Ti]*t[Xi]*t[_i]-t[Ci]*t[Oi]*t[Ni]+t[Ti]*t[Di]*t[Ni],e[Li]=t[Ri]*t[Li]*t[Bi]-t[Ci]*t[Pi]*t[Bi]-t[Ri]*t[ki]*t[_i]+t[Ti]*t[Pi]*t[_i]+t[Ci]*t[ki]*t[Ni]-t[Ti]*t[Li]*t[Ni],e[Pi]=t[Ci]*t[Pi]*t[Oi]-t[Ri]*t[Li]*t[Oi]+t[Ri]*t[ki]*t[Di]-t[Ti]*t[Pi]*t[Di]-t[Ci]*t[ki]*t[Xi]+t[Ti]*t[Li]*t[Xi],e[Oi]=t[Fi]*t[Xi]*t[Bi]-t[Pi]*t[Yi]*t[Bi]+t[Pi]*t[Oi]*t[zi]-t[ki]*t[Xi]*t[zi]-t[Fi]*t[Oi]*t[Ni]+t[ki]*t[Yi]*t[Ni],e[Yi]=t[Ri]*t[Yi]*t[Bi]-t[Ii]*t[Xi]*t[Bi]-t[Ri]*t[Oi]*t[zi]+t[Ti]*t[Xi]*t[zi]+t[Ii]*t[Oi]*t[Ni]-t[Ti]*t[Yi]*t[Ni],e[Di]=t[Ii]*t[Pi]*t[Bi]-t[Ri]*t[Fi]*t[Bi]+t[Ri]*t[ki]*t[zi]-t[Ti]*t[Pi]*t[zi]-t[Ii]*t[ki]*t[Ni]+t[Ti]*t[Fi]*t[Ni],e[Xi]=t[Ri]*t[Fi]*t[Oi]-t[Ii]*t[Pi]*t[Oi]-t[Ri]*t[ki]*t[Yi]+t[Ti]*t[Pi]*t[Yi]+t[Ii]*t[ki]*t[Xi]-t[Ti]*t[Fi]*t[Xi],e[Bi]=t[Li]*t[Yi]*t[Bi]-t[Fi]*t[Di]*t[Bi]-t[Li]*t[Oi]*t[zi]+t[ki]*t[Di]*t[zi]+t[Fi]*t[Oi]*t[_i]-t[ki]*t[Yi]*t[_i],e[zi]=t[Ii]*t[Di]*t[Bi]-t[Ci]*t[Yi]*t[Bi]+t[Ci]*t[Oi]*t[zi]-t[Ti]*t[Di]*t[zi]-t[Ii]*t[Oi]*t[_i]+t[Ti]*t[Yi]*t[_i],e[_i]=t[Ci]*t[Fi]*t[Bi]-t[Ii]*t[Li]*t[Bi]-t[Ci]*t[ki]*t[zi]+t[Ti]*t[Li]*t[zi]+t[Ii]*t[ki]*t[_i]-t[Ti]*t[Fi]*t[_i],e[Ni]=t[Ii]*t[Li]*t[Oi]-t[Ci]*t[Fi]*t[Oi]+t[Ci]*t[ki]*t[Yi]-t[Ti]*t[Li]*t[Yi]-t[Ii]*t[ki]*t[Di]+t[Ti]*t[Fi]*t[Di],t[Ti]=e[Ti]*s,t[Ii]=e[Ii]*s,t[Ci]=e[Ci]*s,t[Ri]=e[Ri]*s,t[ki]=e[ki]*s,t[Fi]=e[Fi]*s,t[Li]=e[Li]*s,t[Pi]=e[Pi]*s,t[Oi]=e[Oi]*s,t[Yi]=e[Yi]*s,t[Di]=e[Di]*s,t[Xi]=e[Xi]*s,t[Bi]=e[Bi]*s,t[zi]=e[zi]*s,t[_i]=e[_i]*s,t[Ni]=e[Ni]*s,this}determinant(){let t=this.values;return t[Bi]*t[Yi]*t[Li]*t[Ri]-t[Oi]*t[zi]*t[Li]*t[Ri]-t[Bi]*t[Fi]*t[Di]*t[Ri]+t[ki]*t[zi]*t[Di]*t[Ri]+t[Oi]*t[Fi]*t[_i]*t[Ri]-t[ki]*t[Yi]*t[_i]*t[Ri]-t[Bi]*t[Yi]*t[Ci]*t[Pi]+t[Oi]*t[zi]*t[Ci]*t[Pi]+t[Bi]*t[Ii]*t[Di]*t[Pi]-t[Ti]*t[zi]*t[Di]*t[Pi]-t[Oi]*t[Ii]*t[_i]*t[Pi]+t[Ti]*t[Yi]*t[_i]*t[Pi]+t[Bi]*t[Fi]*t[Ci]*t[Xi]-t[ki]*t[zi]*t[Ci]*t[Xi]-t[Bi]*t[Ii]*t[Li]*t[Xi]+t[Ti]*t[zi]*t[Li]*t[Xi]+t[ki]*t[Ii]*t[_i]*t[Xi]-t[Ti]*t[Fi]*t[_i]*t[Xi]-t[Oi]*t[Fi]*t[Ci]*t[Ni]+t[ki]*t[Yi]*t[Ci]*t[Ni]+t[Oi]*t[Ii]*t[Li]*t[Ni]-t[Ti]*t[Yi]*t[Li]*t[Ni]-t[ki]*t[Ii]*t[Di]*t[Ni]+t[Ti]*t[Fi]*t[Di]*t[Ni]}translate(t,e,i){let s=this.values;return s[Ri]+=t,s[Pi]+=e,s[Xi]+=i,this}copy(){return(new Vi).set(this.values)}projection(t,e,i,s){this.identity();let r=1/Math.tan(i*(Math.PI/180)/2),n=(e+t)/(t-e),a=2*e*t/(t-e),o=this.values;return o[Ti]=r/s,o[ki]=0,o[Oi]=0,o[Bi]=0,o[Ii]=0,o[Fi]=r,o[Yi]=0,o[zi]=0,o[Ci]=0,o[Li]=0,o[Di]=n,o[_i]=-1,o[Ri]=0,o[Pi]=0,o[Xi]=a,o[Ni]=0,this}ortho2d(t,e,i,s){return this.ortho(t,t+i,e,e+s,0,1)}ortho(t,e,i,s,r,n){this.identity();let a=2/(e-t),o=2/(s-i),h=-2/(n-r),l=-(e+t)/(e-t),c=-(s+i)/(s-i),u=-(n+r)/(n-r),d=this.values;return d[Ti]=a,d[ki]=0,d[Oi]=0,d[Bi]=0,d[Ii]=0,d[Fi]=o,d[Yi]=0,d[zi]=0,d[Ci]=0,d[Li]=0,d[Di]=h,d[_i]=0,d[Ri]=l,d[Pi]=c,d[Xi]=u,d[Ni]=1,this}multiply(t){let e=this.temp,i=this.values,s=t.values;return e[Ti]=i[Ti]*s[Ti]+i[Ii]*s[ki]+i[Ci]*s[Oi]+i[Ri]*s[Bi],e[Ii]=i[Ti]*s[Ii]+i[Ii]*s[Fi]+i[Ci]*s[Yi]+i[Ri]*s[zi],e[Ci]=i[Ti]*s[Ci]+i[Ii]*s[Li]+i[Ci]*s[Di]+i[Ri]*s[_i],e[Ri]=i[Ti]*s[Ri]+i[Ii]*s[Pi]+i[Ci]*s[Xi]+i[Ri]*s[Ni],e[ki]=i[ki]*s[Ti]+i[Fi]*s[ki]+i[Li]*s[Oi]+i[Pi]*s[Bi],e[Fi]=i[ki]*s[Ii]+i[Fi]*s[Fi]+i[Li]*s[Yi]+i[Pi]*s[zi],e[Li]=i[ki]*s[Ci]+i[Fi]*s[Li]+i[Li]*s[Di]+i[Pi]*s[_i],e[Pi]=i[ki]*s[Ri]+i[Fi]*s[Pi]+i[Li]*s[Xi]+i[Pi]*s[Ni],e[Oi]=i[Oi]*s[Ti]+i[Yi]*s[ki]+i[Di]*s[Oi]+i[Xi]*s[Bi],e[Yi]=i[Oi]*s[Ii]+i[Yi]*s[Fi]+i[Di]*s[Yi]+i[Xi]*s[zi],e[Di]=i[Oi]*s[Ci]+i[Yi]*s[Li]+i[Di]*s[Di]+i[Xi]*s[_i],e[Xi]=i[Oi]*s[Ri]+i[Yi]*s[Pi]+i[Di]*s[Xi]+i[Xi]*s[Ni],e[Bi]=i[Bi]*s[Ti]+i[zi]*s[ki]+i[_i]*s[Oi]+i[Ni]*s[Bi],e[zi]=i[Bi]*s[Ii]+i[zi]*s[Fi]+i[_i]*s[Yi]+i[Ni]*s[zi],e[_i]=i[Bi]*s[Ci]+i[zi]*s[Li]+i[_i]*s[Di]+i[Ni]*s[_i],e[Ni]=i[Bi]*s[Ri]+i[zi]*s[Pi]+i[_i]*s[Xi]+i[Ni]*s[Ni],this.set(this.temp)}multiplyLeft(t){let e=this.temp,i=this.values,s=t.values;return e[Ti]=s[Ti]*i[Ti]+s[Ii]*i[ki]+s[Ci]*i[Oi]+s[Ri]*i[Bi],e[Ii]=s[Ti]*i[Ii]+s[Ii]*i[Fi]+s[Ci]*i[Yi]+s[Ri]*i[zi],e[Ci]=s[Ti]*i[Ci]+s[Ii]*i[Li]+s[Ci]*i[Di]+s[Ri]*i[_i],e[Ri]=s[Ti]*i[Ri]+s[Ii]*i[Pi]+s[Ci]*i[Xi]+s[Ri]*i[Ni],e[ki]=s[ki]*i[Ti]+s[Fi]*i[ki]+s[Li]*i[Oi]+s[Pi]*i[Bi],e[Fi]=s[ki]*i[Ii]+s[Fi]*i[Fi]+s[Li]*i[Yi]+s[Pi]*i[zi],e[Li]=s[ki]*i[Ci]+s[Fi]*i[Li]+s[Li]*i[Di]+s[Pi]*i[_i],e[Pi]=s[ki]*i[Ri]+s[Fi]*i[Pi]+s[Li]*i[Xi]+s[Pi]*i[Ni],e[Oi]=s[Oi]*i[Ti]+s[Yi]*i[ki]+s[Di]*i[Oi]+s[Xi]*i[Bi],e[Yi]=s[Oi]*i[Ii]+s[Yi]*i[Fi]+s[Di]*i[Yi]+s[Xi]*i[zi],e[Di]=s[Oi]*i[Ci]+s[Yi]*i[Li]+s[Di]*i[Di]+s[Xi]*i[_i],e[Xi]=s[Oi]*i[Ri]+s[Yi]*i[Pi]+s[Di]*i[Xi]+s[Xi]*i[Ni],e[Bi]=s[Bi]*i[Ti]+s[zi]*i[ki]+s[_i]*i[Oi]+s[Ni]*i[Bi],e[zi]=s[Bi]*i[Ii]+s[zi]*i[Fi]+s[_i]*i[Yi]+s[Ni]*i[zi],e[_i]=s[Bi]*i[Ci]+s[zi]*i[Li]+s[_i]*i[Di]+s[Ni]*i[_i],e[Ni]=s[Bi]*i[Ri]+s[zi]*i[Pi]+s[_i]*i[Xi]+s[Ni]*i[Ni],this.set(this.temp)}lookAt(t,e,i){let s=Vi.xAxis,r=Vi.yAxis,n=Vi.zAxis;n.setFrom(e).normalize(),s.setFrom(e).normalize(),s.cross(i).normalize(),r.setFrom(s).cross(n).normalize(),this.identity();let a=this.values;return a[Ti]=s.x,a[Ii]=s.y,a[Ci]=s.z,a[ki]=r.x,a[Fi]=r.y,a[Li]=r.z,a[Oi]=-n.x,a[Yi]=-n.y,a[Di]=-n.z,Vi.tmpMatrix.identity(),Vi.tmpMatrix.values[Ri]=-t.x,Vi.tmpMatrix.values[Pi]=-t.y,Vi.tmpMatrix.values[Xi]=-t.z,this.multiply(Vi.tmpMatrix),this}},Ui=Vi;Ui.xAxis=new Si,Ui.yAxis=new Si,Ui.zAxis=new Si,Ui.tmpMatrix=new Vi;var Wi=class{constructor(t,e){this.position=new Si(0,0,0),this.direction=new Si(0,0,-1),this.up=new Si(0,1,0),this.near=0,this.far=100,this.zoom=1,this.viewportWidth=0,this.viewportHeight=0,this.projectionView=new Ui,this.inverseProjectionView=new Ui,this.projection=new Ui,this.view=new Ui,this.viewportWidth=t,this.viewportHeight=e,this.update()}update(){let t=this.projection,e=this.view,i=this.projectionView,s=this.inverseProjectionView,r=this.zoom,n=this.viewportWidth,a=this.viewportHeight;t.ortho(r*(-n/2),r*(n/2),r*(-a/2),r*(a/2),this.near,this.far),e.lookAt(this.position,this.direction,this.up),i.set(t.values),i.multiply(e),s.set(i.values).invert()}screenToWorld(t,e,i){let s=t.x,r=i-t.y-1;return t.x=2*s/e-1,t.y=2*r/i-1,t.z=2*t.z-1,t.project(this.inverseProjectionView),t}worldToScreen(t,e,i){return t.project(this.projectionView),t.x=e*(t.x+1)/2,t.y=i*(t.y+1)/2,t.z=(t.z+1)/2,t}setViewport(t,e){this.viewportWidth=t,this.viewportHeight=e}},qi=class{constructor(t){this.mouseX=0,this.mouseY=0,this.buttonDown=!1,this.touch0=null,this.touch1=null,this.initialPinchDistance=0,this.listeners=new Array,this.eventListeners=[],this.element=t,this.setupCallbacks(t)}setupCallbacks(t){let e=e=>{if(e instanceof MouseEvent){let i=t.getBoundingClientRect();this.mouseX=e.clientX-i.left,this.mouseY=e.clientY-i.top,this.listeners.map((t=>{this.buttonDown?t.dragged&&t.dragged(this.mouseX,this.mouseY):t.moved&&t.moved(this.mouseX,this.mouseY)}))}},i=s=>{if(s instanceof MouseEvent){let r=t.getBoundingClientRect();this.mouseX=s.clientX-r.left,this.mouseY=s.clientY-r.top,this.buttonDown=!1,this.listeners.map((t=>{t.up&&t.up(this.mouseX,this.mouseY)})),document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",i)}};t.addEventListener("mousedown",(s=>{if(s instanceof MouseEvent){let r=t.getBoundingClientRect();this.mouseX=s.clientX-r.left,this.mouseY=s.clientY-r.top,this.buttonDown=!0,this.listeners.map((t=>{t.down&&t.down(this.mouseX,this.mouseY)})),document.addEventListener("mousemove",e),document.addEventListener("mouseup",i)}}),!0),t.addEventListener("mousemove",e,!0),t.addEventListener("mouseup",i,!0),t.addEventListener("wheel",(t=>{t.preventDefault();let e=t.deltaY;t.deltaMode==WheelEvent.DOM_DELTA_LINE&&(e*=8),t.deltaMode==WheelEvent.DOM_DELTA_PAGE&&(e*=24),this.listeners.map((e=>{e.wheel&&e.wheel(t.deltaY)}))}),!0),t.addEventListener("touchstart",(e=>{if(!this.touch0||!this.touch1){let i=e.changedTouches.item(0);if(!i)return;let s=t.getBoundingClientRect(),r=i.clientX-s.left,n=i.clientY-s.top,a=new Gi(i.identifier,r,n);if(this.mouseX=r,this.mouseY=n,this.buttonDown=!0,this.touch0){if(!this.touch1){this.touch1=a;let t=this.touch1.x-this.touch0.x,e=this.touch1.x-this.touch0.x;this.initialPinchDistance=Math.sqrt(t*t+e*e),this.listeners.map((t=>{t.zoom&&t.zoom(this.initialPinchDistance,this.initialPinchDistance)}))}}else this.touch0=a,this.listeners.map((t=>{t.down&&t.down(a.x,a.y)}))}e.preventDefault()}),!1),t.addEventListener("touchmove",(e=>{if(this.touch0){var i=e.changedTouches;let n=t.getBoundingClientRect();for(var s=0;s{i.dragged&&i.dragged(t,e)}))),this.touch1&&this.touch1.identifier===r.identifier&&(this.touch1.x=this.mouseX=t,this.touch1.y=this.mouseY=e)}if(this.touch0&&this.touch1){let t=this.touch1.x-this.touch0.x,e=this.touch1.x-this.touch0.x,i=Math.sqrt(t*t+e*e);this.listeners.map((t=>{t.zoom&&t.zoom(this.initialPinchDistance,i)}))}}e.preventDefault()}),!1);let s=e=>{if(this.touch0){var i=e.changedTouches;let n=t.getBoundingClientRect();for(var s=0;s{i.up&&i.up(t,e)})),!this.touch1){this.buttonDown=!1;break}this.touch0=this.touch1,this.touch1=null,this.mouseX=this.touch0.x,this.mouseX=this.touch0.x,this.buttonDown=!0,this.listeners.map((t=>{t.down&&t.down(this.touch0.x,this.touch0.y)}))}this.touch1&&this.touch1.identifier&&(this.touch1=null)}}e.preventDefault()};t.addEventListener("touchend",s,!1),t.addEventListener("touchcancel",s)}addListener(t){this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>-1&&this.listeners.splice(e,1)}},Gi=class{constructor(t,e,i){this.identifier=t,this.x=e,this.y=i}},ji=class{constructor(t,e){this.canvas=t,this.camera=e;let i=0,s=0,r=0,n=0,a=0,o=0,h=0;new qi(t).addListener({down:(t,l)=>{i=e.position.x,s=e.position.y,r=a=t,n=o=l,h=e.zoom},dragged:(h,l)=>{let c=h-r,u=l-n,d=e.screenToWorld(new Si(0,0),t.clientWidth,t.clientHeight),f=e.screenToWorld(new Si(c,u),t.clientWidth,t.clientHeight).sub(d);e.position.set(i-f.x,s-f.y,0),e.update(),a=h,o=l},wheel:i=>{let s=i/200*e.zoom,r=e.zoom+s;if(r>0){let s=0,n=0;if(i<0)s=a,n=o;else{let e=new Si(t.clientWidth/2+15,t.clientHeight/2),i=a-e.x,r=t.clientHeight-1-o-e.y;s=e.x-i,n=t.clientHeight-1-e.y+r}let h=e.screenToWorld(new Si(s,n),t.clientWidth,t.clientHeight);e.zoom=r,e.update();let l=e.screenToWorld(new Si(s,n),t.clientWidth,t.clientHeight);e.position.add(h.sub(l)),e.update()}},zoom:(t,i)=>{let s=t/i;e.zoom=h*s},up:(t,e)=>{a=t,o=e},moved:(t,e)=>{a=t,o=e}})}},Hi=class{constructor(t,e,i){this.vertexShader=e,this.fragmentShader=i,this.vs=null,this.fs=null,this.program=null,this.tmp2x2=new Float32Array(4),this.tmp3x3=new Float32Array(9),this.tmp4x4=new Float32Array(16),this.vsSource=e,this.fsSource=i,this.context=t instanceof yi?t:new yi(t),this.context.addRestorable(this),this.compile()}getProgram(){return this.program}getVertexShader(){return this.vertexShader}getFragmentShader(){return this.fragmentShader}getVertexShaderSource(){return this.vsSource}getFragmentSource(){return this.fsSource}compile(){let t=this.context.gl;try{if(this.vs=this.compileShader(t.VERTEX_SHADER,this.vertexShader),!this.vs)throw new Error("Couldn't compile vertex shader.");if(this.fs=this.compileShader(t.FRAGMENT_SHADER,this.fragmentShader),!this.fs)throw new Error("Couldn#t compile fragment shader.");this.program=this.compileProgram(this.vs,this.fs)}catch(t){throw this.dispose(),t}}compileShader(t,e){let i=this.context.gl,s=i.createShader(t);if(!s)throw new Error("Couldn't create shader.");if(i.shaderSource(s,e),i.compileShader(s),!i.getShaderParameter(s,i.COMPILE_STATUS)){let t="Couldn't compile shader: "+i.getShaderInfoLog(s);if(i.deleteShader(s),!i.isContextLost())throw new Error(t)}return s}compileProgram(t,e){let i=this.context.gl,s=i.createProgram();if(!s)throw new Error("Couldn't compile program.");if(i.attachShader(s,t),i.attachShader(s,e),i.linkProgram(s),!i.getProgramParameter(s,i.LINK_STATUS)){let t="Couldn't compile shader program: "+i.getProgramInfoLog(s);if(i.deleteProgram(s),!i.isContextLost())throw new Error(t)}return s}restore(){this.compile()}bind(){this.context.gl.useProgram(this.program)}unbind(){this.context.gl.useProgram(null)}setUniformi(t,e){this.context.gl.uniform1i(this.getUniformLocation(t),e)}setUniformf(t,e){this.context.gl.uniform1f(this.getUniformLocation(t),e)}setUniform2f(t,e,i){this.context.gl.uniform2f(this.getUniformLocation(t),e,i)}setUniform3f(t,e,i,s){this.context.gl.uniform3f(this.getUniformLocation(t),e,i,s)}setUniform4f(t,e,i,s,r){this.context.gl.uniform4f(this.getUniformLocation(t),e,i,s,r)}setUniform2x2f(t,e){let i=this.context.gl;this.tmp2x2.set(e),i.uniformMatrix2fv(this.getUniformLocation(t),!1,this.tmp2x2)}setUniform3x3f(t,e){let i=this.context.gl;this.tmp3x3.set(e),i.uniformMatrix3fv(this.getUniformLocation(t),!1,this.tmp3x3)}setUniform4x4f(t,e){let i=this.context.gl;this.tmp4x4.set(e),i.uniformMatrix4fv(this.getUniformLocation(t),!1,this.tmp4x4)}getUniformLocation(t){let e=this.context.gl;if(!this.program)throw new Error("Shader not compiled.");let i=e.getUniformLocation(this.program,t);if(!i&&!e.isContextLost())throw new Error(`Couldn't find location for uniform ${t}`);return i}getAttributeLocation(t){let e=this.context.gl;if(!this.program)throw new Error("Shader not compiled.");let i=e.getAttribLocation(this.program,t);if(-1==i&&!e.isContextLost())throw new Error(`Couldn't find location for attribute ${t}`);return i}dispose(){this.context.removeRestorable(this);let t=this.context.gl;this.vs&&(t.deleteShader(this.vs),this.vs=null),this.fs&&(t.deleteShader(this.fs),this.fs=null),this.program&&(t.deleteProgram(this.program),this.program=null)}static newColoredTextured(t){let e=`\n\t\t\t\tattribute vec4 ${Hi.POSITION};\n\t\t\t\tattribute vec4 ${Hi.COLOR};\n\t\t\t\tattribute vec2 ${Hi.TEXCOORDS};\n\t\t\t\tuniform mat4 ${Hi.MVP_MATRIX};\n\t\t\t\tvarying vec4 v_color;\n\t\t\t\tvarying vec2 v_texCoords;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = ${Hi.COLOR};\n\t\t\t\t\tv_texCoords = ${Hi.TEXCOORDS};\n\t\t\t\t\tgl_Position = ${Hi.MVP_MATRIX} * ${Hi.POSITION};\n\t\t\t\t}\n\t\t\t`;return new Hi(t,e,"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_color;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tgl_FragColor = v_color * texture2D(u_texture, v_texCoords);\n\t\t\t\t}\n\t\t\t")}static newTwoColoredTextured(t){let e=`\n\t\t\t\tattribute vec4 ${Hi.POSITION};\n\t\t\t\tattribute vec4 ${Hi.COLOR};\n\t\t\t\tattribute vec4 ${Hi.COLOR2};\n\t\t\t\tattribute vec2 ${Hi.TEXCOORDS};\n\t\t\t\tuniform mat4 ${Hi.MVP_MATRIX};\n\t\t\t\tvarying vec4 v_light;\n\t\t\t\tvarying vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_light = ${Hi.COLOR};\n\t\t\t\t\tv_dark = ${Hi.COLOR2};\n\t\t\t\t\tv_texCoords = ${Hi.TEXCOORDS};\n\t\t\t\t\tgl_Position = ${Hi.MVP_MATRIX} * ${Hi.POSITION};\n\t\t\t\t}\n\t\t\t`;return new Hi(t,e,"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_light;\n\t\t\t\tvarying LOWP vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tvec4 texColor = texture2D(u_texture, v_texCoords);\n\t\t\t\t\tgl_FragColor.a = texColor.a * v_light.a;\n\t\t\t\t\tgl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;\n\t\t\t\t}\n\t\t\t")}static newColored(t){let e=`\n\t\t\t\tattribute vec4 ${Hi.POSITION};\n\t\t\t\tattribute vec4 ${Hi.COLOR};\n\t\t\t\tuniform mat4 ${Hi.MVP_MATRIX};\n\t\t\t\tvarying vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = ${Hi.COLOR};\n\t\t\t\t\tgl_Position = ${Hi.MVP_MATRIX} * ${Hi.POSITION};\n\t\t\t\t}\n\t\t\t`;return new Hi(t,e,"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tgl_FragColor = v_color;\n\t\t\t\t}\n\t\t\t")}},Zi=Hi;Zi.MVP_MATRIX="u_projTrans",Zi.POSITION="a_position",Zi.COLOR="a_color",Zi.COLOR2="a_color2",Zi.TEXCOORDS="a_texCoords",Zi.SAMPLER="u_texture";var Ki=class{constructor(t,e,i,s){this.attributes=e,this.verticesBuffer=null,this.verticesLength=0,this.dirtyVertices=!1,this.indicesBuffer=null,this.indicesLength=0,this.dirtyIndices=!1,this.elementsPerVertex=0,this.context=t instanceof yi?t:new yi(t),this.elementsPerVertex=0;for(let t=0;tthis.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length}setIndices(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length}draw(t,e){this.drawWithOffset(t,e,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)}drawWithOffset(t,e,i,s){let r=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?r.drawElements(e,s,r.UNSIGNED_SHORT,2*i):r.drawArrays(e,i,s),this.unbind(t)}bind(t){let e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);let i=0;for(let s=0;s0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)}unbind(t){let e=this.context.gl;for(let i=0;i0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)}update(){let t=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=t.createBuffer()),t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),t.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),t.DYNAMIC_DRAW),this.dirtyIndices=!1)}restore(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()}dispose(){this.context.removeRestorable(this);let t=this.context.gl;t.deleteBuffer(this.verticesBuffer),t.deleteBuffer(this.indicesBuffer)}},Ji=class{constructor(t,e,i){this.name=t,this.type=e,this.numElements=i}},Qi=class extends Ji{constructor(){super(Zi.POSITION,ss.Float,2)}},$i=class extends Ji{constructor(){super(Zi.POSITION,ss.Float,3)}},ts=class extends Ji{constructor(t=0){super(Zi.TEXCOORDS+(0==t?"":t),ss.Float,2)}},es=class extends Ji{constructor(){super(Zi.COLOR,ss.Float,4)}},is=class extends Ji{constructor(){super(Zi.COLOR2,ss.Float,4)}},ss=(t=>(t[t.Float=0]="Float",t))(ss||{}),rs=class{constructor(t,e=!0,i=10920){if(this.drawCalls=0,this.isDrawing=!1,this.shader=null,this.lastTexture=null,this.verticesLength=0,this.indicesLength=0,this.cullWasEnabled=!1,i>10920)throw new Error("Can't have more than 10920 triangles per batch: "+i);this.context=t instanceof yi?t:new yi(t);let s=e?[new Qi,new es,new ts,new is]:[new Qi,new es,new ts];this.mesh=new Ki(t,s,i,3*i);let r=this.context.gl;this.srcColorBlend=r.SRC_ALPHA,this.srcAlphaBlend=r.ONE,this.dstBlend=r.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=t,this.lastTexture=null,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend),this.cullWasEnabled=e.isEnabled(e.CULL_FACE),this.cullWasEnabled&&e.disable(e.CULL_FACE)}setBlendMode(t,e,i){if((this.srcColorBlend!=t||this.srcAlphaBlend!=e||this.dstBlend!=i)&&(this.srcColorBlend=t,this.srcAlphaBlend=e,this.dstBlend=i,this.isDrawing)){this.flush(),this.context.gl.blendFuncSeparate(t,i,e,i)}}draw(t,e,i){t!=this.lastTexture?(this.flush(),this.lastTexture=t):(this.verticesLength+e.length>this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();let s=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);let r=this.mesh.getIndices();for(let t=this.indicesLength,e=0;e0||this.indicesLength>0)&&this.flush(),this.shader=null,this.lastTexture=null,this.isDrawing=!1;let t=this.context.gl;t.disable(t.BLEND),this.cullWasEnabled&&t.enable(t.CULL_FACE)}getDrawCalls(){return this.drawCalls}static getAndResetGlobalDrawCalls(){let t=rs.globalDrawCalls;return rs.globalDrawCalls=0,t}dispose(){this.mesh.dispose()}},ns=rs;ns.globalDrawCalls=0;var as=class{constructor(t,e=10920){if(this.isDrawing=!1,this.shapeType=os.Filled,this.color=new h(1,1,1,1),this.shader=null,this.vertexIndex=0,this.tmp=new v,e>10920)throw new Error("Can't have more than 10920 triangles per batch: "+e);this.context=t instanceof yi?t:new yi(t),this.mesh=new Ki(t,[new Qi,new es],e,0);let i=this.context.gl;this.srcColorBlend=i.SRC_ALPHA,this.srcAlphaBlend=i.ONE,this.dstBlend=i.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("ShapeRenderer.begin() has already been called");this.shader=t,this.vertexIndex=0,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend)}setBlendMode(t,e,i){if(this.srcColorBlend=t,this.srcAlphaBlend=e,this.dstBlend=i,this.isDrawing){this.flush(),this.context.gl.blendFuncSeparate(t,i,e,i)}}setColor(t){this.color.setFromColor(t)}setColorWith(t,e,i,s){this.color.set(t,e,i,s)}point(t,e,i){this.check(os.Point,1),i||(i=this.color),this.vertex(t,e,i)}line(t,e,i,s,r){this.check(os.Line,2);this.mesh.getVertices(),this.vertexIndex;r||(r=this.color),this.vertex(t,e,r),this.vertex(i,s,r)}triangle(t,e,i,s,r,n,a,o,h,l){this.check(t?os.Filled:os.Line,3);this.mesh.getVertices(),this.vertexIndex;o||(o=this.color),h||(h=this.color),l||(l=this.color),t?(this.vertex(e,i,o),this.vertex(s,r,h),this.vertex(n,a,l)):(this.vertex(e,i,o),this.vertex(s,r,h),this.vertex(s,r,o),this.vertex(n,a,h),this.vertex(n,a,o),this.vertex(e,i,h))}quad(t,e,i,s,r,n,a,o,h,l,c,u,d){this.check(t?os.Filled:os.Line,3);this.mesh.getVertices(),this.vertexIndex;l||(l=this.color),c||(c=this.color),u||(u=this.color),d||(d=this.color),t?(this.vertex(e,i,l),this.vertex(s,r,c),this.vertex(n,a,u),this.vertex(n,a,u),this.vertex(o,h,d),this.vertex(e,i,l)):(this.vertex(e,i,l),this.vertex(s,r,c),this.vertex(s,r,c),this.vertex(n,a,u),this.vertex(n,a,u),this.vertex(o,h,d),this.vertex(o,h,d),this.vertex(e,i,l))}rect(t,e,i,s,r,n){this.quad(t,e,i,e+s,i,e+s,i+r,e,i+r,n,n,n,n)}rectLine(t,e,i,s,r,n,a){this.check(t?os.Filled:os.Line,8),a||(a=this.color);let o=this.tmp.set(r-i,e-s);o.normalize(),n*=.5;let h=o.x*n,l=o.y*n;t?(this.vertex(e+h,i+l,a),this.vertex(e-h,i-l,a),this.vertex(s+h,r+l,a),this.vertex(s-h,r-l,a),this.vertex(s+h,r+l,a),this.vertex(e-h,i-l,a)):(this.vertex(e+h,i+l,a),this.vertex(e-h,i-l,a),this.vertex(s+h,r+l,a),this.vertex(s-h,r-l,a),this.vertex(s+h,r+l,a),this.vertex(e+h,i+l,a),this.vertex(s-h,r-l,a),this.vertex(e-h,i-l,a))}x(t,e,i){this.line(t-i,e-i,t+i,e+i),this.line(t-i,e+i,t+i,e-i)}polygon(t,e,i,s){if(i<3)throw new Error("Polygon must contain at least 3 vertices");this.check(os.Line,2*i),s||(s=this.color);this.mesh.getVertices(),this.vertexIndex;i<<=1;let r=t[e<<=1],n=t[e+1],a=e+i;for(let o=e,h=e+i-2;o=a?(h=r,l=n):(h=t[o+2],l=t[o+3]),this.vertex(e,i,s),this.vertex(h,l,s)}}circle(t,e,i,s,r,n=0){if(0==n&&(n=Math.max(1,6*c.cbrt(s)|0)),n<=0)throw new Error("segments must be > 0.");r||(r=this.color);let a=2*c.PI/n,o=Math.cos(a),h=Math.sin(a),l=s,u=0;if(t){this.check(os.Filled,3*n+3),n--;for(let t=0;t0;)this.vertex(b,A,l),b+=M,A+=E,M+=S,E+=T,S+=I,T+=C,this.vertex(b,A,l);this.vertex(b,A,l),this.vertex(a,o,l)}vertex(t,e,i){let s=this.vertexIndex,r=this.mesh.getVertices();r[s++]=t,r[s++]=e,r[s++]=i.r,r[s++]=i.g,r[s++]=i.b,r[s++]=i.a,this.vertexIndex=s}end(){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");this.flush();let t=this.context.gl;t.disable(t.BLEND),this.isDrawing=!1}flush(){if(0!=this.vertexIndex){if(!this.shader)throw new Error("No shader set.");this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0}}check(t,e){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");if(this.shapeType==t){if(!(this.mesh.maxVertices()-this.mesh.numVertices()(t[t.Point=0]="Point",t[t.Line=1]="Line",t[t.Filled=4]="Filled",t))(os||{}),hs=class{constructor(t){this.boneLineColor=new h(1,0,0,1),this.boneOriginColor=new h(0,1,0,1),this.attachmentLineColor=new h(0,0,1,.5),this.triangleLineColor=new h(1,.64,0,.5),this.pathColor=(new h).setFromString("FF7F00"),this.clipColor=new h(.8,0,0,2),this.aabbColor=new h(0,1,0,.5),this.drawBones=!0,this.drawRegionAttachments=!0,this.drawBoundingBoxes=!0,this.drawMeshHull=!0,this.drawMeshTriangles=!0,this.drawPaths=!0,this.drawSkeletonXY=!1,this.drawClipping=!0,this.premultipliedAlpha=!1,this.scale=1,this.boneWidth=2,this.bounds=new ci,this.temp=new Array,this.vertices=g.newFloatArray(2048),this.context=t instanceof yi?t:new yi(t)}draw(t,e,i){let s=e.x,r=e.y,n=this.context.gl,a=this.premultipliedAlpha?n.ONE:n.SRC_ALPHA;t.setBlendMode(a,n.ONE,n.ONE_MINUS_SRC_ALPHA);let o=e.bones;if(this.drawBones){t.setColor(this.boneLineColor);for(let e=0,s=o.length;e-1)continue;if(!s.parent)continue;let r=s.data.length*s.a+s.worldX,n=s.data.length*s.c+s.worldY;t.rectLine(!0,s.worldX,s.worldY,r,n,this.boneWidth*this.scale)}this.drawSkeletonXY&&t.x(s,r,4*this.scale)}if(this.drawRegionAttachments){t.setColor(this.attachmentLineColor);let i=e.slots;for(let e=0,s=i.length;e0){t.setColor(this.attachmentLineColor),h=2*(h>>1);let e=a[h-2],i=a[h-1];for(let s=0,r=h;s-1||t.circle(!0,s.worldX,s.worldY,3*this.scale,this.boneOriginColor,8)}}if(this.drawClipping){let i=e.slots;t.setColor(this.clipColor);for(let e=0,s=i.length;e=0&&i==y.data.index&&(x=!0),!x){h.clipEndWithSlot(y);continue}s>=0&&s==y.data.index&&(x=!1);let w,b=y.getAttachment();if(b instanceof re){let t=b;d.vertices=this.vertices,d.numVertices=4,d.numFloats=v<<2,t.computeWorldVertices(y,d.vertices,0,v),a=cs.QUAD_TRIANGLES,n=t.uvs,w=t.region.renderObject.page.texture,o=t.color}else{if(!(b instanceof te)){if(b instanceof Wt){let t=b;h.clipStart(y,t);continue}h.clipEndWithSlot(y);continue}{let t=b;d.vertices=this.vertices,d.numVertices=t.worldVerticesLength>>1,d.numFloats=d.numVertices*v,d.numFloats>d.vertices.length&&(d.vertices=this.vertices=g.newFloatArray(d.numFloats)),t.computeWorldVertices(y,0,t.worldVerticesLength,d.vertices,0,v),a=t.triangles,w=t.region.renderObject.page.texture,n=t.uvs,o=t.color}}if(w){let e=y.color,i=this.tempColor;i.r=p.r*e.r*o.r,i.g=p.g*e.g*o.g,i.b=p.b*e.b*o.b,i.a=p.a*e.a*o.a,l&&(i.r*=i.a,i.g*=i.a,i.b*=i.a);let s=this.tempColor2;y.darkColor?(l?(s.r=y.darkColor.r*i.a,s.g=y.darkColor.g*i.a,s.b=y.darkColor.b*i.a):s.setFromColor(y.darkColor),s.a=l?1:0):s.set(0,0,0,1);let f=y.data.blendMode;if(f!=u&&(u=f,t.setBlendMode(bi.getSourceColorGLBlendMode(u,l),bi.getSourceAlphaGLBlendMode(u),bi.getDestGLBlendMode(u))),h.isClipping()){h.clipTriangles(d.vertices,d.numFloats,a,a.length,n,i,s,c);let e=new Float32Array(h.clippedVertices),o=h.clippedTriangles;r&&r(d.vertices,d.numFloats,m),t.draw(w,e,o)}else{let e=d.vertices;if(c)for(let t=2,r=0,a=d.numFloats;t(t[t.Stretch=0]="Stretch",t[t.Expand=1]="Expand",t[t.Fit=2]="Fit",t))(ys||{}),ws=0,bs=163,As=class{constructor(t){if(this.logo=null,this.spinner=null,this.angle=0,this.fadeOut=0,this.fadeIn=0,this.timeKeeper=new y,this.backgroundColor=new h(.135,.135,.135,1),this.tempColor=new h,this.renderer=t,this.timeKeeper.maxDelta=9,!fs){let t=navigator.userAgent.indexOf("Safari")>-1,e=()=>ws++;(fs=new Image).src=Es,t||(fs.crossOrigin="anonymous"),fs.onload=e,(ds=new Image).src=Ms,t||(ds.crossOrigin="anonymous"),ds.onload=e}}dispose(){var t,e;null==(t=this.logo)||t.dispose(),null==(e=this.spinner)||e.dispose()}draw(t=!1){if(ws<2||t&&this.fadeOut>1)return;this.timeKeeper.update();let e=Math.abs(Math.sin(this.timeKeeper.totalTime+.25));this.angle-=200*this.timeKeeper.delta*(1+1.5*Math.pow(e,5));let i=this.tempColor,s=this.renderer,r=s.canvas,n=s.context.gl;if(s.resize(1),s.camera.position.set(r.width/2,r.height/2,0),s.batcher.setBlendMode(n.ONE,n.ONE,n.ONE_MINUS_SRC_ALPHA),t){if(this.fadeOut+=this.timeKeeper.delta*(this.timeKeeper.totalTime<1?2:1),this.fadeOut>1)return;i.setFromColor(this.backgroundColor),e=1-this.fadeOut/1,e=1-(e-1)*(e-1),i.a*=e,i.a>0&&(s.camera.zoom=1,s.begin(),s.quad(!0,0,0,r.width,0,r.width,r.height,0,r.height,i,i,i,i),s.end())}else this.fadeIn+=this.timeKeeper.delta,this.backgroundColor.a>0&&(n.clearColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),n.clear(n.COLOR_BUFFER_BIT)),e=1;e*=Math.min(this.fadeIn/1,1),i.set(e,e,e,e),this.logo||(this.logo=new Mi(s.context,fs),this.spinner=new Mi(s.context,ds)),s.camera.zoom=Math.max(1,bs/r.height),s.begin(),s.drawTexture(this.logo,(r.width-165)/2,(r.height-108)/2,165,108,i),this.spinner&&s.drawTextureRotated(this.spinner,(r.width-bs)/2,(r.height-bs)/2,bs,bs,81.5,81.5,this.angle,i),s.end()}},Ms="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAALKElEQVR42u2de2iW5R/GPzuqcwfnnKfNmafl5tTNHWzqNi3DEMQykcAoJSsySkspjSIk0iD/07Kf4R+FnVBDUTshZGpWUEJaaiWFgZlUFmXmIe3HNXthyebeZ77P9H13ffBG8Y8H7ut7vff93N/7fu4vGGPiFZiez/Qtw9lytJajfzfw9z/j+efPOv7cV8W+lUNY2a8T/ayTCRsWFLJA5rtUO1LLkV5p9LJeJizQiHeqnlOtmVFtdTGrrZkJCxYXsTgaI6r9MY4/UpNItW4mFDaXsTlaM6qVZlBq3UwofFrJp0HMWJ9DvXUzobCznJ1BzFjWlTLrZkJh/TDWBzFjTgo51s2EgnKI0Rrx+FiOWzNzVaym91Syx5qZsGBWb2ZFa0ZN6dbMhAWTcpkUrRmXD2K5NTNhgVbH0Zpxbl/mWjMTFvRIo0e0ZpzcncnWzISKtvmiMWNRJ4qslwmVXRXsas2Ix8ZwzFqZsGFREYtaM+Oaa1ljrUzYkJ9G/ok6TlzKjJWZVFor0y7c1Zu7WjLiqiGsskamXdHopyT4vALmzS9k/t19uHtKHlOSIMn6xAtARjIZ1sFcUSZ0Y4La+G6M18hS2IlCn4a+WoC0JNL0d/dUupdnUj40g6EJ2VEdMnhrOG/p5f/jUXz8SgmvaGU6KpNRNsLVQV0OdXf24s63h/P2gWoOrBjMCr2GJFQnnxnIM3q5P1PPmaYv+4ev4/C6UtbpV2gzXCkgL5W8Bwt48OIc6ul6Tp+s4+SyASxLiI4+PYCn1bHzDZxvaQW6vZzto7MYnQIpNkf7kp5EuozYUroqEjcNKHHd0Tl9mBPN1pk+hFeieGBnBtog7UXjsj9pWg+m6duecw2cay1OC/uxMC47KmP9OIYfoz1YoC20J/rzRG4quTZK2EAyJGs20qwUbYw0aNRmUxtvfUW/uEtNzc1NB1/X8LVyd15hh82F43AvD+VlXcsSJEZa1CQ3ejleAO7oxR3RDP0XN91X4+NXYb8nkv7UNTwV7e0YTdu7I3g33t7tuaEbNwSZpps2fSyvs4M2Tjhot+jb0Xzbltj8r5j/xVt/6Z1Ob93U1ZYO691EhhzchcHeXosVjcNZysyezLw4xRZt05R+fTeuj8vOj+zKyG0j2aZcVVs6v+QalnjrMFZASQYl2nBoSyz06e3j/Xk8rgWYmMvEICu2pm1HOTuc7okV8FgRj0XukwzanhvCc/F+72TjoQjdObN1OFuDLmh0xP+WHtxiI10ukJlCprb4guiv1fP+avZrS1C7NAkliHZjDtZwMMgqbukAltpMlwuMy2FcEBPqvfLLar5Uqi0hBdEwryy+Mv5n6zkbjTBa+dlMlwvUZFETZKGiFM7tvbhdJ3gSVRO0wzIjnxmvl/J6a6JsGMYGrahtpssFeqbR841S3mhN80OjOaSDEdqd6SjaMKgzgzRK7q1ib3PT9sYyNo7JZoyNFNvRcVMZmy7WOvIuryv/Zvdmdt90+nY0bRp3AvROohFwdwW7dTG7RFlbwlqdrbOBYg005NAQmZU0HWt1rXMBH1Xw0dQ8pmqzoaPmdhun7bHZjNVe9qP9eFQfO1VkUmHjhAVUZ1GtnKFSbjrkrPfy4i4UW5t/6ZxM54J0CqxFe81KpGsQyE4h23oYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjLna+bdOy+IiFquIpGq16Pb79cNYv3IIK/X/ugx+Ui6TVKvYVU9Nc8gX8od8Ir/IN/KPfCQ/yVfyl/6/pfJvLChkQdD6wyqntquCXYuKWJSfRr6D0dEAxV3xlw/khyD+kd/ku/88cHo+09tS3LBpO1HHCVUqcIA6CqB4K+6X6x35L/JM2loXurlWmUmlA5XogOIcK8/If5HncrSWo7F6cKIWPjT/RXGOlWfkv8hzaWsN4uaaysE6WIkOKM6x8oz8F3kusXqo2vxC5jtYiQ4ozrH0TeS5qIZcrB7qkrwdA8U5Vp6R/yLPZV8V+2L14Cl5THGwEh1QnGPlGfkv8lyUlIzFQ1cNYVVHrcjZ0VCcFe9Y+Eb+izy3ceclUl43aFN52DXXssYpnY6a4qFS8ZcP2uIf+e7inRh6pdFrdTGrm8uiHx/L8T2V7NGWzvJBLJ/bl7mTuzO5qBNFDoiJID/IF/KHfCK/yDfyT3O7d/KbfNfS80hNIrU0g9L6HOq1x5iTQo6FNpeLfCQ/yVfyl3xmXYwxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHNk9z4JwJ0SqKTdQkbyEwhU393T6V7zzR6pieR3tE1ITeVXImhe6BXDGZFdRbVeank2TBhcaEMr0rwbixj49IBLL2/L/ffmMuNHfqO9tFZjJYBd1ewO3Lx+IcVfKhqna5nHZYR6XFPH+5R3eeI5t9fx/fvjeC9Jdew5OKZKqFR/RDVKL6vL/f9PJafmyvHsL+a/ff24V6NmjZQbGchVbY6UM2BluqHv1rCqzVZ1KQlkZboepCdQvacPsz5bjTfXao+yMEaDt7Wk9tSIMVGig3TejCtJSM2bSpkPjWPqd1S6Zao+lORSYWmgkOjORRNwZqd5ezMSiHLRooNr5XwWjS6/1XHX9vL2T67N7M1iyXa9JCrYjVrS1gbpJyw6hBfsmiNCYT0P9/A+Wj1/6qGr5YNYFlJBiWJogEzezLz/ZG8/9s4fgtSyuvNYbyp1IONFBtu7sHNv4/j9yAxUHWrdaWsG9+N8XHd+YxkMpSy+aySz841cC5oXbmHCnnI74yxAgZ3YbDeB4PEQCOpBpFNZWwa2ZWRcdnxLsl00crtRB0n2lLg8JNRfDKoM4NsolgBSmw/UMADba1+qpmqfyf6x1u/0a/og3I+aEunP6/i86osqmygcGarF4p54dex/Bo0LqfqOfVwIQ/HW5/RSkwV1oN2WLlHTc82TljAwM4M1O5LWwYKZTjibYXNS0N5KcjKTe10PadfLObFuJwK4ozp+UzXDBTUjL+M5ZcBnRkQV53dMIwNQTu6bSTbVEzbi5awuVByd2E/FgaN0Tc1fKOzBHHV2aAdVSdv6s5NNkp7cSH/++xAng2yyHx+CM/H21YhfdPp+0U1X0TbSZnXx8faG9Aop0MS0cToh1p+iLcpOkLj9t/JOk5eqoPHxnDsyf486an5yqCDK7XZ1O4oZ4dWyy3FSXHUAYq47uyYbMZoGmhpG3DlEFb6uNiVBhpyaHhnBO8oJmfqOROJjzIiP43hJ8UxITqqX56S2Hur2KsOnq3nrE6PPNKPRwrSKbAZrjTQNZmuE7oxYXMZmxWbw9dxWFu4W4ezVedOE6qzI7oyYkY+M7TPeWsPbk2UX1qioSN+E3OZqOR2cReKE+qQRFN0Pi7y73g/UawU1KzezJpXwLz5hczX1ueUPKYkNb6GJQZ+j7/aAfRZREsv+quGsMoamXZBW2Gt5eU0alorEzYsKmJRa/m4NdeyxlqZsCGa84DKnVorEzboC7podis69DfIJmwufHMc7famvvmxZiYsKOtKWbRm1OcW1syEBboSJFozLh/EcmtmwgIluaM14/phrLdmJixYXMTiaM24p5I91syEBTphFOR7Y2tmwgJNvUFOr+tov3UzoaAv44KYUatv62ZCoemdhtG0+hzqrZsJBR08DWLG0gxKrZu50qvpxos3U5NItW4mFPp1ot+lPlpq2lYXs9qamVBZUMiC1ox4pJYjvlfStAu6GmTLcLboMtPIV4/6im5fFfuUi9QIap2MiWP+D96R1vPmsD/fAAAAAElFTkSuQmCC",Es="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKUAAABsCAYAAAALzHKmAAAQ7klEQVR42u3da4xdVRUA4D0zd2Y6nZY59DVtZ1puS9+lzC0YAi2UQ8AAQczFpPgA9VIeIQbirRqJ0cBUBVGjDr/QCKSNRSMmpuODxAdxqhgwxkhFjf6Sxh/+UUNVNGJCzR7uTvas7LXX2q9zzp3em6y0gTN3Zu75utZe5+yztxC9V+/Ve5X9En1Vjd7J6SFbLNF7naPw+l2jh7YHMBWssqMHtlsRdim4qsLtIawaPiHEQOLoNrA9iIkQDnRrVA1qD2LZ8ISoxYqKo13sQAtBWBayQWZUAXGRQM9JjCngDVY0UqJNDbQrMcaGmArdUKpIjbYiQLsCZCyIMQBy8QwnilR4Q5AuCpxFYvRFmBLbEiwKwpsSaWycVQGZBKMrwBjA9BhxDe57u2L2hOoKNCbOrgAZitEVYUxoKSMErQvSxYIzCkguRg5EF4AUhqUlhy/YUKSxcRaKsioYOQhD4I0yYxkR3PcJBcuFysmgsXAWBTMJyBCMIQh9kGGxXIXvexCQXbHGAMrBWTbM2CCpMSMLIxehC77lSJwXGth7M0FzoVJIXXDWQnGmhOkL0ic7YhhtWdGGkAuPAjUWGoF4faCmwBkbZmyUqUCyMqMLRA4+E6IsdTjidUHKBYrh9CnpRcH0ypKxsyOGEYNIIeTCOz91OIJ1QYoB5eAMyZo+MFNnyVTZ0YiRC9EGEMOyAgshxErHsL2XK1gOUgwohtM1a5YNM7Rsu4K0ZkcbRm4mpPBRwFZ5hg9eCqkrUB+csWGGogzNkqEgrdnRhpGLkINudaLgwvVB6oqzCjCTZElb2Y4B0gUjBtEG0ARnDRLjjoG9DwcshtQGlIPTljVjwUySLWNkyRCQVHa0ZUUTRAwgF91a33BEy0VKAcVwwqwZC2bqbOlUurllOxQkJzNyINoAYqjWhYYjWg5SCiiG05Q1U8FMjTIoS8YE6YORi1BHtJ4KIcQEEtTXUWAxpK44YVlPBdO1jCdFWTZIE8bVGEYMIRPcZGBw4HKQcoBiOE1ZMzbMgVQwU6JMAdKEEcuIJogUvg1YCCE2gsCO42DlIIVAKZwpYJaSLVNnSU6XjYHUmxhTmXaFaMO3EYkLqMC+FsLlIoVAKZzMrEnBhJeLfLNlKMrYWRIDCbOkFSSVHbHM6AKRC6/ODUewNqQ+OLlZkxpjUmV8MBbMUJSxyzY3Q1IgTRgxiBRCHdem0KDAUkBh9sRwwjEnAXMMgTnKhFlUtiwkS5rGka4g9SaGgxFmRC7AzTCEEBcyA36dDSsXqAtOLkysjGMwY5XxVChjZ0kuSCo7YlkRQsQQYtDEFsegsLoCxUp7Kpgps2UslFGzJGccSYHUmxhOZqwzEZqAbfUMCisHKIZzgsCpl3MTzMwTpi1bYp2477gyFKUxS7qWbdjY2EBS2dGE0QQRA7gNCyHEdhjE8RhUDlBT9tzgmjWZMFNlSy+Urk1OzCyJlW0XkK4YOQh1cDtcgwBrQmoDWkdgboBZE8mYsJSHlnFbJ+5bwmOPJ7lZkirbC8aRsMvmgtTHjBhGE0QbwJ2egUE1ITVlUC5OmDVdYNrKuN70xM6WoShjlW4464dbtiFIWK6x7GjESEHUUe0iYncnbMdQSE0Z1ITTNOb0hRmjjLtmS9dmJ2rp1jtuKktyyrb6YLEMCUHq2dGG0QQRQ7f72kzc+cJecerne8Wvv7JNPHPvenEkz8Sh3UtFc92QyGt9Yko/HgOLAIUZlItTz5ouMF3KuE+2jFLCQ1D6lm6fLMkBacuOJowYRBUXyfjuHjF3NhdnsfjvAfH6E9vFt9XxKgikEKgJZyyYalzOLeMu2bLbULI6bh+QGwmQ+rgRlumdGEQAao+K56bEL2woVUwOiev0r8OAUjiJrMmFCbvykGxZRAmPitK1dHM7bohyMsuyi/I8f0+e57fJYIKEZXpXo9E4mOf5XTKyLLvCBLETF8uY2SKepkC+dpX4T02Ivepr4HvZcOZ5fmee54fyPL+DmTUhzAs6n4n8bN5dr9f3YdkSg8nsxG0lPBVKVpNjG0/aGhzfLDmRZdnumZmZp8+c+cdZPV555fSr7Xb7s0jJ3i5Pcue4MxKkPPkvvXTqz/B92u32l0wYOzG1fkhcd/py8Rcbyq/vFM/KY1WA95h/3zzP71bfU6JsNpsfgj+P/FlbrdaDGExYyuXvLz8H+DudODH700ajcSM3W6Yu4alQ1spCOTd38jcKocTZbh9+9NixY99XJ8AEUkcpo9W64yH197m5k7+bnZ19QT+J09NHntQhwji/Jg58qi6++ofLxJ8gSFneVw2Ka4QQDfh1Ok4dZavVmtZ/nrm5k7/Vf55O1tRhboUw5+ZOvqyOl5+R/FyOHj32PYVU/tloNG5IXcKrhJIzngwp3fNjomazea/64BuNxts646f50lWv169utw9/DmtqdJQyZFaSJVuV6nq9fqMEof5/vV6/CYBqgJDlee+yAbF/+4i4ZWqZeNfaIfHWzn+Hx0KcEuU9+s8jv3ej0bhVlXOZydX/k0iRMeb8P0D5e6tj8zy/Xb9UJIc56h/yqVOnXul8lmuZ2bJslKmbHG7XrbpCmCXFRLvdfqQD6jTS3Jiy5I4OykM6ADV+1Eu1DmV6evopBORexzDi1L+X/HnGxsb2w3Hm9PSRJ9QxWPOTZdmlKht2hi+w6dkox5bqffI8fye3hDteGqKaHVsHXihKl0tB+h0cY+lute54AGRKDCW89LNTRynHb7ChUWVVjetOnJh9EYBUyPZeNCoOtsbFQwdXi4/esELcd+tq8cCHJ8UXp+viy9efLz7AgamjlKXc1AA1m83DoIRDlFubzeb96hhZLVTlgJ24gttutx+ONa50bHZKRenaeTs1OfpAfnr6yOOdE7EZdNwmlKocntXLNkA5JTGq47Ds+Lf94lWsyfnXleLfnIwJUN4DOnNYwuUxh2A3Ln9XULrfK8t3J27Tu3BVwiOjXJqoAy8UZej1yclGo3GTLN+gu3w+z/P3YaWbQqk3Ne12e4ZC+c8rxWsYytcPiP9RpZxCqWDKnxOiBNlyAUpOnGsoh4tA2Rm8X9xqtT6md5wyZmYe+0YRKL+1S/wYQ3n8zctBl5SBUv5djivfjMOPduIzcizeiYfr9foVvUwZG+XCuzibZKnSceZ5/v4QlKp8y7ElhnJlTeTP7BI/kllRYfzrfvHqFy4UX1vaL/aVlSmROzwbwdS29T2UcEwZF+V8ozM2lu1VY812u/15akypGh3TmFJesJbHHD167IdUxz3YJy5bNySuX1mbvy55CbMLtzU6tjGlsdFptVqfUMc0Go23F4wy1l2dSnbfvpMwVPe9WWVLDsrOJaF9MFu2Wq1PqmNkGce67xiXhTjdNwdlvV6/BgxfbPfBfVCetxi6b9/rlCup65QzM48dl2OjLMv26CibzeZ96sTIzEFdpwQXz9U1yrtVlpR/Zll2Fec65Y6l4pbbx8XHH9kknvzJlPjlHy8Tp29eKT5ou0aJoIT3w3dBlLDzVpfAJEZ1XOdaJZxnOSlvPMjPzxFljIvng914RwebsjYO7uhMyHu46sOfnf3Oz2TXDW6vvYxdFoIXz3Wc8J5zs9n8iOn2IrxTc2BM3Glqdp7dI553uaOjxrhwcob+MyuUpjs6WZZdon8OcigjPx8V+u+GTWFTSWEx3WYcdJ225jNDSE4q0GHCzlueHOyujn6bUWYgeb9ZZUaQPe+GzQ+Gc8+oOGhC+c1d4gfI16n3XDAhQ7+9qE9l01E2Go132GYKyXE1NiFDTcpoNpv3LOYJGWXNErJNW9sEp63p2RKiVPMn1bS1DgxsyhoGdGpmizj+xtXiDYnx7/vFmce3iWdW1cTVGEY4hQ2ZW0nNq8Qm/M6XbXm3S100lwGedFybuvNOibLI+ZS2ceU4eAxiEuvCkfmU8ycToDxETe6FgCBQHeqyAbFvfEhcO7BwDuXFCEbTZF840XeHK0jYcbs2OIGle0mVJ/mmnClEPQqxyTY5I8/zFhif7fSZee4bnrPOU4AssnRXHaVTCTd14dRDY3UbTIiSeFhsN/aMjgnqthFx880rxX3yATL5p3y4LPXzOaBkUyBjZMlYpbtQlIOBD475ZEusjMNSvkXe6VEoJVDkeZ2dzIfIFsRzU+JF2OyM9M9fTC/6SUYOyFQPjQ2nWiUjxnPfw5EeHqMWIqAeIFsAU847lJM2JM6xsewt1OIDLs99P7ZFHNdB/upS8XtPiD7PfLuCXJNolYyyFiNI/Zit65ItrOVafFbHcFohY7hPTN21Tjz4uc3iqfsnxKdX1MTl1OoYRFaMsToGB6Trw2JFP/OdZC2hJZ7ZkrMoAbbSGmelDJ91hFKuJeS7jlBMkJnrAqqJlgMUZS/dArPlGHNdSg5M3xXXtvquuEatvIYtDRhpxbUJuIgqsU5lGWtUploK0KuEU9mSW8YpmFQ556xNuYW7NiW13B+FkMiKHIy+C6eGgBxJvMR0oSv5hi6+z4HJyZoU0M2RVvDlrOQbcxVfX5AhZbuqy0v7ZstYMLHlAVlLTF9ALLbvu9Y5Zylpn/XOsd0ibIvxr2KCLHpp6SCUIdnSZSF+WzfOhem6GD+1KwR3Z4jNjrtDpNoZwmWd8yrupZN6Hx3fbMmFSe0Swdq2ZIPjxk1112Duo8OBGLrBkw/IoncdK2XHsdC9dHz204m50xh3tzFq1zFqtzHXrfCw7OgDsqyNnZLszVijsmXgrmNcmGtS78lIoMX2aJz03fKO2sDJddPQSCDPiQ1DfWBycY6XtXstc2PQKuxgG2McmXTPb9/9vmuJYXKyJrWjbeg+3xPM4O73nWqvbyw7xgZZSJbEUBa157cNJjdr2vb+5iA1YV3HxYscj30PDCEHIgcjtfm8K8hSsmRotkwFk5s1TTghUAopB6xrjHMBBkI0YYTZ0dZlxwLpkiWDULpmy5gwqayZgZNkA7oKQQCxctByYg0XIIEQQuRitGVHblMTA2ShKGPDpC6wu+DEgJqg2rDGDBtAF4Q6RAojp1xXGmSMbImVcR+YWNY04eQCtUG1ofUJ2/uvcETIgUhhdAE5GAlkKShjwHTNmhhODKgJqQ2sC14uOgyfD0IbRF+MlQaZAiZWyn2yJsTJATqGnHQO2Jhh+xlsACFCG0QbRtdyzQFZCZSxYPpmTS7Q5cjJHYNBYIkZpu99HoUQ/o4QIYSIZUZfjJ4ZMjZI32wZBDMU5yhy8pZTULl4XYP5fagMyEVoy4oupTpGduwnkloSlKEwY+AcQU4MhRTD6ovXBRwFzwWgCSEF0QVjJUGmgEllTS5OLlCIlIN1mS9mx/cZ5eLDALpCTI2RAhkTZQqYoTgpoCPECbaBHQ2ETL3PUl98ECAXYijG0OyYAmQoTG7W5ODkAF1CnVgm2JQx4okPA+gCMTbGskBGgRmaOblAh5GTORIrfKFx4VH4EIAxIXIxlg2SBbMvECY3e7oApbDaIgQu5/2HmeEKEINYiwSRi7EQkLFgumZOCuggctKGI4ULZN/vMeSLj0AYMytWEqMLzFg4fYDaoKaC6wvOFR4FkIPQFaILxrJAOsHsc/zlfYDWXE8qF22s8Pz5KHxcgEVALBtjJXBSSEOwFhk1Zgy4hitCT4hVw+gFs8/zwxqIBbUgyK7fcyA0PD9XX4iVxhiC0xdof6STWCsoBmKF7+cVCWFXQYyBMxRpf+STX1b0x45AhN0OMSrOGEirhrY/dfQAdjvS7oy+WCF6r1RIFxXWvlTRg1YVqFWBmxZbD99ig9pt0YPQw9rD1nstVri9V+/Ve3XrS/wfim4P5fIFxLoAAAAASUVORK5CYII=",Ss=class{constructor(t,e){this.time=new y,e.pathPrefix||(e.pathPrefix=""),e.app||(e.app={loadAssets:()=>{},initialize:()=>{},update:()=>{},render:()=>{},error:()=>{}}),e.webglConfig&&(e.webglConfig={alpha:!0}),this.htmlCanvas=t,this.context=new yi(t,e.webglConfig),this.renderer=new vs(t,this.context),this.gl=this.context.gl,this.assetManager=new Ei(this.context,e.pathPrefix),this.input=new qi(t),e.app.loadAssets&&e.app.loadAssets(this);let i=()=>{requestAnimationFrame(i),this.time.update(),e.app.update&&e.app.update(this,this.time.delta),e.app.render&&e.app.render(this)},s=()=>{this.assetManager.isLoadingComplete()?this.assetManager.hasErrors()?e.app.error&&e.app.error(this,this.assetManager.getErrors()):(e.app.initialize&&e.app.initialize(this),i()):requestAnimationFrame(s)};requestAnimationFrame(s)}clear(t,e,i,s){this.gl.clearColor(t,e,i,s),this.gl.clear(this.gl.COLOR_BUFFER_BIT)}};return ps=r,((r,n,a,o)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let h of i(n))s.call(r,h)||h===a||t(r,h,{get:()=>n[h],enumerable:!(o=e(n,h))||o.enumerable});return r})(t({},"__esModule",{value:!0}),ps)})();t.exports=e}).call(window)},3524:(t,e,i)=>{var s=i(7473),r=i(4597),n=i(6732),a=i(2482),o=i(704),h=i(3137),l=i(1192),c=new s({Extends:h,initialize:function(t,e,i,s,n,c,u){var d,f,p,g=[],m=t.cacheManager.custom.spine;if(a(e)){var x=e;for(e=r(x,"key"),f=new o(t,{key:e,url:r(x,"jsonURL"),extension:r(x,"jsonExtension","json"),xhrSettings:r(x,"jsonXhrSettings")}),s=r(x,"atlasURL"),n=r(x,"preMultipliedAlpha"),Array.isArray(s)||(s=[s]),d=0;d{var s=i(2494),r=i(7473),n=i(5851),a=i(3527),o=i(5722),h={canvas:i(6937),webgl:i(6937)},l=i(3524),c=i(8332),u=i(5782),d=i(1984),f=new r({Extends:o,initialize:function(t,e,i){o.call(this,t,e,i);var r=e.game;this.isWebGL=2===r.config.renderType,this.cache=r.cache.addCustom("spine"),this.spineTextures=r.cache.addCustom("spineTextures"),this.json=r.cache.json,this.textures=r.textures,this.drawDebug=!1,this.gl,this.renderer,this.sceneRenderer,this.skeletonRenderer,this.skeletonDebugRenderer,this.plugin=h,this.temp1,this.temp2,this.isWebGL?(this.runtime=h.webgl,this.renderer=r.renderer,this.gl=r.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=r.renderer,this.getAtlas=this.getAtlasCanvas),this.renderer||(this.renderer={width:r.scale.width,height:r.scale.height,preRender:d,postRender:d,render:d,destroy:d});e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",(function(t,e,s,r,n){var a=this.scene.sys[i],o=new c(this.scene,a,t,e,s,r,n);return this.displayList.add(o),this.updateList.add(o),o}),(function(t,e){void 0===t&&(t={});var r=n(t,"key",null),a=n(t,"animationName",null),o=n(t,"loop",!1),h=this.scene.sys[i],l=new c(this.scene,h,0,0,r,a,o);void 0!==e&&(t.add=e),s(this.scene,l,t);var u=n(t,"skinName",!1);u&&l.setSkinByName(u);var d=n(t,"slotName",!1),f=n(t,"attachmentName",null);return d&&l.setAttachment(d,f),l.refresh()})),e.registerGameObject("spineContainer",(function(t,e,s){var r=this.scene.sys[i],n=new u(this.scene,r,t,e,s);return this.displayList.add(n),n}),(function(t,e){void 0===t&&(t={});var r=n(t,"x",0),a=n(t,"y",0),o=n(t,"children",null),h=this.scene.sys[i],l=new u(this.scene,h,r,a,o);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(a,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this),this.game.events.once("destroy",this.gameDestroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){var t=this.renderer.spineSceneRenderer;t||(t=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0),this.renderer.spineSceneRenderer=t),this.sceneRenderer=t,this.skeletonRenderer=t.skeletonRenderer,this.skeletonDebugRenderer=t.skeletonDebugRenderer,this.temp1=new h.webgl.Vector3(0,0,0),this.temp2=new h.webgl.Vector3(0,0,0)},getAtlasCanvas:function(t){var e=this.cache.get(t);if(e){var i,s=this.spineTextures;if(s.has(t))i=s.get(t);else{var r=this.textures;i=new this.runtime.TextureAtlas(e.data,(function(t){return new h.canvas.CanvasTexture(r.get(e.prefix+t).getSourceImage())}))}return i}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var i,s=this.spineTextures;if(s.has(t))i=s.get(t);else{var r=this.textures,n=this.sceneRenderer.context.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i=new this.runtime.TextureAtlas(e.data,(function(t){return new h.webgl.GLTexture(n,r.get(e.prefix+t).getSourceImage(),!1)}))}return i}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,i,s,r,n,a){var o;if(a=a||{},Array.isArray(t))for(var h=0;h{var s=i(7473),r=i(7361),n=i(7738),a=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n){r.call(this,t,i,s,n),this.type="Spine",this.plugin=e},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null,this.plugin=null}});t.exports=a},7738:(t,e,i)=>{var s=i(1984),r=i(1984);s=i(434),t.exports={renderWebGL:s,renderCanvas:r}},434:t=>{t.exports=function(t,e,i,s){var r=e.plugin.sceneRenderer,n=e.list;if(0!==n.length){i.addToRenderList(e);var a=e.localTransform;s?(a.loadIdentity(),a.multiply(s),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.newType&&(t.pipelines.clear(),r.begin());var o=t.nextTypeMatch;t.nextTypeMatch=!0,t.newType=!1;for(var h=0;h{t.exports="complete"},8621:t=>{t.exports="dispose"},8944:t=>{t.exports="end"},7494:t=>{t.exports="event"},1908:t=>{t.exports="interrupted"},5591:t=>{t.exports="start"},5146:(t,e,i)=>{t.exports={COMPLETE:i(6576),DISPOSE:i(8621),END:i(8944),EVENT:i(7494),INTERRUPTED:i(1908),START:i(5591)}},8332:(t,e,i)=>{var s=i(6412),r=i(2915),n=i(7473),a=i(1991),o=i(3131),h=i(9660),l=i(4627),c=i(3212),u=i(8414),d=i(3426),f=i(7149),p=i(2273),g=i(4208),m=i(5146),x=i(2762),v=new n({Extends:p,Mixins:[a,o,h,l,c,u,x],initialize:function(t,e,i,s,r,n,a){p.call(this,t,"Spine"),this.plugin=e,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null,this.root=null,this.bounds=null,this.drawDebug=!1,this.timeScale=1,this.displayOriginX=0,this.displayOriginY=0,this.preMultipliedAlpha=!1,this.blendMode=-1,this.setPosition(i,s),r&&this.setSkeleton(r,n,a)},willRender:function(t,e){var i=!this.skeleton||!(15!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id);if(!e&&!i&&this.parentContainer){var s=this.plugin,r=s.sceneRenderer;s.gl&&r.batcher.isDrawing&&(r.end(),s.renderer.pipelines.rebind())}return i},setAlpha:function(t,e){if(void 0===t&&(t=1),e){var i=this.findSlot(e);i&&(i.color.a=r(t,0,1))}else this.alpha=t;return this},alpha:{get:function(){return this.skeleton.color.a},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.a=e),0===e?this.renderFlags&=-3:this.renderFlags|=2}},red:{get:function(){return this.skeleton.color.r},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.r=e)}},green:{get:function(){return this.skeleton.color.g},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.g=e)}},blue:{get:function(){return this.skeleton.color.b},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.b=e)}},setColor:function(t,e){void 0===t&&(t=16777215);var i=(t>>16&255)/255,s=(t>>8&255)/255,r=(255&t)/255,n=t>16777215?(t>>>24)/255:null,a=this.skeleton;if(e){var o=this.findSlot(e);o&&(a=o)}return a.color.r=i,a.color.g=s,a.color.b=r,null!==n&&(a.color.a=n),this},setSkeletonFromJSON:function(t,e,i,s){return this.setSkeleton(t,e,i,s)},setSkeleton:function(t,e,i,s){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,s);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var n=r.skeleton;return n.setSkin(),n.setToSetupPose(),this.skeleton=n,r=this.plugin.createAnimationState(n),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=g(d(this.rotation))+90),this.state.apply(n),n.updateCache(),this.updateSize()},onComplete:function(t){this.emit(m.COMPLETE,t)},onDispose:function(t){this.emit(m.DISPOSE,t)},onEnd:function(t){this.emit(m.END,t)},onEvent:function(t,e){this.emit(m.EVENT,t,e)},onInterrupted:function(t){this.emit(m.INTERRUPTED,t)},onStart:function(t){this.emit(m.START,t)},refresh:function(){return this.root&&(this.root.rotation=g(d(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,s){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===i&&(i=0),void 0===s&&(s=0),this.width=t,this.height=e,this.displayOriginX=r.x-i,this.displayOriginY=r.y-s,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,s=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=i,t.scaleY=s,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i{var s=i(1984),r=i(1984),n=i(1984);s=i(4290),n=i(780),t.exports={renderWebGL:s,renderCanvas:r,renderDirect:n}},780:(t,e,i)=>{var s=i(2915),r=i(3426),n=i(2208),a=i(4208),o=i(8445);t.exports=function(t,e,i,h,l){var c=e.plugin,u=e.skeleton,d=c.sceneRenderer;t.pipelines.clear(),d.begin();var f=e.scrollFactorX,p=e.scrollFactorY,g=u.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,u.color.a=s(g*l.alpha,0,1)),i.addToRenderList(e);var m=n(e,i,h).calc,x=t.height;if(u.x=m.tx,u.y=x-m.ty,u.scaleX=m.scaleX,u.scaleY=m.scaleY,e.scaleX<0?(u.scaleX*=-1,e.root.rotation=o(a(m.rotationNormalized)-180,0,360)):e.root.rotation=o(a(r(m.rotationNormalized))+90,0,360),e.scaleY<0&&(u.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(m.rotationNormalized):e.root.rotation+=2*a(m.rotationNormalized)),u.updateWorldTransform(),d.drawSkeleton(u,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,u.color.a=g),c.drawDebug||e.drawDebug){var v=u.x,y=u.y;u.x=0,u.y=0,d.drawSkeletonDebug(u,e.preMultipliedAlpha),u.x=v,u.y=y}d.end(),t.pipelines.rebind()}},4290:(t,e,i)=>{var s=i(2915),r=i(3426),n=i(2208),a=i(4208),o=i(8445);t.exports=function(t,e,i,h,l){var c=e.plugin,u=e.skeleton,d=c.sceneRenderer;t.newType&&(t.pipelines.clear(),d.begin());var f=e.scrollFactorX,p=e.scrollFactorY,g=u.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,u.color.a=s(g*l.alpha,0,1)),i.addToRenderList(e);var m=n(e,i,h).calc,x=t.height;if(u.x=m.tx,u.y=x-m.ty,u.scaleX=m.scaleX,u.scaleY=m.scaleY,e.scaleX<0?(u.scaleX*=-1,e.root.rotation=o(a(m.rotationNormalized)-180,0,360)):e.root.rotation=o(a(r(m.rotationNormalized))+90,0,360),e.scaleY<0&&(u.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(m.rotationNormalized):e.root.rotation+=2*a(m.rotationNormalized)),u.updateWorldTransform(),d.drawSkeleton(u,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,u.color.a=g),c.drawDebug||e.drawDebug){var v=u.x,y=u.y;u.x=0,u.y=0,d.drawSkeletonDebug(u,e.preMultipliedAlpha),u.x=v,u.y=y}t.nextTypeMatch||(d.end(),t.pipelines.rebind())}},9454:(t,e,i)=>{var s={VERSION:"3.60.0",BlendModes:i(8351),ScaleModes:i(8196),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},1081:(t,e,i)=>{var s=i(7473),r=i(6748),n=new s({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(r.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],s=0;s{t.exports="changedata"},7801:t=>{t.exports="changedata-"},4873:t=>{t.exports="destroy"},9966:t=>{t.exports="removedata"},4586:t=>{t.exports="setdata"},6748:(t,e,i)=>{t.exports={CHANGE_DATA:i(9044),CHANGE_DATA_KEY:i(7801),DESTROY:i(4873),REMOVE_DATA:i(9966),SET_DATA:i(4586)}},3004:(t,e,i)=>{var s=i(2776),r={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return r;r.audioData=!!window.Audio,r.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var s=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(s||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(s)};if(r.ogg=i('ogg; codecs="vorbis"'),r.opus=i('ogg; codecs="opus"',"opus"),r.mp3=i("mpeg"),r.wav=i("wav"),r.m4a=i("x-m4a"),r.aac=i("aac"),r.flac=i("flac","x-flac"),r.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(s.edge)r.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var n=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===n&&a>=11||n>10)&&(r.dolby=!0)}}}catch(t){}return r}()},2776:(t,e,i)=>{var s,r=i(5203),n={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(s=navigator.userAgent,/Edg\/\d+/.test(s)?(n.edge=!0,n.es2019=!0):/OPR/.test(s)?(n.opera=!0,n.es2019=!0):/Chrome\/(\d+)/.test(s)&&!r.windowsPhone?(n.chrome=!0,n.chromeVersion=parseInt(RegExp.$1,10),n.es2019=n.chromeVersion>69):/Firefox\D+(\d+)/.test(s)?(n.firefox=!0,n.firefoxVersion=parseInt(RegExp.$1,10),n.es2019=n.firefoxVersion>10):/AppleWebKit/.test(s)&&r.iOS?n.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(s)?(n.ie=!0,n.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+) Safari/.test(s)&&!r.windowsPhone?(n.safari=!0,n.safariVersion=parseInt(RegExp.$1,10),n.es2019=n.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(n.ie=!0,n.trident=!0,n.tridentVersion=parseInt(RegExp.$1,10),n.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(n.silk=!0),n)},6505:(t,e,i)=>{var s,r,n,a=i(8073),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",r="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(n=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(n,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+r},n.src=s+"AP804Oa6"+r,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),s=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),s}()),o)},6543:(t,e,i)=>{var s=i(5203),r=i(2776),n=i(8073),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=n.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=n.create2D(this),s=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=s.data instanceof Uint8ClampedArray,n.remove(t),n.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!s.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},3922:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",s="FullScreen",r=["request"+i,"request"+s,"webkitRequest"+i,"webkitRequest"+s,"msRequest"+i,"msRequest"+s,"mozRequest"+s,"mozRequest"+i];for(t=0;t{var s=i(2776),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},5203:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},2131:(t,e,i)=>{var s=i(4597),r={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return r;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(r.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(r.h264=!0,r.mp4=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(r.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(r.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(r.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(r.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),r.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e{t.exports={os:i(5203),browser:i(2776),features:i(6543),input:i(1454),audio:i(3004),video:i(2131),fullscreen:i(3922),canvasFeatures:i(6505)}},5686:(t,e,i)=>{var s=i(7473),r=new Float32Array(20),n=new s({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(t){return this._matrix.set(t),this._dirty=!0,this},reset:function(){var t=this._matrix;return t.fill(0),t[0]=1,t[6]=1,t[12]=1,t[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var t=this._data;return this._dirty&&(t.set(this._matrix),t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._dirty=!1),t},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,s=-.5*(i-1);return this.multiply([i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),s=Math.sin(t),r=.213,n=.715,a=.072;return this.multiply([r+.787*i+s*-r,n+i*-n+s*-n,a+i*-a+.928*s,0,0,r+i*-r+.143*s,n+i*(1-n)+.14*s,a+i*-a+-.283*s,0,0,r+i*-r+-.787*s,n+i*-n+s*n,a+.928*i+s*a,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply(n.BLACK_WHITE,t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,s=-.5*(i-1);return this.multiply([i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply(n.NEGATIVE,t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply(n.DESATURATE_LUMINANCE,t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply(n.SEPIA,t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply(n.LSD,t)},brown:function(t){return void 0===t&&(t=!1),this.multiply(n.BROWN,t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply(n.VINTAGE,t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply(n.KODACHROME,t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply(n.TECHNICOLOR,t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply(n.POLAROID,t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply(n.SHIFT_BGR,t)},multiply:function(t,e){void 0===e&&(e=!1),e||this.reset();var i=this._matrix,s=r;return s.set(i),i.set([s[0]*t[0]+s[1]*t[5]+s[2]*t[10]+s[3]*t[15],s[0]*t[1]+s[1]*t[6]+s[2]*t[11]+s[3]*t[16],s[0]*t[2]+s[1]*t[7]+s[2]*t[12]+s[3]*t[17],s[0]*t[3]+s[1]*t[8]+s[2]*t[13]+s[3]*t[18],s[0]*t[4]+s[1]*t[9]+s[2]*t[14]+s[3]*t[19]+s[4],s[5]*t[0]+s[6]*t[5]+s[7]*t[10]+s[8]*t[15],s[5]*t[1]+s[6]*t[6]+s[7]*t[11]+s[8]*t[16],s[5]*t[2]+s[6]*t[7]+s[7]*t[12]+s[8]*t[17],s[5]*t[3]+s[6]*t[8]+s[7]*t[13]+s[8]*t[18],s[5]*t[4]+s[6]*t[9]+s[7]*t[14]+s[8]*t[19]+s[9],s[10]*t[0]+s[11]*t[5]+s[12]*t[10]+s[13]*t[15],s[10]*t[1]+s[11]*t[6]+s[12]*t[11]+s[13]*t[16],s[10]*t[2]+s[11]*t[7]+s[12]*t[12]+s[13]*t[17],s[10]*t[3]+s[11]*t[8]+s[12]*t[13]+s[13]*t[18],s[10]*t[4]+s[11]*t[9]+s[12]*t[14]+s[13]*t[19]+s[14],s[15]*t[0]+s[16]*t[5]+s[17]*t[10]+s[18]*t[15],s[15]*t[1]+s[16]*t[6]+s[17]*t[11]+s[18]*t[16],s[15]*t[2]+s[16]*t[7]+s[17]*t[12]+s[18]*t[17],s[15]*t[3]+s[16]*t[8]+s[17]*t[13]+s[18]*t[18],s[15]*t[4]+s[16]*t[9]+s[17]*t[14]+s[18]*t[19]+s[19]]),this._dirty=!0,this}});n.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],n.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],n.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],n.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],n.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],n.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],n.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],n.KODACHROME=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],n.TECHNICOLOR=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],n.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],n.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t.exports=n},8073:(t,e,i)=>{var s,r,n,a=i(9454),o=i(2150),h=[],l=!1;t.exports=(n=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return s(t,e,i,a.CANVAS)},create:s=function(t,e,i,s,n){var c;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=a.CANVAS),void 0===n&&(n=!1);var u=r(s);return null===u?(u={parent:t,canvas:document.createElement("canvas"),type:s},s===a.CANVAS&&h.push(u),c=u.canvas):(u.parent=t,c=u.canvas),n&&(u.parent=c),c.width=e,c.height=i,l&&s===a.CANVAS&&o.disable(c.getContext("2d",{willReadFrequently:!1})),c},createWebGL:function(t,e,i){return s(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:r=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{var s=i(7473),r=i(3649),n=new s({initialize:function(t,e,i,s,r,n){e||(e=t.sys.make.image({x:i,y:s,key:r,frame:n,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});r.register("bitmapMask",(function(t,e,i,s,r){return new n(this.scene,t,e,i,s,r)})),t.exports=n},6726:(t,e,i)=>{var s=new(i(7473))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,r=this.geometryMask,n=t.maskCount,a=255;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,n,a),s.stencilOp(s.KEEP,s.KEEP,s.INCR),n++):(s.stencilFunc(s.EQUAL,n+1,a),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),this.level=n,r.renderWebGL(t,r,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),this.invertAlpha?s.stencilFunc(s.NOTEQUAL,n,a):s.stencilFunc(s.EQUAL,n,a)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},7340:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,n.BARREL,t),this.amount=e}});t.exports=a},5170:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h){void 0===i&&(i=1),void 0===s&&(s=1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=4),r.call(this,n.BLOOM,t),this.steps=h,this.offsetX=i,this.offsetY=s,this.blurStrength=a,this.strength=o,this.glcolor=[1,1,1],null!=e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4199:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h){void 0===e&&(e=0),void 0===i&&(i=2),void 0===s&&(s=2),void 0===a&&(a=1),void 0===h&&(h=4),r.call(this,n.BLUR,t),this.quality=0,this.x=i,this.y=s,this.steps=h,this.strength=a,this.glcolor=[1,1,1],null!=o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},3132:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h,l){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===s&&(s=.2),void 0===a&&(a=!1),void 0===o&&(o=1),void 0===h&&(h=1),void 0===l&&(l=1),r.call(this,n.BOKEH,t),this.radius=e,this.amount=i,this.contrast=s,this.isTiltShift=a,this.strength=l,this.blurX=o,this.blurY=h}});t.exports=a},6610:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o){void 0===e&&(e=8),void 0===a&&(a=1),void 0===o&&(o=.005),r.call(this,n.CIRCLE,t),this.scale=a,this.feather=o,this.thickness=e,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],null!=i&&(this.color=i),null!=s&&(this.backgroundColor=s)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundColor:{get:function(){var t=this.glcolor2;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor2;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},4931:(t,e,i)=>{var s=i(7473),r=i(5686),n=i(1571),a=new s({Extends:r,initialize:function(t){r.call(this),this.type=n.COLOR_MATRIX,this.gameObject=t,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});t.exports=a},6128:(t,e,i)=>{var s=new(i(7473))({initialize:function(t,e){this.type=t,this.gameObject=e,this.active=!0},setActive:function(t){return this.active=t,this},destroy:function(){this.gameObject=null,this.active=!1}});t.exports=s},9195:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===s&&(s=.005),r.call(this,n.DISPLACEMENT,t),this.x=i,this.y=s,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.gameObject.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=a},445:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a){void 0===i&&(i=4),void 0===s&&(s=0),void 0===a&&(a=!1),r.call(this,n.GLOW,t),this.outerStrength=i,this.innerStrength=s,this.knockout=a,this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},7724:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h,l,c){void 0===s&&(s=.2),void 0===a&&(a=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l=1),void 0===c&&(c=0),r.call(this,n.GRADIENT,t),this.alpha=s,this.size=c,this.fromX=a,this.fromY=o,this.toX=h,this.toY=l,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],null!=e&&(this.color1=e),null!=i&&(this.color2=i)},color1:{get:function(){var t=this.glcolor1;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor1;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}},color2:{get:function(){var t=this.glcolor2;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor2;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}}});t.exports=a},4412:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,n.PIXELATE,t),this.amount=e}});t.exports=a},75:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.1),void 0===a&&(a=1),void 0===h&&(h=6),void 0===l&&(l=1),r.call(this,n.SHADOW,t),this.x=e,this.y=i,this.decay=s,this.power=a,this.glcolor=[0,0,0,1],this.samples=h,this.intensity=l,void 0!==o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},8734:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===s&&(s=3),void 0===a&&(a=!1),r.call(this,n.SHINE,t),this.speed=e,this.lineWidth=i,this.gradient=s,this.reveal=a}});t.exports=a},2437:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===s&&(s=.5),void 0===a&&(a=.5),r.call(this,n.VIGNETTE,t),this.x=e,this.y=i,this.radius=s,this.strength=a}});t.exports=a},5984:(t,e,i)=>{var s=i(7473),r=i(6128),n=i(1571),a=new s({Extends:r,initialize:function(t,e,i,s,a){void 0===e&&(e=.1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===a&&(a=!1),r.call(this,n.WIPE,t),this.progress=0,this.wipeWidth=e,this.direction=i,this.axis=s,this.reveal=a}});t.exports=a},1571:t=>{t.exports={GLOW:4,SHADOW:5,PIXELATE:6,VIGNETTE:7,SHINE:8,BLUR:9,GRADIENT:12,BLOOM:13,COLOR_MATRIX:14,CIRCLE:15,BARREL:16,DISPLACEMENT:17,WIPE:18,BOKEH:19}},7347:(t,e,i)=>{var s=i(1030),r=i(1571),n={Barrel:i(7340),Controller:i(6128),Bloom:i(5170),Blur:i(4199),Bokeh:i(3132),Circle:i(6610),ColorMatrix:i(4931),Displacement:i(9195),Glow:i(445),Gradient:i(7724),Pixelate:i(4412),Shadow:i(75),Shine:i(8734),Vignette:i(2437),Wipe:i(5984)};n=s(!1,n,r),t.exports=n},2494:(t,e,i)=>{var s=i(8351),r=i(8361);t.exports=function(t,e,i){e.x=r(i,"x",0),e.y=r(i,"y",0),e.depth=r(i,"depth",0),e.flipX=r(i,"flipX",!1),e.flipY=r(i,"flipY",!1);var n=r(i,"scale",null);"number"==typeof n?e.setScale(n):null!==n&&(e.scaleX=r(n,"x",1),e.scaleY=r(n,"y",1));var a=r(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=r(a,"x",1),e.scrollFactorY=r(a,"y",1)),e.rotation=r(i,"rotation",0);var o=r(i,"angle",null);null!==o&&(e.angle=o),e.alpha=r(i,"alpha",1);var h=r(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),c=r(h,"y",.5);e.setOrigin(l,c)}return e.blendMode=r(i,"blendMode",s.NORMAL),e.visible=r(i,"visible",!0),r(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},2273:(t,e,i)=>{var s=i(7473),r=i(6125),n=i(1081),a=i(4399),o=i(3389),h=i(204),l=new s({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new n(this)),this},setData:function(t,e){return this.data||(this.data=new n(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new n(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new n(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new n(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.preFX&&(this.preFX.destroy(),this.preFX=void 0),this.postFX&&(this.postFX.destroy(),this.postFX=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},3649:(t,e,i)=>{var s=i(7473),r=i(8456),n=i(204),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectFactory",a,"add"),t.exports=a},2208:(t,e,i)=>{var s=i(4227),r=new s,n=new s,a=new s,o={camera:r,sprite:n,calc:a};t.exports=function(t,e,i){var s=r,h=n,l=a;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),s.multiply(h,l),o}},4344:(t,e,i)=>{var s=i(2915),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,r){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=r},4518:(t,e,i)=>{var s=i(2915),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=r},5173:(t,e,i)=>{var s=i(8351),r={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=r},1991:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},8305:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},3131:t=>{var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},1626:(t,e,i)=>{var s=i(7473),r=i(7347),n=i(8935),a=new s({initialize:function(t,e){this.gameObject=t,this.isPost=e,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(t){return void 0===t&&(t=0),this.padding=t,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(t){if(!this.isPost){var e=this.gameObject.scene.sys.renderer;e&&e.pipelines?(this.gameObject.pipeline=e.pipelines.FX_PIPELINE,void 0!==t&&(this.padding=t),this.enabled=!0):this.enabled=!1}},clear:function(){if(this.isPost)this.gameObject.resetPostPipeline(!0);else{for(var t=this.list,e=0;e{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},3671:(t,e,i)=>{var s=i(1392),r=i(9876),n=i(2529),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&r(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t,e){return void 0===t&&(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getTopLeft:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,r,n,a,o,h,l;if(void 0===t&&(t=new s),this.parentContainer){var c=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),c.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),c.transformPoint(t.x,t.y,t),r=t.x,n=t.y,this.getBottomLeft(t),c.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),c.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),r=t.x,n=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,r,a,h),t.y=Math.min(i,n,o,l),t.width=Math.max(e,r,a,h)-t.x,t.height=Math.max(i,n,o,l)-t.y,t}};t.exports=a},2246:(t,e,i)=>{var s=i(7499),r=i(6726),n={mask:null,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},createBitmapMask:function(t,e,i,r,n){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new s(this.scene,t,e,i,r,n)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new r(this.scene,t)}};t.exports=n},5085:t=>{var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},77:(t,e,i)=>{var s=i(7149),r=i(1864),n=i(5851),a=i(3747),o=i(2529),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=n(t,"from",0),t.to=n(t,"to",1);var h=r(t,"positionOnPath",!1);this.rotateToPath=r(t,"rotateToPath",!1),this.pathRotationOffset=n(t,"rotationOffset",0);var l=n(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var c=this.path.getPoint(.1);this.rotation=Math.atan2(c.y-this.y,c.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,r=this.pathVector;if(i.copy(r).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,r),i.add(r),r.add(this.pathOffset),void this.setPosition(r.x,r.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),r),i.add(r),r.add(this.pathOffset);var n=this.x,o=this.y;this.setPosition(r.x,r.y);var h=this.x-n,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+s(this.pathRotationOffset))}}};t.exports=h},986:(t,e,i)=>{var s=i(3911),r={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(t){this.pipelineData={};var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(i){void 0===t&&(t=i.default);var s=i.get(t);if(s)return this.defaultPipeline=s,this.pipeline=s,!0}return!1},setPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var n=r.pipelines;if(n){var a=n.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?s(e):e)}return this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},resetPipeline:function(t){return void 0===t&&(t=!1),this.pipeline=this.defaultPipeline,t&&(this.pipelineData={}),null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=r},4461:(t,e,i)=>{var s=i(3911),r=i(1626),n=i(8935),a={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(t){this.postPipelines=[],this.postPipelineData={},this.postFX=new r(this,!0),t&&(this.preFX=new r(this,!1))},setPostPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var n=r.pipelines;if(n){Array.isArray(t)||(t=[t]);for(var a=0;a0,this},setPostPipelineData:function(t,e){var i=this.postPipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,s=[],r=0;r=0;s--){var r=i[s];(e&&r.name===t||!e&&r===t)&&(r.destroy(),n(i,s))}return this.hasPostPipeline=this.postPipelines.length>0,this},clearFX:function(){return this.preFX&&this.preFX.clear(),this.postFX&&this.postFX.clear(),this}};t.exports=a},4627:t=>{var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},1868:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},4976:(t,e,i)=>{var s=i(2362),r={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=r},9243:(t,e,i)=>{var s=i(2362),r={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=r},5693:t=>{var e={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,s=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=s,this.tintFill=!1,this},setTintFill:function(t,e,i,s){return this.setTint(t,e,i,s),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=e},6125:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},3212:(t,e,i)=>{var s=i(7425),r=i(4227),n=i(7556),a=i(3692),o=i(2820),h=i(2529),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:0!==this._scaleY&&(this.renderFlags|=4)}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:0!==this._scaleX&&(this.renderFlags|=4)}},angle:{get:function(){return o(this._rotation*s.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.z=i,this.w=s,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*s,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(e||(e=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,s){i||(i=new h),s||(s=this.scene.sys.cameras.main);var r=s.scrollX,a=s.scrollY,o=t+r*this.scrollFactorX-r,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):n(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},4227:(t,e,i)=>{var s=i(7473),r=i(7425),n=i(2529),a=new s({initialize:function(t,e,i,s,r,n){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===r&&(r=0),void 0===n&&(n=0),this.matrix=new Float32Array([t,e,i,s,r,n,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||n?r.TAU-(n>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,r=s[0],n=s[1],a=s[2],o=s[3];return s[0]=r*i+a*e,s[1]=n*i+o*e,s[2]=r*-e+a*i,s[3]=n*-e+o*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,r=i[0],n=i[1],a=i[2],o=i[3],h=i[4],l=i[5],c=s[0],u=s[1],d=s[2],f=s[3],p=s[4],g=s[5],m=void 0===e?i:e.matrix;return m[0]=c*r+u*a,m[1]=c*n+u*o,m[2]=d*r+f*a,m[3]=d*n+f*o,m[4]=p*r+g*a+h,m[5]=p*n+g*o+l,m},multiplyWithOffset:function(t,e,i){var s=this.matrix,r=t.matrix,n=s[0],a=s[1],o=s[2],h=s[3],l=e*n+i*o+s[4],c=e*a+i*h+s[5],u=r[0],d=r[1],f=r[2],p=r[3],g=r[4],m=r[5];return s[0]=u*n+d*o,s[1]=u*a+d*h,s[2]=f*n+p*o,s[3]=f*a+p*h,s[4]=g*n+m*o+l,s[5]=g*a+m*h+c,this},transform:function(t,e,i,s,r,n){var a=this.matrix,o=a[0],h=a[1],l=a[2],c=a[3],u=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*c,a[2]=i*o+s*l,a[3]=i*h+s*c,a[4]=r*o+n*l+u,a[5]=r*h+n*c+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,r=s[0],n=s[1],a=s[2],o=s[3],h=s[4],l=s[5];return i.x=t*r+e*a+h,i.y=t*n+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=e*r-i*s;return t[0]=r/o,t[1]=-i/o,t[2]=-s/o,t[3]=e/o,t[4]=(s*a-r*n)/o,t[5]=-(e*a-i*n)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,r,n){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=s,a[4]=r,a[5]=n,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],r=e[2],n=e[3],a=i*n-s*r;if(t.translateX=e[4],t.translateY=e[5],i||s){var o=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(r||n){var h=Math.sqrt(r*r+n*n);t.rotation=.5*Math.PI-(n>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,r){var n=this.matrix,a=Math.sin(i),o=Math.cos(i);return n[4]=t,n[5]=e,n[0]=o*s,n[1]=a*s,n[2]=-a*r,n[3]=o*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new n);var s=this.matrix,r=s[0],a=s[1],o=s[2],h=s[3],l=s[4],c=s[5],u=1/(r*h+o*-a);return i.x=h*u*t+-o*u*e+(c*o-l*h)*u,i.y=r*u*e+-a*u*t+(-c*r+l*a)*u,i},setQuad:function(t,e,i,s,r,n){void 0===n&&(n=this.quad);var a=this.matrix,o=a[0],h=a[1],l=a[2],c=a[3],u=a[4],d=a[5];return n[0]=t*o+e*l+u,n[1]=t*h+e*c+d,n[2]=t*o+s*l+u,n[3]=t*h+s*c+d,n[4]=i*o+s*l+u,n[5]=i*h+s*c+d,n[6]=i*o+e*l+u,n[7]=i*h+e*c+d,r&&n.forEach((function(t,e){n[e]=Math.round(t)})),n},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.round(s)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.round(s)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},8414:t=>{var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},4286:(t,e,i)=>{t.exports={Alpha:i(4344),AlphaSingle:i(4518),BlendMode:i(5173),ComputedSize:i(1991),Crop:i(8305),Depth:i(3131),Flip:i(9660),FX:i(1626),GetBounds:i(3671),Mask:i(2246),Origin:i(5085),PathFollower:i(77),Pipeline:i(986),PostPipeline:i(4461),ScrollFactor:i(4627),Size:i(1868),Texture:i(4976),TextureCrop:i(9243),Tint:i(5693),ToJSON:i(6125),Transform:i(3212),TransformMatrix:i(4227),Visible:i(8414)}},7361:(t,e,i)=>{var s=i(1953),r=i(8351),n=i(7473),a=i(4286),o=i(3389),h=i(2273),l=i(1392),c=i(3232),u=i(9422),d=i(2529),f=new n({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.PostPipeline,a.Transform,a.Visible,c],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(e,i),this.setBlendMode(r.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,r=!1;t.setEmpty();for(var n=0;n-1},setAll:function(t,e,i,r){return s.SetAll(this.list,t,e,i,r),this},each:function(t,e){var i,s=[null],r=this.list.slice(),n=r.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},3232:(t,e,i)=>{var s=i(1984),r=s,n=s;r=i(4343),t.exports={renderWebGL:r,renderCanvas:n}},4343:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var r=e.list,n=r.length;if(0!==n){var a=e.localTransform;s?(a.loadIdentity(),a.multiply(s),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var o=-1!==e.blendMode;o||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,c=e.scrollFactorY,u=0;u{t.exports="addedtoscene"},4265:t=>{t.exports="destroy"},8671:t=>{t.exports="removedfromscene"},3420:t=>{t.exports="complete"},601:t=>{t.exports="created"},7919:t=>{t.exports="error"},6231:t=>{t.exports="locked"},5241:t=>{t.exports="loop"},8325:t=>{t.exports="playing"},3356:t=>{t.exports="play"},7513:t=>{t.exports="seeked"},5788:t=>{t.exports="seeking"},7111:t=>{t.exports="stalled"},8118:t=>{t.exports="stop"},9184:t=>{t.exports="textureready"},4287:t=>{t.exports="unlocked"},857:t=>{t.exports="unsupported"},3389:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(6608),DESTROY:i(4265),REMOVED_FROM_SCENE:i(8671),VIDEO_COMPLETE:i(3420),VIDEO_CREATED:i(601),VIDEO_ERROR:i(7919),VIDEO_LOCKED:i(6231),VIDEO_LOOP:i(5241),VIDEO_PLAY:i(3356),VIDEO_PLAYING:i(8325),VIDEO_SEEKED:i(7513),VIDEO_SEEKING:i(5788),VIDEO_STALLED:i(7111),VIDEO_STOP:i(8118),VIDEO_TEXTURE:i(9184),VIDEO_UNLOCKED:i(4287),VIDEO_UNSUPPORTED:i(857)}},1643:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},8881:(t,e,i)=>{var s=i(7655);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},4479:(t,e,i)=>{var s=i(4771),r=i(7655);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=s(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,c=0;c{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},284:(t,e,i)=>{var s=i(7473),r=i(8881),n=i(4479),a=i(1643),o=i(3915),h=i(2529),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return n(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},3915:(t,e,i)=>{var s=i(7655);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},7655:(t,e,i)=>{var s=i(7473),r=i(1643),n=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=r.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=n},5956:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},716:(t,e,i)=>{var s=i(7120),r=i(7655);t.exports=function(t,e,i){if(void 0===i&&(i=new r),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var n=s(t)*e;return e>.5?(n-=t.width+t.height)<=t.width?(i.x=t.right-n,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(n-t.width)):n<=t.width?(i.x=t.x+n,i.y=t.y):(i.x=t.right,i.y=t.y+(n-t.width)),i}},8151:(t,e,i)=>{var s=i(716),r=i(7120);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=r(t)/i);for(var a=0;a{t.exports=function(t){return 2*(t.width+t.height)}},2161:(t,e,i)=>{var s=i(7655);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},1392:(t,e,i)=>{var s=i(7473),r=i(5956),n=i(716),a=i(8151),o=i(1643),h=i(284),l=i(2161),c=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=c},9422:(t,e,i)=>{var s=i(1392);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=Math.min(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-r,o=Math.max(t.bottom,e.bottom)-n;return i.setTo(r,n,a,o)}},1593:(t,e,i)=>{var s=i(7473),r=i(4359),n=i(1179),a=i(4597),o=i(5593),h=i(7410),l=i(5874),c=i(707),u=new s({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var s=a(e,"url");void 0===s?s=t.path+i+"."+a(e,"extension",""):"string"!=typeof s||s.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(s=t.path+s),this.url=s,this.src="",this.xhrSettings=c(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===r.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=r.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,s=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(s=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==r.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(n.FILE_COMPLETE,e,i,t),this.loader.emit(n.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=r.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},9845:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},5593:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},7410:(t,e,i)=>{var s=i(1030),r=i(707);t.exports=function(t,e){var i=void 0===t?r():s({},t);if(e)for(var n in e)void 0!==e[n]&&(i[n]=e[n]);return i}},3137:(t,e,i)=>{var s=i(7473),r=i(4359),n=i(1179),a=new s({initialize:function(t,e,i,s){var n=[];s.forEach((function(t){t&&n.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=n,this.state=r.FILE_PENDING,this.complete=!1,this.pending=n.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a{var s=i(7410);t.exports=function(t,e){var i=s(e,t.xhrSettings),r=new XMLHttpRequest;if(r.open("GET",t.src,i.async,i.user,i.password),r.responseType=t.xhrSettings.responseType,r.timeout=i.timeout,i.headers)for(var n in i.headers)r.setRequestHeader(n,i.headers[n]);return i.header&&i.headerValue&&r.setRequestHeader(i.header,i.headerValue),i.requestedWith&&r.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&r.overrideMimeType(i.overrideMimeType),i.withCredentials&&(r.withCredentials=!0),r.onload=t.onLoad.bind(t,r),r.onerror=t.onError.bind(t,r),r.onprogress=t.onProgress.bind(t),r.send(),r}},707:t=>{t.exports=function(t,e,i,s,r,n){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===s&&(s=""),void 0===r&&(r=0),void 0===n&&(n=!1),{responseType:t,async:e,user:i,password:s,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:n}}},4359:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},462:t=>{t.exports="addfile"},7297:t=>{t.exports="complete"},8660:t=>{t.exports="filecomplete"},6484:t=>{t.exports="filecomplete-"},7972:t=>{t.exports="loaderror"},1906:t=>{t.exports="load"},1441:t=>{t.exports="fileprogress"},1072:t=>{t.exports="postprocess"},1927:t=>{t.exports="progress"},6597:t=>{t.exports="start"},1179:(t,e,i)=>{t.exports={ADD:i(462),COMPLETE:i(7297),FILE_COMPLETE:i(8660),FILE_KEY_COMPLETE:i(6484),FILE_LOAD_ERROR:i(7972),FILE_LOAD:i(1906),FILE_PROGRESS:i(1441),POST_PROCESS:i(1072),PROGRESS:i(1927),START:i(6597)}},6732:(t,e,i)=>{var s=i(7473),r=i(4359),n=i(1593),a=i(9845),o=i(4597),h=i(2482),l=i(5593),c=new s({Extends:n,initialize:function t(e,i,s,r,a){var l,c="png";if(h(i)){var u=i;i=o(u,"key"),s=o(u,"url"),l=o(u,"normalMap"),r=o(u,"xhrSettings"),c=o(u,"extension",c),a=o(u,"frameConfig")}Array.isArray(s)&&(l=s[1],s=s[0]);var d={type:"image",cache:e.textureManager,extension:c,responseType:"blob",key:i,url:s,xhrSettings:r,config:a};if(n.call(this,e,d),l){var f=new t(e,this.key,l,r,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){n.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){n.revokeObjectURL(t.data),t.onProcessError()},n.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=r.FILE_PROCESSING,t===r.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=r.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=r.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t?t.state>=r.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(7473),r=i(4359),n=i(1593),a=i(9845),o=i(4597),h=i(5851),l=i(2482),c=new s({Extends:n,initialize:function(t,e,i,s,a){var c="json";if(l(e)){var u=e;e=o(u,"key"),i=o(u,"url"),s=o(u,"xhrSettings"),c=o(u,"extension",c),a=o(u,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:c,responseType:"text",key:e,url:i,xhrSettings:s,config:a};n.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=r.FILE_POPULATED)},onProcess:function(){if(this.state!==r.FILE_POPULATED){this.state=r.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,s){if(Array.isArray(t))for(var r=0;r{var s=i(7473),r=i(4359),n=i(1593),a=i(9845),o=i(4597),h=i(2482),l=new s({Extends:n,initialize:function(t,e,i,s){var r="text",a="txt",l=t.cacheManager.text;if(h(e)){var c=e;e=o(c,"key"),i=o(c,"url"),s=o(c,"xhrSettings"),a=o(c,"extension",a),r=o(c,"type",r),l=o(c,"cache",l)}var u={type:r,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:s};n.call(this,t,u)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{t.exports=function(t){for(var e=0,i=0;i{var s=i(3916);t.exports=function(t,e){return s(t)/s(e)/s(t-e)}},7025:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},48:t=>{t.exports=function(t,e,i,s,r){var n=.5*(s-e),a=.5*(r-i),o=t*t;return(2*i-2*s+n+a)*(t*o)+(-3*i+3*s-2*n-a)*o+n*t+i}},5035:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.ceil(t*s)/s}},2915:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},7149:(t,e,i)=>{var s=i(7425);t.exports=function(t){return t*s.DEG_TO_RAD}},2975:t=>{t.exports=function(t,e){return Math.abs(t-e)}},2107:(t,e,i)=>{var s=i(2915),r=i(7473),n=i(9652),a=i(1984),o=new n,h=new r({initialize:function t(e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=t.DefaultOrder),this._x=e,this._y=i,this._z=s,this._order=r,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,s){return void 0===s&&(s=this._order),this._x=t,this._y=e,this._z=i,this._order=s,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var r=t.val,n=r[0],a=r[4],o=r[8],h=r[1],l=r[5],c=r[9],u=r[2],d=r[6],f=r[10],p=0,g=0,m=0,x=.99999;switch(e){case"XYZ":g=Math.asin(s(o,-1,1)),Math.abs(o){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},104:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},4941:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s}},1555:(t,e,i)=>{var s=i(2915);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))+e}},5005:t=>{t.exports=function(t,e){return t/e/1e3}},3702:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},8820:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},1743:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},3416:t=>{t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},2149:(t,e,i)=>{var s=new(i(7473))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=l*n-a*h,u=-l*r+a*o,d=h*r-n*o,f=e*c+i*u+s*d;return f?(f=1/f,t[0]=c*f,t[1]=(-l*i+s*h)*f,t[2]=(a*i-s*n)*f,t[3]=u*f,t[4]=(l*e-s*o)*f,t[5]=(-a*e+s*r)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(n*e-i*r)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=n*l-a*h,t[1]=s*h-i*l,t[2]=i*a-s*n,t[3]=a*o-r*l,t[4]=e*l-s*o,t[5]=s*r-e*a,t[6]=r*h-n*o,t[7]=i*o-e*h,t[8]=e*n-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*n-a*h)+i*(-l*r+a*o)+s*(h*r-n*o)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=t.val,d=u[0],f=u[1],p=u[2],g=u[3],m=u[4],x=u[5],v=u[6],y=u[7],w=u[8];return e[0]=d*i+f*n+p*h,e[1]=d*s+f*a+p*l,e[2]=d*r+f*o+p*c,e[3]=g*i+m*n+x*h,e[4]=g*s+m*a+x*l,e[5]=g*r+m*o+x*c,e[6]=v*i+y*n+w*h,e[7]=v*s+y*a+w*l,e[8]=v*r+y*o+w*c,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*n,e[1]=l*s+h*a,e[2]=l*r+h*o,e[3]=l*n-h*i,e[4]=l*a-h*s,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,r=t.w,n=e+e,a=i+i,o=s+s,h=e*n,l=e*a,c=e*o,u=i*a,d=i*o,f=s*o,p=r*n,g=r*a,m=r*o,x=this.val;return x[0]=1-(u+f),x[3]=l+m,x[6]=c-g,x[1]=l-m,x[4]=1-(h+f),x[7]=d+p,x[2]=c+g,x[5]=d-p,x[8]=1-(h+u),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],x=e[14],v=e[15],y=s*h-r*o,w=s*l-n*o,b=s*c-a*o,A=r*l-n*h,M=r*c-a*h,E=n*c-a*l,S=u*m-d*g,T=u*x-f*g,I=u*v-p*g,C=d*x-f*m,R=d*v-p*m,k=f*v-p*x,F=y*k-w*R+b*C+A*I-M*T+E*S;return F?(F=1/F,i[0]=(h*k-l*R+c*C)*F,i[1]=(l*I-o*k-c*T)*F,i[2]=(o*R-h*I+c*S)*F,i[3]=(n*R-r*k-a*C)*F,i[4]=(s*k-n*I+a*T)*F,i[5]=(r*I-s*R-a*S)*F,i[6]=(m*E-x*M+v*A)*F,i[7]=(x*b-g*E-v*w)*F,i[8]=(g*M-m*b+v*y)*F,this):null}});t.exports=s},9652:(t,e,i)=>{var s=i(7473),r=i(5689),n=1e-6,a=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,r,n,a,o,h,l,c,u,d,f,p,g){var m=this.val;return m[0]=t,m[1]=e,m[2]=i,m[3]=s,m[4]=r,m[5]=n,m[6]=a,m[7]=o,m[8]=h,m[9]=l,m[10]=c,m[11]=u,m[12]=d,m[13]=f,m[14]=p,m[15]=g,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=o.fromQuat(i).val,r=e.x,n=e.y,a=e.z;return this.setValues(s[0]*r,s[1]*r,s[2]*r,0,s[4]*n,s[5]*n,s[6]*n,0,s[8]*a,s[9]*a,s[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],r=t[6],n=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=s,t[13]=n,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],g=t[14],m=t[15],x=e*a-i*n,v=e*o-s*n,y=e*h-r*n,w=i*o-s*a,b=i*h-r*a,A=s*h-r*o,M=l*p-c*f,E=l*g-u*f,S=l*m-d*f,T=c*g-u*p,I=c*m-d*p,C=u*m-d*g,R=x*C-v*I+y*T+w*S-b*E+A*M;return R?(R=1/R,this.setValues((a*C-o*I+h*T)*R,(s*I-i*C-r*T)*R,(p*A-g*b+m*w)*R,(u*b-c*A-d*w)*R,(o*S-n*C-h*E)*R,(e*C-s*S+r*E)*R,(g*y-f*A-m*v)*R,(l*A-u*y+d*v)*R,(n*I-a*S+h*M)*R,(i*S-e*I-r*M)*R,(f*b-p*y+m*x)*R,(c*y-l*b-d*x)*R,(a*E-n*T-o*M)*R,(e*T-i*E+s*M)*R,(p*v-f*w-g*x)*R,(l*w-c*v+u*x)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return this.setValues(a*(u*m-d*g)-c*(o*m-h*g)+p*(o*d-h*u),-(i*(u*m-d*g)-c*(s*m-r*g)+p*(s*d-r*u)),i*(o*m-h*g)-a*(s*m-r*g)+p*(s*h-r*o),-(i*(o*d-h*u)-a*(s*d-r*u)+c*(s*h-r*o)),-(n*(u*m-d*g)-l*(o*m-h*g)+f*(o*d-h*u)),e*(u*m-d*g)-l*(s*m-r*g)+f*(s*d-r*u),-(e*(o*m-h*g)-n*(s*m-r*g)+f*(s*h-r*o)),e*(o*d-h*u)-n*(s*d-r*u)+l*(s*h-r*o),n*(c*m-d*p)-l*(a*m-h*p)+f*(a*d-h*c),-(e*(c*m-d*p)-l*(i*m-r*p)+f*(i*d-r*c)),e*(a*m-h*p)-n*(i*m-r*p)+f*(i*h-r*a),-(e*(a*d-h*c)-n*(i*d-r*c)+l*(i*h-r*a)),-(n*(c*g-u*p)-l*(a*g-o*p)+f*(a*u-o*c)),e*(c*g-u*p)-l*(i*g-s*p)+f*(i*u-s*c),-(e*(a*g-o*p)-n*(i*g-s*p)+f*(i*o-s*a)),e*(a*u-o*c)-n*(i*u-s*c)+l*(i*o-s*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return(e*a-i*n)*(u*m-d*g)-(e*o-s*n)*(c*m-d*p)+(e*h-r*n)*(c*g-u*p)+(i*o-s*a)*(l*m-d*f)-(i*h-r*a)*(l*g-u*f)+(s*h-r*o)*(l*p-c*f)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=e[9],d=e[10],f=e[11],p=e[12],g=e[13],m=e[14],x=e[15],v=t.val,y=v[0],w=v[1],b=v[2],A=v[3];return e[0]=y*i+w*a+b*c+A*p,e[1]=y*s+w*o+b*u+A*g,e[2]=y*r+w*h+b*d+A*m,e[3]=y*n+w*l+b*f+A*x,y=v[4],w=v[5],b=v[6],A=v[7],e[4]=y*i+w*a+b*c+A*p,e[5]=y*s+w*o+b*u+A*g,e[6]=y*r+w*h+b*d+A*m,e[7]=y*n+w*l+b*f+A*x,y=v[8],w=v[9],b=v[10],A=v[11],e[8]=y*i+w*a+b*c+A*p,e[9]=y*s+w*o+b*u+A*g,e[10]=y*r+w*h+b*d+A*m,e[11]=y*n+w*l+b*f+A*x,y=v[12],w=v[13],b=v[14],A=v[15],e[12]=y*i+w*a+b*c+A*p,e[13]=y*s+w*o+b*u+A*g,e[14]=y*r+w*h+b*d+A*m,e[15]=y*n+w*l+b*f+A*x,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,r=i[0],n=i[4],a=i[8],o=i[12],h=i[1],l=i[5],c=i[9],u=i[13],d=i[2],f=i[6],p=i[10],g=i[14],m=i[3],x=i[7],v=i[11],y=i[15],w=s[0],b=s[4],A=s[8],M=s[12],E=s[1],S=s[5],T=s[9],I=s[13],C=s[2],R=s[6],k=s[10],F=s[14],L=s[3],P=s[7],O=s[11],Y=s[15];return this.setValues(r*w+n*E+a*C+o*L,h*w+l*E+c*C+u*L,d*w+f*E+p*C+g*L,m*w+x*E+v*C+y*L,r*b+n*S+a*R+o*P,h*b+l*S+c*R+u*P,d*b+f*S+p*R+g*P,m*b+x*S+v*R+y*P,r*A+n*T+a*k+o*O,h*A+l*T+c*k+u*O,d*A+f*T+p*k+g*O,m*A+x*T+v*k+y*O,r*M+n*I+a*F+o*Y,h*M+l*I+c*F+u*Y,d*M+f*I+p*F+g*Y,m*M+x*I+v*F+y*Y)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),r=1-i,n=t.x,a=t.y,o=t.z,h=r*n,l=r*a;return this.setValues(h*n+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*n,0,h*o-s*a,l*o+s*n,r*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,r=e.y,a=e.z,o=Math.sqrt(s*s+r*r+a*a);if(Math.abs(o){t.exports=function(t,e,i){return Math.min(t+e,i)}},44:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},5385:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},8585:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=e+1);var r=(t-e)/(i-e);return r>1?void 0!==s?(r=(s-t)/(s-i))<0&&(r=0):r=1:r<0&&(r=0),r}},372:(t,e,i)=>{var s=i(7473),r=i(2149),n=i(1984),a=i(5689),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),c=new a(1,0,0),u=new a(0,1,0),d=new a,f=new r,p=new s({initialize:function(t,e,i,s){this.onChangeCallback=n,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=s*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),r+e*(t.z-r),n+e*(t.w-n))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(c).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=f.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+r*n+i*o-s*a,i*h+r*a+s*n-e*o,s*h+r*o+e*a-i*n,r*h-e*n-i*a-s*o)},slerp:function(t,e){var i=this.x,s=this.y,r=this.z,n=this.w,a=t.x,h=t.y,l=t.z,c=t.w,u=i*a+s*h+r*l+n*c;u<0&&(u=-u,a=-a,h=-h,l=-l,c=-c);var d=1-e,f=e;if(1-u>o){var p=Math.acos(u),g=Math.sin(p);d=Math.sin((1-e)*p)/g,f=Math.sin(e*p)/g}return this.set(d*i+f*a,d*s+f*h,d*r+f*l,d*n+f*c)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s,n=r?1/r:0;return this.set(-t*n,-e*n,-i*n,s*n)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+r*n,i*a+s*n,s*a-i*n,r*a-e*n)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a-s*n,i*a+r*n,s*a+e*n,r*a-i*n)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*n,i*a-e*n,s*a+r*n,r*a-s*n)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,r=t.z/2,n=Math.cos(i),a=Math.cos(s),o=Math.cos(r),h=Math.sin(i),l=Math.sin(s),c=Math.sin(r);switch(t.order){case"XYZ":this.set(h*a*o+n*l*c,n*l*o-h*a*c,n*a*c+h*l*o,n*a*o-h*l*c,e);break;case"YXZ":this.set(h*a*o+n*l*c,n*l*o-h*a*c,n*a*c-h*l*o,n*a*o+h*l*c,e);break;case"ZXY":this.set(h*a*o-n*l*c,n*l*o+h*a*c,n*a*c+h*l*o,n*a*o-h*l*c,e);break;case"ZYX":this.set(h*a*o-n*l*c,n*l*o+h*a*c,n*a*c-h*l*o,n*a*o+h*l*c,e);break;case"YZX":this.set(h*a*o+n*l*c,n*l*o+h*a*c,n*a*c-h*l*o,n*a*o-h*l*c,e);break;case"XZY":this.set(h*a*o-n*l*c,n*l*o-h*a*c,n*a*c+h*l*o,n*a*o+h*l*c,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],r=i[4],n=i[8],a=i[1],o=i[5],h=i[9],l=i[2],c=i[6],u=i[10],d=s+o+u;return d>0?(e=.5/Math.sqrt(d+1),this.set((c-h)*e,(n-l)*e,(a-r)*e,.25/e)):s>o&&s>u?(e=2*Math.sqrt(1+s-o-u),this.set(.25*e,(r+a)/e,(n+l)/e,(c-h)/e)):o>u?(e=2*Math.sqrt(1+o-s-u),this.set((r+a)/e,.25*e,(h+c)/e,(n-l)/e)):(e=2*Math.sqrt(1+u-s-o),this.set((n+l)/e,(h+c)/e,.25*e,(a-r)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var n=h[r],a=h[n];e=Math.sqrt(i[3*r+r]-i[3*n+n]-i[3*a+a]+1),l[r]=.5*e,e=.5/e,l[n]=(i[3*n+r]+i[3*r+n])*e,l[a]=(i[3*a+r]+i[3*r+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+n]-i[3*n+a])*e}return this.onChangeCallback(this),this}});t.exports=p},4208:(t,e,i)=>{var s=i(7425);t.exports=function(t){return t*s.RAD_TO_DEG}},1705:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},6650:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,r=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=s*e,t}},2037:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},6283:t=>{t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},9876:t=>{t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x-e,o=t.y-i;return t.x=a*r-o*n+e,t.y=a*n+o*r+i,t}},8348:t=>{t.exports=function(t,e,i,s,r){var n=s+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},4497:t=>{t.exports=function(t,e,i,s,r){return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},9640:(t,e,i)=>{var s=i(5689),r=i(9652),n=i(372),a=new r,o=new n,h=new s;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},4078:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},855:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},4936:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1),s*=Math.PI/t;for(var r=[],n=[],a=0;a{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},278:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},163:(t,e,i)=>{var s=i(2529);t.exports=function(t,e,i,r){void 0===r&&(r=new s);var n=0,a=0;return t>0&&t<=e*i&&(n=t>e-1?t-(a=Math.floor(t/e))*e:t),r.set(n,a)}},7556:(t,e,i)=>{var s=i(2529);t.exports=function(t,e,i,r,n,a,o,h){void 0===h&&(h=new s);var l=Math.sin(n),c=Math.cos(n),u=c*a,d=l*a,f=-l*o,p=c*o,g=1/(u*p+f*-d);return h.x=p*g*t+-f*g*e+(r*f-i*p)*g,h.y=u*g*e+-d*g*t+(-r*u+i*d)*g,h}},2529:(t,e,i)=>{var s=i(7473),r=i(12),n=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new n(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return r(this.x,t.x,e)&&r(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});n.ZERO=new n,n.RIGHT=new n(1,0),n.LEFT=new n(-1,0),n.UP=new n(0,-1),n.DOWN=new n(0,1),n.ONE=new n(1,1),t.exports=n},5689:(t,e,i)=>{var s=new(i(7473))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,r=t.z,n=e.x,a=e.y,o=e.z;return this.x=s*o-r*a,this.y=r*n-i*o,this.z=i*a-s*n,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z;return this.x=i*a-s*n,this.y=s*r-e*a,this.z=e*n-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*n,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*n,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*n,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+s*r[6],this.y=e*r[1]+i*r[4]+s*r[7],this.z=e*r[2]+i*r[5]+s*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12],this.y=r[1]*e+r[5]*i+r[9]*s+r[13],this.z=r[2]*e+r[6]*i+r[10]*s+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=e*r[0]+i*r[4]+s*r[8]+r[12],a=e*r[1]+i*r[5]+s*r[9]+r[13],o=e*r[2]+i*r[6]+s*r[10]+r[14],h=e*r[3]+i*r[7]+s*r[11]+r[15];return this.x=n/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,c=o*s+r*i-n*e,u=-r*e-n*i-a*s;return this.x=h*o+u*-r+l*-a-c*-n,this.y=l*o+u*-n+c*-r-h*-a,this.z=c*o+u*-a+h*-n-l*-r,this},project:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=r[0],a=r[1],o=r[2],h=r[3],l=r[4],c=r[5],u=r[6],d=r[7],f=r[8],p=r[9],g=r[10],m=r[11],x=r[12],v=r[13],y=r[14],w=1/(e*h+i*d+s*m+r[15]);return this.x=(e*n+i*l+s*f+x)*w,this.y=(e*a+i*c+s*p+v)*w,this.z=(e*o+i*u+s*g+y)*w,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,r=t.z,n=t.w,a=this.x-i,o=n-this.y-1-s,h=this.z;return this.x=2*a/r-1,this.y=2*o/n-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},9279:(t,e,i)=>{var s=new(i(7473))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=s*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this.w=n+e*(t.w-n),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+s*s+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12]*r,this.y=n[1]*e+n[5]*i+n[9]*s+n[13]*r,this.z=n[2]*e+n[6]*i+n[10]*s+n[14]*r,this.w=n[3]*e+n[7]*i+n[11]*s+n[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,c=o*s+r*i-n*e,u=-r*e-n*i-a*s;return this.x=h*o+u*-r+l*-a-c*-n,this.y=l*o+u*-n+c*-r-h*-a,this.z=c*o+u*-a+h*-n-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},4119:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},8445:t=>{t.exports=function(t,e,i){if(t>=e&&t<=i)return t;var s=i-e;return e+((t-e)%s+s)%s}},6412:t=>{t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},760:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},6909:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},6947:t=>{t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},3426:(t,e,i)=>{var s=i(7425);t.exports=function(t){return t>Math.PI&&(t-=s.PI2),Math.abs(((t+s.TAU)%s.PI2-s.PI2)%s.PI2)}},6906:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},3270:(t,e,i)=>{var s=i(104);t.exports=function(){return s(-Math.PI,Math.PI)}},2748:(t,e,i)=>{var s=i(104);t.exports=function(){return s(-180,180)}},936:(t,e,i)=>{var s=i(6906);t.exports=function(t){return s(t+Math.PI)}},1935:(t,e,i)=>{var s=i(7425);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},3692:(t,e,i)=>{var s=i(8445);t.exports=function(t){return s(t,-Math.PI,Math.PI)}},2820:(t,e,i)=>{var s=i(8445);t.exports=function(t){return s(t,-180,180)}},1833:(t,e,i)=>{t.exports={Between:i(6412),BetweenPoints:i(760),BetweenPointsY:i(6909),BetweenY:i(6947),CounterClockwise:i(3426),Normalize:i(6906),Random:i(3270),RandomDegrees:i(2748),Reverse:i(936),RotateTo:i(1935),ShortestBetween:i(5393),Wrap:i(3692),WrapDegrees:i(2820)}},7425:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},1518:t=>{t.exports=function(t,e,i,s){var r=t-i,n=e-s;return Math.sqrt(r*r+n*n)}},5372:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}},4430:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}},4361:t=>{t.exports=function(t,e,i,s){return Math.max(Math.abs(t-i),Math.abs(e-s))}},7798:t=>{t.exports=function(t,e,i,s,r){return void 0===r&&(r=2),Math.sqrt(Math.pow(i-t,r)+Math.pow(s-e,r))}},8290:t=>{t.exports=function(t,e,i,s){return Math.abs(t-i)+Math.abs(e-s)}},3788:t=>{t.exports=function(t,e,i,s){var r=t-i,n=e-s;return r*r+n*n}},6338:(t,e,i)=>{t.exports={Between:i(1518),BetweenPoints:i(5372),BetweenPointsSquared:i(4430),Chebyshev:i(4361),Power:i(7798),Snake:i(8290),Squared:i(3788)}},5751:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},6203:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},9103:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},4938:(t,e,i)=>{t.exports={In:i(5751),Out:i(9103),InOut:i(6203)}},8677:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},4649:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},504:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},8872:(t,e,i)=>{t.exports={In:i(8677),Out:i(504),InOut:i(4649)}},3170:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},2627:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},1349:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},5006:(t,e,i)=>{t.exports={In:i(3170),Out:i(1349),InOut:i(2627)}},6046:t=>{t.exports=function(t){return t*t*t}},9531:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},4836:t=>{t.exports=function(t){return--t*t*t+1}},875:(t,e,i)=>{t.exports={In:i(6046),Out:i(4836),InOut:i(9531)}},7619:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},7437:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+1}},8119:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/i)+1}},2884:(t,e,i)=>{t.exports={In:i(7619),Out:i(8119),InOut:i(7437)}},5456:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},3461:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},2711:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},6287:(t,e,i)=>{t.exports={In:i(5456),Out:i(2711),InOut:i(3461)}},8613:(t,e,i)=>{t.exports={Back:i(4938),Bounce:i(8872),Circular:i(5006),Cubic:i(875),Elastic:i(2884),Expo:i(6287),Linear:i(4233),Quadratic:i(6341),Quartic:i(762),Quintic:i(345),Sine:i(8698),Stepped:i(7051)}},744:t=>{t.exports=function(t){return t}},4233:(t,e,i)=>{t.exports=i(744)},9810:t=>{t.exports=function(t){return t*t}},8163:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},6123:t=>{t.exports=function(t){return t*(2-t)}},6341:(t,e,i)=>{t.exports={In:i(9810),Out:i(6123),InOut:i(8163)}},7337:t=>{t.exports=function(t){return t*t*t*t}},4878:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},9012:t=>{t.exports=function(t){return 1- --t*t*t*t}},762:(t,e,i)=>{t.exports={In:i(7337),Out:i(9012),InOut:i(4878)}},303:t=>{t.exports=function(t){return t*t*t*t*t}},553:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},1632:t=>{t.exports=function(t){return--t*t*t*t*t+1}},345:(t,e,i)=>{t.exports={In:i(303),Out:i(1632),InOut:i(553)}},8455:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},1844:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},990:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},8698:(t,e,i)=>{t.exports={In:i(8455),Out:i(990),InOut:i(1844)}},6745:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},7051:(t,e,i)=>{t.exports=i(6745)},3158:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},12:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},7373:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},2622:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(3158),Equal:i(12),Floor:i(1326),GreaterThan:i(7373),LessThan:i(2622)}},4675:(t,e,i)=>{var s=i(7425),r=i(1030),n={Angle:i(1833),Distance:i(6338),Easing:i(8613),Fuzzy:i(7927),Interpolation:i(2140),Pow2:i(7897),Snap:i(3943),RandomDataGenerator:i(6957),Average:i(3136),Bernstein:i(785),Between:i(7025),CatmullRom:i(48),CeilTo:i(5035),Clamp:i(2915),DegToRad:i(7149),Difference:i(2975),Euler:i(2107),Factorial:i(3916),FloatBetween:i(104),FloorTo:i(4941),FromPercent:i(1555),GetSpeed:i(5005),IsEven:i(3702),IsEvenStrict:i(8820),Linear:i(1743),LinearXY:i(3416),MaxAdd:i(3733),Median:i(44),MinSub:i(5385),Percent:i(8585),RadToDeg:i(4208),RandomXY:i(1705),RandomXYZ:i(6650),RandomXYZW:i(2037),Rotate:i(6283),RotateAround:i(9876),RotateAroundDistance:i(8348),RotateTo:i(4497),RoundAwayFromZero:i(4078),RoundTo:i(855),SinCosTableGenerator:i(4936),SmootherStep:i(278),SmoothStep:i(2733),ToXY:i(163),TransformXY:i(7556),Within:i(4119),Wrap:i(8445),Vector2:i(2529),Vector3:i(5689),Vector4:i(9279),Matrix3:i(2149),Matrix4:i(9652),Quaternion:i(372),RotateVec3:i(9640)};n=r(!1,n,s),t.exports=n},1640:(t,e,i)=>{var s=i(785);t.exports=function(t,e){for(var i=0,r=t.length-1,n=0;n<=r;n++)i+=Math.pow(1-e,r-n)*Math.pow(e,n)*t[n]*s(r,n);return i}},6105:(t,e,i)=>{var s=i(48);t.exports=function(t,e){var i=t.length-1,r=i*e,n=Math.floor(r);return t[0]===t[i]?(e<0&&(n=Math.floor(r=i*(1+e))),s(r-n,t[(n-1+i)%i],t[n],t[(n+1)%i],t[(n+2)%i])):e<0?t[0]-(s(-r,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(s(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(r-n,t[n?n-1:0],t[n],t[i{t.exports=function(t,e,i,s,r){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,r)}},6765:(t,e,i)=>{var s=i(1743);t.exports=function(t,e){var i=t.length-1,r=i*e,n=Math.floor(r);return e<0?s(t[0],t[1],r):e>1?s(t[i],t[i-1],i-r):s(t[n],t[n+1>i?i:n+1],r-n)}},6388:t=>{t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},5735:(t,e,i)=>{var s=i(2733);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},8705:(t,e,i)=>{var s=i(278);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},2140:(t,e,i)=>{t.exports={Bezier:i(1640),CatmullRom:i(6105),CubicBezier:i(4002),Linear:i(6765),QuadraticBezier:i(6388),SmoothStep:i(5735),SmootherStep:i(8705)}},5443:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},167:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},7897:(t,e,i)=>{t.exports={GetNext:i(5443),IsSize:i(725),IsValue:i(167)}},6957:(t,e,i)=>{var s=new(i(7473))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},5659:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},5461:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},5131:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},3943:(t,e,i)=>{t.exports={Ceil:i(5659),Floor:i(5461),To:i(5131)}},8666:(t,e,i)=>{var s=new(i(7473))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},8456:t=>{var e={},i={},s={register:function(t,i,s,r){void 0===r&&(r=!1),e[t]={plugin:i,mapping:s,custom:r}},registerCustom:function(t,e,s,r){i[t]={plugin:e,mapping:s,data:r}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=s},5722:(t,e,i)=>{var s=i(8666),r=i(7473),n=i(204),a=new r({Extends:s,initialize:function(t,e,i){s.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(n.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},8351:t=>{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},8196:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},3527:t=>{t.exports="resize"},8618:t=>{t.exports="addedtoscene"},4328:t=>{t.exports="boot"},6099:t=>{t.exports="create"},7645:t=>{t.exports="destroy"},2710:t=>{t.exports="pause"},2547:t=>{t.exports="postupdate"},8577:t=>{t.exports="prerender"},8197:t=>{t.exports="preupdate"},8997:t=>{t.exports="ready"},7604:t=>{t.exports="removedfromscene"},8999:t=>{t.exports="render"},9742:t=>{t.exports="resume"},3667:t=>{t.exports="shutdown"},3468:t=>{t.exports="sleep"},7840:t=>{t.exports="start"},9896:t=>{t.exports="transitioncomplete"},5103:t=>{t.exports="transitioninit"},3162:t=>{t.exports="transitionout"},7841:t=>{t.exports="transitionstart"},6454:t=>{t.exports="transitionwake"},6536:t=>{t.exports="update"},3875:t=>{t.exports="wake"},204:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(8618),BOOT:i(4328),CREATE:i(6099),DESTROY:i(7645),PAUSE:i(2710),POST_UPDATE:i(2547),PRE_RENDER:i(8577),PRE_UPDATE:i(8197),READY:i(8997),REMOVED_FROM_SCENE:i(7604),RENDER:i(8999),RESUME:i(9742),SHUTDOWN:i(3667),SLEEP:i(3468),START:i(7840),TRANSITION_COMPLETE:i(9896),TRANSITION_INIT:i(5103),TRANSITION_OUT:i(3162),TRANSITION_START:i(7841),TRANSITION_WAKE:i(6454),UPDATE:i(6536),WAKE:i(3875)}},2362:(t,e,i)=>{var s=i(7473),r=i(2915),n=i(1030),a=new s({initialize:function(t,e,i,s,r,n,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(n,a,s,r)},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.cutX=i,this.cutY=s,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var r=this.data,n=r.cut;n.x=i,n.y=s,n.w=t,n.h=e,n.r=i+t,n.b=s+e,r.sourceSize.w=t,r.sourceSize.h=e,r.spriteSourceSize.w=t,r.spriteSourceSize.h=e,r.radius=.5*Math.sqrt(t*t+e*e);var a=r.drawImage;return a.x=i,a.y=s,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,s,r,n){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=s,o.w=r,o.h=n,o.r=i+r,o.b=s+n,this.x=i,this.y=s,this.width=r,this.height=n,this.halfWidth=.5*r,this.halfHeight=.5*n,this.centerX=Math.floor(r/2),this.centerY=Math.floor(n/2),this.updateUVs()},setCropUVs:function(t,e,i,s,n,a,o){var h=this.cutX,l=this.cutY,c=this.cutWidth,u=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=r(e,0,d)),g=l+(i=r(i,0,f)),m=s=r(s,0,d-e),x=n=r(n,0,f-i),v=this.data;if(v.trim){var y=v.spriteSourceSize,w=e+(s=r(s,0,c-e)),b=i+(n=r(n,0,u-i));if(!(y.rw||y.y>b)){var A=Math.max(y.x,e),M=Math.max(y.y,i),E=Math.min(y.r,w)-A,S=Math.min(y.b,b)-M;m=E,x=S,p=a?h+(c-(A-y.x)-E):h+(A-y.x),g=o?l+(u-(M-y.y)-S):l+(M-y.y),e=A,i=M,s=E,n=S}else p=0,g=0,m=0,x=0}else a&&(p=h+(c-e-s)),o&&(g=l+(u-i-n));var T=this.source.width,I=this.source.height;return t.u0=Math.max(0,p/T),t.v0=Math.max(0,g/I),t.u1=Math.min(1,(p+m)/T),t.v1=Math.min(1,(g+x)/I),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=m,t.ch=x,t.width=s,t.height=n,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,r,n){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=s,this.u1=r,this.v1=n,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=s;var n=this.source.width,a=this.source.height;return this.u0=t/n,this.v0=e/a,this.u1=(t+i)/n,this.v1=(e+s)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=n(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},1864:t=>{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},3747:t=>{t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},7473:t=>{function e(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,s,r,a){for(var o in s)if(s.hasOwnProperty(o)){var h=e(s,o,r);if(!1!==h){if(i((a||t).prototype,o)){if(n.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=s[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},1792:t=>{t.exports=function(t,e,i,s,r){if(void 0===r&&(r=t),i>0){var n=i-t.length;if(n<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>n&&(e.splice(n),a=n);for(var o=0;o{t.exports=function(t,e,i,s,r,n){if(void 0===i&&(i=0),void 0===n&&(n=t),s>0){var a=s-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),r&&r.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;s>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),r&&r.call(n,l)}return e}},2513:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var s=i(2497);t.exports=function(t,e,i,r,n){void 0===r&&(r=0),void 0===n&&(n=t.length);var a=0;if(s(t,r,n))for(var o=r;o{t.exports=function(t,e,i){var s,r=[null];for(s=3;s{var s=i(2497);t.exports=function(t,e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=t.length),s(t,r,n)){var a,o=[null];for(a=5;a{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var s,r,n=1;if(i){if(te.length&&(n=e.length),i?(s=e[n-1][i],(r=e[n][i])-t<=t-s?e[n]:e[n-1]):(s=e[n-1],(r=e[n])-t<=t-s?r:s)}},4493:t=>{var e=function(t,i){void 0===i&&(i=[]);for(var s=0;s{var s=i(2497);t.exports=function(t,e,i,r,n){void 0===r&&(r=0),void 0===n&&(n=t.length);var a=[];if(s(t,r,n))for(var o=r;o{var s=i(2497);t.exports=function(t,e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=t.length),s(t,r,n))for(var a=r;a{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return void 0===t[s]?null:t[s]}},8683:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return s>r||(t.splice(s,1),r===t.length-1?t.push(e):t.splice(r,0,e)),t}},546:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return s{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var s=t[i-1],r=t.indexOf(s);t[i]=s,t[r]=e}return t}},1419:t=>{t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},6512:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,s){var r,n=[],a=!1;if((i||s)&&(a=!0,i||(i=""),s||(s="")),e=e;r--)a?n.push(i+r.toString()+s):n.push(r);else for(r=t;r<=e;r++)a?n.push(i+r.toString()+s):n.push(r);return n}},1316:(t,e,i)=>{var s=i(4078);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var r=[],n=Math.max(s((e-t)/(i||1)),0),a=0;a{function e(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function i(t,e){return te?1:0}var s=function(t,r,n,a,o){for(void 0===n&&(n=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>n;){if(a-n>600){var h=a-n+1,l=r-n+1,c=Math.log(h),u=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*u*(h-u)/h)*(l-h/2<0?-1:1),f=Math.max(n,Math.floor(r-l*u/h+d)),p=Math.min(a,Math.floor(r+(h-l)*u/h+d));s(t,r,f,p,o)}var g=t[r],m=n,x=a;for(e(t,n,r),o(t[a],g)>0&&e(t,n,a);m0;)x--}0===o(t[n],g)?e(t,n,x):e(t,++x,a),x<=r&&(n=x+1),r<=x&&(a=x-1)}};t.exports=s},9703:(t,e,i)=>{var s=i(5851),r=i(4912),n=function(t,e,i){for(var s=[],r=0;r{var s=i(8935);t.exports=function(t,e,i,r){var n;if(void 0===r&&(r=t),!Array.isArray(e))return-1!==(n=t.indexOf(e))?(s(t,n),i&&i.call(r,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(n=t.indexOf(h))&&(s(t,n),o.push(h),i&&i.call(r,h)),a--}return o}},4725:(t,e,i)=>{var s=i(8935);t.exports=function(t,e,i,r){if(void 0===r&&(r=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var n=s(t,e);return i&&i.call(r,n),n}},8780:(t,e,i)=>{var s=i(2497);t.exports=function(t,e,i,r,n){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===n&&(n=t),s(t,e,i)){var a=i-e,o=t.splice(e,a);if(r)for(var h=0;h{var s=i(8935);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*i);return s(t,r)}},6960:t=>{t.exports=function(t,e,i){var s=t.indexOf(e),r=t.indexOf(i);return-1!==s&&-1===r&&(t[s]=i,!0)}},1021:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e,i,s){var r=t.length;if(e<0||e>r||e>=i||i>r){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},5361:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},3718:(t,e,i)=>{var s=i(2497);t.exports=function(t,e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=t.length),s(t,r,n))for(var a=r;a{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},2071:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},8935:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],r=e;r{var s=i(9356);function r(t,e){return String(t).localeCompare(e)}function n(t,e,i,s){var r,n,a,o,h,l=t.length,c=0,u=2*i;for(r=0;rl&&(n=l),a>l&&(a=l),o=r,h=n;;)if(o{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return t[s]=i,t[r]=e,t}},1953:(t,e,i)=>{t.exports={Matrix:i(1237),Add:i(1792),AddAt:i(2280),BringToTop:i(2513),CountAllMatching:i(1771),Each:i(7883),EachInRange:i(5856),FindClosestInSorted:i(3957),Flatten:i(4493),GetAll:i(6245),GetFirst:i(1647),GetRandom:i(5301),MoveDown:i(1842),MoveTo:i(1419),MoveUp:i(6512),MoveAbove:i(8683),MoveBelow:i(546),NumberArray:i(4130),NumberArrayStep:i(1316),QuickSelect:i(9465),Range:i(9703),Remove:i(7161),RemoveAt:i(4725),RemoveBetween:i(8780),RemoveRandomElement:i(5744),Replace:i(6960),RotateLeft:i(1021),RotateRight:i(4027),SafeRange:i(2497),SendToBack:i(5361),SetAll:i(3718),Shuffle:i(4912),SortByDigits:i(2071),SpliceOne:i(8935),StableSort:i(9992),Swap:i(2372)}},1816:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var s=i(7222),r=i(1816);t.exports=function(t){var e="";if(!r(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},6063:t=>{t.exports=function(t){for(var e=0;e{var s=i(7116);t.exports=function(t){return s(t,180)}},2597:(t,e,i)=>{var s=i(7116);t.exports=function(t){return s(t,90)}},7116:(t,e,i)=>{var s=i(1816),r=i(4780);t.exports=function(t,e){if(void 0===e&&(e=90),!s(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=r(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=r(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var s=i(7116);t.exports=function(t){return s(t,-90)}},7711:(t,e,i)=>{var s=i(1021),r=i(4027);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?s(t,Math.abs(i)):r(t,i)),0!==e)for(var n=0;n{t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),r=0;r-1;n--)s[r][n]=t[n][r]}return s}},1237:(t,e,i)=>{t.exports={CheckMatrix:i(1816),MatrixToString:i(6655),ReverseColumns:i(582),ReverseRows:i(6063),Rotate180:i(8321),RotateLeft:i(2597),RotateMatrix:i(7116),RotateRight:i(6285),Translate:i(7711),TransposeMatrix:i(4780)}},3911:t=>{var e=function(t){var i,s,r;if("object"!=typeof t||null===t)return t;for(r in i=Array.isArray(t)?[]:{},t)s=t[r],i[r]=e(s);return i};t.exports=e},1030:(t,e,i)=>{var s=i(2482),r=function(){var t,e,i,n,a,o,h=arguments[0]||{},l=1,c=arguments.length,u=!1;for("boolean"==typeof h&&(u=h,h=arguments[1]||{},l=2),c===l&&(h=this,--l);l{var s=i(4675),r=i(5851);t.exports=function(t,e,i){var n=r(t,e,null);if(null===n)return i;if(Array.isArray(n))return s.RND.pick(n);if("object"==typeof n){if(n.hasOwnProperty("randInt"))return s.RND.integerInRange(n.randInt[0],n.randInt[1]);if(n.hasOwnProperty("randFloat"))return s.RND.realInRange(n.randFloat[0],n.randFloat[1])}else if("function"==typeof n)return n(e);return n}},4597:t=>{t.exports=function(t,e,i){var s=typeof t;return t&&"number"!==s&&"string"!==s&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},5851:t=>{t.exports=function(t,e,i,s){if(!t&&!s||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(s&&s.hasOwnProperty(e))return s[e];if(-1!==e.indexOf(".")){for(var r=e.split("."),n=t,a=s,o=i,h=i,l=!0,c=!0,u=0;u{t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},7222:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===s&&(s=3);var r=0;if(e+1>=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var n=Math.ceil((r=e-t.length)/2);t=new Array(r-n+1).join(i)+t+new Array(n+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}}},e={};var i=function i(s){var r=e[s];if(void 0!==r)return r.exports;var n=e[s]={exports:{}};return t[s](n,n.exports,i),n.exports}(4513);window.SpinePlugin=i})(); \ No newline at end of file